LCOV - code coverage report
Current view: top level - sc/source/filter/lotus - lotus.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 18 31 58.1 %
Date: 2014-04-11 Functions: 3 3 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             : #include "lotimpop.hxx"
      21             : 
      22             : #include <sfx2/docfile.hxx>
      23             : #include <tools/urlobj.hxx>
      24             : 
      25             : #include "scerrors.hxx"
      26             : #include "root.hxx"
      27             : #include "filtopt.hxx"
      28             : #include "ftools.hxx"
      29             : 
      30             : extern FltError ScImportLotus123old( SvStream&, ScDocument*, rtl_TextEncoding eSrc );
      31             :         // alter Krempel in filter.cxx!
      32             : 
      33           1 : FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc )
      34             : {
      35           1 :         ScFilterOptions aFilterOpt;
      36           1 :     sal_Bool bWithWK3 = aFilterOpt.GetWK3Flag();
      37             : 
      38           1 :     SvStream*           pStream = rMedium.GetInStream();
      39             : 
      40           1 :     if( !pStream )
      41           0 :         return eERR_OPEN;
      42             : 
      43             :     FltError            eRet;
      44             : 
      45           1 :     pStream->Seek( 0UL );
      46             : 
      47           1 :     pStream->SetBufferSize( 32768 );
      48             : 
      49           2 :     ImportLotus         aLotusImport( *pStream, pDocument, eSrc );
      50             : 
      51           1 :     if( bWithWK3 )
      52           0 :         eRet = aLotusImport.Read();
      53             :     else
      54           1 :         eRet = 0xFFFFFFFF;  // WK1 /WKS erzwingen
      55             : 
      56             :     // ACHTUNG: QUICK-HACK fuer WK1 / WKS  <->  WK3 / WK4
      57           1 :     if( eRet == 0xFFFFFFFF )
      58             :     {
      59           1 :         pStream->Seek( 0UL );
      60             : 
      61           1 :         pStream->SetBufferSize( 32768 );
      62             : 
      63           1 :         eRet = ScImportLotus123old( *pStream, pDocument, eSrc );
      64             : 
      65           1 :         pStream->SetBufferSize( 0 );
      66             : 
      67           1 :         return eRet;
      68             :     }
      69             : 
      70           0 :     if( eRet != eERR_OK )
      71           0 :         return eRet;
      72             : 
      73           0 :     if( pLotusRoot->eFirstType == Lotus_WK3 )
      74             :     {// versuchen *.FM3-File zu laden
      75           0 :         INetURLObject aURL( rMedium.GetURLObject() );
      76           0 :         aURL.setExtension( "FM3" );
      77           0 :         SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_STD_READ );
      78           0 :         pStream = aMedium.GetInStream();
      79           0 :         if ( pStream )
      80             :         {
      81           0 :             if( aLotusImport.Read( *pStream ) != eERR_OK )
      82           0 :                 eRet = SCWARN_IMPORT_WRONG_FM3;
      83             :         }
      84             :         else
      85           0 :             eRet = SCWARN_IMPORT_OPEN_FM3;
      86             :     }
      87             : 
      88           1 :     return eRet;
      89          18 : }
      90             : 
      91             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10