fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / filter / lotus / lotus.cxx
blob321d4bd4543b0bb590237f7bbb24cfe7428ecaac
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "lotfilter.hxx"
21 #include "lotimpop.hxx"
23 #include <sfx2/docfile.hxx>
24 #include <tools/urlobj.hxx>
26 #include "scerrors.hxx"
27 #include "root.hxx"
28 #include "filtopt.hxx"
29 #include "ftools.hxx"
31 FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc )
33 ScFilterOptions aFilterOpt;
34 bool bWithWK3 = aFilterOpt.GetWK3Flag();
36 SvStream* pStream = rMedium.GetInStream();
38 if( !pStream )
39 return eERR_OPEN;
41 FltError eRet;
43 pStream->Seek( 0UL );
45 pStream->SetBufferSize( 32768 );
47 LotusContext aContext;
49 ImportLotus aLotusImport(aContext, *pStream, pDocument, eSrc);
51 if( bWithWK3 )
52 eRet = aLotusImport.Read();
53 else
54 eRet = 0xFFFFFFFF; // WK1 /WKS erzwingen
56 // ACHTUNG: QUICK-HACK fuer WK1 / WKS <-> WK3 / WK4
57 if( eRet == 0xFFFFFFFF )
59 pStream->Seek( 0UL );
61 pStream->SetBufferSize( 32768 );
63 eRet = ScImportLotus123old(aContext, *pStream, pDocument, eSrc);
65 pStream->SetBufferSize( 0 );
67 return eRet;
70 if( eRet != eERR_OK )
71 return eRet;
73 if (aContext.pLotusRoot->eFirstType == Lotus_WK3)
75 // versuchen *.FM3-File zu laden
76 INetURLObject aURL( rMedium.GetURLObject() );
77 aURL.setExtension( "FM3" );
78 SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_STD_READ );
79 pStream = aMedium.GetInStream();
80 if ( pStream )
82 if( aLotusImport.Read( *pStream ) != eERR_OK )
83 eRet = SCWARN_IMPORT_WRONG_FM3;
85 else
86 eRet = SCWARN_IMPORT_OPEN_FM3;
89 return eRet;
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */