merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / source / filter / rtf / rtfimp.cxx
blob83b48b1fa2b113e1174d05919bd6339e4d7137ed
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sc.hxx"
33 #ifndef PCH
34 #include "global.hxx"
35 #include "document.hxx"
36 #include "filter.hxx"
37 #endif
38 #include "editutil.hxx"
39 #include "rtfimp.hxx"
40 #include "rtfparse.hxx"
41 #include "ftools.hxx"
44 FltError ScFormatFilterPluginImpl::ScImportRTF( SvStream &rStream, const String& rBaseURL, ScDocument *pDoc, ScRange& rRange )
46 ScRTFImport aImp( pDoc, rRange );
47 FltError nErr = (FltError) aImp.Read( rStream, rBaseURL );
48 ScRange aR = aImp.GetRange();
49 rRange.aEnd = aR.aEnd;
50 aImp.WriteToDocument();
51 return nErr;
54 ScEEAbsImport *ScFormatFilterPluginImpl::CreateRTFImport( ScDocument* pDoc, const ScRange& rRange )
56 return new ScRTFImport( pDoc, rRange );
60 ScRTFImport::ScRTFImport( ScDocument* pDocP, const ScRange& rRange ) :
61 ScEEImport( pDocP, rRange )
63 mpParser = new ScRTFParser( mpEngine );
67 ScRTFImport::~ScRTFImport()
69 // Reihenfolge wichtig, sonst knallt's irgendwann irgendwo in irgendeinem Dtor!
70 // Ist gewaehrleistet, da ScEEImport Basisklasse ist
71 delete (ScRTFParser*) mpParser; // vor EditEngine!