LCOV - code coverage report
Current view: top level - sd/source/ui/view - drviews2.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 437 0.0 %
Date: 2012-08-25 Functions: 0 2 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 801 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include "DrawViewShell.hxx"
      31                 :            : #include "ViewShellImplementation.hxx"
      32                 :            : #include <vcl/waitobj.hxx>
      33                 :            : #include <svx/svdograf.hxx>
      34                 :            : #include <svx/svxids.hrc>
      35                 :            : #include <svx/svdpagv.hxx>
      36                 :            : #include <svx/svdundo.hxx>
      37                 :            : #include <sfx2/zoomitem.hxx>
      38                 :            : #include <editeng/editdata.hxx>
      39                 :            : #include <basic/sberrors.hxx>
      40                 :            : #include <vcl/msgbox.hxx>
      41                 :            : #include <sfx2/request.hxx>
      42                 :            : #include <sfx2/dispatch.hxx>
      43                 :            : #include <svx/xfillit0.hxx>
      44                 :            : #include <svx/xflclit.hxx>
      45                 :            : #include <svl/aeitem.hxx>
      46                 :            : #include <editeng/eeitem.hxx>
      47                 :            : #include <basic/sbstar.hxx>
      48                 :            : #include <editeng/flditem.hxx>
      49                 :            : #include <svx/xlineit0.hxx>
      50                 :            : #include <svx/graphichelper.hxx>
      51                 :            : #include <svx/compressgraphicdialog.hxx>
      52                 :            : #include <svx/svdoutl.hxx>
      53                 :            : #include <svx/xlnwtit.hxx>
      54                 :            : #include <svx/svdoattr.hxx>
      55                 :            : #include <svx/xlnstwit.hxx>
      56                 :            : #include <svx/sdtmfitm.hxx>
      57                 :            : #include <svx/sdtagitm.hxx>
      58                 :            : #include <svx/xlnedwit.hxx>
      59                 :            : #include <svx/fontworkbar.hxx>
      60                 :            : 
      61                 :            : #include <svx/svxdlg.hxx>
      62                 :            : #include <svx/dialogs.hrc>
      63                 :            : 
      64                 :            : #include <sfx2/viewfrm.hxx>
      65                 :            : #include "sdgrffilter.hxx"
      66                 :            : 
      67                 :            : #include "app.hrc"
      68                 :            : #include "glob.hrc"
      69                 :            : #include "helpids.h"
      70                 :            : #include "sdattr.hxx"
      71                 :            : #include "drawview.hxx"
      72                 :            : #include "Window.hxx"
      73                 :            : #include "drawdoc.hxx"
      74                 :            : #include "DrawDocShell.hxx"
      75                 :            : #include "sdpage.hxx"
      76                 :            : #include "fuscale.hxx"
      77                 :            : #include "sdresid.hxx"
      78                 :            : #include "GraphicViewShell.hxx"
      79                 :            : #include "unmodpg.hxx"
      80                 :            : #include "slideshow.hxx"
      81                 :            : #include "fuvect.hxx"
      82                 :            : #include "stlpool.hxx"
      83                 :            : 
      84                 :            : #include "optsitem.hxx"
      85                 :            : #include "sdabstdlg.hxx"
      86                 :            : #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
      87                 :            : #include <com/sun/star/drawing/XDrawPages.hpp>
      88                 :            : 
      89                 :            : #include <strings.hrc>
      90                 :            : 
      91                 :            : using namespace ::com::sun::star;
      92                 :            : using namespace ::com::sun::star::uno;
      93                 :            : 
      94                 :            : namespace sd {
      95                 :            : 
      96                 :            : /*************************************************************************
      97                 :            : |*
      98                 :            : |* SfxRequests fuer temporaere Funktionen
      99                 :            : |*
     100                 :            : \************************************************************************/
     101                 :            : 
     102                 :          0 : void DrawViewShell::FuTemporary(SfxRequest& rReq)
     103                 :            : {
     104                 :            :     // Waehrend einer Native-Diashow wird nichts ausgefuehrt!
     105 [ #  # ][ #  # ]:          0 :     if(SlideShow::IsRunning( GetViewShellBase() ) && (rReq.GetSlot() != SID_NAVIGATOR))
                 [ #  # ]
     106                 :          0 :         return;
     107                 :            : 
     108                 :            :     DBG_ASSERT( mpDrawView, "sd::DrawViewShell::FuTemporary(), no draw view!" );
     109         [ #  # ]:          0 :     if( !mpDrawView )
     110                 :          0 :         return;
     111                 :            : 
     112                 :          0 :     CheckLineTo (rReq);
     113                 :            : 
     114                 :          0 :     DeactivateCurrentFunction();
     115                 :            : 
     116                 :          0 :     sal_uInt16 nSId = rReq.GetSlot();
     117                 :            : 
     118                 :            :     // Slot wird gemapped (ToolboxImages/-Slots)
     119                 :          0 :     MapSlot( nSId );
     120                 :            : 
     121   [ #  #  #  #  :          0 :     switch ( nSId )
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                   #  # ]
     122                 :            :     {
     123                 :            :         case SID_OUTLINE_TEXT_AUTOFIT:
     124                 :            :         {
     125                 :          0 :             ::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
     126                 :          0 :             SdrObject* pObj = NULL;
     127                 :          0 :             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     128         [ #  # ]:          0 :             if( rMarkList.GetMarkCount() == 1 )
     129                 :            :             {
     130 [ #  # ][ #  # ]:          0 :                 pUndoManager->EnterListAction( String(), String() );
                 [ #  # ]
     131                 :          0 :                 mpDrawView->BegUndo();
     132                 :            : 
     133                 :          0 :                 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     134                 :          0 :                 bool bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE;
     135                 :            : 
     136                 :          0 :                 mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
     137                 :            : 
     138 [ #  # ][ #  # ]:          0 :                 pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? SDRTEXTFIT_NONE : SDRTEXTFIT_AUTOFIT));
     139                 :            : 
     140                 :          0 :                 mpDrawView->EndUndo();
     141                 :          0 :                 pUndoManager->LeaveListAction();
     142                 :            :             }
     143                 :          0 :             Cancel();
     144                 :          0 :             rReq.Done();
     145                 :            :         }
     146                 :          0 :         break;
     147                 :            : 
     148                 :            :         // Flaechen und Linien-Attribute:
     149                 :            :         // Sollten (wie StateMethode) eine eigene
     150                 :            :         // Execute-Methode besitzen
     151                 :            :         case SID_ATTR_FILL_STYLE:
     152                 :            :         case SID_ATTR_FILL_COLOR:
     153                 :            :         case SID_ATTR_FILL_GRADIENT:
     154                 :            :         case SID_ATTR_FILL_HATCH:
     155                 :            :         case SID_ATTR_FILL_BITMAP:
     156                 :            :         case SID_ATTR_FILL_SHADOW:
     157                 :            : 
     158                 :            :         case SID_ATTR_LINE_STYLE:
     159                 :            :         case SID_ATTR_LINE_DASH:
     160                 :            :         case SID_ATTR_LINE_WIDTH:
     161                 :            :         case SID_ATTR_LINE_COLOR:
     162                 :            :         case SID_ATTR_LINEEND_STYLE:
     163                 :            : 
     164                 :            :         case SID_ATTR_TEXT_FITTOSIZE:
     165                 :            :         {
     166         [ #  # ]:          0 :             if( rReq.GetArgs() )
     167                 :            :             {
     168                 :          0 :                 sal_Bool bMergeUndo = sal_False;
     169                 :          0 :                 ::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
     170                 :            : 
     171                 :            :                 // Anpassungen Start/EndWidth
     172         [ #  # ]:          0 :                 if(nSId == SID_ATTR_LINE_WIDTH)
     173                 :            :                 {
     174                 :          0 :                     SdrObject* pObj = NULL;
     175                 :          0 :                     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     176                 :          0 :                     sal_uLong nCount = rMarkList.GetMarkCount();
     177                 :            : 
     178                 :          0 :                     sal_Int32 nNewLineWidth = ((const XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue();
     179                 :            : 
     180         [ #  # ]:          0 :                     for (sal_uLong i=0; i<nCount; i++)
     181                 :            :                     {
     182 [ #  # ][ #  # ]:          0 :                         SfxItemSet aAttr(GetDoc()->GetPool());
     183 [ #  # ][ #  # ]:          0 :                         pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
     184 [ #  # ][ #  # ]:          0 :                         aAttr.Put(pObj->GetMergedItemSet());
     185                 :            : 
     186         [ #  # ]:          0 :                         sal_Int32 nActLineWidth = ((const XLineWidthItem&)aAttr.Get(XATTR_LINEWIDTH)).GetValue();
     187                 :            : 
     188         [ #  # ]:          0 :                         if(nActLineWidth != nNewLineWidth)
     189                 :            :                         {
     190                 :          0 :                             sal_Bool bSetItemSet(sal_False);
     191                 :            : 
     192                 :            :                             // do this for SFX_ITEM_DEFAULT and for SFX_ITEM_SET
     193 [ #  # ][ #  # ]:          0 :                             if(SFX_ITEM_DONTCARE != aAttr.GetItemState(XATTR_LINESTARTWIDTH))
     194                 :            :                             {
     195         [ #  # ]:          0 :                                 sal_Int32 nValAct = ((const XLineStartWidthItem&)aAttr.Get(XATTR_LINESTARTWIDTH)).GetValue();
     196                 :          0 :                                 sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
     197         [ #  # ]:          0 :                                 if(nValNew < 0)
     198                 :          0 :                                     nValNew = 0;
     199                 :          0 :                                 bSetItemSet = sal_True;
     200 [ #  # ][ #  # ]:          0 :                                 aAttr.Put(XLineStartWidthItem(nValNew));
                 [ #  # ]
     201                 :            :                             }
     202                 :            : 
     203                 :            :                             // do this for SFX_ITEM_DEFAULT and for SFX_ITEM_SET
     204 [ #  # ][ #  # ]:          0 :                             if(SFX_ITEM_DONTCARE != aAttr.GetItemState(XATTR_LINEENDWIDTH))
     205                 :            :                             {
     206         [ #  # ]:          0 :                                 sal_Int32 nValAct = ((const XLineEndWidthItem&)aAttr.Get(XATTR_LINEENDWIDTH)).GetValue();
     207                 :          0 :                                 sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
     208         [ #  # ]:          0 :                                 if(nValNew < 0)
     209                 :          0 :                                     nValNew = 0;
     210                 :          0 :                                 bSetItemSet = sal_True;
     211 [ #  # ][ #  # ]:          0 :                                 aAttr.Put(XLineEndWidthItem(nValNew));
                 [ #  # ]
     212                 :            :                             }
     213                 :            : 
     214         [ #  # ]:          0 :                             if(bSetItemSet)
     215         [ #  # ]:          0 :                                 pObj->SetMergedItemSet(aAttr);
     216                 :            :                         }
     217         [ #  # ]:          0 :                     }
     218                 :            :                 }
     219                 :            : 
     220         [ #  # ]:          0 :                 if (nSId == SID_ATTR_FILL_SHADOW)
     221                 :            :                 {
     222                 :            :                     // Ggf. werden transparente Objekte wei?gefuellt
     223                 :          0 :                     SdrObject* pObj = NULL;
     224                 :          0 :                     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     225                 :          0 :                     sal_uLong nCount = rMarkList.GetMarkCount();
     226                 :            : 
     227                 :          0 :                     const bool bUndo = mpDrawView->IsUndoEnabled();
     228                 :            : 
     229         [ #  # ]:          0 :                     for (sal_uLong i=0; i<nCount; i++)
     230                 :            :                     {
     231 [ #  # ][ #  # ]:          0 :                         SfxItemSet aAttr(GetDoc()->GetPool());
     232 [ #  # ][ #  # ]:          0 :                         pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
     233                 :            : 
     234                 :            :                         // #i25616#
     235 [ #  # ][ #  # ]:          0 :                         if(!pObj->ISA(SdrGrafObj))
                 [ #  # ]
     236                 :            :                         {
     237 [ #  # ][ #  # ]:          0 :                             aAttr.Put(pObj->GetMergedItemSet());
     238                 :            : 
     239                 :            :                             const XFillStyleItem& rFillStyle =
     240         [ #  # ]:          0 :                             (const XFillStyleItem&) aAttr.Get(XATTR_FILLSTYLE);
     241                 :            : 
     242         [ #  # ]:          0 :                             if (rFillStyle.GetValue() == XFILL_NONE)
     243                 :            :                             {
     244         [ #  # ]:          0 :                                 if( bUndo )
     245                 :            :                                 {
     246                 :            :                                     // Vorlage hat keine Fuellung,
     247                 :            :                                     // daher hart attributieren: Fuellung setzen
     248         [ #  # ]:          0 :                                     if (!bMergeUndo)
     249                 :            :                                     {
     250                 :          0 :                                         bMergeUndo = sal_True;
     251 [ #  # ][ #  # ]:          0 :                                         pUndoManager->EnterListAction( String(), String() );
         [ #  # ][ #  # ]
                 [ #  # ]
     252         [ #  # ]:          0 :                                         mpDrawView->BegUndo();
     253                 :            :                                     }
     254                 :            : 
     255 [ #  # ][ #  # ]:          0 :                                     mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
         [ #  # ][ #  # ]
     256                 :            :                                 }
     257                 :            : 
     258 [ #  # ][ #  # ]:          0 :                                 aAttr.Put(XFillStyleItem(XFILL_SOLID));
                 [ #  # ]
     259 [ #  # ][ #  # ]:          0 :                                 aAttr.Put(XFillColorItem(String(), COL_WHITE));
         [ #  # ][ #  # ]
                 [ #  # ]
     260                 :            : 
     261         [ #  # ]:          0 :                                 pObj->SetMergedItemSet(aAttr);
     262                 :            :                             }
     263                 :            :                         }
     264         [ #  # ]:          0 :                     }
     265                 :            : 
     266         [ #  # ]:          0 :                     if (bMergeUndo)
     267                 :            :                     {
     268                 :          0 :                         mpDrawView->EndUndo();
     269                 :            :                     }
     270                 :            :                 }
     271                 :            : 
     272                 :          0 :                 mpDrawView->SetAttributes(*rReq.GetArgs());
     273                 :            : 
     274         [ #  # ]:          0 :                 if (bMergeUndo)
     275                 :            :                 {
     276                 :          0 :                     pUndoManager->LeaveListAction();
     277                 :            :                 }
     278                 :            : 
     279                 :          0 :                 rReq.Done();
     280                 :            :             }
     281                 :            :             else
     282                 :            :             {
     283   [ #  #  #  # ]:          0 :                 switch( rReq.GetSlot() )
     284                 :            :                 {
     285                 :            :                     case SID_ATTR_FILL_SHADOW:
     286                 :            :                     case SID_ATTR_FILL_STYLE:
     287                 :            :                     case SID_ATTR_FILL_COLOR:
     288                 :            :                     case SID_ATTR_FILL_GRADIENT:
     289                 :            :                     case SID_ATTR_FILL_HATCH:
     290                 :            :                     case SID_ATTR_FILL_BITMAP:
     291                 :          0 :                         GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_AREA, SFX_CALLMODE_ASYNCHRON );
     292                 :          0 :                         break;
     293                 :            :                     case SID_ATTR_LINE_STYLE:
     294                 :            :                     case SID_ATTR_LINE_DASH:
     295                 :            :                     case SID_ATTR_LINE_WIDTH:
     296                 :            :                     case SID_ATTR_LINE_COLOR:
     297                 :          0 :                         GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_LINE, SFX_CALLMODE_ASYNCHRON );
     298                 :          0 :                         break;
     299                 :            :                     case SID_ATTR_TEXT_FITTOSIZE:
     300                 :          0 :                         GetViewFrame()->GetDispatcher()->Execute( SID_TEXTATTR_DLG, SFX_CALLMODE_ASYNCHRON );
     301                 :          0 :                         break;
     302                 :            :                 }
     303                 :            :             }
     304                 :          0 :             Cancel();
     305                 :            :         }
     306                 :          0 :         break;
     307                 :            : 
     308                 :            :         case SID_HYPHENATION:
     309                 :            :         {
     310                 :            :             // const SfxPoolItem* pItem = rReq.GetArg( SID_HYPHENATION );
     311                 :            :             //  ^-- Soll so nicht benutzt werden (Defaults sind falsch) !
     312                 :          0 :             SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_HYPHENATION, sal_False);
     313                 :            : 
     314         [ #  # ]:          0 :             if( pItem )
     315                 :            :             {
     316         [ #  # ]:          0 :                 SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
     317                 :          0 :                 sal_Bool bValue = ( (const SfxBoolItem*) pItem)->GetValue();
     318 [ #  # ][ #  # ]:          0 :                 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
                 [ #  # ]
     319 [ #  # ][ #  # ]:          0 :                 mpDrawView->SetAttributes( aSet );
     320                 :            :             }
     321                 :            :             else // nur zum Test
     322                 :            :             {
     323                 :            :                 OSL_FAIL(" Kein Wert fuer Silbentrennung!");
     324         [ #  # ]:          0 :                 SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
     325                 :          0 :                 sal_Bool bValue = sal_True;
     326 [ #  # ][ #  # ]:          0 :                 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
                 [ #  # ]
     327 [ #  # ][ #  # ]:          0 :                 mpDrawView->SetAttributes( aSet );
     328                 :            :             }
     329                 :          0 :             rReq.Done();
     330                 :          0 :             Cancel();
     331                 :            :         }
     332                 :          0 :         break;
     333                 :            : 
     334                 :            :         case SID_INSERTPAGE:
     335                 :            :         case SID_INSERTPAGE_QUICK:
     336                 :            :         case SID_DUPLICATE_PAGE:
     337                 :            :         {
     338                 :          0 :             SdPage* pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage());
     339                 :          0 :             Cancel();
     340         [ #  # ]:          0 :             if(HasCurrentFunction(SID_BEZIER_EDIT) )
     341                 :          0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
     342         [ #  # ]:          0 :             if (pNewPage != NULL)
     343                 :          0 :                 SwitchPage((pNewPage->GetPageNum()-1)/2);
     344                 :          0 :             rReq.Done ();
     345                 :            :         }
     346                 :          0 :         break;
     347                 :            : 
     348                 :            :         case SID_INSERT_MASTER_PAGE:
     349                 :            :         {
     350                 :            :             // Use the API to create a new page.
     351                 :            :             Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
     352 [ #  # ][ #  # ]:          0 :                 GetDoc()->getUnoModel(), UNO_QUERY);
                 [ #  # ]
     353         [ #  # ]:          0 :             if (xMasterPagesSupplier.is())
     354                 :            :             {
     355                 :            :                 Reference<drawing::XDrawPages> xMasterPages (
     356 [ #  # ][ #  # ]:          0 :                     xMasterPagesSupplier->getMasterPages());
     357         [ #  # ]:          0 :                 if (xMasterPages.is())
     358                 :            :                 {
     359                 :          0 :                     sal_uInt16 nIndex = GetCurPageId();
     360 [ #  # ][ #  # ]:          0 :                     xMasterPages->insertNewByIndex (nIndex);
     361                 :            : 
     362                 :            :                     // Create shapes for the default layout.
     363                 :            :                     SdPage* pMasterPage = GetDoc()->GetMasterSdPage(
     364 [ #  # ][ #  # ]:          0 :                         nIndex, PK_STANDARD);
     365         [ #  # ]:          0 :                     pMasterPage->CreateTitleAndLayout (sal_True,sal_True);
     366                 :          0 :                 }
     367                 :            :             }
     368                 :            : 
     369         [ #  # ]:          0 :             Cancel();
     370 [ #  # ][ #  # ]:          0 :             if(HasCurrentFunction(SID_BEZIER_EDIT))
     371                 :            :                 GetViewFrame()->GetDispatcher()->Execute(
     372 [ #  # ][ #  # ]:          0 :                     SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
     373         [ #  # ]:          0 :             rReq.Done ();
     374                 :            :         }
     375                 :          0 :         break;
     376                 :            : 
     377                 :            :         case SID_MODIFYPAGE:
     378                 :            :         {
     379 [ #  # ][ #  # ]:          0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES ||
         [ #  # ][ #  # ]
     380                 :            :                 (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE) )
     381                 :            :             {
     382         [ #  # ]:          0 :                 if ( mpDrawView->IsTextEdit() )
     383                 :            :                 {
     384                 :          0 :                     mpDrawView->SdrEndTextEdit();
     385                 :            :                 }
     386                 :          0 :                 sal_uInt16 nPage = maTabControl.GetCurPageId() - 1;
     387                 :          0 :                 mpActualPage = GetDoc()->GetSdPage(nPage, mePageKind);
     388                 :            :                 ::sd::ViewShell::mpImpl->ProcessModifyPageSlot (
     389                 :            :                     rReq,
     390                 :            :                     mpActualPage,
     391                 :          0 :                     mePageKind);
     392                 :            :             }
     393                 :            : 
     394                 :          0 :             Cancel();
     395                 :          0 :             rReq.Done ();
     396                 :            :         }
     397                 :          0 :         break;
     398                 :            : 
     399                 :            :         case SID_ASSIGN_LAYOUT:
     400                 :            :         {
     401 [ #  # ][ #  # ]:          0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
         [ #  # ][ #  # ]
     402                 :            :             {
     403         [ #  # ]:          0 :                 if ( mpDrawView->IsTextEdit() )
     404                 :          0 :                     mpDrawView->SdrEndTextEdit();
     405                 :            : 
     406                 :          0 :                 ::sd::ViewShell::mpImpl->AssignLayout(rReq, mePageKind);
     407                 :            :             }
     408                 :          0 :             Cancel();
     409                 :          0 :             rReq.Done ();
     410                 :            :         }
     411                 :          0 :         break;
     412                 :            : 
     413                 :            :         case SID_RENAMEPAGE:
     414                 :            :         case SID_RENAME_MASTER_PAGE:
     415                 :            :         {
     416 [ #  # ][ #  # ]:          0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
     417                 :            :             {
     418 [ #  # ][ #  # ]:          0 :                 if ( mpDrawView->IsTextEdit() )
     419                 :            :                 {
     420         [ #  # ]:          0 :                     mpDrawView->SdrEndTextEdit();
     421                 :            :                 }
     422                 :            : 
     423                 :          0 :                 sal_uInt16 nPageId = maTabControl.GetCurPageId();
     424                 :          0 :                 SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE )
     425         [ #  # ]:          0 :                     ? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() )
     426 [ #  # ][ #  # ]:          0 :                     : GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() );
         [ #  # ][ #  # ]
     427                 :            : 
     428 [ #  # ][ #  # ]:          0 :                 String aTitle( SdResId( STR_TITLE_RENAMESLIDE ) );
     429 [ #  # ][ #  # ]:          0 :                 String aDescr( SdResId( STR_DESC_RENAMESLIDE ) );
     430 [ #  # ][ #  # ]:          0 :                 String aPageName = pCurrentPage->GetName();
     431                 :            : 
     432         [ #  # ]:          0 :                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     433                 :            :                 DBG_ASSERT(pFact, "Dialogdiet fail!");
     434 [ #  # ][ #  # ]:          0 :                 AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog( GetActiveWindow(), aPageName, aDescr );
     435                 :            :                 DBG_ASSERT(aNameDlg, "Dialogdiet fail!");
     436         [ #  # ]:          0 :                 aNameDlg->SetText( aTitle );
     437 [ #  # ][ #  # ]:          0 :                 aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true );
     438         [ #  # ]:          0 :                 aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
     439                 :            : 
     440 [ #  # ][ #  # ]:          0 :                 if( aNameDlg->Execute() == RET_OK )
     441                 :            :                 {
     442         [ #  # ]:          0 :                     String aNewName;
     443         [ #  # ]:          0 :                     aNameDlg->GetName( aNewName );
     444 [ #  # ][ #  # ]:          0 :                     if( ! aNewName.Equals( aPageName ) )
     445                 :            :                     {
     446                 :            : #ifdef DBG_UTIL
     447                 :            :                         bool bResult =
     448                 :            : #endif
     449         [ #  # ]:          0 :                             RenameSlide( nPageId, aNewName );
     450                 :            :                         DBG_ASSERT( bResult, "Couldn't rename slide" );
     451         [ #  # ]:          0 :                     }
     452                 :            :                 }
     453 [ #  # ][ #  # ]:          0 :                 delete aNameDlg;
         [ #  # ][ #  # ]
                 [ #  # ]
     454                 :            :             }
     455                 :            : 
     456                 :          0 :             Cancel();
     457                 :          0 :             rReq.Ignore ();
     458                 :            :         }
     459                 :          0 :         break;
     460                 :            : 
     461                 :            :         case SID_RENAMEPAGE_QUICK:
     462                 :            :         {
     463 [ #  # ][ #  # ]:          0 :             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
     464                 :            :             {
     465         [ #  # ]:          0 :                 if ( mpDrawView->IsTextEdit() )
     466                 :            :                 {
     467                 :          0 :                     mpDrawView->SdrEndTextEdit();
     468                 :            :                 }
     469                 :            : 
     470                 :          0 :                 maTabControl.StartEditMode( maTabControl.GetCurPageId() );
     471                 :            :             }
     472                 :            : 
     473                 :          0 :             Cancel();
     474                 :          0 :             rReq.Ignore ();
     475                 :            :         }
     476                 :          0 :         break;
     477                 :            : 
     478                 :            :         case SID_PAGESIZE :  // entweder dieses (kein menueeintrag o. ae. !!)
     479                 :            :         {
     480                 :          0 :             const SfxItemSet *pArgs = rReq.GetArgs ();
     481                 :            : 
     482         [ #  # ]:          0 :             if (pArgs)
     483         [ #  # ]:          0 :                 if (pArgs->Count () == 3)
     484                 :            :                 {
     485 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pWidth, SfxUInt32Item, ID_VAL_PAGEWIDTH, sal_False);
     486 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pHeight, SfxUInt32Item, ID_VAL_PAGEHEIGHT, sal_False);
     487 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
     488                 :            : 
     489                 :          0 :                     Size aSize (pWidth->GetValue (), pHeight->GetValue ());
     490                 :            : 
     491         [ #  # ]:          0 :                     SetupPage (aSize, 0, 0, 0, 0, sal_True, sal_False, pScaleAll->GetValue ());
     492         [ #  # ]:          0 :                     rReq.Ignore ();
     493                 :            :                     break;
     494                 :            :                 }
     495                 :            : #ifndef DISABLE_SCRIPTING
     496                 :          0 :             StarBASIC::FatalError (SbERR_WRONG_ARGS);
     497                 :            : #endif
     498                 :          0 :             rReq.Ignore ();
     499                 :          0 :             break;
     500                 :            :         }
     501                 :            : 
     502                 :            :         case SID_PAGEMARGIN :  // oder dieses (kein menueeintrag o. ae. !!)
     503                 :            :         {
     504                 :          0 :             const SfxItemSet *pArgs = rReq.GetArgs ();
     505                 :            : 
     506         [ #  # ]:          0 :             if (pArgs)
     507         [ #  # ]:          0 :                 if (pArgs->Count () == 5)
     508                 :            :                 {
     509 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pLeft, SfxUInt32Item, ID_VAL_PAGELEFT, sal_False);
     510 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pRight, SfxUInt32Item, ID_VAL_PAGERIGHT, sal_False);
     511 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pUpper, SfxUInt32Item, ID_VAL_PAGETOP, sal_False);
     512 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pLower, SfxUInt32Item, ID_VAL_PAGEBOTTOM, sal_False);
     513 [ #  # ][ #  # ]:          0 :                     SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
     514                 :            : 
     515                 :          0 :                     Size aEmptySize (0, 0);
     516                 :            : 
     517                 :          0 :                     SetupPage (aEmptySize, pLeft->GetValue (), pRight->GetValue (),
     518                 :          0 :                                pUpper->GetValue (), pLower->GetValue (),
     519         [ #  # ]:          0 :                                sal_False, sal_True, pScaleAll->GetValue ());
     520         [ #  # ]:          0 :                     rReq.Ignore ();
     521                 :            :                     break;
     522                 :            :                 }
     523                 :            : #ifndef DISABLE_SCRIPTING
     524                 :          0 :             StarBASIC::FatalError (SbERR_WRONG_ARGS);
     525                 :            : #endif
     526                 :          0 :             rReq.Ignore ();
     527                 :          0 :             break;
     528                 :            :         }
     529                 :            : 
     530                 :            :         case SID_ATTR_ZOOMSLIDER:
     531                 :            :         {
     532                 :          0 :             const SfxItemSet* pArgs = rReq.GetArgs();
     533                 :            : 
     534 [ #  # ][ #  # ]:          0 :             if (pArgs && pArgs->Count () == 1 )
                 [ #  # ]
     535                 :            :             {
     536                 :          0 :                 SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER, sal_False);
     537 [ #  # ][ #  # ]:          0 :                 if (CHECK_RANGE (5, pScale->GetValue (), 3000))
                 [ #  # ]
     538                 :            :                 {
     539                 :          0 :                     SetZoom (pScale->GetValue ());
     540                 :            : 
     541                 :          0 :                     SfxBindings& rBindings = GetViewFrame()->GetBindings();
     542                 :          0 :                     rBindings.Invalidate( SID_ATTR_ZOOM );
     543                 :          0 :                     rBindings.Invalidate( SID_ZOOM_IN );
     544                 :          0 :                     rBindings.Invalidate( SID_ZOOM_OUT );
     545                 :          0 :                     rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
     546                 :            : 
     547                 :            :                 }
     548                 :            :             }
     549                 :            : 
     550                 :          0 :             Cancel();
     551                 :          0 :             rReq.Done ();
     552                 :          0 :             break;
     553                 :            :         }
     554                 :            :         case SID_ZOOMING :  // kein Menueintrag, sondern aus dem Zoomdialog generiert
     555                 :            :         {
     556                 :          0 :             const SfxItemSet* pArgs = rReq.GetArgs();
     557                 :            : 
     558         [ #  # ]:          0 :             if (pArgs)
     559         [ #  # ]:          0 :                 if (pArgs->Count () == 1)
     560                 :            :                 {
     561                 :          0 :                     SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM, sal_False);
     562 [ #  # ][ #  # ]:          0 :                     if (CHECK_RANGE (10, pScale->GetValue (), 1000))
                 [ #  # ]
     563                 :            :                     {
     564                 :          0 :                         SetZoom (pScale->GetValue ());
     565                 :            : 
     566                 :          0 :                         SfxBindings& rBindings = GetViewFrame()->GetBindings();
     567                 :          0 :                         rBindings.Invalidate( SID_ATTR_ZOOM );
     568                 :          0 :                         rBindings.Invalidate( SID_ZOOM_IN );
     569                 :          0 :                         rBindings.Invalidate( SID_ZOOM_OUT );
     570                 :          0 :                         rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
     571                 :            :                     }
     572                 :            : #ifndef DISABLE_SCRIPTING
     573                 :          0 :                     else StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
     574                 :            : #endif
     575                 :          0 :                     rReq.Ignore ();
     576                 :          0 :                     break;
     577                 :            :                 }
     578                 :            : #ifndef DISABLE_SCRIPTING
     579                 :          0 :             StarBASIC::FatalError (SbERR_WRONG_ARGS);
     580                 :            : #endif
     581                 :          0 :             rReq.Ignore ();
     582                 :          0 :             break;
     583                 :            :         }
     584                 :            : 
     585                 :            :         case SID_ATTR_ZOOM:
     586                 :            :         {
     587                 :          0 :             const SfxItemSet* pArgs = rReq.GetArgs();
     588                 :          0 :             mbZoomOnPage = sal_False;
     589                 :            : 
     590         [ #  # ]:          0 :             if ( pArgs )
     591                 :            :             {
     592                 :            :                 SvxZoomType eZT = ( ( const SvxZoomItem& ) pArgs->
     593                 :          0 :                                             Get( SID_ATTR_ZOOM ) ).GetType();
     594   [ #  #  #  #  :          0 :                 switch( eZT )
                   #  # ]
     595                 :            :                 {
     596                 :            :                     case SVX_ZOOM_PERCENT:
     597                 :            :                         SetZoom( (long) ( ( const SvxZoomItem& ) pArgs->
     598                 :          0 :                                             Get( SID_ATTR_ZOOM ) ).GetValue() );
     599                 :          0 :                         break;
     600                 :            : 
     601                 :            :                     case SVX_ZOOM_OPTIMAL:
     602                 :            :                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_ALL,
     603                 :          0 :                                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
     604                 :          0 :                         break;
     605                 :            : 
     606                 :            :                     case SVX_ZOOM_PAGEWIDTH:
     607                 :            :                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE_WIDTH,
     608                 :          0 :                                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
     609                 :          0 :                         break;
     610                 :            : 
     611                 :            :                     case SVX_ZOOM_WHOLEPAGE:
     612                 :            :                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE,
     613                 :          0 :                                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
     614                 :          0 :                         break;
     615                 :            :                     case SVX_ZOOM_PAGEWIDTH_NOBORDER:
     616                 :            :                         OSL_FAIL("sd::DrawViewShell::FuTemporary(), SVX_ZOOM_PAGEWIDTH_NOBORDER not handled!" );
     617                 :          0 :                         break;
     618                 :            :                 }
     619                 :          0 :                 rReq.Ignore ();
     620                 :            :             }
     621                 :            :             else
     622                 :            :             {
     623                 :            :                 // hier den Zoom-Dialog oeffnen
     624         [ #  # ]:          0 :                 SetCurrentFunction( FuScale::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     625                 :            :             }
     626                 :          0 :             Cancel();
     627                 :            :         }
     628                 :          0 :         break;
     629                 :            : 
     630                 :            :         case SID_CHANGEBEZIER:
     631                 :            :         case SID_CHANGEPOLYGON:
     632         [ #  # ]:          0 :             if ( mpDrawView->IsTextEdit() )
     633                 :            :             {
     634                 :          0 :                 mpDrawView->SdrEndTextEdit();
     635                 :          0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
     636                 :            :             }
     637                 :            : 
     638         [ #  # ]:          0 :             if ( mpDrawView->IsPresObjSelected() )
     639                 :            :             {
     640                 :          0 :                 ::sd::Window* pWindow = GetActiveWindow();
     641 [ #  # ][ #  # ]:          0 :                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
         [ #  # ][ #  # ]
                 [ #  # ]
     642                 :            :             }
     643                 :            :             else
     644                 :            :             {
     645         [ #  # ]:          0 :                 if( rReq.GetSlot() == SID_CHANGEBEZIER )
     646                 :            :                 {
     647 [ #  # ][ #  # ]:          0 :                     WaitObject aWait( (Window*)GetActiveWindow() );
     648 [ #  # ][ #  # ]:          0 :                     mpDrawView->ConvertMarkedToPathObj(sal_False);
     649                 :            :                 }
     650                 :            :                 else
     651                 :            :                 {
     652         [ #  # ]:          0 :                     if( mpDrawView->IsVectorizeAllowed() )
     653         [ #  # ]:          0 :                         SetCurrentFunction( FuVectorize::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     654                 :            :                     else
     655                 :            :                     {
     656 [ #  # ][ #  # ]:          0 :                         WaitObject aWait( (Window*)GetActiveWindow() );
     657 [ #  # ][ #  # ]:          0 :                         mpDrawView->ConvertMarkedToPolyObj(sal_False);
     658                 :            :                     }
     659                 :            :                 }
     660                 :            : 
     661                 :          0 :                 Invalidate(SID_CHANGEBEZIER);
     662                 :          0 :                 Invalidate(SID_CHANGEPOLYGON);
     663                 :            :             }
     664                 :          0 :             Cancel();
     665                 :            : 
     666         [ #  # ]:          0 :             if( HasCurrentFunction(SID_BEZIER_EDIT) )
     667                 :            :             {   // ggf. die richtige Editfunktion aktivieren
     668                 :            :                 GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
     669                 :          0 :                                         SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
     670                 :            :             }
     671                 :          0 :             rReq.Ignore ();
     672                 :          0 :             break;
     673                 :            : 
     674                 :            :         case SID_CONVERT_TO_CONTOUR:
     675         [ #  # ]:          0 :             if ( mpDrawView->IsTextEdit() )
     676                 :            :             {
     677                 :          0 :                 mpDrawView->SdrEndTextEdit();
     678                 :          0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
     679                 :            :             }
     680                 :            : 
     681         [ #  # ]:          0 :             if ( mpDrawView->IsPresObjSelected() )
     682                 :            :             {
     683                 :          0 :                 ::sd::Window* pWindow = GetActiveWindow();
     684 [ #  # ][ #  # ]:          0 :                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
         [ #  # ][ #  # ]
                 [ #  # ]
     685                 :            :             }
     686                 :            :             else
     687                 :            :             {
     688 [ #  # ][ #  # ]:          0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
     689         [ #  # ]:          0 :                 mpDrawView->ConvertMarkedToPathObj(sal_True);
     690                 :            : 
     691 [ #  # ][ #  # ]:          0 :                 Invalidate(SID_CONVERT_TO_CONTOUR);
     692                 :            :             }
     693                 :          0 :             Cancel();
     694                 :            : 
     695                 :          0 :             rReq.Ignore ();
     696                 :          0 :             break;
     697                 :            : 
     698                 :            :         case SID_CONVERT_TO_METAFILE:
     699                 :            :         case SID_CONVERT_TO_BITMAP:
     700                 :            :         {
     701                 :            :             // End text edit mode when it is active because the metafile or
     702                 :            :             // bitmap that will be created does not support it.
     703         [ #  # ]:          0 :             if ( mpDrawView->IsTextEdit() )
     704                 :            :             {
     705                 :          0 :                 mpDrawView->SdrEndTextEdit();
     706                 :          0 :                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
     707                 :            :             }
     708                 :            : 
     709         [ #  # ]:          0 :             if ( mpDrawView->IsPresObjSelected(true,true,true) )
     710                 :            :             {
     711                 :          0 :                 ::sd::Window* pWindow = GetActiveWindow();
     712 [ #  # ][ #  # ]:          0 :                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
         [ #  # ][ #  # ]
                 [ #  # ]
     713                 :            :             }
     714                 :            :             else
     715                 :            :             {
     716 [ #  # ][ #  # ]:          0 :                 WaitObject aWait( (Window*)GetActiveWindow() );
     717                 :            : 
     718                 :            :                 // create SdrGrafObj from metafile/bitmap
     719         [ #  # ]:          0 :                 Graphic aGraphic;
     720      [ #  #  # ]:          0 :                 switch (nSId)
     721                 :            :                 {
     722                 :            :                     case SID_CONVERT_TO_METAFILE:
     723                 :            :                     {
     724                 :            :                         // switch on undo for the next operations
     725 [ #  # ][ #  # ]:          0 :                         mpDrawView->BegUndo( String( SdResId( STR_UNDO_CONVERT_TO_METAFILE )));
         [ #  # ][ #  # ]
     726         [ #  # ]:          0 :                         GDIMetaFile aMetaFile(mpDrawView->GetAllMarkedMetaFile ());
     727 [ #  # ][ #  # ]:          0 :                         aGraphic = Graphic(aMetaFile);
         [ #  # ][ #  # ]
     728                 :            :                     }
     729                 :          0 :                     break;
     730                 :            :                     case SID_CONVERT_TO_BITMAP:
     731                 :            :                     {
     732                 :            :                         // switch on undo for the next operations
     733 [ #  # ][ #  # ]:          0 :                         mpDrawView->BegUndo( String( SdResId( STR_UNDO_CONVERT_TO_BITMAP )));
         [ #  # ][ #  # ]
     734         [ #  # ]:          0 :                         Bitmap aBitmap (mpDrawView->GetAllMarkedBitmap ());
     735 [ #  # ][ #  # ]:          0 :                         aGraphic = Graphic(aBitmap);
         [ #  # ][ #  # ]
     736                 :            :                     }
     737                 :          0 :                     break;
     738                 :            :                 }
     739                 :            : 
     740                 :            :                 // create new object
     741 [ #  # ][ #  # ]:          0 :                 SdrGrafObj* pGraphicObj = new SdrGrafObj (aGraphic);
     742                 :            : 
     743                 :            :                 // get some necessary info and ensure it
     744                 :          0 :                 const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList());
     745                 :          0 :                 const sal_uInt32 nMarkCount(rMarkList.GetMarkCount());
     746                 :          0 :                 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
     747                 :            :                 OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
     748                 :            :                 OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)");
     749                 :            : 
     750                 :            :                 // fit rectangle of new graphic object to selection's mark rect
     751         [ #  # ]:          0 :                 Rectangle aAllMarkedRect;
     752         [ #  # ]:          0 :                 rMarkList.TakeBoundRect(pPageView, aAllMarkedRect);
     753         [ #  # ]:          0 :                 pGraphicObj->SetLogicRect(aAllMarkedRect);
     754                 :            : 
     755                 :            :                 // #i71540# to keep the order, it is necessary to replace the lowest object
     756                 :            :                 // of the selection with the new object. This also means that with multi
     757                 :            :                 // selection, all other objects need to be deleted first
     758         [ #  # ]:          0 :                 SdrMark* pFirstMark = rMarkList.GetMark(0L);
     759         [ #  # ]:          0 :                 SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj();
     760                 :            : 
     761         [ #  # ]:          0 :                 if(nMarkCount > 1L)
     762                 :            :                 {
     763                 :            :                     // take first object out of selection
     764         [ #  # ]:          0 :                     mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true);
     765                 :            : 
     766                 :            :                     // clear remaining selection
     767         [ #  # ]:          0 :                     mpDrawView->DeleteMarkedObj();
     768                 :            :                 }
     769                 :            : 
     770                 :            :                 // now replace lowest object with new one
     771         [ #  # ]:          0 :                 mpDrawView->ReplaceObjectAtView(pReplacementCandidate, *pPageView, pGraphicObj);
     772                 :            : 
     773                 :            :                 // switch off undo
     774 [ #  # ][ #  # ]:          0 :                 mpDrawView->EndUndo();
                 [ #  # ]
     775                 :            :             }
     776                 :            :         }
     777                 :            : 
     778                 :          0 :         Cancel();
     779                 :            : 
     780                 :          0 :         rReq.Done ();
     781                 :          0 :         break;
     782                 :            : 
     783                 :            :         case SID_SET_DEFAULT:
     784                 :            :         {
     785                 :          0 :             SfxItemSet* pSet = NULL;
     786                 :            : 
     787         [ #  # ]:          0 :             if (mpDrawView->IsTextEdit())
     788                 :            :             {
     789                 :          0 :                 ::Outliner* pOutl = mpDrawView->GetTextEditOutliner();
     790         [ #  # ]:          0 :                 if (pOutl)
     791                 :            :                 {
     792                 :          0 :                     pOutl->RemoveFields(sal_True, (TypeId) SvxURLField::StaticType());
     793                 :            :                 }
     794                 :            : 
     795         [ #  # ]:          0 :                 pSet = new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
     796                 :          0 :                 mpDrawView->SetAttributes( *pSet, sal_True );
     797                 :            :             }
     798                 :            :             else
     799                 :            :             {
     800                 :          0 :                 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     801                 :          0 :                 sal_uLong nCount = rMarkList.GetMarkCount();
     802                 :            : 
     803                 :            :                 // In diese Liste werden fuer jedes Praesentationsobjekt ein SfxItemSet
     804                 :            :                 // der harten Attribute sowie der UserCall eingetragen, da diese beim nachfolgenden
     805                 :            :                 // mpDrawView->SetAttributes( *pSet, sal_True ) verloren gehen und spaeter restauriert
     806                 :            :                 // werden muessen
     807         [ #  # ]:          0 :                 std::vector<std::pair<SfxItemSet*,SdrObjUserCall*> > aAttrList;
     808                 :          0 :                 SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage();
     809                 :            :                 sal_uLong i;
     810                 :            : 
     811         [ #  # ]:          0 :                 for ( i = 0; i < nCount; i++ )
     812                 :            :                 {
     813 [ #  # ][ #  # ]:          0 :                     SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
     814                 :            : 
     815 [ #  # ][ #  # ]:          0 :                     if( pPresPage->IsPresObj( pObj ) )
     816                 :            :                     {
     817 [ #  # ][ #  # ]:          0 :                         SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
                 [ #  # ]
     818 [ #  # ][ #  # ]:          0 :                         pNewSet->Put(pObj->GetMergedItemSet());
     819 [ #  # ][ #  # ]:          0 :                         aAttrList.push_back(std::make_pair(pNewSet, pObj->GetUserCall()));
                 [ #  # ]
     820                 :            :                     }
     821                 :            :                 }
     822                 :            : 
     823 [ #  # ][ #  # ]:          0 :                 pSet = new SfxItemSet( GetPool() );
     824         [ #  # ]:          0 :                 mpDrawView->SetAttributes( *pSet, sal_True );
     825                 :            : 
     826                 :          0 :                 sal_uLong j = 0;
     827                 :            : 
     828         [ #  # ]:          0 :                 for ( i = 0; i < nCount; i++ )
     829                 :            :                 {
     830                 :          0 :                     SfxStyleSheet* pSheet = NULL;
     831 [ #  # ][ #  # ]:          0 :                     SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
     832                 :            : 
     833 [ #  # ][ #  # ]:          0 :                     if (pObj->GetObjIdentifier() == OBJ_TITLETEXT)
     834                 :            :                     {
     835         [ #  # ]:          0 :                         pSheet = mpActualPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
     836         [ #  # ]:          0 :                         if (pSheet)
     837         [ #  # ]:          0 :                             pObj->SetStyleSheet(pSheet, sal_False);
     838                 :            :                     }
     839 [ #  # ][ #  # ]:          0 :                     else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
     840                 :            :                     {
     841         [ #  # ]:          0 :                         for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
     842                 :            :                         {
     843         [ #  # ]:          0 :                             pSheet = mpActualPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
     844                 :            :                             DBG_ASSERT(pSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden");
     845         [ #  # ]:          0 :                             if (pSheet)
     846                 :            :                             {
     847         [ #  # ]:          0 :                                 pObj->StartListening(*pSheet);
     848                 :            : 
     849         [ #  # ]:          0 :                                 if( nLevel == 1 )
     850                 :            :                                     // Textrahmen hoert auf StyleSheet der Ebene1
     851         [ #  # ]:          0 :                                     pObj->NbcSetStyleSheet(pSheet, sal_False);
     852                 :            : 
     853                 :            :                             }
     854                 :            :                         }
     855                 :            :                     }
     856                 :            : 
     857 [ #  # ][ #  # ]:          0 :                     if( pPresPage->IsPresObj( pObj ) )
     858                 :            :                     {
     859         [ #  # ]:          0 :                         std::pair<SfxItemSet*,SdrObjUserCall*> &rAttr = aAttrList[j++];
     860                 :            : 
     861                 :          0 :                         SfxItemSet* pNewSet = rAttr.first;
     862                 :          0 :                         SdrObjUserCall* pUserCall = rAttr.second;
     863                 :            : 
     864 [ #  # ][ #  # ]:          0 :                         if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SFX_ITEM_ON )
         [ #  # ][ #  # ]
     865                 :            :                         {
     866 [ #  # ][ #  # ]:          0 :                             pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT));
     867                 :            :                         }
     868                 :            : 
     869 [ #  # ][ #  # ]:          0 :                         if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SFX_ITEM_ON )
         [ #  # ][ #  # ]
     870                 :            :                         {
     871 [ #  # ][ #  # ]:          0 :                             pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT));
     872                 :            :                         }
     873                 :            : 
     874         [ #  # ]:          0 :                         if( pUserCall )
     875         [ #  # ]:          0 :                             pObj->SetUserCall( pUserCall );
     876                 :            : 
     877 [ #  # ][ #  # ]:          0 :                         delete pNewSet;
     878                 :            :                     }
     879                 :          0 :                 }
     880                 :            :             }
     881                 :            : 
     882         [ #  # ]:          0 :             delete pSet;
     883                 :          0 :             Cancel();
     884                 :            :         }
     885                 :          0 :         break;
     886                 :            : 
     887                 :            :         case SID_DELETE_SNAPITEM:
     888                 :            :         {
     889                 :            :             SdrPageView* pPV;
     890 [ #  # ][ #  # ]:          0 :             Point   aMPos = GetActiveWindow()->PixelToLogic( maMousePos );
     891         [ #  # ]:          0 :             sal_uInt16  nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( Size(
     892         [ #  # ]:          0 :                 FuPoor::HITPIX, 0 ) ).Width();
     893                 :            :             sal_uInt16  nHelpLine;
     894                 :            : 
     895                 :          0 :             mbMousePosFreezed = sal_False;
     896                 :            : 
     897 [ #  # ][ #  # ]:          0 :             if( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
                 [ #  # ]
     898                 :            :             {
     899         [ #  # ]:          0 :                 pPV->DeleteHelpLine( nHelpLine );
     900                 :            :             }
     901         [ #  # ]:          0 :             Cancel();
     902         [ #  # ]:          0 :             rReq.Ignore ();
     903                 :            :         }
     904                 :          0 :         break;
     905                 :            : 
     906                 :            :         case SID_DELETE_PAGE:
     907                 :            :         case SID_DELETE_MASTER_PAGE:
     908                 :          0 :             DeleteActualPage();
     909                 :          0 :             Cancel();
     910                 :          0 :             rReq.Ignore ();
     911                 :          0 :         break;
     912                 :            : 
     913                 :            :         case SID_DELETE_LAYER:
     914                 :          0 :             DeleteActualLayer();
     915                 :          0 :             Cancel();
     916                 :          0 :             rReq.Ignore ();
     917                 :          0 :         break;
     918                 :            : 
     919                 :            :         case SID_ORIGINAL_SIZE:
     920                 :          0 :             mpDrawView->SetMarkedOriginalSize();
     921                 :          0 :             Cancel();
     922                 :          0 :             rReq.Done();
     923                 :          0 :         break;
     924                 :            : 
     925                 :            :         case SID_DRAW_FONTWORK:
     926                 :            :         case SID_DRAW_FONTWORK_VERTICAL:
     927                 :            :         {
     928                 :          0 :             svx::FontworkBar::execute( mpView, rReq, GetViewFrame()->GetBindings() );       // SJ: can be removed  (I think)
     929                 :          0 :             Cancel();
     930                 :          0 :             rReq.Done();
     931                 :            :         }
     932                 :          0 :         break;
     933                 :            : 
     934                 :            :         case SID_SAVE_GRAPHIC:
     935                 :            :         {
     936                 :          0 :             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     937         [ #  # ]:          0 :             if( rMarkList.GetMarkCount() == 1 )
     938                 :            :             {
     939                 :          0 :                 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
     940 [ #  # ][ #  # ]:          0 :                 if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
         [ #  # ][ #  # ]
     941                 :            :                 {
     942 [ #  # ][ #  # ]:          0 :                     GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
     943                 :            :                     {
     944 [ #  # ][ #  # ]:          0 :                         GraphicHelper::ExportGraphic( aGraphicObject.GetGraphic(), String("") );
         [ #  # ][ #  # ]
                 [ #  # ]
     945         [ #  # ]:          0 :                     }
     946                 :            :                 }
     947                 :            :             }
     948                 :          0 :             Cancel();
     949                 :          0 :             rReq.Ignore();
     950                 :            :         }
     951                 :          0 :         break;
     952                 :            : 
     953                 :            :         case SID_COMPRESS_GRAPHIC:
     954                 :            :         {
     955                 :          0 :             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     956         [ #  # ]:          0 :             if( rMarkList.GetMarkCount() == 1 )
     957                 :            :             {
     958                 :          0 :                 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
     959 [ #  # ][ #  # ]:          0 :                 if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
         [ #  # ][ #  # ]
     960                 :            :                 {
     961 [ #  # ][ #  # ]:          0 :                     GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
     962                 :            :                     {
     963 [ #  # ][ #  # ]:          0 :                         CompressGraphicsDialog dialog( GetParentWindow(), aGraphicObject.GetGraphic(), pObj->GetLogicRect().GetSize(), GetViewFrame()->GetBindings() );
         [ #  # ][ #  # ]
                 [ #  # ]
     964 [ #  # ][ #  # ]:          0 :                         if ( dialog.Execute() == RET_OK )
     965                 :            :                         {
     966         [ #  # ]:          0 :                             SdrGrafObj* pNewObject = (SdrGrafObj*) pObj->Clone();
     967         [ #  # ]:          0 :                             const Graphic aNewGraphic = dialog.GetCompressedGraphic();
     968                 :          0 :                             SdrPageView* pPageView = mpDrawView->GetSdrPageView();
     969         [ #  # ]:          0 :                             pNewObject->SetEmptyPresObj( sal_False );
     970         [ #  # ]:          0 :                             pNewObject->SetGraphic( aNewGraphic );
     971         [ #  # ]:          0 :                             String aUndoString( mpDrawView->GetDescriptionOfMarkedObjects() );
     972         [ #  # ]:          0 :                             aUndoString += (sal_Unicode) ( ' ' );
     973 [ #  # ][ #  # ]:          0 :                             aUndoString += String( "Compress" );
                 [ #  # ]
     974         [ #  # ]:          0 :                             mpDrawView->BegUndo( aUndoString );
     975         [ #  # ]:          0 :                             mpDrawView->ReplaceObjectAtView( pObj, *pPageView, pNewObject );
     976 [ #  # ][ #  # ]:          0 :                             mpDrawView->EndUndo();
                 [ #  # ]
     977         [ #  # ]:          0 :                         }
     978         [ #  # ]:          0 :                     }
     979                 :            :                 }
     980                 :            :             }
     981                 :          0 :             Cancel();
     982                 :          0 :             rReq.Ignore();
     983                 :            :         }
     984                 :          0 :         break;
     985                 :            : 
     986                 :            :         default:
     987                 :            :         {
     988                 :            :             // switch Anweisung wegen CLOOKS aufgeteilt. Alle case-Anweisungen die
     989                 :            :             // eine Fu???? -Funktion aufrufen, sind in die Methode FuTemp01 (drviews8)
     990                 :            :             // gewandert.
     991                 :          0 :             FuTemp01(rReq);
     992                 :            :         }
     993                 :          0 :         break;
     994                 :            :     }
     995                 :            : 
     996         [ #  # ]:          0 :     if(HasCurrentFunction())
     997                 :            :     {
     998         [ #  # ]:          0 :         GetCurrentFunction()->Activate();
     999                 :            :     }
    1000                 :            : }
    1001                 :            : 
    1002                 :            : 
    1003                 :            : 
    1004                 :            : 
    1005                 :            : /** This method consists basically of three parts:
    1006                 :            :     1. Process the arguments of the SFX request.
    1007                 :            :     2. Use the model to create a new page or duplicate an existing one.
    1008                 :            :     3. Update the tab control and switch to the new page.
    1009                 :            : */
    1010                 :          0 : SdPage* DrawViewShell::CreateOrDuplicatePage (
    1011                 :            :     SfxRequest& rRequest,
    1012                 :            :     PageKind ePageKind,
    1013                 :            :     SdPage* pPage,
    1014                 :            :     const sal_Int32 nInsertPosition)
    1015                 :            : {
    1016                 :          0 :     SdPage* pNewPage = NULL;
    1017 [ #  # ][ #  # ]:          0 :     if (ePageKind == PK_STANDARD && meEditMode != EM_MASTERPAGE)
    1018                 :            :     {
    1019         [ #  # ]:          0 :         if ( mpDrawView->IsTextEdit() )
    1020                 :            :         {
    1021                 :          0 :             mpDrawView->SdrEndTextEdit();
    1022                 :            :         }
    1023                 :          0 :         pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition);
    1024                 :            :     }
    1025                 :          0 :     return pNewPage;
    1026                 :            : }
    1027                 :            : 
    1028                 :            : } // end of namespace sd
    1029                 :            : 
    1030                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10