LCOV - code coverage report
Current view: top level - sd/source/ui/view - drviews2.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 1462 0.1 %
Date: 2014-11-03 Functions: 2 11 18.2 %
Legend: Lines: hit not hit

          Line data    Source code
       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 <avmedia/mediaplayer.hxx>
      23             : 
      24             : #include <basic/sberrors.hxx>
      25             : #include <basic/sbstar.hxx>
      26             : 
      27             : #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
      28             : #include <com/sun/star/drawing/XDrawPages.hpp>
      29             : #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
      30             : #include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp>
      31             : #include <com/sun/star/frame/XDispatchProvider.hpp>
      32             : #include <com/sun/star/util/URLTransformer.hpp>
      33             : #include <com/sun/star/util/XURLTransformer.hpp>
      34             : 
      35             : #include <comphelper/processfactory.hxx>
      36             : 
      37             : #include <editeng/editdata.hxx>
      38             : #include <editeng/eeitem.hxx>
      39             : #include <editeng/flditem.hxx>
      40             : 
      41             : #include <sfx2/bindings.hxx>
      42             : #include <sfx2/dispatch.hxx>
      43             : #include <sfx2/docfile.hxx>
      44             : #include <sfx2/msgpool.hxx>
      45             : #include <sfx2/request.hxx>
      46             : #include <sfx2/viewfrm.hxx>
      47             : #include <sfx2/zoomitem.hxx>
      48             : 
      49             : #include <svl/aeitem.hxx>
      50             : 
      51             : #include <svx/SpellDialogChildWindow.hxx>
      52             : #include <svx/compressgraphicdialog.hxx>
      53             : #include <svx/dialogs.hrc>
      54             : #include <svx/bmpmask.hxx>
      55             : #include <svx/colrctrl.hxx>
      56             : #include <svx/extedit.hxx>
      57             : #include <svx/extrusionbar.hxx>
      58             : #include <svx/f3dchild.hxx>
      59             : #include <svx/fontwork.hxx>
      60             : #include <svx/fontworkbar.hxx>
      61             : #include <svx/graphichelper.hxx>
      62             : #include <svx/hlnkitem.hxx>
      63             : #include <svx/imapdlg.hxx>
      64             : #include <svx/sdtagitm.hxx>
      65             : #include <svx/sdtmfitm.hxx>
      66             : #include <svx/svdoattr.hxx>
      67             : #include <svx/svdograf.hxx>
      68             : #include <svx/svdoole2.hxx>
      69             : #include <svx/svdoutl.hxx>
      70             : #include <svx/svdpagv.hxx>
      71             : #include <svx/svdundo.hxx>
      72             : #include <svx/svxdlg.hxx>
      73             : #include <svx/svxids.hrc>
      74             : #include <svx/xfillit0.hxx>
      75             : #include <svx/xflclit.hxx>
      76             : #include <svx/xlineit0.hxx>
      77             : #include <svx/xlnedwit.hxx>
      78             : #include <svx/xlnstwit.hxx>
      79             : #include <svx/xlnwtit.hxx>
      80             : 
      81             : #include <tools/diagnose_ex.h>
      82             : 
      83             : #include <unotools/useroptions.hxx>
      84             : 
      85             : #include <vcl/graph.hxx>
      86             : #include <vcl/msgbox.hxx>
      87             : #include <vcl/svapp.hxx>
      88             : #include <vcl/waitobj.hxx>
      89             : 
      90             : #include <editeng/escapementitem.hxx>
      91             : #include <editeng/kernitem.hxx>
      92             : #include <editeng/wghtitem.hxx>
      93             : #include <editeng/postitem.hxx>
      94             : #include <editeng/udlnitem.hxx>
      95             : #include <editeng/crossedoutitem.hxx>
      96             : #include <editeng/contouritem.hxx>
      97             : #include <editeng/shdditem.hxx>
      98             : #include <svx/xtable.hxx>
      99             : #include <svx/svdobj.hxx>
     100             : #include <svx/SvxColorChildWindow.hxx>
     101             : #include <editeng/outlobj.hxx>
     102             : #include <editeng/flstitem.hxx>
     103             : #include <editeng/scripttypeitem.hxx>
     104             : #include <editeng/fontitem.hxx>
     105             : #include <editeng/fhgtitem.hxx>
     106             : #include <editeng/colritem.hxx>
     107             : #include <editeng/brushitem.hxx>
     108             : 
     109             : #include <svl/whiter.hxx>
     110             : 
     111             : #include "app.hrc"
     112             : #include "glob.hrc"
     113             : #include "strings.hrc"
     114             : 
     115             : #include "framework/FrameworkHelper.hxx"
     116             : 
     117             : #include "AnimationChildWindow.hxx"
     118             : #include "DrawDocShell.hxx"
     119             : #include "DrawViewShell.hxx"
     120             : #include "GraphicViewShell.hxx"
     121             : #include "LayerTabBar.hxx"
     122             : #include "Outliner.hxx"
     123             : #include "ViewShellHint.hxx"
     124             : #include "ViewShellImplementation.hxx"
     125             : #include "Window.hxx"
     126             : #include "drawdoc.hxx"
     127             : #include "drawview.hxx"
     128             : #include "fuarea.hxx"
     129             : #include "fubullet.hxx"
     130             : #include "fuchar.hxx"
     131             : #include "fucushow.hxx"
     132             : #include "fuconnct.hxx"
     133             : #include "fucopy.hxx"
     134             : #include "fudspord.hxx"
     135             : #include "fuexpand.hxx"
     136             : #include "fuinsert.hxx"
     137             : #include "fuinsfil.hxx"
     138             : #include "fuline.hxx"
     139             : #include "fulinend.hxx"
     140             : #include "fulink.hxx"
     141             : #include "fumeasur.hxx"
     142             : #include "fumorph.hxx"
     143             : #include "fuoaprms.hxx"
     144             : #include "fuolbull.hxx"
     145             : #include "fupage.hxx"
     146             : #include "fuparagr.hxx"
     147             : #include "fuprlout.hxx"
     148             : #include "fuscale.hxx"
     149             : #include "fusel.hxx"
     150             : #include "fusldlg.hxx"
     151             : #include "fusnapln.hxx"
     152             : #include "fusumry.hxx"
     153             : #include "futempl.hxx"
     154             : #include "futhes.hxx"
     155             : #include "futransf.hxx"
     156             : #include "futxtatt.hxx"
     157             : #include "fuvect.hxx"
     158             : #include "futext.hxx"
     159             : #include "fuzoom.hxx"
     160             : #include "helpids.h"
     161             : #include "optsitem.hxx"
     162             : #include "sdabstdlg.hxx"
     163             : #include "sdattr.hxx"
     164             : #include "sdgrffilter.hxx"
     165             : #include "sdpage.hxx"
     166             : #include "sdresid.hxx"
     167             : #include "slideshow.hxx"
     168             : #include "stlpool.hxx"
     169             : #include "undolayer.hxx"
     170             : #include "unmodpg.hxx"
     171             : #include <sfx2/sidebar/Sidebar.hxx>
     172             : 
     173             : #include "ViewShellBase.hxx"
     174             : #include <boost/scoped_ptr.hpp>
     175             : 
     176             : namespace {
     177             :     const char CustomAnimationPanelId[] = "CustomAnimationPanel";
     178             :     const char SlideTransitionPanelId[] = "SlideTransitionPanel";
     179             :     const char GalleryPanelId[] = "GalleryPanel";
     180             : }
     181             : 
     182             : using namespace ::com::sun::star;
     183             : using namespace ::com::sun::star::uno;
     184             : 
     185             : #define MIN_ACTIONS_FOR_DIALOG  5000    ///< if there are more meta objects, we show a dialog during the break up
     186             : 
     187             : namespace sd {
     188             : 
     189           0 : class SdExternalToolEdit : public ExternalToolEdit
     190             : {
     191             :     FmFormView* m_pView;
     192             :     SdrObject*  m_pObj;
     193             : 
     194             : public:
     195           0 :     SdExternalToolEdit ( FmFormView* pView, SdrObject* pObj ) :
     196             :         m_pView   (pView),
     197           0 :         m_pObj (pObj)
     198           0 :     {}
     199             : 
     200           0 :     virtual void Update( Graphic& aGraphic ) SAL_OVERRIDE
     201             :     {
     202           0 :         SdrPageView* pPageView = m_pView->GetSdrPageView();
     203           0 :         if( pPageView )
     204             :         {
     205           0 :             SdrGrafObj* pNewObj = (SdrGrafObj*) m_pObj->Clone();
     206           0 :             OUString    aStr = m_pView->GetDescriptionOfMarkedObjects();
     207           0 :             aStr += " External Edit";
     208           0 :             m_pView->BegUndo( aStr );
     209           0 :             pNewObj->SetGraphicObject( aGraphic );
     210           0 :             m_pView->ReplaceObjectAtView( m_pObj, *pPageView, pNewObj );
     211           0 :             m_pView->EndUndo();
     212             :         }
     213           0 :     }
     214             : };
     215             : 
     216             : /**
     217             :  * SfxRequests for temporary actions
     218             :  */
     219             : 
     220           0 : void DrawViewShell::FuTemporary(SfxRequest& rReq)
     221             : {
     222             :     // during a native slide show nothing gets executed!
     223           0 :     if(SlideShow::IsRunning( GetViewShellBase() ) && (rReq.GetSlot() != SID_NAVIGATOR))
     224           0 :         return;
     225             : 
     226             :     DBG_ASSERT( mpDrawView, "sd::DrawViewShell::FuTemporary(), no draw view!" );
     227           0 :     if( !mpDrawView )
     228           0 :         return;
     229             : 
     230           0 :     CheckLineTo (rReq);
     231             : 
     232           0 :     DeactivateCurrentFunction();
     233             : 
     234           0 :     sal_uInt16 nSId = rReq.GetSlot();
     235             : 
     236             :     // Slot gets mapped (ToolboxImages/-Slots)
     237           0 :     MapSlot( nSId );
     238             : 
     239           0 :     switch ( nSId )
     240             :     {
     241             :         case SID_OUTLINE_TEXT_AUTOFIT:
     242             :         {
     243           0 :             ::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
     244           0 :             SdrObject* pObj = NULL;
     245           0 :             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     246           0 :             if( rMarkList.GetMarkCount() == 1 )
     247             :             {
     248           0 :                 pUndoManager->EnterListAction("", "");
     249           0 :                 mpDrawView->BegUndo();
     250             : 
     251           0 :                 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     252           0 :                 bool bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE;
     253             : 
     254           0 :                 mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
     255             : 
     256           0 :                 pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? SDRTEXTFIT_NONE : SDRTEXTFIT_AUTOFIT));
     257             : 
     258           0 :                 mpDrawView->EndUndo();
     259           0 :                 pUndoManager->LeaveListAction();
     260             :             }
     261           0 :             Cancel();
     262           0 :             rReq.Done();
     263             :         }
     264           0 :         break;
     265             : 
     266             :         // area and line attributes: shall have
     267             :         // an own Execute method (like StateMethode)
     268             :         case SID_ATTR_FILL_STYLE:
     269             :         case SID_ATTR_FILL_COLOR:
     270             :         case SID_ATTR_FILL_GRADIENT:
     271             :         case SID_ATTR_FILL_HATCH:
     272             :         case SID_ATTR_FILL_BITMAP:
     273             :         case SID_ATTR_FILL_SHADOW:
     274             :         case SID_ATTR_FILL_TRANSPARENCE:
     275             :         case SID_ATTR_FILL_FLOATTRANSPARENCE:
     276             : 
     277             :         case SID_ATTR_LINE_STYLE:
     278             :         case SID_ATTR_LINE_DASH:
     279             :         case SID_ATTR_LINE_WIDTH:
     280             :         case SID_ATTR_LINE_COLOR:
     281             :         case SID_ATTR_LINEEND_STYLE:
     282             :         case SID_ATTR_LINE_START:
     283             :         case SID_ATTR_LINE_END:
     284             :         case SID_ATTR_LINE_TRANSPARENCE:
     285             :         case SID_ATTR_LINE_JOINT:
     286             :         case SID_ATTR_LINE_CAP:
     287             : 
     288             :         case SID_ATTR_TEXT_FITTOSIZE:
     289             :         {
     290           0 :             if( rReq.GetArgs() )
     291             :             {
     292           0 :                 mpDrawView->SetAttributes(*rReq.GetArgs());
     293           0 :                 rReq.Done();
     294             :             }
     295             :             else
     296             :             {
     297           0 :                 switch( rReq.GetSlot() )
     298             :                 {
     299             :                     case SID_ATTR_FILL_SHADOW:
     300             :                     case SID_ATTR_FILL_STYLE:
     301             :                     case SID_ATTR_FILL_COLOR:
     302             :                     case SID_ATTR_FILL_GRADIENT:
     303             :                     case SID_ATTR_FILL_HATCH:
     304             :                     case SID_ATTR_FILL_BITMAP:
     305             :                     case SID_ATTR_FILL_TRANSPARENCE:
     306             :                     case SID_ATTR_FILL_FLOATTRANSPARENCE:
     307           0 :                         GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_AREA, SfxCallMode::ASYNCHRON );
     308           0 :                         break;
     309             :                     case SID_ATTR_LINE_STYLE:
     310             :                     case SID_ATTR_LINE_DASH:
     311             :                     case SID_ATTR_LINE_WIDTH:
     312             :                     case SID_ATTR_LINE_COLOR:
     313             :                     case SID_ATTR_LINE_TRANSPARENCE:
     314             :                     case SID_ATTR_LINE_JOINT:
     315             :                     case SID_ATTR_LINE_CAP:
     316           0 :                         GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_LINE, SfxCallMode::ASYNCHRON );
     317           0 :                         break;
     318             :                     case SID_ATTR_TEXT_FITTOSIZE:
     319           0 :                         GetViewFrame()->GetDispatcher()->Execute( SID_TEXTATTR_DLG, SfxCallMode::ASYNCHRON );
     320           0 :                         break;
     321             :                 }
     322             :             }
     323           0 :             Cancel();
     324             :         }
     325           0 :         break;
     326             : 
     327             :         case SID_HYPHENATION:
     328             :         {
     329             :             // const SfxPoolItem* pItem = rReq.GetArg( SID_HYPHENATION );
     330             :             //  ^-- should not be used (defaults are wrong) !
     331           0 :             SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_HYPHENATION, false);
     332             : 
     333           0 :             if( pItem )
     334             :             {
     335           0 :                 SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
     336           0 :                 bool bValue = ( (const SfxBoolItem*) pItem)->GetValue();
     337           0 :                 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
     338           0 :                 mpDrawView->SetAttributes( aSet );
     339             :             }
     340             :             else // only for testing purpose
     341             :             {
     342             :                 OSL_FAIL(" no value for hyphenation!");
     343           0 :                 SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
     344           0 :                 bool bValue = true;
     345           0 :                 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
     346           0 :                 mpDrawView->SetAttributes( aSet );
     347             :             }
     348           0 :             rReq.Done();
     349           0 :             Cancel();
     350             :         }
     351           0 :         break;
     352             : 
     353             :         case SID_INSERTPAGE:
     354             :         case SID_INSERTPAGE_QUICK:
     355             :         case SID_DUPLICATE_PAGE:
     356             :         {
     357           0 :             SdPage* pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage());
     358           0 :             Cancel();
     359           0 :             if(HasCurrentFunction(SID_BEZIER_EDIT) )
     360           0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
     361           0 :             if (pNewPage != NULL)
     362           0 :                 SwitchPage((pNewPage->GetPageNum()-1)/2);
     363           0 :             rReq.Done ();
     364             :         }
     365           0 :         break;
     366             : 
     367             :         case SID_INSERT_MASTER_PAGE:
     368             :         {
     369             :             // Use the API to create a new page.
     370             :             Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
     371           0 :                 GetDoc()->getUnoModel(), UNO_QUERY);
     372           0 :             if (xMasterPagesSupplier.is())
     373             :             {
     374             :                 Reference<drawing::XDrawPages> xMasterPages (
     375           0 :                     xMasterPagesSupplier->getMasterPages());
     376           0 :                 if (xMasterPages.is())
     377             :                 {
     378           0 :                     sal_uInt16 nIndex = GetCurPageId();
     379           0 :                     xMasterPages->insertNewByIndex (nIndex);
     380             : 
     381             :                     // Create shapes for the default layout.
     382             :                     SdPage* pMasterPage = GetDoc()->GetMasterSdPage(
     383           0 :                         nIndex, PK_STANDARD);
     384           0 :                     pMasterPage->CreateTitleAndLayout (true,true);
     385           0 :                 }
     386             :             }
     387             : 
     388           0 :             Cancel();
     389           0 :             if(HasCurrentFunction(SID_BEZIER_EDIT))
     390             :                 GetViewFrame()->GetDispatcher()->Execute(
     391           0 :                     SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
     392           0 :             rReq.Done ();
     393             :         }
     394           0 :         break;
     395             : 
     396             :         case SID_MODIFYPAGE:
     397             :         {
     398           0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES ||
     399           0 :                 (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE) )
     400             :             {
     401           0 :                 if ( mpDrawView->IsTextEdit() )
     402             :                 {
     403           0 :                     mpDrawView->SdrEndTextEdit();
     404             :                 }
     405           0 :                 sal_uInt16 nPage = maTabControl.GetCurPageId() - 1;
     406           0 :                 mpActualPage = GetDoc()->GetSdPage(nPage, mePageKind);
     407             :                 ::sd::ViewShell::mpImpl->ProcessModifyPageSlot (
     408             :                     rReq,
     409             :                     mpActualPage,
     410           0 :                     mePageKind);
     411             :             }
     412             : 
     413           0 :             Cancel();
     414           0 :             rReq.Done ();
     415             :         }
     416           0 :         break;
     417             : 
     418             :         case SID_ASSIGN_LAYOUT:
     419             :         {
     420           0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
     421             :             {
     422           0 :                 if ( mpDrawView->IsTextEdit() )
     423           0 :                     mpDrawView->SdrEndTextEdit();
     424             : 
     425           0 :                 ::sd::ViewShell::mpImpl->AssignLayout(rReq, mePageKind);
     426             :             }
     427           0 :             Cancel();
     428           0 :             rReq.Done ();
     429             :         }
     430           0 :         break;
     431             : 
     432             :         case SID_RENAMEPAGE:
     433             :         case SID_RENAME_MASTER_PAGE:
     434             :         {
     435           0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
     436             :             {
     437           0 :                 if ( mpDrawView->IsTextEdit() )
     438             :                 {
     439           0 :                     mpDrawView->SdrEndTextEdit();
     440             :                 }
     441             : 
     442           0 :                 sal_uInt16 nPageId = maTabControl.GetCurPageId();
     443           0 :                 SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE )
     444           0 :                     ? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() )
     445           0 :                     : GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() );
     446             : 
     447           0 :                 OUString aTitle = SD_RESSTR(STR_TITLE_RENAMESLIDE);
     448           0 :                 OUString aDescr = SD_RESSTR(STR_DESC_RENAMESLIDE);
     449           0 :                 OUString aPageName = pCurrentPage->GetName();
     450             : 
     451           0 :                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     452             :                 DBG_ASSERT(pFact, "Dialog creation failed!");
     453           0 :                 boost::scoped_ptr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( GetActiveWindow(), aPageName, aDescr ));
     454             :                 DBG_ASSERT(aNameDlg, "Dialog creation failed!");
     455           0 :                 aNameDlg->SetText( aTitle );
     456           0 :                 aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true );
     457           0 :                 aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
     458             : 
     459           0 :                 if( aNameDlg->Execute() == RET_OK )
     460             :                 {
     461           0 :                     OUString aNewName;
     462           0 :                     aNameDlg->GetName( aNewName );
     463           0 :                     if (aNewName != aPageName)
     464             :                     {
     465             : #ifdef DBG_UTIL
     466             :                         bool bResult =
     467             : #endif
     468           0 :                             RenameSlide( nPageId, aNewName );
     469             :                         DBG_ASSERT( bResult, "Couldn't rename slide" );
     470           0 :                     }
     471           0 :                 }
     472             :             }
     473             : 
     474           0 :             Cancel();
     475           0 :             rReq.Ignore ();
     476             :         }
     477           0 :         break;
     478             : 
     479             :         case SID_RENAMEPAGE_QUICK:
     480             :         {
     481           0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
     482             :             {
     483           0 :                 if ( mpDrawView->IsTextEdit() )
     484             :                 {
     485           0 :                     mpDrawView->SdrEndTextEdit();
     486             :                 }
     487             : 
     488           0 :                 maTabControl.StartEditMode( maTabControl.GetCurPageId() );
     489             :             }
     490             : 
     491           0 :             Cancel();
     492           0 :             rReq.Ignore ();
     493             :         }
     494           0 :         break;
     495             : 
     496             :         case SID_PAGESIZE :  // either this (no menu entries or something else!)
     497             :         {
     498           0 :             const SfxItemSet *pArgs = rReq.GetArgs ();
     499             : 
     500           0 :             if (pArgs)
     501           0 :                 if (pArgs->Count () == 3)
     502             :                 {
     503           0 :                     SFX_REQUEST_ARG (rReq, pWidth, SfxUInt32Item, ID_VAL_PAGEWIDTH, false);
     504           0 :                     SFX_REQUEST_ARG (rReq, pHeight, SfxUInt32Item, ID_VAL_PAGEHEIGHT, false);
     505           0 :                     SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, false);
     506             : 
     507           0 :                     Size aSize (pWidth->GetValue (), pHeight->GetValue ());
     508             : 
     509           0 :                     SetupPage (aSize, 0, 0, 0, 0, true, false, pScaleAll->GetValue ());
     510           0 :                     rReq.Ignore ();
     511           0 :                     break;
     512             :                 }
     513             : #if HAVE_FEATURE_SCRIPTING
     514           0 :             StarBASIC::FatalError (SbERR_WRONG_ARGS);
     515             : #endif
     516           0 :             rReq.Ignore ();
     517           0 :             break;
     518             :         }
     519             : 
     520             :         case SID_PAGEMARGIN :  // or this (no menu entries or something else!)
     521             :         {
     522           0 :             const SfxItemSet *pArgs = rReq.GetArgs ();
     523             : 
     524           0 :             if (pArgs)
     525           0 :                 if (pArgs->Count () == 5)
     526             :                 {
     527           0 :                     SFX_REQUEST_ARG (rReq, pLeft, SfxUInt32Item, ID_VAL_PAGELEFT, false);
     528           0 :                     SFX_REQUEST_ARG (rReq, pRight, SfxUInt32Item, ID_VAL_PAGERIGHT, false);
     529           0 :                     SFX_REQUEST_ARG (rReq, pUpper, SfxUInt32Item, ID_VAL_PAGETOP, false);
     530           0 :                     SFX_REQUEST_ARG (rReq, pLower, SfxUInt32Item, ID_VAL_PAGEBOTTOM, false);
     531           0 :                     SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, false);
     532             : 
     533           0 :                     Size aEmptySize (0, 0);
     534             : 
     535           0 :                     SetupPage (aEmptySize, pLeft->GetValue (), pRight->GetValue (),
     536           0 :                                pUpper->GetValue (), pLower->GetValue (),
     537           0 :                                false, true, pScaleAll->GetValue ());
     538           0 :                     rReq.Ignore ();
     539           0 :                     break;
     540             :                 }
     541             : #if HAVE_FEATURE_SCRIPTING
     542           0 :             StarBASIC::FatalError (SbERR_WRONG_ARGS);
     543             : #endif
     544           0 :             rReq.Ignore ();
     545           0 :             break;
     546             :         }
     547             : 
     548             :         case SID_ATTR_ZOOMSLIDER:
     549             :         {
     550           0 :             const SfxItemSet* pArgs = rReq.GetArgs();
     551             : 
     552           0 :             if (pArgs && pArgs->Count () == 1 )
     553             :             {
     554           0 :                 SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER, false);
     555           0 :                 if (CHECK_RANGE (5, pScale->GetValue (), 3000))
     556             :                 {
     557           0 :                     SetZoom (pScale->GetValue ());
     558             : 
     559           0 :                     SfxBindings& rBindings = GetViewFrame()->GetBindings();
     560           0 :                     rBindings.Invalidate( SID_ATTR_ZOOM );
     561           0 :                     rBindings.Invalidate( SID_ZOOM_IN );
     562           0 :                     rBindings.Invalidate( SID_ZOOM_OUT );
     563           0 :                     rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
     564             : 
     565             :                 }
     566             :             }
     567             : 
     568           0 :             Cancel();
     569           0 :             rReq.Done ();
     570           0 :             break;
     571             :         }
     572             :         case SID_ZOOMING :  // no menu entry, but generated from zoom dialog
     573             :         {
     574           0 :             const SfxItemSet* pArgs = rReq.GetArgs();
     575             : 
     576           0 :             if (pArgs)
     577           0 :                 if (pArgs->Count () == 1)
     578             :                 {
     579           0 :                     SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM, false);
     580           0 :                     if (CHECK_RANGE (10, pScale->GetValue (), 1000))
     581             :                     {
     582           0 :                         SetZoom (pScale->GetValue ());
     583             : 
     584           0 :                         SfxBindings& rBindings = GetViewFrame()->GetBindings();
     585           0 :                         rBindings.Invalidate( SID_ATTR_ZOOM );
     586           0 :                         rBindings.Invalidate( SID_ZOOM_IN );
     587           0 :                         rBindings.Invalidate( SID_ZOOM_OUT );
     588           0 :                         rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
     589             :                     }
     590             : #if HAVE_FEATURE_SCRIPTING
     591           0 :                     else StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
     592             : #endif
     593           0 :                     rReq.Ignore ();
     594           0 :                     break;
     595             :                 }
     596             : #if HAVE_FEATURE_SCRIPTING
     597           0 :             StarBASIC::FatalError (SbERR_WRONG_ARGS);
     598             : #endif
     599           0 :             rReq.Ignore ();
     600           0 :             break;
     601             :         }
     602             : 
     603             :         case SID_ATTR_ZOOM:
     604             :         {
     605           0 :             const SfxItemSet* pArgs = rReq.GetArgs();
     606           0 :             mbZoomOnPage = false;
     607             : 
     608           0 :             if ( pArgs )
     609             :             {
     610             :                 SvxZoomType eZT = ( ( const SvxZoomItem& ) pArgs->
     611           0 :                                             Get( SID_ATTR_ZOOM ) ).GetType();
     612           0 :                 switch( eZT )
     613             :                 {
     614             :                     case SVX_ZOOM_PERCENT:
     615             :                         SetZoom( (long) ( ( const SvxZoomItem& ) pArgs->
     616           0 :                                             Get( SID_ATTR_ZOOM ) ).GetValue() );
     617           0 :                         break;
     618             : 
     619             :                     case SVX_ZOOM_OPTIMAL:
     620             :                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_ALL,
     621           0 :                                     SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
     622           0 :                         break;
     623             : 
     624             :                     case SVX_ZOOM_PAGEWIDTH:
     625             :                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE_WIDTH,
     626           0 :                                     SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
     627           0 :                         break;
     628             : 
     629             :                     case SVX_ZOOM_WHOLEPAGE:
     630             :                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE,
     631           0 :                                     SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
     632           0 :                         break;
     633             :                     case SVX_ZOOM_PAGEWIDTH_NOBORDER:
     634             :                         OSL_FAIL("sd::DrawViewShell::FuTemporary(), SVX_ZOOM_PAGEWIDTH_NOBORDER not handled!" );
     635           0 :                         break;
     636             :                 }
     637           0 :                 rReq.Ignore ();
     638             :             }
     639             :             else
     640             :             {
     641             :                 // open zoom dialog
     642           0 :                 SetCurrentFunction( FuScale::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     643             :             }
     644           0 :             Cancel();
     645             :         }
     646           0 :         break;
     647             : 
     648             :         case SID_CHANGEBEZIER:
     649             :         case SID_CHANGEPOLYGON:
     650           0 :             if ( mpDrawView->IsTextEdit() )
     651             :             {
     652           0 :                 mpDrawView->SdrEndTextEdit();
     653           0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
     654             :             }
     655             : 
     656           0 :             if ( mpDrawView->IsPresObjSelected() )
     657             :             {
     658           0 :                 ::sd::Window* pWindow = GetActiveWindow();
     659           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
     660             :             }
     661             :             else
     662             :             {
     663           0 :                 if( rReq.GetSlot() == SID_CHANGEBEZIER )
     664             :                 {
     665           0 :                     WaitObject aWait( (Window*)GetActiveWindow() );
     666           0 :                     mpDrawView->ConvertMarkedToPathObj(false);
     667             :                 }
     668             :                 else
     669             :                 {
     670           0 :                     if( mpDrawView->IsVectorizeAllowed() )
     671             :                     {
     672           0 :                         SetCurrentFunction( FuVectorize::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     673             :                     }
     674             :                     else
     675             :                     {
     676           0 :                         WaitObject aWait( (Window*)GetActiveWindow() );
     677           0 :                         mpDrawView->ConvertMarkedToPolyObj(false);
     678             :                     }
     679             :                 }
     680             : 
     681           0 :                 Invalidate(SID_CHANGEBEZIER);
     682           0 :                 Invalidate(SID_CHANGEPOLYGON);
     683             :             }
     684           0 :             Cancel();
     685             : 
     686           0 :             if( HasCurrentFunction(SID_BEZIER_EDIT) )
     687             :             {   // where applicable, activate right edit action
     688             :                 GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
     689           0 :                                         SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
     690             :             }
     691           0 :             rReq.Ignore ();
     692           0 :             break;
     693             : 
     694             :         case SID_CONVERT_TO_CONTOUR:
     695           0 :             if ( mpDrawView->IsTextEdit() )
     696             :             {
     697           0 :                 mpDrawView->SdrEndTextEdit();
     698           0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
     699             :             }
     700             : 
     701           0 :             if ( mpDrawView->IsPresObjSelected() )
     702             :             {
     703           0 :                 ::sd::Window* pWindow = GetActiveWindow();
     704           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
     705             :             }
     706             :             else
     707             :             {
     708           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
     709           0 :                 mpDrawView->ConvertMarkedToPathObj(true);
     710             : 
     711           0 :                 Invalidate(SID_CONVERT_TO_CONTOUR);
     712             :             }
     713           0 :             Cancel();
     714             : 
     715           0 :             rReq.Ignore ();
     716           0 :             break;
     717             : 
     718             :         case SID_CONVERT_TO_METAFILE:
     719             :         case SID_CONVERT_TO_BITMAP:
     720             :         {
     721             :             // End text edit mode when it is active because the metafile or
     722             :             // bitmap that will be created does not support it.
     723           0 :             if ( mpDrawView->IsTextEdit() )
     724             :             {
     725           0 :                 mpDrawView->SdrEndTextEdit();
     726           0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
     727             :             }
     728             : 
     729           0 :             if ( mpDrawView->IsPresObjSelected(true,true,true) )
     730             :             {
     731           0 :                 ::sd::Window* pWindow = GetActiveWindow();
     732           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
     733             :             }
     734             :             else
     735             :             {
     736           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
     737             : 
     738             :                 // create SdrGrafObj from metafile/bitmap
     739           0 :                 Graphic aGraphic;
     740           0 :                 switch (nSId)
     741             :                 {
     742             :                     case SID_CONVERT_TO_METAFILE:
     743             :                     {
     744             :                         // switch on undo for the next operations
     745           0 :                         mpDrawView->BegUndo(SD_RESSTR(STR_UNDO_CONVERT_TO_METAFILE));
     746           0 :                         GDIMetaFile aMetaFile(mpDrawView->GetMarkedObjMetaFile());
     747           0 :                         aGraphic = Graphic(aMetaFile);
     748             :                     }
     749           0 :                     break;
     750             :                     case SID_CONVERT_TO_BITMAP:
     751             :                     {
     752             :                         // switch on undo for the next operations
     753           0 :                         mpDrawView->BegUndo(SD_RESSTR(STR_UNDO_CONVERT_TO_BITMAP));
     754           0 :                         bool bDone(false);
     755             : 
     756             :                         // I have to get the image here directly since GetMarkedObjBitmapEx works
     757             :                         // based on Bitmaps, but not on BitmapEx, thus throwing away the alpha
     758             :                         // channel. Argh! GetMarkedObjBitmapEx itself is too widely used to safely
     759             :                         // change that, e.g. in the exchange formats. For now I can only add this
     760             :                         // exception to get good results for Svgs. This is how the code gets more
     761             :                         // and more crowded, at last I made a remark for myself to change this
     762             :                         // as one of the next tasks.
     763           0 :                         if(1 == mpDrawView->GetMarkedObjectCount())
     764             :                         {
     765           0 :                             const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->GetMarkedObjectByIndex(0));
     766             : 
     767           0 :                             if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg())
     768             :                             {
     769           0 :                                 aGraphic = Graphic(pSdrGrafObj->GetGraphic().getSvgData()->getReplacement());
     770           0 :                                 bDone = true;
     771             :                             }
     772             :                         }
     773             : 
     774           0 :                         if(!bDone)
     775             :                         {
     776           0 :                             aGraphic = Graphic(mpDrawView->GetMarkedObjBitmapEx());
     777             :                         }
     778             :                     }
     779           0 :                     break;
     780             :                 }
     781             : 
     782             :                 // create new object
     783           0 :                 SdrGrafObj* pGraphicObj = new SdrGrafObj (aGraphic);
     784             : 
     785             :                 // get some necessary info and ensure it
     786           0 :                 const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList());
     787           0 :                 const size_t nMarkCount(rMarkList.GetMarkCount());
     788           0 :                 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
     789             :                 OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
     790             :                 OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)");
     791             : 
     792             :                 // fit rectangle of new graphic object to selection's mark rect
     793           0 :                 Rectangle aAllMarkedRect;
     794           0 :                 rMarkList.TakeBoundRect(pPageView, aAllMarkedRect);
     795           0 :                 pGraphicObj->SetLogicRect(aAllMarkedRect);
     796             : 
     797             :                 // #i71540# to keep the order, it is necessary to replace the lowest object
     798             :                 // of the selection with the new object. This also means that with multi
     799             :                 // selection, all other objects need to be deleted first
     800           0 :                 SdrMark* pFirstMark = rMarkList.GetMark(0);
     801           0 :                 SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj();
     802             : 
     803           0 :                 if(nMarkCount > 1)
     804             :                 {
     805             :                     // take first object out of selection
     806           0 :                     mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true);
     807             : 
     808             :                     // clear remaining selection
     809           0 :                     mpDrawView->DeleteMarkedObj();
     810             :                 }
     811             : 
     812             :                 // #i124816# copy layer from lowest object which gets replaced
     813           0 :                 pGraphicObj->SetLayer(pReplacementCandidate->GetLayer());
     814             : 
     815             :                 // now replace lowest object with new one
     816           0 :                 mpDrawView->ReplaceObjectAtView(pReplacementCandidate, *pPageView, pGraphicObj);
     817             : 
     818             :                 // switch off undo
     819           0 :                 mpDrawView->EndUndo();
     820             :             }
     821             :         }
     822             : 
     823           0 :         Cancel();
     824             : 
     825           0 :         rReq.Done ();
     826           0 :         break;
     827             : 
     828             :         case SID_SET_DEFAULT:
     829             :         {
     830           0 :             boost::scoped_ptr<SfxItemSet> pSet;
     831             : 
     832           0 :             if (mpDrawView->IsTextEdit())
     833             :             {
     834           0 :                 ::Outliner* pOutl = mpDrawView->GetTextEditOutliner();
     835           0 :                 if (pOutl)
     836             :                 {
     837           0 :                     pOutl->RemoveFields(true, (TypeId) SvxURLField::StaticType());
     838             :                 }
     839             : 
     840           0 :                 pSet.reset(new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END ));
     841           0 :                 mpDrawView->SetAttributes( *pSet, true );
     842             :             }
     843             :             else
     844             :             {
     845           0 :                 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     846           0 :                 const size_t nCount = rMarkList.GetMarkCount();
     847             : 
     848             :                 // For every presentation object a SfxItemSet of hard attributes
     849             :                 // and the UserCall is stored in this list. This is because
     850             :                 // at the following mpDrawView->SetAttributes( *pSet, sal_True )
     851             :                 // they get lost and have to be restored.
     852           0 :                 std::vector<std::pair<SfxItemSet*,SdrObjUserCall*> > aAttrList;
     853           0 :                 SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage();
     854             : 
     855           0 :                 for ( size_t i = 0; i < nCount; ++i )
     856             :                 {
     857           0 :                     SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
     858             : 
     859           0 :                     if( pPresPage->IsPresObj( pObj ) )
     860             :                     {
     861           0 :                         SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
     862           0 :                         pNewSet->Put(pObj->GetMergedItemSet());
     863           0 :                         aAttrList.push_back(std::make_pair(pNewSet, pObj->GetUserCall()));
     864             :                     }
     865             :                 }
     866             : 
     867           0 :                 pSet.reset(new SfxItemSet( GetPool() ));
     868           0 :                 mpDrawView->SetAttributes( *pSet, true );
     869             : 
     870           0 :                 sal_uLong j = 0;
     871             : 
     872           0 :                 for ( size_t i = 0; i < nCount; ++i )
     873             :                 {
     874           0 :                     SfxStyleSheet* pSheet = NULL;
     875           0 :                     SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
     876             : 
     877           0 :                     if (pObj->GetObjIdentifier() == OBJ_TITLETEXT)
     878             :                     {
     879           0 :                         pSheet = mpActualPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
     880           0 :                         if (pSheet)
     881           0 :                             pObj->SetStyleSheet(pSheet, false);
     882             :                     }
     883           0 :                     else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
     884             :                     {
     885           0 :                         for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
     886             :                         {
     887           0 :                             pSheet = mpActualPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
     888             :                             DBG_ASSERT(pSheet, "Template for outline object not found");
     889           0 :                             if (pSheet)
     890             :                             {
     891           0 :                                 pObj->StartListening(*pSheet);
     892             : 
     893           0 :                                 if( nLevel == 1 )
     894             :                                     // text frame listens on StyleSheet of level1
     895           0 :                                     pObj->NbcSetStyleSheet(pSheet, false);
     896             : 
     897             :                             }
     898             :                         }
     899             :                     }
     900             : 
     901           0 :                     if( pPresPage->IsPresObj( pObj ) )
     902             :                     {
     903           0 :                         std::pair<SfxItemSet*,SdrObjUserCall*> &rAttr = aAttrList[j++];
     904             : 
     905           0 :                         boost::scoped_ptr<SfxItemSet> pNewSet(rAttr.first);
     906           0 :                         SdrObjUserCall* pUserCall = rAttr.second;
     907             : 
     908           0 :                         if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SfxItemState::SET )
     909             :                         {
     910           0 :                             pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT));
     911             :                         }
     912             : 
     913           0 :                         if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SfxItemState::SET )
     914             :                         {
     915           0 :                             pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT));
     916             :                         }
     917             : 
     918           0 :                         if( pUserCall )
     919           0 :                             pObj->SetUserCall( pUserCall );
     920             :                     }
     921           0 :                 }
     922             :             }
     923             : 
     924           0 :             pSet.reset();
     925           0 :             Cancel();
     926             :         }
     927           0 :         break;
     928             : 
     929             :         case SID_DELETE_SNAPITEM:
     930             :         {
     931             :             SdrPageView* pPV;
     932           0 :             Point   aMPos = GetActiveWindow()->PixelToLogic( maMousePos );
     933           0 :             sal_uInt16  nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( Size(
     934           0 :                 FuPoor::HITPIX, 0 ) ).Width();
     935             :             sal_uInt16  nHelpLine;
     936             : 
     937           0 :             mbMousePosFreezed = false;
     938             : 
     939           0 :             if( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
     940             :             {
     941           0 :                 pPV->DeleteHelpLine( nHelpLine );
     942             :             }
     943           0 :             Cancel();
     944           0 :             rReq.Ignore ();
     945             :         }
     946           0 :         break;
     947             : 
     948             :         case SID_DELETE_PAGE:
     949             :         case SID_DELETE_MASTER_PAGE:
     950           0 :             DeleteActualPage();
     951           0 :             Cancel();
     952           0 :             rReq.Ignore ();
     953           0 :         break;
     954             : 
     955             :         case SID_DELETE_LAYER:
     956           0 :             DeleteActualLayer();
     957           0 :             Cancel();
     958           0 :             rReq.Ignore ();
     959           0 :         break;
     960             : 
     961             :         case SID_ORIGINAL_SIZE:
     962           0 :             mpDrawView->SetMarkedOriginalSize();
     963           0 :             Cancel();
     964           0 :             rReq.Done();
     965           0 :         break;
     966             : 
     967             :         case SID_DRAW_FONTWORK:
     968             :         case SID_DRAW_FONTWORK_VERTICAL:
     969             :         {
     970           0 :             svx::FontworkBar::execute( mpView, rReq, GetViewFrame()->GetBindings() );       // SJ: can be removed  (I think)
     971           0 :             Cancel();
     972           0 :             rReq.Done();
     973             :         }
     974           0 :         break;
     975             : 
     976             :         case SID_SAVE_GRAPHIC:
     977             :         {
     978           0 :             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     979           0 :             if( rMarkList.GetMarkCount() == 1 )
     980             :             {
     981           0 :                 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
     982           0 :                 if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
     983             :                 {
     984           0 :                     GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
     985             :                     {
     986           0 :                         GraphicHelper::ExportGraphic( aGraphicObject.GetGraphic(), "" );
     987           0 :                     }
     988             :                 }
     989             :             }
     990           0 :             Cancel();
     991           0 :             rReq.Ignore();
     992             :         }
     993           0 :         break;
     994             : 
     995             :         case SID_EXTERNAL_EDIT:
     996             :         {
     997           0 :             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     998           0 :             if( rMarkList.GetMarkCount() == 1 )
     999             :             {
    1000           0 :                 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
    1001           0 :                 if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
    1002             :                 {
    1003           0 :                     GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
    1004           0 :                     SdExternalToolEdit* aExternalToolEdit = new SdExternalToolEdit( mpDrawView, pObj );
    1005           0 :                     aExternalToolEdit->Edit( &aGraphicObject );
    1006             :                 }
    1007             :             }
    1008           0 :             Cancel();
    1009           0 :             rReq.Ignore();
    1010             :         }
    1011           0 :         break;
    1012             : 
    1013             :         case SID_COMPRESS_GRAPHIC:
    1014             :         {
    1015           0 :             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
    1016           0 :             if( rMarkList.GetMarkCount() == 1 )
    1017             :             {
    1018           0 :                 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
    1019             : 
    1020           0 :                 if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
    1021             :                 {
    1022           0 :                     SdrGrafObj* pGraphicObj = (SdrGrafObj*) pObj;
    1023           0 :                     CompressGraphicsDialog dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() );
    1024           0 :                     if ( dialog.Execute() == RET_OK )
    1025             :                     {
    1026           0 :                         SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
    1027           0 :                         SdrPageView* pPageView = mpDrawView->GetSdrPageView();
    1028           0 :                         OUString aUndoString = mpDrawView->GetDescriptionOfMarkedObjects();
    1029           0 :                         aUndoString += " Compress";
    1030           0 :                         mpDrawView->BegUndo( aUndoString );
    1031           0 :                         mpDrawView->ReplaceObjectAtView( pObj, *pPageView, pNewObject );
    1032           0 :                         mpDrawView->EndUndo();
    1033           0 :                     }
    1034             :                 }
    1035             :             }
    1036           0 :             Cancel();
    1037           0 :             rReq.Ignore();
    1038             :         }
    1039           0 :         break;
    1040             : 
    1041             :         case SID_ATTRIBUTES_LINE:  // BASIC
    1042             :         {
    1043           0 :             SetCurrentFunction( FuLine::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1044           0 :             Cancel();
    1045             :         }
    1046           0 :         break;
    1047             : 
    1048             :         case SID_ATTRIBUTES_AREA:  // BASIC
    1049             :         {
    1050           0 :             SetCurrentFunction( FuArea::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1051           0 :             Cancel();
    1052             :         }
    1053           0 :         break;
    1054             : 
    1055             :         case SID_ATTR_TRANSFORM:
    1056             :         {
    1057           0 :             SetCurrentFunction( FuTransform::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1058           0 :             Invalidate(SID_RULER_OBJECT);
    1059           0 :             Cancel();
    1060             :         }
    1061           0 :         break;
    1062             : 
    1063             :         case SID_CHAR_DLG_EFFECT:
    1064             :         case SID_CHAR_DLG:  // BASIC
    1065             :         {
    1066           0 :             SetCurrentFunction( FuChar::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1067           0 :             Cancel();
    1068             :         }
    1069           0 :         break;
    1070             : 
    1071             :         case SID_PARA_DLG:
    1072             :         {
    1073           0 :             SetCurrentFunction( FuParagraph::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1074           0 :             Cancel();
    1075             :         }
    1076           0 :         break;
    1077             : 
    1078             :         case FN_NUM_BULLET_ON:
    1079             :         {
    1080             :             // The value (sal_uInt16)0xFFFF means set bullet on/off.
    1081           0 :             SfxUInt16Item aItem(FN_SVX_SET_BULLET, (sal_uInt16)0xFFFF);
    1082           0 :             GetViewFrame()->GetDispatcher()->Execute( FN_SVX_SET_BULLET, SfxCallMode::RECORD, &aItem, 0L );
    1083             :         }
    1084           0 :         break;
    1085             : 
    1086             :         case FN_NUM_NUMBERING_ON:
    1087             :         {
    1088             :             // The value (sal_uInt16)0xFFFF means set bullet on/off.
    1089           0 :             SfxUInt16Item aItem(FN_SVX_SET_NUMBER, (sal_uInt16)0xFFFF);
    1090           0 :             GetViewFrame()->GetDispatcher()->Execute( FN_SVX_SET_NUMBER, SfxCallMode::RECORD, &aItem, 0L );
    1091             :         }
    1092           0 :         break;
    1093             : 
    1094             :         case SID_OUTLINE_BULLET:
    1095             :         case FN_SVX_SET_BULLET:
    1096             :         case FN_SVX_SET_NUMBER:
    1097             :         {
    1098           0 :             SetCurrentFunction( FuOutlineBullet::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1099           0 :             Cancel();
    1100             :         }
    1101           0 :         break;
    1102             : 
    1103             :         case FN_INSERT_SOFT_HYPHEN:
    1104             :         case FN_INSERT_HARDHYPHEN:
    1105             :         case FN_INSERT_HARD_SPACE:
    1106             :         case SID_INSERT_RLM :
    1107             :         case SID_INSERT_LRM :
    1108             :         case SID_INSERT_ZWNBSP :
    1109             :         case SID_INSERT_ZWSP:
    1110             :         case SID_CHARMAP:
    1111             :         {
    1112           0 :             SetCurrentFunction( FuBullet::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1113           0 :             Cancel();
    1114             :         }
    1115           0 :         break;
    1116             : 
    1117             :         case SID_PRESENTATION_LAYOUT:
    1118             :         {
    1119           0 :             SetCurrentFunction( FuPresentationLayout::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
    1120           0 :             Cancel();
    1121             :         }
    1122           0 :         break;
    1123             : 
    1124             :         case SID_PASTE_SPECIAL:
    1125             :         {
    1126           0 :             SetCurrentFunction( FuInsertClipboard::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1127           0 :             Cancel();
    1128           0 :             rReq.Ignore ();
    1129             :         }
    1130           0 :         break;
    1131             : 
    1132             :         case SID_CHANGE_PICTURE:
    1133             :         case SID_INSERT_GRAPHIC:
    1134             :         {
    1135           0 :             SetCurrentFunction( FuInsertGraphic::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1136           0 :             Cancel();
    1137           0 :             rReq.Ignore ();
    1138           0 :             Invalidate(SID_DRAWTBX_INSERT);
    1139             :         }
    1140           0 :         break;
    1141             : 
    1142             :         case SID_INSERT_AVMEDIA:
    1143             :         {
    1144           0 :             SetCurrentFunction( FuInsertAVMedia::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1145             : 
    1146           0 :             Cancel();
    1147           0 :             rReq.Ignore ();
    1148             : 
    1149           0 :             Invalidate(SID_DRAWTBX_INSERT);
    1150             :         }
    1151           0 :         break;
    1152             : 
    1153             :         case SID_INSERT_OBJECT:
    1154             :         case SID_INSERT_PLUGIN:
    1155             :         case SID_INSERT_SOUND:
    1156             :         case SID_INSERT_VIDEO:
    1157             :         case SID_INSERT_FLOATINGFRAME:
    1158             :         case SID_INSERT_MATH:
    1159             :         case SID_INSERT_DIAGRAM:
    1160             :         case SID_ATTR_TABLE:
    1161             :         {
    1162           0 :             SetCurrentFunction( FuInsertOLE::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1163             : 
    1164           0 :             Cancel();
    1165           0 :             rReq.Ignore ();
    1166             : 
    1167           0 :             Invalidate(SID_DRAWTBX_INSERT);
    1168             :         }
    1169           0 :         break;
    1170             : #if HAVE_FEATURE_GLTF
    1171             :         case SID_INSERT_3DMODEL:
    1172             :         {
    1173           0 :             SetCurrentFunction( FuInsert3DModel::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1174             : 
    1175           0 :             Cancel();
    1176           0 :             rReq.Ignore ();
    1177             : 
    1178           0 :             Invalidate(SID_DRAWTBX_INSERT);
    1179             :         }
    1180           0 :         break;
    1181             : #endif
    1182             : 
    1183             :         case SID_COPYOBJECTS:
    1184             :         {
    1185           0 :             if ( mpDrawView->IsPresObjSelected(false, true) )
    1186             :             {
    1187           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    1188           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    1189             :             }
    1190             :             else
    1191             :             {
    1192           0 :                 if ( mpDrawView->IsTextEdit() )
    1193             :                 {
    1194           0 :                     mpDrawView->SdrEndTextEdit();
    1195             :                 }
    1196             : 
    1197           0 :                 SetCurrentFunction( FuCopy::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1198             :             }
    1199           0 :             Cancel();
    1200           0 :             rReq.Ignore ();
    1201             :         }
    1202           0 :         break;
    1203             : 
    1204             :         case SID_INSERTFILE:  // BASIC
    1205             :         {
    1206           0 :             Broadcast (ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START));
    1207           0 :             SetCurrentFunction( FuInsertFile::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1208           0 :             Broadcast (ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END));
    1209           0 :             Cancel();
    1210           0 :             rReq.Done ();
    1211             : 
    1212           0 :             Invalidate(SID_DRAWTBX_INSERT);
    1213             :         }
    1214           0 :         break;
    1215             : 
    1216             :         case SID_SELECT_BACKGROUND:
    1217             :         case SID_PAGESETUP:  // BASIC ??
    1218             :         {
    1219           0 :             SetCurrentFunction( FuPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1220           0 :             Cancel();
    1221           0 :             rReq.Ignore (); // we generate independent macros !!
    1222             :         }
    1223           0 :         break;
    1224             : 
    1225             :         case SID_ZOOM_MODE:
    1226             :         case SID_ZOOM_PANNING:
    1227             :         {
    1228           0 :             mbZoomOnPage = false;
    1229           0 :             SetCurrentFunction( FuZoom::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
    1230           0 :             Invalidate( SID_ZOOM_TOOLBOX );
    1231           0 :             rReq.Ignore ();
    1232             :         }
    1233           0 :         break;
    1234             : 
    1235             :         case SID_BEFORE_OBJ:
    1236             :         case SID_BEHIND_OBJ:
    1237             :         {
    1238           0 :             SetCurrentFunction( FuDisplayOrder::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
    1239           0 :             Invalidate( SID_POSITION );
    1240           0 :             rReq.Ignore ();
    1241             :             // finishes itself, no Cancel() needed!
    1242             :         }
    1243           0 :         break;
    1244             : 
    1245             :         case SID_REVERSE_ORDER:   // BASIC
    1246             :         {
    1247           0 :             mpDrawView->ReverseOrderOfMarked();
    1248           0 :             Invalidate( SID_POSITION );
    1249           0 :             Cancel();
    1250           0 :             rReq.Done ();
    1251             :         }
    1252           0 :         break;
    1253             : 
    1254             :         case SID_ANIMATION_EFFECTS:
    1255             :         {
    1256           0 :             SetCurrentFunction( FuObjectAnimationParameters::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
    1257           0 :             Cancel();
    1258             :         }
    1259           0 :         break;
    1260             : 
    1261             :         case SID_LINEEND_POLYGON:
    1262             :         {
    1263           0 :             SetCurrentFunction( FuLineEnd::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1264           0 :             Cancel();
    1265             :         }
    1266           0 :         break;
    1267             : 
    1268             :         case SID_CAPTUREPOINT:
    1269             :             // negative value to signal call from menu
    1270           0 :             maMousePos = Point(-1,-1);
    1271             :             // fall-through
    1272             :         case SID_SET_SNAPITEM:
    1273             :         {
    1274           0 :             SetCurrentFunction( FuSnapLine::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
    1275           0 :             Cancel();
    1276             :         }
    1277           0 :         break;
    1278             : 
    1279             :         case SID_MANAGE_LINKS:
    1280             :         {
    1281           0 :             SetCurrentFunction( FuLink::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1282           0 :             Cancel();
    1283           0 :             rReq.Ignore ();
    1284             :         }
    1285           0 :         break;
    1286             : 
    1287             :         case SID_THESAURUS:
    1288             :         {
    1289           0 :             SetCurrentFunction( FuThesaurus::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1290           0 :             Cancel();
    1291           0 :             rReq.Ignore ();
    1292             :         }
    1293           0 :         break;
    1294             : 
    1295             :         case SID_TEXTATTR_DLG:
    1296             :         {
    1297           0 :             SetCurrentFunction( FuTextAttrDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1298           0 :             Cancel();
    1299           0 :             rReq.Ignore ();
    1300             :         }
    1301           0 :         break;
    1302             : 
    1303             :         case SID_MEASURE_DLG:
    1304             :         {
    1305           0 :             SetCurrentFunction( FuMeasureDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1306           0 :             Cancel();
    1307           0 :             rReq.Ignore ();
    1308             :         }
    1309           0 :         break;
    1310             : 
    1311             :         case SID_CONNECTION_DLG:
    1312             :         {
    1313           0 :             SetCurrentFunction( FuConnectionDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1314           0 :             Cancel();
    1315           0 :             rReq.Done();
    1316             :         }
    1317           0 :         break;
    1318             : 
    1319             :         case SID_CONNECTION_NEW_ROUTING:
    1320             :         {
    1321           0 :             SfxItemSet aDefAttr( GetPool(), SDRATTR_EDGELINE1DELTA, SDRATTR_EDGELINE3DELTA );
    1322           0 :             GetView()->SetAttributes( aDefAttr, true ); // (ReplaceAll)
    1323             : 
    1324           0 :             Cancel();
    1325           0 :             rReq.Done();
    1326             :         }
    1327           0 :         break;
    1328             : 
    1329             :         case SID_TWAIN_SELECT:
    1330             :         {
    1331           0 :             if( mxScannerManager.is() )
    1332             :             {
    1333             :                 try
    1334             :                 {
    1335             :                     const ::com::sun::star::uno::Sequence< ::com::sun::star::scanner::ScannerContext >
    1336           0 :                         aContexts( mxScannerManager->getAvailableScanners() );
    1337             : 
    1338           0 :                     if( aContexts.getLength() )
    1339             :                     {
    1340           0 :                         ::com::sun::star::scanner::ScannerContext aContext( aContexts.getConstArray()[ 0 ] );
    1341           0 :                         mxScannerManager->configureScannerAndScan( aContext, mxScannerListener );
    1342           0 :                     }
    1343             :                 }
    1344           0 :                 catch(...)
    1345             :                 {
    1346             :                 }
    1347             :             }
    1348             : 
    1349           0 :             Cancel();
    1350           0 :             rReq.Done();
    1351             :         }
    1352           0 :         break;
    1353             : 
    1354             :         case SID_TWAIN_TRANSFER:
    1355             :         {
    1356           0 :             bool bDone = false;
    1357             : 
    1358           0 :             if( mxScannerManager.is() )
    1359             :             {
    1360             :                 try
    1361             :                 {
    1362           0 :                     const ::com::sun::star::uno::Sequence< ::com::sun::star::scanner::ScannerContext > aContexts( mxScannerManager->getAvailableScanners() );
    1363             : 
    1364           0 :                     if( aContexts.getLength() )
    1365             :                     {
    1366           0 :                         mxScannerManager->startScan( aContexts.getConstArray()[ 0 ], mxScannerListener );
    1367           0 :                         bDone = true;
    1368           0 :                     }
    1369             :                 }
    1370           0 :                 catch( ... )
    1371             :                 {
    1372             :                 }
    1373             :             }
    1374             : 
    1375           0 :             if( !bDone )
    1376             :             {
    1377             : #ifndef UNX
    1378             :                 const sal_uInt16 nId = STR_TWAIN_NO_SOURCE;
    1379             : #else
    1380           0 :                 const sal_uInt16 nId = STR_TWAIN_NO_SOURCE_UNX;
    1381             : #endif
    1382             : 
    1383           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    1384           0 :                 InfoBox(pWindow, SD_RESSTR(nId)).Execute();
    1385             :             }
    1386             :             else
    1387             :             {
    1388           0 :                 SfxBindings& rBindings = GetViewFrame()->GetBindings();
    1389           0 :                 rBindings.Invalidate( SID_TWAIN_SELECT );
    1390           0 :                 rBindings.Invalidate( SID_TWAIN_TRANSFER );
    1391             :             }
    1392             : 
    1393           0 :             Cancel();
    1394           0 :             rReq.Done();
    1395             :         }
    1396           0 :         break;
    1397             : 
    1398             :         case SID_POLYGON_MORPHING:
    1399             :         {
    1400           0 :             SetCurrentFunction( FuMorph::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1401           0 :             Cancel();
    1402             :         }
    1403           0 :         break;
    1404             : 
    1405             :         case SID_VECTORIZE:
    1406             :         {
    1407           0 :             SetCurrentFunction( FuVectorize::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    1408           0 :             Cancel();
    1409             :         }
    1410           0 :         break;
    1411             : 
    1412             :         case SID_INSERTLAYER:
    1413             :         {
    1414           0 :             if ( mpDrawView->IsTextEdit() )
    1415             :             {
    1416           0 :                 mpDrawView->SdrEndTextEdit();
    1417             :             }
    1418             : 
    1419           0 :             SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
    1420           0 :             sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount();
    1421           0 :             sal_uInt16 nLayer = nLayerCnt - 2 + 1;
    1422           0 :             OUString aLayerName = SD_RESSTR(STR_LAYER) + OUString::number(nLayer);
    1423           0 :             OUString aLayerTitle, aLayerDesc;
    1424           0 :             bool bIsVisible = false;
    1425           0 :             bool bIsLocked = false;
    1426           0 :             bool bIsPrintable = false;
    1427             : 
    1428           0 :             const SfxItemSet* pArgs = rReq.GetArgs();
    1429             : 
    1430           0 :             if (! pArgs)
    1431             :             {
    1432           0 :                 SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
    1433             : 
    1434           0 :                 aNewAttr.Put( SdAttrLayerName( aLayerName ) );
    1435           0 :                 aNewAttr.Put( SdAttrLayerTitle() );
    1436           0 :                 aNewAttr.Put( SdAttrLayerDesc() );
    1437           0 :                 aNewAttr.Put( SdAttrLayerVisible() );
    1438           0 :                 aNewAttr.Put( SdAttrLayerPrintable() );
    1439           0 :                 aNewAttr.Put( SdAttrLayerLocked() );
    1440           0 :                 aNewAttr.Put( SdAttrLayerThisPage() );
    1441             : 
    1442           0 :                 SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
    1443           0 :                 boost::scoped_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(NULL, aNewAttr, true, SD_RESSTR(STR_INSERTLAYER)) : 0);
    1444           0 :                 if( pDlg )
    1445             :                 {
    1446           0 :                     pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_INSERTLAYER )->GetCommand() );
    1447             : 
    1448             :                     // test for already existing names
    1449           0 :                     bool bLoop = true;
    1450           0 :                     while( bLoop && pDlg->Execute() == RET_OK )
    1451             :                     {
    1452           0 :                         pDlg->GetAttr( aNewAttr );
    1453           0 :                         aLayerName   = ((SdAttrLayerName &) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
    1454             : 
    1455           0 :                         if( rLayerAdmin.GetLayer( aLayerName, false )
    1456           0 :                             || aLayerName.isEmpty() )
    1457             :                         {
    1458             :                             // name already exists
    1459             :                             WarningBox aWarningBox (
    1460             :                                 GetParentWindow(),
    1461             :                                 WinBits( WB_OK ),
    1462           0 :                                 SD_RESSTR(STR_WARN_NAME_DUPLICATE));
    1463           0 :                             aWarningBox.Execute();
    1464             :                         }
    1465             :                         else
    1466           0 :                             bLoop = false;
    1467             :                     }
    1468           0 :                     if( bLoop ) // was canceled
    1469             :                     {
    1470           0 :                         pDlg.reset();
    1471           0 :                         Cancel();
    1472           0 :                         rReq.Ignore ();
    1473           0 :                         break;
    1474             :                     }
    1475             :                     else
    1476             :                     {
    1477           0 :                         aLayerTitle  = ((SdAttrLayerTitle &) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue ();
    1478           0 :                         aLayerDesc   = ((SdAttrLayerDesc &) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue ();
    1479           0 :                         bIsVisible   = ((SdAttrLayerVisible &) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
    1480           0 :                         bIsLocked    = ((SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue () ;
    1481           0 :                         bIsPrintable = ((SdAttrLayerPrintable &) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue () ;
    1482             :                     }
    1483           0 :                 }
    1484             :             }
    1485           0 :             else if (pArgs->Count () != 4)
    1486             :                  {
    1487             : #if HAVE_FEATURE_SCRIPTING
    1488           0 :                      StarBASIC::FatalError (SbERR_WRONG_ARGS);
    1489             : #endif
    1490           0 :                      Cancel();
    1491           0 :                      rReq.Ignore ();
    1492           0 :                      break;
    1493             :                  }
    1494             :                  else
    1495             :                  {
    1496           0 :                      SFX_REQUEST_ARG (rReq, pLayerName, SfxStringItem, ID_VAL_LAYERNAME, false);
    1497           0 :                      SFX_REQUEST_ARG (rReq, pIsVisible, SfxBoolItem, ID_VAL_ISVISIBLE, false);
    1498           0 :                      SFX_REQUEST_ARG (rReq, pIsLocked, SfxBoolItem, ID_VAL_ISLOCKED, false);
    1499           0 :                      SFX_REQUEST_ARG (rReq, pIsPrintable, SfxBoolItem, ID_VAL_ISPRINTABLE, false);
    1500             : 
    1501           0 :                      aLayerName   = pLayerName->GetValue ();
    1502           0 :                      bIsVisible   = pIsVisible->GetValue ();
    1503           0 :                      bIsLocked    = pIsLocked->GetValue ();
    1504           0 :                      bIsPrintable = pIsPrintable->GetValue ();
    1505             :                  }
    1506             : 
    1507           0 :             OUString aPrevLayer = mpDrawView->GetActiveLayer();
    1508             :             SdrLayer* pLayer;
    1509           0 :             sal_uInt16 nPrevLayer = 0;
    1510           0 :             nLayerCnt = rLayerAdmin.GetLayerCount();
    1511             : 
    1512           0 :             for ( nLayer = 0; nLayer < nLayerCnt; nLayer++ )
    1513             :             {
    1514           0 :                 pLayer = rLayerAdmin.GetLayer(nLayer);
    1515           0 :                 OUString aName = pLayer->GetName();
    1516             : 
    1517           0 :                 if ( aPrevLayer == aName )
    1518             :                 {
    1519           0 :                     nPrevLayer = std::max(nLayer, (sal_uInt16) 4);
    1520             :                 }
    1521           0 :             }
    1522             : 
    1523           0 :             mpDrawView->InsertNewLayer(aLayerName, nPrevLayer + 1);
    1524           0 :             pLayer = rLayerAdmin.GetLayer(aLayerName, false);
    1525           0 :             if( pLayer )
    1526             :             {
    1527           0 :                 pLayer->SetTitle( aLayerTitle );
    1528           0 :                 pLayer->SetDescription( aLayerDesc );
    1529             :             }
    1530             : 
    1531           0 :             mpDrawView->SetLayerVisible( aLayerName, bIsVisible );
    1532           0 :             mpDrawView->SetLayerLocked( aLayerName, bIsLocked);
    1533           0 :             mpDrawView->SetLayerPrintable(aLayerName, bIsPrintable);
    1534             : 
    1535           0 :             mpDrawView->SetActiveLayer(aLayerName);
    1536             : 
    1537           0 :             ResetActualLayer();
    1538             : 
    1539           0 :             GetDoc()->SetChanged(true);
    1540             : 
    1541             :             GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHLAYER,
    1542           0 :                     SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
    1543             : 
    1544           0 :             Cancel();
    1545           0 :             rReq.Done ();
    1546             :         }
    1547           0 :         break;
    1548             : 
    1549             :         case SID_MODIFYLAYER:
    1550             :         {
    1551           0 :             if(!GetLayerTabControl()) // #i87182#
    1552             :             {
    1553             :                 OSL_ENSURE(false, "No LayerTabBar (!)");
    1554           0 :                 Cancel();
    1555           0 :                 rReq.Ignore();
    1556           0 :                 break;
    1557             :             }
    1558             : 
    1559           0 :             if ( mpDrawView->IsTextEdit() )
    1560             :             {
    1561           0 :                 mpDrawView->SdrEndTextEdit();
    1562             :             }
    1563             : 
    1564           0 :             SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
    1565           0 :             sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId();
    1566           0 :             OUString aLayerName = GetLayerTabControl()->GetPageText(nCurPage);
    1567           0 :             SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, false);
    1568             : 
    1569           0 :             OUString aLayerTitle = pLayer->GetTitle();
    1570           0 :             OUString aLayerDesc = pLayer->GetDescription();
    1571             : 
    1572           0 :             OUString aOldLayerName(aLayerName);
    1573           0 :             OUString aOldLayerTitle(aLayerTitle);
    1574           0 :             OUString aOldLayerDesc(aLayerDesc);
    1575             : 
    1576             :             bool bIsVisible, bIsLocked, bIsPrintable;
    1577           0 :             bool bOldIsVisible = bIsVisible = mpDrawView->IsLayerVisible(aLayerName);
    1578           0 :             bool bOldIsLocked = bIsLocked = mpDrawView->IsLayerLocked(aLayerName);
    1579           0 :             bool bOldIsPrintable = bIsPrintable = mpDrawView->IsLayerPrintable(aLayerName);
    1580             : 
    1581           0 :             const SfxItemSet* pArgs = rReq.GetArgs();
    1582             :             // is it allowed to delete the layer?
    1583           0 :             bool bDelete = true;
    1584             : 
    1585           0 :             OUString aLayoutLayer = SD_RESSTR(STR_LAYER_LAYOUT);
    1586           0 :             OUString aControlsLayer = SD_RESSTR(STR_LAYER_CONTROLS);
    1587           0 :             OUString aMeasureLinesLayer = SD_RESSTR(STR_LAYER_MEASURELINES);
    1588           0 :             OUString aBackgroundLayer = SD_RESSTR(STR_LAYER_BCKGRND);
    1589           0 :             OUString aBackgroundObjLayer = SD_RESSTR(STR_LAYER_BCKGRNDOBJ);
    1590             : 
    1591           0 :             if( aLayerName == aLayoutLayer       || aLayerName == aControlsLayer ||
    1592           0 :                 aLayerName == aMeasureLinesLayer ||
    1593           0 :                 aLayerName == aBackgroundLayer   || aLayerName == aBackgroundObjLayer )
    1594             :             {
    1595           0 :                 bDelete = false;
    1596             :             }
    1597             : 
    1598           0 :             if (! pArgs)
    1599             :             {
    1600           0 :                 SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
    1601             : 
    1602           0 :                 aNewAttr.Put( SdAttrLayerName( aLayerName ) );
    1603           0 :                 aNewAttr.Put( SdAttrLayerTitle( aLayerTitle ) );
    1604           0 :                 aNewAttr.Put( SdAttrLayerDesc( aLayerDesc ) );
    1605           0 :                 aNewAttr.Put( SdAttrLayerVisible( bIsVisible ) );
    1606           0 :                 aNewAttr.Put( SdAttrLayerLocked( bIsLocked ) );
    1607           0 :                 aNewAttr.Put( SdAttrLayerPrintable( bIsPrintable ) );
    1608           0 :                 aNewAttr.Put( SdAttrLayerThisPage() );
    1609             : 
    1610           0 :                 SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
    1611           0 :                 boost::scoped_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(NULL, aNewAttr, bDelete, SD_RESSTR(STR_MODIFYLAYER)) : 0);
    1612           0 :                 if( pDlg )
    1613             :                 {
    1614           0 :                     pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_MODIFYLAYER )->GetCommand() );
    1615             : 
    1616             :                     // test for already existing names
    1617           0 :                     bool    bLoop = true;
    1618           0 :                     sal_uInt16  nRet = 0;
    1619           0 :                     while( bLoop && ( (nRet = pDlg->Execute()) == RET_OK ) )
    1620             :                     {
    1621           0 :                         pDlg->GetAttr( aNewAttr );
    1622           0 :                         aLayerName   = ((SdAttrLayerName &) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
    1623             : 
    1624           0 :                         if( (rLayerAdmin.GetLayer( aLayerName, false ) &&
    1625           0 :                              aLayerName != aOldLayerName) || aLayerName.isEmpty() )
    1626             :                         {
    1627             :                             // name already exists
    1628             :                             WarningBox aWarningBox (
    1629             :                                 GetParentWindow(),
    1630             :                                 WinBits( WB_OK ),
    1631           0 :                                 SD_RESSTR(STR_WARN_NAME_DUPLICATE));
    1632           0 :                             aWarningBox.Execute();
    1633             :                         }
    1634             :                         else
    1635           0 :                             bLoop = false;
    1636             :                     }
    1637           0 :                     switch (nRet)
    1638             :                     {
    1639             :                         case RET_OK :
    1640           0 :                             aLayerTitle  = ((SdAttrLayerTitle &) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue ();
    1641           0 :                             aLayerDesc   = ((SdAttrLayerDesc &) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue ();
    1642           0 :                             bIsVisible   = ((const SdAttrLayerVisible &) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
    1643           0 :                             bIsLocked    = ((const SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue ();
    1644           0 :                             bIsPrintable = ((const SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue ();
    1645           0 :                             break;
    1646             : 
    1647             :                         default :
    1648           0 :                             pDlg.reset();
    1649           0 :                             rReq.Ignore ();
    1650           0 :                             Cancel ();
    1651           0 :                             return;
    1652             :                     }
    1653           0 :                 }
    1654             :             }
    1655           0 :             else if (pArgs->Count () == 4)
    1656             :             {
    1657           0 :                 SFX_REQUEST_ARG (rReq, pLayerName, SfxStringItem, ID_VAL_LAYERNAME, false);
    1658           0 :                 SFX_REQUEST_ARG (rReq, pIsVisible, SfxBoolItem, ID_VAL_ISVISIBLE, false);
    1659           0 :                 SFX_REQUEST_ARG (rReq, pIsLocked, SfxBoolItem, ID_VAL_ISLOCKED, false);
    1660           0 :                 SFX_REQUEST_ARG (rReq, pIsPrintable, SfxBoolItem, ID_VAL_ISPRINTABLE, false);
    1661             : 
    1662           0 :                 aLayerName   = pLayerName->GetValue ();
    1663           0 :                 bIsVisible   = pIsVisible->GetValue ();
    1664           0 :                 bIsLocked    = pIsLocked->GetValue ();
    1665           0 :                 bIsPrintable = pIsPrintable->GetValue ();
    1666             :             }
    1667             :             else
    1668             :             {
    1669             : #if HAVE_FEATURE_SCRIPTING
    1670           0 :                 StarBASIC::FatalError (SbERR_WRONG_ARGS);
    1671             : #endif
    1672           0 :                 Cancel ();
    1673           0 :                 rReq.Ignore ();
    1674           0 :                 break;
    1675             :             }
    1676             : 
    1677           0 :             ::svl::IUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager();
    1678             :             SdLayerModifyUndoAction* pAction = new SdLayerModifyUndoAction(
    1679           0 :                 GetDoc(),
    1680             :                 pLayer,
    1681             :                 // old values
    1682             :                 aOldLayerName,
    1683             :                 aOldLayerTitle,
    1684             :                 aOldLayerDesc,
    1685             :                 bOldIsVisible,
    1686             :                 bOldIsLocked,
    1687             :                 bOldIsPrintable,
    1688             :                 // new values
    1689             :                 aLayerName,
    1690             :                 aLayerTitle,
    1691             :                 aLayerDesc,
    1692             :                 bIsVisible,
    1693             :                 bIsLocked,
    1694             :                 bIsPrintable
    1695           0 :                 );
    1696           0 :             pManager->AddUndoAction( pAction );
    1697             : 
    1698           0 :             ModifyLayer( pLayer, aLayerName, aLayerTitle, aLayerDesc, bIsVisible, bIsLocked, bIsPrintable );
    1699             : 
    1700           0 :             Cancel();
    1701           0 :             rReq.Done ();
    1702             :         }
    1703           0 :         break;
    1704             : 
    1705             :         case SID_RENAMELAYER:
    1706             :         {
    1707           0 :             if ( mpDrawView->IsTextEdit() )
    1708             :             {
    1709           0 :                 mpDrawView->SdrEndTextEdit();
    1710             :             }
    1711             : 
    1712           0 :             if(GetLayerTabControl()) // #i87182#
    1713             :             {
    1714           0 :                 GetLayerTabControl()->StartEditMode(GetLayerTabControl()->GetCurPageId());
    1715             :             }
    1716             :             else
    1717             :             {
    1718             :                 OSL_ENSURE(false, "No LayerTabBar (!)");
    1719             :             }
    1720             : 
    1721           0 :             Cancel();
    1722           0 :             rReq.Ignore ();
    1723             :         }
    1724           0 :         break;
    1725             : 
    1726             :         case SID_EDIT_HYPERLINK :
    1727             :         {
    1728           0 :             GetViewFrame()->GetDispatcher()->Execute( SID_HYPERLINK_DIALOG );
    1729             : 
    1730           0 :             Cancel();
    1731           0 :             rReq.Done ();
    1732             :         }
    1733           0 :         break;
    1734             : 
    1735             :         case SID_OPEN_HYPERLINK:
    1736             :         {
    1737           0 :             OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
    1738           0 :             if ( pOutView )
    1739             :             {
    1740           0 :                 const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
    1741           0 :                 if ( pFieldItem )
    1742             :                 {
    1743           0 :                     const SvxFieldData* pField = pFieldItem->GetField();
    1744           0 :                     if( pField && pField->ISA( SvxURLField ) )
    1745             :                     {
    1746           0 :                         const SvxURLField* pURLField = static_cast< const SvxURLField* >( pField );
    1747             : 
    1748           0 :                         SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() );
    1749           0 :                         SfxStringItem aTarget( SID_TARGETNAME, pURLField->GetTargetFrame() );
    1750             : 
    1751           0 :                         OUString aReferName;
    1752           0 :                         SfxViewFrame* pFrame = GetViewFrame();
    1753           0 :                         SfxMedium* pMed = pFrame->GetObjectShell()->GetMedium();
    1754           0 :                         if (pMed)
    1755           0 :                             aReferName = pMed->GetName();
    1756             : 
    1757           0 :                         SfxFrameItem aFrm( SID_DOCFRAME, pFrame );
    1758           0 :                         SfxStringItem aReferer( SID_REFERER, aReferName );
    1759             : 
    1760           0 :                         SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
    1761           0 :                         SfxBoolItem aBrowsing( SID_BROWSE, true );
    1762             : 
    1763           0 :                         SfxViewFrame* pViewFrm = SfxViewFrame::Current();
    1764           0 :                         if (pViewFrm)
    1765             :                             pViewFrm->GetDispatcher()->Execute( SID_OPENDOC,
    1766             :                                                         SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
    1767             :                                                         &aUrl, &aTarget,
    1768             :                                                         &aFrm, &aReferer,
    1769             :                                                         &aNewView, &aBrowsing,
    1770           0 :                                                         0L );
    1771             :                     }
    1772             :                 }
    1773             :             }
    1774           0 :             Cancel();
    1775           0 :             rReq.Done ();
    1776             :         }
    1777           0 :         break;
    1778             : 
    1779             :         case SID_HYPERLINK_SETLINK:
    1780             :         {
    1781           0 :             const SfxItemSet* pReqArgs = rReq.GetArgs();
    1782             : 
    1783           0 :             if (pReqArgs)
    1784             :             {
    1785             :                 SvxHyperlinkItem* pHLItem =
    1786           0 :                 (SvxHyperlinkItem*) &pReqArgs->Get(SID_HYPERLINK_SETLINK);
    1787             : 
    1788           0 :                 if (pHLItem->GetInsertMode() == HLINK_FIELD)
    1789             :                 {
    1790           0 :                     InsertURLField(pHLItem->GetURL(), pHLItem->GetName(),
    1791           0 :                                    pHLItem->GetTargetFrame(), NULL);
    1792             :                 }
    1793           0 :                 else if (pHLItem->GetInsertMode() == HLINK_BUTTON)
    1794             :                 {
    1795           0 :                     InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(),
    1796           0 :                                     pHLItem->GetTargetFrame(), NULL);
    1797             :                 }
    1798           0 :                 else if (pHLItem->GetInsertMode() == HLINK_DEFAULT)
    1799             :                 {
    1800           0 :                     OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
    1801             : 
    1802           0 :                     if (pOlView)
    1803             :                     {
    1804           0 :                         InsertURLField(pHLItem->GetURL(), pHLItem->GetName(),
    1805           0 :                                        pHLItem->GetTargetFrame(), NULL);
    1806             :                     }
    1807             :                     else
    1808             :                     {
    1809           0 :                         InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(),
    1810           0 :                                         pHLItem->GetTargetFrame(), NULL);
    1811             :                     }
    1812             :                 }
    1813             :             }
    1814             : 
    1815           0 :             Cancel();
    1816           0 :             rReq.Ignore ();
    1817             :         }
    1818           0 :         break;
    1819             : 
    1820             :         case SID_HIDE_LAST_LEVEL:
    1821             :         {
    1822           0 :             ESelection aSel;
    1823             :             // fdo#78151 editing a PRESOBJ_OUTLINE in a master page ?
    1824           0 :             ::Outliner* pOL = GetOutlinerForMasterPageOutlineTextObj(aSel);
    1825           0 :             if (pOL)
    1826             :             {
    1827             :                 //we are on the last paragraph
    1828           0 :                 aSel.Adjust();
    1829           0 :                 if (aSel.nEndPara == pOL->GetParagraphCount() - 1)
    1830             :                 {
    1831           0 :                     sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara);
    1832             :                     //there exists a previous numbering level
    1833           0 :                     if (nDepth != sal_uInt16(-1) && nDepth > 0)
    1834             :                     {
    1835           0 :                         Paragraph* pPara = pOL->GetParagraph(aSel.nEndPara);
    1836           0 :                         pOL->Remove(pPara, 1);
    1837             :                     }
    1838             :                 }
    1839             :             }
    1840           0 :             Cancel();
    1841           0 :             rReq.Done ();
    1842             :         }
    1843           0 :         break;
    1844             : 
    1845             :         case SID_SHOW_NEXT_LEVEL:
    1846             :         {
    1847           0 :             ESelection aSel;
    1848             :             // fdo#78151 editing a PRESOBJ_OUTLINE in a master page ?
    1849           0 :             ::Outliner* pOL = GetOutlinerForMasterPageOutlineTextObj(aSel);
    1850           0 :             if (pOL)
    1851             :             {
    1852             :                 //we are on the last paragraph
    1853           0 :                 aSel.Adjust();
    1854           0 :                 if (aSel.nEndPara == pOL->GetParagraphCount() - 1)
    1855             :                 {
    1856           0 :                     sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara);
    1857             :                     //there exists a previous numbering level
    1858           0 :                     if (nDepth != sal_uInt16(-1) && nDepth < 8)
    1859             :                     {
    1860           0 :                         sal_uInt16 nNewDepth = nDepth+1;
    1861           0 :                         pOL->Insert(SD_RESSTR(STR_PRESOBJ_MPOUTLINE+nNewDepth), EE_PARA_APPEND, nNewDepth);
    1862             :                     }
    1863             :                 }
    1864             :             }
    1865           0 :             Cancel();
    1866           0 :             rReq.Done ();
    1867             :         }
    1868           0 :         break;
    1869             : 
    1870             :         case SID_INSERT_FLD_DATE_FIX:
    1871             :         case SID_INSERT_FLD_DATE_VAR:
    1872             :         case SID_INSERT_FLD_TIME_FIX:
    1873             :         case SID_INSERT_FLD_TIME_VAR:
    1874             :         case SID_INSERT_FLD_AUTHOR:
    1875             :         case SID_INSERT_FLD_PAGE:
    1876             :         case SID_INSERT_FLD_PAGE_TITLE:
    1877             :         case SID_INSERT_FLD_PAGES:
    1878             :         case SID_INSERT_FLD_FILE:
    1879             :         {
    1880           0 :             sal_uInt16 nMul = 1;
    1881           0 :             boost::scoped_ptr<SvxFieldItem> pFieldItem;
    1882             : 
    1883           0 :             switch( nSId )
    1884             :             {
    1885             :                 case SID_INSERT_FLD_DATE_FIX:
    1886             :                     pFieldItem.reset(new SvxFieldItem(
    1887           0 :                         SvxDateField( Date( Date::SYSTEM ), SVXDATETYPE_FIX ), EE_FEATURE_FIELD ));
    1888           0 :                 break;
    1889             : 
    1890             :                 case SID_INSERT_FLD_DATE_VAR:
    1891           0 :                     pFieldItem.reset(new SvxFieldItem( SvxDateField(), EE_FEATURE_FIELD ));
    1892           0 :                 break;
    1893             : 
    1894             :                 case SID_INSERT_FLD_TIME_FIX:
    1895             :                     pFieldItem.reset(new SvxFieldItem(
    1896           0 :                         SvxExtTimeField( ::tools::Time( ::tools::Time::SYSTEM ), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD ));
    1897           0 :                 break;
    1898             : 
    1899             :                 case SID_INSERT_FLD_TIME_VAR:
    1900           0 :                     pFieldItem.reset(new SvxFieldItem( SvxExtTimeField(), EE_FEATURE_FIELD ));
    1901           0 :                 break;
    1902             : 
    1903             :                 case SID_INSERT_FLD_AUTHOR:
    1904             :                 {
    1905           0 :                     SvtUserOptions aUserOptions;
    1906             :                     pFieldItem.reset(new SvxFieldItem(
    1907             :                             SvxAuthorField(
    1908           0 :                                 aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() ), EE_FEATURE_FIELD ));
    1909             :                 }
    1910           0 :                 break;
    1911             : 
    1912             :                 case SID_INSERT_FLD_PAGE:
    1913             :                 {
    1914           0 :                     pFieldItem.reset(new SvxFieldItem( SvxPageField(), EE_FEATURE_FIELD ));
    1915           0 :                     nMul = 3;
    1916             :                 }
    1917           0 :                 break;
    1918             : 
    1919             :                 case SID_INSERT_FLD_PAGE_TITLE:
    1920             :                 {
    1921           0 :                     pFieldItem.reset(new SvxFieldItem( SvxPageTitleField(), EE_FEATURE_FIELD));
    1922           0 :                     nMul = 3;
    1923             :                 }
    1924           0 :                 break;
    1925             : 
    1926             :                 case SID_INSERT_FLD_PAGES:
    1927             :                 {
    1928           0 :                     pFieldItem.reset(new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD ));
    1929           0 :                     nMul = 3;
    1930             :                 }
    1931           0 :                 break;
    1932             : 
    1933             :                 case SID_INSERT_FLD_FILE:
    1934             :                 {
    1935           0 :                     OUString aName;
    1936           0 :                     if( GetDocSh()->HasName() )
    1937           0 :                         aName = GetDocSh()->GetMedium()->GetName();
    1938           0 :                     pFieldItem.reset(new SvxFieldItem( SvxExtFileField( aName ), EE_FEATURE_FIELD ));
    1939             :                 }
    1940           0 :                 break;
    1941             :             }
    1942             : 
    1943           0 :             OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
    1944             : 
    1945           0 :             if( pOLV )
    1946             :             {
    1947           0 :                 const SvxFieldItem* pOldFldItem = pOLV->GetFieldAtSelection();
    1948             : 
    1949           0 :                 if( pOldFldItem && ( pOldFldItem->GetField()->ISA( SvxURLField ) ||
    1950           0 :                                     pOldFldItem->GetField()->ISA( SvxDateField ) ||
    1951           0 :                                     pOldFldItem->GetField()->ISA( SvxTimeField ) ||
    1952           0 :                                     pOldFldItem->GetField()->ISA( SvxExtTimeField ) ||
    1953           0 :                                     pOldFldItem->GetField()->ISA( SvxExtFileField ) ||
    1954           0 :                                     pOldFldItem->GetField()->ISA( SvxAuthorField ) ||
    1955           0 :                                     pOldFldItem->GetField()->ISA( SvxPageField ) ) )
    1956             :                 {
    1957             :                     // select field, then it will be deleted when inserting
    1958           0 :                     ESelection aSel = pOLV->GetSelection();
    1959           0 :                     if( aSel.nStartPos == aSel.nEndPos )
    1960           0 :                         aSel.nEndPos++;
    1961           0 :                     pOLV->SetSelection( aSel );
    1962             :                 }
    1963             : 
    1964           0 :                 if( pFieldItem )
    1965           0 :                     pOLV->InsertField( *pFieldItem );
    1966             :             }
    1967             :             else
    1968             :             {
    1969           0 :                 Outliner* pOutl = GetDoc()->GetInternalOutliner();
    1970           0 :                 pOutl->Init( OUTLINERMODE_TEXTOBJECT );
    1971           0 :                 sal_uInt16 nOutlMode = pOutl->GetMode();
    1972           0 :                 pOutl->SetStyleSheet( 0, NULL );
    1973           0 :                 pOutl->QuickInsertField( *pFieldItem, ESelection() );
    1974           0 :                 OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
    1975             : 
    1976           0 :                 SdrRectObj* pRectObj = new SdrRectObj( OBJ_TEXT );
    1977           0 :                 pRectObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(true));
    1978             : 
    1979           0 :                 pOutl->UpdateFields();
    1980           0 :                 pOutl->SetUpdateMode( true );
    1981           0 :                 Size aSize( pOutl->CalcTextSize() );
    1982           0 :                 aSize.Width() *= nMul;
    1983           0 :                 pOutl->SetUpdateMode( false );
    1984             : 
    1985           0 :                 Point aPos;
    1986           0 :                 Rectangle aRect( aPos, GetActiveWindow()->GetOutputSizePixel() );
    1987           0 :                 aPos = aRect.Center();
    1988           0 :                 aPos = GetActiveWindow()->PixelToLogic(aPos);
    1989           0 :                 aPos.X() -= aSize.Width() / 2;
    1990           0 :                 aPos.Y() -= aSize.Height() / 2;
    1991             : 
    1992           0 :                 Rectangle aLogicRect(aPos, aSize);
    1993           0 :                 pRectObj->SetLogicRect(aLogicRect);
    1994           0 :                 pRectObj->SetOutlinerParaObject( pOutlParaObject );
    1995           0 :                 mpDrawView->InsertObjectAtView(pRectObj, *mpDrawView->GetSdrPageView());
    1996           0 :                 pOutl->Init( nOutlMode );
    1997             :             }
    1998             : 
    1999           0 :             pFieldItem.reset();
    2000             : 
    2001           0 :             Cancel();
    2002           0 :             rReq.Ignore ();
    2003             :         }
    2004           0 :         break;
    2005             : 
    2006             :         case SID_MODIFY_FIELD:
    2007             :         {
    2008           0 :             OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
    2009             : 
    2010           0 :             if( pOLV )
    2011             :             {
    2012           0 :                 const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection();
    2013             : 
    2014           0 :                 if( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) ||
    2015           0 :                                  pFldItem->GetField()->ISA( SvxAuthorField ) ||
    2016           0 :                                  pFldItem->GetField()->ISA( SvxExtFileField ) ||
    2017           0 :                                  pFldItem->GetField()->ISA( SvxExtTimeField ) ) )
    2018             :                 {
    2019             :                     // Dialog...
    2020           0 :                     SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
    2021           0 :                     boost::scoped_ptr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOLV->GetAttribs() ) : 0);
    2022           0 :                     if( pDlg && pDlg->Execute() == RET_OK )
    2023             :                     {
    2024             :                         // To make a correct SetAttribs() call at the utlinerView
    2025             :                         // it is necessary to split the actions here
    2026           0 :                         boost::scoped_ptr<SvxFieldData> pField(pDlg->GetField());
    2027           0 :                         ESelection aSel = pOLV->GetSelection();
    2028           0 :                         bool bSelectionWasModified(false);
    2029             : 
    2030           0 :                         if( pField )
    2031             :                         {
    2032           0 :                             SvxFieldItem aFieldItem( *pField, EE_FEATURE_FIELD );
    2033             : 
    2034           0 :                             if( aSel.nStartPos == aSel.nEndPos )
    2035             :                             {
    2036           0 :                                 bSelectionWasModified = true;
    2037           0 :                                 aSel.nEndPos++;
    2038           0 :                                 pOLV->SetSelection( aSel );
    2039             :                             }
    2040             : 
    2041           0 :                             pOLV->InsertField( aFieldItem );
    2042             : 
    2043             :                             // select again for eventual SetAttribs call
    2044           0 :                             pOLV->SetSelection( aSel );
    2045             :                         }
    2046             : 
    2047           0 :                         SfxItemSet aSet( pDlg->GetItemSet() );
    2048             : 
    2049           0 :                         if( aSet.Count() )
    2050             :                         {
    2051           0 :                             pOLV->SetAttribs( aSet );
    2052             : 
    2053           0 :                             ::Outliner* pOutliner = pOLV->GetOutliner();
    2054           0 :                             if( pOutliner )
    2055           0 :                                 pOutliner->UpdateFields();
    2056             :                         }
    2057             : 
    2058           0 :                         if(pField)
    2059             :                         {
    2060             :                             // restore selection to original
    2061           0 :                             if(bSelectionWasModified)
    2062             :                             {
    2063           0 :                                 aSel.nEndPos--;
    2064           0 :                                 pOLV->SetSelection( aSel );
    2065             :                             }
    2066           0 :                         }
    2067           0 :                     }
    2068             :                 }
    2069             :             }
    2070             : 
    2071           0 :             Cancel();
    2072           0 :             rReq.Ignore ();
    2073             :         }
    2074           0 :         break;
    2075             : 
    2076             :         case SID_OPEN_XML_FILTERSETTINGS:
    2077             :         {
    2078             :             try
    2079             :             {
    2080           0 :                 css::uno::Reference < css::ui::dialogs::XExecutableDialog > xDialog = css::ui::dialogs::XSLTFilterDialog::create( ::comphelper::getProcessComponentContext() );
    2081           0 :                 xDialog->execute();
    2082             :             }
    2083           0 :             catch( ::com::sun::star::uno::RuntimeException& )
    2084             :             {
    2085             :                 DBG_UNHANDLED_EXCEPTION();
    2086             :             }
    2087             : 
    2088           0 :             Cancel();
    2089           0 :             rReq.Ignore ();
    2090             :         }
    2091           0 :         break;
    2092             : 
    2093             :         case SID_GROUP:  // BASIC
    2094             :         {
    2095           0 :             if ( mpDrawView->IsPresObjSelected( true, true, true ) )
    2096             :             {
    2097           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2098           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2099             :             }
    2100             :             else
    2101             :             {
    2102           0 :                 mpDrawView->GroupMarked();
    2103             :             }
    2104           0 :             Cancel();
    2105           0 :             rReq.Done ();
    2106             :         }
    2107           0 :         break;
    2108             : 
    2109             :         case SID_UNGROUP:  // BASIC
    2110             :         {
    2111           0 :             mpDrawView->UnGroupMarked();
    2112           0 :             Cancel();
    2113           0 :             rReq.Done ();
    2114             :         }
    2115           0 :         break;
    2116             : 
    2117             :         case SID_NAME_GROUP:
    2118             :         {
    2119             :             // only allow for single object selection since the name of an object needs
    2120             :             // to be unique
    2121           0 :             if(1 == mpDrawView->GetMarkedObjectCount())
    2122             :             {
    2123             :                 // #i68101#
    2124           0 :                 SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0);
    2125             :                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
    2126           0 :                 OUString aName(pSelected->GetName());
    2127             : 
    2128           0 :                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
    2129             :                 OSL_ENSURE(pFact, "Dialog creation failed!");
    2130           0 :                 boost::scoped_ptr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(NULL, aName));
    2131             :                 OSL_ENSURE(pDlg, "Dialog creation failed!");
    2132             : 
    2133           0 :                 pDlg->SetCheckNameHdl(LINK(this, DrawViewShell, NameObjectHdl));
    2134             : 
    2135           0 :                 if(RET_OK == pDlg->Execute())
    2136             :                 {
    2137           0 :                     pDlg->GetName(aName);
    2138           0 :                     pSelected->SetName(aName);
    2139           0 :                 }
    2140             :             }
    2141             : 
    2142           0 :             SfxBindings& rBindings = GetViewFrame()->GetBindings();
    2143           0 :             rBindings.Invalidate( SID_NAVIGATOR_STATE, true, false );
    2144           0 :             rBindings.Invalidate( SID_CONTEXT );
    2145             : 
    2146           0 :             Cancel();
    2147           0 :             rReq.Ignore();
    2148           0 :             break;
    2149             :         }
    2150             : 
    2151             :         // #i68101#
    2152             :         case SID_OBJECT_TITLE_DESCRIPTION:
    2153             :         {
    2154           0 :             if(1 == mpDrawView->GetMarkedObjectCount())
    2155             :             {
    2156           0 :                 SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0);
    2157             :                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
    2158           0 :                 OUString aTitle(pSelected->GetTitle());
    2159           0 :                 OUString aDescription(pSelected->GetDescription());
    2160             : 
    2161           0 :                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
    2162             :                 OSL_ENSURE(pFact, "Dialog creation failed!");
    2163           0 :                 boost::scoped_ptr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription));
    2164             :                 OSL_ENSURE(pDlg, "Dialog creation failed!");
    2165             : 
    2166           0 :                 if(RET_OK == pDlg->Execute())
    2167             :                 {
    2168           0 :                     pDlg->GetTitle(aTitle);
    2169           0 :                     pDlg->GetDescription(aDescription);
    2170           0 :                     pSelected->SetTitle(aTitle);
    2171           0 :                     pSelected->SetDescription(aDescription);
    2172           0 :                 }
    2173             :             }
    2174             : 
    2175           0 :             SfxBindings& rBindings = GetViewFrame()->GetBindings();
    2176           0 :             rBindings.Invalidate( SID_NAVIGATOR_STATE, true, false );
    2177           0 :             rBindings.Invalidate( SID_CONTEXT );
    2178             : 
    2179           0 :             Cancel();
    2180           0 :             rReq.Ignore();
    2181           0 :             break;
    2182             :         }
    2183             : 
    2184             :         case SID_ENTER_GROUP:  // BASIC
    2185             :         {
    2186           0 :             mpDrawView->EnterMarkedGroup();
    2187           0 :             Cancel();
    2188           0 :             rReq.Done ();
    2189             :         }
    2190           0 :         break;
    2191             : 
    2192             :         case SID_LEAVE_GROUP:  // BASIC
    2193             :         {
    2194           0 :             mpDrawView->LeaveOneGroup();
    2195           0 :             Cancel();
    2196           0 :             rReq.Done ();
    2197             :         }
    2198           0 :         break;
    2199             : 
    2200             :         case SID_LEAVE_ALL_GROUPS:  // BASIC
    2201             :         {
    2202           0 :             mpDrawView->LeaveAllGroup();
    2203           0 :             Cancel();
    2204           0 :             rReq.Done ();
    2205             :         }
    2206           0 :         break;
    2207             : 
    2208             :         case SID_COMBINE:  // BASIC
    2209             :         {
    2210             :             // End text edit to avoid conflicts
    2211           0 :             if(mpDrawView->IsTextEdit())
    2212           0 :                 mpDrawView->SdrEndTextEdit();
    2213             : 
    2214           0 :             if ( mpDrawView->IsPresObjSelected() )
    2215             :             {
    2216           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2217           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2218             :             }
    2219             :             else
    2220             :             {
    2221           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2222           0 :                 mpDrawView->CombineMarkedObjects(false);
    2223             :             }
    2224           0 :             Cancel();
    2225           0 :             rReq.Done ();
    2226             :         }
    2227           0 :         break;
    2228             : 
    2229             :         case SID_DISTRIBUTE_DLG:
    2230             :         {
    2231           0 :             if ( mpDrawView->IsPresObjSelected() )
    2232             :             {
    2233           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2234           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2235             :             }
    2236             :             else
    2237             :             {
    2238           0 :                 mpDrawView->DistributeMarkedObjects();
    2239             :             }
    2240           0 :             Cancel();
    2241           0 :             rReq.Done ();
    2242             :         }
    2243           0 :         break;
    2244             : 
    2245             :         case SID_POLY_MERGE:
    2246             :         {
    2247             :             // End text edit to avoid conflicts
    2248           0 :             if(mpDrawView->IsTextEdit())
    2249           0 :                 mpDrawView->SdrEndTextEdit();
    2250             : 
    2251           0 :             if ( mpDrawView->IsPresObjSelected() )
    2252             :             {
    2253           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2254           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2255             :             }
    2256             :             else
    2257             :             {
    2258           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2259           0 :                 mpDrawView->MergeMarkedObjects(SDR_MERGE_MERGE);
    2260             :             }
    2261           0 :             Cancel();
    2262           0 :             rReq.Done ();
    2263             :         }
    2264           0 :         break;
    2265             : 
    2266             :         case SID_POLY_SUBSTRACT:
    2267             :         {
    2268             :             // End text edit to avoid conflicts
    2269           0 :             if(mpDrawView->IsTextEdit())
    2270           0 :                 mpDrawView->SdrEndTextEdit();
    2271             : 
    2272           0 :             if ( mpDrawView->IsPresObjSelected() )
    2273             :             {
    2274           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2275           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2276             :             }
    2277             :             else
    2278             :             {
    2279           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2280           0 :                 mpDrawView->MergeMarkedObjects(SDR_MERGE_SUBSTRACT);
    2281             :             }
    2282           0 :             Cancel();
    2283           0 :             rReq.Done ();
    2284             :         }
    2285           0 :         break;
    2286             : 
    2287             :         case SID_POLY_INTERSECT:
    2288             :         {
    2289             :             // End text edit to avoid conflicts
    2290           0 :             if(mpDrawView->IsTextEdit())
    2291           0 :                 mpDrawView->SdrEndTextEdit();
    2292             : 
    2293           0 :             if ( mpDrawView->IsPresObjSelected() )
    2294             :             {
    2295           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2296           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2297             :             }
    2298             :             else
    2299             :             {
    2300           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2301           0 :                 mpDrawView->MergeMarkedObjects(SDR_MERGE_INTERSECT);
    2302             :             }
    2303           0 :             Cancel();
    2304           0 :             rReq.Done ();
    2305             :         }
    2306           0 :         break;
    2307             : 
    2308             :         case SID_DISMANTLE:  // BASIC
    2309             :         {
    2310           0 :             if ( mpDrawView->IsDismantlePossible(false) )
    2311             :             {
    2312           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2313           0 :                 mpDrawView->DismantleMarkedObjects(false);
    2314             :             }
    2315           0 :             Cancel();
    2316           0 :             rReq.Done ();
    2317             :         }
    2318           0 :         break;
    2319             : 
    2320             :         case SID_CONNECT:  // BASIC
    2321             :         {
    2322           0 :             if ( mpDrawView->IsPresObjSelected() )
    2323             :             {
    2324           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2325           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2326             :             }
    2327             :             else
    2328             :             {
    2329           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2330           0 :                 mpDrawView->CombineMarkedObjects(true);
    2331             :             }
    2332           0 :             Cancel();
    2333           0 :             rReq.Done ();
    2334             :         }
    2335           0 :         break;
    2336             : 
    2337             :         case SID_BREAK:  // BASIC
    2338             :         {
    2339           0 :             if ( mpDrawView->IsTextEdit() )
    2340             :             {
    2341           0 :                 mpDrawView->SdrEndTextEdit();
    2342             :             }
    2343             : 
    2344           0 :             if ( mpDrawView->IsBreak3DObjPossible() )
    2345             :             {
    2346           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2347           0 :                 mpDrawView->Break3DObj();
    2348             :             }
    2349           0 :             else if ( mpDrawView->IsDismantlePossible(true) )
    2350             :             {
    2351           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2352           0 :                 mpDrawView->DismantleMarkedObjects(true);
    2353             :             }
    2354           0 :             else if ( mpDrawView->IsImportMtfPossible() )
    2355             :             {
    2356           0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
    2357           0 :                 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
    2358           0 :                 const size_t nAnz=rMarkList.GetMarkCount();
    2359             : 
    2360             :                 // determine the sum of meta objects of all selected meta files
    2361           0 :                 sal_uLong nCount = 0;
    2362           0 :                 for(size_t nm=0; nm<nAnz; ++nm)
    2363             :                 {
    2364           0 :                     SdrMark*     pM=rMarkList.GetMark(nm);
    2365           0 :                     SdrObject*   pObj=pM->GetMarkedSdrObj();
    2366           0 :                     SdrGrafObj*  pGraf=PTR_CAST(SdrGrafObj,pObj);
    2367           0 :                     SdrOle2Obj*  pOle2=PTR_CAST(SdrOle2Obj,pObj);
    2368             : 
    2369           0 :                     if(pGraf)
    2370             :                     {
    2371           0 :                         if(pGraf->HasGDIMetaFile())
    2372             :                         {
    2373           0 :                             nCount += pGraf->GetGraphic().GetGDIMetaFile().GetActionSize();
    2374             :                         }
    2375           0 :                         else if(pGraf->isEmbeddedSvg())
    2376             :                         {
    2377           0 :                             nCount += pGraf->getMetafileFromEmbeddedSvg().GetActionSize();
    2378             :                         }
    2379             :                     }
    2380             : 
    2381           0 :                     if(pOle2 && pOle2->GetGraphic())
    2382             :                     {
    2383           0 :                          nCount += pOle2->GetGraphic()->GetGDIMetaFile().GetActionSize();
    2384             :                     }
    2385             :                 }
    2386             : 
    2387             :                 // decide with the sum of all meta objects if we should show a dialog
    2388           0 :                 if(nCount < MIN_ACTIONS_FOR_DIALOG)
    2389             :                 {
    2390             :                     // nope, no dialog
    2391           0 :                     mpDrawView->DoImportMarkedMtf();
    2392             :                 }
    2393             :                 else
    2394             :                 {
    2395           0 :                     SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
    2396           0 :                     if( pFact )
    2397             :                     {
    2398           0 :                         boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, static_cast<sal_uLong>(nAnz) ));
    2399           0 :                         if( pDlg )
    2400             :                         {
    2401           0 :                             pDlg->Execute();
    2402           0 :                         }
    2403             :                     }
    2404           0 :                 }
    2405             :             }
    2406             : 
    2407           0 :             Cancel();
    2408           0 :             rReq.Done ();
    2409             :         }
    2410           0 :         break;
    2411             : 
    2412             :         case SID_CONVERT_TO_3D:
    2413             :         {
    2414           0 :             if ( mpDrawView->IsPresObjSelected() )
    2415             :             {
    2416           0 :                 ::sd::Window* pWindow = GetActiveWindow();
    2417           0 :                 InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
    2418             :             }
    2419             :             else
    2420             :             {
    2421           0 :                 if (mpDrawView->IsConvertTo3DObjPossible())
    2422             :                 {
    2423           0 :                     if (mpDrawView->IsTextEdit())
    2424             :                     {
    2425           0 :                         mpDrawView->SdrEndTextEdit();
    2426             :                     }
    2427             : 
    2428           0 :                     WaitObject aWait( (Window*)GetActiveWindow() );
    2429           0 :                     mpDrawView->ConvertMarkedObjTo3D(true);
    2430             :                 }
    2431             :             }
    2432             : 
    2433           0 :             Cancel();
    2434           0 :             rReq.Done();
    2435             :         }
    2436           0 :         break;
    2437             : 
    2438             :         case SID_FRAME_TO_TOP:  // BASIC
    2439             :         {
    2440           0 :             mpDrawView->PutMarkedToTop();
    2441           0 :             Cancel();
    2442           0 :             Invalidate( SID_POSITION );
    2443           0 :             rReq.Done ();
    2444             :         }
    2445           0 :         break;
    2446             : 
    2447             :         case SID_MOREFRONT:  // BASIC
    2448             :         {
    2449           0 :             mpDrawView->MovMarkedToTop();
    2450           0 :             Cancel();
    2451           0 :             Invalidate( SID_POSITION );
    2452           0 :             rReq.Done ();
    2453             :         }
    2454           0 :         break;
    2455             : 
    2456             :         case SID_MOREBACK:  // BASIC
    2457             :         {
    2458           0 :             mpDrawView->MovMarkedToBtm();
    2459           0 :             Cancel();
    2460           0 :             Invalidate( SID_POSITION );
    2461           0 :             rReq.Done ();
    2462             :         }
    2463           0 :         break;
    2464             : 
    2465             :         case SID_FRAME_TO_BOTTOM:   // BASIC
    2466             :         {
    2467           0 :             mpDrawView->PutMarkedToBtm();
    2468           0 :             Cancel();
    2469           0 :             Invalidate( SID_POSITION );
    2470           0 :             rReq.Done ();
    2471             :         }
    2472           0 :         break;
    2473             : 
    2474             :         case SID_HORIZONTAL:  // BASIC
    2475             :         case SID_FLIP_HORIZONTAL:
    2476             :         {
    2477           0 :             mpDrawView->MirrorAllMarkedHorizontal();
    2478           0 :             Cancel();
    2479           0 :             rReq.Done ();
    2480             :         }
    2481           0 :         break;
    2482             : 
    2483             :         case SID_VERTICAL:  // BASIC
    2484             :         case SID_FLIP_VERTICAL:
    2485             :         {
    2486           0 :             mpDrawView->MirrorAllMarkedVertical();
    2487           0 :             Cancel();
    2488           0 :             rReq.Done ();
    2489             :         }
    2490           0 :         break;
    2491             : 
    2492             :         case SID_OBJECT_ALIGN_LEFT:  // BASIC
    2493             :         {
    2494           0 :             mpDrawView->AlignMarkedObjects(SDRHALIGN_LEFT, SDRVALIGN_NONE);
    2495           0 :             Cancel();
    2496           0 :             rReq.Done ();
    2497             :         }
    2498           0 :         break;
    2499             : 
    2500             :         case SID_OBJECT_ALIGN_CENTER:  // BASIC
    2501             :         {
    2502           0 :             mpDrawView->AlignMarkedObjects(SDRHALIGN_CENTER, SDRVALIGN_NONE);
    2503           0 :             Cancel();
    2504           0 :             rReq.Done ();
    2505             :         }
    2506           0 :         break;
    2507             : 
    2508             :         case SID_OBJECT_ALIGN_RIGHT:  // BASIC
    2509             :         {
    2510           0 :             mpDrawView->AlignMarkedObjects(SDRHALIGN_RIGHT, SDRVALIGN_NONE);
    2511           0 :             Cancel();
    2512           0 :             rReq.Done ();
    2513             :         }
    2514           0 :         break;
    2515             : 
    2516             :         case SID_OBJECT_ALIGN_UP:  // BASIC
    2517             :         {
    2518           0 :             mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_TOP);
    2519           0 :             Cancel();
    2520           0 :             rReq.Done ();
    2521             :         }
    2522           0 :         break;
    2523             : 
    2524             :         case SID_OBJECT_ALIGN_MIDDLE:  // BASIC
    2525             :         {
    2526           0 :             mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_CENTER);
    2527           0 :             Cancel();
    2528           0 :             rReq.Done ();
    2529             :         }
    2530           0 :         break;
    2531             : 
    2532             :         case SID_OBJECT_ALIGN_DOWN:  // BASIC
    2533             :         {
    2534           0 :             mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_BOTTOM);
    2535           0 :             Cancel();
    2536           0 :             rReq.Done ();
    2537             :         }
    2538           0 :         break;
    2539             : 
    2540             :         case SID_SELECTALL:  // BASIC
    2541             :         {
    2542           0 :             if( (dynamic_cast<FuSelection*>( GetOldFunction().get() ) != 0) &&
    2543           0 :                 !GetView()->IsFrameDragSingles() && GetView()->HasMarkablePoints())
    2544             :             {
    2545           0 :                 if ( !mpDrawView->IsAction() )
    2546           0 :                     mpDrawView->MarkAllPoints();
    2547             :             }
    2548             :             else
    2549           0 :                 mpDrawView->SelectAll();
    2550             : 
    2551           0 :             Cancel();
    2552           0 :             rReq.Done ();
    2553             :         }
    2554           0 :         break;
    2555             : 
    2556             :         case SID_STYLE_NEW: // BASIC ???
    2557             :         case SID_STYLE_APPLY:
    2558             :         case SID_STYLE_EDIT:
    2559             :         case SID_STYLE_DELETE:
    2560             :         case SID_STYLE_HIDE:
    2561             :         case SID_STYLE_SHOW:
    2562             :         case SID_STYLE_FAMILY:
    2563             :         case SID_STYLE_WATERCAN:
    2564             :         case SID_STYLE_UPDATE_BY_EXAMPLE:
    2565             :         case SID_STYLE_NEW_BY_EXAMPLE:
    2566             :         {
    2567           0 :             if( rReq.GetSlot() == SID_STYLE_EDIT && !rReq.GetArgs() )
    2568             :             {
    2569           0 :                 SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet();
    2570           0 :                 if( pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE)
    2571           0 :                     pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet();
    2572             : 
    2573           0 :                 if( (pStyleSheet == NULL) && GetView()->IsTextEdit() )
    2574             :                 {
    2575           0 :                     GetView()->SdrEndTextEdit();
    2576             : 
    2577           0 :                     pStyleSheet = mpDrawView->GetStyleSheet();
    2578           0 :                     if(pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE)
    2579           0 :                         pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet();
    2580             :                 }
    2581             : 
    2582           0 :                 if( pStyleSheet == NULL )
    2583             :                 {
    2584           0 :                     rReq.Ignore();
    2585           0 :                     break;
    2586             :                 }
    2587             : 
    2588           0 :                 SfxAllItemSet aSet(GetDoc()->GetPool());
    2589             : 
    2590           0 :                 SfxStringItem aStyleNameItem( SID_STYLE_EDIT, pStyleSheet->GetName() );
    2591           0 :                 aSet.Put(aStyleNameItem);
    2592             : 
    2593           0 :                 SfxUInt16Item aStyleFamilyItem( SID_STYLE_FAMILY, (sal_uInt16)pStyleSheet->GetFamily() );
    2594           0 :                 aSet.Put(aStyleFamilyItem);
    2595             : 
    2596           0 :                 rReq.SetArgs(aSet);
    2597             :             }
    2598             : 
    2599           0 :             if( rReq.GetArgs() )
    2600             :             {
    2601           0 :                 SetCurrentFunction( FuTemplate::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    2602           0 :                 if( rReq.GetSlot() == SID_STYLE_APPLY )
    2603           0 :                     GetViewFrame()->GetBindings().Invalidate( SID_STYLE_APPLY );
    2604           0 :                 Cancel();
    2605             :             }
    2606           0 :             else if( rReq.GetSlot() == SID_STYLE_APPLY )
    2607           0 :                 GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SfxCallMode::ASYNCHRON );
    2608           0 :             rReq.Ignore ();
    2609             :         }
    2610           0 :         break;
    2611             : 
    2612             :         case SID_IMAP:
    2613             :         {
    2614           0 :             sal_uInt16      nId = SvxIMapDlgChildWindow::GetChildWindowId();
    2615             : 
    2616           0 :             GetViewFrame()->ToggleChildWindow( nId );
    2617           0 :             GetViewFrame()->GetBindings().Invalidate( SID_IMAP );
    2618             : 
    2619           0 :             if ( GetViewFrame()->HasChildWindow( nId )
    2620           0 :                 && ( ( ViewShell::Implementation::GetImageMapDialog() ) != NULL ) )
    2621             :             {
    2622           0 :                 const SdrMarkList&  rMarkList = mpDrawView->GetMarkedObjectList();
    2623             : 
    2624           0 :                 if ( rMarkList.GetMarkCount() == 1 )
    2625           0 :                     UpdateIMapDlg( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
    2626             :             }
    2627             : 
    2628           0 :             Cancel();
    2629           0 :             rReq.Ignore ();
    2630             :         }
    2631           0 :         break;
    2632             : 
    2633             :         case SID_GRID_FRONT:
    2634             :         {
    2635           0 :             mpDrawView->SetGridFront( !mpDrawView->IsGridFront() );
    2636           0 :             Cancel();
    2637           0 :             rReq.Done ();
    2638             :         }
    2639           0 :         break;
    2640             : 
    2641             :         case SID_HELPLINES_FRONT:
    2642             :         {
    2643           0 :             mpDrawView->SetHlplFront( !mpDrawView->IsHlplFront() );
    2644           0 :             Cancel();
    2645           0 :             rReq.Done ();
    2646             :         }
    2647           0 :         break;
    2648             : 
    2649             :         case SID_FONTWORK:
    2650             :         {
    2651           0 :             if ( rReq.GetArgs() )
    2652             :             {
    2653           0 :                 GetViewFrame()->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
    2654           0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
    2655           0 :                                         Get(SID_FONTWORK))).GetValue());
    2656             :             }
    2657             :             else
    2658             :             {
    2659           0 :                 GetViewFrame()->ToggleChildWindow( SvxFontWorkChildWindow::GetChildWindowId() );
    2660             :             }
    2661             : 
    2662           0 :             GetViewFrame()->GetBindings().Invalidate(SID_FONTWORK);
    2663           0 :             Cancel();
    2664           0 :             rReq.Ignore ();
    2665             :         }
    2666           0 :         break;
    2667             : 
    2668             :         case SID_COLOR_CONTROL:
    2669             :         {
    2670           0 :             if ( rReq.GetArgs() )
    2671           0 :                 GetViewFrame()->SetChildWindow(SvxColorChildWindow::GetChildWindowId(),
    2672           0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
    2673           0 :                                         Get(SID_COLOR_CONTROL))).GetValue());
    2674             :             else
    2675           0 :                 GetViewFrame()->ToggleChildWindow(SvxColorChildWindow::GetChildWindowId() );
    2676             : 
    2677           0 :             GetViewFrame()->GetBindings().Invalidate(SID_COLOR_CONTROL);
    2678           0 :             Cancel();
    2679           0 :             rReq.Ignore ();
    2680             :         }
    2681           0 :         break;
    2682             : 
    2683             :         case SID_EXTRUSION_TOOGLE:
    2684             :         case SID_EXTRUSION_TILT_DOWN:
    2685             :         case SID_EXTRUSION_TILT_UP:
    2686             :         case SID_EXTRUSION_TILT_LEFT:
    2687             :         case SID_EXTRUSION_TILT_RIGHT:
    2688             :         case SID_EXTRUSION_3D_COLOR:
    2689             :         case SID_EXTRUSION_DEPTH:
    2690             :         case SID_EXTRUSION_DIRECTION:
    2691             :         case SID_EXTRUSION_PROJECTION:
    2692             :         case SID_EXTRUSION_LIGHTING_DIRECTION:
    2693             :         case SID_EXTRUSION_LIGHTING_INTENSITY:
    2694             :         case SID_EXTRUSION_SURFACE:
    2695             :         case SID_EXTRUSION_DEPTH_FLOATER:
    2696             :         case SID_EXTRUSION_DIRECTION_FLOATER:
    2697             :         case SID_EXTRUSION_LIGHTING_FLOATER:
    2698             :         case SID_EXTRUSION_SURFACE_FLOATER:
    2699             :         case SID_EXTRUSION_DEPTH_DIALOG:
    2700           0 :             svx::ExtrusionBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
    2701           0 :             Cancel();
    2702           0 :             rReq.Ignore ();
    2703           0 :             break;
    2704             : 
    2705             :         case SID_FONTWORK_SHAPE:
    2706             :         case SID_FONTWORK_SHAPE_TYPE:
    2707             :         case SID_FONTWORK_ALIGNMENT:
    2708             :         case SID_FONTWORK_SAME_LETTER_HEIGHTS:
    2709             :         case SID_FONTWORK_CHARACTER_SPACING:
    2710             :         case SID_FONTWORK_KERN_CHARACTER_PAIRS:
    2711             :         case SID_FONTWORK_GALLERY_FLOATER:
    2712             :         case SID_FONTWORK_CHARACTER_SPACING_FLOATER:
    2713             :         case SID_FONTWORK_ALIGNMENT_FLOATER:
    2714             :         case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
    2715           0 :             svx::FontworkBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
    2716           0 :             Cancel();
    2717           0 :             rReq.Ignore ();
    2718           0 :             break;
    2719             : 
    2720             :         case SID_BMPMASK:
    2721             :         {
    2722           0 :             GetViewFrame()->ToggleChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() );
    2723           0 :             GetViewFrame()->GetBindings().Invalidate( SID_BMPMASK );
    2724             : 
    2725           0 :             Cancel();
    2726           0 :             rReq.Ignore ();
    2727             :         }
    2728           0 :         break;
    2729             : 
    2730             :         case SID_NAVIGATOR:
    2731             :         {
    2732           0 :             if ( rReq.GetArgs() )
    2733             :                 GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
    2734           0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
    2735           0 :                                         Get(SID_NAVIGATOR))).GetValue());
    2736             :             else
    2737           0 :                 GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
    2738             : 
    2739           0 :             GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
    2740           0 :             Cancel();
    2741           0 :             rReq.Ignore ();
    2742             :         }
    2743           0 :         break;
    2744             : 
    2745             :         case SID_SLIDE_TRANSITIONS_PANEL:
    2746             :         case SID_CUSTOM_ANIMATION_PANEL:
    2747             :         case SID_GALLERY:
    2748             :         {
    2749             :             // First make sure that the sidebar is visible
    2750           0 :             GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
    2751             : 
    2752           0 :             OUString panelId;
    2753           0 :             if (nSId == SID_CUSTOM_ANIMATION_PANEL)
    2754           0 :                 panelId = CustomAnimationPanelId;
    2755           0 :             else if (nSId == SID_GALLERY)
    2756           0 :                 panelId = GalleryPanelId;
    2757           0 :             else if (nSId == SID_SLIDE_TRANSITIONS_PANEL)
    2758           0 :                 panelId = SlideTransitionPanelId;
    2759             : 
    2760             :             ::sfx2::sidebar::Sidebar::ShowPanel(
    2761             :                 panelId,
    2762           0 :                 GetViewFrame()->GetFrame().GetFrameInterface());
    2763             : 
    2764           0 :             Cancel();
    2765           0 :             rReq.Done();
    2766             :         }
    2767           0 :         break;
    2768             : 
    2769             :         case SID_ANIMATION_OBJECTS:
    2770             :         {
    2771           0 :             if ( rReq.GetArgs() )
    2772             :                 GetViewFrame()->SetChildWindow(
    2773           0 :                     AnimationChildWindow::GetChildWindowId(),
    2774           0 :                     ((const SfxBoolItem&) (rReq.GetArgs()->
    2775           0 :                         Get(SID_ANIMATION_OBJECTS))).GetValue());
    2776             :             else
    2777             :                 GetViewFrame()->ToggleChildWindow(
    2778           0 :                     AnimationChildWindow::GetChildWindowId() );
    2779             : 
    2780           0 :             GetViewFrame()->GetBindings().Invalidate(SID_ANIMATION_OBJECTS);
    2781           0 :             Cancel();
    2782           0 :             rReq.Ignore ();
    2783             :         }
    2784           0 :         break;
    2785             : 
    2786             :         case SID_3D_WIN:
    2787             :         {
    2788           0 :             if ( rReq.GetArgs() )
    2789           0 :                 GetViewFrame()->SetChildWindow( Svx3DChildWindow::GetChildWindowId(),
    2790           0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
    2791           0 :                                         Get( SID_3D_WIN ))).GetValue());
    2792             :             else
    2793           0 :                 GetViewFrame()->ToggleChildWindow( Svx3DChildWindow::GetChildWindowId() );
    2794             : 
    2795           0 :             GetViewFrame()->GetBindings().Invalidate( SID_3D_WIN );
    2796           0 :             Cancel();
    2797           0 :             rReq.Ignore ();
    2798             :         }
    2799           0 :         break;
    2800             : 
    2801             :         case SID_CONVERT_TO_3D_LATHE_FAST:
    2802             :         {
    2803             :             /* The call is enough. The initialization via Start3DCreation and
    2804             :                CreateMirrorPolygons is no longer needed if the parameter
    2805             :                sal_True is provided. Then a tilted rotary body with an axis left
    2806             :                besides the bounding rectangle of the selected objects is drawn
    2807             :                immediately and without user interaction.  */
    2808           0 :             mpDrawView->SdrEndTextEdit();
    2809           0 :             if(GetActiveWindow())
    2810           0 :                 GetActiveWindow()->EnterWait();
    2811           0 :             mpDrawView->End3DCreation(true);
    2812           0 :             Cancel();
    2813           0 :             rReq.Ignore();
    2814           0 :             if(GetActiveWindow())
    2815           0 :                 GetActiveWindow()->LeaveWait();
    2816             :         }
    2817           0 :         break;
    2818             : 
    2819             :         case SID_PRESENTATION_DLG:
    2820             :         {
    2821           0 :             SetCurrentFunction( FuSlideShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    2822           0 :             Cancel();
    2823             :         }
    2824           0 :         break;
    2825             : 
    2826             :         case SID_REMOTE_DLG:
    2827             :         {
    2828             : #ifdef ENABLE_SDREMOTE
    2829           0 :              SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
    2830           0 :              VclAbstractDialog* pDlg = pFact ? pFact->CreateRemoteDialog(GetActiveWindow()) : 0;
    2831           0 :              if (pDlg)
    2832           0 :                  pDlg->Execute();
    2833             : #endif
    2834             :         }
    2835           0 :         break;
    2836             : 
    2837             :         case SID_CUSTOMSHOW_DLG:
    2838             :         {
    2839           0 :             SetCurrentFunction( FuCustomShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    2840           0 :             Cancel();
    2841             :         }
    2842           0 :         break;
    2843             : 
    2844             :         case SID_EXPAND_PAGE:
    2845             :         {
    2846           0 :             SetCurrentFunction( FuExpandPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    2847           0 :             Cancel();
    2848             :         }
    2849           0 :         break;
    2850             : 
    2851             :         case SID_SUMMARY_PAGE:
    2852             :         {
    2853           0 :             mpDrawView->SdrEndTextEdit();
    2854           0 :             SetCurrentFunction( FuSummaryPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
    2855           0 :             Cancel();
    2856             :         }
    2857           0 :         break;
    2858             : 
    2859             :         case SID_AVMEDIA_PLAYER:
    2860             :         {
    2861           0 :             GetViewFrame()->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() );
    2862           0 :             GetViewFrame()->GetBindings().Invalidate( SID_AVMEDIA_PLAYER );
    2863           0 :             Cancel();
    2864           0 :             rReq.Ignore ();
    2865             :         }
    2866           0 :         break;
    2867             : 
    2868             :         case SID_PRESENTATION_MINIMIZER:
    2869             :         {
    2870           0 :             Reference<XComponentContext> xContext(::comphelper::getProcessComponentContext());
    2871           0 :             Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext));
    2872           0 :             Reference<frame::XDispatchProvider> xProvider(GetViewShellBase().GetController()->getFrame(), UNO_QUERY);
    2873           0 :             if (xProvider.is())
    2874             :             {
    2875           0 :                 util::URL aURL;
    2876           0 :                 aURL.Complete = "vnd.com.sun.star.comp.PresentationMinimizer:execute";
    2877           0 :                 xParser->parseStrict(aURL);
    2878           0 :                 uno::Reference<frame::XDispatch> xDispatch(xProvider->queryDispatch(aURL, OUString(), 0));
    2879           0 :                 if (xDispatch.is())
    2880             :                 {
    2881           0 :                     xDispatch->dispatch(aURL, uno::Sequence< beans::PropertyValue >());
    2882           0 :                 }
    2883             :             }
    2884           0 :             Cancel();
    2885           0 :             rReq.Ignore();
    2886             :         }
    2887           0 :         break;
    2888             : 
    2889             :         case SID_DISPLAY_MASTER_BACKGROUND:
    2890             :         case SID_DISPLAY_MASTER_OBJECTS:
    2891             :         {
    2892             :             // Determine current page and toggle visibility of layers
    2893             :             // associated with master page background or master page shapes.
    2894           0 :             SdPage* pPage = GetActualPage();
    2895           0 :             if (pPage != NULL
    2896           0 :                 && GetDoc() != NULL)
    2897             :             {
    2898           0 :                 SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
    2899           0 :                 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
    2900             :                 sal_uInt8 aLayerId;
    2901           0 :                 if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
    2902           0 :                     aLayerId = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND), false);
    2903             :                 else
    2904           0 :                     aLayerId = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ), false);
    2905           0 :                 aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
    2906           0 :                 pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
    2907             :             }
    2908           0 :             Cancel();
    2909           0 :             rReq.Ignore ();
    2910             :         }
    2911           0 :         break;
    2912             : 
    2913             :        case SID_PHOTOALBUM:
    2914             :        {
    2915           0 :             SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
    2916             :             boost::scoped_ptr<VclAbstractDialog> pDlg(pFact ? pFact->CreateSdPhotoAlbumDialog(
    2917           0 :                 GetActiveWindow(),
    2918           0 :                 GetDoc()) : 0);
    2919             : 
    2920           0 :             if (pDlg)
    2921             :             {
    2922           0 :                 pDlg->Execute();
    2923           0 :                 pDlg.reset();
    2924             :             }
    2925           0 :             Cancel();
    2926           0 :             rReq.Ignore ();
    2927             :         }
    2928           0 :         break;
    2929             : 
    2930             :         default:
    2931             :         {
    2932             :             DBG_ASSERT( false, "Slot without function" );
    2933           0 :             Cancel();
    2934           0 :             rReq.Ignore ();
    2935             :         }
    2936           0 :         break;
    2937             :     }
    2938             : 
    2939           0 :     if(HasCurrentFunction())
    2940             :     {
    2941           0 :         GetCurrentFunction()->Activate();
    2942             :     }
    2943             : }
    2944             : 
    2945           0 : void DrawViewShell::ExecChar( SfxRequest &rReq )
    2946             : {
    2947           0 :     SdDrawDocument* pDoc = GetDoc();
    2948           0 :     if (!pDoc || !mpDrawView)
    2949           0 :         return;
    2950             : 
    2951           0 :     SfxItemSet aEditAttr( pDoc->GetPool() );
    2952           0 :     mpDrawView->GetAttributes( aEditAttr );
    2953             : 
    2954             :     //modified by wj for sym2_1580, if put old itemset into new set,
    2955             :     //when mpDrawView->SetAttributes(aNewAttr) it will invalidate all the item
    2956             :     // and use old attr to update all the attributes
    2957             : //  SfxItemSet aNewAttr( GetPool(),
    2958             : //  EE_ITEMS_START, EE_ITEMS_END );
    2959             : //  aNewAttr.Put( aEditAttr, sal_False );
    2960           0 :     SfxItemSet aNewAttr( pDoc->GetPool() );
    2961             :     //modified end
    2962             : 
    2963           0 :     sal_uInt16 nSId = rReq.GetSlot();
    2964             : 
    2965           0 :     MapSlot( nSId );
    2966             : 
    2967           0 :     switch ( nSId )
    2968             :     {
    2969             :     case SID_ATTR_CHAR_FONT:
    2970           0 :         if( rReq.GetArgs() )
    2971             :         {
    2972           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxFontItem, SID_ATTR_CHAR_FONT , false );
    2973           0 :             if (pItem)
    2974             :             {
    2975           0 :                 aNewAttr.Put(*pItem);
    2976             :             }
    2977             :         }
    2978           0 :         break;
    2979             :     case SID_ATTR_CHAR_FONTHEIGHT:
    2980           0 :         if( rReq.GetArgs() )
    2981             :         {
    2982           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxFontHeightItem, SID_ATTR_CHAR_FONTHEIGHT , false );
    2983           0 :             if (pItem)
    2984             :             {
    2985           0 :                 aNewAttr.Put(*pItem);
    2986             :             }
    2987             :         }
    2988           0 :         break;
    2989             :     case SID_ATTR_CHAR_WEIGHT:
    2990           0 :         if( rReq.GetArgs() )
    2991             :         {
    2992             :             //const SvxWeightItem *pItem = (const SvxWeightItem*) rReq.GetArg( SID_ATTR_CHAR_WEIGHT, sal_False, TYPE(SvxWeightItem) );
    2993           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxWeightItem, SID_ATTR_CHAR_WEIGHT , false );
    2994           0 :             if (pItem)
    2995             :             {
    2996           0 :                 aNewAttr.Put(*pItem);
    2997             :             }
    2998             :         }
    2999           0 :         break;
    3000             :     case SID_ATTR_CHAR_POSTURE:
    3001           0 :         if( rReq.GetArgs() )
    3002             :         {
    3003             :             //const SvxPostureItem *pItem = (const SvxPostureItem*) rReq.GetArg( SID_ATTR_CHAR_POSTURE, sal_False, TYPE(SvxPostureItem) );
    3004           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxPostureItem, SID_ATTR_CHAR_POSTURE , false );
    3005           0 :             if (pItem)
    3006             :             {
    3007           0 :                 aNewAttr.Put(*pItem);
    3008             :             }
    3009             :         }
    3010           0 :         break;
    3011             :     case SID_ATTR_CHAR_UNDERLINE:
    3012           0 :         if( rReq.GetArgs() )
    3013             :         {
    3014             :             //<<modify by wj for sym2_1873
    3015             :             //SFX_REQUEST_ARG( rReq, pItem, SvxTextLineItem, SID_ATTR_CHAR_UNDERLINE , sal_False );
    3016           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxUnderlineItem, SID_ATTR_CHAR_UNDERLINE , false );
    3017             :             //end>>
    3018           0 :             if (pItem)
    3019             :             {
    3020           0 :                 aNewAttr.Put(*pItem);
    3021             :             }
    3022             :             else
    3023             :             {
    3024           0 :                 FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
    3025           0 :                 aNewAttr.Put( SvxUnderlineItem( eFU != UNDERLINE_NONE ?UNDERLINE_NONE : UNDERLINE_SINGLE,  EE_CHAR_UNDERLINE ) );
    3026             :             }//aNewAttr.Put( (const SvxUnderlineItem&)aEditAttr.Get( EE_CHAR_UNDERLINE ) );
    3027             :         }
    3028           0 :         break;
    3029             :     case SID_ATTR_CHAR_SHADOWED:
    3030           0 :         if( rReq.GetArgs() )
    3031             :         {
    3032           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxShadowedItem, SID_ATTR_CHAR_SHADOWED , false );
    3033           0 :             if (pItem)
    3034             :             {
    3035           0 :                 aNewAttr.Put(*pItem);
    3036             :             }
    3037             :         }
    3038           0 :         break;
    3039             :     case SID_ATTR_CHAR_STRIKEOUT:
    3040           0 :         if( rReq.GetArgs() )
    3041             :         {
    3042           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxCrossedOutItem, SID_ATTR_CHAR_STRIKEOUT , false );
    3043           0 :             if (pItem)
    3044             :             {
    3045           0 :                 aNewAttr.Put(*pItem);
    3046             :             }
    3047             :         }
    3048           0 :         break;
    3049             :     case SID_ATTR_CHAR_COLOR:
    3050           0 :         if( rReq.GetArgs() )
    3051             :         {
    3052           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxColorItem, SID_ATTR_CHAR_COLOR , false );
    3053           0 :             if (pItem)
    3054             :             {
    3055           0 :                 aNewAttr.Put(*pItem);
    3056             :             }
    3057             :         }
    3058           0 :         break;
    3059             :     case SID_ATTR_CHAR_KERNING:
    3060           0 :         if( rReq.GetArgs() )
    3061             :         {
    3062           0 :             SFX_REQUEST_ARG( rReq, pItem, SvxKerningItem, SID_ATTR_CHAR_KERNING , false );
    3063           0 :             if (pItem)
    3064             :             {
    3065           0 :                 aNewAttr.Put(*pItem);
    3066             :             }
    3067             :         }
    3068           0 :         break;
    3069             :     case SID_SET_SUB_SCRIPT:
    3070             :         {
    3071           0 :             SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
    3072             :             SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
    3073           0 :                             aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
    3074           0 :             if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
    3075           0 :                 aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
    3076             :             else
    3077           0 :                 aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
    3078           0 :             aNewAttr.Put( aItem );
    3079             :         }
    3080           0 :         break;
    3081             :     case SID_SET_SUPER_SCRIPT:
    3082             :         {
    3083           0 :             SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
    3084             :             SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
    3085           0 :                             aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
    3086           0 :             if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
    3087           0 :                 aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
    3088             :             else
    3089           0 :                 aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
    3090           0 :             aNewAttr.Put( aItem );
    3091             :         }
    3092           0 :         break;
    3093             :     case SID_SHRINK_FONT_SIZE:
    3094             :     case SID_GROW_FONT_SIZE:
    3095             :         {
    3096           0 :             const SvxFontListItem* pFonts = dynamic_cast<const SvxFontListItem*>(GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
    3097           0 :             const FontList* pFontList = pFonts ? pFonts->GetFontList() : NULL;
    3098           0 :             if( pFontList )
    3099             :             {
    3100           0 :                 FuText::ChangeFontSize( nSId == SID_GROW_FONT_SIZE, NULL, pFontList, mpView );
    3101           0 :                 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
    3102             :             }
    3103             :         }
    3104             :     default:
    3105             :         ;
    3106             :     }
    3107             : 
    3108           0 :     mpDrawView->SetAttributes(aNewAttr);
    3109           0 :     rReq.Done();
    3110           0 :     Cancel();
    3111             : }
    3112             : 
    3113             : /** This method consists basically of three parts:
    3114             :     1. Process the arguments of the SFX request.
    3115             :     2. Use the model to create a new page or duplicate an existing one.
    3116             :     3. Update the tab control and switch to the new page.
    3117             : */
    3118           0 : SdPage* DrawViewShell::CreateOrDuplicatePage (
    3119             :     SfxRequest& rRequest,
    3120             :     PageKind ePageKind,
    3121             :     SdPage* pPage,
    3122             :     const sal_Int32 nInsertPosition)
    3123             : {
    3124           0 :     SdPage* pNewPage = NULL;
    3125           0 :     if (ePageKind == PK_STANDARD && meEditMode != EM_MASTERPAGE)
    3126             :     {
    3127           0 :         if ( mpDrawView->IsTextEdit() )
    3128             :         {
    3129           0 :             mpDrawView->SdrEndTextEdit();
    3130             :         }
    3131           0 :         pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition);
    3132             :     }
    3133           0 :     return pNewPage;
    3134             : }
    3135             : 
    3136           0 : void DrawViewShell::ExecutePropPanelAttr (SfxRequest& rReq)
    3137             : {
    3138           0 :     if(SlideShow::IsRunning( GetViewShellBase() ))
    3139           0 :         return;
    3140             : 
    3141           0 :     SdDrawDocument* pDoc = GetDoc();
    3142           0 :     if (!pDoc || !mpDrawView)
    3143           0 :         return;
    3144             : 
    3145           0 :     sal_uInt16 nSId = rReq.GetSlot();
    3146           0 :     SfxItemSet aAttrs( pDoc->GetPool() );
    3147             : 
    3148           0 :     switch ( nSId )
    3149             :     {
    3150             :     case SID_TABLE_VERT_NONE:
    3151             :     case SID_TABLE_VERT_CENTER:
    3152             :     case SID_TABLE_VERT_BOTTOM:
    3153           0 :         SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_TOP;
    3154           0 :         if (nSId == SID_TABLE_VERT_CENTER)
    3155           0 :             eTVA = SDRTEXTVERTADJUST_CENTER;
    3156           0 :         else if (nSId == SID_TABLE_VERT_BOTTOM)
    3157           0 :             eTVA = SDRTEXTVERTADJUST_BOTTOM;
    3158             : 
    3159           0 :         aAttrs.Put( SdrTextVertAdjustItem(eTVA) );
    3160           0 :         mpDrawView->SetAttributes(aAttrs);
    3161             : 
    3162           0 :         break;
    3163           0 :     }
    3164             : }
    3165             : 
    3166           0 : void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet)
    3167             : {
    3168           0 :     SfxWhichIter    aIter( rSet );
    3169           0 :     sal_uInt16          nWhich = aIter.FirstWhich();
    3170             : 
    3171           0 :     SdDrawDocument* pDoc = GetDoc();
    3172           0 :     if (!pDoc || !mpDrawView)
    3173           0 :         return;
    3174             : 
    3175           0 :     SfxItemSet aAttrs( pDoc->GetPool() );
    3176           0 :     mpDrawView->GetAttributes( aAttrs );
    3177             : 
    3178           0 :     while ( nWhich )
    3179             :     {
    3180           0 :         sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
    3181           0 :             ? GetPool().GetSlotId(nWhich)
    3182           0 :             : nWhich;
    3183           0 :         switch ( nSlotId )
    3184             :         {
    3185             :             case SID_TABLE_VERT_NONE:
    3186             :             case SID_TABLE_VERT_CENTER:
    3187             :             case SID_TABLE_VERT_BOTTOM:
    3188           0 :                 bool bContour = false;
    3189           0 :                 SfxItemState eConState = aAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME );
    3190           0 :                 if( eConState != SfxItemState::DONTCARE )
    3191             :                 {
    3192           0 :                     bContour = ( ( const SdrOnOffItem& )aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
    3193             :                 }
    3194           0 :                 if (bContour) break;
    3195             : 
    3196           0 :                 SfxItemState eVState = aAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST );
    3197             :                 //SfxItemState eHState = aAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST );
    3198             : 
    3199             :                 //if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
    3200           0 :                 if(SfxItemState::DONTCARE != eVState)
    3201             :                 {
    3202           0 :                     SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
    3203           0 :                     bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) ||
    3204           0 :                             (nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) ||
    3205           0 :                             (nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM);
    3206           0 :                     rSet.Put(SfxBoolItem(nSlotId, bSet));
    3207             :                 }
    3208             :                 else
    3209             :                 {
    3210           0 :                     rSet.Put(SfxBoolItem(nSlotId, false));
    3211             :                 }
    3212           0 :                 break;
    3213             :         }
    3214           0 :         nWhich = aIter.NextWhich();
    3215           0 :     }
    3216             : }
    3217             : 
    3218         114 : } // end of namespace sd
    3219             : 
    3220             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10