LibreOffice Module sd (master) 1
drviews2.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <config_features.h>
21
23
24#include <basic/sberrors.hxx>
25#include <basic/sbstar.hxx>
26
27#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
28#include <com/sun/star/drawing/XDrawPages.hpp>
29#include <com/sun/star/lang/XInitialization.hpp>
30#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
31#include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp>
32#include <com/sun/star/frame/XDispatchProvider.hpp>
33#include <com/sun/star/util/URLTransformer.hpp>
34#include <com/sun/star/util/XURLTransformer.hpp>
35#include <com/sun/star/scanner/XScannerManager2.hpp>
36#include <com/sun/star/document/XDocumentProperties.hpp>
37
41#include <comphelper/lok.hxx>
42
44#include <editeng/editdata.hxx>
45#include <editeng/eeitem.hxx>
46#include <editeng/flditem.hxx>
47#include <editeng/section.hxx>
48#include <editeng/editobj.hxx>
51
52#include <sal/log.hxx>
53
54#include <sfx2/bindings.hxx>
55#include <sfx2/dispatch.hxx>
56#include <sfx2/docfile.hxx>
57#include <sfx2/msgpool.hxx>
58#include <sfx2/msg.hxx>
59#include <sfx2/request.hxx>
60#include <sfx2/viewfrm.hxx>
61#include <sfx2/zoomitem.hxx>
62
66#include <svx/bmpmask.hxx>
67#include <svx/extedit.hxx>
68#include <svx/extrusionbar.hxx>
69#include <svx/f3dchild.hxx>
70#include <svx/fontwork.hxx>
71#include <svx/fontworkbar.hxx>
72#include <svx/graphichelper.hxx>
73#include <svx/hlnkitem.hxx>
74#include <svx/imapdlg.hxx>
75#include <svx/sdtagitm.hxx>
76#include <svx/svdograf.hxx>
77#include <svx/svdoole2.hxx>
78#include <svx/svdpagv.hxx>
79#include <svx/svdundo.hxx>
80#include <svx/svxdlg.hxx>
81#include <svx/svxids.hrc>
82#include <svx/sdtfsitm.hxx>
83#include <svx/sdmetitm.hxx>
85#include <svx/xflclit.hxx>
86#include <svx/xlnwtit.hxx>
87#include <svx/chrtitem.hxx>
88#include <svx/xlnclit.hxx>
89#include <svx/xflgrit.hxx>
90
93
95
96#include <vcl/abstdlg.hxx>
97#include <vcl/graph.hxx>
98#include <vcl/svapp.hxx>
99#include <vcl/unohelp2.hxx>
100#include <vcl/weld.hxx>
101
102#include <editeng/cmapitem.hxx>
104#include <editeng/kernitem.hxx>
105#include <editeng/wghtitem.hxx>
106#include <editeng/postitem.hxx>
107#include <editeng/udlnitem.hxx>
109#include <editeng/shdditem.hxx>
110#include <editeng/numitem.hxx>
111#include <svx/svdobj.hxx>
113#include <editeng/outlobj.hxx>
114#include <editeng/flstitem.hxx>
115#include <editeng/fontitem.hxx>
116#include <editeng/fhgtitem.hxx>
117#include <editeng/colritem.hxx>
118
119#include <svl/poolitem.hxx>
120#include <svl/style.hxx>
121#include <svl/whiter.hxx>
122
123#include <app.hrc>
124#include <strings.hrc>
125
127#include <DrawDocShell.hxx>
128#include <DrawViewShell.hxx>
129#include <LayerTabBar.hxx>
130#include <Outliner.hxx>
131#include <ViewShellHint.hxx>
133#include <Window.hxx>
134#include <drawdoc.hxx>
135#include <drawview.hxx>
136#include <fuarea.hxx>
137#include <fubullet.hxx>
138#include <fuchar.hxx>
139#include <fucushow.hxx>
140#include <fuconnct.hxx>
141#include <fucopy.hxx>
142#include <fudspord.hxx>
144#include <fuexpand.hxx>
145#include <fuinsert.hxx>
146#include <fuinsfil.hxx>
147#include <fuline.hxx>
148#include <fulinend.hxx>
149#include <fulink.hxx>
150#include <fumeasur.hxx>
151#include <fumorph.hxx>
152#include <fuoaprms.hxx>
153#include <fuolbull.hxx>
154#include <fupage.hxx>
155#include <fuparagr.hxx>
156#include <fuprlout.hxx>
157#include <fuscale.hxx>
158#include <fusel.hxx>
159#include <fusldlg.hxx>
160#include <fusnapln.hxx>
161#include <fusumry.hxx>
162#include <futempl.hxx>
163#include <futhes.hxx>
164#include <futransf.hxx>
165#include <futxtatt.hxx>
166#include <fuvect.hxx>
167#include <futext.hxx>
168#include <helpids.h>
169#include <sdabstdlg.hxx>
170#include <sdattr.hxx>
171#include <sdpage.hxx>
172#include <sdresid.hxx>
173#include <unokywds.hxx>
174#include <slideshow.hxx>
175#include <stlsheet.hxx>
176#include <undolayer.hxx>
179#include <sdmod.hxx>
182#include <SlideSorter.hxx>
188
189#include <ViewShellBase.hxx>
190#include <memory>
191
192using namespace ::com::sun::star;
193using namespace ::com::sun::star::uno;
194
195#define MIN_ACTIONS_FOR_DIALOG 5000
196
197namespace sd {
198
199namespace {
200
201const SvxFieldItem* findField(editeng::Section const & rSection)
202{
203 for (SfxPoolItem const * pPool: rSection.maAttributes)
204 {
205 if (pPool->Which() == EE_FEATURE_FIELD)
206 return static_cast<const SvxFieldItem*>(pPool);
207 }
208 return nullptr;
209}
210
211bool hasCustomPropertyField(std::vector<editeng::Section> const & aSections, std::u16string_view rName)
212{
213 for (editeng::Section const & rSection : aSections)
214 {
215 const SvxFieldItem* pFieldItem = findField(rSection);
216 if (pFieldItem)
217 {
218 const editeng::CustomPropertyField* pCustomPropertyField = dynamic_cast<const editeng::CustomPropertyField*>(pFieldItem->GetField());
219 if (pCustomPropertyField && pCustomPropertyField->GetName() == rName)
220 return true;
221 }
222 }
223 return false;
224}
225
226OUString getWeightString(SfxItemSet const & rItemSet)
227{
228 OUString sWeightString = "NORMAL";
229
230 if (const SfxPoolItem* pItem = rItemSet.GetItem(EE_CHAR_WEIGHT, false))
231 {
232 const SvxWeightItem* pWeightItem = dynamic_cast<const SvxWeightItem*>(pItem);
233 if (pWeightItem && pWeightItem->GetWeight() == WEIGHT_BOLD)
234 sWeightString = "BOLD";
235 }
236 return sWeightString;
237}
238
239class ClassificationCommon
240{
241protected:
242 sd::DrawViewShell& m_rDrawViewShell;
243 uno::Reference<document::XDocumentProperties> m_xDocumentProperties;
244 uno::Reference<beans::XPropertyContainer> m_xPropertyContainer;
245 sfx::ClassificationKeyCreator m_aKeyCreator;
246public:
247 ClassificationCommon(sd::DrawViewShell& rDrawViewShell, const css::uno::Reference<css::document::XDocumentProperties>& rDocProps)
248 : m_rDrawViewShell(rDrawViewShell)
249 , m_xDocumentProperties(rDocProps)
250 , m_xPropertyContainer(m_xDocumentProperties->getUserDefinedProperties())
252 {}
253};
254
255class ClassificationCollector : public ClassificationCommon
256{
257private:
258 std::vector<svx::ClassificationResult> m_aResults;
259
260 void iterateSectionsAndCollect(std::vector<editeng::Section> const & rSections, EditTextObject const & rEditText)
261 {
262 sal_Int32 nCurrentParagraph = -1;
263 OUString sBlank;
264
265 for (editeng::Section const & rSection : rSections)
266 {
267 // Insert new paragraph if needed
268 while (nCurrentParagraph < rSection.mnParagraph)
269 {
270 nCurrentParagraph++;
271 // Get Weight of current paragraph
272 OUString sWeightProperty = getWeightString(rEditText.GetParaAttribs(nCurrentParagraph));
273 // Insert new paragraph into collection
274 m_aResults.push_back({ svx::ClassificationType::PARAGRAPH, sWeightProperty, sBlank, sBlank });
275 }
276
277 const SvxFieldItem* pFieldItem = findField(rSection);
278 const editeng::CustomPropertyField* pCustomPropertyField = pFieldItem ?
279 dynamic_cast<const editeng::CustomPropertyField*>(pFieldItem->GetField()) :
280 nullptr;
281 if (pCustomPropertyField)
282 {
283 const OUString& aKey = pCustomPropertyField->GetName();
284 if (m_aKeyCreator.isMarkingTextKey(aKey))
285 {
286 OUString aValue = svx::classification::getProperty(m_xPropertyContainer, aKey);
287 m_aResults.push_back({ svx::ClassificationType::TEXT, aValue, sBlank, sBlank });
288 }
289 else if (m_aKeyCreator.isCategoryNameKey(aKey) || m_aKeyCreator.isCategoryIdentifierKey(aKey))
290 {
291 OUString aValue = svx::classification::getProperty(m_xPropertyContainer, aKey);
292 m_aResults.push_back({ svx::ClassificationType::CATEGORY, aValue, sBlank, sBlank });
293 }
294 else if (m_aKeyCreator.isMarkingKey(aKey))
295 {
296 OUString aValue = svx::classification::getProperty(m_xPropertyContainer, aKey);
297 m_aResults.push_back({ svx::ClassificationType::MARKING, aValue, sBlank, sBlank });
298 }
299 else if (m_aKeyCreator.isIntellectualPropertyPartKey(aKey))
300 {
301 OUString aValue = svx::classification::getProperty(m_xPropertyContainer, aKey);
302 m_aResults.push_back({ svx::ClassificationType::INTELLECTUAL_PROPERTY_PART, aValue, sBlank, sBlank });
303 }
304 }
305 }
306 }
307
308public:
309 ClassificationCollector(sd::DrawViewShell & rDrawViewShell, const css::uno::Reference<css::document::XDocumentProperties>& rDocProps)
310 : ClassificationCommon(rDrawViewShell, rDocProps)
311 {}
312
313 std::vector<svx::ClassificationResult> const & getResults() const
314 {
315 return m_aResults;
316 }
317
318 void collect()
319 {
320 // Set to MASTER mode
321 EditMode eOldMode = m_rDrawViewShell.GetEditMode();
322 if (eOldMode != EditMode::MasterPage)
323 m_rDrawViewShell.ChangeEditMode(EditMode::MasterPage, false);
324
325 // Scoped guard to revert to the previous mode
326 comphelper::ScopeGuard const aGuard([this, eOldMode] () {
327 m_rDrawViewShell.ChangeEditMode(eOldMode, false);
328 });
329
330 const sal_uInt16 nCount = m_rDrawViewShell.GetDoc()->GetMasterSdPageCount(PageKind::Standard);
331
332 for (sal_uInt16 nPageIndex = 0; nPageIndex < nCount; ++nPageIndex)
333 {
334 SdPage* pMasterPage = m_rDrawViewShell.GetDoc()->GetMasterSdPage(nPageIndex, PageKind::Standard);
335 for (size_t nObject = 0; nObject < pMasterPage->GetObjCount(); ++nObject)
336 {
337 SdrObject* pObject = pMasterPage->GetObj(nObject);
338 SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject);
339 if (pRectObject && pRectObject->GetTextKind() == SdrObjKind::Text)
340 {
341 OutlinerParaObject* pOutlinerParagraphObject = pRectObject->GetOutlinerParaObject();
342 if (pOutlinerParagraphObject)
343 {
344 const EditTextObject& rEditText = pOutlinerParagraphObject->GetTextObject();
345 std::vector<editeng::Section> aSections;
346 rEditText.GetAllSections(aSections);
347
348 // Search for a custom property field that has the classification category identifier key
349 if (hasCustomPropertyField(aSections, m_aKeyCreator.makeCategoryNameKey()))
350 {
351 iterateSectionsAndCollect(aSections, rEditText);
352 return;
353 }
354 }
355 }
356 }
357 }
358 }
359};
360
361class ClassificationInserter : public ClassificationCommon
362{
363private:
365 void deleteExistingObjects()
366 {
367 OUString sKey = m_aKeyCreator.makeCategoryNameKey();
368
369 const sal_uInt16 nCount = m_rDrawViewShell.GetDoc()->GetMasterSdPageCount(PageKind::Standard);
370
371 for (sal_uInt16 nPageIndex = 0; nPageIndex < nCount; ++nPageIndex)
372 {
373 SdPage* pMasterPage = m_rDrawViewShell.GetDoc()->GetMasterSdPage(nPageIndex, PageKind::Standard);
374 for (size_t nObject = 0; nObject < pMasterPage->GetObjCount(); ++nObject)
375 {
376 SdrObject* pObject = pMasterPage->GetObj(nObject);
377 SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject);
378 if (pRectObject && pRectObject->GetTextKind() == SdrObjKind::Text)
379 {
380 OutlinerParaObject* pOutlinerParagraphObject = pRectObject->GetOutlinerParaObject();
381 if (pOutlinerParagraphObject)
382 {
383 const EditTextObject& rEditText = pOutlinerParagraphObject->GetTextObject();
384 std::vector<editeng::Section> aSections;
385 rEditText.GetAllSections(aSections);
386
387 if (hasCustomPropertyField(aSections, sKey))
388 {
389 pMasterPage->RemoveObject(pRectObject->GetOrdNum());
390 }
391 }
392 }
393 }
394 }
395 }
396
397 void fillTheOutliner(Outliner* pOutliner, std::vector<svx::ClassificationResult> const & rResults)
398 {
399 sal_Int32 nParagraph = -1;
400 for (svx::ClassificationResult const & rResult : rResults)
401 {
402
403 ESelection aPosition(nParagraph, EE_TEXTPOS_MAX_COUNT, nParagraph, EE_TEXTPOS_MAX_COUNT);
404
405 switch (rResult.meType)
406 {
408 {
409 OUString sKey = m_aKeyCreator.makeNumberedTextKey();
410 svx::classification::addOrInsertDocumentProperty(m_xPropertyContainer, sKey, rResult.msName);
411 pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition);
412 }
413 break;
414
416 {
417 OUString sKey = m_aKeyCreator.makeCategoryNameKey();
418 pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition);
419 }
420 break;
421
423 {
424 OUString sKey = m_aKeyCreator.makeNumberedMarkingKey();
425 svx::classification::addOrInsertDocumentProperty(m_xPropertyContainer, sKey, rResult.msName);
426 pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition);
427 }
428 break;
429
431 {
432 OUString sKey = m_aKeyCreator.makeNumberedIntellectualPropertyPartKey();
433 svx::classification::addOrInsertDocumentProperty(m_xPropertyContainer, sKey, rResult.msName);
434 pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition);
435 }
436 break;
437
439 {
440 nParagraph++;
441 pOutliner->Insert("");
442
443 SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END> aItemSet(m_rDrawViewShell.GetDoc()->GetPool());
444
445 if (rResult.msName == "BOLD")
447 else
449
450 SvxNumRule aDefaultNumRule(SvxNumRuleFlags::NONE, 0, false);
451 aItemSet.Put(SvxNumBulletItem(std::move(aDefaultNumRule), EE_PARA_NUMBULLET));
452
453 pOutliner->SetParaAttribs(nParagraph, aItemSet);
454 }
455 break;
456
457 default:
458 break;
459 }
460 }
461 }
462
463public:
464 ClassificationInserter(sd::DrawViewShell & rDrawViewShell, const css::uno::Reference<css::document::XDocumentProperties>& rDocProps)
465 : ClassificationCommon(rDrawViewShell, rDocProps)
466 {
467 }
468
469 void insert(std::vector<svx::ClassificationResult> const & rResults)
470 {
471 // Set to MASTER mode
472 EditMode eOldMode = m_rDrawViewShell.GetEditMode();
473 if (eOldMode != EditMode::MasterPage)
474 m_rDrawViewShell.ChangeEditMode(EditMode::MasterPage, false);
475
476 // Scoped guard to revert the mode
477 comphelper::ScopeGuard const aGuard([this, eOldMode] () {
478 m_rDrawViewShell.ChangeEditMode(eOldMode, false);
479 });
480
481 // Delete the previous existing object - if exists
482 deleteExistingObjects();
483
484 // Clear properties
485 svx::classification::removeAllProperties(m_xPropertyContainer);
486
487 SfxClassificationHelper aHelper(m_xDocumentProperties);
488
489 // Apply properties from the BA policy
490 for (svx::ClassificationResult const & rResult : rResults)
491 {
492 if (rResult.meType == svx::ClassificationType::CATEGORY)
493 aHelper.SetBACName(rResult.msName, SfxClassificationHelper::getPolicyType());
494 }
495
496 // Insert full text as document property
497 svx::classification::insertFullTextualRepresentationAsDocumentProperty(m_xPropertyContainer, m_aKeyCreator, rResults);
498
499 // Create the outliner from the
500 Outliner* pOutliner = m_rDrawViewShell.GetDoc()->GetInternalOutliner();
501 OutlinerMode eOutlinerMode = pOutliner->GetOutlinerMode();
502
503 comphelper::ScopeGuard const aOutlinerGuard([pOutliner, eOutlinerMode] () {
504 pOutliner->Init(eOutlinerMode);
505 });
506
507 pOutliner->Init(OutlinerMode::TextObject);
508
509 // Fill the outliner with the text from classification result
510 fillTheOutliner(pOutliner, rResults);
511
512 // Calculate to outliner text size
513 pOutliner->UpdateFields();
514 pOutliner->SetUpdateLayout(true);
515 Size aTextSize(pOutliner->CalcTextSize());
516 pOutliner->SetUpdateLayout(false);
517
518 // Create objects, apply the outliner and add them (objects) to all master pages
519 const sal_uInt16 nCount = m_rDrawViewShell.GetDoc()->GetMasterSdPageCount(PageKind::Standard);
520
521 for (sal_uInt16 nPageIndex = 0; nPageIndex < nCount; ++nPageIndex)
522 {
523 SdPage* pMasterPage = m_rDrawViewShell.GetDoc()->GetMasterSdPage(nPageIndex, PageKind::Standard);
524 if (!pMasterPage)
525 continue;
526
528 *m_rDrawViewShell.GetDoc(), // TTTT should be reference
529 SdrObjKind::Text);
530 pObject->SetMergedItem(makeSdrTextAutoGrowWidthItem(true));
531 pObject->SetOutlinerParaObject(pOutliner->CreateParaObject());
532 pMasterPage->InsertObject(pObject.get());
533
534 // Calculate position
535 ::tools::Rectangle aRectangle(Point(), pMasterPage->GetSize());
536 Point aPosition(aRectangle.Center().X(), aRectangle.Bottom());
537
538 aPosition.AdjustX( -(aTextSize.Width() / 2) );
539 aPosition.AdjustY( -(aTextSize.Height()) );
540
541 pObject->SetLogicRect(::tools::Rectangle(aPosition, aTextSize));
542 }
543 }
544};
545
546 void lcl_convertStringArguments(sal_uInt16 nSlot, const std::unique_ptr<SfxItemSet>& pArgs)
547 {
548 const SfxPoolItem* pItem = nullptr;
549
550 if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LINE_WIDTH_ARG, false, &pItem))
551 {
552 double fValue = static_cast<const SvxDoubleItem*>(pItem)->GetValue();
553 // FIXME: different units...
554 int nPow = 100;
555 int nValue = fValue * nPow;
556
557 XLineWidthItem aItem(nValue);
558 pArgs->Put(aItem);
559 }
560 if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, false, &pItem))
561 {
562 const SfxStringItem* pJSON = static_cast<const SfxStringItem*>(pItem);
563 if (pJSON)
564 {
566 XFillGradientItem aItem(aGradient);
567 pArgs->Put(aItem);
568 }
569 }
570
571 if (nSlot == SID_ATTR_FILL_COLOR)
572 {
573 // Merge the color parameters to the color itself.
574 const XFillColorItem* pColorItem = static_cast<const XFillColorItem*>(pArgs->GetItem(SID_ATTR_FILL_COLOR));
575 if (pColorItem)
576 {
577 XFillColorItem aColorItem(*pColorItem);
578 model::ComplexColor aComplexColor = aColorItem.getComplexColor();
579
580 if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, &pItem) == SfxItemState::SET)
581 {
582 auto pIntItem = static_cast<const SfxInt16Item*>(pItem);
583 aComplexColor.setSchemeColor(model::convertToThemeColorType(pIntItem->GetValue()));
584 }
585 if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_MOD, false, &pItem) == SfxItemState::SET)
586 {
587 auto pIntItem = static_cast<const SfxInt16Item*>(pItem);
588 aComplexColor.addTransformation({model::TransformationType::LumMod, pIntItem->GetValue()});
589 }
590 if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_OFF, false, &pItem) == SfxItemState::SET)
591 {
592 auto pIntItem = static_cast<const SfxInt16Item*>(pItem);
593 aComplexColor.addTransformation({model::TransformationType::LumOff, pIntItem->GetValue()});
594 }
595 aColorItem.setComplexColor(aComplexColor);
596 pArgs->Put(aColorItem);
597 }
598 }
599 }
600}
601
607{
608 // during a native slide show nothing gets executed!
609 if(SlideShow::IsRunning( GetViewShellBase() ) && (rReq.GetSlot() != SID_NAVIGATOR))
610 return;
611
612 DBG_ASSERT( mpDrawView, "sd::DrawViewShell::FuTemporary(), no draw view!" );
613 if( !mpDrawView )
614 return;
615
616 CheckLineTo (rReq);
617
619
620 sal_uInt16 nSId = rReq.GetSlot();
621
622 switch ( nSId )
623 {
624 case SID_OUTLINE_TEXT_AUTOFIT:
625 {
626 SfxUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
627 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
628 if( rMarkList.GetMarkCount() == 1 )
629 {
630 pUndoManager->EnterListAction("", "", 0, GetViewShellBase().GetViewShellId());
631 mpDrawView->BegUndo();
632
633 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
634 bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != drawing::TextFitToSizeType_NONE;
635
637
638 if (!bSet)
639 {
640 //If we are turning on AutoFit we have to turn these off if already on
645 }
646
647 pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? drawing::TextFitToSizeType_NONE : drawing::TextFitToSizeType_AUTOFIT));
648
649 mpDrawView->EndUndo();
650 pUndoManager->LeaveListAction();
651 }
652 Cancel();
653 rReq.Done();
654 }
655 break;
656
657 // area and line attributes: shall have
658 // an own Execute method (like StateMethode)
659 case SID_ATTR_FILL_STYLE:
660 case SID_ATTR_FILL_COLOR:
661 case SID_ATTR_FILL_GRADIENT:
662 case SID_ATTR_FILL_HATCH:
663 case SID_ATTR_FILL_BITMAP:
664 case SID_ATTR_FILL_SHADOW:
665 case SID_ATTR_SHADOW_COLOR:
666 case SID_ATTR_SHADOW_TRANSPARENCE:
667 case SID_ATTR_SHADOW_BLUR:
668 case SID_ATTR_SHADOW_XDISTANCE:
669 case SID_ATTR_SHADOW_YDISTANCE:
670 case SID_ATTR_FILL_USE_SLIDE_BACKGROUND:
671 case SID_ATTR_FILL_TRANSPARENCE:
672 case SID_ATTR_FILL_FLOATTRANSPARENCE:
673
674 case SID_ATTR_LINE_STYLE:
675 case SID_ATTR_LINE_DASH:
676 case SID_ATTR_LINE_WIDTH:
677 case SID_ATTR_LINE_COLOR:
678 case SID_ATTR_LINEEND_STYLE:
679 case SID_ATTR_LINE_START:
680 case SID_ATTR_LINE_END:
681 case SID_ATTR_LINE_TRANSPARENCE:
682 case SID_ATTR_LINE_JOINT:
683 case SID_ATTR_LINE_CAP:
684
685 case SID_ATTR_TEXT_FITTOSIZE:
686 {
687 if( rReq.GetArgs() )
688 {
689 std::unique_ptr<SfxItemSet> pNewArgs = rReq.GetArgs()->Clone();
690 lcl_convertStringArguments(rReq.GetSlot(), pNewArgs);
691 mpDrawView->SetAttributes(*pNewArgs);
692 rReq.Done();
693 }
694 else
695 {
696 switch( rReq.GetSlot() )
697 {
698 case SID_ATTR_FILL_SHADOW:
699 case SID_ATTR_SHADOW_COLOR:
700 case SID_ATTR_SHADOW_TRANSPARENCE:
701 case SID_ATTR_SHADOW_BLUR:
702 case SID_ATTR_SHADOW_XDISTANCE:
703 case SID_ATTR_SHADOW_YDISTANCE:
704 case SID_ATTR_FILL_STYLE:
705 case SID_ATTR_FILL_COLOR:
706 case SID_ATTR_FILL_GRADIENT:
707 case SID_ATTR_FILL_HATCH:
708 case SID_ATTR_FILL_BITMAP:
709 case SID_ATTR_FILL_USE_SLIDE_BACKGROUND:
710 case SID_ATTR_FILL_TRANSPARENCE:
711 case SID_ATTR_FILL_FLOATTRANSPARENCE:
712 GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_AREA, SfxCallMode::ASYNCHRON );
713 break;
714 case SID_ATTR_LINE_STYLE:
715 case SID_ATTR_LINE_DASH:
716 case SID_ATTR_LINE_WIDTH:
717 case SID_ATTR_LINE_COLOR:
718 case SID_ATTR_LINE_TRANSPARENCE:
719 case SID_ATTR_LINE_JOINT:
720 case SID_ATTR_LINE_CAP:
721 GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_LINE, SfxCallMode::ASYNCHRON );
722 break;
723 case SID_ATTR_TEXT_FITTOSIZE:
724 GetViewFrame()->GetDispatcher()->Execute( SID_TEXTATTR_DLG, SfxCallMode::ASYNCHRON );
725 break;
726 }
727 }
728 Cancel();
729 }
730 break;
731
732 case SID_HYPHENATION:
733 {
734 const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_HYPHENATION);
735
736 if( pItem )
737 {
739 bool bValue = pItem->GetValue();
740 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
741 mpDrawView->SetAttributes( aSet );
742 }
743 else // only for testing purpose
744 {
745 OSL_FAIL(" no value for hyphenation!");
747 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, true ) );
748 mpDrawView->SetAttributes( aSet );
749 }
750 rReq.Done();
751 Cancel();
752 }
753 break;
754
755 case SID_INSERTPAGE:
756 case SID_INSERTPAGE_QUICK:
757 {
759 Cancel();
760 if(HasCurrentFunction(SID_BEZIER_EDIT) )
761 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
762 if (pNewPage != nullptr)
763 SwitchPage((pNewPage->GetPageNum()-1)/2);
764 rReq.Done ();
765 }
766 break;
767
768 case SID_DUPLICATE_PAGE:
769 {
771 SdPage* pNewPage = nullptr;
772 if(slideSorter)
774 else
775 pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage());
776 Cancel();
777 if(HasCurrentFunction(SID_BEZIER_EDIT) )
778 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
779 if(!slideSorter && pNewPage != nullptr)
780 SwitchPage((pNewPage->GetPageNum()-1)/2);
781 rReq.Done();
782 }
783 break;
784
785 case SID_INSERT_MASTER_PAGE:
786 {
787 // Use the API to create a new page.
788 Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
789 GetDoc()->getUnoModel(), UNO_QUERY);
790 if (xMasterPagesSupplier.is())
791 {
792 Reference<drawing::XDrawPages> xMasterPages (
793 xMasterPagesSupplier->getMasterPages());
794 if (xMasterPages.is())
795 {
796 sal_uInt16 nIndex = GetCurPagePos() + 1;
797 xMasterPages->insertNewByIndex (nIndex);
798
799 // Create shapes for the default layout.
800 SdPage* pMasterPage = GetDoc()->GetMasterSdPage(
802 pMasterPage->CreateTitleAndLayout (true,true);
803 }
804 }
805
806 Cancel();
807 if(HasCurrentFunction(SID_BEZIER_EDIT))
809 SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
810 rReq.Done ();
811 }
812 break;
813
814 case SID_MODIFYPAGE:
815 {
818 {
819 if ( mpDrawView->IsTextEdit() )
820 {
821 mpDrawView->SdrEndTextEdit();
822 }
823 sal_uInt16 nPage = maTabControl->GetCurPagePos();
825 ::sd::ViewShell::mpImpl->ProcessModifyPageSlot (
826 rReq,
828 mePageKind);
829 }
830
831 Cancel();
832 rReq.Done ();
833 }
834 break;
835
836 case SID_ASSIGN_LAYOUT:
837 {
839 {
840 if ( mpDrawView->IsTextEdit() )
841 mpDrawView->SdrEndTextEdit();
842
843 ::sd::ViewShell::mpImpl->AssignLayout(rReq, mePageKind);
844 }
845 Cancel();
846 rReq.Done ();
847 }
848 break;
849
850 case SID_RENAMEPAGE:
851 case SID_RENAME_MASTER_PAGE:
852 {
854 {
855 if ( mpDrawView->IsTextEdit() )
856 {
857 mpDrawView->SdrEndTextEdit();
858 }
859
860 sal_uInt16 nPage = maTabControl->GetCurPagePos();
861 SdPage* pCurrentPage = ( GetEditMode() == EditMode::Page )
862 ? GetDoc()->GetSdPage( nPage, GetPageKind() )
863 : GetDoc()->GetMasterSdPage( nPage, GetPageKind() );
864
865 OUString aTitle = SdResId(STR_TITLE_RENAMESLIDE);
866 OUString aDescr = SdResId(STR_DESC_RENAMESLIDE);
867 const OUString& aPageName = pCurrentPage->GetName();
868
869 if(rReq.GetArgs())
870 {
871 OUString aName = rReq.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue();
872
873 bool bResult = RenameSlide( maTabControl->GetPageId(nPage), aName );
874 DBG_ASSERT( bResult, "Couldn't rename slide" );
875 }
876 else
877 {
879 ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aPageName, aDescr));
880 aNameDlg->SetText( aTitle );
881 aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true );
882 aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
883
884 if( aNameDlg->Execute() == RET_OK )
885 {
886 OUString aNewName;
887 aNameDlg->GetName( aNewName );
888 if (aNewName != aPageName)
889 {
890 bool bResult = RenameSlide( maTabControl->GetPageId(nPage), aNewName );
891 DBG_ASSERT( bResult, "Couldn't rename slide" );
892 }
893 }
894 }
895 }
896 Cancel();
897 rReq.Ignore();
898 }
899 break;
900
901 case SID_RENAMEPAGE_QUICK:
902 {
904 {
905 if ( mpDrawView->IsTextEdit() )
906 {
907 mpDrawView->SdrEndTextEdit();
908 }
909
910 maTabControl->StartEditMode( maTabControl->GetCurPageId() );
911 }
912
913 Cancel();
914 rReq.Ignore ();
915 }
916 break;
917
918 case SID_PAGESIZE : // either this (no menu entries or something else!)
919 {
920 const SfxItemSet *pArgs = rReq.GetArgs ();
921
922 if (pArgs && pArgs->Count () == 3)
923 {
924 const SfxUInt32Item* pWidth = rReq.GetArg<SfxUInt32Item>(ID_VAL_PAGEWIDTH);
925 const SfxUInt32Item* pHeight = rReq.GetArg<SfxUInt32Item>(ID_VAL_PAGEHEIGHT);
926 const SfxBoolItem* pScaleAll = rReq.GetArg<SfxBoolItem>(ID_VAL_SCALEOBJECTS);
927
928 Size aSize (pWidth->GetValue (), pHeight->GetValue ());
929
930 SetupPage (aSize, 0, 0, 0, 0, true, false, pScaleAll->GetValue ());
931 rReq.Ignore ();
932 break;
933 }
934#if HAVE_FEATURE_SCRIPTING
936#endif
937 rReq.Ignore ();
938 break;
939 }
940
941 case SID_PAGEMARGIN : // or this (no menu entries or something else!)
942 {
943 const SfxItemSet *pArgs = rReq.GetArgs ();
944
945 if (pArgs && pArgs->Count () == 5)
946 {
947 const SfxUInt32Item* pLeft = rReq.GetArg<SfxUInt32Item>(ID_VAL_PAGELEFT);
948 const SfxUInt32Item* pRight = rReq.GetArg<SfxUInt32Item>(ID_VAL_PAGERIGHT);
949 const SfxUInt32Item* pUpper = rReq.GetArg<SfxUInt32Item>(ID_VAL_PAGETOP);
950 const SfxUInt32Item* pLower = rReq.GetArg<SfxUInt32Item>(ID_VAL_PAGEBOTTOM);
951 const SfxBoolItem* pScaleAll = rReq.GetArg<SfxBoolItem>(ID_VAL_SCALEOBJECTS);
952
953 Size aEmptySize (0, 0);
954
955 SetupPage (aEmptySize, pLeft->GetValue (), pRight->GetValue (),
956 pUpper->GetValue (), pLower->GetValue (),
957 false, true, pScaleAll->GetValue ());
958 rReq.Ignore ();
959 break;
960 }
961#if HAVE_FEATURE_SCRIPTING
963#endif
964 rReq.Ignore ();
965 break;
966 }
967
968 case SID_ATTR_ZOOMSLIDER:
969 {
970 const SfxItemSet* pArgs = rReq.GetArgs();
971
972 const SfxUInt16Item* pScale = (pArgs && pArgs->Count () == 1) ?
973 rReq.GetArg(SID_ATTR_ZOOMSLIDER) : nullptr;
974 if (pScale && CHECK_RANGE (5, pScale->GetValue (), 3000))
975 {
976 SetZoom (pScale->GetValue ());
977
978 SfxBindings& rBindings = GetViewFrame()->GetBindings();
979 rBindings.Invalidate( SID_ATTR_ZOOM );
980 rBindings.Invalidate( SID_ZOOM_IN );
981 rBindings.Invalidate( SID_ZOOM_OUT );
982 rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
983
984 }
985
986 Cancel();
987 rReq.Done ();
988 break;
989 }
990
991 case SID_ATTR_ZOOM:
992 {
993 const SfxItemSet* pArgs = rReq.GetArgs();
994 mbZoomOnPage = false;
995
996 if ( pArgs )
997 {
998 SvxZoomType eZT = pArgs->Get( SID_ATTR_ZOOM ).GetType();
999 switch( eZT )
1000 {
1001 case SvxZoomType::PERCENT:
1002 SetZoom( static_cast<::tools::Long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) );
1003 break;
1004
1005 case SvxZoomType::OPTIMAL:
1006 GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_ALL,
1007 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
1008 break;
1009
1010 case SvxZoomType::PAGEWIDTH:
1011 GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE_WIDTH,
1012 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
1013 break;
1014
1015 case SvxZoomType::WHOLEPAGE:
1016 GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE,
1017 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
1018 break;
1019 case SvxZoomType::PAGEWIDTH_NOBORDER:
1020 OSL_FAIL("sd::DrawViewShell::FuTemporary(), SvxZoomType::PAGEWIDTH_NOBORDER not handled!" );
1021 break;
1022 }
1023 rReq.Ignore ();
1024 }
1025 else
1026 {
1027 // open zoom dialog
1029 }
1030 Cancel();
1031 }
1032 break;
1033
1034 case SID_CHANGEBEZIER:
1035 case SID_CHANGEPOLYGON:
1036 if ( mpDrawView->IsTextEdit() )
1037 {
1038 mpDrawView->SdrEndTextEdit();
1039 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
1040 }
1041
1042 if ( mpDrawView->IsPresObjSelected() )
1043 {
1044 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
1045 VclMessageType::Info, VclButtonsType::Ok,
1046 SdResId(STR_ACTION_NOTPOSSIBLE)));
1047 xInfoBox->run();
1048 }
1049 else
1050 {
1051 if( rReq.GetSlot() == SID_CHANGEBEZIER )
1052 {
1054 mpDrawView->ConvertMarkedToPathObj(false);
1055 }
1056 else
1057 {
1058 if( mpDrawView->IsVectorizeAllowed() )
1059 {
1061 }
1062 else
1063 {
1065 mpDrawView->ConvertMarkedToPolyObj();
1066 }
1067 }
1068
1069 Invalidate(SID_CHANGEBEZIER);
1070 Invalidate(SID_CHANGEPOLYGON);
1071 }
1072 Cancel();
1073
1074 if( HasCurrentFunction(SID_BEZIER_EDIT) )
1075 { // where applicable, activate right edit action
1076 GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
1077 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
1078 }
1079 rReq.Ignore ();
1080 break;
1081
1082 case SID_CONVERT_TO_CONTOUR:
1083 if ( mpDrawView->IsTextEdit() )
1084 {
1085 mpDrawView->SdrEndTextEdit();
1086 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
1087 }
1088
1089 if ( mpDrawView->IsPresObjSelected() )
1090 {
1091 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
1092 VclMessageType::Info, VclButtonsType::Ok,
1093 SdResId(STR_ACTION_NOTPOSSIBLE)));
1094 xInfoBox->run();
1095 }
1096 else
1097 {
1099 mpDrawView->ConvertMarkedToPathObj(true);
1100
1101 Invalidate(SID_CONVERT_TO_CONTOUR);
1102 }
1103 Cancel();
1104
1105 rReq.Ignore ();
1106 break;
1107
1108 case SID_CONVERT_TO_METAFILE:
1109 case SID_CONVERT_TO_BITMAP:
1110 {
1111 // End text edit mode when it is active because the metafile or
1112 // bitmap that will be created does not support it.
1113 if ( mpDrawView->IsTextEdit() )
1114 {
1115 mpDrawView->SdrEndTextEdit();
1116 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
1117 }
1118
1119 if ( mpDrawView->IsPresObjSelected(true,true,true) )
1120 {
1121 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
1122 VclMessageType::Info, VclButtonsType::Ok,
1123 SdResId(STR_ACTION_NOTPOSSIBLE)));
1124 xInfoBox->run();
1125 }
1126 else
1127 {
1129
1130 // create SdrGrafObj from metafile/bitmap
1131 Graphic aGraphic;
1132 switch (nSId)
1133 {
1134 case SID_CONVERT_TO_METAFILE:
1135 {
1136 // switch on undo for the next operations
1137 mpDrawView->BegUndo(SdResId(STR_UNDO_CONVERT_TO_METAFILE));
1138 GDIMetaFile aMetaFile(mpDrawView->GetMarkedObjMetaFile());
1139 aGraphic = Graphic(aMetaFile);
1140 }
1141 break;
1142 case SID_CONVERT_TO_BITMAP:
1143 {
1144 // Disable spelling during conversion
1145 bool bOnlineSpell = GetDoc()->GetOnlineSpell();
1146 GetDoc()->SetOnlineSpell(false);
1147
1148 // switch on undo for the next operations
1149 mpDrawView->BegUndo(SdResId(STR_UNDO_CONVERT_TO_BITMAP));
1150 bool bDone(false);
1151
1152 // I have to get the image here directly since GetMarkedObjBitmapEx works
1153 // based on Bitmaps, but not on BitmapEx, thus throwing away the alpha
1154 // channel. Argh! GetMarkedObjBitmapEx itself is too widely used to safely
1155 // change that, e.g. in the exchange formats. For now I can only add this
1156 // exception to get good results for Svgs. This is how the code gets more
1157 // and more crowded, at last I made a remark for myself to change this
1158 // as one of the next tasks.
1159 if(1 == mpDrawView->GetMarkedObjectCount())
1160 {
1161 const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->GetMarkedObjectByIndex(0));
1162
1163 if(pSdrGrafObj && pSdrGrafObj->isEmbeddedVectorGraphicData())
1164 {
1165 aGraphic = Graphic(pSdrGrafObj->GetGraphic().getVectorGraphicData()->getReplacement());
1166 bDone = true;
1167 }
1168 }
1169
1170 if(!bDone)
1171 {
1172 aGraphic = Graphic(mpDrawView->GetMarkedObjBitmapEx());
1173 }
1174 // Restore online spelling
1175 GetDoc()->SetOnlineSpell(bOnlineSpell);
1176 }
1177 break;
1178 }
1179
1180 // create new object
1181 rtl::Reference<SdrGrafObj> pGraphicObj = new SdrGrafObj(
1182 *GetDoc(),
1183 aGraphic);
1184
1185 // get some necessary info and ensure it
1186 const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList());
1187 const size_t nMarkCount(rMarkList.GetMarkCount());
1188 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1189 OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
1190 OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)");
1191
1192 // fit rectangle of new graphic object to selection's mark rect
1193 ::tools::Rectangle aAllMarkedRect;
1194 rMarkList.TakeBoundRect(pPageView, aAllMarkedRect);
1195 pGraphicObj->SetLogicRect(aAllMarkedRect);
1196
1197 // #i71540# to keep the order, it is necessary to replace the lowest object
1198 // of the selection with the new object. This also means that with multi
1199 // selection, all other objects need to be deleted first
1200 SdrMark* pFirstMark = rMarkList.GetMark(0);
1201 SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj();
1202
1203 if(nMarkCount > 1)
1204 {
1205 // take first object out of selection
1206 mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true);
1207
1208 // clear remaining selection
1209 mpDrawView->DeleteMarkedObj();
1210 }
1211
1212 // #i124816# copy layer from lowest object which gets replaced
1213 pGraphicObj->SetLayer(pReplacementCandidate->GetLayer());
1214
1215 // now replace lowest object with new one
1216 mpDrawView->ReplaceObjectAtView(pReplacementCandidate, *pPageView, pGraphicObj.get());
1217
1218 // switch off undo
1219 mpDrawView->EndUndo();
1220 }
1221 }
1222
1223 Cancel();
1224
1225 rReq.Done ();
1226 break;
1227
1228 case SID_REMOVE_HYPERLINK:
1229 {
1230 if (mpDrawView->IsTextEdit())
1231 {
1232 // First make sure the field is selected
1233 OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
1234 if (pOutView)
1235 {
1236 pOutView->SelectFieldAtCursor();
1238 }
1239 }
1240 }
1241 Cancel();
1242 rReq.Done ();
1243 break;
1244
1245 case SID_SET_DEFAULT:
1246 {
1247 std::optional<SfxItemSet> pSet;
1248
1249 if (mpDrawView->IsTextEdit())
1250 {
1251 pSet.emplace( GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END> );
1252 mpDrawView->SetAttributes( *pSet, true );
1253 }
1254 else
1255 {
1256 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
1257 const size_t nCount = rMarkList.GetMarkCount();
1258
1259 // For every presentation object a SfxItemSet of hard attributes
1260 // and the UserCall is stored in this list. This is because
1261 // at the following mpDrawView->SetAttributes( *pSet, sal_True )
1262 // they get lost and have to be restored.
1263 std::vector<std::pair<std::unique_ptr<SfxItemSet>,SdrObjUserCall*> > aAttrList;
1264 SdPage* pPresPage = static_cast<SdPage*>( mpDrawView->GetSdrPageView()->GetPage() );
1265
1266 for ( size_t i = 0; i < nCount; ++i )
1267 {
1268 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1269
1270 if( pPresPage->IsPresObj( pObj ) )
1271 {
1272 auto pNewSet = std::make_unique<SfxItemSetFixed<SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT>>( GetDoc()->GetPool() );
1273 pNewSet->Put(pObj->GetMergedItemSet());
1274 aAttrList.emplace_back(std::move(pNewSet), pObj->GetUserCall());
1275 }
1276 }
1277
1278 pSet.emplace( GetPool() );
1279 mpDrawView->SetAttributes( *pSet, true );
1280
1281 sal_uLong j = 0;
1282
1283 for ( size_t i = 0; i < nCount; ++i )
1284 {
1285 SfxStyleSheet* pSheet = nullptr;
1286 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1287
1288 if (pObj->GetObjIdentifier() == SdrObjKind::TitleText)
1289 {
1291 if (pSheet)
1292 pObj->SetStyleSheet(pSheet, false);
1293 }
1294 else if(pObj->GetObjIdentifier() == SdrObjKind::OutlineText)
1295 {
1296 for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
1297 {
1299 DBG_ASSERT(pSheet, "Template for outline object not found");
1300 if (pSheet)
1301 {
1302 pObj->StartListening(*pSheet);
1303
1304 if( nLevel == 1 )
1305 // text frame listens on StyleSheet of level1
1306 pObj->NbcSetStyleSheet(pSheet, false);
1307 }
1308 }
1309 }
1310
1311 if( pPresPage->IsPresObj( pObj ) )
1312 {
1313 std::pair<std::unique_ptr<SfxItemSet>,SdrObjUserCall*> &rAttr = aAttrList[j++];
1314
1315 std::unique_ptr<SfxItemSet> & pNewSet(rAttr.first);
1316 SdrObjUserCall* pUserCall = rAttr.second;
1317
1318 if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SfxItemState::SET )
1319 {
1320 pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT));
1321 }
1322
1323 if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SfxItemState::SET )
1324 {
1325 pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT));
1326 }
1327
1328 if( pUserCall )
1329 pObj->SetUserCall( pUserCall );
1330 }
1331 }
1332 }
1333
1334 pSet.reset();
1335 Cancel();
1336 }
1337 break;
1338
1339 case SID_DELETE_SNAPITEM:
1340 {
1341 SdrPageView* pPV;
1343 sal_uInt16 nHitLog = static_cast<sal_uInt16>(GetActiveWindow()->PixelToLogic( Size(
1344 FuPoor::HITPIX, 0 ) ).Width());
1345 sal_uInt16 nHelpLine;
1346
1347 if( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow()->GetOutDev(), nHelpLine, pPV) )
1348 {
1349 pPV->DeleteHelpLine( nHelpLine );
1350 }
1351 Cancel();
1352 rReq.Ignore ();
1353 }
1354 break;
1355
1356 case SID_DELETE_PAGE:
1357 case SID_DELETE_MASTER_PAGE:
1359 Cancel();
1360 rReq.Ignore ();
1361 break;
1362
1363 case SID_DELETE_LAYER:
1365 Cancel();
1366 rReq.Ignore ();
1367 break;
1368
1369 case SID_ORIGINAL_SIZE:
1370 mpDrawView->SetMarkedOriginalSize();
1371 Cancel();
1372 rReq.Done();
1373 break;
1374
1375 case SID_DRAW_FONTWORK:
1376 case SID_DRAW_FONTWORK_VERTICAL:
1377 {
1378 svx::FontworkBar::execute(*mpView, rReq, GetViewFrame()->GetBindings()); // SJ: can be removed (I think)
1379 Cancel();
1380 rReq.Done();
1381 }
1382 break;
1383
1384 case SID_SAVE_GRAPHIC:
1385 {
1386 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
1387 if( rMarkList.GetMarkCount() == 1 )
1388 {
1389 const SdrGrafObj* pObj = dynamic_cast<const SdrGrafObj*>(rMarkList.GetMark(0)->GetMarkedSdrObj());
1390 if (pObj && pObj->GetGraphicType() == GraphicType::Bitmap)
1391 {
1392 weld::Window* pFrame = GetFrameWeld();
1393 GraphicAttr aGraphicAttr = pObj->GetGraphicAttr();
1394 short nState = RET_CANCEL;
1395 if (aGraphicAttr != GraphicAttr()) // the image has been modified
1396 {
1397 if (pFrame)
1398 {
1400 }
1401 }
1402 else
1403 {
1404 nState = RET_NO;
1405 }
1406
1407 if (nState == RET_YES)
1408 {
1410 }
1411 else if (nState == RET_NO)
1412 {
1413 const GraphicObject& aGraphicObject(pObj->GetGraphicObject());
1414 GraphicHelper::ExportGraphic(pFrame, aGraphicObject.GetGraphic(), "");
1415 }
1416 }
1417 }
1418 Cancel();
1419 rReq.Ignore();
1420 }
1421 break;
1422
1423 case SID_EXTERNAL_EDIT:
1424 {
1425 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
1426 if( rMarkList.GetMarkCount() == 1 )
1427 {
1428 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
1429 if( auto pGraphicObj = dynamic_cast<SdrGrafObj*>( pObj ) )
1430 if( pGraphicObj->GetGraphicType() == GraphicType::Bitmap )
1431 {
1432 GraphicObject aGraphicObject( pGraphicObj->GetGraphicObject() );
1433 m_ExternalEdits.push_back(
1434 std::make_unique<SdrExternalToolEdit>(
1435 mpDrawView.get(), pGraphicObj));
1436 m_ExternalEdits.back()->Edit( &aGraphicObject );
1437 }
1438 }
1439 Cancel();
1440 rReq.Ignore();
1441 }
1442 break;
1443
1444 case SID_COMPRESS_GRAPHIC:
1445 {
1446 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
1447 if( rMarkList.GetMarkCount() == 1 )
1448 {
1449 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
1450
1451 if( auto pGraphicObj = dynamic_cast<SdrGrafObj*>( pObj ) )
1452 if( pGraphicObj->GetGraphicType() == GraphicType::Bitmap )
1453 {
1454 CompressGraphicsDialog dialog(GetFrameWeld(), pGraphicObj, GetViewFrame()->GetBindings() );
1455 if (dialog.run() == RET_OK)
1456 {
1458 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1459 OUString aUndoString = mpDrawView->GetDescriptionOfMarkedObjects() + " Compress";
1460 mpDrawView->BegUndo( aUndoString );
1461 mpDrawView->ReplaceObjectAtView( pObj, *pPageView, pNewObject.get() );
1462 mpDrawView->EndUndo();
1463 }
1464 }
1465 }
1466 Cancel();
1467 rReq.Ignore();
1468 }
1469 break;
1470
1471 case SID_GRAPHIC_SIZE_CHECK:
1472 {
1474 svx::GenericCheckDialog aDialog(GetFrameWeld(), aResult);
1475 aDialog.run();
1476
1477 Cancel();
1478 rReq.Ignore();
1479 }
1480 break;
1481
1482 case SID_ATTRIBUTES_LINE: // BASIC
1483 {
1485 if (rReq.GetArgs())
1486 Cancel();
1487 }
1488 break;
1489
1490 case SID_ATTRIBUTES_AREA: // BASIC
1491 {
1493 if (rReq.GetArgs())
1494 Cancel();
1495 }
1496 break;
1497
1498 case SID_ATTR_TRANSFORM:
1499 {
1501 // tdf#138963 conditions tested for here must be the same as those
1502 // of the early returns from FuTransform::DoExecute
1503 if (rReq.GetArgs() || !mpDrawView->AreObjectsMarked())
1504 {
1505 Invalidate(SID_RULER_OBJECT);
1506 Cancel();
1507 }
1508 }
1509 break;
1510 case SID_MOVE_SHAPE_HANDLE:
1511 {
1512 const SfxItemSet *pArgs = rReq.GetArgs ();
1513 if (pArgs && pArgs->Count () >= 3)
1514 {
1515 const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1);
1516 const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2);
1517 const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3);
1518 const SfxInt32Item* OrdNum = rReq.GetArg<SfxInt32Item>(FN_PARAM_4);
1519
1520 const sal_uLong handleNum = handleNumItem->GetValue();
1521 const sal_uLong newPosX = convertTwipToMm100(newPosXTwips->GetValue());
1522 const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue());
1523
1524 mpDrawView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), OrdNum ? OrdNum->GetValue() : -1);
1525 Cancel();
1526 }
1527 break;
1528 }
1529 case SID_CHAR_DLG_EFFECT:
1530 case SID_CHAR_DLG: // BASIC
1531 {
1533 Cancel();
1534 }
1535 break;
1536
1537 case SID_PARA_DLG:
1538 {
1540 Cancel();
1541 }
1542 break;
1543
1544 case FN_NUM_BULLET_ON:
1545 {
1546 // The value (sal_uInt16)0xFFFF means set bullet on/off.
1547 SfxUInt16Item aItem(FN_SVX_SET_BULLET, sal_uInt16(0xFFFF));
1548 GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_BULLET,
1549 SfxCallMode::RECORD, { &aItem });
1550 }
1551 break;
1552
1553 case FN_NUM_NUMBERING_ON:
1554 {
1555 // The value (sal_uInt16)0xFFFF means set bullet on/off.
1556 SfxUInt16Item aItem(FN_SVX_SET_NUMBER, sal_uInt16(0xFFFF));
1557 GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_NUMBER,
1558 SfxCallMode::RECORD, { &aItem });
1559 }
1560 break;
1561
1562 case SID_OUTLINE_BULLET:
1563 case FN_SVX_SET_BULLET:
1564 case FN_SVX_SET_NUMBER:
1565 {
1567 Cancel();
1568 }
1569 break;
1570
1571 case FN_INSERT_SOFT_HYPHEN:
1572 case FN_INSERT_HARDHYPHEN:
1573 case FN_INSERT_HARD_SPACE:
1574 case FN_INSERT_NNBSP:
1575 case SID_INSERT_RLM :
1576 case SID_INSERT_LRM :
1577 case SID_INSERT_WJ :
1578 case SID_INSERT_ZWSP:
1579 case SID_CHARMAP:
1580 {
1582 Cancel();
1583 }
1584 break;
1585
1586 case SID_PRESENTATION_LAYOUT:
1587 {
1589 Cancel();
1590 }
1591 break;
1592
1593 case SID_PASTE_SPECIAL:
1594 {
1596 Cancel();
1597 rReq.Ignore ();
1598 }
1599 break;
1600
1601 case SID_CHANGE_PICTURE:
1602 case SID_INSERT_GRAPHIC:
1603 {
1605 nSId == SID_CHANGE_PICTURE ) );
1606 Cancel();
1607 rReq.Ignore ();
1608 }
1609 break;
1610
1611 case SID_INSERT_AVMEDIA:
1612 {
1614
1615 Cancel();
1616 rReq.Ignore ();
1617 }
1618 break;
1619
1620 case SID_INSERT_OBJECT:
1621 case SID_INSERT_FLOATINGFRAME:
1622 case SID_INSERT_MATH:
1623 case SID_INSERT_DIAGRAM:
1624 case SID_ATTR_TABLE:
1625 {
1627 // Set the selection tool as the old one. This in particular important for the
1628 // zoom function, in which clicking without dragging zooms as well, and that
1629 // makes exiting the object editing mode impossible.
1630 if (dynamic_cast<FuSelection*>( GetOldFunction().get() ) == nullptr)
1632 Cancel();
1633 rReq.Ignore ();
1634 }
1635 break;
1636 case SID_CLASSIFICATION_APPLY:
1637 {
1638 const SfxItemSet* pArgs = rReq.GetArgs();
1639 const SfxPoolItem* pItem = nullptr;
1640 if (pArgs && pArgs->GetItemState(nSId, false, &pItem) == SfxItemState::SET)
1641 {
1642 const OUString& rName = static_cast<const SfxStringItem*>(pItem)->GetValue();
1643 auto eType = SfxClassificationPolicyType::IntellectualProperty;
1644 if (pArgs->GetItemState(SID_TYPE_NAME, false, &pItem) == SfxItemState::SET)
1645 {
1646 const OUString& rType = static_cast<const SfxStringItem*>(pItem)->GetValue();
1648 }
1649 if (SfxViewFrame* pViewFrame = GetViewFrame())
1650 {
1651 if (SfxObjectShell* pObjectShell = pViewFrame->GetObjectShell())
1652 {
1653 SfxClassificationHelper aHelper(pObjectShell->getDocProperties());
1654 aHelper.SetBACName(rName, eType);
1655 }
1656 }
1657 }
1658 else
1659 SAL_WARN("sd.ui", "missing parameter for SID_CLASSIFICATION_APPLY");
1660
1661 Cancel();
1662 rReq.Ignore();
1663 }
1664 break;
1665
1666 case SID_CLASSIFICATION_DIALOG:
1667 {
1668 if (SfxObjectShell* pObjShell = SfxObjectShell::Current())
1669 {
1670 css::uno::Reference<css::document::XDocumentProperties> xDocProps(pObjShell->getDocProperties());
1671 auto xDialog = std::make_shared<svx::ClassificationDialog>(GetFrameWeld(), xDocProps, false, [](){} );
1672 ClassificationCollector aCollector(*this, xDocProps);
1673 aCollector.collect();
1674
1675 xDialog->setupValues(std::vector(aCollector.getResults()));
1676
1677 if (RET_OK == xDialog->run())
1678 {
1679 ClassificationInserter aInserter(*this, xDocProps);
1680 aInserter.insert(xDialog->getResult());
1681 }
1682 xDialog.reset();
1683 }
1684
1685 Cancel();
1686 rReq.Ignore();
1687 }
1688 break;
1689
1690 case SID_COPYOBJECTS:
1691 {
1692 if ( mpDrawView->IsPresObjSelected(false) )
1693 {
1694 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
1695 VclMessageType::Info, VclButtonsType::Ok,
1696 SdResId(STR_ACTION_NOTPOSSIBLE)));
1697 xInfoBox->run();
1698 }
1699 else
1700 {
1701 if ( mpDrawView->IsTextEdit() )
1702 {
1703 mpDrawView->SdrEndTextEdit();
1704 }
1705
1707 }
1708 Cancel();
1709 rReq.Ignore ();
1710 }
1711 break;
1712
1713 case SID_INSERTFILE: // BASIC
1714 {
1718 Cancel();
1719 rReq.Done ();
1720 }
1721 break;
1722
1723 case SID_SELECT_BACKGROUND:
1724 case SID_SAVE_BACKGROUND:
1725 case SID_ATTR_PAGE_SIZE:
1726 case SID_ATTR_PAGE:
1727 case SID_PAGESETUP: // BASIC ??
1728 {
1730 Cancel();
1731 rReq.Ignore (); // we generate independent macros !!
1732 }
1733 break;
1734
1735 case SID_BEFORE_OBJ:
1736 case SID_BEHIND_OBJ:
1737 {
1739 rReq.Done();
1740 // finishes itself, no Cancel() needed!
1741 }
1742 break;
1743
1744 case SID_REVERSE_ORDER: // BASIC
1745 {
1746 mpDrawView->ReverseOrderOfMarked();
1747 Cancel();
1748 rReq.Done ();
1749 }
1750 break;
1751
1752 case SID_ANIMATION_EFFECTS:
1753 {
1755 Cancel();
1756 }
1757 break;
1758
1759 case SID_EXECUTE_ANIMATION_EFFECT:
1760 {
1762 mpDrawView.get(), GetDoc(), rReq));
1763 Cancel();
1764 }
1765 break;
1766
1767 case SID_LINEEND_POLYGON:
1768 {
1770 Cancel();
1771 }
1772 break;
1773
1774 case SID_CAPTUREPOINT:
1775 // negative value to signal call from menu
1776 maMousePos = Point(-1,-1);
1777 [[fallthrough]];
1778 case SID_SET_SNAPITEM:
1779 {
1781 Cancel();
1782 }
1783 break;
1784
1785 case SID_MANAGE_LINKS:
1786 {
1788 Cancel();
1789 rReq.Ignore ();
1790 }
1791 break;
1792
1793 case SID_THESAURUS:
1794 {
1796 Cancel();
1797 rReq.Ignore ();
1798 }
1799 break;
1800
1801 case SID_TEXTATTR_DLG:
1802 {
1803 if (mpDrawView->IsTextEdit())
1804 mpDrawView->SdrEndTextEdit();
1806 Cancel();
1807 rReq.Ignore ();
1808 }
1809 break;
1810
1811 case SID_MEASURE_DLG:
1812 {
1814 Cancel();
1815 rReq.Ignore ();
1816 }
1817 break;
1818
1819 case SID_CONNECTION_DLG:
1820 {
1822 Cancel();
1823 rReq.Done();
1824 }
1825 break;
1826
1827 case SID_CONNECTION_NEW_ROUTING:
1828 {
1830 GetView()->SetAttributes( aDefAttr, true ); // (ReplaceAll)
1831
1832 Cancel();
1833 rReq.Done();
1834 }
1835 break;
1836
1837 case SID_TWAIN_SELECT:
1838 {
1839 if( mxScannerManager.is() )
1840 {
1841 try
1842 {
1843 const css::uno::Sequence< css::scanner::ScannerContext >
1844 aContexts( mxScannerManager->getAvailableScanners() );
1845
1846 if( aContexts.hasElements() )
1847 {
1848 css::scanner::ScannerContext aContext( aContexts.getConstArray()[ 0 ] );
1849
1850 Reference<lang::XInitialization> xInit(mxScannerManager, UNO_QUERY);
1851 if (xInit.is())
1852 {
1853 // initialize dialog
1854 weld::Window* pWindow = rReq.GetFrameWeld();
1855 uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence(
1856 {
1857 {"ParentWindow", pWindow ? uno::Any(pWindow->GetXWindow()) : uno::Any(Reference<awt::XWindow>())}
1858 }));
1859 xInit->initialize( aSeq );
1860 }
1861
1862 mxScannerManager->configureScannerAndScan( aContext, mxScannerListener );
1863 }
1864 }
1865 catch(...)
1866 {
1867 }
1868 }
1869
1870 Cancel();
1871 rReq.Done();
1872 }
1873 break;
1874
1875 case SID_TWAIN_TRANSFER:
1876 {
1877 bool bDone = false;
1878
1879 if( mxScannerManager.is() )
1880 {
1881 try
1882 {
1883 const css::uno::Sequence< css::scanner::ScannerContext > aContexts( mxScannerManager->getAvailableScanners() );
1884
1885 if( aContexts.hasElements() )
1886 {
1887 mxScannerManager->startScan( aContexts.getConstArray()[ 0 ], mxScannerListener );
1888 bDone = true;
1889 }
1890 }
1891 catch( ... )
1892 {
1893 }
1894 }
1895
1896 if( !bDone )
1897 {
1898 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
1899 VclMessageType::Info, VclButtonsType::Ok,
1900#ifndef UNX
1901 SdResId(STR_TWAIN_NO_SOURCE)
1902#else
1903 SdResId(STR_TWAIN_NO_SOURCE_UNX)
1904#endif
1905 ));
1906 xInfoBox->run();
1907
1908 }
1909 else
1910 {
1911 SfxBindings& rBindings = GetViewFrame()->GetBindings();
1912 rBindings.Invalidate( SID_TWAIN_SELECT );
1913 rBindings.Invalidate( SID_TWAIN_TRANSFER );
1914 }
1915
1916 Cancel();
1917 rReq.Done();
1918 }
1919 break;
1920
1921 case SID_POLYGON_MORPHING:
1922 {
1924 Cancel();
1925 }
1926 break;
1927
1928 case SID_INSERTLAYER:
1929 {
1930 if ( mpDrawView->IsTextEdit() )
1931 {
1932 mpDrawView->SdrEndTextEdit();
1933 }
1934
1935 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
1936 sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount();
1937 sal_uInt16 nLayer = nLayerCnt - 2 + 1;
1938 OUString aLayerName = SdResId(STR_LAYER) + OUString::number(nLayer);
1939 OUString aLayerTitle, aLayerDesc;
1940 bool bIsVisible = false;
1941 bool bIsLocked = false;
1942 bool bIsPrintable = false;
1943
1944 const SfxItemSet* pArgs = rReq.GetArgs();
1945
1946 if (! pArgs)
1947 {
1949
1950 aNewAttr.Put( makeSdAttrLayerName( aLayerName ) );
1951 aNewAttr.Put( makeSdAttrLayerTitle() );
1952 aNewAttr.Put( makeSdAttrLayerDesc() );
1953 aNewAttr.Put( makeSdAttrLayerVisible() );
1954 aNewAttr.Put( makeSdAttrLayerPrintable() );
1955 aNewAttr.Put( makeSdAttrLayerLocked() );
1956 aNewAttr.Put( makeSdAttrLayerThisPage() );
1957
1959 vcl::Window* pWin = GetActiveWindow();
1960 ScopedVclPtr<AbstractSdInsertLayerDlg> pDlg( pFact->CreateSdInsertLayerDlg(pWin ? pWin->GetFrameWeld() : nullptr, aNewAttr, true, SdResId(STR_INSERTLAYER)) );
1961 pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_INSERTLAYER )->GetCommand() );
1962
1963 // test for already existing names
1964 bool bLoop = true;
1965 while( bLoop && pDlg->Execute() == RET_OK )
1966 {
1967 pDlg->GetAttr( aNewAttr );
1968 aLayerName = aNewAttr.Get(ATTR_LAYER_NAME).GetValue ();
1969
1970 if( rLayerAdmin.GetLayer( aLayerName )
1971 || aLayerName.isEmpty()
1973 {
1974 // name already exists
1975 std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(),
1976 VclMessageType::Warning, VclButtonsType::Ok,
1977 SdResId(STR_WARN_NAME_DUPLICATE)));
1978 xWarn->run();
1979 }
1980 else
1981 bLoop = false;
1982 }
1983 if( bLoop ) // was canceled
1984 {
1985 pDlg.disposeAndClear();
1986 Cancel();
1987 rReq.Ignore ();
1988 break;
1989 }
1990 else
1991 {
1992 aLayerTitle = aNewAttr.Get(ATTR_LAYER_TITLE).GetValue();
1993 aLayerDesc = aNewAttr.Get(ATTR_LAYER_DESC).GetValue ();
1994 bIsVisible = static_cast<const SfxBoolItem &>( aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
1995 bIsLocked = static_cast<const SfxBoolItem &>( aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue () ;
1996 bIsPrintable = static_cast<const SfxBoolItem &>( aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue () ;
1997 }
1998 }
1999 else if (pArgs->Count () != 4)
2000 {
2001#if HAVE_FEATURE_SCRIPTING
2003#endif
2004 Cancel();
2005 rReq.Ignore ();
2006 break;
2007 }
2008 else
2009 {
2010 const SfxStringItem* pLayerName = rReq.GetArg<SfxStringItem>(ID_VAL_LAYERNAME);
2011 const SfxBoolItem* pIsVisible = rReq.GetArg<SfxBoolItem>(ID_VAL_ISVISIBLE);
2012 const SfxBoolItem* pIsLocked = rReq.GetArg<SfxBoolItem>(ID_VAL_ISLOCKED);
2013 const SfxBoolItem* pIsPrintable = rReq.GetArg<SfxBoolItem>(ID_VAL_ISPRINTABLE);
2014
2015 aLayerName = pLayerName->GetValue ();
2016 bIsVisible = pIsVisible->GetValue ();
2017 bIsLocked = pIsLocked->GetValue ();
2018 bIsPrintable = pIsPrintable->GetValue ();
2019 }
2020
2021 OUString aPrevLayer = mpDrawView->GetActiveLayer();
2022 SdrLayer* pLayer;
2023 sal_uInt16 nPrevLayer = 0;
2024 nLayerCnt = rLayerAdmin.GetLayerCount();
2025
2026 for ( nLayer = 0; nLayer < nLayerCnt; nLayer++ )
2027 {
2028 pLayer = rLayerAdmin.GetLayer(nLayer);
2029 OUString aName = pLayer->GetName();
2030
2031 if ( aPrevLayer == aName )
2032 {
2033 nPrevLayer = std::max(nLayer, sal_uInt16(4));
2034 }
2035 }
2036
2037 mpDrawView->InsertNewLayer(aLayerName, nPrevLayer + 1);
2038 pLayer = rLayerAdmin.GetLayer(aLayerName);
2039 if( pLayer )
2040 {
2041 pLayer->SetTitle( aLayerTitle );
2042 pLayer->SetDescription( aLayerDesc );
2043 }
2044
2045 mpDrawView->SetLayerVisible( aLayerName, bIsVisible );
2046 mpDrawView->SetLayerLocked( aLayerName, bIsLocked);
2047 mpDrawView->SetLayerPrintable(aLayerName, bIsPrintable);
2048
2049 mpDrawView->SetActiveLayer(aLayerName);
2050
2052
2053 GetDoc()->SetChanged();
2054
2055 GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHLAYER,
2056 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
2057
2058 Cancel();
2059 rReq.Done ();
2060 }
2061 break;
2062
2063 case SID_MODIFYLAYER:
2064 {
2065 if(!GetLayerTabControl()) // #i87182#
2066 {
2067 OSL_ENSURE(false, "No LayerTabBar (!)");
2068 Cancel();
2069 rReq.Ignore();
2070 break;
2071 }
2072
2073 if ( mpDrawView->IsTextEdit() )
2074 {
2075 mpDrawView->SdrEndTextEdit();
2076 }
2077
2078 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
2079 sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId();
2080 OUString aLayerName = GetLayerTabControl()->GetLayerName(nCurPage);
2081 SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName);
2082
2083 OUString aLayerTitle = pLayer->GetTitle();
2084 OUString aLayerDesc = pLayer->GetDescription();
2085
2086 OUString aOldLayerName(aLayerName);
2087 OUString aOldLayerTitle(aLayerTitle);
2088 OUString aOldLayerDesc(aLayerDesc);
2089
2090 bool bIsVisible, bIsLocked, bIsPrintable;
2091 bool bOldIsVisible = bIsVisible = mpDrawView->IsLayerVisible(aLayerName);
2092 bool bOldIsLocked = bIsLocked = mpDrawView->IsLayerLocked(aLayerName);
2093 bool bOldIsPrintable = bIsPrintable = mpDrawView->IsLayerPrintable(aLayerName);
2094
2095 const SfxItemSet* pArgs = rReq.GetArgs();
2096 // is it allowed to delete the layer?
2097 bool bDelete = !( LayerTabBar::IsRealNameOfStandardLayer(aLayerName) );
2098
2099 if (! pArgs)
2100 {
2102
2103 aNewAttr.Put( makeSdAttrLayerName( aLayerName ) );
2104 aNewAttr.Put( makeSdAttrLayerTitle( aLayerTitle ) );
2105 aNewAttr.Put( makeSdAttrLayerDesc( aLayerDesc ) );
2106 aNewAttr.Put( makeSdAttrLayerVisible( bIsVisible ) );
2107 aNewAttr.Put( makeSdAttrLayerLocked( bIsLocked ) );
2108 aNewAttr.Put( makeSdAttrLayerPrintable( bIsPrintable ) );
2109 aNewAttr.Put( makeSdAttrLayerThisPage() );
2110
2112 vcl::Window* pWin = GetActiveWindow();
2113 ScopedVclPtr<AbstractSdInsertLayerDlg> pDlg( pFact->CreateSdInsertLayerDlg(pWin ? pWin->GetFrameWeld() : nullptr, aNewAttr, bDelete, SdResId(STR_MODIFYLAYER)) );
2114 pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_MODIFYLAYER )->GetCommand() );
2115
2116 // test for already existing names
2117 bool bLoop = true;
2118 sal_uInt16 nRet = 0;
2119 while( bLoop )
2120 {
2121 nRet = pDlg->Execute();
2122 if (nRet != RET_OK)
2123 break;
2124 pDlg->GetAttr( aNewAttr );
2125 aLayerName = aNewAttr.Get(ATTR_LAYER_NAME).GetValue ();
2126 if (bDelete)
2127 {
2128 if( (rLayerAdmin.GetLayer( aLayerName ) && aLayerName != aOldLayerName)
2131 || aLayerName.isEmpty() )
2132 {
2133 // name already exists
2134 std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(),
2135 VclMessageType::Warning, VclButtonsType::Ok,
2136 SdResId(STR_WARN_NAME_DUPLICATE)));
2137 xWarn->run();
2138 }
2139 else
2140 bLoop = false;
2141 }
2142 else
2143 bLoop = false; // altering name is already disabled in the dialog itself
2144 }
2145 switch (nRet)
2146 {
2147 case RET_OK :
2148 aLayerTitle = aNewAttr.Get(ATTR_LAYER_TITLE).GetValue ();
2149 aLayerDesc = aNewAttr.Get(ATTR_LAYER_DESC).GetValue ();
2150 bIsVisible = static_cast<const SfxBoolItem &>( aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
2151 bIsLocked = static_cast<const SfxBoolItem &>( aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue ();
2152 bIsPrintable = static_cast<const SfxBoolItem &>( aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue ();
2153 break;
2154
2155 default :
2156 pDlg.disposeAndClear();
2157 rReq.Ignore ();
2158 Cancel ();
2159 return;
2160 }
2161 }
2162 else if (pArgs->Count () == 4)
2163 {
2164 const SfxStringItem* pLayerName = rReq.GetArg<SfxStringItem>(ID_VAL_LAYERNAME);
2165 const SfxBoolItem* pIsVisible = rReq.GetArg<SfxBoolItem>(ID_VAL_ISVISIBLE);
2166 const SfxBoolItem* pIsLocked = rReq.GetArg<SfxBoolItem>(ID_VAL_ISLOCKED);
2167 const SfxBoolItem* pIsPrintable = rReq.GetArg<SfxBoolItem>(ID_VAL_ISPRINTABLE);
2168
2169 aLayerName = pLayerName->GetValue ();
2170 bIsVisible = pIsVisible->GetValue ();
2171 bIsLocked = pIsLocked->GetValue ();
2172 bIsPrintable = pIsPrintable->GetValue ();
2173 }
2174 else
2175 {
2176#if HAVE_FEATURE_SCRIPTING
2178#endif
2179 Cancel ();
2180 rReq.Ignore ();
2181 break;
2182 }
2183
2184 SfxUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager();
2185 std::unique_ptr<SdLayerModifyUndoAction> pAction( new SdLayerModifyUndoAction(
2186 GetDoc(),
2187 pLayer,
2188 // old values
2189 aOldLayerName,
2190 aOldLayerTitle,
2191 aOldLayerDesc,
2192 bOldIsVisible,
2193 bOldIsLocked,
2194 bOldIsPrintable,
2195 // new values
2196 aLayerName,
2197 aLayerTitle,
2198 aLayerDesc,
2199 bIsVisible,
2200 bIsLocked,
2201 bIsPrintable
2202 ) );
2203 pManager->AddUndoAction( std::move(pAction) );
2204
2205 ModifyLayer( pLayer, aLayerName, aLayerTitle, aLayerDesc, bIsVisible, bIsLocked, bIsPrintable );
2206
2207 Cancel();
2208 rReq.Done ();
2209 }
2210 break;
2211
2212 case SID_TOGGLELAYERVISIBILITY:
2213 {
2214 // tdf#113439; duplicates LayerTabBar::MouseButtonDown()
2215 sal_uInt16 aTabId = GetLayerTabControl()->GetCurPageId();
2216 OUString aName( GetLayerTabControl()->GetLayerName(aTabId) );
2217
2218 SdrPageView* pPV = mpDrawView->GetSdrPageView();
2219 bool bVisible = !pPV->IsLayerVisible(aName);
2220
2222
2224 GetDoc()->SetChanged();
2225
2226 Cancel();
2227 rReq.Ignore ();
2228 }
2229 break;
2230
2231 case SID_RENAMELAYER:
2232 {
2233 if ( mpDrawView->IsTextEdit() )
2234 {
2235 mpDrawView->SdrEndTextEdit();
2236 }
2237
2238 if(GetLayerTabControl()) // #i87182#
2239 {
2241 }
2242 else
2243 {
2244 OSL_ENSURE(false, "No LayerTabBar (!)");
2245 }
2246
2247 Cancel();
2248 rReq.Ignore ();
2249 }
2250 break;
2251
2252 case SID_EDIT_HYPERLINK :
2253 {
2254 // Ensure the field is selected first
2255 OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
2256 if (pOutView)
2257 pOutView->SelectFieldAtCursor();
2258
2259 GetViewFrame()->GetDispatcher()->Execute( SID_HYPERLINK_DIALOG );
2260
2261 Cancel();
2262 rReq.Done ();
2263 }
2264 break;
2265
2266 case SID_OPEN_HYPERLINK:
2267 {
2268 OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
2269 if ( pOutView )
2270 {
2271 const SvxFieldData* pField = pOutView->GetFieldAtCursor();
2272 if( auto pURLField = dynamic_cast< const SvxURLField *>( pField ) )
2273 {
2274 SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() );
2275 SfxStringItem aTarget( SID_TARGETNAME, pURLField->GetTargetFrame() );
2276
2277 OUString aReferName;
2278 SfxViewFrame* pFrame = GetViewFrame();
2279 SfxMedium* pMed = pFrame->GetObjectShell()->GetMedium();
2280 if (pMed)
2281 aReferName = pMed->GetName();
2282
2283 SfxFrameItem aFrm( SID_DOCFRAME, pFrame );
2284 SfxStringItem aReferer( SID_REFERER, aReferName );
2285
2286 SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
2287 SfxBoolItem aBrowsing( SID_BROWSE, true );
2288
2289 if (SfxViewFrame* pViewFrm = SfxViewFrame::Current())
2290 {
2291 pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
2292 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
2293 { &aUrl, &aTarget, &aFrm, &aReferer,
2294 &aNewView, &aBrowsing });
2295 }
2296 }
2297 }
2298 Cancel();
2299 rReq.Done ();
2300 }
2301 break;
2302
2303 case SID_COPY_HYPERLINK_LOCATION:
2304 {
2305 OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
2306 if ( pOutView )
2307 {
2308 const SvxFieldData* pField = pOutView->GetFieldAtCursor();
2309 if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField))
2310 {
2311 uno::Reference<datatransfer::clipboard::XClipboard> xClipboard
2312 = pOutView->GetWindow()->GetClipboard();
2313
2314 vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, SfxViewShell::Current());
2315 }
2316 }
2317
2318 Cancel();
2319 rReq.Done ();
2320 }
2321 break;
2322
2323 case SID_HYPERLINK_SETLINK:
2324 {
2325 const SfxItemSet* pReqArgs = rReq.GetArgs();
2326
2327 if (pReqArgs)
2328 {
2329 const SvxHyperlinkItem* pHLItem =
2330 &pReqArgs->Get(SID_HYPERLINK_SETLINK);
2331
2332 if (pHLItem->GetInsertMode() == HLINK_FIELD)
2333 {
2334 InsertURLField(pHLItem->GetURL(), pHLItem->GetName(),
2335 pHLItem->GetTargetFrame());
2336 }
2337 else if (pHLItem->GetInsertMode() == HLINK_BUTTON)
2338 {
2339 InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(),
2340 pHLItem->GetTargetFrame(), nullptr);
2341 }
2342 else if (pHLItem->GetInsertMode() == HLINK_DEFAULT)
2343 {
2344 OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
2345
2346 if (pOlView || comphelper::LibreOfficeKit::isActive())
2347 {
2348 InsertURLField(pHLItem->GetURL(), pHLItem->GetName(),
2349 pHLItem->GetTargetFrame());
2350 }
2351 else
2352 {
2353 InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(),
2354 pHLItem->GetTargetFrame(), nullptr);
2355 }
2356 }
2357 }
2358
2359 Cancel();
2360 rReq.Ignore ();
2361 }
2362 break;
2363
2364 case SID_HIDE_LAST_LEVEL:
2365 {
2366 ESelection aSel;
2367 // fdo#78151 editing a PresObjKind::Outline in a master page ?
2369 if (pOL)
2370 {
2371 //we are on the last paragraph
2372 aSel.Adjust();
2373 if (aSel.nEndPara == pOL->GetParagraphCount() - 1)
2374 {
2375 sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara);
2376 //there exists a previous numbering level
2377 if (nDepth != sal_uInt16(-1) && nDepth > 0)
2378 {
2379 Paragraph* pPara = pOL->GetParagraph(aSel.nEndPara);
2380 pOL->Remove(pPara, 1);
2381 }
2382 }
2383 }
2384 Cancel();
2385 rReq.Done ();
2386 }
2387 break;
2388
2389 case SID_SHOW_NEXT_LEVEL:
2390 {
2391 const TranslateId STR_PRESOBJ_MPOUTLINE_ARY[]
2392 {
2393 STR_PRESOBJ_MPOUTLINE,
2394 STR_PRESOBJ_MPOUTLLAYER2,
2395 STR_PRESOBJ_MPOUTLLAYER3,
2396 STR_PRESOBJ_MPOUTLLAYER4,
2397 STR_PRESOBJ_MPOUTLLAYER5,
2398 STR_PRESOBJ_MPOUTLLAYER6,
2399 STR_PRESOBJ_MPOUTLLAYER7,
2400 STR_PRESOBJ_MPNOTESTITLE,
2401 STR_PRESOBJ_MPNOTESTEXT,
2402 STR_PRESOBJ_NOTESTEXT
2403 };
2404
2405 ESelection aSel;
2406 // fdo#78151 editing a PresObjKind::Outline in a master page ?
2408 if (pOL)
2409 {
2410 //we are on the last paragraph
2411 aSel.Adjust();
2412 if (aSel.nEndPara == pOL->GetParagraphCount() - 1)
2413 {
2414 sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara);
2415 //there exists a previous numbering level
2416 if (nDepth < 8)
2417 {
2418 sal_uInt16 nNewDepth = nDepth+1;
2419 pOL->Insert(SdResId(STR_PRESOBJ_MPOUTLINE_ARY[nNewDepth]), EE_PARA_APPEND, nNewDepth);
2420 }
2421 }
2422 }
2423 Cancel();
2424 rReq.Done ();
2425 }
2426 break;
2427
2428 case SID_INSERT_FLD_DATE_FIX:
2429 case SID_INSERT_FLD_DATE_VAR:
2430 case SID_INSERT_FLD_TIME_FIX:
2431 case SID_INSERT_FLD_TIME_VAR:
2432 case SID_INSERT_FLD_AUTHOR:
2433 case SID_INSERT_FLD_PAGE:
2434 case SID_INSERT_FLD_PAGE_TITLE:
2435 case SID_INSERT_FLD_PAGES:
2436 case SID_INSERT_FLD_FILE:
2437 {
2438 sal_uInt16 nMul = 1;
2439 std::unique_ptr<SvxFieldItem> pFieldItem;
2440
2441 switch( nSId )
2442 {
2443 case SID_INSERT_FLD_DATE_FIX:
2444 pFieldItem.reset(new SvxFieldItem(
2445 SvxDateField( Date( Date::SYSTEM ), SvxDateType::Fix ), EE_FEATURE_FIELD ));
2446 break;
2447
2448 case SID_INSERT_FLD_DATE_VAR:
2449 pFieldItem.reset(new SvxFieldItem( SvxDateField(), EE_FEATURE_FIELD ));
2450 break;
2451
2452 case SID_INSERT_FLD_TIME_FIX:
2453 pFieldItem.reset(new SvxFieldItem(
2455 break;
2456
2457 case SID_INSERT_FLD_TIME_VAR:
2458 pFieldItem.reset(new SvxFieldItem( SvxExtTimeField(), EE_FEATURE_FIELD ));
2459 break;
2460
2461 case SID_INSERT_FLD_AUTHOR:
2462 {
2463 SvtUserOptions aUserOptions;
2464 pFieldItem.reset(new SvxFieldItem(
2466 aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() ), EE_FEATURE_FIELD ));
2467 }
2468 break;
2469
2470 case SID_INSERT_FLD_PAGE:
2471 {
2472 pFieldItem.reset(new SvxFieldItem( SvxPageField(), EE_FEATURE_FIELD ));
2473 nMul = 3;
2474 }
2475 break;
2476
2477 case SID_INSERT_FLD_PAGE_TITLE:
2478 {
2479 pFieldItem.reset(new SvxFieldItem( SvxPageTitleField(), EE_FEATURE_FIELD));
2480 nMul = 3;
2481 }
2482 break;
2483
2484 case SID_INSERT_FLD_PAGES:
2485 {
2486 pFieldItem.reset(new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD ));
2487 nMul = 3;
2488 }
2489 break;
2490
2491 case SID_INSERT_FLD_FILE:
2492 {
2493 OUString aName;
2494 if( GetDocSh()->HasName() )
2495 aName = GetDocSh()->GetMedium()->GetName();
2496 pFieldItem.reset(new SvxFieldItem( SvxExtFileField( aName ), EE_FEATURE_FIELD ));
2497 }
2498 break;
2499 }
2500
2501 OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
2502
2503 if( pOLV )
2504 {
2505 const SvxFieldItem* pOldFldItem = pOLV->GetFieldAtSelection();
2506
2507 if( pOldFldItem && ( nullptr != dynamic_cast< const SvxURLField *>( pOldFldItem->GetField() ) ||
2508 nullptr != dynamic_cast< const SvxDateField *>( pOldFldItem->GetField() ) ||
2509 nullptr != dynamic_cast< const SvxTimeField *>( pOldFldItem->GetField() ) ||
2510 nullptr != dynamic_cast< const SvxExtTimeField *>( pOldFldItem->GetField() ) ||
2511 nullptr != dynamic_cast< const SvxExtFileField *>( pOldFldItem->GetField() ) ||
2512 nullptr != dynamic_cast< const SvxAuthorField *>( pOldFldItem->GetField() ) ||
2513 nullptr != dynamic_cast< const SvxPageField *>( pOldFldItem->GetField() ) ) )
2514 {
2515 // select field, then it will be deleted when inserting
2516 ESelection aSel = pOLV->GetSelection();
2517 if( aSel.nStartPos == aSel.nEndPos )
2518 aSel.nEndPos++;
2519 pOLV->SetSelection( aSel );
2520 }
2521
2522 if( pFieldItem )
2523 pOLV->InsertField( *pFieldItem );
2524 }
2525 else
2526 {
2527 Outliner* pOutl = GetDoc()->GetInternalOutliner();
2528 pOutl->Init( OutlinerMode::TextObject );
2529 OutlinerMode nOutlMode = pOutl->GetOutlinerMode();
2530 pOutl->SetStyleSheet( 0, nullptr );
2531 pOutl->QuickInsertField( *pFieldItem, ESelection() );
2532 std::optional<OutlinerParaObject> pOutlParaObject = pOutl->CreateParaObject();
2533
2535 *GetDoc(),
2536 SdrObjKind::Text);
2537 pRectObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(true));
2538
2539 pOutl->UpdateFields();
2540 pOutl->SetUpdateLayout( true );
2541 Size aSize( pOutl->CalcTextSize() );
2542 aSize.setWidth( aSize.Width() * nMul );
2543 pOutl->SetUpdateLayout( false );
2544
2545 Point aPos;
2546 ::tools::Rectangle aRect( aPos, GetActiveWindow()->GetOutputSizePixel() );
2547 aPos = aRect.Center();
2548 aPos = GetActiveWindow()->PixelToLogic(aPos);
2549 aPos.AdjustX( -(aSize.Width() / 2) );
2550 aPos.AdjustY( -(aSize.Height() / 2) );
2551
2552 ::tools::Rectangle aLogicRect(aPos, aSize);
2553 pRectObj->SetLogicRect(aLogicRect);
2554 pRectObj->SetOutlinerParaObject( std::move(pOutlParaObject) );
2555 mpDrawView->InsertObjectAtView(pRectObj.get(), *mpDrawView->GetSdrPageView());
2556 pOutl->Init( nOutlMode );
2557 }
2558
2559 pFieldItem.reset();
2560
2561 Cancel();
2562 rReq.Ignore ();
2563 }
2564 break;
2565
2566 case SID_MODIFY_FIELD:
2567 {
2568 OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
2569
2570 if( pOLV )
2571 {
2572 const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection();
2573
2574 if( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) ||
2575 nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) ||
2576 nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) ||
2577 nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) )
2578 {
2579 // Dialog...
2581 vcl::Window* pWin = GetActiveWindow();
2582 ScopedVclPtr<AbstractSdModifyFieldDlg> pDlg( pFact->CreateSdModifyFieldDlg(pWin ? pWin->GetFrameWeld() : nullptr, pFldItem->GetField(), pOLV->GetAttribs() ) );
2583 if( pDlg->Execute() == RET_OK )
2584 {
2585 // To make a correct SetAttribs() call at the utlinerView
2586 // it is necessary to split the actions here
2587 std::unique_ptr<SvxFieldData> pField(pDlg->GetField());
2588 ESelection aSel = pOLV->GetSelection();
2589 bool bSelectionWasModified(false);
2590
2591 if( pField )
2592 {
2593 SvxFieldItem aFieldItem( *pField, EE_FEATURE_FIELD );
2594
2595 if( aSel.nStartPos == aSel.nEndPos )
2596 {
2597 bSelectionWasModified = true;
2598 aSel.nEndPos++;
2599 pOLV->SetSelection( aSel );
2600 }
2601
2602 pOLV->InsertField( aFieldItem );
2603
2604 // select again for eventual SetAttribs call
2605 pOLV->SetSelection( aSel );
2606 }
2607
2608 SfxItemSet aSet( pDlg->GetItemSet() );
2609
2610 if( aSet.Count() )
2611 {
2612 pOLV->SetAttribs( aSet );
2613
2614 ::Outliner* pOutliner = pOLV->GetOutliner();
2615 if( pOutliner )
2616 pOutliner->UpdateFields();
2617 }
2618
2619 if(pField)
2620 {
2621 // restore selection to original
2622 if(bSelectionWasModified)
2623 {
2624 aSel.nEndPos--;
2625 pOLV->SetSelection( aSel );
2626 }
2627 }
2628 }
2629 }
2630 }
2631
2632 Cancel();
2633 rReq.Ignore ();
2634 }
2635 break;
2636
2637 case SID_OPEN_XML_FILTERSETTINGS:
2638 {
2639 try
2640 {
2641 css::uno::Reference < css::ui::dialogs::XExecutableDialog > xDialog = css::ui::dialogs::XSLTFilterDialog::create( ::comphelper::getProcessComponentContext() );
2642 xDialog->execute();
2643 }
2644 catch( css::uno::RuntimeException& )
2645 {
2646 DBG_UNHANDLED_EXCEPTION("sd.view");
2647 }
2648
2649 Cancel();
2650 rReq.Ignore ();
2651 }
2652 break;
2653
2654 case SID_GROUP: // BASIC
2655 {
2656 if ( mpDrawView->IsPresObjSelected( true, true, true ) )
2657 {
2658 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2659 VclMessageType::Info, VclButtonsType::Ok,
2660 SdResId(STR_ACTION_NOTPOSSIBLE)));
2661 xInfoBox->run();
2662 }
2663 else
2664 {
2665 mpDrawView->GroupMarked();
2666 }
2667 Cancel();
2668 rReq.Done ();
2669 }
2670 break;
2671
2672 case SID_UNGROUP: // BASIC
2673 {
2674 mpDrawView->UnGroupMarked();
2675 Cancel();
2676 rReq.Done ();
2677 }
2678 break;
2679
2680 case SID_NAME_GROUP:
2681 {
2682 // only allow for single object selection since the name of an object needs
2683 // to be unique
2684 if(1 == mpDrawView->GetMarkedObjectCount())
2685 {
2686 // #i68101#
2687 SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0);
2688 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
2689 OUString aName(pSelected->GetName());
2690
2693
2694 pDlg->SetCheckNameHdl(LINK(this, DrawViewShell, NameObjectHdl));
2695
2696 if(RET_OK == pDlg->Execute())
2697 {
2698 pDlg->GetName(aName);
2699 pSelected->SetName(aName);
2700
2701 SdPage* pPage = GetActualPage();
2702 if (pPage)
2703 pPage->notifyObjectRenamed(pSelected);
2704 }
2705 }
2706
2707 SfxBindings& rBindings = GetViewFrame()->GetBindings();
2708 rBindings.Invalidate( SID_NAVIGATOR_STATE, true );
2709 rBindings.Invalidate( SID_CONTEXT );
2710
2711 Cancel();
2712 rReq.Ignore();
2713 break;
2714 }
2715
2716 // #i68101#
2717 case SID_OBJECT_TITLE_DESCRIPTION:
2718 {
2719 if(1 == mpDrawView->GetMarkedObjectCount())
2720 {
2721 SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0);
2722 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
2723 OUString aTitle(pSelected->GetTitle());
2724 OUString aDescription(pSelected->GetDescription());
2725 bool isDecorative(pSelected->IsDecorative());
2726
2729 GetFrameWeld(), aTitle, aDescription, isDecorative));
2730
2731 if(RET_OK == pDlg->Execute())
2732 {
2733 pDlg->GetTitle(aTitle);
2734 pDlg->GetDescription(aDescription);
2735 pDlg->IsDecorative(isDecorative);
2736 pSelected->SetTitle(aTitle);
2737 pSelected->SetDescription(aDescription);
2738 pSelected->SetDecorative(isDecorative);
2739 }
2740 }
2741
2742 SfxBindings& rBindings = GetViewFrame()->GetBindings();
2743 rBindings.Invalidate( SID_NAVIGATOR_STATE, true );
2744 rBindings.Invalidate( SID_CONTEXT );
2745
2746 Cancel();
2747 rReq.Ignore();
2748 break;
2749 }
2750
2751 case SID_ENTER_GROUP: // BASIC
2752 {
2753 mpDrawView->EnterMarkedGroup();
2754 Cancel();
2755 rReq.Done ();
2756 }
2757 break;
2758
2759 case SID_LEAVE_GROUP: // BASIC
2760 {
2761 mpDrawView->LeaveOneGroup();
2762 Cancel();
2763 rReq.Done ();
2764 }
2765 break;
2766
2767 case SID_LEAVE_ALL_GROUPS: // BASIC
2768 {
2769 mpDrawView->LeaveAllGroup();
2770 Cancel();
2771 rReq.Done ();
2772 }
2773 break;
2774
2775 case SID_TEXT_COMBINE: // BASIC
2776 {
2777 // End text edit to avoid conflicts
2778 if(mpDrawView->IsTextEdit())
2779 mpDrawView->SdrEndTextEdit();
2780
2781 if ( mpDrawView->IsPresObjSelected() )
2782 {
2783 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2784 VclMessageType::Info, VclButtonsType::Ok,
2785 SdResId(STR_ACTION_NOTPOSSIBLE)));
2786 xInfoBox->run();
2787 }
2788 else
2789 {
2791 mpDrawView->CombineMarkedTextObjects();
2792 }
2793 Cancel();
2794 rReq.Done ();
2795 }
2796 break;
2797
2798 case SID_COMBINE: // BASIC
2799 {
2800 // End text edit to avoid conflicts
2801 if(mpDrawView->IsTextEdit())
2802 mpDrawView->SdrEndTextEdit();
2803
2804 if ( mpDrawView->IsPresObjSelected() )
2805 {
2806 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2807 VclMessageType::Info, VclButtonsType::Ok,
2808 SdResId(STR_ACTION_NOTPOSSIBLE)));
2809 xInfoBox->run();
2810 }
2811 else
2812 {
2814 mpDrawView->CombineMarkedObjects(false);
2815 }
2816 Cancel();
2817 rReq.Done ();
2818 }
2819 break;
2820
2821 case SID_DISTRIBUTE_HLEFT:
2822 case SID_DISTRIBUTE_HCENTER:
2823 case SID_DISTRIBUTE_HDISTANCE:
2824 case SID_DISTRIBUTE_HRIGHT:
2825 case SID_DISTRIBUTE_VTOP:
2826 case SID_DISTRIBUTE_VCENTER:
2827 case SID_DISTRIBUTE_VDISTANCE:
2828 case SID_DISTRIBUTE_VBOTTOM:
2829 {
2830 if ( mpDrawView->IsPresObjSelected() )
2831 {
2832 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2833 VclMessageType::Info, VclButtonsType::Ok,
2834 SdResId(STR_ACTION_NOTPOSSIBLE)));
2835 xInfoBox->run();
2836 }
2837 else
2838 {
2839 mpDrawView->DistributeMarkedObjects(nSId);
2840 }
2841 Cancel();
2842 rReq.Done ();
2843 }
2844 break;
2845 case SID_POLY_MERGE:
2846 {
2847 // End text edit to avoid conflicts
2848 if(mpDrawView->IsTextEdit())
2849 mpDrawView->SdrEndTextEdit();
2850
2851 if ( mpDrawView->IsPresObjSelected() )
2852 {
2853 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2854 VclMessageType::Info, VclButtonsType::Ok,
2855 SdResId(STR_ACTION_NOTPOSSIBLE)));
2856 xInfoBox->run();
2857 }
2858 else
2859 {
2861 mpDrawView->MergeMarkedObjects(SdrMergeMode::Merge);
2862 }
2863 Cancel();
2864 rReq.Done ();
2865 }
2866 break;
2867
2868 case SID_POLY_SUBSTRACT:
2869 {
2870 // End text edit to avoid conflicts
2871 if(mpDrawView->IsTextEdit())
2872 mpDrawView->SdrEndTextEdit();
2873
2874 if ( mpDrawView->IsPresObjSelected() )
2875 {
2876 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2877 VclMessageType::Info, VclButtonsType::Ok,
2878 SdResId(STR_ACTION_NOTPOSSIBLE)));
2879 xInfoBox->run();
2880 }
2881 else
2882 {
2884 mpDrawView->MergeMarkedObjects(SdrMergeMode::Subtract);
2885 }
2886 Cancel();
2887 rReq.Done ();
2888 }
2889 break;
2890
2891 case SID_POLY_INTERSECT:
2892 {
2893 // End text edit to avoid conflicts
2894 if(mpDrawView->IsTextEdit())
2895 mpDrawView->SdrEndTextEdit();
2896
2897 if ( mpDrawView->IsPresObjSelected() )
2898 {
2899 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2900 VclMessageType::Info, VclButtonsType::Ok,
2901 SdResId(STR_ACTION_NOTPOSSIBLE)));
2902 xInfoBox->run();
2903 }
2904 else
2905 {
2907 mpDrawView->MergeMarkedObjects(SdrMergeMode::Intersect);
2908 }
2909 Cancel();
2910 rReq.Done ();
2911 }
2912 break;
2913
2914 case SID_EQUALIZEWIDTH:
2915 case SID_EQUALIZEHEIGHT:
2916 {
2917 // End text edit to avoid conflicts
2918 if(mpDrawView->IsTextEdit())
2919 mpDrawView->SdrEndTextEdit();
2920
2921 mpDrawView->EqualizeMarkedObjects(nSId == SID_EQUALIZEWIDTH);
2922 Cancel();
2923 rReq.Done ();
2924 }
2925 break;
2926
2927 case SID_DISMANTLE: // BASIC
2928 {
2929 if ( mpDrawView->IsDismantlePossible() )
2930 {
2932 mpDrawView->DismantleMarkedObjects();
2933 }
2934 Cancel();
2935 rReq.Done ();
2936 }
2937 break;
2938
2939 case SID_CONNECT: // BASIC
2940 {
2941 if ( mpDrawView->IsPresObjSelected() )
2942 {
2943 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
2944 VclMessageType::Info, VclButtonsType::Ok,
2945 SdResId(STR_ACTION_NOTPOSSIBLE)));
2946 xInfoBox->run();
2947 }
2948 else
2949 {
2951 mpDrawView->CombineMarkedObjects();
2952 }
2953 Cancel();
2954 rReq.Done ();
2955 }
2956 break;
2957
2958 case SID_BREAK: // BASIC
2959 {
2960 if ( mpDrawView->IsTextEdit() )
2961 {
2962 mpDrawView->SdrEndTextEdit();
2963 }
2964
2965 if ( mpDrawView->IsBreak3DObjPossible() )
2966 {
2968 mpDrawView->Break3DObj();
2969 }
2970 else if ( mpDrawView->IsDismantlePossible(true) )
2971 {
2973 mpDrawView->DismantleMarkedObjects(true);
2974 }
2975 else if ( mpDrawView->IsImportMtfPossible() )
2976 {
2978 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
2979 const size_t nCnt=rMarkList.GetMarkCount();
2980
2981 // determine the sum of meta objects of all selected meta files
2982 sal_uLong nCount = 0;
2983 for(size_t nm=0; nm<nCnt; ++nm)
2984 {
2985 SdrMark* pM=rMarkList.GetMark(nm);
2986 SdrObject* pObj=pM->GetMarkedSdrObj();
2987 SdrGrafObj* pGraf= dynamic_cast< SdrGrafObj *>( pObj );
2988 SdrOle2Obj* pOle2= dynamic_cast< SdrOle2Obj *>( pObj );
2989
2990 if (pGraf != nullptr)
2991 {
2992 if (pGraf->HasGDIMetaFile())
2993 {
2995 }
2996 else if (pGraf->isEmbeddedVectorGraphicData())
2997 {
2999 }
3000 }
3001
3002 if(pOle2 && pOle2->GetGraphic())
3003 {
3005 }
3006 }
3007
3008 // decide with the sum of all meta objects if we should show a dialog
3010 {
3011 // nope, no dialog
3012 mpDrawView->DoImportMarkedMtf();
3013 }
3014 else
3015 {
3017 ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateBreakDlg(GetFrameWeld(), mpDrawView.get(), GetDocSh(), nCount, static_cast<sal_uLong>(nCnt) ));
3018 pDlg->Execute();
3019 }
3020 }
3021
3022 Cancel();
3023 rReq.Done ();
3024 }
3025 break;
3026
3027 case SID_CONVERT_TO_3D:
3028 {
3029 if ( mpDrawView->IsPresObjSelected() )
3030 {
3031 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
3032 VclMessageType::Info, VclButtonsType::Ok,
3033 SdResId(STR_ACTION_NOTPOSSIBLE)));
3034 xInfoBox->run();
3035 }
3036 else
3037 {
3038 if (mpDrawView->IsConvertTo3DObjPossible())
3039 {
3040 if (mpDrawView->IsTextEdit())
3041 {
3042 mpDrawView->SdrEndTextEdit();
3043 }
3044
3046 mpDrawView->ConvertMarkedObjTo3D();
3047 }
3048 }
3049
3050 Cancel();
3051 rReq.Done();
3052 }
3053 break;
3054
3055 case SID_FRAME_TO_TOP: // BASIC
3056 {
3057 mpDrawView->PutMarkedToTop();
3058 Cancel();
3059 rReq.Done ();
3060 }
3061 break;
3062
3063 case SID_MOREFRONT: // BASIC
3064 case SID_FRAME_UP: // BASIC
3065 {
3066 mpDrawView->MovMarkedToTop();
3067 Cancel();
3068 rReq.Done ();
3069 }
3070 break;
3071
3072 case SID_MOREBACK: // BASIC
3073 case SID_FRAME_DOWN: // BASIC
3074 {
3075 mpDrawView->MovMarkedToBtm();
3076 Cancel();
3077 rReq.Done ();
3078 }
3079 break;
3080
3081 case SID_FRAME_TO_BOTTOM: // BASIC
3082 {
3083 mpDrawView->PutMarkedToBtm();
3084 Cancel();
3085 rReq.Done ();
3086 }
3087 break;
3088
3089 case SID_HORIZONTAL: // BASIC
3090 case SID_FLIP_HORIZONTAL:
3091 {
3092 mpDrawView->MirrorAllMarkedHorizontal();
3093 Cancel();
3094 rReq.Done ();
3095 }
3096 break;
3097
3098 case SID_VERTICAL: // BASIC
3099 case SID_FLIP_VERTICAL:
3100 {
3101 mpDrawView->MirrorAllMarkedVertical();
3102 Cancel();
3103 rReq.Done ();
3104 }
3105 break;
3106
3107 case SID_OBJECT_ALIGN_LEFT: // BASIC
3108 {
3109 mpDrawView->AlignMarkedObjects(SdrHorAlign::Left, SdrVertAlign::NONE);
3110 Cancel();
3111 rReq.Done ();
3112 }
3113 break;
3114
3115 case SID_OBJECT_ALIGN_CENTER: // BASIC
3116 {
3117 mpDrawView->AlignMarkedObjects(SdrHorAlign::Center, SdrVertAlign::NONE);
3118 Cancel();
3119 rReq.Done ();
3120 }
3121 break;
3122
3123 case SID_OBJECT_ALIGN_RIGHT: // BASIC
3124 {
3125 mpDrawView->AlignMarkedObjects(SdrHorAlign::Right, SdrVertAlign::NONE);
3126 Cancel();
3127 rReq.Done ();
3128 }
3129 break;
3130
3131 case SID_OBJECT_ALIGN_UP: // BASIC
3132 {
3133 mpDrawView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Top);
3134 Cancel();
3135 rReq.Done ();
3136 }
3137 break;
3138
3139 case SID_OBJECT_ALIGN_MIDDLE: // BASIC
3140 {
3141 mpDrawView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Center);
3142 Cancel();
3143 rReq.Done ();
3144 }
3145 break;
3146
3147 case SID_OBJECT_ALIGN_DOWN: // BASIC
3148 {
3149 mpDrawView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Bottom);
3150 Cancel();
3151 rReq.Done ();
3152 }
3153 break;
3154
3155 case SID_SELECTALL: // BASIC
3156 {
3157 if( (dynamic_cast<FuSelection*>( GetOldFunction().get() ) != nullptr) &&
3158 !GetView()->IsFrameDragSingles() && GetView()->HasMarkablePoints())
3159 {
3160 if ( !mpDrawView->IsAction() )
3161 mpDrawView->MarkAllPoints();
3162 }
3163 else
3164 mpDrawView->SelectAll();
3165
3167
3168 Cancel();
3169 rReq.Done ();
3170 }
3171 break;
3172
3173 case SID_STYLE_NEW: // BASIC ???
3174 case SID_STYLE_APPLY:
3175 case SID_STYLE_EDIT:
3176 case SID_STYLE_DELETE:
3177 case SID_STYLE_HIDE:
3178 case SID_STYLE_SHOW:
3179 case SID_STYLE_FAMILY:
3180 case SID_STYLE_WATERCAN:
3181 case SID_STYLE_UPDATE_BY_EXAMPLE:
3182 case SID_STYLE_NEW_BY_EXAMPLE:
3183 {
3184 if( rReq.GetSlot() == SID_STYLE_EDIT && !rReq.GetArgs() )
3185 {
3186 SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet();
3187 if( pStyleSheet && pStyleSheet->GetFamily() == SfxStyleFamily::Page)
3188 pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet();
3189
3190 if( (pStyleSheet == nullptr) && GetView()->IsTextEdit() )
3191 {
3193
3194 pStyleSheet = mpDrawView->GetStyleSheet();
3195 if(pStyleSheet && pStyleSheet->GetFamily() == SfxStyleFamily::Page)
3196 pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet();
3197 }
3198
3199 if( pStyleSheet == nullptr )
3200 {
3201 rReq.Ignore();
3202 break;
3203 }
3204
3205 SfxAllItemSet aSet(GetDoc()->GetPool());
3206
3207 SfxStringItem aStyleNameItem( SID_STYLE_EDIT, pStyleSheet->GetName() );
3208 aSet.Put(aStyleNameItem);
3209
3210 SfxUInt16Item aStyleFamilyItem( SID_STYLE_FAMILY, static_cast<sal_uInt16>(pStyleSheet->GetFamily()) );
3211 aSet.Put(aStyleFamilyItem);
3212
3213 rReq.SetArgs(aSet);
3214 }
3215
3216 if( rReq.GetArgs() )
3217 {
3219 if( rReq.GetSlot() == SID_STYLE_APPLY )
3220 GetViewFrame()->GetBindings().Invalidate( SID_STYLE_APPLY );
3221 Cancel();
3222 }
3223 else if( rReq.GetSlot() == SID_STYLE_APPLY )
3224 GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SfxCallMode::ASYNCHRON );
3225 rReq.Ignore ();
3226 }
3227 break;
3228
3229 case SID_IMAP:
3230 {
3231 sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
3232
3234 GetViewFrame()->GetBindings().Invalidate( SID_IMAP );
3235
3236 if ( GetViewFrame()->HasChildWindow( nId )
3237 && ( ( ViewShell::Implementation::GetImageMapDialog() ) != nullptr ) )
3238 {
3239 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
3240
3241 if ( rMarkList.GetMarkCount() == 1 )
3242 UpdateIMapDlg( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
3243 }
3244
3245 Cancel();
3246 rReq.Ignore ();
3247 }
3248 break;
3249
3250 case SID_GRID_FRONT:
3251 {
3252 mpDrawView->SetGridFront( !mpDrawView->IsGridFront() );
3253 Cancel();
3254 rReq.Done ();
3255 }
3256 break;
3257
3258 case SID_HELPLINES_FRONT:
3259 {
3260 mpDrawView->SetHlplFront( !mpDrawView->IsHlplFront() );
3261 Cancel();
3262 rReq.Done ();
3263 }
3264 break;
3265
3266 case SID_FONTWORK:
3267 {
3268 if ( rReq.GetArgs() )
3269 {
3270 GetViewFrame()->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
3271 static_cast<const SfxBoolItem&>(rReq.GetArgs()->
3272 Get(SID_FONTWORK)).GetValue());
3273 }
3274 else
3275 {
3276 GetViewFrame()->ToggleChildWindow( SvxFontWorkChildWindow::GetChildWindowId() );
3277 }
3278
3279 GetViewFrame()->GetBindings().Invalidate(SID_FONTWORK);
3280 Cancel();
3281 rReq.Ignore ();
3282 }
3283 break;
3284
3285 case SID_COLOR_CONTROL:
3286 {
3287 if ( rReq.GetArgs() )
3288 GetViewFrame()->SetChildWindow(SvxColorChildWindow::GetChildWindowId(),
3289 rReq.GetArgs()->Get(SID_COLOR_CONTROL).GetValue());
3290 else
3291 GetViewFrame()->ToggleChildWindow(SvxColorChildWindow::GetChildWindowId() );
3292
3293 GetViewFrame()->GetBindings().Invalidate(SID_COLOR_CONTROL);
3294 Cancel();
3295 rReq.Ignore ();
3296 }
3297 break;
3298
3299 case SID_EXTRUSION_TOGGLE:
3300 case SID_EXTRUSION_TILT_DOWN:
3301 case SID_EXTRUSION_TILT_UP:
3302 case SID_EXTRUSION_TILT_LEFT:
3303 case SID_EXTRUSION_TILT_RIGHT:
3304 case SID_EXTRUSION_3D_COLOR:
3305 case SID_EXTRUSION_DEPTH:
3306 case SID_EXTRUSION_DIRECTION:
3307 case SID_EXTRUSION_PROJECTION:
3308 case SID_EXTRUSION_LIGHTING_DIRECTION:
3309 case SID_EXTRUSION_LIGHTING_INTENSITY:
3310 case SID_EXTRUSION_SURFACE:
3311 case SID_EXTRUSION_DEPTH_FLOATER:
3312 case SID_EXTRUSION_DIRECTION_FLOATER:
3313 case SID_EXTRUSION_LIGHTING_FLOATER:
3314 case SID_EXTRUSION_SURFACE_FLOATER:
3315 case SID_EXTRUSION_DEPTH_DIALOG:
3317 Cancel();
3318 rReq.Ignore ();
3319 break;
3320
3321 case SID_FONTWORK_SHAPE:
3322 case SID_FONTWORK_SHAPE_TYPE:
3323 case SID_FONTWORK_ALIGNMENT:
3324 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
3325 case SID_FONTWORK_CHARACTER_SPACING:
3326 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
3327 case SID_FONTWORK_GALLERY_FLOATER:
3328 case SID_FONTWORK_CHARACTER_SPACING_FLOATER:
3329 case SID_FONTWORK_ALIGNMENT_FLOATER:
3330 case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
3332 Cancel();
3333 rReq.Ignore ();
3334 break;
3335
3336 case SID_BMPMASK:
3337 {
3338 GetViewFrame()->ToggleChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() );
3339 GetViewFrame()->GetBindings().Invalidate( SID_BMPMASK );
3340
3341 Cancel();
3342 rReq.Ignore ();
3343 }
3344 break;
3345
3346 case SID_NAVIGATOR:
3347 {
3349 {
3350 GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
3351 OUString panelId = "SdNavigatorPanel";
3353 panelId, GetViewFrame()->GetFrame().GetFrameInterface());
3354
3355 Cancel();
3356 rReq.Done();
3357 } else {
3358 if ( rReq.GetArgs() )
3359 GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
3360 static_cast<const SfxBoolItem&>(rReq.GetArgs()->
3361 Get(SID_NAVIGATOR)).GetValue());
3362 else
3363 GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
3364
3365 GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
3366 Cancel();
3367 rReq.Ignore ();
3368 }
3369 }
3370 break;
3371
3372 case SID_SLIDE_TRANSITIONS_PANEL:
3373 case SID_MASTER_SLIDES_PANEL:
3374 case SID_CUSTOM_ANIMATION_PANEL:
3375 case SID_GALLERY:
3376 {
3377 // First make sure that the sidebar is visible
3378 GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
3379
3380 OUString panelId;
3381 if (nSId == SID_CUSTOM_ANIMATION_PANEL)
3382 panelId = "SdCustomAnimationPanel";
3383 else if (nSId == SID_GALLERY)
3384 panelId = "GalleryPanel";
3385 else if (nSId == SID_SLIDE_TRANSITIONS_PANEL)
3386 panelId = "SdSlideTransitionPanel";
3387 else if (nSId == SID_MASTER_SLIDES_PANEL)
3388 panelId = "SdAllMasterPagesPanel";
3389
3391 panelId,
3392 GetViewFrame()->GetFrame().GetFrameInterface());
3393
3394 Cancel();
3395 rReq.Done();
3396 }
3397 break;
3398
3399 case SID_ANIMATION_OBJECTS:
3400 {
3401 if ( rReq.GetArgs() )
3403 AnimationChildWindow::GetChildWindowId(),
3404 static_cast<const SfxBoolItem&>(rReq.GetArgs()->
3405 Get(SID_ANIMATION_OBJECTS)).GetValue());
3406 else
3408 AnimationChildWindow::GetChildWindowId() );
3409
3410 GetViewFrame()->GetBindings().Invalidate(SID_ANIMATION_OBJECTS);
3411 Cancel();
3412 rReq.Ignore ();
3413 }
3414 break;
3415
3416 case SID_3D_WIN:
3417 {
3418 if ( rReq.GetArgs() )
3419 GetViewFrame()->SetChildWindow( Svx3DChildWindow::GetChildWindowId(),
3420 static_cast<const SfxBoolItem&>(rReq.GetArgs()->
3421 Get( SID_3D_WIN )).GetValue());
3422 else
3423 GetViewFrame()->ToggleChildWindow( Svx3DChildWindow::GetChildWindowId() );
3424
3425 GetViewFrame()->GetBindings().Invalidate( SID_3D_WIN );
3426 Cancel();
3427 rReq.Ignore ();
3428 }
3429 break;
3430
3431 case SID_CONVERT_TO_3D_LATHE_FAST:
3432 {
3433 /* The call is enough. The initialization via Start3DCreation and
3434 CreateMirrorPolygons is no longer needed if the parameter
3435 sal_True is provided. Then a tilted rotary body with an axis left
3436 besides the bounding rectangle of the selected objects is drawn
3437 immediately and without user interaction. */
3438 mpDrawView->SdrEndTextEdit();
3439 if(GetActiveWindow())
3441 mpDrawView->End3DCreation(true);
3442 Cancel();
3443 rReq.Ignore();
3444 if(GetActiveWindow())
3446 }
3447 break;
3448
3449 case SID_PRESENTATION_DLG:
3450 {
3452 Cancel();
3453 }
3454 break;
3455
3456 case SID_REMOTE_DLG:
3457 {
3458#ifdef ENABLE_SDREMOTE
3461 pDlg->Execute();
3462#endif
3463 }
3464 break;
3465
3466 case SID_CUSTOMSHOW_DLG:
3467 {
3469 Cancel();
3470 }
3471 break;
3472
3473 case SID_EXPAND_PAGE:
3474 {
3476 Cancel();
3477 }
3478 break;
3479
3480 case SID_SUMMARY_PAGE:
3481 {
3482 mpDrawView->SdrEndTextEdit();
3484 Cancel();
3485 }
3486 break;
3487
3488#if HAVE_FEATURE_AVMEDIA
3489 case SID_AVMEDIA_PLAYER:
3490 {
3491 GetViewFrame()->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() );
3492 GetViewFrame()->GetBindings().Invalidate( SID_AVMEDIA_PLAYER );
3493 Cancel();
3494 rReq.Ignore ();
3495 }
3496 break;
3497#endif
3498
3499 case SID_PRESENTATION_MINIMIZER:
3500 {
3501 Reference<XComponentContext> xContext(::comphelper::getProcessComponentContext());
3502 Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext));
3503 Reference<frame::XDispatchProvider> xProvider(GetViewShellBase().GetController()->getFrame(), UNO_QUERY);
3504 if (xProvider.is())
3505 {
3506 util::URL aURL;
3507 aURL.Complete = "vnd.com.sun.star.comp.PresentationMinimizer:execute";
3508 xParser->parseStrict(aURL);
3509 uno::Reference<frame::XDispatch> xDispatch(xProvider->queryDispatch(aURL, OUString(), 0));
3510 if (xDispatch.is())
3511 {
3512 xDispatch->dispatch(aURL, uno::Sequence< beans::PropertyValue >());
3513 }
3514 }
3515 Cancel();
3516 rReq.Ignore();
3517 }
3518 break;
3519
3520 case SID_DISPLAY_MASTER_BACKGROUND:
3521 case SID_DISPLAY_MASTER_OBJECTS:
3522 {
3523 // Determine current page and toggle visibility of layers
3524 // associated with master page background or master page shapes.
3525 // FIXME: This solution is wrong, because shapes of master pages need
3526 // not be on layer "background" or "backgroundobjects".
3527 // See tdf#118613
3528 SdPage* pPage = GetActualPage();
3529 if (pPage != nullptr
3530 && GetDoc() != nullptr)
3531 {
3532 SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
3533 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
3534 SdrLayerID aLayerId;
3535 if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
3536 aLayerId = rLayerAdmin.GetLayerID(sUNO_LayerName_background);
3537 else
3538 aLayerId = rLayerAdmin.GetLayerID(sUNO_LayerName_background_objects);
3539 aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
3540 pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
3541 }
3542 Cancel();
3543 rReq.Done(); // Mark task as done to auto-update the state of each buttons tdf#132816
3544 }
3545 break;
3546
3547 case SID_PHOTOALBUM:
3548 {
3550 vcl::Window* pWin = GetActiveWindow();
3552 pWin ? pWin->GetFrameWeld() : nullptr,
3553 GetDoc()));
3554
3555 pDlg->Execute();
3556 Cancel();
3557 rReq.Ignore ();
3558 }
3559 break;
3560
3561 case SID_INSERT_QRCODE:
3562 case SID_EDIT_QRCODE:
3563 {
3565 const uno::Reference<frame::XModel> xModel = GetViewShellBase().GetController()->getModel();
3567 GetFrameWeld(), xModel, rReq.GetSlot() == SID_EDIT_QRCODE));
3568 pDlg->Execute();
3569 Cancel();
3570 rReq.Ignore ();
3571 }
3572 break;
3573
3574 case SID_ADDITIONS_DIALOG:
3575 {
3576 OUString sAdditionsTag = "";
3577
3578 const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG);
3579 if (pStringArg)
3580 sAdditionsTag = pStringArg->GetValue();
3581
3584 pFact->CreateAdditionsDialog(GetFrameWeld(), sAdditionsTag));
3585 pDlg->Execute();
3586 Cancel();
3587 rReq.Ignore ();
3588 }
3589 break;
3590
3591 case SID_ATTR_GLOW_COLOR:
3592 case SID_ATTR_GLOW_RADIUS:
3593 case SID_ATTR_GLOW_TRANSPARENCY:
3594 case SID_ATTR_SOFTEDGE_RADIUS:
3595 case SID_ATTR_TEXTCOLUMNS_NUMBER:
3596 case SID_ATTR_TEXTCOLUMNS_SPACING:
3597 if (const SfxItemSet* pNewArgs = rReq.GetArgs())
3598 mpDrawView->SetAttributes(*pNewArgs);
3599 rReq.Done();
3600 Cancel();
3601 break;
3602
3603 default:
3604 {
3605 SAL_WARN( "sd.ui", "Slot without function" );
3606 Cancel();
3607 rReq.Ignore ();
3608 }
3609 break;
3610 }
3611
3612 if(HasCurrentFunction())
3613 {
3614 GetCurrentFunction()->Activate();
3615 }
3616}
3617
3619{
3620 SdDrawDocument* pDoc = GetDoc();
3621 if (!pDoc || !mpDrawView)
3622 return;
3623
3624 SfxItemSet aEditAttr( pDoc->GetPool() );
3625 mpDrawView->GetAttributes( aEditAttr );
3626
3627 //modified by wj for sym2_1580, if put old itemset into new set,
3628 //when mpDrawView->SetAttributes(aNewAttr) it will invalidate all the item
3629 // and use old attr to update all the attributes
3630// SfxItemSet aNewAttr( GetPool(),
3631// EE_ITEMS_START, EE_ITEMS_END );
3632// aNewAttr.Put( aEditAttr, sal_False );
3633 SfxItemSet aNewAttr( pDoc->GetPool() );
3634 //modified end
3635
3636 sal_uInt16 nSId = rReq.GetSlot();
3637
3638 switch ( nSId )
3639 {
3640 case SID_ATTR_CHAR_FONT:
3641 if( rReq.GetArgs() )
3642 {
3643 const SvxFontItem* pItem = rReq.GetArg<SvxFontItem>(SID_ATTR_CHAR_FONT);
3644 if (pItem)
3645 {
3646 aNewAttr.Put(*pItem);
3647 }
3648 }
3649 break;
3650 case SID_ATTR_CHAR_FONTHEIGHT:
3651 if( rReq.GetArgs() )
3652 {
3653 const SvxFontHeightItem* pItem = rReq.GetArg<SvxFontHeightItem>(SID_ATTR_CHAR_FONTHEIGHT);
3654 if (pItem)
3655 {
3656 aNewAttr.Put(*pItem);
3657 }
3658 }
3659 break;
3660 case SID_ATTR_CHAR_WEIGHT:
3661 if( rReq.GetArgs() )
3662 {
3663 const SvxWeightItem* pItem = rReq.GetArg<SvxWeightItem>(SID_ATTR_CHAR_WEIGHT);
3664 if (pItem)
3665 {
3666 aNewAttr.Put(*pItem);
3667 }
3668 }
3669 break;
3670 case SID_ATTR_CHAR_POSTURE:
3671 if( rReq.GetArgs() )
3672 {
3673 const SvxPostureItem* pItem = rReq.GetArg<SvxPostureItem>(SID_ATTR_CHAR_POSTURE);
3674 if (pItem)
3675 {
3676 aNewAttr.Put(*pItem);
3677 }
3678 }
3679 break;
3680 case SID_ATTR_CHAR_UNDERLINE:
3681 if( rReq.GetArgs() )
3682 {
3683 const SvxUnderlineItem* pItem = rReq.GetArg<SvxUnderlineItem>(SID_ATTR_CHAR_UNDERLINE);
3684 if (pItem)
3685 {
3686 aNewAttr.Put(*pItem);
3687 }
3688 else
3689 {
3690 FontLineStyle eFU = aEditAttr.Get( EE_CHAR_UNDERLINE ).GetLineStyle();
3692 }
3693 }
3694 break;
3695 case SID_ATTR_CHAR_OVERLINE:
3696 if( rReq.GetArgs() )
3697 {
3698 const SvxOverlineItem* pItem = rReq.GetArg<SvxOverlineItem>(SID_ATTR_CHAR_OVERLINE);
3699 if (pItem)
3700 {
3701 aNewAttr.Put(*pItem);
3702 }
3703 else
3704 {
3705 FontLineStyle eFU = aEditAttr.Get( EE_CHAR_OVERLINE ).GetLineStyle();
3707 }
3708 }
3709 break;
3710
3711 case SID_ULINE_VAL_NONE:
3712 {
3714 break;
3715 }
3716
3717 case SID_ULINE_VAL_SINGLE:
3718 case SID_ULINE_VAL_DOUBLE:
3719 case SID_ULINE_VAL_DOTTED:
3720 {
3721 FontLineStyle eOld = aEditAttr.Get(EE_CHAR_UNDERLINE).GetLineStyle();
3722 FontLineStyle eNew = eOld;
3723
3724 switch (nSId)
3725 {
3726 case SID_ULINE_VAL_SINGLE:
3727 eNew = ( eOld == LINESTYLE_SINGLE ) ? LINESTYLE_NONE : LINESTYLE_SINGLE;
3728 break;
3729 case SID_ULINE_VAL_DOUBLE:
3730 eNew = ( eOld == LINESTYLE_DOUBLE ) ? LINESTYLE_NONE : LINESTYLE_DOUBLE;
3731 break;
3732 case SID_ULINE_VAL_DOTTED:
3733 eNew = ( eOld == LINESTYLE_DOTTED ) ? LINESTYLE_NONE : LINESTYLE_DOTTED;
3734 break;
3735 }
3736
3737 SvxUnderlineItem aUnderline(eNew, EE_CHAR_UNDERLINE);
3738 aNewAttr.Put(aUnderline);
3739 }
3740 break;
3741
3742 case SID_ATTR_CHAR_SHADOWED:
3743 if( rReq.GetArgs() )
3744 {
3745 const SvxShadowedItem* pItem = rReq.GetArg<SvxShadowedItem>(SID_ATTR_CHAR_SHADOWED);
3746 if (pItem)
3747 {
3748 aNewAttr.Put(*pItem);
3749 }
3750 }
3751 break;
3752 case SID_ATTR_CHAR_CONTOUR:
3753 if( rReq.GetArgs() )
3754 {
3755 const SvxContourItem* pItem = rReq.GetArg<SvxContourItem>(SID_ATTR_CHAR_CONTOUR);
3756 if (pItem)
3757 {
3758 aNewAttr.Put(*pItem);
3759 }
3760 }
3761 break;
3762
3763 case SID_ATTR_CHAR_STRIKEOUT:
3764 if( rReq.GetArgs() )
3765 {
3766 const SvxCrossedOutItem* pItem = rReq.GetArg<SvxCrossedOutItem>(SID_ATTR_CHAR_STRIKEOUT);
3767 if (pItem)
3768 {
3769 aNewAttr.Put(*pItem);
3770 }
3771 }
3772 break;
3773 case SID_ATTR_CHAR_COLOR:
3774 if( rReq.GetArgs() )
3775 {
3776 const SvxColorItem* pItem = rReq.GetArg<SvxColorItem>(SID_ATTR_CHAR_COLOR);
3777 if (pItem)
3778 {
3779 aNewAttr.Put(*pItem);
3780 }
3781 }
3782 break;
3783 case SID_ATTR_CHAR_KERNING:
3784 if( rReq.GetArgs() )
3785 {
3786 const SvxKerningItem* pItem = rReq.GetArg<SvxKerningItem>(SID_ATTR_CHAR_KERNING);
3787 if (pItem)
3788 {
3789 aNewAttr.Put(*pItem);
3790 }
3791 }
3792 break;
3793 case SID_ATTR_CHAR_CASEMAP:
3794 if( rReq.GetArgs() )
3795 {
3796 const SvxCaseMapItem* pItem = rReq.GetArg<SvxCaseMapItem>(SID_ATTR_CHAR_CASEMAP);
3797 if (pItem)
3798 {
3799 aNewAttr.Put(*pItem);
3800 }
3801 }
3802 break;
3803 case SID_SET_SUB_SCRIPT:
3804 {
3806 SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
3807 if( eEsc == SvxEscapement::Subscript )
3808 aItem.SetEscapement( SvxEscapement::Off );
3809 else
3810 aItem.SetEscapement( SvxEscapement::Subscript );
3811 aNewAttr.Put( aItem );
3812 }
3813 break;
3814 case SID_SET_SUPER_SCRIPT:
3815 {
3817 SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
3818 if( eEsc == SvxEscapement::Superscript )
3819 aItem.SetEscapement( SvxEscapement::Off );
3820 else
3821 aItem.SetEscapement( SvxEscapement::Superscript );
3822 aNewAttr.Put( aItem );
3823 }
3824 break;
3825 case SID_SHRINK_FONT_SIZE:
3826 case SID_GROW_FONT_SIZE:
3827 {
3828 const SvxFontListItem* pFonts = dynamic_cast<const SvxFontListItem*>(GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
3829 const FontList* pFontList = pFonts ? pFonts->GetFontList() : nullptr;
3830 if( pFontList )
3831 {
3832 FuText::ChangeFontSize( nSId == SID_GROW_FONT_SIZE, nullptr, pFontList, mpView );
3833 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
3834 }
3835 break;
3836 }
3837 case SID_ATTR_CHAR_BACK_COLOR:
3838 if( rReq.GetArgs() )
3839 {
3840 const SvxColorItem* pItem = rReq.GetArg<SvxColorItem>(SID_ATTR_CHAR_BACK_COLOR);
3841 if (pItem)
3842 {
3843 aNewAttr.Put(*pItem);
3844 }
3845 }
3846 break;
3847 default:
3848 break;
3849 }
3850
3851 mpDrawView->SetAttributes(aNewAttr);
3852 rReq.Done();
3853 Cancel();
3854}
3855
3862 SfxRequest& rRequest,
3863 PageKind ePageKind,
3864 SdPage* pPage,
3865 const sal_Int32 nInsertPosition)
3866{
3867 SdPage* pNewPage = nullptr;
3868 if (ePageKind == PageKind::Standard && meEditMode != EditMode::MasterPage)
3869 {
3870 if ( mpDrawView->IsTextEdit() )
3871 {
3872 mpDrawView->SdrEndTextEdit();
3873 }
3874 pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition);
3875 }
3876 return pNewPage;
3877}
3878
3880{
3881 // Create a list of the pages that are to be duplicated. The process of
3882 // duplication alters the selection.
3883 sal_Int32 nInsertPosition (0);
3884 ::std::vector<SdPage*> aPagesToDuplicate;
3888 while (aSelectedPages.HasMoreElements())
3889 {
3890 sd::slidesorter::model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
3891 if (pDescriptor && pDescriptor->GetPage())
3892 {
3893 aPagesToDuplicate.push_back(pDescriptor->GetPage());
3894 nInsertPosition = pDescriptor->GetPage()->GetPageNum()+2;
3895 }
3896 }
3897
3898 // Duplicate the pages in aPagesToDuplicate and collect the newly
3899 // created pages in aPagesToSelect.
3900 const bool bUndo (aPagesToDuplicate.size()>1 && mrSlideSorter.GetView().IsUndoEnabled());
3901 if (bUndo)
3902 mrSlideSorter.GetView().BegUndo(SdResId(STR_INSERTPAGE));
3903
3904 ::std::vector<SdPage*> aPagesToSelect;
3905 for(::std::vector<SdPage*>::const_iterator
3906 iPage(aPagesToDuplicate.begin()),
3907 iEnd(aPagesToDuplicate.end());
3908 iPage!=iEnd;
3909 ++iPage, nInsertPosition+=2)
3910 {
3911 aPagesToSelect.push_back(
3912 mrSlideSorter.GetViewShell()->CreateOrDuplicatePage(
3913 rRequest, PageKind::Standard, *iPage, nInsertPosition));
3914 }
3915 aPagesToDuplicate.clear();
3916
3917 if (bUndo)
3918 mrSlideSorter.GetView().EndUndo();
3919
3920 // Set the selection to the pages in aPagesToSelect.
3921 sd::slidesorter::controller::PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector());
3922 rSelector.DeselectAllPages();
3923 for (auto const& it: aPagesToSelect)
3924 {
3925 rSelector.SelectPage(it);
3926 }
3927}
3928
3930{
3932 return;
3933
3934 SdDrawDocument* pDoc = GetDoc();
3935 if (!pDoc || !mpDrawView)
3936 return;
3937
3938 sal_uInt16 nSId = rReq.GetSlot();
3939 SfxItemSet aAttrs( pDoc->GetPool() );
3940
3941 switch ( nSId )
3942 {
3943 case SID_TABLE_VERT_NONE:
3944 case SID_TABLE_VERT_CENTER:
3945 case SID_TABLE_VERT_BOTTOM:
3947 if (nSId == SID_TABLE_VERT_CENTER)
3949 else if (nSId == SID_TABLE_VERT_BOTTOM)
3951
3952 aAttrs.Put( SdrTextVertAdjustItem(eTVA) );
3953 mpDrawView->SetAttributes(aAttrs);
3954
3955 break;
3956 }
3957}
3958
3960{
3961 SfxWhichIter aIter( rSet );
3962 sal_uInt16 nWhich = aIter.FirstWhich();
3963
3964 SdDrawDocument* pDoc = GetDoc();
3965 if (!pDoc || !mpDrawView)
3966 return;
3967
3968 SfxItemSet aAttrs( pDoc->GetPool() );
3969 mpDrawView->GetAttributes( aAttrs );
3970
3971 while ( nWhich )
3972 {
3973 sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
3974 ? GetPool().GetSlotId(nWhich)
3975 : nWhich;
3976 switch ( nSlotId )
3977 {
3978 case SID_TABLE_VERT_NONE:
3979 case SID_TABLE_VERT_CENTER:
3980 case SID_TABLE_VERT_BOTTOM:
3981 bool bContour = false;
3983 if( eConState != SfxItemState::DONTCARE )
3984 {
3985 bContour = aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ).GetValue();
3986 }
3987 if (bContour) break;
3988
3990 //SfxItemState eHState = aAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST );
3991
3992 //if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
3993 if(SfxItemState::DONTCARE != eVState)
3994 {
3995 SdrTextVertAdjust eTVA = aAttrs.Get(SDRATTR_TEXT_VERTADJUST).GetValue();
3996 bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) ||
3997 (nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) ||
3998 (nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM);
3999 rSet.Put(SfxBoolItem(nSlotId, bSet));
4000 }
4001 else
4002 {
4003 rSet.Put(SfxBoolItem(nSlotId, false));
4004 }
4005 break;
4006 }
4007 nWhich = aIter.NextWhich();
4008 }
4009}
4010
4011} // end of namespace sd
4012
4013/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define CHECK_RANGE(nMin, nValue, nMax)
SlideSorter & mrSlideSorter
constexpr auto convertTwipToMm100(N n)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
sal_uInt16 GetValue() const
sal_uInt32 GetValue() const
const OUString & GetValue() const
rtl::Reference< SdrGrafObj > GetCompressedSdrGrafObj()
virtual void GetAllSections(std::vector< editeng::Section > &rAttrs) const=0
virtual const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const=0
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
size_t GetActionSize() const
static OUString ExportGraphic(weld::Window *pWin, const Graphic &rGraphic, const OUString &rGraphicName)
static short HasToSaveTransformedImage(weld::Widget *pWin)
const Graphic & GetGraphic() const
const GDIMetaFile & GetGDIMetaFile() const
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
const EditTextObject & GetTextObject() const
void SetSelection(const ESelection &)
void SelectFieldAtCursor()
void InsertField(const SvxFieldItem &rFld)
const SvxFieldItem * GetFieldAtSelection() const
vcl::Window * GetWindow() const
ESelection GetSelection() const
const SvxFieldData * GetFieldAtCursor() const
SfxItemSet GetAttribs()
Outliner * GetOutliner() const
void SetAttribs(const SfxItemSet &)
EditView & GetEditView() const
void Remove(Paragraph const *pPara, sal_Int32 nParaCount)
OutlinerMode GetOutlinerMode() const
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
sal_Int16 GetDepth(sal_Int32 nPara) const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
bool SetUpdateLayout(bool bUpdate)
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
bool UpdateFields()
Size CalcTextSize()
Paragraph * Insert(const OUString &rText, sal_Int32 nAbsPos=EE_PARA_APPEND, sal_Int16 nDepth=0)
void Init(OutlinerMode nMode)
sal_Int32 GetParagraphCount() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
virtual VclPtr< VclAbstractDialog > CreateRemoteDialog(weld::Window *pWindow)=0
virtual VclPtr< VclAbstractDialog > CreateBreakDlg(weld::Window *pWindow, ::sd::DrawView *pDrView, ::sd::DrawDocShell *pShell, sal_uLong nSumActionCount, sal_uLong nObjCount)=0
virtual VclPtr< VclAbstractDialog > CreateSdPhotoAlbumDialog(weld::Window *pWindow, SdDrawDocument *pDoc)=0
virtual VclPtr< AbstractSdModifyFieldDlg > CreateSdModifyFieldDlg(weld::Window *pWindow, const SvxFieldData *pInField, const SfxItemSet &rSet)=0
virtual VclPtr< AbstractSdInsertLayerDlg > CreateSdInsertLayerDlg(weld::Window *pParent, const SfxItemSet &rInAttrs, bool bDeletable, const OUString &rStr)=0
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
Definition: sdabstdlg.cxx:38
SAL_DLLPRIVATE void SetOnlineSpell(bool bIn)
Definition: drawdoc.cxx:962
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
SAL_DLLPRIVATE bool GetOnlineSpell() const
Definition: drawdoc.hxx:431
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SdOutliner * GetInternalOutliner(bool bCreateOutliner=true)
Definition: drawdoc.cxx:930
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
Definition: drawdoc2.cxx:217
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
Definition: drawdoc.hxx:242
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum) override
Definition: sdpage.cxx:1706
bool IsPresObj(const SdrObject *pObj)
Definition: sdpage.cxx:2322
void CreateTitleAndLayout(bool bInit=false, bool bCreate=false)
Definition: sdpage.cxx:793
SfxStyleSheet * GetStyleSheetForPresObj(PresObjKind eObjKind) const
Definition: sdpage.cxx:625
void notifyObjectRenamed(const SdrObject *pObj)
Notify that the object has been renamed and the animation effects has to update.
const OUString & GetName() const
Definition: sdpage.cxx:2505
GraphicAttr GetGraphicAttr(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
bool HasGDIMetaFile() const
GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const
Graphic GetTransformedGraphic(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
const Graphic & GetGraphic() const
GraphicType GetGraphicType() const
const GraphicObject & GetGraphicObject(bool bForceSwapIn=false) const
bool isEmbeddedVectorGraphicData() const
sal_uInt16 GetLayerCount() const
SdrLayerID GetLayerID(const OUString &rName) const
SdrLayer * GetLayer(sal_uInt16 i)
void Set(SdrLayerID a)
bool IsSet(SdrLayerID a) const
const OUString & GetTitle() const
const OUString & GetName() const
const OUString & GetDescription() const
void SetDescription(const OUString &rDesc)
void SetTitle(const OUString &rTitle)
size_t GetMarkCount() const
bool TakeBoundRect(SdrPageView const *pPageView, tools::Rectangle &rRect) const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
SdrUndoFactory & GetSdrUndoFactory() const
const SdrLayerAdmin & GetLayerAdmin() const
virtual bool IsTextEdit() const final override
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrObjUserCall * GetUserCall() const
virtual OUString GetTitle() const
virtual void SetTitle(const OUString &rStr)
void SetUserCall(SdrObjUserCall *pUser)
virtual void SetDescription(const OUString &rStr)
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
sal_uInt32 GetOrdNum() const
void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual OUString GetDescription() const
virtual const OUString & GetName() const
virtual SdrObjKind GetObjIdentifier() const
const SfxItemSet & GetMergedItemSet() const
virtual SdrLayerID GetLayer() const
void SetMergedItem(const SfxPoolItem &rItem)
virtual void SetDecorative(bool isDecorative)
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual bool IsDecorative() const
const Graphic * GetGraphic() const
bool IsLayerVisible(const OUString &rName) const
void DeleteHelpLine(sal_uInt16 nNum)
void SetLayerVisible(const OUString &rName, bool bShow)
sal_uInt16 GetPageNum() const
Size GetSize() const
void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet &rNew)
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
SdrObjKind GetTextKind() const
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
void Invalidate(sal_uInt16 nId)
bool GetValue() const
static SfxClassificationPolicyType getPolicyType()
static SfxClassificationPolicyType stringToPolicyType(std::u16string_view rType)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
sal_uInt16 Count() const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const OUString & GetName() const
SfxMedium * GetMedium() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
sal_uInt16 Which() const
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
weld::Window * GetFrameWeld() const
void SetArgs(const SfxAllItemSet &rArgs)
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
SfxViewFrame * GetFrame() const
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
virtual void Invalidate(sal_uInt16 nId=0)
const OUString & GetName() const
SfxStyleFamily GetFamily() const
size_t LeaveListAction()
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
void ToggleChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxDispatcher * GetDispatcher()
virtual SfxObjectShell * GetObjectShell() override
void ShowChildWindow(sal_uInt16, bool bVisible=true)
css::uno::Reference< css::frame::XController > GetController() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
static void FatalError(ErrCode)
OUString GetFirstName() const
OUString GetID() const
OUString GetLastName() const
virtual VclPtr< AbstractSvxNameDialog > CreateSvxNameDialog(weld::Window *pParent, const OUString &rName, const OUString &rDesc)=0
virtual VclPtr< AbstractSvxObjectTitleDescDialog > CreateSvxObjectTitleDescDialog(weld::Window *pParent, const OUString &rTitle, const OUString &rDescription, bool isDecorative)=0
virtual VclPtr< AbstractSvxObjectNameDialog > CreateSvxObjectNameDialog(weld::Window *pParent, const OUString &rName)=0
static SvxAbstractDialogFactory * Create()
void SetEscapement(const SvxEscapement eNew)
const SvxFieldData * GetField() const
const FontList * GetFontList() const
SvxLinkInsertMode GetInsertMode() const
const OUString & GetName() const
const OUString & GetURL() const
const OUString & GetTargetFrame() const
FontWeight GetWeight() const
bool StartEditMode(sal_uInt16 nPageId)
sal_uInt16 GetCurPageId() const
static void RemoveURLField(EditView &pEditView)
static VclAbstractDialogFactory * Create()
virtual VclPtr< AbstractAdditionsDialog > CreateAdditionsDialog(weld::Window *pParent, const OUString &sAdditionsTag)=0
virtual VclPtr< AbstractQrCodeGenDialog > CreateQrCodeGenDialog(weld::Window *pParent, const css::uno::Reference< css::frame::XModel > xModel, bool bEditExisting)=0
void disposeAndClear()
const model::ComplexColor & getComplexColor() const
void setComplexColor(model::ComplexColor const &rComplexColor)
static BGradient fromJSON(std::u16string_view rJSON)
OUString const & GetName() const
void setSchemeColor(ThemeColorType eType)
void addTransformation(Transformation const &rTransform)
virtual SfxUndoManager * GetUndoManager() override
Definition: docshell.cxx:363
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
static void CheckLineTo(SfxRequest &rReq)
check if we have to draw a polyline
Definition: drviewsa.cxx:404
void DuplicateSelectedSlides(SfxRequest &rRequest)
Definition: drviews2.cxx:3879
void ModifyLayer(SdrLayer *pLayer, const OUString &rLayerName, const OUString &rLayerTitle, const OUString &rLayerDesc, bool bIsVisible, bool bIsLocked, bool bIsPrintable)
modifies the given layer with the given values
Definition: drviewsb.cxx:130
void DeleteActualLayer()
Definition: drviews4.cxx:139
void SetupPage(Size const &rSize, ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bSize, bool bMargin, bool bScaleAll)
Change page parameter if SID_PAGESIZE or SID_PAGEMARGIN.
Definition: drviewsa.cxx:422
SD_DLLPUBLIC void ExecChar(SfxRequest &rReq)
Definition: drviews2.cxx:3618
css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager
EditMode GetEditMode() const
std::unique_ptr< DrawView > mpDrawView
void UpdateIMapDlg(SdrObject *pObj)
Definition: drviewsc.cxx:36
void FreshNavigatrTree()
Definition: drviews4.cxx:304
void DeleteActualPage()
Definition: drviews4.cxx:96
void FuTemporary(SfxRequest &rReq)
SfxRequests for temporary actions.
Definition: drviews2.cxx:606
void ExecutePropPanelAttr(SfxRequest const &rReq)
Definition: drviews2.cxx:3929
css::uno::Reference< css::lang::XEventListener > mxScannerListener
std::vector< std::unique_ptr< SdrExternalToolEdit > > m_ExternalEdits
sal_uInt16 GetCurPagePos() const
VclPtr< TabControl > maTabControl
void GetStatePropPanelAttr(SfxItemSet &rSet)
Definition: drviews2.cxx:3959
void InsertURLButton(const OUString &rURL, const OUString &rText, const OUString &rTarget, const Point *pPos)
Definition: drviewse.cxx:1536
SD_DLLPUBLIC LayerTabBar * GetLayerTabControl()
Return a pointer to the tab control for layers.
Definition: drviews5.cxx:636
virtual SdPage * GetActualPage() override
void InsertURLField(const OUString &rURL, const OUString &rText, const OUString &rTarget)
Definition: drviewse.cxx:1481
bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus=true)
Switch to desired page.
Definition: drviews1.cxx:831
bool RenameSlide(sal_uInt16 nPageId, const OUString &rName)
Renames the given slide using an SvxNameDialog.
Definition: drviewsb.cxx:45
::Outliner * GetOutlinerForMasterPageOutlineTextObj(ESelection &rSel)
Definition: drviews7.cxx:215
PageKind GetPageKind() const
virtual SdPage * CreateOrDuplicatePage(SfxRequest &rRequest, PageKind ePageKind, SdPage *pPage, const sal_Int32 nInsertPosition=-1) override
Depending on the given request create a new page or duplicate an existing one.
Definition: drviews2.cxx:3861
void ResetActualLayer()
Select new refreshed page, in case of a page order change (eg.
Definition: drviews1.cxx:1211
virtual void SetZoom(::tools::Long nZoom) override
set zoom factor
Definition: drviews1.cxx:282
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuarea.cxx:39
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuolbull.cxx:51
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fubullet.cxx:66
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuchar.cxx:49
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuconnct.cxx:40
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fucopy.cxx:56
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fucushow.cxx:45
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fudspord.cxx:49
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuexpand.cxx:60
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuinsert.cxx:658
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuinsert.cxx:205
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuinsfil.cxx:115
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq, bool replaceExistingImage)
Definition: fuinsert.cxx:99
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuinsert.cxx:273
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fulinend.cxx:45
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuline.cxx:44
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fumeasur.cxx:40
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fumorph.cxx:61
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuoaprms.cxx:67
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fupage.cxx:114
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuparagr.cxx:51
static const int HITPIX
Definition: fupoor.hxx:50
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuprlout.cxx:58
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuscale.cxx:54
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fusel.cxx:89
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fusldlg.cxx:51
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fusnapln.cxx:46
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fusumry.cxx:56
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: futempl.cxx:87
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: futxtatt.cxx:40
static void ChangeFontSize(bool, OutlinerView *, const FontList *, ::sd::View *)
Definition: futext.cxx:1345
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: futhes.cxx:56
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: futransf.cxx:43
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuvect.cxx:43
The UI part presenting the graphic size check results, which is used by GenericCheckDialog.
OUString GetLayerName(sal_uInt16 nPageId) const
Definition: LayerTabBar.cxx:90
static bool IsLocalizedNameOfStandardLayer(std::u16string_view rName)
static bool IsRealNameOfStandardLayer(std::u16string_view rName)
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
Definition: slideshow.cxx:208
Local derivation of the SfxHint class that defines some hint ids that are used by the ViewShell class...
static SvxIMapDlg * GetImageMapDialog()
Return a pointer to the image map dialog that is displayed in some child window.
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
Definition: viewshel.cxx:1407
const rtl::Reference< FuPoor > & GetCurrentFunction() const
Definition: ViewShell.hxx:250
SdDrawDocument * GetDoc() const
Definition: viewshel.cxx:1412
std::unique_ptr< Implementation, o3tl::default_delete< Implementation > > mpImpl
Definition: ViewShell.hxx:485
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
::sd::View * GetView() const
Definition: ViewShell.hxx:144
void DeactivateCurrentFunction(bool bPermanent=false)
Definition: viewshel.cxx:1459
const rtl::Reference< FuPoor > & GetOldFunction() const
Definition: ViewShell.hxx:248
void SetOldFunction(const rtl::Reference< FuPoor > &xFunction)
Definition: viewshel.cxx:1430
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
Definition: viewshel.cxx:1582
::sd::View * mpView
Definition: ViewShell.hxx:452
void SetCurrentFunction(const rtl::Reference< FuPoor > &xFunction)
Definition: viewshel.cxx:1422
virtual SdPage * CreateOrDuplicatePage(SfxRequest &rRequest, PageKind ePageKind, SdPage *pPage, const sal_Int32 nInsertPosition=-1)
Depending on the given request create a new page or duplicate an existing one.
Definition: viewshe3.cxx:160
void Cancel()
this method deactivates the current function.
Definition: viewshel.cxx:1442
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
bool HasCurrentFunction() const
Definition: ViewShell.hxx:252
virtual bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false, bool bSlide=false, bool bMaster=false)
Definition: sdview.cxx:509
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
Definition: sdview.cxx:772
SD_DLLPUBLIC SlideSorter & GetSlideSorter() const
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
A sub-controller that handles page selection of the slide browser.
void SelectPage(int nPageIndex)
Select the specified descriptor.
static PageEnumeration CreateSelectedPagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over the currently selected slides of the given model.
Public class of page enumerations that delegates its calls to an implementation object that can filte...
virtual SharedPageDescriptor GetNextElement() override
Return the next element of the enumeration.
virtual bool HasMoreElements() const override
Return <TRUE> when the enumeration has more elements, i.e.
static void TogglePanel(std::u16string_view rsPanelId, const css::uno::Reference< css::frame::XFrame > &rxFrame)
static void execute(SdrView *pSdrView, SfxRequest const &rReq, SfxBindings &rBindings)
static void execute(SdrView &rSdrView, SfxRequest const &rReq, SfxBindings &rBindings)
virtual short run() override
constexpr Point Center() const
constexpr tools::Long Bottom() const
void LeaveWait()
Point PixelToLogic(const Point &rDevicePt) const
void EnterWait()
weld::Window * GetFrameWeld() const
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
static void CopyStringTo(const OUString &rContent, const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rxClipboard, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
virtual css::uno::Reference< css::awt::XWindow > GetXWindow()=0
int nCount
#define DBG_ASSERT(sCon, aError)
#define DBG_UNHANDLED_EXCEPTION(...)
Reference< XDispatch > xDispatch
URL aURL
virtual std::shared_ptr< SfxDialogController > GetController() override
virtual SfxBindings & GetBindings() override
#define MIN_ACTIONS_FOR_DIALOG
if there are more meta objects, we show a dialog during the break up
Definition: drviews2.cxx:195
#define EE_TEXTPOS_MAX_COUNT
#define EE_PARA_APPEND
constexpr TypedWhichId< SfxBoolItem > EE_PARA_HYPHENATE(EE_PARA_START+6)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
constexpr TypedWhichId< SvxNumBulletItem > EE_PARA_NUMBULLET(EE_PARA_START+5)
EmbeddedObjectRef * pObject
sal_Int32 nState
Any aHelper
DocumentType eType
sal_Int16 nValue
FontLineStyle
LINESTYLE_SINGLE
LINESTYLE_DOUBLE
LINESTYLE_NONE
LINESTYLE_DOTTED
WEIGHT_BOLD
WEIGHT_NORMAL
constexpr OUStringLiteral HID_SD_NAMEDIALOG_PAGE
Definition: helpids.h:41
HLINK_FIELD
HLINK_DEFAULT
HLINK_BUTTON
sal_Int32 nIndex
OUString aName
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
int i
constexpr ThemeColorType convertToThemeColorType(sal_Int32 nIndex)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
OUString getProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rName)
void insertFullTextualRepresentationAsDocumentProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, sfx::ClassificationKeyCreator const &rKeyCreator, std::vector< svx::ClassificationResult > const &rResults)
bool addOrInsertDocumentProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rsKey, OUString const &rsValue)
void removeAllProperties(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
sal_Int16 nId
const char GetValue[]
OutlinerMode
SfxItemState
EditMode
Definition: pres.hxx:53
PageKind
Definition: pres.hxx:45
#define ERRCODE_BASIC_WRONG_ARGS
SfxBoolItem makeSdAttrLayerLocked(bool bValue=false)
Definition: sdattr.hxx:53
SfxBoolItem makeSdAttrLayerThisPage()
Definition: sdattr.hxx:58
SfxStringItem makeSdAttrLayerTitle(const OUString &aStr=OUString())
Definition: sdattr.hxx:33
SfxBoolItem makeSdAttrLayerVisible(bool bValue=true)
Definition: sdattr.hxx:43
SfxBoolItem makeSdAttrLayerPrintable(bool bValue=true)
Definition: sdattr.hxx:48
SfxStringItem makeSdAttrLayerName(const OUString &aStr)
Definition: sdattr.hxx:28
SfxStringItem makeSdAttrLayerDesc(const OUString &aStr=OUString())
Definition: sdattr.hxx:38
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
#define SD_MOD()
Definition: sdmod.hxx:184
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SdrTextVertAdjust
SDRTEXTVERTADJUST_BOTTOM
SDRTEXTVERTADJUST_CENTER
SDRTEXTVERTADJUST_TOP
static SfxItemSet & rSet
sal_uIntPtr sal_uLong
sal_Int32 nEndPos
sal_Int32 nStartPos
void Adjust()
sal_Int32 nEndPara
std::vector< const SfxPoolItem * > maAttributes
sal_Int32 mnParagraph
Reference< XModel > xModel
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
constexpr TypedWhichId< SdrTextFitToSizeTypeItem > SDRATTR_TEXT_FITTOSIZE(SDRATTR_MISC_FIRST+3)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEHEIGHT(SDRATTR_MISC_FIRST+1)
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_CONTOURFRAME(SDRATTR_MISC_FIRST+21)
SvxEscapement
bool bVisible
constexpr OUStringLiteral sUNO_LayerName_background_objects
Definition: unokywds.hxx:30
constexpr OUStringLiteral sUNO_LayerName_background
Definition: unokywds.hxx:29
RET_OK
RET_CANCEL
RET_NO
RET_YES
SvxZoomType