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 : : #ifndef SC_RTFPARSE_HXX
30 : : #define SC_RTFPARSE_HXX
31 : :
32 : : #include "eeparser.hxx"
33 : :
34 : : #ifdef SC_RTFPARSE_CXX
35 : : #include <boost/ptr_container/ptr_vector.hpp>
36 : : #include <o3tl/sorted_vector.hxx>
37 : :
38 : 0 : struct ScRTFCellDefault
39 : : {
40 : : SfxItemSet aItemSet;
41 : : SCCOL nCol;
42 : : sal_uInt16 nTwips; // rechter Rand der Zelle
43 : : SCCOL nColOverlap; // MergeCell wenn >1, merged cells wenn 0
44 : :
45 : 0 : ScRTFCellDefault( SfxItemPool* pPool ) :
46 : 0 : aItemSet( *pPool ), nColOverlap(1) {}
47 : : };
48 : :
49 : : // deswegen ULONG, typedef bringt's auch nicht :-(
50 : 0 : class ScRTFColTwips : public o3tl::sorted_vector<sal_uLong> {};
51 : :
52 : : #else // SC_RTFPARSE_CXX
53 : :
54 : : struct ScRTFCellDefault;
55 : : class ScRTFColTwips;
56 : :
57 : : #endif // SC_RTFPARSE_CXX
58 : :
59 : :
60 : : class EditEngine;
61 : :
62 : : class ScRTFParser : public ScEEParser
63 : : {
64 : : private:
65 : : typedef boost::ptr_vector<ScRTFCellDefault> DefaultList;
66 : :
67 : : DefaultList maDefaultList;
68 : : size_t mnCurPos;
69 : :
70 : : ScRTFColTwips* pColTwips;
71 : : ScRTFCellDefault* pInsDefault;
72 : : ScRTFCellDefault* pActDefault;
73 : : ScRTFCellDefault* pDefMerge;
74 : : sal_uLong nStartAdjust;
75 : : sal_uInt16 nLastWidth;
76 : : sal_Bool bNewDef;
77 : :
78 : : DECL_LINK( RTFImportHdl, ImportInfo* );
79 : : inline void NextRow();
80 : : void EntryEnd( ScEEParseEntry*, const ESelection& );
81 : : void ProcToken( ImportInfo* );
82 : : void ColAdjust();
83 : : sal_Bool SeekTwips( sal_uInt16 nTwips, SCCOL* pCol );
84 : : void NewCellRow( ImportInfo* );
85 : :
86 : : public:
87 : : ScRTFParser( EditEngine* );
88 : : virtual ~ScRTFParser();
89 : : virtual sal_uLong Read( SvStream&, const String& rBaseURL );
90 : : };
91 : :
92 : :
93 : : #endif
94 : :
95 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|