LCOV - code coverage report
Current view: top level - vcl/source/gdi - graph.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 247 302 81.8 %
Date: 2014-11-03 Functions: 56 72 77.8 %
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 <vcl/outdev.hxx>
      21             : #include <vcl/svapp.hxx>
      22             : #include <vcl/graph.hxx>
      23             : #include <vcl/metaact.hxx>
      24             : #include <impgraph.hxx>
      25             : #include <comphelper/processfactory.hxx>
      26             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      27             : #include <com/sun/star/graphic/GraphicProvider.hpp>
      28             : #include <com/sun/star/graphic/XGraphicProvider.hpp>
      29             : #include <com/sun/star/lang/XUnoTunnel.hpp>
      30             : #include <com/sun/star/lang/XTypeProvider.hpp>
      31             : #include <com/sun/star/graphic/XGraphic.hpp>
      32             : #include <cppuhelper/typeprovider.hxx>
      33             : 
      34             : using namespace ::com::sun::star;
      35             : 
      36          68 : static void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
      37             :                              vcl::Font* pFont, const Bitmap* pBitmap, const BitmapEx* pBitmapEx,
      38             :                              const Point& rDestPt, const Size& rDestSize )
      39             : {
      40          68 :     sal_uInt16      nPixel = (sal_uInt16) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width();
      41          68 :     sal_uInt16      nPixelWidth = nPixel;
      42          68 :     Point       aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
      43          68 :     Size        aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
      44          68 :     bool        bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
      45          68 :     Rectangle   aBorderRect( aPoint, aSize );
      46             : 
      47          68 :     pOutDev->Push();
      48             : 
      49          68 :     pOutDev->SetFillColor();
      50             : 
      51             :     // On the printer a black rectangle and on the screen one with 3D effect
      52          68 :     if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER )
      53           0 :         pOutDev->SetLineColor( COL_BLACK );
      54             :     else
      55             :     {
      56          68 :         aBorderRect.Left() += nPixel;
      57          68 :         aBorderRect.Top() += nPixel;
      58             : 
      59          68 :         pOutDev->SetLineColor( COL_LIGHTGRAY );
      60          68 :         pOutDev->DrawRect( aBorderRect );
      61             : 
      62          68 :         aBorderRect.Left() -= nPixel;
      63          68 :         aBorderRect.Top() -= nPixel;
      64          68 :         aBorderRect.Right() -= nPixel;
      65          68 :         aBorderRect.Bottom() -= nPixel;
      66          68 :         pOutDev->SetLineColor( COL_GRAY );
      67             :     }
      68             : 
      69          68 :     pOutDev->DrawRect( aBorderRect );
      70             : 
      71          68 :     aPoint.X() += nPixelWidth + 2*nPixel;
      72          68 :     aPoint.Y() += nPixelWidth + 2*nPixel;
      73          68 :     aSize.Width() -= 2*nPixelWidth + 4*nPixel;
      74          68 :     aSize.Height() -= 2*nPixelWidth + 4*nPixel;
      75             : 
      76         200 :     if( aSize.Width() > 0 && aSize.Height() > 0
      77         132 :         && (  ( pBitmap && !!*pBitmap ) || ( pBitmapEx && !!*pBitmapEx ) ) )
      78             :     {
      79          64 :         Size aBitmapSize( pOutDev->PixelToLogic( pBitmap ? pBitmap->GetSizePixel() : pBitmapEx->GetSizePixel() ) );
      80             : 
      81          64 :         if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > aBitmapSize.Width() )
      82             :         {
      83          38 :             if ( pBitmap )
      84           0 :                 pOutDev->DrawBitmap( aPoint, *pBitmap );
      85             :             else
      86          38 :                 pOutDev->DrawBitmapEx( aPoint, *pBitmapEx );
      87          38 :             aPoint.X() += aBitmapSize.Width() + 2*nPixel;
      88          38 :             aSize.Width() -= aBitmapSize.Width() + 2*nPixel;
      89             :         }
      90             :     }
      91             : 
      92         200 :     if ( aSize.Width() > 0 && aSize.Height() > 0 && pFont && pText && pText->getLength()
      93         132 :          && !(!pOutDev->IsOutputEnabled() /*&& pOutDev->GetConnectMetaFile() */) )
      94             :     {
      95          62 :         MapMode aMapMode( MAP_POINT );
      96          62 :         Size    aSz = pOutDev->LogicToLogic( Size( 0, 12 ), &aMapMode, NULL );
      97          62 :         long    nThreshold = aSz.Height() / 2;
      98          62 :         long    nStep = nThreshold / 3;
      99             : 
     100          62 :         if ( !nStep )
     101           0 :             nStep = aSz.Height() - nThreshold;
     102             : 
     103          78 :         for(;; aSz.Height() -= nStep )
     104             :         {
     105         140 :             pFont->SetSize( aSz );
     106         140 :             pOutDev->SetFont( *pFont );
     107             : 
     108         140 :             long nTextHeight = pOutDev->GetTextHeight();
     109         140 :             long nTextWidth = pOutDev->GetTextWidth( *pText );
     110         140 :             if ( nTextHeight )
     111             :             {
     112             :                 // The approximation does not respect imprecisions caused
     113             :                 // by word wraps
     114         140 :                 long nLines = aSize.Height() / nTextHeight;
     115         140 :                 long nWidth = aSize.Width() * nLines; // Approximation!!!
     116             : 
     117         140 :                 if ( nTextWidth <= nWidth || aSz.Height() <= nThreshold )
     118             :                 {
     119          62 :                     sal_uInt16 nStart = 0;
     120          62 :                     sal_uInt16 nLen = 0;
     121             : 
     122         124 :                     while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
     123           0 :                         nStart++;
     124        3420 :                     while( nStart+nLen < pText->getLength() && (*pText)[nStart+nLen] != ' ' )
     125        3296 :                         nLen++;
     126         186 :                     while( nStart < pText->getLength() && nLines-- )
     127             :                     {
     128          62 :                         sal_uInt16 nNext = nLen;
     129           0 :                         do
     130             :                         {
     131         124 :                             while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] == ' ' )
     132           0 :                                 nNext++;
     133         124 :                             while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] != ' ' )
     134           0 :                                 nNext++;
     135          62 :                             nTextWidth = pOutDev->GetTextWidth( *pText, nStart, nNext );
     136          62 :                             if ( nTextWidth > aSize.Width() )
     137          62 :                                 break;
     138           0 :                             nLen = nNext;
     139             :                         }
     140           0 :                         while ( nStart+nNext < pText->getLength() );
     141             : 
     142          62 :                         sal_uInt16 n = nLen;
     143          62 :                         nTextWidth = pOutDev->GetTextWidth( *pText, nStart, n );
     144        2716 :                         while( nTextWidth > aSize.Width() )
     145        2592 :                             nTextWidth = pOutDev->GetTextWidth( *pText, nStart, --n );
     146          62 :                         pOutDev->DrawText( aPoint, *pText, nStart, n );
     147             : 
     148          62 :                         aPoint.Y() += nTextHeight;
     149          62 :                         nStart      = sal::static_int_cast<sal_uInt16>(nStart + nLen);
     150          62 :                         nLen        = nNext-nLen;
     151         124 :                         while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
     152             :                         {
     153           0 :                             nStart++;
     154           0 :                             nLen--;
     155             :                         }
     156             :                     }
     157          62 :                     break;
     158             :                 }
     159             :             }
     160             :             else
     161           0 :                 break;
     162          78 :         }
     163             :     }
     164             : 
     165             :     // If the default graphic does not have content, we draw a red rectangle
     166          68 :     if( !bFilled )
     167             :     {
     168           0 :         aBorderRect.Left()++;
     169           0 :         aBorderRect.Top()++;
     170           0 :         aBorderRect.Right()--;
     171           0 :         aBorderRect.Bottom()--;
     172             : 
     173           0 :         pOutDev->SetLineColor( COL_LIGHTRED );
     174           0 :         pOutDev->DrawLine( aBorderRect.TopLeft(), aBorderRect.BottomRight() );
     175           0 :         pOutDev->DrawLine( aBorderRect.TopRight(), aBorderRect.BottomLeft() );
     176             :     }
     177             : 
     178          68 :     pOutDev->Pop();
     179          68 : }
     180             : 
     181           0 : TYPEINIT1_AUTOFACTORY( Graphic, SvDataCopyStream );
     182             : 
     183       34456 : Graphic::Graphic()
     184             : {
     185       34456 :     mpImpGraphic = new ImpGraphic;
     186       34456 : }
     187             : 
     188      174111 : Graphic::Graphic( const Graphic& rGraphic ) :
     189      174111 : SvDataCopyStream()
     190             : {
     191      174111 :     if( rGraphic.IsAnimated() )
     192           0 :         mpImpGraphic = new ImpGraphic( *rGraphic.mpImpGraphic );
     193             :     else
     194             :     {
     195      174111 :         mpImpGraphic = rGraphic.mpImpGraphic;
     196      174111 :         mpImpGraphic->mnRefCount++;
     197             :     }
     198      174111 : }
     199             : 
     200         909 : Graphic::Graphic( const Bitmap& rBmp )
     201             : {
     202         909 :     mpImpGraphic = new ImpGraphic( rBmp );
     203         909 : }
     204             : 
     205      360235 : Graphic::Graphic( const BitmapEx& rBmpEx )
     206             : {
     207      360235 :     mpImpGraphic = new ImpGraphic( rBmpEx );
     208      360235 : }
     209             : 
     210         302 : Graphic::Graphic(const SvgDataPtr& rSvgDataPtr)
     211             : {
     212         302 :     mpImpGraphic = new ImpGraphic(rSvgDataPtr);
     213         302 : }
     214             : 
     215          16 : Graphic::Graphic( const Animation& rAnimation )
     216             : {
     217          16 :     mpImpGraphic = new ImpGraphic( rAnimation );
     218          16 : }
     219             : 
     220        3717 : Graphic::Graphic( const GDIMetaFile& rMtf )
     221             : {
     222        3717 :     mpImpGraphic = new ImpGraphic( rMtf );
     223        3717 : }
     224             : 
     225      350091 : Graphic::Graphic( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic )
     226             : {
     227      350091 :     uno::Reference< lang::XUnoTunnel >      xTunnel( rxGraphic, uno::UNO_QUERY );
     228      350091 :     const ::Graphic*                        pGraphic = ( xTunnel.is() ?
     229      761193 :                                                          reinterpret_cast< ::Graphic* >( xTunnel->getSomething( getUnoTunnelId() ) ) :
     230      837216 :                                                           NULL );
     231             : 
     232      350091 :     if( pGraphic )
     233             :     {
     234      137034 :         if( pGraphic->IsAnimated() )
     235           0 :             mpImpGraphic = new ImpGraphic( *pGraphic->mpImpGraphic );
     236             :         else
     237             :         {
     238      137034 :             mpImpGraphic = pGraphic->mpImpGraphic;
     239      137034 :             mpImpGraphic->mnRefCount++;
     240             :         }
     241             :     }
     242             :     else
     243      213057 :         mpImpGraphic = new ImpGraphic;
     244      350091 : }
     245             : 
     246     1995254 : Graphic::~Graphic()
     247             : {
     248      923589 :     if( mpImpGraphic->mnRefCount == 1UL )
     249      601337 :         delete mpImpGraphic;
     250             :     else
     251      322252 :         mpImpGraphic->mnRefCount--;
     252     1071665 : }
     253             : 
     254       38659 : void Graphic::ImplTestRefCount()
     255             : {
     256       38659 :     if( mpImpGraphic->mnRefCount > 1UL )
     257             :     {
     258          16 :         mpImpGraphic->mnRefCount--;
     259          16 :         mpImpGraphic = new ImpGraphic( *mpImpGraphic );
     260             :     }
     261       38659 : }
     262             : 
     263       23329 : Graphic& Graphic::operator=( const Graphic& rGraphic )
     264             : {
     265       23329 :     if( &rGraphic != this )
     266             :     {
     267       23329 :         if( rGraphic.IsAnimated() )
     268             :         {
     269          16 :             if( mpImpGraphic->mnRefCount == 1UL )
     270          16 :                 delete mpImpGraphic;
     271             :             else
     272           0 :                 mpImpGraphic->mnRefCount--;
     273             : 
     274          16 :             mpImpGraphic = new ImpGraphic( *rGraphic.mpImpGraphic );
     275             :         }
     276             :         else
     277             :         {
     278       23313 :             rGraphic.mpImpGraphic->mnRefCount++;
     279             : 
     280       23313 :             if( mpImpGraphic->mnRefCount == 1UL )
     281       11138 :                 delete mpImpGraphic;
     282             :             else
     283       12175 :                 mpImpGraphic->mnRefCount--;
     284             : 
     285       23313 :             mpImpGraphic = rGraphic.mpImpGraphic;
     286             :         }
     287             :     }
     288             : 
     289       23329 :     return *this;
     290             : }
     291             : 
     292        3827 : bool Graphic::operator==( const Graphic& rGraphic ) const
     293             : {
     294        3827 :     return( *mpImpGraphic == *rGraphic.mpImpGraphic );
     295             : }
     296             : 
     297           0 : bool Graphic::operator!=( const Graphic& rGraphic ) const
     298             : {
     299           0 :     return( *mpImpGraphic != *rGraphic.mpImpGraphic );
     300             : }
     301             : 
     302           0 : bool Graphic::operator!() const
     303             : {
     304           0 :     return( GRAPHIC_NONE == mpImpGraphic->ImplGetType() );
     305             : }
     306             : 
     307           0 : void Graphic::Load( SvStream& rIStm )
     308             : {
     309           0 :     ReadGraphic( rIStm, *this );
     310           0 : }
     311             : 
     312           0 : void Graphic::Save( SvStream& rOStm )
     313             : {
     314           0 :     WriteGraphic( rOStm, *this );
     315           0 : }
     316             : 
     317           0 : void Graphic::Assign( const SvDataCopyStream& rCopyStream )
     318             : {
     319           0 :     *this = static_cast<const Graphic&>( rCopyStream );
     320           0 : }
     321             : 
     322         100 : void Graphic::Clear()
     323             : {
     324         100 :     ImplTestRefCount();
     325         100 :     mpImpGraphic->ImplClear();
     326         100 : }
     327             : 
     328      498066 : GraphicType Graphic::GetType() const
     329             : {
     330      498066 :     return mpImpGraphic->ImplGetType();
     331             : }
     332             : 
     333          56 : void Graphic::SetDefaultType()
     334             : {
     335          56 :     ImplTestRefCount();
     336          56 :     mpImpGraphic->ImplSetDefaultType();
     337          56 : }
     338             : 
     339        3459 : bool Graphic::IsSupportedGraphic() const
     340             : {
     341        3459 :     return mpImpGraphic->ImplIsSupportedGraphic();
     342             : }
     343             : 
     344       38067 : bool Graphic::IsTransparent() const
     345             : {
     346       38067 :     return mpImpGraphic->ImplIsTransparent();
     347             : }
     348             : 
     349       38063 : bool Graphic::IsAlpha() const
     350             : {
     351       38063 :     return mpImpGraphic->ImplIsAlpha();
     352             : }
     353             : 
     354      379199 : bool Graphic::IsAnimated() const
     355             : {
     356      379199 :     return mpImpGraphic->ImplIsAnimated();
     357             : }
     358             : 
     359       37977 : bool Graphic::IsEPS() const
     360             : {
     361       37977 :     return mpImpGraphic->ImplIsEPS();
     362             : }
     363             : 
     364           8 : Bitmap Graphic::GetBitmap(const GraphicConversionParameters& rParameters) const
     365             : {
     366           8 :     return mpImpGraphic->ImplGetBitmap(rParameters);
     367             : }
     368             : 
     369      356302 : BitmapEx Graphic::GetBitmapEx(const GraphicConversionParameters& rParameters) const
     370             : {
     371      356302 :     return mpImpGraphic->ImplGetBitmapEx(rParameters);
     372             : }
     373             : 
     374           0 : Animation Graphic::GetAnimation() const
     375             : {
     376           0 :     return mpImpGraphic->ImplGetAnimation();
     377             : }
     378             : 
     379        2856 : const GDIMetaFile& Graphic::GetGDIMetaFile() const
     380             : {
     381        2856 :     return mpImpGraphic->ImplGetGDIMetaFile();
     382             : }
     383             : 
     384      351016 : uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const
     385             : {
     386      351016 :     uno::Reference< graphic::XGraphic > xRet;
     387             : 
     388      351016 :     if( GetType() != GRAPHIC_NONE )
     389             :     {
     390      136084 :         uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
     391      272162 :         uno::Reference< graphic::XGraphicProvider > xProv( graphic::GraphicProvider::create( xContext ) );
     392             : 
     393      272156 :         uno::Sequence< beans::PropertyValue > aLoadProps( 1 );
     394      272156 :         OUString aURL = "private:memorygraphic/" + OUString::number( reinterpret_cast< sal_Int64 >( this ) );
     395             : 
     396      136078 :         aLoadProps[ 0 ].Name = "URL";
     397      136078 :         aLoadProps[ 0 ].Value <<= aURL;
     398             : 
     399      272162 :         xRet = xProv->queryGraphic( aLoadProps );
     400             :     }
     401             : 
     402      351010 :     return xRet;
     403             : }
     404             : 
     405       52856 : Size Graphic::GetPrefSize() const
     406             : {
     407       52856 :     return mpImpGraphic->ImplGetPrefSize();
     408             : }
     409             : 
     410        8698 : void Graphic::SetPrefSize( const Size& rPrefSize )
     411             : {
     412        8698 :     ImplTestRefCount();
     413        8698 :     mpImpGraphic->ImplSetPrefSize( rPrefSize );
     414        8698 : }
     415             : 
     416       52463 : MapMode Graphic::GetPrefMapMode() const
     417             : {
     418       52463 :     return mpImpGraphic->ImplGetPrefMapMode();
     419             : }
     420             : 
     421        8698 : void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
     422             : {
     423        8698 :     ImplTestRefCount();
     424        8698 :     mpImpGraphic->ImplSetPrefMapMode( rPrefMapMode );
     425        8698 : }
     426             : 
     427         606 : Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
     428             : {
     429         606 :     Size aRet;
     430             : 
     431         606 :     if( GRAPHIC_BITMAP == mpImpGraphic->ImplGetType() )
     432         594 :         aRet = mpImpGraphic->ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel();
     433             :     else
     434          12 :         aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
     435             : 
     436         606 :     return aRet;
     437             : }
     438             : 
     439       40407 : sal_uLong Graphic::GetSizeBytes() const
     440             : {
     441       40407 :     return mpImpGraphic->ImplGetSizeBytes();
     442             : }
     443             : 
     444           0 : void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
     445             : {
     446           0 :     mpImpGraphic->ImplDraw( pOutDev, rDestPt );
     447           0 : }
     448             : 
     449         110 : void Graphic::Draw( OutputDevice* pOutDev,
     450             :                     const Point& rDestPt, const Size& rDestSz ) const
     451             : {
     452         110 :     if( GRAPHIC_DEFAULT == mpImpGraphic->ImplGetType() )
     453           0 :         ImplDrawDefault( pOutDev, NULL, NULL, NULL, NULL, rDestPt, rDestSz );
     454             :     else
     455         110 :         mpImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz );
     456         110 : }
     457             : 
     458          68 : void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText,
     459             :                     vcl::Font& rFont, const BitmapEx& rBitmap,
     460             :                     const Point& rDestPt, const Size& rDestSz )
     461             : {
     462          68 :     ImplDrawDefault( pOutDev, &rText, &rFont, NULL, &rBitmap, rDestPt, rDestSz );
     463          68 : }
     464             : 
     465           0 : void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt,
     466             :                               const Size& rDestSz, long nExtraData,
     467             :                               OutputDevice* pFirstFrameOutDev )
     468             : {
     469           0 :     ImplTestRefCount();
     470           0 :     mpImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev );
     471           0 : }
     472             : 
     473           0 : void Graphic::StopAnimation( OutputDevice* pOutDev, long nExtraData )
     474             : {
     475           0 :     ImplTestRefCount();
     476           0 :     mpImpGraphic->ImplStopAnimation( pOutDev, nExtraData );
     477           0 : }
     478             : 
     479        8180 : void Graphic::SetAnimationNotifyHdl( const Link& rLink )
     480             : {
     481        8180 :     mpImpGraphic->ImplSetAnimationNotifyHdl( rLink );
     482        8180 : }
     483             : 
     484       10892 : Link Graphic::GetAnimationNotifyHdl() const
     485             : {
     486       10892 :     return mpImpGraphic->ImplGetAnimationNotifyHdl();
     487             : }
     488             : 
     489           0 : sal_uLong Graphic::GetAnimationLoopCount() const
     490             : {
     491           0 :     return mpImpGraphic->ImplGetAnimationLoopCount();
     492             : }
     493             : 
     494       17789 : GraphicReader* Graphic::GetContext()
     495             : {
     496       17789 :     return mpImpGraphic->ImplGetContext();
     497             : }
     498             : 
     499         671 : void Graphic::SetContext( GraphicReader* pReader )
     500             : {
     501         671 :     mpImpGraphic->ImplSetContext( pReader );
     502         671 : }
     503             : 
     504        8180 : void Graphic::SetDocFileName( const OUString& rName, sal_uLong nFilePos )
     505             : {
     506        8180 :     mpImpGraphic->ImplSetDocFileName( rName, nFilePos );
     507        8180 : }
     508             : 
     509       10892 : const OUString& Graphic::GetDocFileName() const
     510             : {
     511       10892 :     return mpImpGraphic->ImplGetDocFileName();
     512             : }
     513             : 
     514       10892 : sal_uLong Graphic::GetDocFilePos() const
     515             : {
     516       10892 :     return mpImpGraphic->ImplGetDocFilePos();
     517             : }
     518             : 
     519          68 : bool Graphic::SwapOut()
     520             : {
     521          68 :     ImplTestRefCount();
     522          68 :     return mpImpGraphic->ImplSwapOut();
     523             : }
     524             : 
     525           4 : bool Graphic::SwapOut( SvStream* pOStream )
     526             : {
     527           4 :     ImplTestRefCount();
     528           4 :     return mpImpGraphic->ImplSwapOut( pOStream );
     529             : }
     530             : 
     531          90 : bool Graphic::SwapIn()
     532             : {
     533          90 :     ImplTestRefCount();
     534          90 :     return mpImpGraphic->ImplSwapIn();
     535             : }
     536             : 
     537           0 : bool Graphic::SwapIn( SvStream* pStrm )
     538             : {
     539           0 :     ImplTestRefCount();
     540           0 :     return mpImpGraphic->ImplSwapIn( pStrm );
     541             : }
     542             : 
     543       84206 : bool Graphic::IsSwapOut() const
     544             : {
     545       84206 :     return mpImpGraphic->ImplIsSwapOut();
     546             : }
     547             : 
     548       10973 : void Graphic::SetLink( const GfxLink& rGfxLink )
     549             : {
     550       10973 :     ImplTestRefCount();
     551       10973 :     mpImpGraphic->ImplSetLink( rGfxLink );
     552       10973 : }
     553             : 
     554        2100 : GfxLink Graphic::GetLink() const
     555             : {
     556        2100 :     return mpImpGraphic->ImplGetLink();
     557             : }
     558             : 
     559       48036 : bool Graphic::IsLink() const
     560             : {
     561       48036 :     return mpImpGraphic->ImplIsLink();
     562             : }
     563             : 
     564        5957 : sal_uLong Graphic::GetChecksum() const
     565             : {
     566        5957 :     return mpImpGraphic->ImplGetChecksum();
     567             : }
     568             : 
     569         696 : bool Graphic::ExportNative( SvStream& rOStream ) const
     570             : {
     571         696 :     return mpImpGraphic->ImplExportNative( rOStream );
     572             : }
     573             : 
     574        9972 : SvStream& ReadGraphic( SvStream& rIStream, Graphic& rGraphic )
     575             : {
     576        9972 :     rGraphic.ImplTestRefCount();
     577        9972 :     return ReadImpGraphic( rIStream, *rGraphic.mpImpGraphic );
     578             : }
     579             : 
     580         198 : SvStream& WriteGraphic( SvStream& rOStream, const Graphic& rGraphic )
     581             : {
     582         198 :     return WriteImpGraphic( rOStream, *rGraphic.mpImpGraphic );
     583             : }
     584             : 
     585        9779 : const SvgDataPtr& Graphic::getSvgData() const
     586             : {
     587        9779 :     return mpImpGraphic->getSvgData();
     588             : }
     589             : 
     590             : namespace {
     591             : 
     592             : struct Id: public rtl::Static<cppu::OImplementationId, Id> {};
     593             : 
     594             : }
     595             : 
     596      274084 : css::uno::Sequence<sal_Int8> Graphic::getUnoTunnelId() {
     597      274084 :     return Id::get().getImplementationId();
     598        1233 : }
     599             : 
     600             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10