LCOV - code coverage report
Current view: top level - sd/source/filter - sdfilter.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 21 23 91.3 %
Date: 2012-08-25 Functions: 5 7 71.4 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 15 32 46.9 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
      30                 :            : 
      31                 :            : #include <memory>
      32                 :            : 
      33                 :            : #include <osl/module.hxx>
      34                 :            : #include <sfx2/docfile.hxx>
      35                 :            : #include <sfx2/viewfrm.hxx>
      36                 :            : #include <sfx2/progress.hxx>
      37                 :            : #include <svl/itemset.hxx>
      38                 :            : 
      39                 :            : #include "../ui/inc/DrawDocShell.hxx"
      40                 :            : #include "../ui/inc/strings.hrc"
      41                 :            : 
      42                 :            : #include "sdresid.hxx"
      43                 :            : #include "pres.hxx"
      44                 :            : #include "drawdoc.hxx"
      45                 :            : #include "sdfilter.hxx"
      46                 :            : 
      47                 :            : // --------------
      48                 :            : // - Namespaces -
      49                 :            : // --------------
      50                 :            : 
      51                 :            : using namespace ::com::sun::star::uno;
      52                 :            : using namespace ::com::sun::star::task;
      53                 :            : using namespace ::com::sun::star::frame;
      54                 :            : 
      55                 :            : // ------------
      56                 :            : // - SdFilter -
      57                 :            : // ------------
      58                 :            : 
      59                 :         34 : SdFilter::SdFilter( SfxMedium& rMedium, ::sd::DrawDocShell& rDocShell, sal_Bool bShowProgress )
      60                 :            : :   mxModel( rDocShell.GetModel() )
      61                 :            : ,   mrMedium( rMedium )
      62                 :            : ,   mrDocShell( rDocShell )
      63         [ +  - ]:         34 : ,   mrDocument( *rDocShell.GetDoc() )
      64                 :         34 : ,   mbIsDraw( rDocShell.GetDocumentType() == DOCUMENT_TYPE_DRAW )
      65                 :         34 : ,   mbShowProgress( bShowProgress )
      66                 :            : {
      67                 :         34 : }
      68                 :            : 
      69                 :            : // -----------------------------------------------------------------------------
      70                 :            : 
      71                 :         34 : SdFilter::~SdFilter()
      72                 :            : {
      73         [ -  + ]:         34 : }
      74                 :            : 
      75                 :            : // -----------------------------------------------------------------------------
      76                 :            : 
      77                 :         15 : ::rtl::OUString SdFilter::ImplGetFullLibraryName( const ::rtl::OUString& rLibraryName ) const
      78                 :            : {
      79         [ +  - ]:         15 :     String aTemp(::rtl::OUString(SVLIBRARY("?")));
      80         [ +  - ]:         15 :     xub_StrLen nIndex = aTemp.Search( (sal_Unicode)'?' );
      81 [ +  - ][ +  - ]:         15 :     aTemp.Replace( nIndex, 1, rLibraryName );
                 [ +  - ]
      82         [ +  - ]:         15 :     ::rtl::OUString aLibraryName( aTemp );
      83         [ +  - ]:         15 :     return aLibraryName;
      84                 :            : }
      85                 :            : 
      86                 :            : // -----------------------------------------------------------------------------
      87                 :            : 
      88                 :          0 : extern "C" { static void SAL_CALL thisModule() {} }
      89                 :            : 
      90                 :         15 : ::osl::Module* SdFilter::OpenLibrary( const ::rtl::OUString& rLibraryName ) const
      91                 :            : {
      92         [ +  - ]:         15 :     std::auto_ptr< osl::Module > mod(new osl::Module);
      93                 :            :     return mod->loadRelative(&thisModule, ImplGetFullLibraryName(rLibraryName),
      94 [ +  - ][ +  - ]:         30 :                              SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY)
      95 [ +  - ][ +  - ]:         30 :         ? mod.release() : 0;
      96                 :            : }
      97                 :            : 
      98                 :            : // -----------------------------------------------------------------------------
      99                 :            : 
     100                 :          8 : void SdFilter::CreateStatusIndicator()
     101                 :            : {
     102                 :            :     // The status indicator must be retrieved from the provided medium arguments
     103                 :            :     const SfxUnoAnyItem* pStatusBarItem = static_cast<const SfxUnoAnyItem*>(
     104                 :          8 :             mrMedium.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
     105                 :            : 
     106         [ -  + ]:          8 :     if ( pStatusBarItem )
     107         [ #  # ]:          0 :         pStatusBarItem->GetValue() >>= mxStatusIndicator;
     108                 :            : 
     109                 :          8 : }
     110                 :            : 
     111                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10