LCOV - code coverage report
Current view: top level - libreoffice/sd/source/ui/unoidl - SdUnoDrawView.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 245 0.0 %
Date: 2012-12-27 Functions: 0 27 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             : 
      21             : #include "SdUnoDrawView.hxx"
      22             : 
      23             : #include "DrawController.hxx"
      24             : #include "DrawDocShell.hxx"
      25             : #include "DrawViewShell.hxx"
      26             : #include "drawdoc.hxx"
      27             : #include "unolayer.hxx"
      28             : #include "unomodel.hxx"
      29             : #include "unopage.hxx"
      30             : #include "Window.hxx"
      31             : #include "pres.hxx"
      32             : 
      33             : #include <cppuhelper/proptypehlp.hxx>
      34             : #include <comphelper/serviceinfohelper.hxx>
      35             : #include <sfx2/dispatch.hxx>
      36             : #include <sfx2/viewfrm.hxx>
      37             : #include <svx/svdpagv.hxx>
      38             : #include <svx/unoshape.hxx>
      39             : #include <svx/unoshcol.hxx>
      40             : #include <sfx2/zoomitem.hxx>
      41             : #include <com/sun/star/drawing/DrawViewMode.hpp>
      42             : #include <com/sun/star/drawing/XLayerManager.hpp>
      43             : #include <com/sun/star/view/DocumentZoomType.hpp>
      44             : 
      45             : #include <vector>
      46             : 
      47             : using rtl::OUString;
      48             : 
      49             : using namespace ::com::sun::star;
      50             : using namespace ::com::sun::star::uno;
      51             : using namespace ::com::sun::star::drawing;
      52             : 
      53             : 
      54             : namespace sd {
      55             : 
      56           0 : SdUnoDrawView::SdUnoDrawView(
      57             :     DrawViewShell& rViewShell,
      58             :     View& rView) throw()
      59             :     :   DrawSubControllerInterfaceBase(m_aMutex),
      60             :         mrDrawViewShell(rViewShell),
      61           0 :         mrView(rView)
      62             : {
      63           0 : }
      64             : 
      65             : 
      66             : 
      67             : 
      68           0 : SdUnoDrawView::~SdUnoDrawView() throw()
      69             : {
      70           0 : }
      71             : 
      72             : 
      73             : 
      74             : 
      75           0 : sal_Bool SdUnoDrawView::getMasterPageMode(void) const throw()
      76             : {
      77           0 :     return (mrDrawViewShell.GetEditMode() == EM_MASTERPAGE);
      78             : }
      79             : 
      80             : 
      81             : 
      82             : 
      83           0 : void SdUnoDrawView::setMasterPageMode (sal_Bool bMasterPageMode) throw()
      84             : {
      85           0 :     if ((mrDrawViewShell.GetEditMode() == EM_MASTERPAGE) != bMasterPageMode)
      86             :     {
      87             :         mrDrawViewShell.ChangeEditMode (
      88             :             bMasterPageMode ? EM_MASTERPAGE : EM_PAGE,
      89           0 :             mrDrawViewShell.IsLayerModeActive());
      90             :     }
      91           0 : }
      92             : 
      93             : 
      94             : 
      95             : 
      96           0 : sal_Bool SdUnoDrawView::getLayerMode(void) const throw()
      97             : {
      98           0 :     return mrDrawViewShell.IsLayerModeActive();
      99             : }
     100             : 
     101             : 
     102             : 
     103             : 
     104           0 : void SdUnoDrawView::setLayerMode (sal_Bool bLayerMode) throw()
     105             : {
     106           0 :     if (mrDrawViewShell.IsLayerModeActive() != (bLayerMode==sal_True))
     107             :     {
     108             :         mrDrawViewShell.ChangeEditMode (
     109             :             mrDrawViewShell.GetEditMode(),
     110           0 :             bLayerMode);
     111             :     }
     112           0 : }
     113             : 
     114             : 
     115             : 
     116             : 
     117           0 : Reference<drawing::XLayer> SdUnoDrawView::getActiveLayer (void) throw ()
     118             : {
     119           0 :     Reference<drawing::XLayer> xCurrentLayer;
     120             : 
     121             :     do
     122             :     {
     123             :         // Retrieve the layer manager from the model.
     124           0 :         SdXImpressDocument* pModel = GetModel();
     125           0 :         if (pModel == NULL)
     126             :             break;
     127             : 
     128           0 :         SdDrawDocument* pSdModel = pModel->GetDoc();
     129           0 :         if (pSdModel == NULL)
     130             :             break;
     131             : 
     132             :         // From the model get the current SdrLayer object via the layer admin.
     133           0 :         SdrLayerAdmin& rLayerAdmin = pSdModel->GetLayerAdmin ();
     134           0 :         SdrLayer* pLayer = rLayerAdmin.GetLayer (mrView.GetActiveLayer(), sal_True);
     135           0 :         if (pLayer == NULL)
     136             :             break;
     137             : 
     138             :         // Get the corresponding XLayer object from the implementation
     139             :         // object of the layer manager.
     140           0 :         Reference<drawing::XLayerManager> xManager (pModel->getLayerManager(), uno::UNO_QUERY);
     141           0 :         SdLayerManager* pManager = SdLayerManager::getImplementation (xManager);
     142           0 :         if (pManager != NULL)
     143           0 :             xCurrentLayer = pManager->GetLayer (pLayer);
     144             :     }
     145             :     while (false);
     146             : 
     147           0 :     return xCurrentLayer;
     148             : }
     149             : 
     150             : 
     151             : 
     152             : 
     153           0 : void SdUnoDrawView::setActiveLayer (const Reference<drawing::XLayer>& rxLayer) throw ()
     154             : {
     155             :     // Get the SdrLayer object corresponding to the given reference.
     156           0 :     if ( ! rxLayer.is())
     157           0 :         return;
     158             : 
     159           0 :     SdLayer* pLayer = SdLayer::getImplementation (rxLayer);
     160           0 :     if (pLayer == NULL)
     161           0 :         return;
     162             : 
     163           0 :     SdrLayer* pSdrLayer = pLayer->GetSdrLayer();
     164           0 :     if (pSdrLayer == NULL)
     165           0 :         return;
     166             : 
     167             :     // Set the new active layer and make the change visible.
     168           0 :     mrView.SetActiveLayer (pSdrLayer->GetName());
     169           0 :     mrDrawViewShell.ResetActualLayer ();
     170             : }
     171             : 
     172             : 
     173             : 
     174             : 
     175             : // XSelectionSupplier
     176             : 
     177             : 
     178           0 : sal_Bool SAL_CALL SdUnoDrawView::select( const Any& aSelection )
     179             :     throw(lang::IllegalArgumentException, RuntimeException)
     180             : {
     181           0 :     bool bOk = true;
     182             : 
     183           0 :     ::std::vector<SdrObject*> aObjects;
     184             : 
     185           0 :     SdrPage* pSdrPage = NULL;
     186             : 
     187           0 :     Reference< drawing::XShape > xShape;
     188           0 :     aSelection >>= xShape;
     189             : 
     190           0 :     if(xShape.is())
     191             :     {
     192           0 :         SvxShape* pShape = SvxShape::getImplementation( xShape );
     193           0 :         if( pShape && (pShape->GetSdrObject() != NULL) )
     194             :         {
     195           0 :             SdrObject* pObj = pShape->GetSdrObject();
     196           0 :             pSdrPage = pObj->GetPage();
     197           0 :             aObjects.push_back( pObj );
     198             :         }
     199             :         else
     200             :         {
     201           0 :             bOk = false;
     202             :         }
     203             :     }
     204             :     else
     205             :     {
     206           0 :         Reference< drawing::XShapes > xShapes;
     207           0 :         aSelection >>= xShapes;
     208           0 :         if( xShapes.is() )
     209             :         {
     210           0 :             const sal_uInt32 nCount = xShapes->getCount();
     211           0 :             for( sal_uInt32 i = 0; i < nCount; i++ )
     212             :             {
     213           0 :                 xShapes->getByIndex(i) >>= xShape;
     214           0 :                 if( xShape.is() )
     215             :                 {
     216           0 :                     SvxShape* pShape = SvxShape::getImplementation(xShape);
     217           0 :                     if( (pShape == NULL) || (pShape->GetSdrObject() == NULL) )
     218             :                     {
     219           0 :                         bOk = false;
     220             :                         break;
     221             :                     }
     222             : 
     223           0 :                     SdrObject* pObj = pShape->GetSdrObject();
     224             : 
     225           0 :                     if( pSdrPage == NULL )
     226             :                     {
     227           0 :                         pSdrPage = pObj->GetPage();
     228             :                     }
     229           0 :                     else if( pSdrPage != pObj->GetPage() )
     230             :                     {
     231           0 :                         bOk = false;
     232             :                         break;
     233             :                     }
     234             : 
     235           0 :                     aObjects.push_back( pObj );
     236             :                 }
     237             :             }
     238           0 :         }
     239             :     }
     240             : 
     241           0 :     if( bOk )
     242             :     {
     243           0 :         if( pSdrPage )
     244             :         {
     245           0 :             setMasterPageMode( pSdrPage->IsMasterPage() );
     246           0 :             mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNum() - 1) >> 1 );
     247           0 :             mrDrawViewShell.WriteFrameViewData();
     248             :         }
     249             : 
     250           0 :         SdrPageView *pPV = mrView.GetSdrPageView();
     251             : 
     252           0 :         if(pPV)
     253             :         {
     254             :             // first deselect all
     255           0 :             mrView.UnmarkAllObj( pPV );
     256             : 
     257           0 :             ::std::vector<SdrObject*>::iterator aIter( aObjects.begin() );
     258           0 :             const ::std::vector<SdrObject*>::iterator aEnd( aObjects.end() );
     259           0 :             while( aIter != aEnd )
     260             :             {
     261           0 :                 SdrObject* pObj = (*aIter++);
     262           0 :                 mrView.MarkObj( pObj, pPV );
     263             :             }
     264             :         }
     265             :         else
     266             :         {
     267           0 :             bOk = false;
     268             :         }
     269             :     }
     270             : 
     271           0 :     return bOk;
     272             : }
     273             : 
     274             : //----------------------------------------------------------------------
     275             : 
     276           0 : Any SAL_CALL SdUnoDrawView::getSelection()
     277             :     throw(RuntimeException)
     278             : {
     279           0 :     Any aAny;
     280             : 
     281           0 :     if( mrView.IsTextEdit() )
     282           0 :         mrView.getTextSelection( aAny );
     283             : 
     284             : 
     285           0 :     if( !aAny.hasValue() )
     286             :     {
     287           0 :         const SdrMarkList& rMarkList = mrView.GetMarkedObjectList();
     288           0 :         sal_uInt32 nCount = rMarkList.GetMarkCount();
     289           0 :         if( nCount )
     290             :         {
     291           0 :             Reference< drawing::XShapes > xShapes( SvxShapeCollection_NewInstance(), UNO_QUERY );
     292           0 :             for( sal_uInt32 nNum = 0; nNum < nCount; nNum++)
     293             :             {
     294           0 :                 SdrMark *pMark = rMarkList.GetMark(nNum);
     295           0 :                 if(pMark==NULL)
     296           0 :                     continue;
     297             : 
     298           0 :                 SdrObject *pObj = pMark->GetMarkedSdrObj();
     299           0 :                 if(pObj==NULL || pObj->GetPage() == NULL)
     300           0 :                     continue;
     301             : 
     302           0 :                 Reference< drawing::XDrawPage > xPage( pObj->GetPage()->getUnoPage(), UNO_QUERY);
     303             : 
     304           0 :                 if(!xPage.is())
     305           0 :                     continue;
     306             : 
     307           0 :                 SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
     308             : 
     309           0 :                 if(pDrawPage==NULL)
     310           0 :                     continue;
     311             : 
     312           0 :                 Reference< drawing::XShape > xShape( pObj->getUnoShape(), UNO_QUERY );
     313             : 
     314           0 :                 if(xShape.is())
     315           0 :                     xShapes->add(xShape);
     316           0 :             }
     317           0 :             aAny <<= xShapes;
     318             :         }
     319             :     }
     320             : 
     321           0 :     return aAny;
     322             : }
     323             : 
     324             : 
     325             : 
     326             : 
     327           0 : void SAL_CALL SdUnoDrawView::addSelectionChangeListener (
     328             :     const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
     329             :     throw(css::uno::RuntimeException)
     330             : {
     331             :     (void)rxListener;
     332           0 : }
     333             : 
     334             : 
     335             : 
     336             : 
     337           0 : void SAL_CALL SdUnoDrawView::removeSelectionChangeListener (
     338             :     const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
     339             :     throw(css::uno::RuntimeException)
     340             : {
     341             :     (void)rxListener;
     342           0 : }
     343             : 
     344             : 
     345             : 
     346             : 
     347           0 : void SdUnoDrawView::setFastPropertyValue (
     348             :     sal_Int32 nHandle,
     349             :         const Any& rValue)
     350             :     throw(css::beans::UnknownPropertyException,
     351             :         css::beans::PropertyVetoException,
     352             :         css::lang::IllegalArgumentException,
     353             :         css::lang::WrappedTargetException,
     354             :         css::uno::RuntimeException)
     355             : {
     356           0 :     switch( nHandle )
     357             :     {
     358             :         case DrawController::PROPERTY_CURRENTPAGE:
     359             :             {
     360           0 :                 Reference< drawing::XDrawPage > xPage;
     361           0 :                 rValue >>= xPage;
     362           0 :                 setCurrentPage( xPage );
     363             :             }
     364           0 :             break;
     365             : 
     366             :         case DrawController::PROPERTY_MASTERPAGEMODE:
     367             :             {
     368           0 :                 sal_Bool bValue = sal_False;
     369           0 :                 rValue >>= bValue;
     370           0 :                 setMasterPageMode( bValue );
     371             :             }
     372           0 :             break;
     373             : 
     374             :         case DrawController::PROPERTY_LAYERMODE:
     375             :             {
     376           0 :                 sal_Bool bValue = sal_False;
     377           0 :                 rValue >>= bValue;
     378           0 :                 setLayerMode( bValue );
     379             :             }
     380             : 
     381             :         case DrawController::PROPERTY_ACTIVE_LAYER:
     382             :             {
     383           0 :                 Reference<drawing::XLayer> xLayer;
     384           0 :                 rValue >>= xLayer;
     385           0 :                 setActiveLayer (xLayer);
     386             :             }
     387           0 :             break;
     388             :         case DrawController::PROPERTY_ZOOMVALUE:
     389             :             {
     390           0 :                 sal_Int16 nZoom = 0;
     391           0 :                 rValue >>= nZoom;
     392           0 :                 SetZoom( nZoom );
     393             :             }
     394           0 :             break;
     395             :         case DrawController::PROPERTY_ZOOMTYPE:
     396             :             {
     397           0 :                 sal_Int16 nType = 0;
     398           0 :                 rValue >>= nType;
     399           0 :                 SetZoomType( nType );
     400             :             }
     401           0 :             break;
     402             :         case DrawController::PROPERTY_VIEWOFFSET:
     403             :             {
     404           0 :                 awt::Point aOffset;
     405           0 :                 rValue >>= aOffset;
     406           0 :                 SetViewOffset( aOffset );
     407             :             }
     408           0 :             break;
     409             :         default:
     410           0 :             throw beans::UnknownPropertyException();
     411             :     }
     412           0 : }
     413             : 
     414             : 
     415             : 
     416             : 
     417           0 : Any SAL_CALL SdUnoDrawView::getFastPropertyValue (
     418             :     sal_Int32 nHandle)
     419             :     throw(css::beans::UnknownPropertyException,
     420             :         css::lang::WrappedTargetException,
     421             :         css::uno::RuntimeException)
     422             : {
     423           0 :     Any aValue;
     424           0 :     switch( nHandle )
     425             :     {
     426             :         case DrawController::PROPERTY_CURRENTPAGE:
     427           0 :             aValue <<= (const_cast<SdUnoDrawView*>(this))->getCurrentPage();
     428           0 :             break;
     429             : 
     430             :         case DrawController::PROPERTY_MASTERPAGEMODE:
     431           0 :             aValue <<= getMasterPageMode();
     432           0 :             break;
     433             : 
     434             :         case DrawController::PROPERTY_LAYERMODE:
     435           0 :             aValue <<= getLayerMode();
     436           0 :             break;
     437             : 
     438             :         case DrawController::PROPERTY_ACTIVE_LAYER:
     439           0 :             aValue <<= (const_cast<SdUnoDrawView*>(this))->getActiveLayer();
     440           0 :             break;
     441             : 
     442             :         case DrawController::PROPERTY_ZOOMVALUE:
     443           0 :             aValue <<= GetZoom();
     444           0 :             break;
     445             :         case DrawController::PROPERTY_ZOOMTYPE:
     446           0 :             aValue <<= (sal_Int16)com::sun::star::view::DocumentZoomType::BY_VALUE;
     447           0 :             break;
     448             :         case DrawController::PROPERTY_VIEWOFFSET:
     449           0 :             aValue <<= GetViewOffset();
     450           0 :             break;
     451             : 
     452             :         case DrawController::PROPERTY_DRAWVIEWMODE:
     453           0 :             aValue = getDrawViewMode();
     454           0 :             break;
     455             : 
     456             :         default:
     457           0 :             throw beans::UnknownPropertyException();
     458             :     }
     459             : 
     460           0 :     return aValue;
     461             : }
     462             : 
     463             : 
     464             : 
     465             : 
     466             : // XDrawView
     467             : 
     468             : 
     469           0 : void SAL_CALL SdUnoDrawView::setCurrentPage (
     470             :     const Reference< drawing::XDrawPage >& xPage )
     471             :     throw(RuntimeException)
     472             : {
     473           0 :     SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
     474           0 :     SdrPage *pSdrPage = pDrawPage ? pDrawPage->GetSdrPage() : NULL;
     475             : 
     476           0 :     if(pSdrPage)
     477             :     {
     478             :         // End editing of text.  Otherwise the edited text object would
     479             :         // still be visible on the new page.
     480           0 :         mrDrawViewShell.GetView()->SdrEndTextEdit();
     481             : 
     482           0 :         setMasterPageMode( pSdrPage->IsMasterPage() );
     483           0 :         mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNum() - 1) >> 1 );
     484           0 :         mrDrawViewShell.WriteFrameViewData();
     485             :     }
     486           0 : }
     487             : 
     488             : //----------------------------------------------------------------------
     489             : 
     490           0 : Reference< drawing::XDrawPage > SAL_CALL SdUnoDrawView::getCurrentPage()
     491             :     throw(RuntimeException)
     492             : {
     493           0 :     Reference< drawing::XDrawPage >  xPage;
     494             : 
     495           0 :     SdrPageView *pPV = mrView.GetSdrPageView();
     496           0 :     SdrPage* pPage = pPV ? pPV->GetPage() : NULL;
     497             : 
     498           0 :     if(pPage)
     499           0 :         xPage = Reference< drawing::XDrawPage >::query( pPage->getUnoPage() );
     500             : 
     501           0 :     return xPage;
     502             : }
     503             : 
     504             : 
     505           0 : sal_Int16 SdUnoDrawView::GetZoom(void) const
     506             : {
     507           0 :     if (mrDrawViewShell.GetActiveWindow() )
     508             :     {
     509           0 :         return (sal_Int16)mrDrawViewShell.GetActiveWindow()->GetZoom();
     510             :     }
     511             :     else
     512             :     {
     513           0 :         return 0;
     514             :     }
     515             : }
     516             : 
     517           0 : void SdUnoDrawView::SetZoom( sal_Int16 nZoom )
     518             : {
     519           0 :     SvxZoomItem aZoomItem( SVX_ZOOM_PERCENT, nZoom );
     520             : 
     521           0 :     SfxViewFrame* pViewFrame = mrDrawViewShell.GetViewFrame();
     522           0 :     if( pViewFrame )
     523             :     {
     524           0 :         SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
     525           0 :         if( pDispatcher )
     526             :         {
     527           0 :             pDispatcher->Execute(SID_ATTR_ZOOM,SFX_CALLMODE_SYNCHRON,&aZoomItem, 0L);
     528             :         }
     529           0 :     }
     530           0 : }
     531             : 
     532             : 
     533           0 : void SdUnoDrawView::SetViewOffset(const awt::Point& rWinPos )
     534             : {
     535           0 :     Point aWinPos( rWinPos.X, rWinPos.Y );
     536           0 :     aWinPos += mrDrawViewShell.GetViewOrigin();
     537           0 :     mrDrawViewShell.SetWinViewPos( aWinPos, true );
     538           0 : }
     539             : 
     540           0 : awt::Point SdUnoDrawView::GetViewOffset() const
     541             : {
     542           0 :     Point aRet;
     543             : 
     544           0 :     aRet = mrDrawViewShell.GetWinViewPos();
     545           0 :     aRet -= mrDrawViewShell.GetViewOrigin();
     546             : 
     547           0 :     return awt::Point( aRet.X(), aRet.Y() );
     548             : }
     549             : 
     550           0 : void SdUnoDrawView::SetZoomType ( sal_Int16 nType )
     551             : {
     552           0 :     SfxViewFrame* pViewFrame = mrDrawViewShell.GetViewFrame();
     553           0 :     if( pViewFrame )
     554             :     {
     555           0 :         SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
     556           0 :         if( pDispatcher )
     557             :         {
     558             :             SvxZoomType eZoomType;
     559           0 :             switch( nType )
     560             :             {
     561             :                 case com::sun::star::view::DocumentZoomType::OPTIMAL:
     562           0 :                     eZoomType = SVX_ZOOM_OPTIMAL;
     563           0 :                     break;
     564             : 
     565             :                 case com::sun::star::view::DocumentZoomType::PAGE_WIDTH:
     566             :                 case com::sun::star::view::DocumentZoomType::PAGE_WIDTH_EXACT:
     567           0 :                     eZoomType = SVX_ZOOM_PAGEWIDTH;
     568           0 :                     break;
     569             : 
     570             :                 case com::sun::star::view::DocumentZoomType::ENTIRE_PAGE:
     571           0 :                     eZoomType = SVX_ZOOM_WHOLEPAGE;
     572           0 :                     break;
     573             : 
     574             :                 default:
     575           0 :                     return;
     576             :             }
     577           0 :             SvxZoomItem aZoomItem( eZoomType );
     578           0 :             pDispatcher->Execute(SID_ATTR_ZOOM,SFX_CALLMODE_SYNCHRON,&aZoomItem, 0L);
     579             :         }
     580             :     }
     581             : }
     582             : 
     583             : 
     584             : 
     585             : 
     586           0 : SdXImpressDocument* SdUnoDrawView::GetModel (void) const throw()
     587             : {
     588           0 :     if (mrView.GetDocSh()!=NULL)
     589             :     {
     590           0 :         Reference<frame::XModel> xModel (mrView.GetDocSh()->GetModel());
     591           0 :         return SdXImpressDocument::getImplementation(xModel);
     592             :     }
     593             :     else
     594           0 :         return NULL;
     595             : }
     596             : 
     597           0 : Any SdUnoDrawView::getDrawViewMode() const
     598             : {
     599           0 :     Any aRet;
     600           0 :     switch( mrDrawViewShell.GetPageKind() )
     601             :     {
     602           0 :     case PK_NOTES:  aRet <<= DrawViewMode_NOTES; break;
     603           0 :     case PK_HANDOUT: aRet <<= DrawViewMode_HANDOUT; break;
     604           0 :     case PK_STANDARD: aRet <<= DrawViewMode_DRAW; break;
     605             :     }
     606           0 :     return aRet;
     607             : }
     608             : 
     609             : // XServiceInfo
     610           0 : OUString SAL_CALL SdUnoDrawView::getImplementationName(  ) throw (RuntimeException)
     611             : {
     612           0 :     return OUString( "com.sun.star.comp.sd.SdUnoDrawView") ;
     613             : }
     614             : 
     615           0 : sal_Bool SAL_CALL SdUnoDrawView::supportsService( const OUString& ServiceName ) throw (RuntimeException)
     616             : {
     617           0 :     return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() );
     618             : }
     619             : 
     620           0 : Sequence< OUString > SAL_CALL SdUnoDrawView::getSupportedServiceNames(  ) throw (RuntimeException)
     621             : {
     622           0 :     OUString aSN("com.sun.star.drawing.DrawingDocumentDrawView");
     623           0 :     uno::Sequence< OUString > aSeq( &aSN, 1 );
     624           0 :     return aSeq;
     625             : }
     626             : 
     627             : } // end of namespace sd
     628             : 
     629             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10