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

Generated by: LCOV version 1.10