LCOV - code coverage report
Current view: top level - sd/source/ui/docshell - docshel3.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 71 0.0 %
Date: 2014-04-14 Functions: 0 4 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "DrawDocShell.hxx"
      21             : 
      22             : #include "app.hrc"
      23             : 
      24             : #include <svx/svxids.hrc>
      25             : #include <svx/dialogs.hrc>
      26             : 
      27             : #include <svx/ofaitem.hxx>
      28             : #include <svx/svxerr.hxx>
      29             : #include <svx/dialmgr.hxx>
      30             : #include <svl/srchitem.hxx>
      31             : #include <svx/srchdlg.hxx>
      32             : #include <sfx2/request.hxx>
      33             : #include <svl/style.hxx>
      34             : #include <svx/drawitem.hxx>
      35             : #include <editeng/unolingu.hxx>
      36             : #include <com/sun/star/i18n/TextConversionOption.hpp>
      37             : 
      38             : #include "strings.hrc"
      39             : #include "glob.hrc"
      40             : #include "res_bmp.hrc"
      41             : 
      42             : #include "sdmod.hxx"
      43             : #include "drawdoc.hxx"
      44             : #include "sdpage.hxx"
      45             : #include "sdattr.hxx"
      46             : #include "fusearch.hxx"
      47             : #include "ViewShell.hxx"
      48             : #include "View.hxx"
      49             : #include "slideshow.hxx"
      50             : #include "fuhhconv.hxx"
      51             : 
      52             : using namespace ::com::sun::star;
      53             : using namespace ::com::sun::star::beans;
      54             : using namespace ::com::sun::star::uno;
      55             : 
      56             : namespace sd {
      57             : 
      58             : /**
      59             :  * Handles SFX-Requests
      60             :  */
      61           0 : void DrawDocShell::Execute( SfxRequest& rReq )
      62             : {
      63           0 :     if(mpViewShell && SlideShow::IsRunning( mpViewShell->GetViewShellBase() ))
      64             :     {
      65             :         // during a running presentation no slot will be executed
      66           0 :         return;
      67             :     }
      68             : 
      69           0 :     switch ( rReq.GetSlot() )
      70             :     {
      71             :         case SID_SEARCH_ITEM:
      72             :         {
      73           0 :             const SfxItemSet* pReqArgs = rReq.GetArgs();
      74             : 
      75           0 :             if (pReqArgs)
      76             :             {
      77             :                 const SvxSearchItem* pSearchItem =
      78           0 :                 (const SvxSearchItem*) &pReqArgs->Get(SID_SEARCH_ITEM);
      79             : 
      80             :                 // would be nice to have an an assign operation at SearchItem
      81           0 :                 SvxSearchItem* pAppSearchItem = SD_MOD()->GetSearchItem();
      82           0 :                 delete pAppSearchItem;
      83           0 :                 pAppSearchItem = (SvxSearchItem*) pSearchItem->Clone();
      84           0 :                 SD_MOD()->SetSearchItem(pAppSearchItem);
      85             :             }
      86             : 
      87           0 :             rReq.Done();
      88             :         }
      89           0 :         break;
      90             : 
      91             :         case FID_SEARCH_ON:
      92             :         {
      93             :             // no action needed
      94           0 :             rReq.Done();
      95             :         }
      96           0 :         break;
      97             : 
      98             :         case FID_SEARCH_OFF:
      99             :         {
     100           0 :             if( dynamic_cast< FuSearch* >(mxDocShellFunction.get()) )
     101             :             {
     102             :                 // End Search&Replace in all docshells
     103           0 :                 SfxObjectShell* pFirstShell = SfxObjectShell::GetFirst();
     104           0 :                 SfxObjectShell* pShell = pFirstShell;
     105             : 
     106           0 :                 while (pShell)
     107             :                 {
     108           0 :                     if (pShell->ISA(DrawDocShell))
     109             :                     {
     110           0 :                         ( (DrawDocShell*) pShell)->CancelSearching();
     111             :                     }
     112             : 
     113           0 :                     pShell = SfxObjectShell::GetNext(*pShell);
     114             : 
     115           0 :                     if (pShell == pFirstShell)
     116             :                     {
     117           0 :                         pShell = NULL;
     118             :                     }
     119             :                 }
     120             : 
     121           0 :                 SetDocShellFunction(0);
     122           0 :                 Invalidate();
     123           0 :                 rReq.Done();
     124             :             }
     125             :         }
     126           0 :         break;
     127             : 
     128             :         case FID_SEARCH_NOW:
     129             :         {
     130           0 :             const SfxItemSet* pReqArgs = rReq.GetArgs();
     131             : 
     132           0 :             if ( pReqArgs )
     133             :             {
     134           0 :                 rtl::Reference< FuSearch > xFuSearch( dynamic_cast< FuSearch* >( GetDocShellFunction().get() ) );
     135             : 
     136           0 :                 if( !xFuSearch.is() && mpViewShell )
     137             :                 {
     138           0 :                     ::sd::View* pView = mpViewShell->GetView();
     139           0 :                     SetDocShellFunction( FuSearch::Create( mpViewShell, mpViewShell->GetActiveWindow(), pView, mpDoc, rReq ) );
     140           0 :                     xFuSearch.set( dynamic_cast< FuSearch* >( GetDocShellFunction().get() ) );
     141             :                 }
     142             : 
     143           0 :                 if( xFuSearch.is() )
     144             :                 {
     145             :                     const SvxSearchItem* pSearchItem =
     146           0 :                     (const SvxSearchItem*) &pReqArgs->Get(SID_SEARCH_ITEM);
     147             : 
     148             :                     // would be nice to have an an assign operation at SearchItem
     149           0 :                     SvxSearchItem* pAppSearchItem = SD_MOD()->GetSearchItem();
     150           0 :                     delete pAppSearchItem;
     151           0 :                     pAppSearchItem = (SvxSearchItem*)pSearchItem->Clone();
     152           0 :                     SD_MOD()->SetSearchItem(pAppSearchItem);
     153           0 :                     xFuSearch->SearchAndReplace(pSearchItem);
     154           0 :                 }
     155             :             }
     156             : 
     157           0 :             rReq.Done();
     158             :         }
     159           0 :         break;
     160             : 
     161             :         case SID_CLOSEDOC:
     162             :         {
     163           0 :             ExecuteSlot(rReq, SfxObjectShell::GetStaticInterface());
     164             :         }
     165           0 :         break;
     166             : 
     167             :         case SID_GET_COLORLIST:
     168             :         {
     169           0 :             SvxColorListItem* pColItem = (SvxColorListItem*) GetItem( SID_COLOR_TABLE );
     170           0 :             XColorListRef pList = pColItem->GetColorList();
     171           0 :             rReq.SetReturnValue( OfaRefItem<XColorList>( SID_GET_COLORLIST, pList ) );
     172             :         }
     173           0 :         break;
     174             : 
     175             :         case SID_VERSION:
     176             :         {
     177           0 :             const sal_uLong nOldSwapMode = mpDoc->GetSwapGraphicsMode();
     178             : 
     179           0 :             mpDoc->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_TEMP );
     180           0 :             ExecuteSlot( rReq, SfxObjectShell::GetStaticInterface() );
     181           0 :             mpDoc->SetSwapGraphicsMode( nOldSwapMode );
     182             :         }
     183           0 :         break;
     184             : 
     185             :         case SID_HANGUL_HANJA_CONVERSION:
     186             :         {
     187           0 :             if( mpViewShell )
     188             :             {
     189           0 :                 rtl::Reference<FuPoor> aFunc( FuHangulHanjaConversion::Create( mpViewShell, mpViewShell->GetActiveWindow(), mpViewShell->GetView(), mpDoc, rReq ) );
     190           0 :                 static_cast< FuHangulHanjaConversion* >( aFunc.get() )->StartConversion( LANGUAGE_KOREAN, LANGUAGE_KOREAN, NULL, i18n::TextConversionOption::CHARACTER_BY_CHARACTER, sal_True );
     191             :             }
     192             :         }
     193           0 :         break;
     194             : 
     195             :         case SID_CHINESE_CONVERSION:
     196             :         {
     197           0 :             if( mpViewShell )
     198             :             {
     199           0 :                 rtl::Reference<FuPoor> aFunc( FuHangulHanjaConversion::Create( mpViewShell, mpViewShell->GetActiveWindow(), mpViewShell->GetView(), mpDoc, rReq ) );
     200           0 :                 static_cast< FuHangulHanjaConversion* >( aFunc.get() )->StartChineseConversion();
     201             :             }
     202             :         }
     203           0 :         break;
     204             : 
     205             :         default:
     206           0 :         break;
     207             :     }
     208             : }
     209             : 
     210           0 : void DrawDocShell::SetDocShellFunction( const rtl::Reference<FuPoor>& xFunction )
     211             : {
     212           0 :     if( mxDocShellFunction.is() )
     213           0 :         mxDocShellFunction->Dispose();
     214             : 
     215           0 :     mxDocShellFunction = xFunction;
     216           0 : }
     217             : 
     218           0 : } // end of namespace sd
     219             : 
     220             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10