LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/vcl/source/gdi - cvtgrf.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 23 27 85.2 %
Date: 2013-07-09 Functions: 6 6 100.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 <vcl/metaact.hxx>
      22             : #include <vcl/cvtgrf.hxx>
      23             : 
      24             : #include <salinst.hxx>
      25             : #include <svdata.hxx>
      26             : 
      27             : // Callback
      28         151 : GraphicConverter::GraphicConverter() :
      29         151 :     mpConvertData( NULL )
      30             : {
      31         151 : }
      32             : 
      33          94 : GraphicConverter::~GraphicConverter()
      34             : {
      35          94 : }
      36             : 
      37          13 : sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat )
      38             : {
      39          13 :     GraphicConverter*   pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
      40          13 :     sal_uLong               nRet = ERRCODE_IO_GENERAL;
      41             : 
      42          13 :     if( pCvt && pCvt->GetFilterHdl().IsSet() )
      43             :     {
      44          13 :         ConvertData aData( rGraphic, rIStm, nFormat );
      45             : 
      46          13 :         if( pCvt->GetFilterHdl().Call( &aData ) )
      47             :         {
      48          13 :             rGraphic = aData.maGraphic;
      49          13 :             nRet = ERRCODE_NONE;
      50             :         }
      51           0 :         else if( rIStm.GetError() )
      52           0 :             nRet = rIStm.GetError();
      53             :     }
      54             : 
      55          13 :     return nRet;
      56             : }
      57             : 
      58          86 : sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat )
      59             : {
      60          86 :     GraphicConverter*   pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
      61          86 :     sal_uLong               nRet = ERRCODE_IO_GENERAL;
      62             : 
      63          86 :     if( pCvt && pCvt->GetFilterHdl().IsSet() )
      64             :     {
      65          86 :         ConvertData aData( rGraphic, rOStm, nFormat );
      66             : 
      67          86 :         if( pCvt->GetFilterHdl().Call( &aData ) )
      68          86 :             nRet = ERRCODE_NONE;
      69           0 :         else if( rOStm.GetError() )
      70           0 :             nRet = rOStm.GetError();
      71             :     }
      72             : 
      73          86 :     return nRet;
      74         465 : }
      75             : 
      76             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10