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