1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <config_features.h>
21 
22 #include <DrawViewShell.hxx>
23 
24 #include <sfx2/viewfrm.hxx>
25 #include <editeng/eeitem.hxx>
26 #include <editeng/tstpitem.hxx>
27 #include <editeng/lrspitem.hxx>
28 #include <editeng/protitem.hxx>
29 #include <editeng/frmdiritem.hxx>
30 #include <editeng/adjustitem.hxx>
31 #include <svx/ruler.hxx>
32 #include <svx/svdotable.hxx>
33 #include <editeng/numitem.hxx>
34 #include <svx/rulritem.hxx>
35 #include <svx/svxids.hrc>
36 #include <svx/svdpagv.hxx>
37 #include <sfx2/request.hxx>
38 #include <sfx2/dispatch.hxx>
39 #include <tools/urlobj.hxx>
40 #include <svl/eitem.hxx>
41 #include <svl/rectitem.hxx>
42 #include <svl/stritem.hxx>
43 #include <svx/svdoole2.hxx>
44 #include <svl/itempool.hxx>
45 #include <svl/ptitem.hxx>
46 #include <basic/sbstar.hxx>
47 #include <basic/sberrors.hxx>
48 #include <svx/fmshell.hxx>
49 #include <svx/f3dchild.hxx>
50 #include <svx/float3d.hxx>
51 #include <svx/sdmetitm.hxx>
52 
53 #include <app.hrc>
54 #include <strings.hrc>
55 
56 #include <sdundogr.hxx>
57 #include <undopage.hxx>
58 #include <fupoor.hxx>
59 #include <slideshow.hxx>
60 #include <sdpage.hxx>
61 #include <Window.hxx>
62 #include <sdresid.hxx>
63 #include <unokywds.hxx>
64 #include <drawview.hxx>
65 #include <drawdoc.hxx>
66 #include <DrawDocShell.hxx>
67 #include <sdabstdlg.hxx>
68 #include <sfx2/ipclient.hxx>
69 #include <tools/diagnose_ex.h>
70 #include <ViewShellBase.hxx>
71 #include <FormShellManager.hxx>
72 #include <LayerTabBar.hxx>
73 #include <com/sun/star/drawing/framework/XControllerManager.hpp>
74 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
75 #include <com/sun/star/drawing/framework/XConfiguration.hpp>
76 #include <com/sun/star/drawing/XShape.hpp>
77 #include <com/sun/star/frame/XFrame.hpp>
78 #include <editeng/lspcitem.hxx>
79 #include <editeng/ulspitem.hxx>
80 #include <memory>
81 #include <comphelper/processfactory.hxx>
82 #include <oox/drawingml/diagram/diagram.hxx>
83 #include <oox/export/drawingml.hxx>
84 #include <oox/shape/ShapeFilterBase.hxx>
85 
86 using namespace ::com::sun::star::uno;
87 using namespace ::com::sun::star::drawing::framework;
88 using ::com::sun::star::frame::XFrame;
89 using ::com::sun::star::frame::XController;
90 
91 namespace sd {
92 
93 /**
94  * handle SfxRequests for controller
95  */
ExecCtrl(SfxRequest & rReq)96 void  DrawViewShell::ExecCtrl(SfxRequest& rReq)
97 {
98     // except a page switch and jumps to bookmarks, nothing is executed during
99     // a slide show
100     if( HasCurrentFunction(SID_PRESENTATION) &&
101         rReq.GetSlot() != SID_SWITCHPAGE &&
102         rReq.GetSlot() != SID_JUMPTOMARK)
103         return;
104 
105     CheckLineTo (rReq);
106 
107     // End text edit mode for some requests.
108     sal_uInt16 nSlot = rReq.GetSlot();
109     bool bAllowFocusChange = true;
110     switch (nSlot)
111     {
112         case SID_OUTPUT_QUALITY_COLOR:
113         case SID_OUTPUT_QUALITY_GRAYSCALE:
114         case SID_OUTPUT_QUALITY_BLACKWHITE:
115         case SID_OUTPUT_QUALITY_CONTRAST:
116             // Do nothing.
117             break;
118         case SID_SWITCHPAGE:
119             if (rReq.GetArgs() && rReq.GetArgs()->Count () == 1)
120             {
121                 const SfxBoolItem* pAllowFocusChange = rReq.GetArg<SfxBoolItem>(SID_SWITCHPAGE);
122                 bAllowFocusChange = pAllowFocusChange->GetValue();
123                 if (!bAllowFocusChange)
124                     break;
125             }
126             BOOST_FALLTHROUGH;
127         default:
128             if ( mpDrawView->IsTextEdit() )
129             {
130                 mpDrawView->SdrEndTextEdit();
131             }
132     }
133 
134     //  sal_uInt16 nSlot = rReq.GetSlot();
135     switch (nSlot)
136     {
137         case SID_SWITCHPAGE:  // BASIC
138         {
139             // switch page in running slide show
140             if(SlideShow::IsRunning(GetViewShellBase()) && rReq.GetArgs())
141             {
142                 const SfxUInt32Item* pWhatPage = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATPAGE);
143                 SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber(static_cast<sal_Int32>((pWhatPage->GetValue()-1)>>1));
144             }
145             else
146             {
147                 const SfxItemSet *pArgs = rReq.GetArgs ();
148                 sal_uInt16 nSelectedPage = 0;
149 
150                 if (! pArgs || pArgs->Count () == 1)
151                 {
152                     nSelectedPage = maTabControl->GetCurPagePos();
153                 }
154                 else if (pArgs->Count () == 2)
155                 {
156                     const SfxUInt32Item* pWhatPage = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATPAGE);
157                     const SfxUInt32Item* pWhatKind = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATKIND);
158 
159                     sal_Int32 nWhatPage = static_cast<sal_Int32>(pWhatPage->GetValue ());
160                     PageKind nWhatKind = static_cast<PageKind>(pWhatKind->GetValue ());
161                     if (nWhatKind < PageKind::Standard || nWhatKind > PageKind::Handout)
162                     {
163 #if HAVE_FEATURE_SCRIPTING
164                         StarBASIC::FatalError (ERRCODE_BASIC_BAD_PROP_VALUE);
165 #endif
166                         rReq.Ignore ();
167                         break;
168                     }
169                     else if (meEditMode != EditMode::MasterPage)
170                     {
171                         if (! CHECK_RANGE (0, nWhatPage, GetDoc()->GetSdPageCount(nWhatKind)))
172                         {
173 #if HAVE_FEATURE_SCRIPTING
174                             StarBASIC::FatalError (ERRCODE_BASIC_BAD_PROP_VALUE);
175 #endif
176                             rReq.Ignore ();
177                             break;
178                         }
179 
180                         nSelectedPage = static_cast<short>(nWhatPage);
181                         mePageKind    = nWhatKind;
182                     }
183                 }
184                 else
185                 {
186 #if HAVE_FEATURE_SCRIPTING
187                     StarBASIC::FatalError (ERRCODE_BASIC_WRONG_ARGS);
188 #endif
189                     rReq.Ignore ();
190                     break;
191                 }
192 
193                 if( GetDocSh() && (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED))
194                     GetDocSh()->SetModified();
195 
196                 SwitchPage(nSelectedPage, bAllowFocusChange);
197 
198                 if(HasCurrentFunction(SID_BEZIER_EDIT))
199                     GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
200 
201                 Invalidate();
202                 InvalidateWindows();
203                 rReq.Done ();
204             }
205             break;
206         }
207 
208         case SID_SWITCHLAYER:  // BASIC
209         {
210             const SfxItemSet *pArgs = rReq.GetArgs ();
211 
212             // #i87182#
213             bool bCurPageValid(false);
214             sal_uInt16 nCurPage(0);
215 
216             if(GetLayerTabControl())
217             {
218                 nCurPage = GetLayerTabControl()->GetCurPageId();
219                 bCurPageValid = true;
220             }
221 
222             if(pArgs && 1 == pArgs->Count())
223             {
224                 const SfxUInt32Item* pWhatLayer = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATLAYER);
225 
226                 if(pWhatLayer)
227                 {
228                     nCurPage = static_cast<short>(pWhatLayer->GetValue());
229                     bCurPageValid = true;
230                 }
231             }
232 
233             if(bCurPageValid)
234             {
235                 OUString aLayerName( GetLayerTabControl()->GetLayerName(nCurPage));
236                 if (!aLayerName.isEmpty())
237                 {
238                     mpDrawView->SetActiveLayer(aLayerName);
239                 }
240                 Invalidate();
241             }
242 
243             rReq.Done ();
244 
245             break;
246         }
247 
248         case SID_PAGEMODE:  // BASIC
249         {
250 
251             const SfxItemSet *pArgs = rReq.GetArgs();
252 
253             if (pArgs && pArgs->Count () == 2)
254             {
255                 const SfxBoolItem* pIsActive = rReq.GetArg<SfxBoolItem>(ID_VAL_ISACTIVE);
256                 const SfxUInt32Item* pWhatKind = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATKIND);
257 
258                 PageKind nWhatKind = static_cast<PageKind>(pWhatKind->GetValue());
259                 if ( nWhatKind >= PageKind::Standard && nWhatKind <= PageKind::Handout)
260                 {
261                     mbIsLayerModeActive = pIsActive->GetValue();
262                     mePageKind = nWhatKind;
263                 }
264             }
265 
266             // turn on default layer of page
267             mpDrawView->SetActiveLayer(sUNO_LayerName_layout);
268 
269             ChangeEditMode(EditMode::Page, mbIsLayerModeActive);
270 
271             Invalidate();
272             rReq.Done ();
273 
274             break;
275         }
276 
277         case SID_LAYERMODE:  // BASIC
278         {
279             const SfxItemSet *pArgs = rReq.GetArgs();
280 
281             if (pArgs && pArgs->Count() == 2)
282             {
283                 const SfxUInt32Item* pWhatLayer = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATLAYER);
284                 EditMode nWhatLayer = static_cast<EditMode>(pWhatLayer->GetValue());
285                 if (nWhatLayer == EditMode::Page || nWhatLayer == EditMode::MasterPage)
286                 {
287                     mbIsLayerModeActive = rReq.GetArg<SfxBoolItem>(ID_VAL_ISACTIVE)->GetValue();
288                     meEditMode = nWhatLayer;
289                 }
290             }
291 
292             ChangeEditMode(meEditMode, !mbIsLayerModeActive);
293 
294             Invalidate();
295             rReq.Done();
296 
297             break;
298         }
299 
300         case SID_HEADER_AND_FOOTER:
301         case SID_INSERT_PAGE_NUMBER:
302         case SID_INSERT_DATE_TIME:
303         {
304             SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
305             vcl::Window* pWin = GetActiveWindow();
306             VclPtr<AbstractHeaderFooterDialog> pDlg(pFact->CreateHeaderFooterDialog(this, pWin ? pWin->GetFrameWeld() : nullptr, GetDoc(), mpActualPage));
307             auto xRequest = std::make_shared<SfxRequest>(rReq);
308             rReq.Ignore(); // the 'old' request is not relevant any more
309             pDlg->StartExecuteAsync([this, pDlg, xRequest](sal_Int32 /*nResult*/){
310                 GetActiveWindow()->Invalidate();
311                 UpdatePreview( mpActualPage );
312 
313                 Invalidate();
314                 xRequest->Done();
315 
316                 pDlg->disposeOnce();
317             });
318             break;
319         }
320 
321         case SID_MASTER_LAYOUTS:
322         {
323             SdPage* pPage = GetActualPage();
324             if (meEditMode == EditMode::MasterPage)
325                 // Use the master page of the current page.
326                 pPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage());
327 
328             SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
329             vcl::Window* pWin = GetActiveWindow();
330             ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateMasterLayoutDialog(pWin ? pWin->GetFrameWeld() : nullptr, GetDoc(), pPage));
331             pDlg->Execute();
332             Invalidate();
333             rReq.Done ();
334             break;
335         }
336         case SID_OBJECTRESIZE:
337         {
338             // The server likes to change the client size
339             OSL_ASSERT (GetViewShell()!=nullptr);
340             SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient();
341 
342             if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
343             {
344                 const SfxRectangleItem& rRect =
345                     rReq.GetArgs()->Get(SID_OBJECTRESIZE);
346                 ::tools::Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) );
347 
348                 if ( mpDrawView->AreObjectsMarked() )
349                 {
350                     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
351 
352                     if (rMarkList.GetMarkCount() == 1)
353                     {
354                         SdrMark* pMark = rMarkList.GetMark(0);
355                         SdrObject* pObj = pMark->GetMarkedSdrObj();
356 
357                         SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( pObj );
358                         if(pOle2Obj)
359                         {
360                             if( pOle2Obj->GetObjRef().is() )
361                             {
362                                 pOle2Obj->SetLogicRect(aRect);
363                             }
364                         }
365                     }
366                 }
367             }
368             rReq.Ignore ();
369             break;
370         }
371 
372         case SID_RELOAD:
373         {
374             sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId();
375             SfxViewFrame* pFrame = GetViewFrame();
376 
377             try
378             {
379                 Reference< XFrame > xFrame( pFrame->GetFrame().GetFrameInterface(), UNO_SET_THROW );
380 
381                 // Save the current configuration of panes and views.
382                 Reference<XControllerManager> xControllerManager (
383                     GetViewShellBase().GetController(), UNO_QUERY_THROW);
384                 Reference<XConfigurationController> xConfigurationController (
385                     xControllerManager->getConfigurationController(), UNO_SET_THROW );
386                 Reference<XConfiguration> xConfiguration (
387                     xConfigurationController->getRequestedConfiguration(), UNO_SET_THROW );
388 
389                 SfxChildWindow* pWindow = pFrame->GetChildWindow(nId);
390                 if(pWindow)
391                 {
392                     Svx3DWin* p3DWin = static_cast<Svx3DWin*>(pWindow->GetWindow());
393                     if(p3DWin)
394                         p3DWin->DocumentReload();
395                 }
396 
397                 // normal forwarding to ViewFrame for execution
398                 GetViewFrame()->ExecuteSlot(rReq);
399 
400                 // From here on we must cope with this object and the frame already being
401                 // deleted.  Do not call any methods or use data members.
402                 Reference<XController> xController( xFrame->getController(), UNO_SET_THROW );
403 
404                 // Restore the configuration.
405                 xControllerManager.set( xController, UNO_QUERY_THROW );
406                 xConfigurationController.set( xControllerManager->getConfigurationController() );
407                 if ( ! xConfigurationController.is())
408                     throw RuntimeException();
409                 xConfigurationController->restoreConfiguration(xConfiguration);
410             }
411             catch (RuntimeException&)
412             {
413                 DBG_UNHANDLED_EXCEPTION("sd.view");
414             }
415 
416             // We have to return immediately to avoid accessing this object.
417             return;
418         }
419 
420         case SID_JUMPTOMARK:
421         {
422             if( rReq.GetArgs() )
423             {
424                 const SfxStringItem* pBookmark = rReq.GetArg<SfxStringItem>(SID_JUMPTOMARK);
425 
426                 if (pBookmark)
427                 {
428                     OUString sBookmark(INetURLObject::decode(pBookmark->GetValue(), INetURLObject::DecodeMechanism::WithCharset));
429 
430                     rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
431                     if(xSlideshow.is() && xSlideshow->isRunning())
432                     {
433                         xSlideshow->jumpToBookmark(sBookmark);
434                     }
435                     else
436                     {
437                         GotoBookmark(sBookmark);
438                     }
439                 }
440             }
441             rReq.Done();
442             break;
443         }
444 
445         case SID_OUTPUT_QUALITY_COLOR:
446         case SID_OUTPUT_QUALITY_GRAYSCALE:
447         case SID_OUTPUT_QUALITY_BLACKWHITE:
448         case SID_OUTPUT_QUALITY_CONTRAST:
449         {
450             ExecReq( rReq );
451             break;
452         }
453 
454         case SID_MAIL_SCROLLBODY_PAGEDOWN:
455         {
456             ExecReq( rReq );
457             break;
458         }
459 
460         case SID_ATTR_YEAR2000:
461         {
462             FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
463             if (pFormShell != nullptr)
464             {
465                 const SfxPoolItem* pItem;
466                 if (rReq.GetArgs()->GetItemState(
467                     SID_ATTR_YEAR2000, true, &pItem) == SfxItemState::SET)
468                     pFormShell->SetY2KState (
469                         static_cast<const SfxUInt16Item*>(pItem)->GetValue());
470             }
471 
472             rReq.Done();
473         }
474         break;
475 
476         case SID_OPT_LOCALE_CHANGED:
477         {
478             GetActiveWindow()->Invalidate();
479             UpdatePreview( mpActualPage );
480             rReq.Done();
481         }
482         break;
483 
484         case SID_REGENERATE_DIAGRAM:
485         {
486             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
487             if (rMarkList.GetMarkCount() == 1)
488             {
489                 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
490                 Reference<css::drawing::XShape> xShape(pObj->getUnoShape(), UNO_QUERY);
491 
492                 if (oox::drawingml::DrawingML::IsDiagram(xShape))
493                 {
494                     mpDrawView->UnmarkAll();
495 
496                     css::uno::Reference<css::uno::XComponentContext> xContext
497                         = comphelper::getProcessComponentContext();
498                     rtl::Reference<oox::shape::ShapeFilterBase> xFilter(
499                         new oox::shape::ShapeFilterBase(xContext));
500                     xFilter->setTargetDocument(GetDocSh()->GetModel());
501                     xFilter->importTheme();
502                     oox::drawingml::reloadDiagram(pObj, *xFilter);
503 
504                     mpDrawView->MarkObj(pObj, mpDrawView->GetSdrPageView());
505                 }
506             }
507 
508             rReq.Done();
509         }
510         break;
511 
512         case SID_EDIT_DIAGRAM:
513         {
514             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
515             if (rMarkList.GetMarkCount() == 1)
516             {
517                 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
518                 Reference<css::drawing::XShape> xShape(pObj->getUnoShape(), UNO_QUERY);
519 
520                 if (oox::drawingml::DrawingML::IsDiagram(xShape))
521                 {
522                     VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
523                     ScopedVclPtr<VclAbstractDialog> pDlg
524                         = pFact->CreateDiagramDialog(GetFrameWeld(), pObj->GetDiagramData());
525                     pDlg->Execute();
526                 }
527             }
528 
529             rReq.Done();
530         }
531         break;
532 
533         default:
534         break;
535     }
536 }
537 
ExecRuler(SfxRequest & rReq)538 void  DrawViewShell::ExecRuler(SfxRequest& rReq)
539 {
540     // nothing is executed during a slide show!
541     if(HasCurrentFunction(SID_PRESENTATION))
542         return;
543 
544     CheckLineTo (rReq);
545 
546     const SfxItemSet* pArgs = rReq.GetArgs();
547     const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
548     Size aPageSize = mpActualPage->GetSize();
549     Size aViewSize = GetActiveWindow()->GetViewSize();
550 
551     switch ( rReq.GetSlot() )
552     {
553         case SID_ATTR_LONG_LRSPACE:
554             if (pArgs)
555             {
556                 std::unique_ptr<SdUndoGroup> pUndoGroup(new SdUndoGroup(GetDoc()));
557                 pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
558 
559                 const SvxLongLRSpaceItem& rLRSpace = static_cast<const SvxLongLRSpaceItem&>(
560                         pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE)));
561 
562                 if( mpDrawView->IsTextEdit() )
563                 {
564                     ::tools::Rectangle aRect = maMarkRect;
565                     aRect.SetPos(aRect.TopLeft() + aPagePos);
566                     aRect.SetLeft( rLRSpace.GetLeft() );
567                     aRect.SetRight( aViewSize.Width() - rLRSpace.GetRight() );
568                     aRect.SetPos(aRect.TopLeft() - aPagePos);
569                     if ( aRect != maMarkRect)
570                     {
571                         mpDrawView->SetAllMarkedRect(aRect);
572                         maMarkRect = mpDrawView->GetAllMarkedRect();
573                         Invalidate( SID_RULER_OBJECT );
574                     }
575                 }
576                 else
577                 {
578                     ::tools::Long nLeft = std::max(::tools::Long(0), rLRSpace.GetLeft() - aPagePos.X());
579                     ::tools::Long nRight = std::max(::tools::Long(0), rLRSpace.GetRight() + aPagePos.X() +
580                                           aPageSize.Width() - aViewSize.Width());
581 
582                     sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
583                     sal_uInt16 i;
584                     for ( i = 0; i < nPageCnt; i++)
585                     {
586                         SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
587                         SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
588                                                 pPage,
589                                                 pPage->GetLeftBorder(),
590                                                 pPage->GetRightBorder(),
591                                                 nLeft, nRight);
592                         pUndoGroup->AddAction(pUndo);
593                         pPage->SetLeftBorder(nLeft);
594                         pPage->SetRightBorder(nRight);
595                     }
596                     nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
597 
598                     for (i = 0; i < nPageCnt; i++)
599                     {
600                         SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
601                         SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
602                                                 pPage,
603                                                 pPage->GetLeftBorder(),
604                                                 pPage->GetRightBorder(),
605                                                 nLeft, nRight);
606                         pUndoGroup->AddAction(pUndo);
607                         pPage->SetLeftBorder(nLeft);
608                         pPage->SetRightBorder(nRight);
609                     }
610                     InvalidateWindows();
611                 }
612 
613                 // give the undo group to the undo manager
614                 GetViewFrame()->GetObjectShell()->GetUndoManager()->
615                                                     AddUndoAction(std::move(pUndoGroup));
616             }
617             break;
618         case SID_ATTR_LONG_ULSPACE:
619             if (pArgs)
620             {
621                 std::unique_ptr<SdUndoGroup> pUndoGroup(new SdUndoGroup(GetDoc()));
622                 pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
623 
624                 const SvxLongULSpaceItem& rULSpace = static_cast<const SvxLongULSpaceItem&>(
625                         pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE)));
626 
627                 if( mpDrawView->IsTextEdit() )
628                 {
629                     ::tools::Rectangle aRect = maMarkRect;
630                     aRect.SetPos(aRect.TopLeft() + aPagePos);
631                     aRect.SetTop( rULSpace.GetUpper() );
632                     aRect.SetBottom( aViewSize.Height() - rULSpace.GetLower() );
633                     aRect.SetPos(aRect.TopLeft() - aPagePos);
634 
635                     if ( aRect != maMarkRect)
636                     {
637                         mpDrawView->SetAllMarkedRect(aRect);
638                         maMarkRect = mpDrawView->GetAllMarkedRect();
639                         Invalidate( SID_RULER_OBJECT );
640                     }
641                 }
642                 else
643                 {
644                     ::tools::Long nUpper = std::max(::tools::Long(0), rULSpace.GetUpper() - aPagePos.Y());
645                     ::tools::Long nLower = std::max(::tools::Long(0), rULSpace.GetLower() + aPagePos.Y() +
646                                           aPageSize.Height() - aViewSize.Height());
647 
648                     sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
649                     sal_uInt16 i;
650                     for ( i = 0; i < nPageCnt; i++)
651                     {
652                         SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
653                         SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
654                                                 pPage,
655                                                 pPage->GetUpperBorder(),
656                                                 pPage->GetLowerBorder(),
657                                                 nUpper, nLower);
658                         pUndoGroup->AddAction(pUndo);
659                         pPage->SetUpperBorder(nUpper);
660                         pPage->SetLowerBorder(nLower);
661                     }
662                     nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
663 
664                     for (i = 0; i < nPageCnt; i++)
665                     {
666                         SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
667                         SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
668                                                 pPage,
669                                                 pPage->GetUpperBorder(),
670                                                 pPage->GetLowerBorder(),
671                                                 nUpper, nLower);
672                         pUndoGroup->AddAction(pUndo);
673                         pPage->SetUpperBorder(nUpper);
674                         pPage->SetLowerBorder(nLower);
675                     }
676                     InvalidateWindows();
677                 }
678 
679                 // give the undo group to the undo manager
680                 GetViewFrame()->GetObjectShell()->GetUndoManager()->
681                                                     AddUndoAction(std::move(pUndoGroup));
682             }
683             break;
684         case SID_RULER_OBJECT:
685             if (pArgs)
686             {
687                 ::tools::Rectangle aRect = maMarkRect;
688                 aRect.SetPos(aRect.TopLeft() + aPagePos);
689 
690                 const SvxObjectItem& rOI = static_cast<const SvxObjectItem&>(
691                         pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT)));
692 
693                 if ( rOI.GetStartX() != rOI.GetEndX() )
694                 {
695                     aRect.SetLeft( rOI.GetStartX() );
696                     aRect.SetRight( rOI.GetEndX() );
697                 }
698                 if ( rOI.GetStartY() != rOI.GetEndY() )
699                 {
700                     aRect.SetTop( rOI.GetStartY() );
701                     aRect.SetBottom( rOI.GetEndY() );
702                 }
703                 aRect.SetPos(aRect.TopLeft() - aPagePos);
704                 if ( aRect != maMarkRect)
705                 {
706                     mpDrawView->SetAllMarkedRect(aRect);
707                     maMarkRect = mpDrawView->GetAllMarkedRect();
708                     Invalidate( SID_RULER_OBJECT );
709                 }
710             }
711             break;
712         case SID_ATTR_TABSTOP:
713             if (pArgs && mpDrawView->IsTextEdit())
714             {
715                 const SvxTabStopItem& rItem = pArgs->Get( EE_PARA_TABS );
716 
717                 SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_TABS, EE_PARA_TABS>{} );
718 
719                 aEditAttr.Put( rItem );
720                 mpDrawView->SetAttributes( aEditAttr );
721 
722                 Invalidate(SID_ATTR_TABSTOP);
723             }
724             break;
725         case SID_ATTR_PARA_LINESPACE:
726             if (pArgs)
727             {
728                 SvxLineSpacingItem aParaLineSP = static_cast<const SvxLineSpacingItem&>(pArgs->Get(
729                     GetPool().GetWhich(SID_ATTR_PARA_LINESPACE)));
730 
731                 SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_SBL, EE_PARA_SBL>{} );
732                 aParaLineSP.SetWhich( EE_PARA_SBL );
733 
734                 aEditAttr.Put( aParaLineSP );
735                 mpDrawView->SetAttributes( aEditAttr );
736 
737                 Invalidate(SID_ATTR_PARA_LINESPACE);
738             }
739             break;
740         case SID_ATTR_PARA_ADJUST_LEFT:
741         {
742             SvxAdjustItem aItem( SvxAdjust::Left, EE_PARA_JUST );
743             SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
744 
745             aEditAttr.Put( aItem );
746             mpDrawView->SetAttributes( aEditAttr );
747 
748             Invalidate(SID_ATTR_PARA_ADJUST_LEFT);
749             break;
750         }
751         case SID_ATTR_PARA_ADJUST_CENTER:
752         {
753             SvxAdjustItem aItem( SvxAdjust::Center, EE_PARA_JUST );
754             SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
755 
756             aEditAttr.Put( aItem );
757             mpDrawView->SetAttributes( aEditAttr );
758 
759             Invalidate(SID_ATTR_PARA_ADJUST_CENTER);
760             break;
761         }
762         case SID_ATTR_PARA_ADJUST_RIGHT:
763         {
764             SvxAdjustItem aItem( SvxAdjust::Right, EE_PARA_JUST );
765             SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
766 
767             aEditAttr.Put( aItem );
768             mpDrawView->SetAttributes( aEditAttr );
769 
770             Invalidate(SID_ATTR_PARA_ADJUST_RIGHT);
771             break;
772         }
773         case SID_ATTR_PARA_ADJUST_BLOCK:
774         {
775             SvxAdjustItem aItem( SvxAdjust::Block, EE_PARA_JUST );
776             SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
777 
778             aEditAttr.Put( aItem );
779             mpDrawView->SetAttributes( aEditAttr );
780 
781             Invalidate(SID_ATTR_PARA_ADJUST_BLOCK);
782             break;
783         }
784         case SID_ATTR_PARA_ULSPACE:
785             if (pArgs)
786             {
787                 SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>(pArgs->Get(
788                     GetPool().GetWhich(SID_ATTR_PARA_ULSPACE)));
789                 SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_ULSPACE, EE_PARA_ULSPACE>{} );
790                 aULSP.SetWhich( EE_PARA_ULSPACE );
791 
792                 aEditAttr.Put( aULSP );
793                 mpDrawView->SetAttributes( aEditAttr );
794 
795                 Invalidate(SID_ATTR_PARA_ULSPACE);
796             }
797             break;
798         case SID_ATTR_PARA_LRSPACE:
799             if (pArgs)
800             {
801                 SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get(
802                     GetPool().GetWhich(SID_ATTR_PARA_LRSPACE)));
803 
804                 SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
805                 aLRSpace.SetWhich( EE_PARA_LRSPACE );
806 
807                 aEditAttr.Put( aLRSpace );
808                 mpDrawView->SetAttributes( aEditAttr );
809 
810                 Invalidate(SID_ATTR_PARA_LRSPACE);
811             }
812             break;
813         case SID_ATTR_LRSPACE:
814             if (pArgs && mpDrawView->IsTextEdit())
815             {
816                 sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
817                 const SvxLRSpaceItem& rItem = static_cast<const SvxLRSpaceItem&>(
818                             pArgs->Get( nId ));
819 
820                 static const sal_uInt16 aWhichTable[]=
821                 {
822                     EE_PARA_OUTLLEVEL, EE_PARA_OUTLLEVEL,
823                     EE_PARA_LRSPACE, EE_PARA_LRSPACE,
824                     EE_PARA_NUMBULLET, EE_PARA_NUMBULLET,
825                     0, 0
826                 };
827 
828                 SfxItemSet aEditAttr( GetDoc()->GetPool(),
829                                       aWhichTable );
830                 mpDrawView->GetAttributes( aEditAttr );
831 
832                 nId = EE_PARA_LRSPACE;
833                 SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
834                         rItem.GetRight(), rItem.GetTextLeft(),
835                         rItem.GetTextFirstLineOffset(), nId );
836 
837                 const sal_Int16 nOutlineLevel = aEditAttr.Get( EE_PARA_OUTLLEVEL ).GetValue();
838                 const SvxLRSpaceItem& rOrigLRSpaceItem = aEditAttr.Get( EE_PARA_LRSPACE );
839                 const SvxNumBulletItem& rNumBulletItem = aEditAttr.Get( EE_PARA_NUMBULLET );
840                 if( nOutlineLevel != -1 &&
841                     rNumBulletItem.GetNumRule().GetLevelCount() > nOutlineLevel )
842                 {
843                     const SvxNumberFormat& rFormat = rNumBulletItem.GetNumRule().GetLevel(nOutlineLevel);
844                     SvxNumberFormat aFormat(rFormat);
845 
846                     // left margin gets distributed onto LRSpace item
847                     // and number format AbsLSpace - this fixes
848                     // n#707779 (previously, LRSpace left indent could
849                     // become negative - EditEngine really does not
850                     // like that.
851                     const auto nAbsLSpace=aFormat.GetAbsLSpace();
852                     const ::tools::Long  nTxtLeft=rItem.GetTextLeft();
853                     const ::tools::Long  nLeftIndent=std::max(::tools::Long(0),nTxtLeft - nAbsLSpace);
854                     aLRSpaceItem.SetTextLeft(nLeftIndent);
855                     // control for clipped left indent - remainder
856                     // reduces number format first line indent
857                     aFormat.SetAbsLSpace(nTxtLeft - nLeftIndent);
858 
859                     // negative first line indent goes to the number
860                     // format, positive to the lrSpace item
861                     if( rItem.GetTextFirstLineOffset() < 0 )
862                     {
863                         aFormat.SetFirstLineOffset(
864                             rItem.GetTextFirstLineOffset()
865                             - rOrigLRSpaceItem.GetTextFirstLineOffset()
866                             + aFormat.GetCharTextDistance());
867                         aLRSpaceItem.SetTextFirstLineOffset(0);
868                     }
869                     else
870                     {
871                         aFormat.SetFirstLineOffset(0);
872                         aLRSpaceItem.SetTextFirstLineOffset(
873                             rItem.GetTextFirstLineOffset()
874                             - aFormat.GetFirstLineOffset() //TODO: overflow
875                             + aFormat.GetCharTextDistance());
876                     }
877 
878                     if( rFormat != aFormat )
879                     {
880                         // put all items
881                         const_cast<SvxNumRule&>(rNumBulletItem.GetNumRule()).SetLevel(nOutlineLevel,aFormat);
882                         aEditAttr.Put( rNumBulletItem );
883                         aEditAttr.Put( aLRSpaceItem );
884                         mpDrawView->SetAttributes( aEditAttr );
885 
886                         Invalidate(SID_ATTR_PARA_LRSPACE);
887                         break;
888                     }
889                 }
890 
891                 // only put lrSpace item
892                 SfxItemSet aEditAttrReduced( GetDoc()->GetPool(),
893                                              svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
894                 aEditAttrReduced.Put( aLRSpaceItem );
895                 mpDrawView->SetAttributes( aEditAttrReduced );
896 
897                 Invalidate(SID_ATTR_PARA_LRSPACE);
898             }
899             break;
900     }
901 }
902 
GetRulerState(SfxItemSet & rSet)903 void  DrawViewShell::GetRulerState(SfxItemSet& rSet)
904 {
905     Point aOrigin;
906 
907     if (mpDrawView->GetSdrPageView())
908     {
909         aOrigin = mpDrawView->GetSdrPageView()->GetPageOrigin();
910     }
911 
912     Size aViewSize = GetActiveWindow()->GetViewSize();
913 
914     const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
915     Size aPageSize = mpActualPage->GetSize();
916 
917     ::tools::Rectangle aRect(aPagePos, Point( aViewSize.Width() - (aPagePos.X() + aPageSize.Width()),
918                                      aViewSize.Height() - (aPagePos.Y() + aPageSize.Height())));
919 
920     if( mpDrawView->IsTextEdit() )
921     {
922         Point aPnt1 = GetActiveWindow()->GetWinViewPos();
923         ::tools::Rectangle aMinMaxRect( aPnt1, Size(-1, -1) );
924         rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) );
925     }
926     else
927     {
928         rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aRect) );
929     }
930 
931     SvxLongLRSpaceItem aLRSpace(aPagePos.X() + mpActualPage->GetLeftBorder(),
932                                 aRect.Right() + mpActualPage->GetRightBorder(),
933                                 GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
934     SvxLongULSpaceItem aULSpace(aPagePos.Y() + mpActualPage->GetUpperBorder(),
935                                 aRect.Bottom() + mpActualPage->GetLowerBorder(),
936                                 GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
937     rSet.Put(SvxPagePosSizeItem(Point(0,0) - aPagePos, aViewSize.Width(),
938                                                        aViewSize.Height()));
939     SfxPointItem aPointItem( SID_RULER_NULL_OFFSET, aPagePos + aOrigin );
940 
941     SvxProtectItem aProtect( SID_RULER_PROTECT );
942 
943     maMarkRect = mpDrawView->GetAllMarkedRect();
944 
945     const bool bRTL = GetDoc() && GetDoc()->GetDefaultWritingMode() == css::text::WritingMode_RL_TB;
946     rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, bRTL));
947 
948     if( mpDrawView->AreObjectsMarked() )
949     {
950         if( mpDrawView->IsTextEdit() )
951         {
952             SdrObject* pObj = mpDrawView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj();
953             if( pObj->GetObjInventor() == SdrInventor::Default)
954             {
955                 SfxItemSet aEditAttr( GetDoc()->GetPool() );
956                 mpDrawView->GetAttributes( aEditAttr );
957                 if( aEditAttr.GetItemState( EE_PARA_TABS ) >= SfxItemState::DEFAULT )
958                 {
959                     const SvxTabStopItem& rItem = aEditAttr.Get( EE_PARA_TABS );
960                     rSet.Put( rItem );
961 
962                     const SvxLRSpaceItem& rLRSpaceItem = aEditAttr.Get( EE_PARA_LRSPACE );
963                     SvxLRSpaceItem aLRSpaceItem( rLRSpaceItem.GetLeft(),
964                             rLRSpaceItem.GetRight(), rLRSpaceItem.GetTextLeft(),
965                             rLRSpaceItem.GetTextFirstLineOffset(), SID_ATTR_PARA_LRSPACE );
966 
967                     const sal_Int16 nOutlineLevel = aEditAttr.Get( EE_PARA_OUTLLEVEL ).GetValue();
968                     const SvxNumBulletItem& rNumBulletItem = aEditAttr.Get( EE_PARA_NUMBULLET );
969                     if( nOutlineLevel != -1 &&
970                         rNumBulletItem.GetNumRule().GetLevelCount() > nOutlineLevel )
971                     {
972                         const SvxNumberFormat& rFormat = rNumBulletItem.GetNumRule().GetLevel(nOutlineLevel);
973                         aLRSpaceItem.SetTextLeft(rFormat.GetAbsLSpace() + rLRSpaceItem.GetTextLeft());
974                         aLRSpaceItem.SetTextFirstLineOffset(
975                             rLRSpaceItem.GetTextFirstLineOffset() + rFormat.GetFirstLineOffset()
976                                 //TODO: overflow
977                             - rFormat.GetCharTextDistance());
978                     }
979 
980                     rSet.Put( aLRSpaceItem );
981 
982                     Point aPos( aPagePos + maMarkRect.TopLeft() );
983 
984                     if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET )
985                     {
986                         const SdrMetricItem& rTLDItem = aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
987                         ::tools::Long nLD = rTLDItem.GetValue();
988                         aPos.AdjustX(nLD );
989                     }
990 
991                     aPointItem.SetValue( aPos );
992 
993                     ::tools::Rectangle aParaRect(maMarkRect);
994                     if (pObj->GetObjIdentifier() == OBJ_TABLE)
995                     {
996                         sdr::table::SdrTableObj* pTable = static_cast<sdr::table::SdrTableObj*>(pObj);
997                         sdr::table::CellPos cellpos;
998                         pTable->getActiveCellPos(cellpos);
999                         pTable->getCellBounds(cellpos, aParaRect);
1000                     }
1001 
1002                     aLRSpace.SetLeft(aPagePos.X() + aParaRect.Left());
1003 
1004                     if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET )
1005                     {
1006                         const SdrMetricItem& rTLDItem = aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
1007                         ::tools::Long nLD = rTLDItem.GetValue();
1008                         aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD );
1009                     }
1010 
1011                     aLRSpace.SetRight(aRect.Right() + aPageSize.Width() - aParaRect.Right());
1012 
1013                     if ( aEditAttr.GetItemState( SDRATTR_TEXT_RIGHTDIST ) == SfxItemState::SET )
1014                     {
1015                         const SdrMetricItem& rTRDItem = aEditAttr.Get( SDRATTR_TEXT_RIGHTDIST );
1016                         ::tools::Long nRD = rTRDItem.GetValue();
1017                         aLRSpace.SetRight( aLRSpace.GetRight() + nRD );
1018                     }
1019 
1020                     aULSpace.SetUpper( aPagePos.Y() + maMarkRect.Top() );
1021                     aULSpace.SetLower( aRect.Bottom() + aPageSize.Height() - maMarkRect.Bottom() );
1022 
1023                     rSet.DisableItem( SID_RULER_OBJECT );
1024 
1025                     // lock page margins
1026                     aProtect.SetSizeProtect( true );
1027                     aProtect.SetPosProtect( true );
1028                 }
1029 
1030                 if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SfxItemState::DEFAULT )
1031                 {
1032                     const SvxFrameDirectionItem& rItem = aEditAttr.Get( EE_PARA_WRITINGDIR );
1033                     rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == SvxFrameDirection::Horizontal_RL_TB));
1034                 }
1035             }
1036         }
1037         else
1038         {
1039             rSet.DisableItem( EE_PARA_TABS );
1040             rSet.DisableItem( SID_RULER_TEXT_RIGHT_TO_LEFT );
1041 
1042             if( mpDrawView->IsResizeAllowed(true) )
1043             {
1044                 ::tools::Rectangle aResizeRect( maMarkRect );
1045 
1046                 aResizeRect.SetPos(aResizeRect.TopLeft() + aPagePos);
1047                 SvxObjectItem aObjItem(aResizeRect.Left(), aResizeRect.Right(),
1048                                        aResizeRect.Top(), aResizeRect.Bottom());
1049                 rSet.Put(aObjItem);
1050                 rSet.DisableItem( EE_PARA_TABS );
1051             }
1052             else
1053             {
1054                 rSet.DisableItem( SID_RULER_OBJECT );
1055             }
1056         }
1057     }
1058     else
1059     {
1060         rSet.DisableItem( SID_RULER_OBJECT );
1061         rSet.DisableItem( EE_PARA_TABS );
1062     }
1063 
1064     rSet.Put( aLRSpace );
1065     rSet.Put( aULSpace );
1066 
1067     rSet.Put( aPointItem );
1068     rSet.Put( aProtect );
1069 }
1070 
ExecStatusBar(SfxRequest & rReq)1071 void  DrawViewShell::ExecStatusBar(SfxRequest& rReq)
1072 {
1073     // nothing is executed during a slide show!
1074     if(HasCurrentFunction(SID_PRESENTATION))
1075         return;
1076 
1077     CheckLineTo (rReq);
1078 
1079     switch ( rReq.GetSlot() )
1080     {
1081         case SID_ATTR_SIZE:
1082         {
1083             GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_TRANSFORM, SfxCallMode::ASYNCHRON );
1084         }
1085         break;
1086 
1087         case SID_STATUS_LAYOUT:
1088         {
1089             GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION_LAYOUT, SfxCallMode::ASYNCHRON );
1090         }
1091         break;
1092     }
1093 }
1094 
1095 /**
1096  * set state of snap object entries in popup
1097  */
GetSnapItemState(SfxItemSet & rSet)1098 void  DrawViewShell::GetSnapItemState( SfxItemSet &rSet )
1099 {
1100     SdrPageView* pPV;
1101     Point   aMPos = GetActiveWindow()->PixelToLogic(maMousePos);
1102     sal_uInt16  nHitLog = static_cast<sal_uInt16>(GetActiveWindow()->PixelToLogic(
1103         Size(FuPoor::HITPIX,0)).Width());
1104     sal_uInt16  nHelpLine;
1105 
1106     if ( !mpDrawView->PickHelpLine(aMPos, nHitLog, *GetActiveWindow()->GetOutDev(), nHelpLine, pPV) )
1107         return;
1108 
1109     const SdrHelpLine& rHelpLine = (pPV->GetHelpLines())[nHelpLine];
1110 
1111     if ( rHelpLine.GetKind() == SdrHelpLineKind::Point )
1112     {
1113         rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
1114                             SdResId( STR_POPUP_EDIT_SNAPPOINT)) );
1115         rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
1116                             SdResId( STR_POPUP_DELETE_SNAPPOINT)) );
1117     }
1118     else
1119     {
1120         rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
1121                             SdResId( STR_POPUP_EDIT_SNAPLINE)) );
1122         rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
1123                             SdResId( STR_POPUP_DELETE_SNAPLINE)) );
1124     }
1125 }
1126 
1127 } // end of namespace sd
1128 
1129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
1130