/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
switch (rReq.GetSlot())
{ case FN_DRAWTEXT_ATTR_DLG:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, pView)); auto xRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync(
[pDlg, xRequest=std::move(xRequest), pView, pSh] (sal_Int32 nResult)->void
{ if (nResult == RET_OK)
{ if (pView->GetMarkedObjectList().GetMarkCount() != 0)
{
pSh->StartAction();
pView->SetAttributes(*pDlg->GetOutputItemSet()); auto vMarkedObjs = pView->GetMarkedObjects(); for (auto pObj : vMarkedObjs)
{ // If the shape has textframe, set its params as well. if (SwTextBoxHelper::hasTextFrame(pObj))
SwTextBoxHelper::updateTextBoxMargin(pObj);
}
xRequest->Done(*(pDlg->GetOutputItemSet()));
pSh->EndAction();
}
}
pDlg->disposeOnce();
}
);
} break;
case SID_MEASURE_DLG:
{ bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0;
if (pArgs)
{ if(pView->GetMarkedObjectList().GetMarkCount() != 0)
{
std::unique_ptr<SfxItemSet> pNewArgs = pArgs->Clone();
lcl_convertStringArguments(pNewArgs);
pView->SetAttrToMarked(*pNewArgs, false);
} else
pView->SetDefaultAttr(*rReq.GetArgs(), false);
} else
{
SfxDispatcher* pDis = pSh->GetView().GetViewFrame().GetDispatcher(); switch (rReq.GetSlot())
{ case SID_ATTR_FILL_STYLE: case SID_ATTR_FILL_COLOR: case SID_ATTR_FILL_GRADIENT: case SID_ATTR_FILL_HATCH: case SID_ATTR_FILL_BITMAP: case SID_ATTR_FILL_TRANSPARENCE: case SID_ATTR_FILL_FLOATTRANSPARENCE:
pDis->Execute(SID_ATTRIBUTES_AREA); break; case SID_ATTR_LINE_STYLE: case SID_ATTR_LINE_DASH: case SID_ATTR_LINE_WIDTH: case SID_ATTR_LINE_COLOR: case SID_ATTR_LINE_TRANSPARENCE: case SID_ATTR_LINE_JOINT: case SID_ATTR_LINE_CAP:
pDis->Execute(SID_ATTRIBUTES_LINE); break;
}
} if (pView->GetModel().IsChanged())
GetShell().SetModified(); else if (bChanged)
pView->GetModel().SetChanged();
}
staticvoid lcl_unifyFillTransparencyItems(const SfxItemSet& rSet)
{ // Transparent fill options are None, Solid, Linear, Axial, Radial, Elliptical, Square, Rectangular. // But this is represented across two items namely XFillTransparenceItem (for None and Solid) // and XFillFloatTransparenceItem (for the rest). To simplify the representation in LOKit case let's // use XFillFloatTransparenceItem to carry the information of XFillTransparenceItem when gradients // are disabled. When gradient transparency is disabled, all fields of XFillFloatTransparenceItem are invalid // and not used. So convert XFillTransparenceItem's constant transparency percentage as an intensity // and assign this to the XFillFloatTransparenceItem's start-intensity and end-intensity fields. // Now the LOK clients need only listen to statechange messages of XFillFloatTransparenceItem // to get fill-transparency settings instead of listening to two separate items.
XFillFloatTransparenceItem* pFillFloatTranspItem = const_cast<XFillFloatTransparenceItem*>
(rSet.GetItem<XFillFloatTransparenceItem>(XATTR_FILLFLOATTRANSPARENCE)); if (!pFillFloatTranspItem || pFillFloatTranspItem->IsEnabled()) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.