/* -*- 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 .
*/
OUString aCmdSub; if (aCmd.startsWith(".uno:"))
{
aCmdSub = aCmd.subView(5);
} else
{
lcl_LogWarning("FillApi SlideCmd: uno command not recognized'" + rText + "'"); return;
}
// Check if the uno command is allowed const std::map<std::u16string_view, KitUnoCommand>& rUnoCommandList
= GetKitUnoCommandList(); auto aCmdData = rUnoCommandList.find(aCmdSub); if (aCmdData != rUnoCommandList.end())
{ // Make the uno command synchron
aArg.push_back(comphelper::makePropertyValue("SynchronMode", true));
// Todo: check why it does not work on my windows system
comphelper::dispatchCommand(aCmd, comphelper::containerToSequence(aArg));
} else
{
lcl_LogWarning("FillApi SlideCmd: uno command not recognized'" + rText + "'");
}
}
}
for (editeng::Section const & rSection : rSections)
{ // Insert new paragraph if needed while (nCurrentParagraph < rSection.mnParagraph)
{
nCurrentParagraph++; // Get Weight of current paragraph
OUString sWeightProperty = getWeightString(rEditText.GetParaAttribs(nCurrentParagraph)); // Insert new paragraph into collection
m_aResults.emplace_back(svx::ClassificationType::PARAGRAPH, sWeightProperty, sBlank, sBlank);
}
// Search for a custom property field that has the classification category identifier key if (hasCustomPropertyField(aSections, m_aKeyCreator.makeCategoryNameKey()))
{
iterateSectionsAndCollect(aSections, rEditText); return;
}
}
}
}
}
}
};
class ClassificationInserter : public ClassificationCommon
{ private: /// Delete the previous existing classification object(s) - if they exist void deleteExistingObjects()
{
OUString sKey = m_aKeyCreator.makeCategoryNameKey();
// Apply properties from the BA policy for (svx::ClassificationResult const & rResult : rResults)
{ if (rResult.meType == svx::ClassificationType::CATEGORY)
aHelper.SetBACName(rResult.msName, SfxClassificationHelper::getPolicyType());
}
// Insert full text as document property
svx::classification::insertFullTextualRepresentationAsDocumentProperty(m_xPropertyContainer, m_aKeyCreator, rResults);
// Create the outliner from the
Outliner* pOutliner = m_rDrawViewShell.GetDoc()->GetInternalOutliner();
OutlinerMode eOutlinerMode = pOutliner->GetOutlinerMode();
// Fill the outliner with the text from classification result
fillTheOutliner(pOutliner, rResults);
// Calculate to outliner text size
pOutliner->UpdateFields();
pOutliner->SetUpdateLayout(true);
Size aTextSize(pOutliner->CalcTextSize());
pOutliner->SetUpdateLayout(false);
// Create objects, apply the outliner and add them (objects) to all master pages const sal_uInt16 nCount = m_rDrawViewShell.GetDoc()->GetMasterSdPageCount(PageKind::Standard);
for (sal_uInt16 nPageIndex = 0; nPageIndex < nCount; ++nPageIndex)
{
SdPage* pMasterPage = m_rDrawViewShell.GetDoc()->GetMasterSdPage(nPageIndex, PageKind::Standard); if (!pMasterPage) continue;
rtl::Reference<SdrRectObj> pObject = new SdrRectObj(
*m_rDrawViewShell.GetDoc(), // TTTT should be reference
SdrObjKind::Text);
pObject->SetMergedItem(makeSdrTextAutoGrowWidthItem(true));
pObject->SetOutlinerParaObject(pOutliner->CreateParaObject());
pMasterPage->InsertObject(pObject.get());
// Calculate position
::tools::Rectangle aRectangle(Point(), pMasterPage->GetSize());
Point aPosition(aRectangle.Center().X(), aRectangle.Bottom());
if (!bSet)
{ //If we are turning on AutoFit we have to turn these off if already on if (pObj->GetMergedItemSet().GetItem<SdrOnOffItem>(SDRATTR_TEXT_AUTOGROWHEIGHT)->GetValue())
pObj->SetMergedItem(makeSdrTextAutoGrowHeightItem(false)); if (pObj->GetMergedItemSet().GetItem<SdrOnOffItem>(SDRATTR_TEXT_AUTOGROWWIDTH)->GetValue())
pObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(false));
}
// area and line attributes: shall have // an own Execute method (like StateMethode) 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_SHADOW: case SID_ATTR_SHADOW_COLOR: case SID_ATTR_SHADOW_TRANSPARENCE: case SID_ATTR_SHADOW_BLUR: case SID_ATTR_SHADOW_XDISTANCE: case SID_ATTR_SHADOW_YDISTANCE: case SID_ATTR_FILL_USE_SLIDE_BACKGROUND: case SID_ATTR_FILL_TRANSPARENCE: case SID_ATTR_FILL_FLOATTRANSPARENCE:
case SID_ATTR_LINE_STYLE: case SID_ATTR_LINE_DASH: case SID_ATTR_LINE_WIDTH: case SID_ATTR_LINE_COLOR: case SID_ATTR_LINEEND_STYLE: case SID_ATTR_LINE_START: case SID_ATTR_LINE_END: case SID_ATTR_LINE_TRANSPARENCE: case SID_ATTR_LINE_JOINT: case SID_ATTR_LINE_CAP:
case SID_ATTR_TEXT_FITTOSIZE:
{ if( rReq.GetArgs() )
{
std::unique_ptr<SfxItemSet> pNewArgs = rReq.GetArgs()->Clone();
lcl_convertStringArguments(nSId, pNewArgs);
mpDrawView->SetAttributes(*pNewArgs);
rReq.Done();
} else
{ switch( rReq.GetSlot() )
{ case SID_ATTR_FILL_SHADOW: case SID_ATTR_SHADOW_COLOR: case SID_ATTR_SHADOW_TRANSPARENCE: case SID_ATTR_SHADOW_BLUR: case SID_ATTR_SHADOW_XDISTANCE: case SID_ATTR_SHADOW_YDISTANCE: 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_USE_SLIDE_BACKGROUND: case SID_ATTR_FILL_TRANSPARENCE: case SID_ATTR_FILL_FLOATTRANSPARENCE:
GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_AREA, SfxCallMode::ASYNCHRON ); 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:
GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_LINE, SfxCallMode::ASYNCHRON ); break; case SID_ATTR_TEXT_FITTOSIZE:
GetViewFrame()->GetDispatcher()->Execute( SID_TEXTATTR_DLG, SfxCallMode::ASYNCHRON ); break;
}
}
Cancel();
} break;
case SID_HYPHENATION:
{ const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_HYPHENATION);
if( pItem )
{
SfxItemSetFixed<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> aSet( GetPool() ); bool bValue = pItem->GetValue();
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
mpDrawView->SetAttributes( aSet );
} else// only for testing purpose
{
OSL_FAIL(" no value for hyphenation!");
SfxItemSetFixed<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> aSet( GetPool() );
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, true ) );
mpDrawView->SetAttributes( aSet );
}
rReq.Done();
Cancel();
} break;
case FN_TRANSFORM_DOCUMENT_STRUCTURE:
{ // get the parameter, what to transform
OUString aDataJson; const SfxStringItem* pDataJson = rReq.GetArg<SfxStringItem>(FN_PARAM_1); if (pDataJson)
{
aDataJson = pDataJson->GetValue();
aDataJson = rtl::Uri::decode(aDataJson, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8);
}
// Iterate through the JSON data loaded into a tree structure for (constauto& aItem : aTree)
{ if (aItem.first == "Transforms")
{ // Handle all transformations for (constauto& aItem2Obj : aItem.second)
{ // handle `"Transforms": { ` and `"Transforms": [` cases as well // if an element is an object `{...}`, then get the first element of the object constauto& aItem2
= aItem2Obj.first == "" ? *aItem2Obj.second.ordered_begin() : aItem2Obj;
//jump to slide if (aItem2.first == "SlideCommands")
{ int nActPageId = -1; int nNextPageId = 0; for (constauto& aItem3Obj : aItem2.second)
{ // It accept direct property, or object as well constauto& aItem3 = aItem3Obj.first == ""
? *aItem3Obj.second.ordered_begin()
: aItem3Obj;
if (nActPageId != nNextPageId)
{ // Make it sure it always point to a real page if (nNextPageId < 0)
nNextPageId = 0; if (nNextPageId >= nPageCount)
nNextPageId = nPageCount - 1;
nActPageId = nNextPageId; // Make sure nActPageId is the current Page
maTabControl->SetCurPageId(nActPageId);
SdPage* pPageStandard
= GetDoc()->GetSdPage(nActPageId, PageKind::Standard);
mpDrawView->ShowSdrPage(pPageStandard);
}
// It will move to the next slide.
nNextPageId = GetDoc()->CreatePage(
pPage, PageKind::Standard, OUString(), OUString(),
AUTOLAYOUT_TITLE_CONTENT, AUTOLAYOUT_NOTES, true, true,
pPage->GetPageNum() + 2);
case SID_INSERT_MASTER_PAGE:
{ // Use the API to create a new page.
rtl::Reference<SdXImpressDocument> xMasterPagesSupplier (
GetDoc()->getUnoModel()); if (xMasterPagesSupplier.is())
{
Reference<drawing::XDrawPages> xMasterPages (
xMasterPagesSupplier->getMasterPages()); if (xMasterPages.is())
{
sal_uInt16 nIndex = GetCurPagePos() + 1;
xMasterPages->insertNewByIndex (nIndex);
// Create shapes for the default layout.
SdPage* pMasterPage = GetDoc()->GetMasterSdPage(
nIndex, PageKind::Standard);
pMasterPage->CreateTitleAndLayout (true,true);
}
}
case SID_RENAMEPAGE: case SID_RENAME_MASTER_PAGE:
{ if (mePageKind==PageKind::Standard || mePageKind==PageKind::Notes )
{ if ( mpDrawView->IsTextEdit() )
{
mpDrawView->SdrEndTextEdit();
}
if ( pArgs )
{
SvxZoomType eZT = pArgs->Get( SID_ATTR_ZOOM ).GetType(); switch( eZT )
{ case SvxZoomType::PERCENT:
SetZoom( static_cast<::tools::Long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) ); break;
case SvxZoomType::OPTIMAL:
GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_ALL,
SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); break;
case SvxZoomType::PAGEWIDTH:
GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE_WIDTH,
SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); break;
case SvxZoomType::WHOLEPAGE:
GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE,
SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); break; case SvxZoomType::PAGEWIDTH_NOBORDER:
OSL_FAIL("sd::DrawViewShell::FuTemporary(), SvxZoomType::PAGEWIDTH_NOBORDER not handled!" ); break;
}
rReq.Ignore ();
} else
{ // open zoom dialog
SetCurrentFunction( FuScale::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) );
}
Cancel();
} break;
case SID_CHANGEBEZIER: case SID_CHANGEPOLYGON: if ( mpDrawView->IsTextEdit() )
{
mpDrawView->SdrEndTextEdit();
GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
}
case SID_CONVERT_TO_METAFILE: case SID_CONVERT_TO_BITMAP:
{ // End text edit mode when it is active because the metafile or // bitmap that will be created does not support it. if ( mpDrawView->IsTextEdit() )
{
mpDrawView->SdrEndTextEdit();
GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
}
// create SdrGrafObj from metafile/bitmap
Graphic aGraphic; switch (nSId)
{ case SID_CONVERT_TO_METAFILE:
{ // switch on undo for the next operations
mpDrawView->BegUndo(SdResId(STR_UNDO_CONVERT_TO_METAFILE));
GDIMetaFile aMetaFile(mpDrawView->GetMarkedObjMetaFile());
aGraphic = Graphic(aMetaFile);
} break; case SID_CONVERT_TO_BITMAP:
{ // Disable spelling during conversion bool bOnlineSpell = GetDoc()->GetOnlineSpell();
GetDoc()->SetOnlineSpell(false);
// switch on undo for the next operations
mpDrawView->BegUndo(SdResId(STR_UNDO_CONVERT_TO_BITMAP));
aGraphic = Graphic(mpDrawView->GetMarkedObjBitmapEx()); // Restore online spelling
GetDoc()->SetOnlineSpell(bOnlineSpell);
} break;
}
// create new object
rtl::Reference<SdrGrafObj> pGraphicObj = new SdrGrafObj(
*GetDoc(),
aGraphic);
// get some necessary info and ensure it const size_t nMarkCount(rMarkList.GetMarkCount());
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)");
// fit rectangle of new graphic object to selection's mark rect
::tools::Rectangle aAllMarkedRect;
rMarkList.TakeBoundRect(pPageView, aAllMarkedRect);
pGraphicObj->SetLogicRect(aAllMarkedRect);
// #i71540# to keep the order, it is necessary to replace the lowest object // of the selection with the new object. This also means that with multi // selection, all other objects need to be deleted first
SdrMark* pFirstMark = rMarkList.GetMark(0);
SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj();
if(nMarkCount > 1)
{ // take first object out of selection
mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true);
// For every presentation object a SfxItemSet of hard attributes // and the UserCall is stored in this list. This is because // at the following mpDrawView->SetAttributes( *pSet, sal_True ) // they get lost and have to be restored.
std::vector<std::pair<std::unique_ptr<SfxItemSet>,SdrObjUserCall*> > aAttrList;
SdPage* pPresPage = static_cast<SdPage*>( mpDrawView->GetSdrPageView()->GetPage() );
for ( size_t i = 0; i < nCount; ++i )
{
SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
case SID_DELETE_PAGE: case SID_DELETE_MASTER_PAGE:
DeleteActualPage();
Cancel();
rReq.Ignore (); break;
case SID_DELETE_LAYER:
DeleteActualLayer();
Cancel();
rReq.Ignore (); break;
case SID_ORIGINAL_SIZE:
mpDrawView->SetMarkedOriginalSize();
Cancel();
rReq.Done(); break;
case SID_DRAW_FONTWORK: case SID_DRAW_FONTWORK_VERTICAL:
{
svx::FontworkBar::execute(*mpView, rReq, GetViewFrame()->GetBindings()); // SJ: can be removed (I think)
Cancel();
rReq.Done();
} break;
case SID_SAVE_GRAPHIC:
{ if( rMarkList.GetMarkCount() == 1 )
{ if (const SdrGrafObj* pObj = dynamic_cast<const SdrGrafObj*>(rMarkList.GetMark(0)->GetMarkedSdrObj())) if (pObj->GetGraphicType() == GraphicType::Bitmap || pObj->GetGraphicType() == GraphicType::GdiMetafile)
{
weld::Window* pFrame = GetFrameWeld();
GraphicAttr aGraphicAttr = pObj->GetGraphicAttr(); short nState = RET_CANCEL; if (aGraphicAttr != GraphicAttr()) // the image has been modified
{ if (pFrame)
{
nState = GraphicHelper::HasToSaveTransformedImage(pFrame);
}
} else
{
nState = RET_NO;
}
case SID_GRAPHIC_SIZE_CHECK:
{
sd::GraphicSizeCheckGUIResult aResult(GetDoc());
svx::GenericCheckDialog aDialog(GetFrameWeld(), aResult);
aDialog.run();
Cancel();
rReq.Ignore();
} break;
case SID_ATTRIBUTES_LINE: // BASIC
{
SetCurrentFunction( FuLine::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) ); if (rReq.GetArgs())
Cancel();
} break;
case SID_ATTRIBUTES_AREA: // BASIC
{
SetCurrentFunction( FuArea::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) ); if (rReq.GetArgs())
Cancel();
} break;
case SID_ATTR_TRANSFORM:
{
SetCurrentFunction( FuTransform::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) ); // tdf#138963 conditions tested for here must be the same as those // of the early returns from FuTransform::DoExecute if (rReq.GetArgs() || rMarkList.GetMarkCount() == 0)
{
Invalidate(SID_RULER_OBJECT);
Cancel();
}
} break; case SID_MOVE_SHAPE_HANDLE:
{ const SfxItemSet *pArgs = rReq.GetArgs (); if (pArgs && pArgs->Count () >= 3)
{ const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1); const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2); const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3); const SfxInt32Item* OrdNum = rReq.GetArg<SfxInt32Item>(FN_PARAM_4);
case FN_NUM_BULLET_ON:
{ // The value (sal_uInt16)0xFFFF means set bullet on/off.
SfxUInt16Item aItem(FN_SVX_SET_BULLET, sal_uInt16(0xFFFF));
GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_BULLET,
SfxCallMode::RECORD, { &aItem });
} break;
case FN_NUM_NUMBERING_ON:
{ // The value (sal_uInt16)0xFFFF means set bullet on/off.
SfxUInt16Item aItem(FN_SVX_SET_NUMBER, sal_uInt16(0xFFFF));
GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_NUMBER,
SfxCallMode::RECORD, { &aItem });
} break;
case SID_OUTLINE_BULLET: case FN_SVX_SET_BULLET: case FN_SVX_SET_NUMBER:
{
SetCurrentFunction( FuBulletAndPosition::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) );
Cancel();
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( FN_NUM_BULLET_ON );
rBindings.Invalidate( FN_NUM_NUMBERING_ON );
} break;
case FN_INSERT_SOFT_HYPHEN: case FN_INSERT_HARDHYPHEN: case FN_INSERT_HARD_SPACE: case FN_INSERT_NNBSP: case SID_INSERT_RLM : case SID_INSERT_LRM : case SID_INSERT_WJ : case SID_INSERT_ZWSP: case SID_CHARMAP:
{
SetCurrentFunction( FuBullet::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) );
Cancel();
} break;
case SID_INSERT_OBJECT: case SID_INSERT_FLOATINGFRAME: case SID_INSERT_MATH: case SID_INSERT_DIAGRAM: case SID_ATTR_TABLE:
{
SetCurrentFunction( FuInsertOLE::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) ); // Set the selection tool as the old one. This in particular important for the // zoom function, in which clicking without dragging zooms as well, and that // makes exiting the object editing mode impossible. if (dynamic_cast<FuSelection*>( GetOldFunction().get() ) == nullptr)
SetOldFunction( FuSelection::Create( *this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq ) );
Cancel();
rReq.Ignore ();
} break; case SID_CLASSIFICATION_APPLY:
{ const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if (pArgs && pArgs->GetItemState(nSId, false, &pItem) == SfxItemState::SET)
{ const OUString& rName = static_cast<const SfxStringItem*>(pItem)->GetValue(); auto eType = SfxClassificationPolicyType::IntellectualProperty; if (pArgs->GetItemState(SID_TYPE_NAME, false, &pItem) == SfxItemState::SET)
{ const OUString& rType = static_cast<const SfxStringItem*>(pItem)->GetValue();
eType = SfxClassificationHelper::stringToPolicyType(rType);
} if (SfxViewFrame* pViewFrame = GetViewFrame())
{ if (SfxObjectShell* pObjectShell = pViewFrame->GetObjectShell())
{
SfxClassificationHelper aHelper(pObjectShell->getDocProperties());
aHelper.SetBACName(rName, eType);
}
}
} else
SAL_WARN("sd.ui", "missing parameter for SID_CLASSIFICATION_APPLY");
Cancel();
rReq.Ignore();
} break;
case SID_CLASSIFICATION_DIALOG:
{ if (SfxObjectShell* pObjShell = SfxObjectShell::Current())
{
css::uno::Reference<css::document::XDocumentProperties> xDocProps(pObjShell->getDocProperties()); auto xDialog = std::make_shared<svx::ClassificationDialog>(GetFrameWeld(), xDocProps, false, [](){} );
ClassificationCollector aCollector(*this, xDocProps);
aCollector.collect();
case SID_CAPTUREPOINT: // negative value to signal call from menu
maMousePos = Point(-1,-1);
[[fallthrough]]; case SID_SET_SNAPITEM:
{
SetCurrentFunction( FuSnapLine::Create(*this, GetActiveWindow(), mpDrawView.get(), *GetDoc(), rReq) );
Cancel();
} break;
const SfxItemSet* pArgs = rReq.GetArgs(); // is it allowed to delete the layer? bool bDelete = !( LayerTabBar::IsRealNameOfStandardLayer(aLayerName) );
if (! pArgs)
{
SfxItemSetFixed<ATTR_LAYER_START, ATTR_LAYER_END> aNewAttr( GetDoc()->GetPool() );
case SID_EDIT_HYPERLINK :
{ // Ensure the field is selected first
OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView(); if (pOutView)
pOutView->SelectFieldAtCursor();
ESelection aSel; // fdo#78151 editing a PresObjKind::Outline in a master page ?
::Outliner* pOL = GetOutlinerForMasterPageOutlineTextObj(aSel); if (pOL)
{ //we are on the last paragraph
aSel.Adjust(); if (aSel.end.nPara == pOL->GetParagraphCount() - 1)
{
sal_uInt16 nDepth = pOL->GetDepth(aSel.end.nPara); //there exists a previous numbering level if (nDepth < 8)
{
sal_uInt16 nNewDepth = nDepth+1;
pOL->Insert(SdResId(STR_PRESOBJ_MPOUTLINE_ARY[nNewDepth]), EE_PARA_MAX, nNewDepth);
}
}
}
Cancel();
rReq.Done ();
} break;
case SID_INSERT_FLD_DATE_FIX: case SID_INSERT_FLD_DATE_VAR: case SID_INSERT_FLD_TIME_FIX: case SID_INSERT_FLD_TIME_VAR: case SID_INSERT_FLD_AUTHOR: case SID_INSERT_FLD_PAGE: case SID_INSERT_FLD_PAGE_TITLE: case SID_INSERT_FLD_PAGES: case SID_INSERT_FLD_FILE:
{
sal_uInt16 nMul = 1;
std::unique_ptr<SvxFieldItem> pFieldItem;
case SID_NAME_GROUP:
{ // only allow for single object selection since the name of an object needs // to be unique if(1 == rMarkList.GetMarkCount())
{ // #i68101#
rtl::Reference<SdrObject> pSelected = rMarkList.GetMark(0)->GetMarkedSdrObj();
OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
OUString aName(pSelected->GetName());
case SID_SETLAYER:
{ const size_t nMarkCount = rMarkList.GetMarkCount(); if (nMarkCount >= 1 && mpLayerTabBar)
{
SdSelectLayerDlg aDlg(GetFrameWeld());
weld::TreeView& rTreeView = aDlg.GetTreeView(); auto nPageCount = mpLayerTabBar->GetPageCount(); for (auto i = 0; i < nPageCount; i++)
rTreeView.append_text(LayerTabBar::convertToLocalizedName(
mpLayerTabBar->GetLayerName(mpLayerTabBar->GetPageId(i))));
rTreeView.select(0);
if (aDlg.run() == RET_OK && rTreeView.get_selected_index() != -1)
{
SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
SdrLayerID aSdrLayerId = rLayerAdmin.GetLayerID(mpLayerTabBar->GetLayerName(
mpLayerTabBar->GetPageId(rTreeView.get_selected_index()))); for (size_t i = 0; i < nMarkCount; ++i)
{
SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
pObj->SetLayer(aSdrLayerId);
}
}
}
Cancel();
rReq.Ignore(); break;
}
case SID_DISTRIBUTE_HLEFT: case SID_DISTRIBUTE_HCENTER: case SID_DISTRIBUTE_HDISTANCE: case SID_DISTRIBUTE_HRIGHT: case SID_DISTRIBUTE_VTOP: case SID_DISTRIBUTE_VCENTER: case SID_DISTRIBUTE_VDISTANCE: case SID_DISTRIBUTE_VBOTTOM:
{ if ( mpDrawView->IsPresObjSelected() )
{
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
} else
{
mpDrawView->DistributeMarkedObjects(nSId);
}
Cancel();
rReq.Done ();
} break; case SID_POLY_MERGE:
{ // End text edit to avoid conflicts if(mpDrawView->IsTextEdit())
mpDrawView->SdrEndTextEdit();
// determine the sum of meta objects of all selected meta files
sal_uLong nCount = 0; for(size_t nm=0; nm<nCnt; ++nm)
{
SdrMark* pM=rMarkList.GetMark(nm);
SdrObject* pObj=pM->GetMarkedSdrObj();
SdrGrafObj* pGraf= dynamic_cast< SdrGrafObj *>( pObj );
SdrOle2Obj* pOle2= dynamic_cast< SdrOle2Obj *>( pObj );
if (pGraf != nullptr)
{ if (pGraf->HasGDIMetaFile())
{
nCount += pGraf->GetGraphic().GetGDIMetaFile().GetActionSize();
} elseif (pGraf->isEmbeddedVectorGraphicData())
{
nCount += pGraf->getMetafileFromEmbeddedVectorGraphicData().GetActionSize();
}
}
if (pOle2) if (const Graphic* pGraphic = pOle2->GetGraphic())
nCount += pGraphic->GetGDIMetaFile().GetActionSize();
}
// decide with the sum of all meta objects if we should show a dialog if(nCount < MIN_ACTIONS_FOR_DIALOG)
{ // nope, no dialog
mpDrawView->DoImportMarkedMtf();
} else
{
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateBreakDlg(GetFrameWeld(), mpDrawView.get(), GetDocSh(), nCount, static_cast<sal_uLong>(nCnt) ));
pDlg->Execute();
}
}
Cancel();
rReq.Done ();
} break;
case SID_CONVERT_TO_3D:
{ if ( mpDrawView->IsPresObjSelected() )
{
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
} else
{ if (mpDrawView->IsConvertTo3DObjPossible())
{ if (mpDrawView->IsTextEdit())
{
mpDrawView->SdrEndTextEdit();
}
case SID_STYLE_NEW: // BASIC ??? case SID_STYLE_APPLY: case SID_STYLE_EDIT: case SID_STYLE_DELETE: case SID_STYLE_HIDE: case SID_STYLE_SHOW: case SID_STYLE_FAMILY: case SID_STYLE_WATERCAN: case SID_STYLE_UPDATE_BY_EXAMPLE: case SID_STYLE_NEW_BY_EXAMPLE:
{ if (!rReq.GetArgs()
&& (nSId == SID_STYLE_EDIT || nSId == SID_STYLE_UPDATE_BY_EXAMPLE
|| nSId == SID_STYLE_NEW_BY_EXAMPLE))
{
SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet(); if( pStyleSheet && pStyleSheet->GetFamily() == SfxStyleFamily::Page)
pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet();
case SID_EXTRUSION_TOGGLE: case SID_EXTRUSION_TILT_DOWN: case SID_EXTRUSION_TILT_UP: case SID_EXTRUSION_TILT_LEFT: case SID_EXTRUSION_TILT_RIGHT: case SID_EXTRUSION_3D_COLOR: case SID_EXTRUSION_DEPTH: case SID_EXTRUSION_DIRECTION: case SID_EXTRUSION_PROJECTION: case SID_EXTRUSION_LIGHTING_DIRECTION: case SID_EXTRUSION_LIGHTING_INTENSITY: case SID_EXTRUSION_SURFACE: case SID_EXTRUSION_DEPTH_FLOATER: case SID_EXTRUSION_DIRECTION_FLOATER: case SID_EXTRUSION_LIGHTING_FLOATER: case SID_EXTRUSION_SURFACE_FLOATER: case SID_EXTRUSION_DEPTH_DIALOG:
svx::ExtrusionBar::execute( mpDrawView.get(), rReq, GetViewFrame()->GetBindings() );
Cancel();
rReq.Ignore (); break;
case SID_FONTWORK_SHAPE: case SID_FONTWORK_SHAPE_TYPE: case SID_FONTWORK_ALIGNMENT: case SID_FONTWORK_SAME_LETTER_HEIGHTS: case SID_FONTWORK_CHARACTER_SPACING: case SID_FONTWORK_KERN_CHARACTER_PAIRS: case SID_FONTWORK_GALLERY_FLOATER: case SID_FONTWORK_CHARACTER_SPACING_FLOATER: case SID_FONTWORK_ALIGNMENT_FLOATER: case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
svx::FontworkBar::execute(*mpDrawView, rReq, GetViewFrame()->GetBindings());
Cancel();
rReq.Ignore (); break;
case SID_BMPMASK:
{
GetViewFrame()->ToggleChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() );
GetViewFrame()->GetBindings().Invalidate( SID_BMPMASK );
Cancel();
rReq.Ignore ();
} break;
case SID_NAVIGATOR:
{ if ( rReq.GetArgs() )
GetViewFrame()->SetChildWindow(SID_NAVIGATOR, static_cast<const SfxBoolItem&>(rReq.GetArgs()->
Get(SID_NAVIGATOR)).GetValue()); else
GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
case SID_SLIDE_TRANSITIONS_PANEL: case SID_MASTER_SLIDES_PANEL: case SID_CUSTOM_ANIMATION_PANEL: case SID_GALLERY:
{ // First make sure that the sidebar is visible
GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
case SID_CONVERT_TO_3D_LATHE_FAST:
{ /* The call is enough. The initialization via Start3DCreation and CreateMirrorPolygons is no longer needed if the parameter sal_True is provided. Then a tilted rotary body with an axis left besides the bounding rectangle of the selected objects is drawn
immediately and without user interaction. */
mpDrawView->SdrEndTextEdit(); if(GetActiveWindow())
GetActiveWindow()->EnterWait();
mpDrawView->End3DCreation(true);
Cancel();
rReq.Ignore(); if(GetActiveWindow())
GetActiveWindow()->LeaveWait();
} break;
case SID_DISPLAY_MASTER_BACKGROUND: case SID_DISPLAY_MASTER_OBJECTS:
{ // Determine current page and toggle visibility of layers // associated with master page background or master page shapes. // FIXME: This solution is wrong, because shapes of master pages need // not be on layer "background" or "backgroundobjects". // See tdf#118613
SdPage* pPage = GetActualPage(); if (pPage != nullptr
&& GetDoc() != nullptr)
{
SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
SdrLayerID aLayerId; if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
aLayerId = rLayerAdmin.GetLayerID(sUNO_LayerName_background); else
aLayerId = rLayerAdmin.GetLayerID(sUNO_LayerName_background_objects);
aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
}
Cancel();
rReq.Done(); // Mark task as done to auto-update the state of each buttons tdf#132816
} break;
case SID_THEME_DIALOG:
{
SdrPage* pMasterPage = &GetActualPage()->TRG_GetMasterPage(); auto pTheme = pMasterPage->getSdrPageProperties().getTheme(); auto pDialog = std::make_shared<svx::ThemeDialog>(GetFrameWeld(), pTheme.get()); auto* pDocShell = GetDocSh();
weld::DialogController::runAsync(pDialog, [pDialog, pMasterPage, pDocShell](sal_uInt32 nResult)
{ if (RET_OK != nResult) return;
auto pColorSet = pDialog->getCurrentColorSet(); if (pColorSet)
{
sd::ThemeColorChanger aChanger(pMasterPage, pDocShell);
aChanger.apply(pColorSet);
}
});
Cancel();
rReq.Ignore();
} break;
case SID_ATTR_GLOW_COLOR: case SID_ATTR_GLOW_RADIUS: case SID_ATTR_GLOW_TRANSPARENCY: case SID_ATTR_GLOW_TEXT_COLOR: case SID_ATTR_GLOW_TEXT_RADIUS: case SID_ATTR_GLOW_TEXT_TRANSPARENCY: case SID_ATTR_SOFTEDGE_RADIUS: case SID_ATTR_TEXTCOLUMNS_NUMBER: case SID_ATTR_TEXTCOLUMNS_SPACING: if (const SfxItemSet* pNewArgs = rReq.GetArgs())
mpDrawView->SetAttributes(*pNewArgs);
rReq.Done();
Cancel(); break;
case SID_PASTE_SLIDE: case SID_COPY_SLIDE:
{
sd::slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase())
->GetSlideSorter()
.GetController()
.FuSupport(rReq);
Cancel();
rReq.Done();
} break; default:
{
SAL_WARN( "sd.ui", "Slot without function" );
Cancel();
rReq.Ignore ();
} break;
}
//modified by wj for sym2_1580, if put old itemset into new set, //when mpDrawView->SetAttributes(aNewAttr) it will invalidate all the item // and use old attr to update all the attributes // SfxItemSet aNewAttr( GetPool(), // EE_ITEMS_START, EE_ITEMS_END ); // aNewAttr.Put( aEditAttr, sal_False );
SfxItemSet aNewAttr( pDoc->GetPool() ); //modified end
case SID_ULINE_VAL_NONE:
{
aNewAttr.Put(SvxUnderlineItem(LINESTYLE_NONE, EE_CHAR_UNDERLINE)); break;
}
case SID_ULINE_VAL_SINGLE: case SID_ULINE_VAL_DOUBLE: case SID_ULINE_VAL_DOTTED:
{
FontLineStyle eOld = aEditAttr.Get(EE_CHAR_UNDERLINE).GetLineStyle();
FontLineStyle eNew = eOld;
/** This method consists basically of three parts: 1. Process the arguments of the SFX request. 2. Use the model to create a new page or duplicate an existing one. 3. Update the tab control and switch to the new page.
*/
SdPage* DrawViewShell::CreateOrDuplicatePage (
SfxRequest& rRequest,
PageKind ePageKind,
SdPage* pPage, const sal_Int32 nInsertPosition)
{
SdPage* pNewPage = nullptr; if (ePageKind == PageKind::Standard && meEditMode != EditMode::MasterPage)
{ if ( mpDrawView->IsTextEdit() )
{
mpDrawView->SdrEndTextEdit();
}
pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition);
} return pNewPage;
}
// Create a list of the pages that are to be duplicated. The process of // duplication alters the selection.
sal_Int32 nInsertPosition (0);
::std::vector<SdPage*> aPagesToDuplicate;
sd::slidesorter::SlideSorter &mrSlideSorter = pSlideSorterViewShell->GetSlideSorter();
sd::slidesorter::model::PageEnumeration aSelectedPages (
sd::slidesorter::model::PageEnumerationProvider::CreateSelectedPagesEnumeration(mrSlideSorter.GetModel())); while (aSelectedPages.HasMoreElements())
{
sd::slidesorter::model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement()); if (pDescriptor && pDescriptor->GetPage())
{
aPagesToDuplicate.push_back(pDescriptor->GetPage());
nInsertPosition = pDescriptor->GetPage()->GetPageNum()+2;
}
}
// Duplicate the pages in aPagesToDuplicate and collect the newly // created pages in aPagesToSelect. constbool bUndo (aPagesToDuplicate.size()>1 && mrSlideSorter.GetView().IsUndoEnabled()); if (bUndo)
mrSlideSorter.GetView().BegUndo(SdResId(STR_INSERTPAGE));
// Set the selection to the pages in aPagesToSelect.
sd::slidesorter::controller::PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector());
rSelector.DeselectAllPages(); for (autoconst& it: aPagesToSelect)
{
rSelector.SelectPage(it);
}
}
¤ 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.0.121Bemerkung:
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-05-05)
¤
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.