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