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_EXCIMP8_HXX
30 : : #define SC_EXCIMP8_HXX
31 : :
32 : : #include <string.h>
33 : :
34 : : #include <boost/ptr_container/ptr_vector.hpp>
35 : :
36 : : #include "imp_op.hxx"
37 : : #include "root.hxx"
38 : : #include "excscen.hxx"
39 : : #include "excdefs.hxx"
40 : : #include "ftools.hxx"
41 : : #include "queryparam.hxx"
42 : :
43 : : class ScDBData;
44 : : class XclImpStream;
45 : :
46 : :
47 : :
48 : : class ImportExcel8 : public ImportExcel
49 : : {
50 : : public:
51 : : ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm );
52 : : virtual ~ImportExcel8( void );
53 : :
54 : : virtual FltError Read( void );
55 : :
56 : : void Calccount( void ); // 0x0C
57 : : void Precision( void ); // 0x0E
58 : : void Delta( void ); // 0x10
59 : : void Iteration( void ); // 0x11
60 : : void Boundsheet( void ); // 0x85
61 : : void FilterMode( void ); // 0x9B
62 : : void AutoFilterInfo( void ); // 0x9D
63 : : void AutoFilter( void ); // 0x9E
64 : : void Scenman( void ); // 0xAE
65 : : void Scenario( void ); // 0xAF
66 : : void ReadBasic( void ); // 0xD3
67 : : void Labelsst( void ); // 0xFD
68 : :
69 : : void Hlink( void ); // 0x01B8
70 : : void Codename( sal_Bool bWBGlobals ); // 0x01BA
71 : : void SheetProtection( void ); // 0x0867
72 : :
73 : : virtual void EndSheet( void );
74 : : virtual void PostDocLoad( void );
75 : :
76 : : private:
77 : : void LoadDocumentProperties();
78 : :
79 : : private:
80 : : // represents codename ( and associated modules )
81 : : // not speficied directly in the binary format
82 : : std::vector<rtl::OUString> maAutoGeneratedCodeNames;
83 : : ExcScenarioList maScenList;
84 : : };
85 : :
86 : :
87 : :
88 : : //___________________________________________________________________
89 : : // classes AutoFilterData, AutoFilterBuffer
90 : :
91 : 18 : class XclImpAutoFilterData : private ExcRoot
92 : : {
93 : : private:
94 : : ScDBData* pCurrDBData;
95 : : ScQueryParam aParam;
96 : : ScRange aCriteriaRange;
97 : : bool bActive:1;
98 : : bool bCriteria:1;
99 : : bool bAutoOrAdvanced:1;
100 : :
101 : : void CreateFromDouble( rtl::OUString& rStr, double fVal );
102 : : void SetCellAttribs();
103 : : void InsertQueryParam();
104 : :
105 : : protected:
106 : : public:
107 : : XclImpAutoFilterData(
108 : : RootData* pRoot,
109 : : const ScRange& rRange);
110 : :
111 : 18 : inline bool IsActive() const { return bActive; }
112 : 18 : inline bool IsFiltered() const { return bAutoOrAdvanced; }
113 : 357 : inline SCTAB Tab() const { return aParam.nTab; }
114 : 51 : inline SCCOL StartCol() const { return aParam.nCol1; }
115 : 87 : inline SCROW StartRow() const { return aParam.nRow1; }
116 : 63 : inline SCCOL EndCol() const { return aParam.nCol2; }
117 : 33 : inline SCROW EndRow() const { return aParam.nRow2; }
118 : :
119 : : void ReadAutoFilter( XclImpStream& rStrm );
120 : :
121 : 18 : inline void Activate() { bActive = true; }
122 : : void SetAdvancedRange( const ScRange* pRange );
123 : : void SetExtractPos( const ScAddress& rAddr );
124 : 15 : inline void SetAutoOrAdvanced() { bAutoOrAdvanced = true; }
125 : : void Apply();
126 : : void CreateScDBData();
127 : : void EnableRemoveFilter();
128 : : };
129 : :
130 : :
131 : 110 : class XclImpAutoFilterBuffer
132 : : {
133 : : public:
134 : :
135 : : void Insert( RootData* pRoot, const ScRange& rRange);
136 : : void AddAdvancedRange( const ScRange& rRange );
137 : : void AddExtractPos( const ScRange& rRange );
138 : : void Apply();
139 : :
140 : : XclImpAutoFilterData* GetByTab( SCTAB nTab );
141 : :
142 : : private:
143 : :
144 : : boost::ptr_vector<XclImpAutoFilterData> maFilters;
145 : : };
146 : :
147 : : #endif
148 : :
149 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|