1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10*38d50f7bSAndrew Rist * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*38d50f7bSAndrew Rist * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19*38d50f7bSAndrew Rist * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_EXCRECDS_HXX 25cdf0e10cSrcweir #define SC_EXCRECDS_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <tools/solar.h> 28cdf0e10cSrcweir #include <svl/zforlist.hxx> 29cdf0e10cSrcweir #include <tools/string.hxx> 30cdf0e10cSrcweir #include <vcl/vclenum.hxx> 31cdf0e10cSrcweir #include <tools/color.hxx> 32cdf0e10cSrcweir 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <vector> 35cdf0e10cSrcweir #include "olinetab.hxx" 36cdf0e10cSrcweir #include "filter.hxx" 37cdf0e10cSrcweir #include "rangelst.hxx" 38cdf0e10cSrcweir #include "xerecord.hxx" 39cdf0e10cSrcweir #include "xeroot.hxx" 40cdf0e10cSrcweir #include "xeformula.hxx" 41cdf0e10cSrcweir #include "xestring.hxx" 42cdf0e10cSrcweir #include "root.hxx" 43cdf0e10cSrcweir #include "excdefs.hxx" 44cdf0e10cSrcweir #include "cell.hxx" 45cdf0e10cSrcweir 46cdf0e10cSrcweir //------------------------------------------------------------------ Forwards - 47cdf0e10cSrcweir 48cdf0e10cSrcweir class SvxBorderLine; 49cdf0e10cSrcweir 50cdf0e10cSrcweir class SvStream; 51cdf0e10cSrcweir class Font; 52cdf0e10cSrcweir class List; 53cdf0e10cSrcweir class ScPatternAttr; 54cdf0e10cSrcweir class ScTokenArray; 55cdf0e10cSrcweir class ScRangeData; 56cdf0e10cSrcweir class ScDBData; 57cdf0e10cSrcweir class ScEditCell; 58cdf0e10cSrcweir class SfxItemSet; 59cdf0e10cSrcweir class EditTextObject; 60cdf0e10cSrcweir class ScPageHFItem; 61cdf0e10cSrcweir class ScProgress; 62cdf0e10cSrcweir 63cdf0e10cSrcweir class ExcTable; 64cdf0e10cSrcweir 65cdf0e10cSrcweir //----------------------------------------------------------- class ExcRecord - 66cdf0e10cSrcweir 67cdf0e10cSrcweir class ExcRecord : public XclExpRecord 68cdf0e10cSrcweir { 69cdf0e10cSrcweir public: 70cdf0e10cSrcweir virtual void Save( XclExpStream& rStrm ); 71cdf0e10cSrcweir 72cdf0e10cSrcweir virtual sal_uInt16 GetNum() const = 0; 73cdf0e10cSrcweir virtual sal_Size GetLen() const = 0; 74cdf0e10cSrcweir 75cdf0e10cSrcweir protected: 76cdf0e10cSrcweir virtual void SaveCont( XclExpStream& rStrm ); 77cdf0e10cSrcweir 78cdf0e10cSrcweir private: 79cdf0e10cSrcweir /** Writes the body of the record. */ 80cdf0e10cSrcweir virtual void WriteBody( XclExpStream& rStrm ); 81cdf0e10cSrcweir }; 82cdf0e10cSrcweir 83cdf0e10cSrcweir 84cdf0e10cSrcweir //--------------------------------------------------------- class ExcEmptyRec - 85cdf0e10cSrcweir 86cdf0e10cSrcweir class ExcEmptyRec : public ExcRecord 87cdf0e10cSrcweir { 88cdf0e10cSrcweir private: 89cdf0e10cSrcweir protected: 90cdf0e10cSrcweir public: 91cdf0e10cSrcweir virtual void Save( XclExpStream& rStrm ); 92cdf0e10cSrcweir virtual sal_uInt16 GetNum() const; 93cdf0e10cSrcweir virtual sal_Size GetLen() const; 94cdf0e10cSrcweir }; 95cdf0e10cSrcweir 96cdf0e10cSrcweir 97cdf0e10cSrcweir //------------------------------------------------------- class ExcRecordList - 98cdf0e10cSrcweir 99cdf0e10cSrcweir class ExcRecordList : protected List, public ExcEmptyRec 100cdf0e10cSrcweir { 101cdf0e10cSrcweir private: 102cdf0e10cSrcweir protected: 103cdf0e10cSrcweir public: 104cdf0e10cSrcweir virtual ~ExcRecordList(); 105cdf0e10cSrcweir 106cdf0e10cSrcweir using List::Count; 107cdf0e10cSrcweir First(void)108cdf0e10cSrcweir inline ExcRecord* First( void ) { return ( ExcRecord* ) List::First(); } Next(void)109cdf0e10cSrcweir inline ExcRecord* Next( void ) { return ( ExcRecord* ) List::Next(); } 110cdf0e10cSrcweir Append(ExcRecord * pNew)111cdf0e10cSrcweir inline void Append( ExcRecord* pNew ) { if( pNew ) List::Insert( pNew, LIST_APPEND ); } Get(sal_uInt32 nNum) const112cdf0e10cSrcweir inline const ExcRecord* Get( sal_uInt32 nNum ) const { return ( ExcRecord* ) List::GetObject( nNum ); } 113cdf0e10cSrcweir 114cdf0e10cSrcweir virtual void Save( XclExpStream& rStrm ); 115cdf0e10cSrcweir }; 116cdf0e10cSrcweir 117cdf0e10cSrcweir 118cdf0e10cSrcweir //--------------------------------------------------------- class ExcDummyRec - 119cdf0e10cSrcweir 120cdf0e10cSrcweir class ExcDummyRec : public ExcRecord 121cdf0e10cSrcweir { 122cdf0e10cSrcweir protected: 123cdf0e10cSrcweir public: 124cdf0e10cSrcweir virtual void Save( XclExpStream& rStrm ); 125cdf0e10cSrcweir virtual sal_uInt16 GetNum() const; 126cdf0e10cSrcweir virtual const sal_uInt8* GetData() const = 0; // byte data must contain header and body 127cdf0e10cSrcweir }; 128cdf0e10cSrcweir 129cdf0e10cSrcweir 130cdf0e10cSrcweir //------------------------------------------------------- class ExcBoolRecord - 131cdf0e10cSrcweir // stores sal_Bool as 16bit val ( 0x0000 | 0x0001 ) 132cdf0e10cSrcweir 133cdf0e10cSrcweir class ExcBoolRecord : public ExcRecord 134cdf0e10cSrcweir { 135cdf0e10cSrcweir private: 136cdf0e10cSrcweir virtual void SaveCont( XclExpStream& rStrm ); 137cdf0e10cSrcweir 138cdf0e10cSrcweir protected: 139cdf0e10cSrcweir sal_Bool bVal; 140cdf0e10cSrcweir ExcBoolRecord()141cdf0e10cSrcweir inline ExcBoolRecord() : bVal( sal_False ) {} 142cdf0e10cSrcweir 143cdf0e10cSrcweir public: ExcBoolRecord(const sal_Bool bDefault)144cdf0e10cSrcweir inline ExcBoolRecord( const sal_Bool bDefault ) : bVal( bDefault ) {} 145cdf0e10cSrcweir 146cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 147cdf0e10cSrcweir }; 148cdf0e10cSrcweir 149cdf0e10cSrcweir 150cdf0e10cSrcweir //--------------------------------------------------------- class ExcBof_Base - 151cdf0e10cSrcweir 152cdf0e10cSrcweir class ExcBof_Base : public ExcRecord 153cdf0e10cSrcweir { 154cdf0e10cSrcweir private: 155cdf0e10cSrcweir protected: 156cdf0e10cSrcweir sal_uInt16 nDocType; 157cdf0e10cSrcweir sal_uInt16 nVers; 158cdf0e10cSrcweir sal_uInt16 nRupBuild; 159cdf0e10cSrcweir sal_uInt16 nRupYear; 160cdf0e10cSrcweir public: 161cdf0e10cSrcweir ExcBof_Base( void ); 162cdf0e10cSrcweir }; 163cdf0e10cSrcweir 164cdf0e10cSrcweir 165cdf0e10cSrcweir //-------------------------------------------------------------- class ExcBof - 166cdf0e10cSrcweir // Header Record fuer WORKSHEETS 167cdf0e10cSrcweir 168cdf0e10cSrcweir class ExcBof : public ExcBof_Base 169cdf0e10cSrcweir { 170cdf0e10cSrcweir private: 171cdf0e10cSrcweir virtual void SaveCont( XclExpStream& rStrm ); 172cdf0e10cSrcweir public: 173cdf0e10cSrcweir ExcBof( void ); 174cdf0e10cSrcweir 175cdf0e10cSrcweir virtual sal_uInt16 GetNum( void ) const; 176cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 177cdf0e10cSrcweir }; 178cdf0e10cSrcweir 179cdf0e10cSrcweir 180cdf0e10cSrcweir //------------------------------------------------------------- class ExcBofW - 181cdf0e10cSrcweir // Header Record fuer WORKBOOKS 182cdf0e10cSrcweir 183cdf0e10cSrcweir class ExcBofW : public ExcBof_Base 184cdf0e10cSrcweir { 185cdf0e10cSrcweir private: 186cdf0e10cSrcweir virtual void SaveCont( XclExpStream& rStrm ); 187cdf0e10cSrcweir public: 188cdf0e10cSrcweir ExcBofW( void ); 189cdf0e10cSrcweir 190cdf0e10cSrcweir virtual sal_uInt16 GetNum( void ) const; 191cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 192cdf0e10cSrcweir }; 193cdf0e10cSrcweir 194cdf0e10cSrcweir 195cdf0e10cSrcweir //-------------------------------------------------------------- class ExcEof - 196cdf0e10cSrcweir 197cdf0e10cSrcweir class ExcEof : public ExcRecord 198cdf0e10cSrcweir { 199cdf0e10cSrcweir private: 200cdf0e10cSrcweir public: 201cdf0e10cSrcweir virtual sal_uInt16 GetNum( void ) const; 202cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 203cdf0e10cSrcweir }; 204cdf0e10cSrcweir 205cdf0e10cSrcweir 206cdf0e10cSrcweir //--------------------------------------------------------- class ExcDummy_00 - 207cdf0e10cSrcweir // INTERFACEHDR to FNGROUPCOUNT (see excrecds.cxx) 208cdf0e10cSrcweir 209cdf0e10cSrcweir class ExcDummy_00 : public ExcDummyRec 210cdf0e10cSrcweir { 211cdf0e10cSrcweir private: 212cdf0e10cSrcweir static const sal_uInt8 pMyData[]; 213cdf0e10cSrcweir static const sal_Size nMyLen; 214cdf0e10cSrcweir public: 215cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 216cdf0e10cSrcweir virtual const sal_uInt8* GetData( void ) const; 217cdf0e10cSrcweir }; 218cdf0e10cSrcweir 219cdf0e10cSrcweir // EXC_ID_WINDOWPROTECTION 220cdf0e10cSrcweir class XclExpWindowProtection : public XclExpBoolRecord 221cdf0e10cSrcweir { 222cdf0e10cSrcweir public: 223cdf0e10cSrcweir XclExpWindowProtection(bool bValue); 224cdf0e10cSrcweir 225cdf0e10cSrcweir virtual void SaveXml( XclExpXmlStream& rStrm ); 226cdf0e10cSrcweir }; 227cdf0e10cSrcweir 228cdf0e10cSrcweir // EXC_ID_PROTECT Document Protection 229cdf0e10cSrcweir class XclExpProtection : public XclExpBoolRecord 230cdf0e10cSrcweir { 231cdf0e10cSrcweir public: 232cdf0e10cSrcweir XclExpProtection(bool bValue); 233cdf0e10cSrcweir }; 234cdf0e10cSrcweir 235cdf0e10cSrcweir class XclExpPassHash : public XclExpRecord 236cdf0e10cSrcweir { 237cdf0e10cSrcweir public: 238cdf0e10cSrcweir XclExpPassHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aHash); 239cdf0e10cSrcweir virtual ~XclExpPassHash(); 240cdf0e10cSrcweir 241cdf0e10cSrcweir private: 242cdf0e10cSrcweir virtual void WriteBody(XclExpStream& rStrm); 243cdf0e10cSrcweir 244cdf0e10cSrcweir private: 245cdf0e10cSrcweir sal_uInt16 mnHash; 246cdf0e10cSrcweir }; 247cdf0e10cSrcweir 248cdf0e10cSrcweir 249cdf0e10cSrcweir //-------------------------------------------------------- class ExcDummy_04x - 250cdf0e10cSrcweir // PASSWORD to BOOKBOOL (see excrecds.cxx), no 1904 251cdf0e10cSrcweir 252cdf0e10cSrcweir class ExcDummy_040 : public ExcDummyRec 253cdf0e10cSrcweir { 254cdf0e10cSrcweir private: 255cdf0e10cSrcweir static const sal_uInt8 pMyData[]; 256cdf0e10cSrcweir static const sal_Size nMyLen; 257cdf0e10cSrcweir public: 258cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 259cdf0e10cSrcweir virtual const sal_uInt8* GetData( void ) const; 260cdf0e10cSrcweir }; 261cdf0e10cSrcweir 262cdf0e10cSrcweir 263cdf0e10cSrcweir 264cdf0e10cSrcweir class ExcDummy_041 : public ExcDummyRec 265cdf0e10cSrcweir { 266cdf0e10cSrcweir private: 267cdf0e10cSrcweir static const sal_uInt8 pMyData[]; 268cdf0e10cSrcweir static const sal_Size nMyLen; 269cdf0e10cSrcweir public: 270cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 271cdf0e10cSrcweir virtual const sal_uInt8* GetData( void ) const; 272cdf0e10cSrcweir }; 273cdf0e10cSrcweir 274cdf0e10cSrcweir 275cdf0e10cSrcweir //------------------------------------------------------------- class Exc1904 - 276cdf0e10cSrcweir 277cdf0e10cSrcweir class Exc1904 : public ExcBoolRecord 278cdf0e10cSrcweir { 279cdf0e10cSrcweir public: 280cdf0e10cSrcweir Exc1904( ScDocument& rDoc ); 281cdf0e10cSrcweir virtual sal_uInt16 GetNum( void ) const; 282cdf0e10cSrcweir 283cdf0e10cSrcweir virtual void SaveXml( XclExpXmlStream& rStrm ); 284cdf0e10cSrcweir }; 285cdf0e10cSrcweir 286cdf0e10cSrcweir 287cdf0e10cSrcweir //------------------------------------------------------ class ExcBundlesheet - 288cdf0e10cSrcweir 289cdf0e10cSrcweir class ExcBundlesheetBase : public ExcRecord 290cdf0e10cSrcweir { 291cdf0e10cSrcweir protected: 292cdf0e10cSrcweir sal_Size nStrPos; 293cdf0e10cSrcweir sal_Size nOwnPos; // Position NACH # und Len 294cdf0e10cSrcweir sal_uInt16 nGrbit; 295cdf0e10cSrcweir SCTAB nTab; 296cdf0e10cSrcweir 297cdf0e10cSrcweir ExcBundlesheetBase(); 298cdf0e10cSrcweir 299cdf0e10cSrcweir public: 300cdf0e10cSrcweir ExcBundlesheetBase( RootData& rRootData, SCTAB nTab ); 301cdf0e10cSrcweir SetStreamPos(sal_Size nNewStrPos)302cdf0e10cSrcweir inline void SetStreamPos( sal_Size nNewStrPos ) { nStrPos = nNewStrPos; } 303cdf0e10cSrcweir void UpdateStreamPos( XclExpStream& rStrm ); 304cdf0e10cSrcweir 305cdf0e10cSrcweir virtual sal_uInt16 GetNum() const; 306cdf0e10cSrcweir }; 307cdf0e10cSrcweir 308cdf0e10cSrcweir 309cdf0e10cSrcweir 310cdf0e10cSrcweir class ExcBundlesheet : public ExcBundlesheetBase 311cdf0e10cSrcweir { 312cdf0e10cSrcweir private: 313cdf0e10cSrcweir ByteString aName; 314cdf0e10cSrcweir 315cdf0e10cSrcweir virtual void SaveCont( XclExpStream& rStrm ); 316cdf0e10cSrcweir 317cdf0e10cSrcweir public: 318cdf0e10cSrcweir ExcBundlesheet( RootData& rRootData, SCTAB nTab ); 319cdf0e10cSrcweir virtual sal_Size GetLen() const; 320cdf0e10cSrcweir }; 321cdf0e10cSrcweir 322cdf0e10cSrcweir //--------------------------------------------------------- class ExcDummy_02 - 323cdf0e10cSrcweir // sheet dummies: CALCMODE to SETUP 324cdf0e10cSrcweir 325cdf0e10cSrcweir class ExcDummy_02a : public ExcDummyRec 326cdf0e10cSrcweir { 327cdf0e10cSrcweir private: 328cdf0e10cSrcweir static const sal_uInt8 pMyData[]; 329cdf0e10cSrcweir static const sal_Size nMyLen; 330cdf0e10cSrcweir public: 331cdf0e10cSrcweir virtual sal_Size GetLen( void ) const; 332cdf0e10cSrcweir virtual const sal_uInt8* GetData( void ) const; 333cdf0e10cSrcweir }; 334cdf0e10cSrcweir 335cdf0e10cSrcweir 336cdf0e10cSrcweir // ---------------------------------------------------------------------------- 337cdf0e10cSrcweir 338cdf0e10cSrcweir /** This record contains the Windows country IDs for the UI and document language. */ 339cdf0e10cSrcweir class XclExpCountry : public XclExpRecord 340cdf0e10cSrcweir { 341cdf0e10cSrcweir public: 342cdf0e10cSrcweir explicit XclExpCountry( const XclExpRoot& rRoot ); 343cdf0e10cSrcweir 344cdf0e10cSrcweir private: 345cdf0e10cSrcweir sal_uInt16 mnUICountry; /// The UI country ID. 346cdf0e10cSrcweir sal_uInt16 mnDocCountry; /// The document country ID. 347cdf0e10cSrcweir 348cdf0e10cSrcweir /** Writes the body of the COUNTRY record. */ 349cdf0e10cSrcweir virtual void WriteBody( XclExpStream& rStrm ); 350cdf0e10cSrcweir }; 351cdf0e10cSrcweir 352cdf0e10cSrcweir 353cdf0e10cSrcweir // XclExpWsbool =============================================================== 354cdf0e10cSrcweir 355cdf0e10cSrcweir class XclExpWsbool : public XclExpUInt16Record 356cdf0e10cSrcweir { 357cdf0e10cSrcweir public: 358cdf0e10cSrcweir explicit XclExpWsbool( bool bFitToPages, SCTAB nScTab = -1, XclExpFilterManager* pManager = NULL ); 359cdf0e10cSrcweir 360cdf0e10cSrcweir virtual void SaveXml( XclExpXmlStream& rStrm ); 361cdf0e10cSrcweir private: 362cdf0e10cSrcweir SCTAB mnScTab; 363cdf0e10cSrcweir XclExpFilterManager* mpManager; 364cdf0e10cSrcweir }; 365cdf0e10cSrcweir 366cdf0e10cSrcweir 367cdf0e10cSrcweir // ============================================================================ 368cdf0e10cSrcweir 369cdf0e10cSrcweir class XclExpFiltermode : public XclExpEmptyRecord 370cdf0e10cSrcweir { 371cdf0e10cSrcweir public: 372cdf0e10cSrcweir explicit XclExpFiltermode(); 373cdf0e10cSrcweir }; 374cdf0e10cSrcweir 375cdf0e10cSrcweir // ---------------------------------------------------------------------------- 376cdf0e10cSrcweir 377cdf0e10cSrcweir class XclExpAutofilterinfo : public XclExpUInt16Record 378cdf0e10cSrcweir { 379cdf0e10cSrcweir public: 380cdf0e10cSrcweir explicit XclExpAutofilterinfo( const ScAddress& rStartPos, SCCOL nScCol ); 381cdf0e10cSrcweir GetStartPos() const382cdf0e10cSrcweir inline const ScAddress GetStartPos() const { return maStartPos; } GetColCount() const383cdf0e10cSrcweir inline SCCOL GetColCount() const { return static_cast< SCCOL >( GetValue() ); } 384cdf0e10cSrcweir 385cdf0e10cSrcweir private: 386cdf0e10cSrcweir ScAddress maStartPos; 387cdf0e10cSrcweir }; 388cdf0e10cSrcweir 389cdf0e10cSrcweir // ---------------------------------------------------------------------------- 390cdf0e10cSrcweir 391cdf0e10cSrcweir class ExcFilterCondition 392cdf0e10cSrcweir { 393cdf0e10cSrcweir private: 394cdf0e10cSrcweir sal_uInt8 nType; 395cdf0e10cSrcweir sal_uInt8 nOper; 396cdf0e10cSrcweir double fVal; 397cdf0e10cSrcweir XclExpString* pText; 398cdf0e10cSrcweir 399cdf0e10cSrcweir protected: 400cdf0e10cSrcweir public: 401cdf0e10cSrcweir ExcFilterCondition(); 402cdf0e10cSrcweir ~ExcFilterCondition(); 403cdf0e10cSrcweir IsEmpty() const404cdf0e10cSrcweir inline sal_Bool IsEmpty() const { return (nType == EXC_AFTYPE_NOTUSED); } HasEqual() const405cdf0e10cSrcweir inline sal_Bool HasEqual() const { return (nOper == EXC_AFOPER_EQUAL); } 406cdf0e10cSrcweir sal_uLong GetTextBytes() const; 407cdf0e10cSrcweir 408cdf0e10cSrcweir void SetCondition( sal_uInt8 nTp, sal_uInt8 nOp, double fV, String* pT ); 409cdf0e10cSrcweir 410cdf0e10cSrcweir void Save( XclExpStream& rStrm ); 411cdf0e10cSrcweir void SaveXml( XclExpXmlStream& rStrm ); 412cdf0e10cSrcweir void SaveText( XclExpStream& rStrm ); 413cdf0e10cSrcweir }; 414cdf0e10cSrcweir 415cdf0e10cSrcweir // ---------------------------------------------------------------------------- 416cdf0e10cSrcweir 417cdf0e10cSrcweir class XclExpAutofilter : public XclExpRecord, protected XclExpRoot 418cdf0e10cSrcweir { 419cdf0e10cSrcweir private: 420cdf0e10cSrcweir sal_uInt16 nCol; 421cdf0e10cSrcweir sal_uInt16 nFlags; 422cdf0e10cSrcweir ExcFilterCondition aCond[ 2 ]; 423cdf0e10cSrcweir 424cdf0e10cSrcweir sal_Bool AddCondition( ScQueryConnect eConn, sal_uInt8 nType, 425cdf0e10cSrcweir sal_uInt8 nOp, double fVal, String* pText, 426cdf0e10cSrcweir sal_Bool bSimple = sal_False ); 427cdf0e10cSrcweir 428cdf0e10cSrcweir virtual void WriteBody( XclExpStream& rStrm ); 429cdf0e10cSrcweir 430cdf0e10cSrcweir protected: 431cdf0e10cSrcweir public: 432cdf0e10cSrcweir XclExpAutofilter( const XclExpRoot& rRoot, sal_uInt16 nC ); 433cdf0e10cSrcweir GetCol() const434cdf0e10cSrcweir inline sal_uInt16 GetCol() const { return nCol; } HasCondition() const435cdf0e10cSrcweir inline sal_Bool HasCondition() const { return !aCond[ 0 ].IsEmpty(); } HasTop10() const436cdf0e10cSrcweir inline sal_Bool HasTop10() const { return ::get_flag( nFlags, EXC_AFFLAG_TOP10 ); } 437cdf0e10cSrcweir 438cdf0e10cSrcweir sal_Bool AddEntry( const ScQueryEntry& rEntry ); 439cdf0e10cSrcweir 440cdf0e10cSrcweir virtual void SaveXml( XclExpXmlStream& rStrm ); 441cdf0e10cSrcweir }; 442cdf0e10cSrcweir 443cdf0e10cSrcweir // ---------------------------------------------------------------------------- 444cdf0e10cSrcweir 445cdf0e10cSrcweir class ExcAutoFilterRecs : public XclExpRecordBase, protected XclExpRoot 446cdf0e10cSrcweir { 447cdf0e10cSrcweir public: 448cdf0e10cSrcweir explicit ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ); 449cdf0e10cSrcweir virtual ~ExcAutoFilterRecs(); 450cdf0e10cSrcweir 451cdf0e10cSrcweir void AddObjRecs(); 452cdf0e10cSrcweir 453cdf0e10cSrcweir virtual void Save( XclExpStream& rStrm ); 454cdf0e10cSrcweir virtual void SaveXml( XclExpXmlStream& rStrm ); 455cdf0e10cSrcweir 456cdf0e10cSrcweir bool HasFilterMode() const; 457cdf0e10cSrcweir 458cdf0e10cSrcweir private: 459cdf0e10cSrcweir XclExpAutofilter* GetByCol( SCCOL nCol ); // always 0-based 460cdf0e10cSrcweir sal_Bool IsFiltered( SCCOL nCol ); 461cdf0e10cSrcweir 462cdf0e10cSrcweir private: 463cdf0e10cSrcweir typedef XclExpRecordList< XclExpAutofilter > XclExpAutofilterList; 464cdf0e10cSrcweir typedef XclExpAutofilterList::RecordRefType XclExpAutofilterRef; 465cdf0e10cSrcweir 466cdf0e10cSrcweir XclExpAutofilterList maFilterList; 467cdf0e10cSrcweir XclExpFiltermode* pFilterMode; 468cdf0e10cSrcweir XclExpAutofilterinfo* pFilterInfo; 469cdf0e10cSrcweir ScRange maRef; 470cdf0e10cSrcweir }; 471cdf0e10cSrcweir 472cdf0e10cSrcweir // ---------------------------------------------------------------------------- 473cdf0e10cSrcweir 474cdf0e10cSrcweir /** Sheet filter manager. Contains auto filters or advanced filters from all sheets. */ 475cdf0e10cSrcweir class XclExpFilterManager : protected XclExpRoot 476cdf0e10cSrcweir { 477cdf0e10cSrcweir public: 478cdf0e10cSrcweir explicit XclExpFilterManager( const XclExpRoot& rRoot ); 479cdf0e10cSrcweir 480cdf0e10cSrcweir /** Creates the filter records for the specified sheet. 481cdf0e10cSrcweir @descr Creates and inserts related built-in NAME records. Therefore this 482cdf0e10cSrcweir function is called from the name buffer itself. */ 483cdf0e10cSrcweir void InitTabFilter( SCTAB nScTab ); 484cdf0e10cSrcweir 485cdf0e10cSrcweir /** Returns a record object containing all filter records for the specified sheet. */ 486cdf0e10cSrcweir XclExpRecordRef CreateRecord( SCTAB nScTab ); 487cdf0e10cSrcweir 488cdf0e10cSrcweir /** Returns whether or not FilterMode is present */ 489cdf0e10cSrcweir bool HasFilterMode( SCTAB nScTab ); 490cdf0e10cSrcweir 491cdf0e10cSrcweir private: 492cdf0e10cSrcweir using XclExpRoot::CreateRecord; 493cdf0e10cSrcweir 494cdf0e10cSrcweir typedef ScfRef< ExcAutoFilterRecs > XclExpTabFilterRef; 495cdf0e10cSrcweir typedef ::std::map< SCTAB, XclExpTabFilterRef > XclExpTabFilterMap; 496cdf0e10cSrcweir 497cdf0e10cSrcweir XclExpTabFilterMap maFilterMap; 498cdf0e10cSrcweir }; 499cdf0e10cSrcweir 500cdf0e10cSrcweir 501cdf0e10cSrcweir #endif 502cdf0e10cSrcweir 503