LCOV - code coverage report
Current view: top level - sd/source/ui/view - drviews6.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 22 307 7.2 %
Date: 2012-08-25 Functions: 1 8 12.5 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 20 348 5.7 %

           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 <vcl/metaact.hxx>
      32                 :            : #include <sfx2/request.hxx>
      33                 :            : #include <sfx2/dispatch.hxx>
      34                 :            : #include <vcl/msgbox.hxx>
      35                 :            : #include <sfx2/viewfrm.hxx>
      36                 :            : #include <svx/svdograf.hxx>
      37                 :            : #include <svx/svxids.hrc>
      38                 :            : #include <svx/fontwork.hxx>
      39                 :            : #include <svx/bmpmask.hxx>
      40                 :            : #include <svx/galbrws.hxx>
      41                 :            : #include <svx/imapdlg.hxx>
      42                 :            : #include <svx/xftsfit.hxx>
      43                 :            : #include <svx/colrctrl.hxx>
      44                 :            : #include <svx/f3dchild.hxx>
      45                 :            : #include "optsitem.hxx"
      46                 :            : #include <svx/extrusionbar.hxx>
      47                 :            : #include <svx/fontworkbar.hxx>
      48                 :            : #include <svx/tbxcustomshapes.hxx>
      49                 :            : #include <avmedia/mediaplayer.hxx>
      50                 :            : 
      51                 :            : #include "app.hrc"
      52                 :            : #include "strings.hrc"
      53                 :            : #include "glob.hrc"
      54                 :            : 
      55                 :            : #include "app.hxx"
      56                 :            : #include "animobjs.hxx"
      57                 :            : #include "AnimationChildWindow.hxx"
      58                 :            : #include "NavigatorChildWindow.hxx"
      59                 :            : #include "LayerDialogChildWindow.hxx"
      60                 :            : #include "sdresid.hxx"
      61                 :            : #include "fupoor.hxx"
      62                 :            : #include "fusldlg.hxx"
      63                 :            : #include "drawdoc.hxx"
      64                 :            : #include "fuexpand.hxx"
      65                 :            : #include "fusumry.hxx"
      66                 :            : #include "fucushow.hxx"
      67                 :            : #include "drawview.hxx"
      68                 :            : #include "FrameView.hxx"
      69                 :            : #include "Window.hxx"
      70                 :            : #include "DrawDocShell.hxx"
      71                 :            : #include "sdabstdlg.hxx"
      72                 :            : #include "framework/FrameworkHelper.hxx"
      73                 :            : 
      74                 :            : namespace sd {
      75                 :            : 
      76                 :            : /*************************************************************************
      77                 :            : |*
      78                 :            : |* SfxRequests fuer FontWork bearbeiten
      79                 :            : |*
      80                 :            : \************************************************************************/
      81                 :            : 
      82                 :          0 : void DrawViewShell::ExecFormText(SfxRequest& rReq)
      83                 :            : {
      84                 :            :     // waehrend einer Diashow wird nichts ausgefuehrt!
      85         [ #  # ]:          0 :     if(HasCurrentFunction(SID_PRESENTATION))
      86                 :          0 :         return;
      87                 :            : 
      88                 :          0 :     CheckLineTo (rReq);
      89                 :            : 
      90                 :          0 :     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
      91                 :            : 
      92         [ #  # ]:          0 :     if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() &&
           [ #  #  #  # ]
         [ #  # ][ #  # ]
      93                 :          0 :          mpDrawView && !mpDrawView->IsPresObjSelected() )
      94                 :            :     {
      95                 :          0 :         const SfxItemSet& rSet = *rReq.GetArgs();
      96                 :            :         const SfxPoolItem* pItem;
      97                 :            : 
      98 [ #  # ][ #  # ]:          0 :         if ( mpDrawView->IsTextEdit() )
      99         [ #  # ]:          0 :             mpDrawView->SdrEndTextEdit();
     100                 :            : 
     101         [ #  # ]:          0 :         if ( rSet.GetItemState(XATTR_FORMTXTSTDFORM, sal_True, &pItem) ==
           [ #  #  #  # ]
                 [ #  # ]
     102                 :            :              SFX_ITEM_SET &&
     103                 :          0 :             ((const XFormTextStdFormItem*) pItem)->GetValue() != XFTFORM_NONE )
     104                 :            :         {
     105                 :            : 
     106         [ #  # ]:          0 :             sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
     107                 :            : 
     108                 :            :             SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*)GetViewFrame()->
     109 [ #  # ][ #  # ]:          0 :                                         GetChildWindow(nId)->GetWindow();
     110                 :            : 
     111                 :          0 :             pDlg->CreateStdFormObj(*mpDrawView, *mpDrawView->GetSdrPageView(),
     112 [ #  # ][ #  # ]:          0 :                                     rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
     113                 :            :                                    ((const XFormTextStdFormItem*) pItem)->
     114         [ #  # ]:          0 :                                    GetValue());
     115                 :            : 
     116 [ #  # ][ #  # ]:          0 :             if(HasCurrentFunction(SID_BEZIER_EDIT))
     117                 :            :             {   // ggf. die richtige Editfunktion aktivieren
     118                 :            :                 GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
     119 [ #  # ][ #  # ]:          0 :                                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
     120                 :            :             }
     121                 :            :         }
     122                 :            :         else
     123         [ #  # ]:          0 :             mpDrawView->SetAttributes(rSet);
     124                 :            :     }
     125                 :            : }
     126                 :            : 
     127                 :            : /*************************************************************************
     128                 :            : |*
     129                 :            : |* Statuswerte fuer FontWork zurueckgeben
     130                 :            : |*
     131                 :            : \************************************************************************/
     132                 :            : 
     133                 :          0 : void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
     134                 :            : {
     135                 :          0 :     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     136                 :          0 :     const SdrObject* pObj = NULL;
     137                 :          0 :     SvxFontWorkDialog* pDlg = NULL;
     138                 :            : 
     139                 :          0 :     sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
     140                 :            : 
     141         [ #  # ]:          0 :     if ( GetViewFrame()->HasChildWindow(nId) )
     142                 :          0 :         pDlg = (SvxFontWorkDialog*)(GetViewFrame()->GetChildWindow(nId)->GetWindow());
     143                 :            : 
     144         [ #  # ]:          0 :     if ( rMarkList.GetMarkCount() == 1 )
     145                 :          0 :         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     146                 :            : 
     147         [ #  # ]:          0 :     if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
           [ #  #  #  # ]
                 [ #  # ]
     148                 :          0 :         !((SdrTextObj*) pObj)->HasText() )
     149                 :            :     {
     150                 :            : // automatisches Auf/Zuklappen des FontWork-Dialog; erstmal deaktiviert
     151                 :            : 
     152                 :          0 :         rSet.DisableItem(XATTR_FORMTXTSTYLE);
     153                 :          0 :         rSet.DisableItem(XATTR_FORMTXTADJUST);
     154                 :          0 :         rSet.DisableItem(XATTR_FORMTXTDISTANCE);
     155                 :          0 :         rSet.DisableItem(XATTR_FORMTXTSTART);
     156                 :          0 :         rSet.DisableItem(XATTR_FORMTXTMIRROR);
     157                 :          0 :         rSet.DisableItem(XATTR_FORMTXTSTDFORM);
     158                 :          0 :         rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
     159                 :          0 :         rSet.DisableItem(XATTR_FORMTXTOUTLINE);
     160                 :          0 :         rSet.DisableItem(XATTR_FORMTXTSHADOW);
     161                 :          0 :         rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
     162                 :          0 :         rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
     163                 :          0 :         rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
     164                 :            :     }
     165                 :            :     else
     166                 :            :     {
     167         [ #  # ]:          0 :         if ( pDlg )
     168 [ #  # ][ #  # ]:          0 :             pDlg->SetColorList(GetDoc()->GetColorList());
                 [ #  # ]
     169                 :            : 
     170 [ #  # ][ #  # ]:          0 :         SfxItemSet aSet( GetDoc()->GetPool() );
     171         [ #  # ]:          0 :         mpDrawView->GetAttributes( aSet );
     172 [ #  # ][ #  # ]:          0 :         rSet.Set( aSet );
     173                 :            :     }
     174                 :          0 : }
     175                 :            : 
     176                 :            : /*************************************************************************
     177                 :            : |*
     178                 :            : |* SfxRequests fuer Animator bearbeiten
     179                 :            : |*
     180                 :            : \************************************************************************/
     181                 :            : 
     182                 :          0 : void DrawViewShell::ExecAnimationWin( SfxRequest& rReq )
     183                 :            : {
     184                 :            :     // waehrend einer Diashow wird nichts ausgefuehrt!
     185         [ #  # ]:          0 :     if (HasCurrentFunction(SID_PRESENTATION))
     186                 :          0 :         return;
     187                 :            : 
     188                 :          0 :     CheckLineTo (rReq);
     189                 :            : 
     190                 :          0 :     sal_uInt16 nSId = rReq.GetSlot();
     191                 :            : 
     192         [ #  # ]:          0 :     switch( nSId )
     193                 :            :     {
     194                 :            :         case SID_ANIMATOR_INIT:
     195                 :            :         case SID_ANIMATOR_ADD:
     196                 :            :         case SID_ANIMATOR_CREATE:
     197                 :            :         {
     198                 :            :             AnimationWindow* pAnimWin;
     199                 :          0 :             sal_uInt16 nId = AnimationChildWindow::GetChildWindowId();
     200                 :            : 
     201                 :            :             pAnimWin = static_cast<AnimationWindow*>(
     202                 :          0 :                 GetViewFrame()->GetChildWindow(nId)->GetWindow());
     203                 :            : 
     204         [ #  # ]:          0 :             if ( pAnimWin )
     205                 :            :             {
     206         [ #  # ]:          0 :                 if( nSId == SID_ANIMATOR_ADD )
     207                 :          0 :                     pAnimWin->AddObj( *mpDrawView );
     208         [ #  # ]:          0 :                 else if( nSId == SID_ANIMATOR_CREATE )
     209                 :          0 :                     pAnimWin->CreateAnimObj( *mpDrawView );
     210                 :            :             }
     211                 :            :         }
     212                 :          0 :         break;
     213                 :            : 
     214                 :            :         default:
     215                 :          0 :         break;
     216                 :            :     }
     217                 :            : }
     218                 :            : 
     219                 :            : /*************************************************************************
     220                 :            : |*
     221                 :            : |* Statuswerte fuer Animator zurueckgeben
     222                 :            : |*
     223                 :            : |* nValue == 0 -> Kein Button
     224                 :            : |* nValue == 1 -> Button 'uebernehmen'
     225                 :            : |* nValue == 2 -> Button 'einzeln uebernehmen'
     226                 :            : |* nValue == 3 -> Buttons 'uebernehmen' und 'einzeln uebernehmen'
     227                 :            : |*
     228                 :            : \************************************************************************/
     229                 :            : 
     230                 :          0 : void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet )
     231                 :            : {
     232                 :            :     // Hier koennten Buttons etc. disabled werden
     233                 :            :     sal_uInt16 nValue;
     234                 :            : 
     235                 :          0 :     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
     236                 :          0 :     sal_uLong nMarkCount = rMarkList.GetMarkCount();
     237                 :            : 
     238         [ #  # ]:          0 :     if( nMarkCount == 0 )
     239                 :          0 :         nValue = 0;
     240         [ #  # ]:          0 :     else if( nMarkCount > 1 )
     241                 :          0 :         nValue = 3;
     242                 :            :     else // 1 Objekt
     243                 :            :     {
     244                 :          0 :         const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
     245                 :          0 :         sal_uInt32 nInv = pObj->GetObjInventor();
     246                 :          0 :         sal_uInt16 nId  = pObj->GetObjIdentifier();
     247                 :            :         // 1 selektiertes Gruppenobjekt
     248 [ #  # ][ #  # ]:          0 :         if( nInv == SdrInventor && nId == OBJ_GRUP )
     249                 :          0 :             nValue = 3;
     250 [ #  # ][ #  # ]:          0 :         else if( nInv == SdrInventor && nId == OBJ_GRAF ) // Anim. GIF ?
     251                 :            :         {
     252                 :          0 :             sal_uInt16 nCount = 0;
     253                 :            : 
     254         [ #  # ]:          0 :             if( ( (SdrGrafObj*) pObj )->IsAnimated() )
     255                 :          0 :                 nCount = ( (SdrGrafObj*) pObj )->GetGraphic().GetAnimation().Count();
     256         [ #  # ]:          0 :             if( nCount > 0 )
     257                 :          0 :                 nValue = 2;
     258                 :            :             else
     259                 :          0 :                 nValue = 1;
     260                 :            :         }
     261                 :            :         else
     262                 :          0 :             nValue = 1;
     263                 :            :     }
     264         [ #  # ]:          0 :     rSet.Put( SfxUInt16Item( SID_ANIMATOR_STATE, nValue ) );
     265                 :          0 : }
     266                 :            : 
     267                 :            : /*************************************************************************
     268                 :            : |*
     269                 :            : |* Statuswerte fuer SfxChildWindows setzen
     270                 :            : |*
     271                 :            : \************************************************************************/
     272                 :            : 
     273                 :       6385 : void DrawViewShell::SetChildWindowState( SfxItemSet& rSet )
     274                 :            : {
     275                 :            :     // Stati der SfxChild-Windows (Animator, Fontwork etc.)
     276         [ -  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_FONTWORK ) )
     277                 :            :     {
     278                 :          0 :         sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
     279         [ #  # ]:          0 :         rSet.Put(SfxBoolItem(SID_FONTWORK, GetViewFrame()->HasChildWindow(nId)));
     280                 :            :     }
     281         [ -  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COLOR_CONTROL ) )
     282                 :            :     {
     283                 :          0 :         sal_uInt16 nId = SvxColorChildWindow::GetChildWindowId();
     284         [ #  # ]:          0 :         rSet.Put(SfxBoolItem(SID_COLOR_CONTROL, GetViewFrame()->HasChildWindow(nId)));
     285                 :            :     }
     286         [ +  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ANIMATION_OBJECTS ) )
     287                 :            :     {
     288                 :         29 :         sal_uInt16 nId = AnimationChildWindow::GetChildWindowId();
     289         [ +  - ]:         29 :         rSet.Put( SfxBoolItem( SID_ANIMATION_OBJECTS, GetViewFrame()->HasChildWindow( nId ) ) );
     290                 :            :     }
     291         [ +  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_NAVIGATOR ) )
     292                 :            :     {
     293                 :        241 :         sal_uInt16 nId = SID_NAVIGATOR;
     294         [ +  - ]:        241 :         rSet.Put( SfxBoolItem( SID_NAVIGATOR, GetViewFrame()->HasChildWindow( nId ) ) );
     295                 :            :     }
     296         [ -  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BMPMASK ) )
     297                 :            :     {
     298                 :          0 :         sal_uInt16 nId = SvxBmpMaskChildWindow::GetChildWindowId();
     299         [ #  # ]:          0 :         rSet.Put( SfxBoolItem( SID_BMPMASK, GetViewFrame()->HasChildWindow( nId ) ) );
     300                 :            :     }
     301         [ +  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_GALLERY ) )
     302                 :            :     {
     303                 :        184 :         sal_uInt16 nId = GalleryChildWindow::GetChildWindowId();
     304         [ +  - ]:        184 :         rSet.Put( SfxBoolItem( SID_GALLERY, GetViewFrame()->HasChildWindow( nId ) ) );
     305                 :            :     }
     306         [ +  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_IMAP ) )
     307                 :            :     {
     308                 :        184 :         sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
     309         [ +  - ]:        184 :         rSet.Put( SfxBoolItem( SID_IMAP, GetViewFrame()->HasChildWindow( nId ) ) );
     310                 :            :     }
     311         [ -  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_LAYER_DIALOG_WIN ) )
     312                 :            :     {
     313                 :          0 :         sal_uInt16 nId = LayerDialogChildWindow::GetChildWindowId();
     314         [ #  # ]:          0 :         rSet.Put( SfxBoolItem( SID_LAYER_DIALOG_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
     315                 :            :     }
     316         [ +  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_3D_WIN ) )
     317                 :            :     {
     318                 :        223 :         sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId();
     319         [ +  - ]:        223 :         rSet.Put( SfxBoolItem( SID_3D_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
     320                 :            :     }
     321         [ -  + ]:       6385 :     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_AVMEDIA_PLAYER ) )
     322                 :            :     {
     323                 :          0 :         sal_uInt16 nId = ::avmedia::MediaPlayer::GetChildWindowId();
     324         [ #  # ]:          0 :         rSet.Put( SfxBoolItem( SID_AVMEDIA_PLAYER, GetViewFrame()->HasChildWindow( nId ) ) );
     325                 :            :     }
     326                 :       6385 : }
     327                 :            : 
     328                 :            : 
     329                 :            : /*************************************************************************
     330                 :            : |*
     331                 :            : |* SfxRequests fuer Pipette bearbeiten
     332                 :            : |*
     333                 :            : \************************************************************************/
     334                 :            : 
     335                 :          0 : void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
     336                 :            : {
     337                 :            :     // waehrend einer Diashow wird nichts ausgefuehrt!
     338         [ #  # ]:          0 :     if (HasCurrentFunction(SID_PRESENTATION))
     339                 :          0 :         return;
     340                 :            : 
     341      [ #  #  # ]:          0 :     switch ( rReq.GetSlot() )
     342                 :            :     {
     343                 :            :         case ( SID_BMPMASK_PIPETTE ) :
     344                 :            :         {
     345                 :          0 :             mbPipette = ( (const SfxBoolItem&) ( rReq.GetArgs()->
     346                 :          0 :                        Get( SID_BMPMASK_PIPETTE ) ) ).GetValue();
     347                 :            :         }
     348                 :          0 :         break;
     349                 :            : 
     350                 :            :         case ( SID_BMPMASK_EXEC ) :
     351                 :            :         {
     352                 :          0 :             SdrGrafObj* pObj = 0;
     353 [ #  # ][ #  # ]:          0 :             if( mpDrawView && mpDrawView->GetMarkedObjectList().GetMarkCount() )
                 [ #  # ]
     354         [ #  # ]:          0 :                 pObj = dynamic_cast< SdrGrafObj* >( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() );
     355                 :            : 
     356 [ #  # ][ #  # ]:          0 :             if ( pObj && !mpDrawView->IsTextEdit() )
                 [ #  # ]
     357                 :            :             {
     358                 :          0 :                 SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone();
     359                 :          0 :                 sal_Bool        bCont = sal_True;
     360                 :            : 
     361         [ #  # ]:          0 :                 if( pNewObj->IsLinkedGraphic() )
     362                 :            :                 {
     363         [ #  # ]:          0 :                     QueryBox aQBox( (Window*) GetActiveWindow(), WB_YES_NO | WB_DEF_YES,
     364 [ #  # ][ #  # ]:          0 :                                     String( SdResId( STR_RELEASE_GRAPHICLINK ) ) );
         [ #  # ][ #  # ]
     365                 :            : 
     366 [ #  # ][ #  # ]:          0 :                     if( RET_YES == aQBox.Execute() )
     367         [ #  # ]:          0 :                         pNewObj->ReleaseGraphicLink();
     368                 :            :                     else
     369                 :            :                     {
     370 [ #  # ][ #  # ]:          0 :                         delete pNewObj;
     371                 :          0 :                         bCont = sal_False;
     372         [ #  # ]:          0 :                     }
     373                 :            :                 }
     374                 :            : 
     375         [ #  # ]:          0 :                 if( bCont )
     376                 :            :                 {
     377         [ #  # ]:          0 :                     const Graphic&  rOldGraphic = pNewObj->GetGraphic();
     378                 :            :                     const Graphic   aNewGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
     379 [ #  # ][ #  # ]:          0 :                                                  SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
                 [ #  # ]
     380         [ #  # ]:          0 :                                                  Mask( rOldGraphic ) );
     381                 :            : 
     382 [ #  # ][ #  # ]:          0 :                     if( aNewGraphic != rOldGraphic )
     383                 :            :                     {
     384                 :          0 :                         SdrPageView* pPV = mpDrawView->GetSdrPageView();
     385                 :            : 
     386         [ #  # ]:          0 :                         pNewObj->SetEmptyPresObj( sal_False );
     387                 :            :                         pNewObj->SetGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
     388 [ #  # ][ #  # ]:          0 :                                              SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
                 [ #  # ]
     389   [ #  #  #  # ]:          0 :                                              Mask( pNewObj->GetGraphic() ) );
         [ #  # ][ #  # ]
     390                 :            : 
     391         [ #  # ]:          0 :                         String aStr( mpDrawView->GetDescriptionOfMarkedObjects() );
     392 [ #  # ][ #  # ]:          0 :                         aStr += (sal_Unicode)( ' ' ), aStr += String( SdResId( STR_EYEDROPPER ) );
         [ #  # ][ #  # ]
                 [ #  # ]
     393                 :            : 
     394         [ #  # ]:          0 :                         mpDrawView->BegUndo( aStr );
     395         [ #  # ]:          0 :                         mpDrawView->ReplaceObjectAtView( pObj, *pPV, pNewObj );
     396 [ #  # ][ #  # ]:          0 :                         mpDrawView->EndUndo();
     397         [ #  # ]:          0 :                     }
     398                 :            :                 }
     399                 :            :             }
     400                 :            :         }
     401                 :          0 :         break;
     402                 :            : 
     403                 :            :         default:
     404                 :          0 :         break;
     405                 :            :     }
     406                 :            : }
     407                 :            : 
     408                 :          0 : void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet )
     409                 :            : {
     410                 :          0 :     const SdrMarkList&  rMarkList = mpDrawView->GetMarkedObjectList();
     411                 :          0 :     const SdrObject*    pObj = NULL;
     412                 :          0 :     sal_uInt16              nId = SvxBmpMaskChildWindow::GetChildWindowId();
     413                 :          0 :     SvxBmpMask*         pDlg = NULL;
     414                 :          0 :     sal_Bool                bEnable = sal_False;
     415                 :            : 
     416         [ #  # ]:          0 :     if ( GetViewFrame()->HasChildWindow( nId ) )
     417                 :            :     {
     418                 :          0 :         pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
     419                 :            : 
     420         [ #  # ]:          0 :         if ( pDlg->NeedsColorList() )
     421         [ #  # ]:          0 :             pDlg->SetColorList( GetDoc()->GetColorList() );
     422                 :            :     }
     423                 :            : 
     424         [ #  # ]:          0 :     if ( rMarkList.GetMarkCount() == 1 )
     425                 :          0 :         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     426                 :            : 
     427                 :            :     // valid graphic object?
     428 [ #  # ][ #  #  :          0 :     if( pObj && pObj->ISA( SdrGrafObj ) &&
             #  #  #  # ]
                 [ #  # ]
     429         [ #  # ]:          0 :         !( ((SdrGrafObj*) pObj)->IsEPS() || ((SdrGrafObj*) pObj)->IsRenderGraphic() ) &&
     430                 :          0 :         !mpDrawView->IsTextEdit() )
     431                 :            :     {
     432                 :          0 :         bEnable = sal_True;
     433                 :            :     }
     434                 :            : 
     435                 :            :     // put value
     436         [ #  # ]:          0 :     rSet.Put( SfxBoolItem( SID_BMPMASK_EXEC, bEnable ) );
     437                 :          0 : }
     438                 :            : 
     439                 :            : /*************************************************************************
     440                 :            : |*
     441                 :            : |* SfxRequests fuer temporaere Funktionen
     442                 :            : |*
     443                 :            : \************************************************************************/
     444                 :            : 
     445                 :          0 : void DrawViewShell::FuTemp04(SfxRequest& rReq)
     446                 :            : {
     447                 :          0 :     sal_uInt16 nSId = rReq.GetSlot();
     448   [ #  #  #  #  :          0 :     switch( nSId )
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                   #  # ]
     449                 :            :     {
     450                 :            :         case SID_FONTWORK:
     451                 :            :         {
     452         [ #  # ]:          0 :             if ( rReq.GetArgs() )
     453                 :            :             {
     454                 :          0 :                 GetViewFrame()->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
     455                 :          0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
     456                 :          0 :                                         Get(SID_FONTWORK))).GetValue());
     457                 :            :             }
     458                 :            :             else
     459                 :            :             {
     460                 :          0 :                 GetViewFrame()->ToggleChildWindow( SvxFontWorkChildWindow::GetChildWindowId() );
     461                 :            :             }
     462                 :            : 
     463                 :          0 :             GetViewFrame()->GetBindings().Invalidate(SID_FONTWORK);
     464                 :          0 :             Cancel();
     465                 :          0 :             rReq.Ignore ();
     466                 :            :         }
     467                 :          0 :         break;
     468                 :            : 
     469                 :            :         case SID_COLOR_CONTROL:
     470                 :            :         {
     471         [ #  # ]:          0 :             if ( rReq.GetArgs() )
     472                 :          0 :                 GetViewFrame()->SetChildWindow(SvxColorChildWindow::GetChildWindowId(),
     473                 :          0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
     474                 :          0 :                                         Get(SID_COLOR_CONTROL))).GetValue());
     475                 :            :             else
     476                 :          0 :                 GetViewFrame()->ToggleChildWindow(SvxColorChildWindow::GetChildWindowId() );
     477                 :            : 
     478                 :          0 :             GetViewFrame()->GetBindings().Invalidate(SID_COLOR_CONTROL);
     479                 :          0 :             Cancel();
     480                 :          0 :             rReq.Ignore ();
     481                 :            :         }
     482                 :          0 :         break;
     483                 :            : 
     484                 :            :         case SID_EXTRUSION_TOOGLE:
     485                 :            :         case SID_EXTRUSION_TILT_DOWN:
     486                 :            :         case SID_EXTRUSION_TILT_UP:
     487                 :            :         case SID_EXTRUSION_TILT_LEFT:
     488                 :            :         case SID_EXTRUSION_TILT_RIGHT:
     489                 :            :         case SID_EXTRUSION_3D_COLOR:
     490                 :            :         case SID_EXTRUSION_DEPTH:
     491                 :            :         case SID_EXTRUSION_DIRECTION:
     492                 :            :         case SID_EXTRUSION_PROJECTION:
     493                 :            :         case SID_EXTRUSION_LIGHTING_DIRECTION:
     494                 :            :         case SID_EXTRUSION_LIGHTING_INTENSITY:
     495                 :            :         case SID_EXTRUSION_SURFACE:
     496                 :            :         case SID_EXTRUSION_DEPTH_FLOATER:
     497                 :            :         case SID_EXTRUSION_DIRECTION_FLOATER:
     498                 :            :         case SID_EXTRUSION_LIGHTING_FLOATER:
     499                 :            :         case SID_EXTRUSION_SURFACE_FLOATER:
     500                 :            :         case SID_EXTRUSION_DEPTH_DIALOG:
     501                 :          0 :             svx::ExtrusionBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
     502                 :          0 :             Cancel();
     503                 :          0 :             rReq.Ignore ();
     504                 :          0 :             break;
     505                 :            : 
     506                 :            :         case SID_FONTWORK_SHAPE:
     507                 :            :         case SID_FONTWORK_SHAPE_TYPE:
     508                 :            :         case SID_FONTWORK_ALIGNMENT:
     509                 :            :         case SID_FONTWORK_SAME_LETTER_HEIGHTS:
     510                 :            :         case SID_FONTWORK_CHARACTER_SPACING:
     511                 :            :         case SID_FONTWORK_KERN_CHARACTER_PAIRS:
     512                 :            :         case SID_FONTWORK_GALLERY_FLOATER:
     513                 :            :         case SID_FONTWORK_CHARACTER_SPACING_FLOATER:
     514                 :            :         case SID_FONTWORK_ALIGNMENT_FLOATER:
     515                 :            :         case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
     516                 :          0 :             svx::FontworkBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
     517                 :          0 :             Cancel();
     518                 :          0 :             rReq.Ignore ();
     519                 :          0 :             break;
     520                 :            : 
     521                 :            :         case SID_BMPMASK:
     522                 :            :         {
     523                 :          0 :             GetViewFrame()->ToggleChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() );
     524                 :          0 :             GetViewFrame()->GetBindings().Invalidate( SID_BMPMASK );
     525                 :            : 
     526                 :          0 :             Cancel();
     527                 :          0 :             rReq.Ignore ();
     528                 :            :         }
     529                 :          0 :         break;
     530                 :            : 
     531                 :            :         case SID_GALLERY:
     532                 :            :         {
     533                 :          0 :             GetViewFrame()->ToggleChildWindow( GalleryChildWindow::GetChildWindowId() );
     534                 :          0 :             GetViewFrame()->GetBindings().Invalidate( SID_GALLERY );
     535                 :            : 
     536                 :          0 :             Cancel();
     537                 :          0 :             rReq.Ignore ();
     538                 :            :         }
     539                 :          0 :         break;
     540                 :            : 
     541                 :            :         case SID_NAVIGATOR:
     542                 :            :         {
     543         [ #  # ]:          0 :             if ( rReq.GetArgs() )
     544                 :            :                 GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
     545                 :          0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
     546                 :          0 :                                         Get(SID_NAVIGATOR))).GetValue());
     547                 :            :             else
     548                 :          0 :                 GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
     549                 :            : 
     550                 :          0 :             GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
     551                 :          0 :             Cancel();
     552                 :          0 :             rReq.Ignore ();
     553                 :            :         }
     554                 :          0 :         break;
     555                 :            : 
     556                 :            :         case SID_ANIMATION_OBJECTS:
     557                 :            :         {
     558         [ #  # ]:          0 :             if ( rReq.GetArgs() )
     559                 :            :                 GetViewFrame()->SetChildWindow(
     560                 :          0 :                     AnimationChildWindow::GetChildWindowId(),
     561                 :          0 :                     ((const SfxBoolItem&) (rReq.GetArgs()->
     562                 :          0 :                         Get(SID_ANIMATION_OBJECTS))).GetValue());
     563                 :            :             else
     564                 :            :                 GetViewFrame()->ToggleChildWindow(
     565                 :          0 :                     AnimationChildWindow::GetChildWindowId() );
     566                 :            : 
     567                 :          0 :             GetViewFrame()->GetBindings().Invalidate(SID_ANIMATION_OBJECTS);
     568                 :          0 :             Cancel();
     569                 :          0 :             rReq.Ignore ();
     570                 :            :         }
     571                 :          0 :         break;
     572                 :            : 
     573                 :            :         case SID_CUSTOM_ANIMATION_PANEL:
     574                 :            :         {
     575                 :            :             // Make the slide transition panel visible (expand it) in the
     576                 :            :             // tool pane.
     577                 :          0 :             framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
     578         [ #  # ]:          0 :                 framework::FrameworkHelper::msCustomAnimationTaskPanelURL);
     579                 :            : 
     580                 :          0 :             Cancel();
     581                 :          0 :             rReq.Done ();
     582                 :            :         }
     583                 :          0 :         break;
     584                 :            : 
     585                 :            :         case SID_SLIDE_TRANSITIONS_PANEL:
     586                 :            :         {
     587                 :            :             // Make the slide transition panel visible (expand it) in the
     588                 :            :             // tool pane.
     589                 :          0 :             framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
     590         [ #  # ]:          0 :                 framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
     591                 :            : 
     592                 :          0 :             Cancel();
     593                 :          0 :             rReq.Done ();
     594                 :            :         }
     595                 :          0 :         break;
     596                 :            : 
     597                 :            :         case SID_3D_WIN:
     598                 :            :         {
     599         [ #  # ]:          0 :             if ( rReq.GetArgs() )
     600                 :          0 :                 GetViewFrame()->SetChildWindow( Svx3DChildWindow::GetChildWindowId(),
     601                 :          0 :                                         ((const SfxBoolItem&) (rReq.GetArgs()->
     602                 :          0 :                                         Get( SID_3D_WIN ))).GetValue());
     603                 :            :             else
     604                 :          0 :                 GetViewFrame()->ToggleChildWindow( Svx3DChildWindow::GetChildWindowId() );
     605                 :            : 
     606                 :          0 :             GetViewFrame()->GetBindings().Invalidate( SID_3D_WIN );
     607                 :          0 :             Cancel();
     608                 :          0 :             rReq.Ignore ();
     609                 :            :         }
     610                 :          0 :         break;
     611                 :            : 
     612                 :            :         case SID_CONVERT_TO_3D_LATHE_FAST:
     613                 :            :         {
     614                 :            :             // Der Aufruf ist ausreichend. Die Initialisierung per Start3DCreation und CreateMirrorPolygons
     615                 :            :             // ist nicht mehr noetig, falls der Parameter sal_True uebergeben wird. Dann wird sofort und
     616                 :            :             // ohne Benutzereingriff ein gekippter Rotationskoerper mit einer Achse links neben dem
     617                 :            :             // Umschliessenden Rechteck der slektierten Objekte gezeichnet.
     618                 :          0 :             mpDrawView->SdrEndTextEdit();
     619         [ #  # ]:          0 :             if(GetActiveWindow())
     620                 :          0 :                 GetActiveWindow()->EnterWait();
     621                 :          0 :             mpDrawView->End3DCreation(sal_True);
     622                 :          0 :             Cancel();
     623                 :          0 :             rReq.Ignore();
     624         [ #  # ]:          0 :             if(GetActiveWindow())
     625                 :          0 :                 GetActiveWindow()->LeaveWait();
     626                 :            :         }
     627                 :          0 :         break;
     628                 :            : 
     629                 :            :         case SID_PRESENTATION_DLG:
     630                 :            :         {
     631         [ #  # ]:          0 :             SetCurrentFunction( FuSlideShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     632                 :          0 :             Cancel();
     633                 :            :         }
     634                 :          0 :         break;
     635                 :            : 
     636                 :            :         case SID_REMOTE_DLG:
     637                 :            :         {
     638                 :          0 :              SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
     639         [ #  # ]:          0 :              VclAbstractDialog* pDlg = pFact ? pFact->CreateRemoteDialog(GetActiveWindow()) : 0;
     640         [ #  # ]:          0 :              if (pDlg)
     641                 :          0 :                  pDlg->Execute();
     642                 :            :         }
     643                 :          0 :         break;
     644                 :            : 
     645                 :            :         case SID_CUSTOMSHOW_DLG:
     646                 :            :         {
     647         [ #  # ]:          0 :             SetCurrentFunction( FuCustomShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     648                 :          0 :             Cancel();
     649                 :            :         }
     650                 :          0 :         break;
     651                 :            : 
     652                 :            :         case SID_EXPAND_PAGE:
     653                 :            :         {
     654         [ #  # ]:          0 :             SetCurrentFunction( FuExpandPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     655                 :          0 :             Cancel();
     656                 :            :         }
     657                 :          0 :         break;
     658                 :            : 
     659                 :            :         case SID_SUMMARY_PAGE:
     660                 :            :         {
     661                 :          0 :             mpDrawView->SdrEndTextEdit();
     662         [ #  # ]:          0 :             SetCurrentFunction( FuSummaryPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
     663                 :          0 :             Cancel();
     664                 :            :         }
     665                 :          0 :         break;
     666                 :            : 
     667                 :            :         case SID_AVMEDIA_PLAYER:
     668                 :            :         {
     669                 :          0 :             GetViewFrame()->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() );
     670                 :          0 :             GetViewFrame()->GetBindings().Invalidate( SID_AVMEDIA_PLAYER );
     671                 :          0 :             Cancel();
     672                 :          0 :             rReq.Ignore ();
     673                 :            :         }
     674                 :          0 :         break;
     675                 :            : 
     676                 :            :         case SID_LAYER_DIALOG_WIN:
     677                 :            :         {
     678         [ #  # ]:          0 :             if ( rReq.GetArgs() )
     679                 :            :             {
     680                 :            :                 GetViewFrame()->SetChildWindow(
     681                 :          0 :                     LayerDialogChildWindow::GetChildWindowId(),
     682                 :          0 :                     ((const SfxBoolItem&) (rReq.GetArgs()->
     683                 :          0 :                         Get(SID_LAYER_DIALOG_WIN))).GetValue());
     684                 :            :             }
     685                 :            :             else
     686                 :            :             {
     687                 :            :                 GetViewFrame()->ToggleChildWindow(
     688                 :          0 :                     LayerDialogChildWindow::GetChildWindowId());
     689                 :            :             }
     690                 :            : 
     691                 :          0 :             GetViewFrame()->GetBindings().Invalidate(SID_LAYER_DIALOG_WIN);
     692                 :          0 :             Cancel();
     693                 :          0 :             rReq.Ignore ();
     694                 :            :         }
     695                 :          0 :         break;
     696                 :            : 
     697                 :            :         case SID_DISPLAY_MASTER_BACKGROUND:
     698                 :            :         case SID_DISPLAY_MASTER_OBJECTS:
     699                 :            :         {
     700                 :            :             // Determine current page and toggle visibility of layers
     701                 :            :             // associated with master page background or master page shapes.
     702                 :          0 :             SdPage* pPage = GetActualPage();
     703         [ #  # ]:          0 :             if (pPage != NULL
           [ #  #  #  # ]
     704                 :          0 :                 && GetDoc() != NULL)
     705                 :            :             {
     706         [ #  # ]:          0 :                 SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
     707         [ #  # ]:          0 :                 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
     708                 :            :                 sal_uInt8 aLayerId;
     709         [ #  # ]:          0 :                 if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
     710 [ #  # ][ #  # ]:          0 :                     aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
         [ #  # ][ #  # ]
     711                 :            :                 else
     712 [ #  # ][ #  # ]:          0 :                     aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
         [ #  # ][ #  # ]
     713                 :          0 :                 aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
     714         [ #  # ]:          0 :                 pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
     715                 :            :             }
     716                 :          0 :             Cancel();
     717                 :          0 :             rReq.Ignore ();
     718                 :            :         }
     719                 :          0 :         break;
     720                 :            : 
     721                 :            :         default:
     722                 :            :         {
     723                 :            :             DBG_ASSERT( 0, "Slot ohne Funktion" );
     724                 :          0 :             Cancel();
     725                 :          0 :             rReq.Ignore ();
     726                 :            :         }
     727                 :          0 :         break;
     728                 :            :     }
     729                 :          0 : }
     730                 :            : 
     731                 :            : } // end of namespace sd
     732                 :            : 
     733                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10