LibreOffice Module sd (master) 1
drviews7.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 <memory>
21
22#include <sal/config.h>
23#include <sal/log.hxx>
24
25#include <utility>
26
27#include <com/sun/star/lang/XMultiServiceFactory.hpp>
28#include <com/sun/star/linguistic2/XThesaurus.hpp>
29#include <svx/pageitem.hxx>
30#include <svx/rulritem.hxx>
31#include <svx/svdouno.hxx>
32#include <editeng/eeitem.hxx>
33#include <editeng/sizeitem.hxx>
35#include <officecfg/Office/Impress.hxx>
36#include <svx/svxids.hrc>
37#include <svx/svdpagv.hxx>
38#include <svx/clipfmtitem.hxx>
39#include <svl/eitem.hxx>
40#include <svl/intitem.hxx>
41#include <svl/itemset.hxx>
42#include <svl/stritem.hxx>
43#include <svl/visitem.hxx>
44#include <svl/whiter.hxx>
45#include <svx/svdograf.hxx>
46#include <svx/xfillit0.hxx>
47#include <svx/xflclit.hxx>
48#include <svx/xflgrit.hxx>
49#include <svx/xflhtit.hxx>
50#include <svx/xbtmpit.hxx>
51#include <editeng/unolingu.hxx>
52#include <svx/extrusionbar.hxx>
53#include <svx/fontworkbar.hxx>
54
55// #UndoRedo#
56#include <svtools/insdlg.hxx>
58#include <svl/cjkoptions.hxx>
60#include <sfx2/request.hxx>
61
63#include <sfx2/bindings.hxx>
64#include <sfx2/viewfrm.hxx>
65
66#include <app.hrc>
67
69
70#include <drawdoc.hxx>
71#include <DrawViewShell.hxx>
72#include <sdmod.hxx>
73#include <unokywds.hxx>
74#include <sdpage.hxx>
75#include <DrawDocShell.hxx>
76#include <zoomlist.hxx>
77#include <slideshow.hxx>
78#include <drawview.hxx>
79#include <ViewShellBase.hxx>
80#include <ViewShellManager.hxx>
81#include <LayerTabBar.hxx>
82#include <fupoor.hxx>
83#include <Window.hxx>
84#include <fuediglu.hxx>
85#include <fubullet.hxx>
86#include <fuconcs.hxx>
88#include <stlsheet.hxx>
89
90using namespace ::com::sun::star;
91using namespace ::com::sun::star::uno;
92using namespace ::com::sun::star::lang;
93using namespace ::com::sun::star::linguistic2;
94
99static ::std::unique_ptr<SvxClipboardFormatItem> GetSupportedClipboardFormats (
100 TransferableDataHelper& rDataHelper)
101{
102 ::std::unique_ptr<SvxClipboardFormatItem> pResult (
103 new SvxClipboardFormatItem(SID_CLIPBOARD_FORMAT_ITEMS));
104
105 sal_uInt32 nFormatCount (rDataHelper.GetFormatCount());
106 for (sal_uInt32 i=0; i<nFormatCount; i++)
107 {
108 const SotClipboardFormatId nTestFormat = rDataHelper.GetFormat(i);
109
110 // Check if the current format is the same as one that has already
111 // been handled.
112 bool bDuplicate (false);
113 for (sal_uInt32 j=0; j<i; j++)
114 {
115 if (nTestFormat == rDataHelper.GetFormat(j))
116 {
117 bDuplicate = true;
118 break;
119 }
120 }
121
122 // Look up the format among those that are supported by the
123 // DrawViewShell.
124 if ( ! bDuplicate)
125 {
126 switch (nTestFormat)
127 {
128 case SotClipboardFormatId::EMBED_SOURCE:
129 {
130 OUString sName;
131
133 if (rDataHelper.GetTransferableObjectDescriptor(
134 SotClipboardFormatId::OBJECTDESCRIPTOR, aDescriptor))
135 {
136 sName = aDescriptor.maTypeName;
137 }
138 if (!sName.isEmpty())
139 pResult->AddClipbrdFormat(nTestFormat, sName);
140 else
141 pResult->AddClipbrdFormat(nTestFormat);
142
143 break;
144 }
145
146
147 case SotClipboardFormatId::LINK_SOURCE:
148 case SotClipboardFormatId::DRAWING:
149 case SotClipboardFormatId::SVXB:
150 case SotClipboardFormatId::GDIMETAFILE:
151 case SotClipboardFormatId::BITMAP:
152 case SotClipboardFormatId::NETSCAPE_BOOKMARK:
153 case SotClipboardFormatId::STRING:
154 case SotClipboardFormatId::HTML:
155 case SotClipboardFormatId::RTF:
156 case SotClipboardFormatId::RICHTEXT:
157 case SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT:
158 pResult->AddClipbrdFormat(nTestFormat);
159 break;
160 default: break;
161 }
162 }
163 }
164
165 // Check some OLE formats whose names are handled differently.
166 SotClipboardFormatId nFormat (SotClipboardFormatId::EMBED_SOURCE_OLE);
167 bool bHasFormat (rDataHelper.HasFormat(nFormat));
168 if ( ! bHasFormat)
169 {
170 bHasFormat = rDataHelper.HasFormat(nFormat);
171 }
172 if (bHasFormat)
173 {
174 OUString sName;
175 OUString sSource;
176 if (SvPasteObjectHelper::GetEmbeddedName (rDataHelper, sName, sSource, nFormat))
177 pResult->AddClipbrdFormat (nFormat, sName);
178 }
179
180 return pResult;
181}
182
183namespace sd {
184
185IMPL_LINK( DrawViewShell, ClipboardChanged, TransferableDataHelper*, pDataHelper, void )
186{
187 mbPastePossible = ( pDataHelper->GetFormatCount() != 0 );
188
189 // Update the list of supported clipboard formats according to the
190 // new clipboard content.
191 // There are some stack traces that indicate the possibility of the
192 // DrawViewShell destructor called during the call to
193 // GetSupportedClipboardFormats(). If that really has happened then
194 // exit immediately.
195 TransferableDataHelper aDataHelper (
197 ::std::unique_ptr<SvxClipboardFormatItem> pFormats (GetSupportedClipboardFormats(aDataHelper));
198 if (mpDrawView == nullptr)
199 return;
200 mpCurrentClipboardFormats = std::move(pFormats);
201
202 SfxBindings& rBindings = GetViewFrame()->GetBindings();
203 rBindings.Invalidate( SID_PASTE );
204 rBindings.Invalidate( SID_PASTE_SPECIAL );
205 rBindings.Invalidate( SID_PASTE_UNFORMATTED );
206 rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
207}
208
210{
211 SfxItemSet aSet( mpDrawView->GetGeoAttrFromMarked() );
212 rSet.Put(aSet,false);
213}
214
216{
217 if( !mpDrawView )
218 return nullptr;
219
220 //when there is one object selected
221 if (!mpDrawView->AreObjectsMarked() || (mpDrawView->GetMarkedObjectList().GetMarkCount() != 1))
222 return nullptr;
223
224 //and we are editing the outline object
225 if (!mpDrawView->IsTextEdit())
226 return nullptr;
227
228 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
229 if (!pPageView)
230 return nullptr;
231
232 SdPage* pPage = static_cast<SdPage*>(pPageView->GetPage());
233 //only show these in a normal master page
234 if (!pPage || (pPage->GetPageKind() != PageKind::Standard) || !pPage->IsMasterPage())
235 return nullptr;
236
237 OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
238 ::Outliner* pOL = pOLV ? pOLV->GetOutliner() : nullptr;
239 if (!pOL)
240 return nullptr;
241 rSel = pOLV->GetSelection();
242
243 return pOL;
244}
245
247{
248 SdPage *pPage = getCurrentPage();
249 SfxWhichIter aIter( rSet );
250 sal_uInt16 nWhich = aIter.FirstWhich();
251 while ( nWhich )
252 {
253 switch ( nWhich )
254 {
255 case SID_ATTR_PAGE_LRSPACE:
256 {
257 // const SvxLRSpaceItem aTmpPageLRSpace ( rDesc.GetMaster().GetLRSpace() );
258 const SvxLongLRSpaceItem aLongLR(
259 static_cast<::tools::Long>(pPage->GetLeftBorder()),
260 static_cast<::tools::Long>(pPage->GetRightBorder()),
261 SID_ATTR_PAGE_LRSPACE );
262 rSet.Put( aLongLR );
263 }
264 break;
265
266 case SID_ATTR_PAGE_ULSPACE:
267 {
268 // const SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
269 SvxLongULSpaceItem aLongUL(
270 static_cast<::tools::Long>(pPage->GetUpperBorder()),
271 static_cast<::tools::Long>(pPage->GetLowerBorder()),
272 SID_ATTR_PAGE_ULSPACE );
273 rSet.Put( aLongUL );
274 }
275 break;
276
277 default:
278 break;
279 }
280 nWhich = aIter.NextWhich();
281 }
282}
283
285{
286 if (!mpDrawView)
287 return true;
288 if (!mpDrawView->AreObjectsMarked())
289 return true;
290 if (mpDrawView->GetMarkedObjectList().GetMarkCount() != 1)
291 return true;
292
293 bool bDisableEditHyperlink = true;
294 if( mpDrawView->IsTextEdit() )
295 {
296 if (URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()))
297 bDisableEditHyperlink = false;
298 }
299 else
300 {
301 SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() );
302
303 if ( pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->GetObjInventor() )
304 {
305 const uno::Reference< awt::XControlModel >& xControlModel( pUnoCtrl->GetUnoControlModel() );
306 if( xControlModel.is() )
307 {
308 uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
309 if( xPropSet.is() )
310 {
311 uno::Reference< beans::XPropertySetInfo > xPropInfo( xPropSet->getPropertySetInfo() );
312 if( xPropInfo.is() && xPropInfo->hasPropertyByName( "TargetURL") )
313 {
314 bDisableEditHyperlink = false;
315 }
316 }
317 }
318 }
319 }
320 return bDisableEditHyperlink;
321}
322
324{
325 if (mpDrawView == nullptr)
326 {
327 // This assertion and return are here to prevent crashes.
328 DBG_ASSERT(mpDrawView!=nullptr, "Please report this assertion to the Impress team.");
329 return;
330 }
331
333 bool bDisableVerticalText = !SvtCJKOptions::IsVerticalTextEnabled();
334
335 if ( bDisableVerticalText )
336 {
337 rSet.DisableItem( SID_DRAW_FONTWORK_VERTICAL );
338 rSet.DisableItem( SID_DRAW_CAPTION_VERTICAL );
339 rSet.DisableItem( SID_TEXT_FITTOSIZE_VERTICAL );
340 rSet.DisableItem( SID_DRAW_TEXT_VERTICAL );
341 }
342
343 bool bConvertToPathPossible = mpDrawView->IsConvertToPathObjPossible();
344
345 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
346 const size_t nMarkCount = rMarkList.GetMarkCount();
347
348 if( nMarkCount == 1 )
349 {
350 bool bDisable = true;
351 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
352 if( auto pGrafObj = dynamic_cast<const SdrGrafObj*>( pObj) )
353 if( pGrafObj->getQrCode() )
354 bDisable = false;
355 if(bDisable)
356 {
357 rSet.DisableItem(SID_EDIT_QRCODE);
358 }
359 }
360
361 //format paintbrush
363
364 // State of SfxChild-Windows (Animator, Fontwork etc.)
366
368 {
369 sal_uInt16 nSId = GetCurrentFunction()->GetSlotID();
370 rSet.Put( SfxBoolItem( nSId, true ) );
371 }
372
373 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
374
376
377 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_ASSIGN_LAYOUT))
378 {
379 bool bDisable = true;
380 if( pPageView )
381 {
382 SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
383
384 if( pPage && !pPage->IsMasterPage() )
385 {
386 rSet.Put( SfxUInt32Item( SID_ASSIGN_LAYOUT, static_cast< sal_uInt32 >(pPage->GetAutoLayout()) ) );
387 bDisable = false;
388 }
389 }
390
391 if(bDisable)
392 {
393 rSet.DisableItem(SID_ASSIGN_LAYOUT);
394 }
395 }
396
397 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_EXPAND_PAGE))
398 {
399 bool bDisable = true;
400 if( pPageView )
401 {
402 SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
403
404 if( pPage && (pPage->GetPageKind() == PageKind::Standard) && !pPage->IsMasterPage() )
405 {
407
408 if (pObj!=nullptr )
409 {
410 if( !pObj->IsEmptyPresObj() )
411 {
412 bDisable = false;
413 }
414 else
415 {
416 // check if the object is in edit, then if it's temporarily not empty
417 SdrTextObj* pTextObj = DynCastSdrTextObj( pObj );
418 if( pTextObj )
419 {
420 if( pTextObj->CanCreateEditOutlinerParaObject() )
421 {
422 bDisable = false;
423 }
424 }
425 }
426 }
427 }
428 }
429
430 if(bDisable)
431 {
432 rSet.DisableItem(SID_EXPAND_PAGE);
433 }
434 }
435
436 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_SUMMARY_PAGE))
437 {
438 bool bDisable = true;
439 if( pPageView )
440 {
441 SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
442
443 if( pPage && (pPage->GetPageKind() == PageKind::Standard) && !pPage->IsMasterPage() )
444 {
446
447 if(pObj && !pObj->IsEmptyPresObj())
448 {
449 bDisable = false;
450 }
451 }
452 }
453
454 if(bDisable)
455 {
456 rSet.DisableItem(SID_SUMMARY_PAGE);
457 }
458 }
459
460 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_ASSIGN_LAYOUT))
461 {
462 bool bDisable = true;
463 if( pPageView )
464 {
465 SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
466
467 if( pPage && !pPage->IsMasterPage() )
468 {
469 rSet.Put( SfxUInt32Item(SID_ASSIGN_LAYOUT, pPage->GetAutoLayout()) );
470 bDisable = false;
471 }
472 }
473
474 if(bDisable)
475 {
476 rSet.DisableItem(SID_ASSIGN_LAYOUT);
477 }
478 }
479
480 // is it possible to start the presentation?
481 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_PRESENTATION ) ||
482 SfxItemState::DEFAULT == rSet.GetItemState( SID_REHEARSE_TIMINGS ) )
483 {
484 bool bDisable = true;
486
487 for( sal_uInt16 i = 0; i < nCount && bDisable; i++ )
488 {
490
491 if( !pPage->IsExcluded() )
492 bDisable = false;
493 }
494
495 if( bDisable || GetDocSh()->IsPreview())
496 {
497 rSet.DisableItem( SID_PRESENTATION );
498 rSet.DisableItem( SID_REHEARSE_TIMINGS );
499 }
500 }
501
502 // gluepoints
503 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_EDITMODE ) ||
504 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_INSERT_POINT ) ||
505 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_PERCENT ) ||
506 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_ESCDIR ) ||
507 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_ESCDIR_LEFT ) ||
508 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_ESCDIR_RIGHT ) ||
509 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_ESCDIR_TOP ) ||
510 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_ESCDIR_BOTTOM ) ||
511 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_HORZALIGN_CENTER ) ||
512 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_HORZALIGN_LEFT ) ||
513 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_HORZALIGN_RIGHT ) ||
514 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_VERTALIGN_CENTER ) ||
515 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_VERTALIGN_TOP ) ||
516 SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_VERTALIGN_BOTTOM ) )
517 {
518 // percent
519 TriState eState = mpDrawView->IsMarkedGluePointsPercent();
520 if( eState == TRISTATE_INDET )
521 rSet.InvalidateItem( SID_GLUE_PERCENT );
522 else
523 rSet.Put( SfxBoolItem( SID_GLUE_PERCENT, eState == TRISTATE_TRUE ) );
524
525 // alignment has no effect by percent
526 if( eState == TRISTATE_TRUE )
527 {
528 rSet.DisableItem( SID_GLUE_HORZALIGN_CENTER );
529 rSet.DisableItem( SID_GLUE_HORZALIGN_LEFT );
530 rSet.DisableItem( SID_GLUE_HORZALIGN_RIGHT );
531 rSet.DisableItem( SID_GLUE_VERTALIGN_CENTER );
532 rSet.DisableItem( SID_GLUE_VERTALIGN_TOP );
533 rSet.DisableItem( SID_GLUE_VERTALIGN_BOTTOM );
534 }
535 else
536 {
537 // horizontal alignment
538 SdrAlign nHorz = mpDrawView->GetMarkedGluePointsAlign( false );
539 rSet.Put( SfxBoolItem( SID_GLUE_HORZALIGN_CENTER, nHorz == SdrAlign::HORZ_CENTER ) );
540 rSet.Put( SfxBoolItem( SID_GLUE_HORZALIGN_LEFT, nHorz == SdrAlign::HORZ_LEFT ) );
541 rSet.Put( SfxBoolItem( SID_GLUE_HORZALIGN_RIGHT, nHorz == SdrAlign::HORZ_RIGHT ) );
542 // vertical alignment
543 SdrAlign nVert = mpDrawView->GetMarkedGluePointsAlign( true );
544 rSet.Put( SfxBoolItem( SID_GLUE_VERTALIGN_CENTER, nVert == SdrAlign::VERT_CENTER ) );
545 rSet.Put( SfxBoolItem( SID_GLUE_VERTALIGN_TOP, nVert == SdrAlign::VERT_TOP ) );
546 rSet.Put( SfxBoolItem( SID_GLUE_VERTALIGN_BOTTOM, nVert == SdrAlign::VERT_BOTTOM ) );
547 }
548
549 // insert point
550 rSet.Put( SfxBoolItem( SID_GLUE_INSERT_POINT, mpDrawView->IsInsGluePointMode() ) );
551
552 // Escape direction
553 // left
554 eState = mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::LEFT );
555 if( eState == TRISTATE_INDET )
556 rSet.InvalidateItem( SID_GLUE_ESCDIR_LEFT );
557 else
558 rSet.Put( SfxBoolItem( SID_GLUE_ESCDIR_LEFT, eState == TRISTATE_TRUE ) );
559 // right
560 eState = mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::RIGHT );
561 if( eState == TRISTATE_INDET )
562 rSet.InvalidateItem( SID_GLUE_ESCDIR_RIGHT );
563 else
564 rSet.Put( SfxBoolItem( SID_GLUE_ESCDIR_RIGHT, eState == TRISTATE_TRUE ) );
565 // top
566 eState = mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::TOP );
567 if( eState == TRISTATE_INDET )
568 rSet.InvalidateItem( SID_GLUE_ESCDIR_TOP );
569 else
570 rSet.Put( SfxBoolItem( SID_GLUE_ESCDIR_TOP, eState == TRISTATE_TRUE ) );
571 // bottom
572 eState = mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::BOTTOM );
573 if( eState == TRISTATE_INDET )
574 rSet.InvalidateItem( SID_GLUE_ESCDIR_BOTTOM );
575 else
576 rSet.Put( SfxBoolItem( SID_GLUE_ESCDIR_BOTTOM, eState == TRISTATE_TRUE ) );
577 }
578
579 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_GRID_FRONT ) ||
580 SfxItemState::DEFAULT == rSet.GetItemState( SID_HELPLINES_FRONT ) )
581 {
582 rSet.Put( SfxBoolItem( SID_GRID_FRONT, mpDrawView->IsGridFront() ) );
583 rSet.Put( SfxBoolItem( SID_HELPLINES_FRONT, mpDrawView->IsHlplFront() ) );
584 }
585
586 if (!mpDrawView->IsFrameDragSingles())
587 rSet.Put(SfxBoolItem(SID_BEZIER_EDIT, true));
588 else
589 rSet.Put(SfxBoolItem(SID_BEZIER_EDIT, false));
590
591 if(dynamic_cast<FuEditGluePoints*>( GetCurrentFunction().get()))
592 rSet.Put(SfxBoolItem(SID_GLUE_EDITMODE, true));
593 else
594 rSet.Put(SfxBoolItem(SID_GLUE_EDITMODE, false));
595
596 if( !mpDrawView->IsMirrorAllowed( true, true ) )
597 {
598 rSet.DisableItem( SID_HORIZONTAL );
599 rSet.DisableItem( SID_VERTICAL );
600 rSet.DisableItem( SID_FLIP_HORIZONTAL );
601 rSet.DisableItem( SID_FLIP_VERTICAL );
602 }
603
604 if( !mpDrawView->IsMirrorAllowed() )
605 {
606 rSet.DisableItem( SID_OBJECT_MIRROR );
607// rSet.DisableItem( SID_CONVERT_TO_3D_LATHE );
608// rSet.DisableItem( SID_CONVERT_TO_3D_LATHE_FAST );
609 }
610
611 // interactive transparence control
612 if(!mpDrawView->IsTransparenceAllowed())
613 {
614 rSet.DisableItem( SID_OBJECT_TRANSPARENCE );
615 }
616
617 // interactive gradient control
618 if(!mpDrawView->IsGradientAllowed())
619 {
620 rSet.DisableItem( SID_OBJECT_GRADIENT );
621 }
622
623 // disable morphing if necessary
624 if ( !mpDrawView->IsMorphingAllowed() )
625 rSet.DisableItem( SID_POLYGON_MORPHING );
626
627 if( !mpDrawView->IsReverseOrderPossible() )
628 {
629 rSet.DisableItem( SID_REVERSE_ORDER );
630 }
631
632 if ( !bConvertToPathPossible &&
633 !mpDrawView->IsCrookAllowed( mpDrawView->IsCrookNoContortion() ) )
634 {
635 // implicit transformation into curve not possible
636 rSet.DisableItem(SID_OBJECT_CROOK_ROTATE);
637 rSet.DisableItem(SID_OBJECT_CROOK_SLANT);
638 rSet.DisableItem(SID_OBJECT_CROOK_STRETCH);
639 }
640
641 if ( !mpDrawView->IsGroupEntered() )
642 {
643 rSet.DisableItem( SID_LEAVE_GROUP );
644 rSet.Put( SfxBoolItem( SID_LEAVE_ALL_GROUPS, false ) );
645 rSet.ClearItem( SID_LEAVE_ALL_GROUPS );
646 rSet.DisableItem( SID_LEAVE_ALL_GROUPS );
647 }
648 else
649 rSet.Put( SfxBoolItem( SID_LEAVE_ALL_GROUPS, true ) );
650
651 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_THESAURUS ) )
652 {
653 if ( !mpDrawView->IsTextEdit() )
654 {
655 rSet.DisableItem( SID_THESAURUS );
656 }
657 else
658 {
660 Reference< XThesaurus > xThesaurus( LinguMgr::GetThesaurus() );
661
662 if (!xThesaurus.is() || eLang == LANGUAGE_NONE || !xThesaurus->hasLocale( LanguageTag::convertToLocale( eLang)) )
663 rSet.DisableItem( SID_THESAURUS );
664 }
665 }
666
667 if ( !mpDrawView->IsTextEdit() )
668 {
669 rSet.DisableItem( SID_THESAURUS );
670 }
671
672 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_SELECTALL ) ||
673 SfxItemState::DEFAULT == rSet.GetItemState( SID_SIZE_ALL ) )
674 {
675 if( pPageView && pPageView->GetObjList()->GetObjCount() == 0 )
676 {
677 // should be disabled if there is no object on the draw area:
678 rSet.DisableItem( SID_SELECTALL );
679 rSet.DisableItem( SID_SIZE_ALL );
680 }
681 }
682
683 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_CONTEXT ) )
684 rSet.Put( SfxStringItem( SID_CONTEXT, mpDrawView->GetStatusText() ) );
685
686 // clipboard (paste)
687 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_PASTE ) ||
688 SfxItemState::DEFAULT == rSet.GetItemState( SID_PASTE_SPECIAL ) ||
689 SfxItemState::DEFAULT == rSet.GetItemState( SID_PASTE_UNFORMATTED ) ||
690 SfxItemState::DEFAULT == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) )
691 {
692 if ( !mxClipEvtLstnr.is() )
693 {
694 // avoid clipboard initialization for
695 // read-only presentation views (workaround for NT4.0
696 // clipboard prob...)
697 if( dynamic_cast< const PresentationViewShell *>( this ) == nullptr )
698 {
699 // create listener
700 mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, DrawViewShell, ClipboardChanged ) );
701 mxClipEvtLstnr->AddListener( GetActiveWindow() );
702
703 // get initial state
705 mbPastePossible = ( aDataHelper.GetFormatCount() != 0 );
707 }
708 else
709 mbPastePossible = false;
710 }
711
712 if( !mbPastePossible )
713 {
714 rSet.DisableItem( SID_PASTE );
715 rSet.DisableItem( SID_PASTE_SPECIAL );
716 rSet.DisableItem( SID_PASTE_UNFORMATTED );
717 rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
718 }
719 else if( SfxItemState::DEFAULT == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) )
720 {
721 if (mpCurrentClipboardFormats != nullptr)
723 }
724 }
725
726 if ( !bConvertToPathPossible )
727 {
728 rSet.DisableItem(SID_CHANGEBEZIER);
729 }
730
731 if (mpDrawView == nullptr)
732 {
733 // The mpDrawView was not NULL but is now.
734 // The reason for this may be that the DrawViewShell has been
735 // destroyed in the meantime.
736 // We can only return immediately and hope that the deleted
737 // DrawViewShell is not called again.
738 DBG_ASSERT(mpDrawView!=nullptr, "Please report this assertion to the Impress team.");
739 return;
740 }
741
742 if( !( mpDrawView->IsConvertToPolyObjPossible() || mpDrawView->IsVectorizeAllowed() ) )
743 rSet.DisableItem(SID_CHANGEPOLYGON);
744
745 if( !( mpDrawView->IsConvertToPolyObjPossible() || mpDrawView->IsConvertToContourPossible() ) )
746 rSet.DisableItem(SID_CONVERT_TO_CONTOUR);
747
748 if ( !mpDrawView->IsConvertTo3DObjPossible() )
749 {
750 rSet.DisableItem(SID_CONVERT_TO_3D);
751 rSet.DisableItem(SID_CONVERT_TO_3D_LATHE);
752 rSet.DisableItem(SID_CONVERT_TO_3D_LATHE_FAST);
753 }
754
755 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_MANAGE_LINKS ) )
756 {
757 if ( GetDoc()->GetLinkCount() == 0 )
758 {
759 rSet.DisableItem(SID_MANAGE_LINKS);
760 }
761 }
762
764 {
765 rSet.DisableItem(SID_PRESENTATION_LAYOUT);
766 rSet.DisableItem(SID_SELECT_BACKGROUND);
767 rSet.DisableItem(SID_SAVE_BACKGROUND);
768 }
769
771 {
772 rSet.DisableItem(SID_INSERTPAGE);
773 rSet.DisableItem(SID_RENAMEPAGE);
774 rSet.DisableItem(SID_RENAMEPAGE_QUICK);
775 rSet.DisableItem(SID_DUPLICATE_PAGE);
776 rSet.ClearItem(SID_ANIMATION_OBJECTS);
777 rSet.DisableItem(SID_ANIMATION_OBJECTS);
778 rSet.DisableItem(SID_ANIMATION_EFFECTS);
779 rSet.DisableItem(SID_EXECUTE_ANIMATION_EFFECT);
780
782 rSet.DisableItem(SID_MODIFYPAGE);
783
784 rSet.DisableItem(SID_SELECT_BACKGROUND);
785 rSet.DisableItem(SID_SAVE_BACKGROUND);
786 rSet.DisableItem(SID_INSERTLAYER);
787 rSet.DisableItem(SID_LAYERMODE);
788 rSet.DisableItem(SID_INSERTFILE);
789 }
790 else if (mePageKind == PageKind::Handout)
791 {
792 rSet.DisableItem(SID_INSERTPAGE);
793 rSet.DisableItem(SID_DUPLICATE_PAGE);
794 rSet.ClearItem(SID_ANIMATION_OBJECTS);
795 rSet.DisableItem(SID_ANIMATION_OBJECTS);
796 rSet.DisableItem(SID_ANIMATION_EFFECTS);
797 rSet.DisableItem(SID_EXECUTE_ANIMATION_EFFECT);
798 rSet.DisableItem(SID_RENAMEPAGE);
799 rSet.DisableItem(SID_RENAMEPAGE_QUICK);
800 rSet.DisableItem(SID_INSERTLAYER);
801 rSet.DisableItem(SID_MODIFYLAYER);
802 rSet.DisableItem(SID_TOGGLELAYERVISIBILITY);
803 rSet.DisableItem(SID_RENAMELAYER);
804 rSet.DisableItem(SID_LAYERMODE);
805 rSet.DisableItem(SID_INSERTFILE);
806 rSet.DisableItem(SID_PAGEMODE);
807 rSet.DisableItem(SID_SELECT_BACKGROUND);
808 rSet.DisableItem(SID_SAVE_BACKGROUND);
809 }
810 else
811 {
813 {
814 rSet.DisableItem(SID_INSERTPAGE);
815 rSet.DisableItem(SID_DUPLICATE_PAGE);
816 rSet.DisableItem(SID_MODIFYPAGE);
817 rSet.ClearItem(SID_ANIMATION_OBJECTS);
818 rSet.DisableItem(SID_ANIMATION_OBJECTS);
819 }
820
821 rSet.Put (SfxBoolItem (SID_LAYERMODE, IsLayerModeActive()));
822 }
823
824 if ( ! IsLayerModeActive())
825 {
826 rSet.DisableItem( SID_INSERTLAYER );
827 rSet.DisableItem( SID_MODIFYLAYER );
828 rSet.DisableItem( SID_TOGGLELAYERVISIBILITY );
829 rSet.DisableItem( SID_DELETE_LAYER );
830 rSet.DisableItem( SID_RENAMELAYER );
831 }
832
834 {
835 /**********************************************************************
836 * page mode
837 **********************************************************************/
838 rSet.Put(SfxBoolItem(SID_PAGEMODE, true));
839 rSet.Put(SfxBoolItem(SID_MASTERPAGE, false));
840 rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false));
841 rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false));
842 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false));
843
844 rSet.DisableItem (SID_INSERT_MASTER_PAGE);
845 rSet.DisableItem (SID_DELETE_MASTER_PAGE);
846 rSet.DisableItem (SID_RENAME_MASTER_PAGE);
847 rSet.DisableItem (SID_CLOSE_MASTER_VIEW);
848 }
849 else
850 {
851 rSet.Put(SfxBoolItem(SID_PAGEMODE, false));
852 rSet.Put(SfxBoolItem(SID_MASTERPAGE, true));
853
854 /**********************************************************************
855 * Background page mode
856 **********************************************************************/
858 {
859 rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, true));
860 rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false));
861 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false));
862
863 }
864 else if (mePageKind == PageKind::Notes)
865 {
866 rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false));
867 rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, true));
868 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false));
869 }
870 else if (mePageKind == PageKind::Handout)
871 {
872 rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false));
873 rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false));
874 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, true));
875 }
876 }
877
878 // set state of the ruler
879 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_RULER ) )
880 rSet.Put( SfxBoolItem( SID_RULER, HasRuler() ) );
881
882 // do not delete the last page or a master page
883 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_DELETE_PAGE )
884 || SfxItemState::DEFAULT == rSet.GetItemState( SID_DELETE_MASTER_PAGE ) )
885 {
886 if (maTabControl->GetPageCount() == 1 ||
891 {
892 if (rSet.GetItemState(SID_DELETE_PAGE) == SfxItemState::DEFAULT)
893 rSet.DisableItem(SID_DELETE_PAGE);
894 if (rSet.GetItemState(SID_DELETE_MASTER_PAGE)==SfxItemState::DEFAULT)
895 rSet.DisableItem(SID_DELETE_MASTER_PAGE);
896 }
897 }
898
899 // is it allowed to delete the current layer?
900 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_DELETE_LAYER )
901 || SfxItemState::DEFAULT == rSet.GetItemState( SID_RENAMELAYER ) )
902 {
903 if(GetLayerTabControl()) // #i87182#
904 {
905 sal_uInt16 nCurrentLayer = GetLayerTabControl()->GetCurPageId();
906 const OUString& rName = GetLayerTabControl()->GetLayerName(nCurrentLayer);
907
909 {
910 rSet.DisableItem(SID_DELETE_LAYER);
911 rSet.DisableItem(SID_RENAMELAYER);
912 }
913 }
914 else
915 {
916 OSL_ENSURE(false, "No LayerTabBar (!)");
917 }
918 }
919
920 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_CUT ) ||
921 SfxItemState::DEFAULT == rSet.GetItemState( SID_COPY ) ||
922 SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTLINE_BULLET ))
923 {
924 OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
925
926 // special treatment of for SID_OUTLINE_BULLET if objects with different
927 // kinds of NumBullets are marked
928 bool bHasOutliner = false;
929 bool bHasOther = false;
930 for(size_t nNum = 0; nNum < nMarkCount; ++nNum)
931 {
932 SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj();
933 if( pObj->GetObjInventor() == SdrInventor::Default )
934 {
935 if( pObj->GetObjIdentifier() == SdrObjKind::OutlineText )
936 {
937 bHasOutliner = true;
938 if(bHasOther)
939 break;
940 }
941 else
942 {
943 bHasOther = true;
944 if(bHasOutliner)
945 break;
946 }
947 }
948 }
949
950 if( bHasOther && bHasOutliner )
951 rSet.DisableItem( SID_OUTLINE_BULLET );
952
953 if (pOlView)
954 {
955 if (pOlView->GetSelected().isEmpty() || GetObjectShell()->isContentExtractionLocked())
956 {
957 rSet.DisableItem( SID_CUT );
958 rSet.DisableItem( SID_COPY );
959 }
960 }
961
962 }
963
965
966 if ( GetDocSh()->IsUIActive() )
967 {
968 rSet.DisableItem( SID_INSERT_OBJECT );
969 rSet.DisableItem( SID_INSERT_FLOATINGFRAME );
970 rSet.DisableItem( SID_INSERT_MATH );
971 rSet.DisableItem( SID_INSERT_DIAGRAM );
972 rSet.DisableItem( SID_ATTR_TABLE );
973 rSet.DisableItem( SID_SIZE_REAL );
974 rSet.DisableItem( SID_SIZE_OPTIMAL );
975 rSet.DisableItem( SID_SIZE_ALL );
976 rSet.DisableItem( SID_SIZE_PAGE_WIDTH );
977 rSet.DisableItem( SID_SIZE_PAGE );
978 rSet.DisableItem( SID_DUPLICATE_PAGE );
979 rSet.DisableItem( SID_ZOOM_TOOLBOX );
980 }
981
982 // Zoom-State
983 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_ZOOM_IN ) ||
984 SfxItemState::DEFAULT == rSet.GetItemState( SID_ZOOM_OUT )||
985 SfxItemState::DEFAULT == rSet.GetItemState( SID_ZOOM_PANNING ) )
986 {
987 if( GetActiveWindow()->GetZoom() <= GetActiveWindow()->GetMinZoom() || GetDocSh()->IsUIActive() )
988 {
989 rSet.DisableItem( SID_ZOOM_OUT );
990 rSet.DisableItem( SID_ZOOM_PANNING );
991 }
992 if( GetActiveWindow()->GetZoom() >= GetActiveWindow()->GetMaxZoom() || GetDocSh()->IsUIActive() )
993 rSet.DisableItem( SID_ZOOM_IN );
994 }
995
996 if (!mpZoomList->IsNextPossible())
997 {
998 rSet.DisableItem(SID_ZOOM_NEXT);
999 }
1000 if (!mpZoomList->IsPreviousPossible())
1001 {
1002 rSet.DisableItem(SID_ZOOM_PREV);
1003 }
1004
1005 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_REMOTE_DLG ) )
1006 {
1007
1008 bool bDisableSdremoteForGood = false;
1009#ifndef ENABLE_SDREMOTE
1010 bDisableSdremoteForGood = true;
1011#endif
1012 bDisableSdremoteForGood |= ! ( /*officecfg::Office::Common::Misc::ExperimentalMode::get() &&*/
1013 officecfg::Office::Impress::Misc::Start::EnableSdremote::get() );
1014
1015 // This dialog is only useful for TCP/IP remote control
1016 // which is unusual, under-tested and a security issue.
1017 if ( bDisableSdremoteForGood )
1018 {
1019 rSet.Put(SfxVisibilityItem(SID_REMOTE_DLG, false));
1020 }
1021 }
1022
1023 // EditText active
1024 if (GetViewShellBase().GetViewShellManager()->GetShell(ToolbarId::Draw_Text_Toolbox_Sd) != nullptr)
1025 {
1026 sal_uInt16 nCurrentSId = SID_ATTR_CHAR;
1027
1028 if(HasCurrentFunction())
1029 {
1030 nCurrentSId = GetCurrentFunction()->GetSlotID();
1031 }
1032 if( nCurrentSId != SID_TEXT_FITTOSIZE &&
1033 nCurrentSId != SID_TEXT_FITTOSIZE_VERTICAL &&
1034 nCurrentSId != SID_ATTR_CHAR_VERTICAL )
1035 nCurrentSId = SID_ATTR_CHAR;
1036
1037 rSet.Put( SfxBoolItem( nCurrentSId, true ) );
1038 }
1039
1040 if ( GetDocSh()->IsReadOnly() )
1041 {
1042 rSet.DisableItem( SID_AUTOSPELL_CHECK );
1043 }
1044 else
1045 {
1046 if (GetDoc()->GetOnlineSpell())
1047 {
1048 rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, true));
1049 }
1050 else
1051 {
1052 rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, false));
1053 }
1054 }
1055
1056 SdrPageView* pPV = mpDrawView->GetSdrPageView();
1057 OUString aActiveLayer = mpDrawView->GetActiveLayer();
1058
1059 if ( ( !aActiveLayer.isEmpty() && pPV && ( pPV->IsLayerLocked(aActiveLayer) ||
1060 !pPV->IsLayerVisible(aActiveLayer) ) ) ||
1061 SD_MOD()->GetWaterCan() )
1062 {
1063 rSet.DisableItem( SID_PASTE );
1064 rSet.DisableItem( SID_PASTE_SPECIAL );
1065 rSet.DisableItem( SID_PASTE_UNFORMATTED );
1066 rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
1067
1068 rSet.DisableItem( SID_INSERT_FLD_DATE_FIX );
1069 rSet.DisableItem( SID_INSERT_FLD_DATE_VAR );
1070 rSet.DisableItem( SID_INSERT_FLD_TIME_FIX );
1071 rSet.DisableItem( SID_INSERT_FLD_TIME_VAR );
1072 rSet.DisableItem( SID_INSERT_FLD_AUTHOR );
1073 rSet.DisableItem( SID_INSERT_FLD_PAGE );
1074 rSet.DisableItem( SID_INSERT_FLD_PAGE_TITLE );
1075 rSet.DisableItem( SID_INSERT_FLD_PAGES );
1076 rSet.DisableItem( SID_INSERT_FLD_FILE );
1077
1078 rSet.DisableItem( SID_INSERT_GRAPHIC );
1079 rSet.DisableItem( SID_INSERT_AVMEDIA );
1080 rSet.DisableItem( SID_INSERT_DIAGRAM );
1081 rSet.DisableItem( SID_INSERT_OBJECT );
1082 rSet.DisableItem( SID_INSERT_FLOATINGFRAME );
1083
1084 rSet.DisableItem( SID_INSERT_MATH );
1085 rSet.DisableItem( SID_INSERT_FRAME );
1086 rSet.DisableItem( SID_INSERTFILE );
1087 rSet.DisableItem( SID_ATTR_TABLE );
1088 rSet.DisableItem( SID_COPYOBJECTS );
1089
1090 rSet.DisableItem( SID_SCAN );
1091 rSet.DisableItem( SID_TWAIN_SELECT );
1092 rSet.DisableItem( SID_TWAIN_TRANSFER );
1093
1094// rSet.DisableItem( SID_BEZIER_EDIT );
1095 rSet.DisableItem( SID_GLUE_EDITMODE );
1096 rSet.DisableItem( SID_OBJECT_ROTATE );
1097 rSet.DisableItem( SID_OBJECT_SHEAR );
1098 rSet.DisableItem( SID_OBJECT_MIRROR );
1099 rSet.DisableItem( SID_OBJECT_CROP );
1100 rSet.DisableItem( SID_ATTR_GRAF_CROP );
1101 rSet.DisableItem( SID_OBJECT_TRANSPARENCE );
1102 rSet.DisableItem( SID_OBJECT_GRADIENT );
1103 rSet.DisableItem( SID_OBJECT_CROOK_ROTATE );
1104 rSet.DisableItem( SID_OBJECT_CROOK_SLANT );
1105 rSet.DisableItem( SID_OBJECT_CROOK_STRETCH );
1106
1107 // Disable all object-creating tools
1108 rSet.ClearItem( SID_ATTR_CHAR );
1109 rSet.DisableItem( SID_ATTR_CHAR );
1110 rSet.ClearItem( SID_ATTR_CHAR_VERTICAL );
1111 rSet.DisableItem( SID_ATTR_CHAR_VERTICAL );
1112 rSet.ClearItem(SID_DRAW_LINE);
1113 rSet.DisableItem(SID_DRAW_LINE);
1114 rSet.ClearItem(SID_DRAW_MEASURELINE);
1115 rSet.DisableItem(SID_DRAW_MEASURELINE);
1116 rSet.ClearItem(SID_DRAW_XLINE);
1117 rSet.DisableItem(SID_DRAW_XLINE);
1118 rSet.ClearItem( SID_LINE_ARROW_START );
1119 rSet.DisableItem( SID_LINE_ARROW_START );
1120 rSet.ClearItem( SID_LINE_ARROW_END );
1121 rSet.DisableItem( SID_LINE_ARROW_END );
1122 rSet.ClearItem( SID_LINE_ARROWS );
1123 rSet.DisableItem( SID_LINE_ARROWS );
1124 rSet.ClearItem( SID_LINE_ARROW_CIRCLE );
1125 rSet.DisableItem( SID_LINE_ARROW_CIRCLE );
1126 rSet.ClearItem( SID_LINE_CIRCLE_ARROW );
1127 rSet.DisableItem( SID_LINE_CIRCLE_ARROW );
1128 rSet.ClearItem( SID_LINE_ARROW_SQUARE );
1129 rSet.DisableItem( SID_LINE_ARROW_SQUARE );
1130 rSet.ClearItem( SID_LINE_SQUARE_ARROW );
1131 rSet.DisableItem( SID_LINE_SQUARE_ARROW );
1132
1133 rSet.ClearItem(SID_DRAW_RECT);
1134 rSet.DisableItem(SID_DRAW_RECT);
1135 rSet.ClearItem(SID_DRAW_RECT_NOFILL);
1136 rSet.DisableItem(SID_DRAW_RECT_NOFILL);
1137 rSet.ClearItem(SID_DRAW_RECT_ROUND);
1138 rSet.DisableItem(SID_DRAW_RECT_ROUND);
1139 rSet.ClearItem(SID_DRAW_RECT_ROUND_NOFILL);
1140 rSet.DisableItem(SID_DRAW_RECT_ROUND_NOFILL);
1141 rSet.ClearItem(SID_DRAW_SQUARE);
1142 rSet.DisableItem(SID_DRAW_SQUARE);
1143 rSet.ClearItem(SID_DRAW_SQUARE_NOFILL);
1144 rSet.DisableItem(SID_DRAW_SQUARE_NOFILL);
1145 rSet.ClearItem(SID_DRAW_SQUARE_ROUND);
1146 rSet.DisableItem(SID_DRAW_SQUARE_ROUND);
1147 rSet.ClearItem(SID_DRAW_SQUARE_ROUND_NOFILL);
1148 rSet.DisableItem(SID_DRAW_SQUARE_ROUND_NOFILL);
1149 rSet.ClearItem(SID_DRAW_ELLIPSE);
1150 rSet.DisableItem(SID_DRAW_ELLIPSE);
1151 rSet.ClearItem(SID_DRAW_ELLIPSE_NOFILL);
1152 rSet.DisableItem(SID_DRAW_ELLIPSE_NOFILL);
1153 rSet.ClearItem(SID_DRAW_CIRCLE);
1154 rSet.DisableItem(SID_DRAW_CIRCLE);
1155 rSet.ClearItem(SID_DRAW_CIRCLE_NOFILL);
1156 rSet.DisableItem(SID_DRAW_CIRCLE_NOFILL);
1157 rSet.ClearItem(SID_DRAW_CAPTION);
1158 rSet.DisableItem(SID_DRAW_CAPTION);
1159 rSet.ClearItem(SID_DRAW_FONTWORK);
1160 rSet.DisableItem(SID_DRAW_FONTWORK);
1161 rSet.ClearItem(SID_DRAW_FONTWORK_VERTICAL);
1162 rSet.DisableItem(SID_DRAW_FONTWORK_VERTICAL);
1163 rSet.ClearItem(SID_DRAW_CAPTION_VERTICAL);
1164 rSet.DisableItem(SID_DRAW_CAPTION_VERTICAL);
1165 rSet.ClearItem(SID_TEXT_FITTOSIZE);
1166 rSet.DisableItem(SID_TEXT_FITTOSIZE);
1167 rSet.ClearItem(SID_TEXT_FITTOSIZE_VERTICAL);
1168 rSet.DisableItem(SID_TEXT_FITTOSIZE_VERTICAL);
1169 rSet.ClearItem(SID_TOOL_CONNECTOR);
1170 rSet.DisableItem(SID_TOOL_CONNECTOR);
1171 rSet.ClearItem(SID_CONNECTOR_ARROW_START);
1172 rSet.DisableItem(SID_CONNECTOR_ARROW_START);
1173 rSet.ClearItem(SID_CONNECTOR_ARROW_END);
1174 rSet.DisableItem(SID_CONNECTOR_ARROW_END);
1175 rSet.ClearItem(SID_CONNECTOR_ARROWS);
1176 rSet.DisableItem(SID_CONNECTOR_ARROWS);
1177 rSet.ClearItem(SID_CONNECTOR_CIRCLE_START);
1178 rSet.DisableItem(SID_CONNECTOR_CIRCLE_START);
1179 rSet.ClearItem(SID_CONNECTOR_CIRCLE_END);
1180 rSet.DisableItem(SID_CONNECTOR_CIRCLE_END);
1181 rSet.ClearItem(SID_CONNECTOR_CIRCLES);
1182 rSet.DisableItem(SID_CONNECTOR_CIRCLES);
1183 rSet.ClearItem(SID_CONNECTOR_LINE);
1184 rSet.DisableItem(SID_CONNECTOR_LINE);
1185 rSet.ClearItem(SID_CONNECTOR_LINE_ARROW_START);
1186 rSet.DisableItem(SID_CONNECTOR_LINE_ARROW_START);
1187 rSet.ClearItem(SID_CONNECTOR_LINE_ARROW_END);
1188 rSet.DisableItem(SID_CONNECTOR_LINE_ARROW_END);
1189 rSet.ClearItem(SID_CONNECTOR_LINE_ARROWS);
1190 rSet.DisableItem(SID_CONNECTOR_LINE_ARROWS);
1191 rSet.ClearItem(SID_CONNECTOR_LINE_CIRCLE_START);
1192 rSet.DisableItem(SID_CONNECTOR_LINE_CIRCLE_START);
1193 rSet.ClearItem(SID_CONNECTOR_LINE_CIRCLE_END);
1194 rSet.DisableItem(SID_CONNECTOR_LINE_CIRCLE_END);
1195 rSet.ClearItem(SID_CONNECTOR_LINE_CIRCLES);
1196 rSet.DisableItem(SID_CONNECTOR_LINE_CIRCLES);
1197 rSet.ClearItem(SID_CONNECTOR_CURVE);
1198 rSet.DisableItem(SID_CONNECTOR_CURVE);
1199 rSet.ClearItem(SID_CONNECTOR_CURVE_ARROW_START);
1200 rSet.DisableItem(SID_CONNECTOR_CURVE_ARROW_START);
1201 rSet.ClearItem(SID_CONNECTOR_CURVE_ARROW_END);
1202 rSet.DisableItem(SID_CONNECTOR_CURVE_ARROW_END);
1203 rSet.ClearItem(SID_CONNECTOR_CURVE_ARROWS);
1204 rSet.DisableItem(SID_CONNECTOR_CURVE_ARROWS);
1205 rSet.ClearItem(SID_CONNECTOR_CURVE_CIRCLE_START);
1206 rSet.DisableItem(SID_CONNECTOR_CURVE_CIRCLE_START);
1207 rSet.ClearItem(SID_CONNECTOR_CURVE_CIRCLE_END);
1208 rSet.DisableItem(SID_CONNECTOR_CURVE_CIRCLE_END);
1209 rSet.ClearItem(SID_CONNECTOR_CURVE_CIRCLES);
1210 rSet.DisableItem(SID_CONNECTOR_CURVE_CIRCLES);
1211 rSet.ClearItem(SID_CONNECTOR_LINES);
1212 rSet.DisableItem(SID_CONNECTOR_LINES);
1213 rSet.ClearItem(SID_CONNECTOR_LINES_ARROW_START);
1214 rSet.DisableItem(SID_CONNECTOR_LINES_ARROW_START);
1215 rSet.ClearItem(SID_CONNECTOR_LINES_ARROW_END);
1216 rSet.DisableItem(SID_CONNECTOR_LINES_ARROW_END);
1217 rSet.ClearItem(SID_CONNECTOR_LINES_ARROWS);
1218 rSet.DisableItem(SID_CONNECTOR_LINES_ARROWS);
1219 rSet.ClearItem(SID_CONNECTOR_LINES_CIRCLE_START);
1220 rSet.DisableItem(SID_CONNECTOR_LINES_CIRCLE_START);
1221 rSet.ClearItem(SID_CONNECTOR_LINES_CIRCLE_END);
1222 rSet.DisableItem(SID_CONNECTOR_LINES_CIRCLE_END);
1223 rSet.ClearItem(SID_CONNECTOR_LINES_CIRCLES);
1224 rSet.DisableItem(SID_CONNECTOR_LINES_CIRCLES);
1225 rSet.ClearItem(SID_DRAW_ARC);
1226 rSet.DisableItem(SID_DRAW_ARC);
1227 rSet.ClearItem(SID_DRAW_CIRCLEARC);
1228 rSet.DisableItem(SID_DRAW_CIRCLEARC);
1229 rSet.ClearItem(SID_DRAW_PIE);
1230 rSet.DisableItem(SID_DRAW_PIE);
1231 rSet.ClearItem(SID_DRAW_PIE_NOFILL);
1232 rSet.DisableItem(SID_DRAW_PIE_NOFILL);
1233 rSet.ClearItem(SID_DRAW_CIRCLEPIE);
1234 rSet.DisableItem(SID_DRAW_CIRCLEPIE);
1235 rSet.ClearItem(SID_DRAW_CIRCLEPIE_NOFILL);
1236 rSet.DisableItem(SID_DRAW_CIRCLEPIE_NOFILL);
1237 rSet.ClearItem(SID_DRAW_ELLIPSECUT);
1238 rSet.DisableItem(SID_DRAW_ELLIPSECUT);
1239 rSet.ClearItem(SID_DRAW_ELLIPSECUT_NOFILL);
1240 rSet.DisableItem(SID_DRAW_ELLIPSECUT_NOFILL);
1241 rSet.ClearItem(SID_DRAW_CIRCLECUT);
1242 rSet.DisableItem(SID_DRAW_CIRCLECUT);
1243 rSet.ClearItem(SID_DRAW_CIRCLECUT_NOFILL);
1244 rSet.DisableItem(SID_DRAW_CIRCLECUT_NOFILL);
1245 rSet.ClearItem(SID_DRAW_POLYGON);
1246 rSet.DisableItem(SID_DRAW_POLYGON);
1247 rSet.ClearItem(SID_DRAW_POLYGON_NOFILL);
1248 rSet.DisableItem(SID_DRAW_POLYGON_NOFILL);
1249 rSet.ClearItem(SID_DRAW_FREELINE);
1250 rSet.DisableItem(SID_DRAW_FREELINE);
1251 rSet.ClearItem(SID_DRAW_FREELINE_NOFILL);
1252 rSet.DisableItem(SID_DRAW_FREELINE_NOFILL);
1253 rSet.ClearItem(SID_DRAW_XPOLYGON);
1254 rSet.DisableItem(SID_DRAW_XPOLYGON);
1255 rSet.ClearItem(SID_DRAW_XPOLYGON_NOFILL);
1256 rSet.DisableItem(SID_DRAW_XPOLYGON_NOFILL);
1257 rSet.ClearItem(SID_DRAW_BEZIER_FILL);
1258 rSet.DisableItem(SID_DRAW_BEZIER_FILL);
1259 rSet.ClearItem(SID_DRAW_BEZIER_NOFILL);
1260 rSet.DisableItem(SID_DRAW_BEZIER_NOFILL);
1261 rSet.ClearItem(SID_3D_CUBE);
1262 rSet.DisableItem(SID_3D_CUBE);
1263 rSet.ClearItem(SID_3D_SHELL);
1264 rSet.DisableItem(SID_3D_SHELL);
1265 rSet.ClearItem(SID_3D_SPHERE);
1266 rSet.DisableItem(SID_3D_SPHERE);
1267 rSet.ClearItem(SID_3D_HALF_SPHERE);
1268 rSet.DisableItem(SID_3D_HALF_SPHERE);
1269 rSet.ClearItem(SID_3D_CYLINDER);
1270 rSet.DisableItem(SID_3D_CYLINDER);
1271 rSet.ClearItem(SID_3D_CONE);
1272 rSet.DisableItem(SID_3D_CONE);
1273 rSet.ClearItem(SID_3D_TORUS);
1274 rSet.DisableItem(SID_3D_TORUS);
1275 rSet.ClearItem(SID_3D_PYRAMID);
1276 rSet.DisableItem(SID_3D_PYRAMID);
1277 }
1278
1279 if ( !aActiveLayer.isEmpty() && pPV )
1280 rSet.Put( SfxBoolItem(SID_TOGGLELAYERVISIBILITY, pPageView->IsLayerVisible(aActiveLayer)) );
1281
1282 // are the modules available?
1283
1284 if (!SvtModuleOptions().IsCalc())
1285 {
1286 // remove menu entry if module is not available
1287 rSet.Put( SfxVisibilityItem( SID_ATTR_TABLE, false ) );
1288 }
1289 if (!SvtModuleOptions().IsChart())
1290 {
1291 rSet.DisableItem( SID_INSERT_DIAGRAM );
1292 }
1293 if (!SvtModuleOptions().IsMath())
1294 {
1295 rSet.DisableItem( SID_INSERT_MATH );
1296 }
1297
1299 if( (xSlideshow.is() && xSlideshow->isRunning() && (xSlideshow->getAnimationMode() != ANIMATIONMODE_PREVIEW) ) || GetDocSh()->IsPreview() )
1300 {
1301 // Own Slots
1302 rSet.DisableItem( SID_PRESENTATION );
1303 rSet.DisableItem( SID_ZOOM_IN );
1304 rSet.DisableItem( SID_ZOOM_OUT );
1305 rSet.DisableItem( SID_ZOOM_PANNING );
1306 rSet.DisableItem( SID_ZOOM_MODE );
1307 rSet.DisableItem( SID_ZOOM_NEXT );
1308 rSet.DisableItem( SID_ZOOM_PREV );
1309 rSet.DisableItem( SID_SIZE_REAL );
1310 rSet.DisableItem( SID_SIZE_OPTIMAL );
1311 rSet.DisableItem( SID_SIZE_ALL );
1312 rSet.DisableItem( SID_SIZE_PAGE_WIDTH );
1313 rSet.DisableItem( SID_SIZE_PAGE );
1314 rSet.DisableItem( SID_INSERTPAGE );
1315 rSet.DisableItem( SID_DUPLICATE_PAGE );
1316 rSet.DisableItem( SID_MODIFYPAGE );
1317 rSet.DisableItem( SID_RENAMEPAGE );
1318 rSet.DisableItem( SID_RENAMEPAGE_QUICK );
1319 rSet.DisableItem( SID_DELETE_PAGE );
1320 rSet.DisableItem( SID_PAGESETUP );
1321
1322 if( xSlideshow.is() && xSlideshow->isRunning() )
1323 {
1324 rSet.ClearItem(SID_INSERTFILE);
1325 rSet.ClearItem(SID_OBJECT_ROTATE);
1326 rSet.ClearItem(SID_FM_CONFIG);
1327 rSet.ClearItem(SID_ANIMATION_EFFECTS);
1328 rSet.ClearItem(SID_EXECUTE_ANIMATION_EFFECT);
1329 rSet.ClearItem(SID_ANIMATION_OBJECTS);
1330 rSet.ClearItem(SID_3D_WIN);
1331
1332 rSet.DisableItem(SID_OBJECT_ALIGN);
1333 rSet.DisableItem(SID_ZOOM_TOOLBOX);
1334 rSet.DisableItem(SID_OBJECT_CHOOSE_MODE);
1335 rSet.DisableItem(SID_DRAWTBX_TEXT);
1336 rSet.DisableItem(SID_DRAWTBX_RECTANGLES);
1337 rSet.DisableItem(SID_DRAWTBX_ELLIPSES);
1338 rSet.DisableItem(SID_DRAWTBX_LINES);
1339 rSet.DisableItem(SID_DRAWTBX_ARROWS);
1340 rSet.DisableItem(SID_DRAWTBX_3D_OBJECTS);
1341 rSet.DisableItem(SID_DRAWTBX_CONNECTORS);
1342 rSet.DisableItem(SID_OBJECT_CHOOSE_MODE );
1343 rSet.DisableItem(SID_DRAWTBX_INSERT);
1344 rSet.DisableItem(SID_INSERTFILE);
1345 rSet.DisableItem(SID_OBJECT_ROTATE);
1346 rSet.DisableItem(SID_POSITION);
1347 rSet.DisableItem(SID_FM_CONFIG);
1348 rSet.DisableItem(SID_ANIMATION_EFFECTS);
1349 rSet.DisableItem(SID_EXECUTE_ANIMATION_EFFECT);
1350 rSet.DisableItem(SID_ANIMATION_OBJECTS);
1351 rSet.DisableItem(SID_3D_WIN);
1352 }
1353 }
1354
1355 // Menuoption: Change->Convert->To Bitmap, Change->Convert->To Metafile
1356 // disable, if there only Bitmap or Metafiles marked
1357 // Menuoption: Format->Area, Format->Line
1358 // disabled, if the marked objects not able to handle
1359 // these attributes
1360
1361 bool bSingleGraphicSelected = false;
1362
1363 if (!mpDrawView->AreObjectsMarked())
1364 {
1365 rSet.DisableItem (SID_CONVERT_TO_METAFILE);
1366 rSet.DisableItem (SID_CONVERT_TO_BITMAP);
1367 }
1368 else
1369 {
1370 // get marklist
1371 SdrMarkList aMarkList = mpDrawView->GetMarkedObjectList();
1372
1373 bool bFoundBitmap = false;
1374 bool bFoundMetafile = false;
1375 bool bFoundObjNoArea = false;
1376 bool bFoundNoGraphicObj = false;
1377 bool bFoundAny = false;
1378 bool bFoundTable = false;
1379
1380// const size_t nMarkCount = aMarkList.GetMarkCount();
1381 for (size_t i=0; i < nMarkCount && !bFoundAny; ++i)
1382 {
1383 SdrObject* pObj = aMarkList.GetMark(i)->GetMarkedSdrObj();
1385 SdrInventor nInv = pObj->GetObjInventor();
1386
1387 if(nInv == SdrInventor::Default)
1388 {
1389 // 2D objects
1390 switch( nId )
1391 {
1392 case SdrObjKind::PathLine :
1393 case SdrObjKind::PolyLine :
1394 case SdrObjKind::Line:
1395 case SdrObjKind::FreehandLine :
1396 case SdrObjKind::Edge:
1397 case SdrObjKind::CircleArc :
1398 bFoundObjNoArea = true;
1399 bFoundNoGraphicObj = true;
1400 break;
1401 case SdrObjKind::OLE2 :
1402 // #i118485# #i118525# Allow Line, Area and Graphic (Metafile, Bitmap)
1403 bSingleGraphicSelected = nMarkCount == 1;
1404 bFoundBitmap = true;
1405 bFoundMetafile = true;
1406 break;
1407 case SdrObjKind::Graphic :
1408 {
1409 bSingleGraphicSelected = nMarkCount == 1;
1410 const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj);
1411
1412 // Current size of the OBJ_GRAF
1413 const ::tools::Rectangle aRect = pObj->GetLogicRect();
1414 const Size aCurrentSizeofObj = aRect.GetSize();
1415
1416 // Original size of the OBJ_GRAF
1417 const Size aOriginalSizeofObj = pSdrGrafObj->getOriginalSize();
1418
1419 if(aCurrentSizeofObj == aOriginalSizeofObj )
1420 rSet.DisableItem(SID_ORIGINAL_SIZE);
1421
1422 switch(pSdrGrafObj->GetGraphicType())
1423 {
1424 case GraphicType::Bitmap :
1425 bFoundBitmap = true;
1426 if(pSdrGrafObj->isEmbeddedVectorGraphicData())
1427 {
1428 bFoundMetafile = true;
1429 }
1430 break;
1431 case GraphicType::GdiMetafile :
1432 bFoundMetafile = true;
1433 break;
1434 default:
1435 break;
1436 }
1437 break;
1438 }
1439 case SdrObjKind::Table:
1440 bFoundTable = true;
1441 break;
1442 default :
1443 bFoundAny = true;
1444 }
1445 }
1446 else if(nInv == SdrInventor::E3d)
1447 {
1448 // 3D objects
1449 bFoundAny = true;
1450 }
1451 }
1452
1453 if( bFoundTable )
1454 rSet.DisableItem( SID_ATTRIBUTES_LINE );
1455
1456 if (!bFoundAny)
1457 {
1458 // Disable menuitem for area-dialog
1459 if( bFoundObjNoArea ) // #i25616#
1460 rSet.DisableItem( SID_ATTRIBUTES_AREA );
1461
1462 if( bFoundBitmap && !bFoundMetafile && !bFoundNoGraphicObj ) // only Bitmaps marked
1463 rSet.DisableItem( SID_CONVERT_TO_BITMAP );
1464 else if( !bFoundBitmap && bFoundMetafile && !bFoundNoGraphicObj ) // only Metafiles marked
1465 rSet.DisableItem( SID_CONVERT_TO_METAFILE );
1466 else if( !bFoundBitmap && !bFoundMetafile && !bFoundNoGraphicObj ) // nothing to do
1467 {
1468 rSet.DisableItem( SID_CONVERT_TO_BITMAP );
1469 rSet.DisableItem( SID_CONVERT_TO_METAFILE );
1470 }
1471 }
1472 }
1473
1474 if( !bSingleGraphicSelected )
1475 {
1476 rSet.DisableItem (SID_OBJECT_CROP);
1477 rSet.DisableItem (SID_ATTR_GRAF_CROP);
1478 }
1479
1480 // Menuoption: Edit->Hyperlink
1481 // Disable, if there is no hyperlink
1482 bool bDisableEditHyperlink;
1484 bDisableEditHyperlink = ShouldDisableEditHyperlink();
1485 else
1486 {
1487 // tdf#137445 if a popup menu was active, use the state as of when the popup was launched and then drop
1488 // moAtContextMenu_DisableEditHyperlink
1489 bDisableEditHyperlink = *moAtContextMenu_DisableEditHyperlink;
1491 }
1492
1493 //highlight selected custom shape
1494 {
1495 if(HasCurrentFunction())
1496 {
1498 FuConstructCustomShape* pShapeFunc = dynamic_cast< FuConstructCustomShape* >( xFunc.get() );
1499
1500 static const sal_uInt16 nCSTbArray[] = { SID_DRAWTBX_CS_BASIC, SID_DRAWTBX_CS_SYMBOL,
1501 SID_DRAWTBX_CS_ARROW, SID_DRAWTBX_CS_FLOWCHART,
1502 SID_DRAWTBX_CS_CALLOUT, SID_DRAWTBX_CS_STAR };
1503
1504 const sal_uInt16 nCurrentSId = GetCurrentFunction()->GetSlotID();
1505 for (sal_uInt16 i : nCSTbArray)
1506 {
1507 rSet.ClearItem( i ); // Why is this necessary?
1508 rSet.Put( SfxStringItem( i, nCurrentSId == i && pShapeFunc
1509 ? pShapeFunc->GetShapeType() : OUString() ) );
1510 }
1511 }
1512 }
1513
1514 if ( bDisableEditHyperlink || GetDocSh()->IsReadOnly() )
1515 rSet.DisableItem( SID_EDIT_HYPERLINK );
1516
1517 if ( bDisableEditHyperlink )
1518 {
1519 rSet.DisableItem( SID_OPEN_HYPERLINK );
1520 rSet.DisableItem( SID_COPY_HYPERLINK_LOCATION );
1521 }
1522
1523 //fdo#78151 enable show next level/hide last level if editing a master page
1524 //PresObjKind::Outline object and the current selection allow that to happen
1525 {
1526 bool bDisableShowNextLevel = true;
1527 bool bDisableHideLastLevel = true;
1528
1529 ESelection aSel;
1531 if (pOL)
1532 {
1533 //and are on the last paragraph
1534 aSel.Adjust();
1535 if (aSel.nEndPara == pOL->GetParagraphCount() - 1)
1536 {
1537 sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara);
1538 if (nDepth != sal_uInt16(-1))
1539 {
1540 //there exists another numbering level that
1541 //is currently hidden
1542 if (nDepth < 8)
1543 bDisableShowNextLevel = false;
1544 //there exists a previous numbering level
1545 if (nDepth > 0)
1546 bDisableHideLastLevel = false;
1547 }
1548 }
1549 }
1550
1551 if (bDisableShowNextLevel)
1552 rSet.DisableItem(SID_SHOW_NEXT_LEVEL);
1553
1554 if (bDisableHideLastLevel)
1555 rSet.DisableItem(SID_HIDE_LAST_LEVEL);
1556 }
1557
1558#if defined(_WIN32) || defined UNX
1559 if( !mxScannerManager.is() )
1560 {
1561 rSet.DisableItem( SID_TWAIN_SELECT );
1562 rSet.DisableItem( SID_TWAIN_TRANSFER );
1563 }
1564#endif
1565
1566 // Set the state of two entries in the 'Slide' context sub-menu
1567 // concerning the visibility of master page background and master page
1568 // shapes.
1569 if (rSet.GetItemState(SID_DISPLAY_MASTER_BACKGROUND) == SfxItemState::DEFAULT
1570 || rSet.GetItemState(SID_DISPLAY_MASTER_OBJECTS) == SfxItemState::DEFAULT)
1571 {
1572 SdPage* pPage = GetActualPage();
1573 if (pPage != nullptr && GetDoc() != nullptr)
1574 {
1575 SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
1576 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
1577 SdrLayerID aBackgroundId = rLayerAdmin.GetLayerID(sUNO_LayerName_background);
1579 rSet.Put(SfxBoolItem(SID_DISPLAY_MASTER_BACKGROUND,
1580 aVisibleLayers.IsSet(aBackgroundId)));
1581 rSet.Put(SfxBoolItem(SID_DISPLAY_MASTER_OBJECTS,
1582 aVisibleLayers.IsSet(aObjectId)));
1583 }
1584 }
1585
1586 if (rSet.GetItemState(SID_SAVE_BACKGROUND) == SfxItemState::DEFAULT)
1587 {
1588 bool bDisableSaveBackground = true;
1589 SdPage* pPage = GetActualPage();
1590 if (pPage != nullptr && GetDoc() != nullptr)
1591 {
1593 SdStyleSheet* pStyleSheet = pPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND);
1594 MergePageBackgroundFilling(pPage, pStyleSheet, meEditMode == EditMode::MasterPage, aMergedAttr);
1595 if (drawing::FillStyle_BITMAP == aMergedAttr.Get(XATTR_FILLSTYLE).GetValue())
1596 {
1597 bDisableSaveBackground = false;
1598 }
1599 }
1600 if (bDisableSaveBackground)
1601 rSet.DisableItem(SID_SAVE_BACKGROUND);
1602 }
1603
1604 if (GetObjectShell()->isExportLocked())
1605 rSet.DisableItem(SID_PRESENTATION_MINIMIZER);
1606
1607 if (rSet.GetItemState(SID_INSERT_SIGNATURELINE) == SfxItemState::DEFAULT)
1608 {
1609 if (!GetObjectShell()->IsSignPDF())
1610 {
1611 // Currently SID_INSERT_SIGNATURELINE assumes a PDF that was opened for signing, disable
1612 // it otherwise.
1613 rSet.DisableItem(SID_INSERT_SIGNATURELINE);
1614 }
1615 }
1616
1618}
1619
1621{
1622 //DrawView
1623 rSet.Put(SfxBoolItem(SID_SLIDE_SORTER_MODE, false));
1624 rSet.Put(SfxBoolItem(SID_OUTLINE_MODE, false));
1625 rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false));
1626 rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false));
1628 {
1629 rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false));
1630 rSet.Put(SfxBoolItem(SID_NOTES_MODE, true));
1631 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false));
1632 }
1633 else if (mePageKind == PageKind::Handout)
1634 {
1635 rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false));
1636 rSet.Put(SfxBoolItem(SID_NOTES_MODE, false));
1637 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, true));
1638 }
1639 else
1640 {
1641 rSet.Put(SfxBoolItem(SID_DRAWINGMODE, true));
1642 rSet.Put(SfxBoolItem(SID_NOTES_MODE, false));
1643 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false));
1644 }
1645
1646 // Removed [GetDocSh()->GetCurrentFunction() ||] from the following
1647 // clause because the current function of the docshell can only be
1648 // search and replace or spell checking and in that case switching the
1649 // view mode is allowed.
1650 const bool bIsRunning = SlideShow::IsRunning(GetViewShellBase());
1651
1652 if (GetViewFrame()->GetFrame().IsInPlace() || bIsRunning)
1653 {
1654 if ( !GetViewFrame()->GetFrame().IsInPlace() )
1655 {
1656 rSet.ClearItem( SID_DRAWINGMODE );
1657 rSet.DisableItem( SID_DRAWINGMODE );
1658 }
1659
1660 rSet.ClearItem( SID_NOTES_MODE );
1661 rSet.DisableItem( SID_NOTES_MODE );
1662
1663 rSet.ClearItem( SID_HANDOUT_MASTER_MODE );
1664 rSet.DisableItem( SID_HANDOUT_MASTER_MODE );
1665
1666 rSet.ClearItem( SID_OUTLINE_MODE );
1667 rSet.DisableItem( SID_OUTLINE_MODE );
1668
1669 rSet.ClearItem( SID_SLIDE_MASTER_MODE );
1670 rSet.DisableItem( SID_SLIDE_MASTER_MODE );
1671
1672 rSet.ClearItem( SID_NOTES_MASTER_MODE );
1673 rSet.DisableItem( SID_NOTES_MASTER_MODE );
1674
1675 rSet.ClearItem( SID_SLIDE_SORTER_MODE );
1676 rSet.DisableItem( SID_SLIDE_SORTER_MODE );
1677 }
1678
1679 if (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)
1680 {
1681 // Outplace-Edit: do not allow switch
1682 rSet.ClearItem( SID_OUTLINE_MODE );
1683 rSet.DisableItem( SID_OUTLINE_MODE );
1684
1685 rSet.ClearItem( SID_SLIDE_SORTER_MODE );
1686 rSet.DisableItem( SID_SLIDE_SORTER_MODE );
1687
1688 rSet.ClearItem( SID_NOTES_MODE );
1689 rSet.DisableItem( SID_NOTES_MODE );
1690
1691 rSet.ClearItem( SID_HANDOUT_MASTER_MODE );
1692 rSet.DisableItem( SID_HANDOUT_MASTER_MODE );
1693
1694 rSet.ClearItem( SID_SLIDE_MASTER_MODE );
1695 rSet.DisableItem( SID_SLIDE_MASTER_MODE );
1696
1697 rSet.ClearItem( SID_NOTES_MASTER_MODE );
1698 rSet.DisableItem( SID_NOTES_MASTER_MODE );
1699 }
1700
1703}
1704
1706{
1707 SdPage *pPage = getCurrentPage();
1708
1709 if (pPage == nullptr || GetDoc() == nullptr)
1710 return;
1711
1712 SvxPageItem aPageItem(SID_ATTR_PAGE);
1713 aPageItem.SetLandscape( pPage->GetOrientation() == Orientation::Landscape );
1714
1715 rSet.Put(SvxSizeItem( SID_ATTR_PAGE_SIZE, pPage->GetSize() ));
1716 rSet.Put(aPageItem);
1717
1718 const SfxItemSet &rPageAttr = pPage->getSdrPageProperties().GetItemSet();
1719 const XFillStyleItem* pFillStyle = rPageAttr.GetItem(XATTR_FILLSTYLE);
1720 if (!pFillStyle)
1721 return;
1722
1723 drawing::FillStyle eXFS = pFillStyle->GetValue();
1724 XFillStyleItem aFillStyleItem( eXFS );
1725 aFillStyleItem.SetWhich( SID_ATTR_PAGE_FILLSTYLE );
1726 rSet.Put(aFillStyleItem);
1727
1728 switch (eXFS)
1729 {
1730 case drawing::FillStyle_SOLID:
1731 if (const XFillColorItem* pColorItem = rPageAttr.GetItem(XATTR_FILLCOLOR))
1732 {
1733 Color aColor = pColorItem->GetColorValue();
1734 XFillColorItem aFillColorItem( OUString(), aColor );
1735 aFillColorItem.SetWhich( SID_ATTR_PAGE_COLOR );
1736 rSet.Put( aFillColorItem );
1737 }
1738 break;
1739
1740 case drawing::FillStyle_GRADIENT:
1741 {
1742 const XFillGradientItem *pGradient = rPageAttr.GetItem( XATTR_FILLGRADIENT );
1743 XFillGradientItem aFillGradientItem( pGradient->GetName(), pGradient->GetGradientValue(), SID_ATTR_PAGE_GRADIENT );
1744 rSet.Put( aFillGradientItem );
1745 }
1746 break;
1747
1748 case drawing::FillStyle_HATCH:
1749 {
1750 const XFillHatchItem *pFillHatchItem( rPageAttr.GetItem( XATTR_FILLHATCH ) );
1751 XFillHatchItem aFillHatchItem( pFillHatchItem->GetName(), pFillHatchItem->GetHatchValue());
1752 aFillHatchItem.SetWhich( SID_ATTR_PAGE_HATCH );
1753 rSet.Put( aFillHatchItem );
1754 }
1755 break;
1756
1757 case drawing::FillStyle_BITMAP:
1758 {
1759 const XFillBitmapItem *pFillBitmapItem = rPageAttr.GetItem( XATTR_FILLBITMAP );
1760 XFillBitmapItem aFillBitmapItem( pFillBitmapItem->GetName(), pFillBitmapItem->GetGraphicObject() );
1761 aFillBitmapItem.SetWhich( SID_ATTR_PAGE_BITMAP );
1762 rSet.Put( aFillBitmapItem );
1763 }
1764 break;
1765
1766 default:
1767 break;
1768 }
1769}
1770
1772{
1773 SdPage *pPage = getCurrentPage();
1774 if (!pPage)
1775 return;
1776 sal_uInt16 nSlotId = rReq.GetSlot();
1777 const SfxItemSet *pArgs = rReq.GetArgs();
1778 if (!pArgs)
1779 return;
1780
1781 if ( ( nSlotId >= SID_ATTR_PAGE_COLOR ) && ( nSlotId <= SID_ATTR_PAGE_FILLSTYLE ) )
1782 {
1783 SdrPageProperties& rPageProperties = pPage->getSdrPageProperties();
1784 const SfxItemSet &aPageItemSet = rPageProperties.GetItemSet();
1785 SfxItemSet aTempSet = aPageItemSet.CloneAsValue(false, &mpDrawView->GetModel().GetItemPool());
1786 const SfxPoolItem* pItem = nullptr;
1787
1788 rPageProperties.ClearItem(XATTR_FILLSTYLE);
1789 rPageProperties.ClearItem(XATTR_FILLGRADIENT);
1790 rPageProperties.ClearItem(XATTR_FILLHATCH);
1791 rPageProperties.ClearItem(XATTR_FILLBITMAP);
1792
1793 switch (nSlotId)
1794 {
1795 case SID_ATTR_PAGE_FILLSTYLE:
1796 {
1797 XFillStyleItem aFSItem( pArgs->Get( XATTR_FILLSTYLE ) );
1798 drawing::FillStyle eXFS = aFSItem.GetValue();
1799
1800 if ( eXFS == drawing::FillStyle_NONE )
1801 rPageProperties.PutItem( XFillStyleItem( eXFS ) );
1802 }
1803 break;
1804
1805 case SID_ATTR_PAGE_COLOR:
1806 {
1807 rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_SOLID ) );
1808 if (const XFillColorItem* pColorItem = static_cast<const XFillColorItem*>(pArgs->GetItem(SID_ATTR_PAGE_COLOR)))
1809 rPageProperties.PutItem(XFillColorItem("", pColorItem->GetColorValue()));
1810 else
1811 rPageProperties.PutItem(pArgs->Get(XATTR_FILLCOLOR));
1812 }
1813 break;
1814
1815 case SID_ATTR_PAGE_GRADIENT:
1816 {
1817 if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, false, &pItem))
1818 {
1819 const SfxStringItem* pJSON = static_cast<const SfxStringItem*>(pItem);
1820 XFillGradientItem aGradientItem( basegfx::BGradient::fromJSON(pJSON->GetValue()) );
1821
1822 // MigrateItemSet guarantees unique gradient names
1823 SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet(mpDrawView->GetModel().GetItemPool());
1824 aMigrateSet.Put( aGradientItem );
1825 SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, &mpDrawView->GetModel());
1826
1827 rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
1828 rPageProperties.PutItemSet( aTempSet );
1829 }
1830 else
1831 {
1832 XFillGradientItem aGradientItem( pArgs->Get( XATTR_FILLGRADIENT ) );
1833
1834 // MigrateItemSet guarantees unique gradient names
1835 SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet(mpDrawView->GetModel().GetItemPool());
1836 aMigrateSet.Put( aGradientItem );
1837 SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, &mpDrawView->GetModel());
1838
1839 rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
1840 rPageProperties.PutItemSet( aTempSet );
1841 }
1842 }
1843 break;
1844
1845 case SID_ATTR_PAGE_HATCH:
1846 {
1847 XFillHatchItem aHatchItem( pArgs->Get( XATTR_FILLHATCH ) );
1848 rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_HATCH ) );
1849 rPageProperties.PutItem( aHatchItem );
1850 }
1851 break;
1852
1853 case SID_ATTR_PAGE_BITMAP:
1854 {
1855 XFillBitmapItem aBitmapItem( pArgs->Get( XATTR_FILLBITMAP ) );
1856 rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_BITMAP ) );
1857 rPageProperties.PutItem( aBitmapItem );
1858 }
1859 break;
1860
1861 default:
1862 break;
1863 }
1864
1865 rReq.Done();
1866 }
1867 else
1868 {
1869 PageKind ePageKind = GetPageKind();
1870 const SfxPoolItem* pPoolItem = nullptr;
1871 Size aNewSize(pPage->GetSize());
1872 sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1;
1873 bool bScaleAll = true;
1874 Orientation eOrientation = pPage->GetOrientation();
1875 SdPage* pMasterPage = pPage->IsMasterPage() ? pPage : &static_cast<SdPage&>(pPage->TRG_GetMasterPage());
1876 bool bFullSize = pMasterPage->IsBackgroundFullSize();
1877 sal_uInt16 nPaperBin = pPage->GetPaperBin();
1878
1879 switch (nSlotId)
1880 {
1881 case SID_ATTR_PAGE_LRSPACE:
1882 if( pArgs->GetItemState(SID_ATTR_PAGE_LRSPACE,
1883 true,&pPoolItem) == SfxItemState::SET )
1884 {
1885 nLeft = static_cast<const SvxLongLRSpaceItem*>(pPoolItem)->GetLeft();
1886 nRight = static_cast<const SvxLongLRSpaceItem*>(pPoolItem)->GetRight();
1887 if (nLeft != -1)
1888 {
1889 nUpper = pPage->GetUpperBorder();
1890 nLower = pPage->GetLowerBorder();
1891 }
1892 SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
1893 }
1894 break;
1895
1896 case SID_ATTR_PAGE_ULSPACE:
1897 if( pArgs->GetItemState(SID_ATTR_PAGE_ULSPACE,
1898 true,&pPoolItem) == SfxItemState::SET )
1899 {
1900 nUpper = static_cast<const SvxLongULSpaceItem*>(pPoolItem)->GetUpper();
1901 nLower = static_cast<const SvxLongULSpaceItem*>(pPoolItem)->GetLower();
1902 if (nUpper != -1)
1903 {
1904 nLeft = pPage->GetLeftBorder();
1905 nRight = pPage->GetRightBorder();
1906 }
1907 SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
1908 }
1909 break;
1910
1911 default:
1912 break;
1913 }
1914 }
1915}
1916
1918{
1919 // Iterate over all requested items in the set.
1920 SfxWhichIter aIter( rSet );
1921 sal_uInt16 nWhich = aIter.FirstWhich();
1922 while (nWhich)
1923 {
1924 switch (nWhich)
1925 {
1926 case SID_SEARCH_ITEM:
1927 case SID_SEARCH_OPTIONS:
1928 // Forward this request to the common (old) code of the
1929 // document shell.
1930 GetDocSh()->GetState (rSet);
1931 break;
1932 default:
1933 SAL_WARN("sd", "DrawViewShell::GetState(): can not handle which id " << nWhich);
1934 break;
1935 }
1936 nWhich = aIter.NextWhich();
1937 }
1938}
1939
1941{
1943 {
1944 // Do not execute anything during a native slide show.
1945 return;
1946 }
1947
1948 switch (rReq.GetSlot())
1949 {
1950 case SID_SEARCH_ITEM:
1951 // Forward this request to the common (old) code of the
1952 // document shell.
1953 GetDocSh()->Execute (rReq);
1954 break;
1955
1956 case SID_SPELL_DIALOG:
1957 {
1958 SfxViewFrame* pViewFrame = GetViewFrame();
1959 if (rReq.GetArgs() != nullptr)
1960 pViewFrame->SetChildWindow (SID_SPELL_DIALOG,
1961 static_cast<const SfxBoolItem&>(rReq.GetArgs()->
1962 Get(SID_SPELL_DIALOG)).GetValue());
1963 else
1964 pViewFrame->ToggleChildWindow(SID_SPELL_DIALOG);
1965
1966 pViewFrame->GetBindings().Invalidate(SID_SPELL_DIALOG);
1967 rReq.Ignore ();
1968 }
1969 break;
1970
1971 default:
1972 SAL_WARN("sd", "DrawViewShell::Execute(): can not handle slot " << rReq.GetSlot());
1973 break;
1974 }
1975}
1976
1977} // end of namespace sd
1978
1979/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OUString & GetValue() const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
static css::uno::Reference< css::linguistic2::XThesaurus > GetThesaurus()
OUString const & GetName() const
ESelection GetSelection() const
Outliner * GetOutliner() const
OUString GetSelected() const
sal_Int16 GetDepth(sal_Int32 nPara) const
sal_Int32 GetParagraphCount() const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SAL_DLLPRIVATE LanguageType GetLanguage(const sal_uInt16 nId) const
Definition: drawdoc2.cxx:875
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
Definition: sdpage.cxx:203
virtual Orientation GetOrientation() const override
Definition: sdpage.cxx:2562
SdStyleSheet * getPresentationStyle(sal_uInt32 nHelpId) const
returns the presentation style with the given helpid from this masterpage or this slides masterpage
Definition: sdpage.cxx:674
PageKind GetPageKind() const
Definition: sdpage.hxx:205
bool IsExcluded() const
Definition: sdpage.hxx:223
sal_uInt16 GetPaperBin() const
Definition: sdpage.hxx:278
AutoLayout GetAutoLayout() const
Definition: sdpage.hxx:190
GraphicType GetGraphicType() const
bool isEmbeddedVectorGraphicData() const
Size getOriginalSize() const
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
const SdrLayerAdmin & GetLayerAdmin() const
static void MigrateItemSet(const SfxItemSet *pSourceSet, SfxItemSet *pDestSet, SdrModel *pNewModel)
size_t GetObjCount() const
virtual SdrInventor GetObjInventor() const
bool IsEmptyPresObj() const
virtual SdrObjKind GetObjIdentifier() const
virtual const tools::Rectangle & GetLogicRect() const
const SfxItemSet & GetItemSet() const
void PutItemSet(const SfxItemSet &rSet)
void PutItem(const SfxPoolItem &rItem)
void ClearItem(const sal_uInt16 nWhich=0)
SdrObjList * GetObjList() const
bool IsLayerVisible(const OUString &rName) const
SdrPage * GetPage() const
bool IsLayerLocked(const OUString &rName) const
SdrPage & TRG_GetMasterPage() const
bool IsMasterPage() const
Size GetSize() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
sal_Int32 GetLeftBorder() const
SdrPageProperties & getSdrPageProperties()
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
bool IsBackgroundFullSize() const
sal_Int32 GetLowerBorder() const
bool CanCreateEditOutlinerParaObject() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
void Invalidate(sal_uInt16 nId)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SfxItemSet CloneAsValue(bool bItems=true, SfxItemPool *pToPool=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
void InvalidateItem(sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
SfxViewFrame * GetFrame() const
virtual SfxObjectShell * GetObjectShell()
void ToggleChildWindow(sal_uInt16)
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
static bool GetEmbeddedName(const TransferableDataHelper &rData, OUString &_rName, OUString &_rSource, SotClipboardFormatId const &_nFormat)
void SetLandscape(bool bL)
sal_uInt16 GetCurPageId() const
sal_uInt32 GetFormatCount() const
bool GetTransferableObjectDescriptor(SotClipboardFormatId nFormat, TransferableObjectDescriptor &rDesc)
SotClipboardFormatId GetFormat(sal_uInt32 nFormat) const
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
bool HasFormat(SotClipboardFormatId nFormat) const
static bool IsCursorAtURLField(const EditView &pEditView)
const GraphicObject & GetGraphicObject() const
const basegfx::BGradient & GetGradientValue() const
const XHatch & GetHatchValue() const
static BGradient fromJSON(std::u16string_view rJSON)
void Execute(SfxRequest &rReq)
Handles SFX-Requests.
Definition: docshel3.cxx:134
void GetState(SfxItemSet &)
Definition: docshell.cxx:205
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
Definition: drviews1.cxx:636
css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager
std::unique_ptr< DrawView > mpDrawView
bool IsLayerModeActive() const
rtl::Reference< TransferableClipboardListener > mxClipEvtLstnr
void GetMenuStateSel(SfxItemSet &rSet)
Set state (Enabled/Disabled) of Menu-SfxSlots.
Definition: drviewsj.cxx:49
VclPtr< TabControl > maTabControl
void GetDrawAttrState(SfxItemSet &rSet)
Definition: drviews7.cxx:209
void Execute(SfxRequest &rReq)
Definition: drviews7.cxx:1940
void SetChildWindowState(SfxItemSet &rSet)
Definition: drviews6.cxx:199
void GetState(SfxItemSet &rSet)
Definition: drviews7.cxx:1917
void GetPageProperties(SfxItemSet &rSet)
Definition: drviews7.cxx:1705
void GetMarginProperties(SfxItemSet &rSet)
Definition: drviews7.cxx:246
::std::unique_ptr< SvxClipboardFormatItem > mpCurrentClipboardFormats
This item contains the clipboard formats of the current clipboard content that are supported both by ...
SD_DLLPUBLIC LayerTabBar * GetLayerTabControl()
Return a pointer to the tab control for layers.
Definition: drviews5.cxx:636
virtual SdPage * GetActualPage() override
void GetModeSwitchingMenuState(SfxItemSet &rSet)
Set the items of the given item set that are related to switching the editing mode to the correct val...
Definition: drviews7.cxx:1620
void SetPageProperties(SfxRequest &rReq)
Definition: drviews7.cxx:1771
::Outliner * GetOutlinerForMasterPageOutlineTextObj(ESelection &rSel)
Definition: drviews7.cxx:215
void GetMenuState(SfxItemSet &rSet)
Definition: drviews7.cxx:323
PageKind GetPageKind() const
std::optional< bool > moAtContextMenu_DisableEditHyperlink
bool ShouldDisableEditHyperlink() const
return true if "Edit Hyperlink" in context menu should be disabled
Definition: drviews7.cxx:284
static void GetSlotState(SfxItemSet &rSet, ViewShell const *pViewShell, SfxViewFrame *pViewFrame)
Definition: fubullet.cxx:276
const OUString & GetShapeType() const
Definition: fuconcs.cxx:230
static void GetMenuState(DrawViewShell const &rDrawViewShell, SfxItemSet &rSet)
OUString GetLayerName(sal_uInt16 nPageId) const
Definition: LayerTabBar.cxx:90
static bool IsRealNameOfStandardLayer(std::u16string_view rName)
This view shell is responsible for showing the presentation of an Impress document.
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
Definition: slideshow.cxx:208
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
Definition: slideshow.cxx:157
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
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
void GetMenuState(SfxItemSet &rSet)
set state (enabled/disabled) of Menu SfxSlots
Definition: viewshe3.cxx:61
std::unique_ptr< ZoomList > mpZoomList
Definition: ViewShell.hxx:457
void SetPageSizeAndBorder(PageKind ePageKind, const Size &rNewSize, ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin, bool bBackgroundFullSize)
Definition: viewshe2.cxx:450
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
::tools::Long GetZoom() const
Definition: viewshe2.cxx:344
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
SD_DLLPUBLIC ShellType GetShellType() const
Return the type of the shell.
Definition: viewshel.cxx:1402
bool HasRuler() const
Definition: ViewShell.hxx:191
static void getState(SdrView const *pSdrView, SfxItemSet &rSet)
static void getState(SdrView const *pSdrView, SfxItemSet &rSet)
int nCount
#define DBG_ASSERT(sCon, aError)
static ::std::unique_ptr< SvxClipboardFormatItem > GetSupportedClipboardFormats(TransferableDataHelper &rDataHelper)
Create a list of clipboard formats that are supported both from the current clipboard content and the...
Definition: drviews7.cxx:99
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
SotClipboardFormatId
OUString sName
TriState
TRISTATE_INDET
TRISTATE_TRUE
#define LANGUAGE_NONE
#define SAL_WARN(area, stream)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
bool IsVerticalTextEnabled()
int i
@ ANIMATIONMODE_PREVIEW
Definition: slideshow.hxx:73
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool bMasterPage, SfxItemSet &rMergedAttr)
Merge the background properties together and deposit the result in rMergeAttr.
Definition: fupage.cxx:164
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
sal_Int16 nId
const char GetValue[]
PageKind
Definition: pres.hxx:45
Orientation
#define SD_MOD()
Definition: sdmod.hxx:184
static SfxItemSet & rSet
void Adjust()
sal_Int32 nEndPara
SdrAlign
SdrInventor
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
SdrObjKind
constexpr OUStringLiteral sUNO_LayerName_background_objects
Definition: unokywds.hxx:30
constexpr OUStringLiteral sUNO_LayerName_background
Definition: unokywds.hxx:29
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)