LCOV - code coverage report
Current view: top level - sd/source/ui/unoidl - SdUnoDrawView.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 250 0.0 %
Date: 2014-04-14 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 <comphelper/processfactory.hxx>
      34             : #include <cppuhelper/proptypehlp.hxx>
      35             : #include <cppuhelper/supportsservice.hxx>
      36             : #include <sfx2/dispatch.hxx>
      37             : #include <sfx2/viewfrm.hxx>
      38             : #include <svx/svdpagv.hxx>
      39             : #include <svx/unoshape.hxx>
      40             : #include <sfx2/zoomitem.hxx>
      41             : #include <com/sun/star/drawing/DrawViewMode.hpp>
      42             : #include <com/sun/star/drawing/ShapeCollection.hpp>
      43             : #include <com/sun/star/drawing/XLayerManager.hpp>
      44             : #include <com/sun/star/view/DocumentZoomType.hpp>
      45             : 
      46             : #include <vector>
      47             : 
      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 (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           0 :             break;
     127             : 
     128           0 :         SdDrawDocument* pSdModel = pModel->GetDoc();
     129           0 :         if (pSdModel == NULL)
     130           0 :             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(), true);
     135           0 :         if (pLayer == NULL)
     136           0 :             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,
     180             :            RuntimeException,
     181             :            std::exception)
     182             : {
     183           0 :     bool bOk = true;
     184             : 
     185           0 :     ::std::vector<SdrObject*> aObjects;
     186             : 
     187           0 :     SdrPage* pSdrPage = NULL;
     188             : 
     189           0 :     Reference< drawing::XShape > xShape;
     190           0 :     aSelection >>= xShape;
     191             : 
     192           0 :     if(xShape.is())
     193             :     {
     194           0 :         SvxShape* pShape = SvxShape::getImplementation( xShape );
     195           0 :         if( pShape && (pShape->GetSdrObject() != NULL) )
     196             :         {
     197           0 :             SdrObject* pObj = pShape->GetSdrObject();
     198           0 :             pSdrPage = pObj->GetPage();
     199           0 :             aObjects.push_back( pObj );
     200             :         }
     201             :         else
     202             :         {
     203           0 :             bOk = false;
     204             :         }
     205             :     }
     206             :     else
     207             :     {
     208           0 :         Reference< drawing::XShapes > xShapes;
     209           0 :         aSelection >>= xShapes;
     210           0 :         if( xShapes.is() )
     211             :         {
     212           0 :             const sal_uInt32 nCount = xShapes->getCount();
     213           0 :             for( sal_uInt32 i = 0; i < nCount; i++ )
     214             :             {
     215           0 :                 xShapes->getByIndex(i) >>= xShape;
     216           0 :                 if( xShape.is() )
     217             :                 {
     218           0 :                     SvxShape* pShape = SvxShape::getImplementation(xShape);
     219           0 :                     if( (pShape == NULL) || (pShape->GetSdrObject() == NULL) )
     220             :                     {
     221           0 :                         bOk = false;
     222           0 :                         break;
     223             :                     }
     224             : 
     225           0 :                     SdrObject* pObj = pShape->GetSdrObject();
     226             : 
     227           0 :                     if( pSdrPage == NULL )
     228             :                     {
     229           0 :                         pSdrPage = pObj->GetPage();
     230             :                     }
     231           0 :                     else if( pSdrPage != pObj->GetPage() )
     232             :                     {
     233           0 :                         bOk = false;
     234           0 :                         break;
     235             :                     }
     236             : 
     237           0 :                     aObjects.push_back( pObj );
     238             :                 }
     239             :             }
     240           0 :         }
     241             :     }
     242             : 
     243           0 :     if( bOk )
     244             :     {
     245           0 :         if( pSdrPage )
     246             :         {
     247           0 :             setMasterPageMode( pSdrPage->IsMasterPage() );
     248           0 :             mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNum() - 1) >> 1 );
     249           0 :             mrDrawViewShell.WriteFrameViewData();
     250             :         }
     251             : 
     252           0 :         SdrPageView *pPV = mrView.GetSdrPageView();
     253             : 
     254           0 :         if(pPV)
     255             :         {
     256             :             // first deselect all
     257           0 :             mrView.UnmarkAllObj( pPV );
     258             : 
     259           0 :             ::std::vector<SdrObject*>::iterator aIter( aObjects.begin() );
     260           0 :             const ::std::vector<SdrObject*>::iterator aEnd( aObjects.end() );
     261           0 :             while( aIter != aEnd )
     262             :             {
     263           0 :                 SdrObject* pObj = (*aIter++);
     264           0 :                 mrView.MarkObj( pObj, pPV );
     265             :             }
     266             :         }
     267             :         else
     268             :         {
     269           0 :             bOk = false;
     270             :         }
     271             :     }
     272             : 
     273           0 :     return bOk;
     274             : }
     275             : 
     276             : 
     277             : 
     278           0 : Any SAL_CALL SdUnoDrawView::getSelection()
     279             :     throw (RuntimeException, std::exception)
     280             : {
     281           0 :     Any aAny;
     282             : 
     283           0 :     if( mrView.IsTextEdit() )
     284           0 :         mrView.getTextSelection( aAny );
     285             : 
     286             : 
     287           0 :     if( !aAny.hasValue() )
     288             :     {
     289           0 :         const SdrMarkList& rMarkList = mrView.GetMarkedObjectList();
     290           0 :         sal_uInt32 nCount = rMarkList.GetMarkCount();
     291           0 :         if( nCount )
     292             :         {
     293             :             Reference< drawing::XShapes > xShapes( drawing::ShapeCollection::create(
     294           0 :                         comphelper::getProcessComponentContext()), UNO_QUERY );
     295           0 :             for( sal_uInt32 nNum = 0; nNum < nCount; nNum++)
     296             :             {
     297           0 :                 SdrMark *pMark = rMarkList.GetMark(nNum);
     298           0 :                 if(pMark==NULL)
     299           0 :                     continue;
     300             : 
     301           0 :                 SdrObject *pObj = pMark->GetMarkedSdrObj();
     302           0 :                 if(pObj==NULL || pObj->GetPage() == NULL)
     303           0 :                     continue;
     304             : 
     305           0 :                 Reference< drawing::XDrawPage > xPage( pObj->GetPage()->getUnoPage(), UNO_QUERY);
     306             : 
     307           0 :                 if(!xPage.is())
     308           0 :                     continue;
     309             : 
     310           0 :                 SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
     311             : 
     312           0 :                 if(pDrawPage==NULL)
     313           0 :                     continue;
     314             : 
     315           0 :                 Reference< drawing::XShape > xShape( pObj->getUnoShape(), UNO_QUERY );
     316             : 
     317           0 :                 if(xShape.is())
     318           0 :                     xShapes->add(xShape);
     319           0 :             }
     320           0 :             aAny <<= xShapes;
     321             :         }
     322             :     }
     323             : 
     324           0 :     return aAny;
     325             : }
     326             : 
     327             : 
     328             : 
     329             : 
     330           0 : void SAL_CALL SdUnoDrawView::addSelectionChangeListener (
     331             :     const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
     332             :     throw(css::uno::RuntimeException, std::exception)
     333             : {
     334             :     (void)rxListener;
     335           0 : }
     336             : 
     337             : 
     338             : 
     339             : 
     340           0 : void SAL_CALL SdUnoDrawView::removeSelectionChangeListener (
     341             :     const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
     342             :     throw(css::uno::RuntimeException, std::exception)
     343             : {
     344             :     (void)rxListener;
     345           0 : }
     346             : 
     347             : 
     348             : 
     349             : 
     350           0 : void SdUnoDrawView::setFastPropertyValue (
     351             :     sal_Int32 nHandle,
     352             :         const Any& rValue)
     353             :     throw(css::beans::UnknownPropertyException,
     354             :         css::beans::PropertyVetoException,
     355             :         css::lang::IllegalArgumentException,
     356             :         css::lang::WrappedTargetException,
     357             :         css::uno::RuntimeException, std::exception)
     358             : {
     359           0 :     switch( nHandle )
     360             :     {
     361             :         case DrawController::PROPERTY_CURRENTPAGE:
     362             :             {
     363           0 :                 Reference< drawing::XDrawPage > xPage;
     364           0 :                 rValue >>= xPage;
     365           0 :                 setCurrentPage( xPage );
     366             :             }
     367           0 :             break;
     368             : 
     369             :         case DrawController::PROPERTY_MASTERPAGEMODE:
     370             :             {
     371           0 :                 sal_Bool bValue = sal_False;
     372           0 :                 rValue >>= bValue;
     373           0 :                 setMasterPageMode( bValue );
     374             :             }
     375           0 :             break;
     376             : 
     377             :         case DrawController::PROPERTY_LAYERMODE:
     378             :             {
     379           0 :                 sal_Bool bValue = sal_False;
     380           0 :                 rValue >>= bValue;
     381           0 :                 setLayerMode( bValue );
     382             :             }
     383             : 
     384             :         case DrawController::PROPERTY_ACTIVE_LAYER:
     385             :             {
     386           0 :                 Reference<drawing::XLayer> xLayer;
     387           0 :                 rValue >>= xLayer;
     388           0 :                 setActiveLayer (xLayer);
     389             :             }
     390           0 :             break;
     391             :         case DrawController::PROPERTY_ZOOMVALUE:
     392             :             {
     393           0 :                 sal_Int16 nZoom = 0;
     394           0 :                 rValue >>= nZoom;
     395           0 :                 SetZoom( nZoom );
     396             :             }
     397           0 :             break;
     398             :         case DrawController::PROPERTY_ZOOMTYPE:
     399             :             {
     400           0 :                 sal_Int16 nType = 0;
     401           0 :                 rValue >>= nType;
     402           0 :                 SetZoomType( nType );
     403             :             }
     404           0 :             break;
     405             :         case DrawController::PROPERTY_VIEWOFFSET:
     406             :             {
     407           0 :                 awt::Point aOffset;
     408           0 :                 rValue >>= aOffset;
     409           0 :                 SetViewOffset( aOffset );
     410             :             }
     411           0 :             break;
     412             :         default:
     413           0 :             throw beans::UnknownPropertyException();
     414             :     }
     415           0 : }
     416             : 
     417             : 
     418             : 
     419             : 
     420           0 : Any SAL_CALL SdUnoDrawView::getFastPropertyValue (
     421             :     sal_Int32 nHandle)
     422             :     throw(css::beans::UnknownPropertyException,
     423             :         css::lang::WrappedTargetException,
     424             :         css::uno::RuntimeException, std::exception)
     425             : {
     426           0 :     Any aValue;
     427           0 :     switch( nHandle )
     428             :     {
     429             :         case DrawController::PROPERTY_CURRENTPAGE:
     430           0 :             aValue <<= (const_cast<SdUnoDrawView*>(this))->getCurrentPage();
     431           0 :             break;
     432             : 
     433             :         case DrawController::PROPERTY_MASTERPAGEMODE:
     434           0 :             aValue <<= getMasterPageMode();
     435           0 :             break;
     436             : 
     437             :         case DrawController::PROPERTY_LAYERMODE:
     438           0 :             aValue <<= getLayerMode();
     439           0 :             break;
     440             : 
     441             :         case DrawController::PROPERTY_ACTIVE_LAYER:
     442           0 :             aValue <<= (const_cast<SdUnoDrawView*>(this))->getActiveLayer();
     443           0 :             break;
     444             : 
     445             :         case DrawController::PROPERTY_ZOOMVALUE:
     446           0 :             aValue <<= GetZoom();
     447           0 :             break;
     448             :         case DrawController::PROPERTY_ZOOMTYPE:
     449           0 :             aValue <<= (sal_Int16)com::sun::star::view::DocumentZoomType::BY_VALUE;
     450           0 :             break;
     451             :         case DrawController::PROPERTY_VIEWOFFSET:
     452           0 :             aValue <<= GetViewOffset();
     453           0 :             break;
     454             : 
     455             :         case DrawController::PROPERTY_DRAWVIEWMODE:
     456           0 :             aValue = getDrawViewMode();
     457           0 :             break;
     458             : 
     459             :         default:
     460           0 :             throw beans::UnknownPropertyException();
     461             :     }
     462             : 
     463           0 :     return aValue;
     464             : }
     465             : 
     466             : 
     467             : 
     468             : 
     469             : // XDrawView
     470             : 
     471             : 
     472           0 : void SAL_CALL SdUnoDrawView::setCurrentPage (
     473             :     const Reference< drawing::XDrawPage >& xPage )
     474             :     throw (RuntimeException, std::exception)
     475             : {
     476           0 :     SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
     477           0 :     SdrPage *pSdrPage = pDrawPage ? pDrawPage->GetSdrPage() : NULL;
     478             : 
     479           0 :     if(pSdrPage)
     480             :     {
     481             :         // End editing of text.  Otherwise the edited text object would
     482             :         // still be visible on the new page.
     483           0 :         mrDrawViewShell.GetView()->SdrEndTextEdit();
     484             : 
     485           0 :         setMasterPageMode( pSdrPage->IsMasterPage() );
     486           0 :         mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNum() - 1) >> 1 );
     487           0 :         mrDrawViewShell.WriteFrameViewData();
     488             :     }
     489           0 : }
     490             : 
     491             : 
     492             : 
     493           0 : Reference< drawing::XDrawPage > SAL_CALL SdUnoDrawView::getCurrentPage()
     494             :     throw(RuntimeException, std::exception)
     495             : {
     496           0 :     Reference< drawing::XDrawPage >  xPage;
     497             : 
     498           0 :     SdrPageView *pPV = mrView.GetSdrPageView();
     499           0 :     SdrPage* pPage = pPV ? pPV->GetPage() : NULL;
     500             : 
     501           0 :     if(pPage)
     502           0 :         xPage = Reference< drawing::XDrawPage >::query( pPage->getUnoPage() );
     503             : 
     504           0 :     return xPage;
     505             : }
     506             : 
     507             : 
     508           0 : sal_Int16 SdUnoDrawView::GetZoom(void) const
     509             : {
     510           0 :     if (mrDrawViewShell.GetActiveWindow() )
     511             :     {
     512           0 :         return (sal_Int16)mrDrawViewShell.GetActiveWindow()->GetZoom();
     513             :     }
     514             :     else
     515             :     {
     516           0 :         return 0;
     517             :     }
     518             : }
     519             : 
     520           0 : void SdUnoDrawView::SetZoom( sal_Int16 nZoom )
     521             : {
     522           0 :     SvxZoomItem aZoomItem( SVX_ZOOM_PERCENT, nZoom );
     523             : 
     524           0 :     SfxViewFrame* pViewFrame = mrDrawViewShell.GetViewFrame();
     525           0 :     if( pViewFrame )
     526             :     {
     527           0 :         SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
     528           0 :         if( pDispatcher )
     529             :         {
     530           0 :             pDispatcher->Execute(SID_ATTR_ZOOM,SFX_CALLMODE_SYNCHRON,&aZoomItem, 0L);
     531             :         }
     532           0 :     }
     533           0 : }
     534             : 
     535             : 
     536           0 : void SdUnoDrawView::SetViewOffset(const awt::Point& rWinPos )
     537             : {
     538           0 :     Point aWinPos( rWinPos.X, rWinPos.Y );
     539           0 :     aWinPos += mrDrawViewShell.GetViewOrigin();
     540           0 :     mrDrawViewShell.SetWinViewPos( aWinPos, true );
     541           0 : }
     542             : 
     543           0 : awt::Point SdUnoDrawView::GetViewOffset() const
     544             : {
     545           0 :     Point aRet;
     546             : 
     547           0 :     aRet = mrDrawViewShell.GetWinViewPos();
     548           0 :     aRet -= mrDrawViewShell.GetViewOrigin();
     549             : 
     550           0 :     return awt::Point( aRet.X(), aRet.Y() );
     551             : }
     552             : 
     553           0 : void SdUnoDrawView::SetZoomType ( sal_Int16 nType )
     554             : {
     555           0 :     SfxViewFrame* pViewFrame = mrDrawViewShell.GetViewFrame();
     556           0 :     if( pViewFrame )
     557             :     {
     558           0 :         SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
     559           0 :         if( pDispatcher )
     560             :         {
     561             :             SvxZoomType eZoomType;
     562           0 :             switch( nType )
     563             :             {
     564             :                 case com::sun::star::view::DocumentZoomType::OPTIMAL:
     565           0 :                     eZoomType = SVX_ZOOM_OPTIMAL;
     566           0 :                     break;
     567             : 
     568             :                 case com::sun::star::view::DocumentZoomType::PAGE_WIDTH:
     569             :                 case com::sun::star::view::DocumentZoomType::PAGE_WIDTH_EXACT:
     570           0 :                     eZoomType = SVX_ZOOM_PAGEWIDTH;
     571           0 :                     break;
     572             : 
     573             :                 case com::sun::star::view::DocumentZoomType::ENTIRE_PAGE:
     574           0 :                     eZoomType = SVX_ZOOM_WHOLEPAGE;
     575           0 :                     break;
     576             : 
     577             :                 default:
     578           0 :                     return;
     579             :             }
     580           0 :             SvxZoomItem aZoomItem( eZoomType );
     581           0 :             pDispatcher->Execute(SID_ATTR_ZOOM,SFX_CALLMODE_SYNCHRON,&aZoomItem, 0L);
     582             :         }
     583             :     }
     584             : }
     585             : 
     586             : 
     587             : 
     588             : 
     589           0 : SdXImpressDocument* SdUnoDrawView::GetModel (void) const throw()
     590             : {
     591           0 :     if (mrView.GetDocSh()!=NULL)
     592             :     {
     593           0 :         Reference<frame::XModel> xModel (mrView.GetDocSh()->GetModel());
     594           0 :         return SdXImpressDocument::getImplementation(xModel);
     595             :     }
     596             :     else
     597           0 :         return NULL;
     598             : }
     599             : 
     600           0 : Any SdUnoDrawView::getDrawViewMode() const
     601             : {
     602           0 :     Any aRet;
     603           0 :     switch( mrDrawViewShell.GetPageKind() )
     604             :     {
     605           0 :     case PK_NOTES:  aRet <<= DrawViewMode_NOTES; break;
     606           0 :     case PK_HANDOUT: aRet <<= DrawViewMode_HANDOUT; break;
     607           0 :     case PK_STANDARD: aRet <<= DrawViewMode_DRAW; break;
     608             :     }
     609           0 :     return aRet;
     610             : }
     611             : 
     612             : // XServiceInfo
     613           0 : OUString SAL_CALL SdUnoDrawView::getImplementationName(  ) throw (RuntimeException, std::exception)
     614             : {
     615           0 :     return OUString( "com.sun.star.comp.sd.SdUnoDrawView") ;
     616             : }
     617             : 
     618           0 : sal_Bool SAL_CALL SdUnoDrawView::supportsService( const OUString& ServiceName ) throw (RuntimeException, std::exception)
     619             : {
     620           0 :     return cppu::supportsService( this, ServiceName );
     621             : }
     622             : 
     623           0 : Sequence< OUString > SAL_CALL SdUnoDrawView::getSupportedServiceNames(  ) throw (RuntimeException, std::exception)
     624             : {
     625           0 :     OUString aSN("com.sun.star.drawing.DrawingDocumentDrawView");
     626           0 :     uno::Sequence< OUString > aSeq( &aSN, 1 );
     627           0 :     return aSeq;
     628             : }
     629             : 
     630             : } // end of namespace sd
     631             : 
     632             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10