diff options
Diffstat (limited to 'sc/inc')
37 files changed, 513 insertions, 560 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index f1859be15fcf..728f011c3cbc 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -276,7 +276,7 @@ public: {} /* Use the formula::FormulaGrammar::AddressConvention associated with rAddr::Tab() */ Details( const ScDocument* pDoc, const ScAddress & rAddr ); - void SetPos( const ScDocument* pDoc, const ScAddress & rAddr ); +//UNUSED2009-05 void SetPos( const ScDocument* pDoc, const ScAddress & rAddr ); }; SC_DLLPUBLIC static const Details detailsOOOa1; diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 1f6c02c2d74f..5cbe1bafd290 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -110,8 +110,9 @@ public: void SetTab(SCTAB nNewTab) { nTab = nNewTab; } void SetCol(SCCOL nNewCol) { nCol = nNewCol; } - +#ifdef DBG_UTIL void TestData() const; +#endif void Reset( const ScPatternAttr* pPattern, BOOL bAlloc = TRUE ); BOOL Concat(SCSIZE nPos); diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index cae72cf30cf5..8dd77cf68c3f 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -244,8 +244,8 @@ public: const IntlWrapper* pIntl = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - BOOL GetTableList( List& aList ) const; - void SetTableList( const List& aList ); +//UNUSED2009-05 BOOL GetTableList( List& aList ) const; +//UNUSED2009-05 void SetTableList( const List& aList ); public: USHORT nCount; diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index 10de035abf7c..1f2bff35ce98 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -37,6 +37,7 @@ #include <tools/mempool.hxx> #include <svtools/listener.hxx> #include "global.hxx" +#include "rangenam.hxx" #include "formula/grammar.hxx" #include "tokenarray.hxx" #include "formularesult.hxx" @@ -59,9 +60,6 @@ class ScCodeArray; class ScProgress; class ScPostIt; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; - // ============================================================================ /** Default cell clone flags: do not start listening, do not adjust 3D refs to @@ -196,10 +194,6 @@ public: ~ScNoteCell(); #endif - ScNoteCell( SvStream& rStream, USHORT nVer ); - - void Save( SvStream& rStream ) const; - private: ScNoteCell( const ScNoteCell& ); }; @@ -296,8 +290,6 @@ enum ScMatrixMode { MM_FAKE = 3 // Interpret "as-if" matrix formula (legacy) }; -class ScIndexMap; - class SC_DLLPUBLIC ScFormulaCell : public ScBaseCell, public SvtListener { private: @@ -420,7 +412,7 @@ public: void UpdateCompile( BOOL bForceIfNameInUse = FALSE ); BOOL IsRangeNameInUse(USHORT nIndex) const; void FindRangeNamesInUse(std::set<USHORT>& rIndexes) const; - void ReplaceRangeNamesInUse( const ScIndexMap& rMap ); + void ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap ); BOOL IsSubTotal() const { return bSubTotal; } BOOL IsChanged() const { return bChanged; } void ResetChanged() { bChanged = FALSE; } diff --git a/sc/inc/chartarr.hxx b/sc/inc/chartarr.hxx index e2650c5652c1..b04c70eb01b3 100644 --- a/sc/inc/chartarr.hxx +++ b/sc/inc/chartarr.hxx @@ -40,7 +40,6 @@ class ScAddress; class Table; class ScDocument; -class ScMultipleReadHeader; // ScMemChart is a stripped-down SchMemChart from old chart, diff --git a/sc/inc/chartpos.hxx b/sc/inc/chartpos.hxx index b3b6e8763eb1..cd0bd47f2a32 100644 --- a/sc/inc/chartpos.hxx +++ b/sc/inc/chartpos.hxx @@ -100,8 +100,8 @@ public: return ppRowHeader[ nChartRow ]; return NULL; } - ScRangeListRef GetColRanges( SCCOL nChartCol ) const; - ScRangeListRef GetRowRanges( SCROW nChartRow ) const; +//UNUSED2009-05 ScRangeListRef GetColRanges( SCCOL nChartCol ) const; +//UNUSED2009-05 ScRangeListRef GetRowRanges( SCROW nChartRow ) const; }; @@ -114,7 +114,6 @@ enum ScChartGlue { }; class ScDocument; -class ScMultipleReadHeader; class ScChartPositioner // nur noch Parameter-Struct { diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index 54a6570c0f1d..6707473f5610 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -89,8 +89,6 @@ enum ScChangeActionClipMode }; class SvStream; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; // --- ScChangeActionLinkEntry --------------------------------------------- @@ -278,28 +276,8 @@ protected: const ScBigRange&, const ULONG nAction); - ScChangeAction( SvStream&, - ScMultipleReadHeader&, ScChangeTrack* ); virtual ~ScChangeAction(); - static void StoreCell( ScBaseCell*, SvStream&, - ScMultipleWriteHeader& ); - static ScBaseCell* LoadCell( SvStream&, ScMultipleReadHeader&, - ScDocument*, USHORT nVer ); - - static BOOL StoreLinkChain( ScChangeActionLinkEntry*, - SvStream& ); - static BOOL LoadLinkChain( ScChangeAction*, - ScChangeActionLinkEntry**, - SvStream&, ScChangeTrack*, - BOOL bLinkDeleted ); - - static BOOL StoreCellList( ScChangeActionCellListEntry*, - SvStream& ); - static BOOL LoadCellList( ScChangeAction* pOfAction, - ScChangeActionCellListEntry*&, SvStream&, - ScChangeTrack* ); - String GetRefString( const ScBigRange&, ScDocument*, BOOL bFlag3D = FALSE ) const; @@ -367,10 +345,6 @@ protected: // used in Reject() instead of IsRejectable() BOOL IsInternalRejectable() const; - virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const; - virtual BOOL StoreLinks( SvStream& ) const; - virtual BOOL LoadLinks( SvStream&, ScChangeTrack* ); - // Derived classes that hold a pointer to the // ChangeTrack must return that. Otherwise NULL. virtual const ScChangeTrack* GetChangeTrack() const = 0; @@ -491,8 +465,6 @@ class ScChangeActionIns : public ScChangeAction friend class ScChangeTrack; ScChangeActionIns( const ScRange& rRange ); - ScChangeActionIns( SvStream&, - ScMultipleReadHeader&, ScChangeTrack* ); virtual ~ScChangeActionIns(); virtual void AddContent( ScChangeActionContent* ) {} @@ -500,8 +472,6 @@ class ScChangeActionIns : public ScChangeAction virtual BOOL Reject( ScDocument* ); - virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const; - virtual const ScChangeTrack* GetChangeTrack() const { return 0; } public: @@ -586,9 +556,6 @@ class ScChangeActionDel : public ScChangeAction ScChangeActionDel( const ScRange& rRange, SCsCOL nDx, SCsROW nDy, ScChangeTrack* ); - ScChangeActionDel( SvStream&, - ScMultipleReadHeader&, ScDocument*, - USHORT nVer, ScChangeTrack* ); virtual ~ScChangeActionDel(); ScChangeActionIns* GetCutOffInsert() { return pCutOff; } @@ -607,9 +574,6 @@ class ScChangeActionDel : public ScChangeAction virtual const ScChangeTrack* GetChangeTrack() const { return pTrack; } - virtual BOOL StoreLinks( SvStream& ) const; - virtual BOOL LoadLinks( SvStream&, ScChangeTrack* ); - public: ScChangeActionDel(const ULONG nActionNumber, const ScChangeActionState eState, @@ -687,8 +651,6 @@ class ScChangeActionMove : public ScChangeAction nStartLastCut(0), nEndLastCut(0) {} - ScChangeActionMove( SvStream&, - ScMultipleReadHeader&, ScChangeTrack* ); virtual ~ScChangeActionMove(); virtual void AddContent( ScChangeActionContent* ); @@ -709,10 +671,6 @@ class ScChangeActionMove : public ScChangeAction virtual const ScChangeTrack* GetChangeTrack() const { return pTrack; } - virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const; - virtual BOOL StoreLinks( SvStream& ) const; - virtual BOOL LoadLinks( SvStream&, ScChangeTrack* ); - protected: using ScChangeAction::GetRefString; @@ -765,10 +723,6 @@ class ScChangeActionContent : public ScChangeAction ScChangeActionContent* pNextInSlot; // in gleichem Slot ScChangeActionContent** ppPrevInSlot; - ScChangeActionContent( SvStream&, - ScMultipleReadHeader&, ScDocument*, - USHORT nVer, ScChangeTrack* ); - void InsertInSlot( ScChangeActionContent** pp ) { if ( !ppPrevInSlot ) @@ -849,10 +803,6 @@ class ScChangeActionContent : public ScChangeAction void PutValueToDoc( ScBaseCell*, const String&, ScDocument*, SCsCOL nDx, SCsROW nDy ) const; - virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const; - virtual BOOL StoreLinks( SvStream& ) const; - virtual BOOL LoadLinks( SvStream&, ScChangeTrack* ); - protected: using ScChangeAction::GetRefString; @@ -983,8 +933,6 @@ class ScChangeActionReject : public ScChangeAction SetRejectAction( nReject ); SetState( SC_CAS_ACCEPTED ); } - ScChangeActionReject( SvStream&, - ScMultipleReadHeader&, ScChangeTrack* ); virtual void AddContent( ScChangeActionContent* ) {} virtual void DeleteCellEntries() {} @@ -993,8 +941,6 @@ class ScChangeActionReject : public ScChangeAction virtual const ScChangeTrack* GetChangeTrack() const { return 0; } - virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const; - public: ScChangeActionReject(const ULONG nActionNumber, const ScChangeActionState eState, @@ -1282,11 +1228,6 @@ public: // alter Wert aus pOldCell, Format aus Doc void AppendContent( const ScAddress& rPos, const ScBaseCell* pOldCell ); - // nachdem neuer Wert im Dokument gesetzt wurde, - // alter Wert aus pOldCell, Format aus RefDoc - void AppendContent( const ScAddress& rPos, - const ScBaseCell* pOldCell, - ScDocument* pRefDoc ); // nachdem neue Werte im Dokument gesetzt wurden, // alte Werte aus RefDoc/UndoDoc. // Alle Contents, wo im RefDoc eine Zelle steht. @@ -1313,9 +1254,6 @@ public: // bevor neuer Wert im Dokument gesetzt wird void AppendContent( const ScAddress& rPos, - const String& rNewValue ); - // bevor neuer Wert im Dokument gesetzt wird - void AppendContent( const ScAddress& rPos, const String& rNewValue, ScBaseCell* pOldCell ); diff --git a/sc/inc/clipparam.hxx b/sc/inc/clipparam.hxx new file mode 100644 index 000000000000..896117bdef69 --- /dev/null +++ b/sc/inc/clipparam.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: document.hxx,v $ + * $Revision: 1.115.36.9 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CLIPPARAM_HXX +#define SC_CLIPPARAM_HXX + +#include "rangelst.hxx" +#include "rangenam.hxx" + +#include <vector> + +/** + * This struct stores general clipboard parameters associated with a + * ScDocument instance created in clipboard mode. + */ +struct ScClipParam +{ + enum Direction { Unspecified, Column, Row }; + + ScRangeList maRanges; + Direction meDirection; + bool mbCutMode; + + ScClipParam(); + ScClipParam(const ScRange& rRange, bool bCutMode); + explicit ScClipParam(const ScClipParam& r); + + bool isMultiRange() const; + + /** + * Get the column size of a pasted range. Note that when the range is + * non-contiguous, we first compress all individual ranges into a single + * range, and the size of that compressed range is returned. + */ + SCCOL getPasteColSize(); + + /** + * Same as the above method, but returns the row size of the compressed + * range. + */ + SCROW getPasteRowSize(); + + /** + * Return a single range that encompasses all individual ranges. + */ + ScRange getWholeRange() const; + + void transpose(); +}; + +// ============================================================================ + +struct ScClipRangeNameData +{ + ScRangeData::IndexMap maRangeMap; + ::std::vector<ScRangeData*> mpRangeNames; + bool mbReplace; + + ScClipRangeNameData(); + ~ScClipRangeNameData(); + void insert(sal_uInt16 nOldIndex, sal_uInt16 nNewIndex); +}; + +#endif diff --git a/sc/inc/collect.hxx b/sc/inc/collect.hxx index de6539b08311..dc7778d12da3 100644 --- a/sc/inc/collect.hxx +++ b/sc/inc/collect.hxx @@ -80,7 +80,7 @@ public: ScDataObject* At(USHORT nIndex) const; virtual USHORT IndexOf(ScDataObject* pScDataObject) const; - USHORT GetCount() const { return nCount; } + USHORT GetCount() const; ScDataObject* operator[]( const USHORT nIndex) const {return At(nIndex);} ScCollection& operator=( const ScCollection& rCol ); @@ -143,9 +143,6 @@ public: virtual ScDataObject* Clone() const; StrData* operator[]( const USHORT nIndex) const {return (StrData*)At(nIndex);} virtual short Compare(ScDataObject* pKey1, ScDataObject* pKey2) const; - - void Load( SvStream& ); - void Store( SvStream& ) const; }; //------------------------------------------------------------------------ @@ -178,9 +175,6 @@ public: private: friend class TypedScStrCollection; -#if OLD_PIVOT_IMPLEMENTATION - friend class PivotScStrCollection; -#endif String aStrValue; double nValue; @@ -198,6 +192,7 @@ public: TypedScStrCollection( const TypedScStrCollection& rCpy ) : ScSortedCollection( rCpy ) { bCaseSensitive = rCpy.bCaseSensitive; } + ~TypedScStrCollection(); virtual ScDataObject* Clone() const; virtual short Compare( ScDataObject* pKey1, ScDataObject* pKey2 ) const; diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index c66ecb960e7d..3f1fbfc1c88f 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -35,6 +35,7 @@ #include "global.hxx" #include "compressedarray.hxx" #include "address.hxx" +#include "rangenam.hxx" #include <tools/solar.h> #include <set> @@ -58,8 +59,6 @@ class ScBaseCell; class ScDocument; class ScFormulaCell; class ScMarkData; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; class ScPatternAttr; class ScStyleSheet; class SvtBroadcaster; @@ -99,8 +98,6 @@ struct ColEntry }; -class ScIndexMap; - class ScColumn { private: @@ -146,8 +143,8 @@ public: void SwapRow( SCROW nRow1, SCROW nRow2 ); void SwapCell( SCROW nRow, ScColumn& rCol); - BOOL HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, - BOOL bLeft, BOOL bRight ) const; +//UNUSED2009-05 BOOL HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, +//UNUSED2009-05 BOOL bLeft, BOOL bRight ) const; BOOL HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const; BOOL HasAttribSelection( const ScMarkData& rMark, USHORT nMask ) const; BOOL ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, @@ -164,7 +161,7 @@ public: SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; BOOL HasDataAt(SCROW nRow) const; BOOL HasVisibleDataAt(SCROW nRow) const; - SCROW GetFirstDataPos() const; +//UNUSED2009-05 SCROW GetFirstDataPos() const; SCROW GetLastDataPos() const; SCROW GetLastVisDataPos(BOOL bNotes) const; // ohne Broadcaster SCROW GetFirstVisDataPos(BOOL bNotes) const; @@ -258,7 +255,7 @@ public: BOOL HasStringData( SCROW nRow ) const; BOOL HasValueData( SCROW nRow ) const; - USHORT GetErrorData( SCROW nRow) const; +//UNUSED2009-05 USHORT GetErrorData( SCROW nRow) const; BOOL HasStringCells( SCROW nStartRow, SCROW nEndRow ) const; /** Returns the pointer to a cell note object at the passed row. */ @@ -299,7 +296,7 @@ public: void SetTabNo(SCTAB nNewTab); BOOL IsRangeNameInUse(SCROW nRow1, SCROW nRow2, USHORT nIndex) const; void FindRangeNamesInUse(SCROW nRow1, SCROW nRow2, std::set<USHORT>& rIndexes) const; - void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScIndexMap& rMap ); + void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScRangeData::IndexMap& rMap ); const SfxPoolItem* GetAttr( SCROW nRow, USHORT nWhich ) const; const ScPatternAttr* GetPattern( SCROW nRow ) const; diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 76293479660c..c981af2dad18 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -64,7 +64,7 @@ // constants and data types also for external modules (ScInterpreter et al) #define MAXCODE 512 /* maximum number of tokens in formula */ -#define MAXSTRLEN 256 /* maximum length of input string of one symbol */ +#define MAXSTRLEN 1024 /* maximum length of input string of one symbol */ #define MAXJUMPCOUNT 32 /* maximum number of jumps (ocChose) */ // flag values of CharTable @@ -91,6 +91,8 @@ #define SC_COMPILER_C_ODF_RBRACKET 0x00080000 // ODF ']' reference bracket #define SC_COMPILER_C_ODF_LABEL_OP 0x00100000 // ODF '!!' automatic intersection of labels #define SC_COMPILER_C_ODF_NAME_MARKER 0x00200000 // ODF '$$' marker that starts a defined (range) name +#define SC_COMPILER_C_CHAR_NAME 0x00400000 // start character of a defined name +#define SC_COMPILER_C_NAME 0x00800000 // continuation character of a defined name #define SC_COMPILER_FILE_TAB_SEP '#' // 'Doc'#Tab @@ -217,6 +219,14 @@ typedef formula::SimpleIntrusiveReference< struct ScRawToken > ScRawTokenRef; class SC_DLLPUBLIC ScCompiler : public formula::FormulaCompiler { public: + + enum EncodeUrlMode + { + ENCODE_BY_GRAMMAR, + ENCODE_ALWAYS, + ENCODE_NEVER, + }; + struct Convention { const formula::FormulaGrammar::AddressConvention meConv; @@ -313,6 +323,7 @@ private: SCsTAB nMaxTab; // last sheet in document sal_Int32 mnRangeOpPosInSymbol; // if and where a range operator is in symbol const Convention *pConv; + EncodeUrlMode meEncodeUrlMode; bool mbCloseBrackets; // whether to close open brackets automatically, default TRUE bool mbExtendedErrorDetection; bool mbRewind; // whether symbol is to be rewound to some step during lexical analysis @@ -373,6 +384,8 @@ public: void SetGrammar( const formula::FormulaGrammar::Grammar eGrammar ); + void SetEncodeUrlMode( EncodeUrlMode eMode ); + EncodeUrlMode GetEncodeUrlMode() const; private: /** Set grammar and reference convention from within SetFormulaLanguage() or SetGrammar(). @@ -435,28 +448,66 @@ public: BOOL HasModifiedRange(); - /// If the character is allowed as first character in sheet names or references + /** If the character is allowed as first character in sheet names or + references, includes '$' and '?'. */ static inline BOOL IsCharWordChar( String const & rStr, xub_StrLen nPos, const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO ) { sal_Unicode c = rStr.GetChar( nPos ); - return c < 128 ? - static_cast<BOOL>( - (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) : - ScGlobal::pCharClass->isLetterNumeric( rStr, nPos ); + if (c < 128) + { + return pConventions[eConv] ? static_cast<BOOL>( + (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) : + FALSE; // no convention => assume invalid + } + else + return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos ); } - /// If the character is allowed in sheet names or references + /** If the character is allowed in sheet names, thus may be part of a + reference, includes '$' and '?' and such. */ static inline BOOL IsWordChar( String const & rStr, xub_StrLen nPos, const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO ) { sal_Unicode c = rStr.GetChar( nPos ); - return c < 128 ? - static_cast<BOOL>( - (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) : - ScGlobal::pCharClass->isLetterNumeric( rStr, nPos ); + if (c < 128) + { + return pConventions[eConv] ? static_cast<BOOL>( + (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) : + FALSE; // convention not known => assume invalid + } + else + return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos ); + } + + /** If the character is allowed as tested by nFlags (SC_COMPILER_C_... + bits) for all known address conventions. If more than one bit is given + in nFlags, all bits must match. If bTestLetterNumeric is FALSE and + char>=128, no LetterNumeric test is done and FALSE is returned. */ + static inline bool IsCharFlagAllConventions( String const & rStr, + xub_StrLen nPos, + ULONG nFlags, + bool bTestLetterNumeric = true ) + { + sal_Unicode c = rStr.GetChar( nPos ); + if (c < 128) + { + for ( int nConv = formula::FormulaGrammar::CONV_UNSPECIFIED; + ++nConv < formula::FormulaGrammar::CONV_LAST; ) + { + if (pConventions[nConv] && + ((pConventions[nConv]->mpCharTable[ UINT8(c) ] & nFlags) != nFlags)) + return false; + // convention not known => assume valid + } + return true; + } + else if (bTestLetterNumeric) + return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos ); + else + return false; } private: diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index edb0f9371788..141cb5706515 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -40,8 +40,6 @@ class ScBaseCell; class ScFormulaCell; class ScTokenArray; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; class ScRangeList; @@ -285,8 +283,6 @@ public: ScConditionalFormat* GetFormat( sal_uInt32 nKey ); -//UNUSED2008-05 void ResetUsed(); - void CompileAll(); void CompileXML(); void UpdateReference( UpdateRefMode eUpdateRefMode, diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index 341300228869..c3d5db0bc72b 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -72,9 +72,6 @@ namespace com { namespace sun { namespace star { namespace sheet { }}}} class ScDocShell; -#if OLD_PIVOT_IMPLEMENTATION -class ScPivot; -#endif class ScDPSaveDimension; class ScDPSaveGroupDimension; class ScDPSaveNumGroupDimension; diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx index 2056bcb331f1..3d9d357b512b 100644 --- a/sc/inc/dbcolect.hxx +++ b/sc/inc/dbcolect.hxx @@ -42,8 +42,6 @@ //------------------------------------------------------------------------ class ScDocument; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; //------------------------------------------------------------------------ diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx index edfff3c8dc7c..98922c1776b8 100644 --- a/sc/inc/detfunc.hxx +++ b/sc/inc/detfunc.hxx @@ -132,6 +132,7 @@ class SC_DLLPUBLIC ScDetectiveFunc BOOL FindFrameForObject( SdrObject* pObject, ScRange& rRange ); + void Modified(); public: ScDetectiveFunc(ScDocument* pDocument, SCTAB nTable) : pDoc(pDocument),nTab(nTable) {} diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index c8d3751a7aaf..5f75108c2ebf 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -99,10 +99,6 @@ class ScFormulaCell; class ScMarkData; class ScOutlineTable; class ScPatternAttr; -#if OLD_PIVOT_IMPLEMENTATION -class ScPivot; -class ScPivotCollection; -#endif class ScPrintRangeSaver; class ScRangeData; class ScRangeName; @@ -140,6 +136,8 @@ class ScLookupCache; struct ScLookupCacheMapImpl; class SfxUndoManager; class ScFormulaParserPool; +struct ScClipParam; +struct ScClipRangeNameData; namespace com { namespace sun { namespace star { namespace lang { @@ -237,9 +235,6 @@ friend class ScHorizontalAttrIterator; friend class ScDocAttrIterator; friend class ScAttrRectIterator; friend class ScDocShell; -#if OLD_PIVOT_IMPLEMENTATION -friend class ScPivot; -#endif private: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager; @@ -261,14 +256,11 @@ private: ScTable* pTab[MAXTABCOUNT]; ScRangeName* pRangeName; ScDBCollection* pDBCollection; -#if OLD_PIVOT_IMPLEMENTATION - ScPivotCollection* pPivotCollection; -#endif ScDPCollection* pDPCollection; ScChartCollection* pChartCollection; std::auto_ptr< ScTemporaryChartLock > apTemporaryChartLock; ScPatternAttr* pSelectionAttr; // Attribute eines Blocks - SvxLinkManager* pLinkManager; + mutable SvxLinkManager* pLinkManager; ScFormulaCell* pFormulaTree; // Berechnungsbaum Start ScFormulaCell* pEOFormulaTree; // Berechnungsbaum Ende, letzte Zelle ScFormulaCell* pFormulaTrack; // BroadcastTrack Start @@ -290,6 +282,7 @@ private: ScFieldEditEngine* pCacheFieldEditEngine; ::std::auto_ptr<ScDocProtection> pDocProtection; + ::std::auto_ptr<ScClipParam> mpClipParam; ::std::auto_ptr<ScExternalRefManager> pExternalRefMgr; @@ -316,7 +309,6 @@ private: sal_uInt32 nRangeOverflowType; // used in (xml) loading for overflow warnings - ScRange aClipRange; ScRange aEmbedRange; ScAddress aCurTextWidthCalcPos; ScAddress aOnlineSpellPos; // within whole document @@ -366,7 +358,6 @@ private: BOOL bForcedFormulaPending; BOOL bCalculatingFormulaTree; BOOL bIsClip; - BOOL bCutMode; BOOL bIsUndo; BOOL bIsVisible; // set from view ctor @@ -421,6 +412,7 @@ private: bool mbAdjustHeightEnabled; bool mbExecuteLinkEnabled; bool mbChangeReadOnlyEnabled; // allow changes in read-only document (for API import filters) + bool mbStreamValidLocked; sal_Int16 mnNamedRangesLockCount; @@ -449,7 +441,7 @@ public: SC_DLLPUBLIC void InitDrawLayer( SfxObjectShell* pDocShell = NULL ); XColorTable* GetColorTable(); - SvxLinkManager* GetLinkManager() { return pLinkManager; } + SC_DLLPUBLIC SvxLinkManager* GetLinkManager() const; SC_DLLPUBLIC const ScDocOptions& GetDocOptions() const; SC_DLLPUBLIC void SetDocOptions( const ScDocOptions& rOpt ); @@ -497,11 +489,6 @@ public: SC_DLLPUBLIC ScDPCollection* GetDPCollection(); ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; ScDPObject* GetDPAtBlock( const ScRange& rBlock ) const; -#if OLD_PIVOT_IMPLEMENTATION - ScPivotCollection* GetPivotCollection() const; - void SetPivotCollection(ScPivotCollection* pNewPivotCollection); - ScPivot* GetPivotAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; -#endif SC_DLLPUBLIC ScChartCollection* GetChartCollection() const; void StopTemporaryChartLock(); @@ -526,7 +513,7 @@ public: ::com::sun::star::embed::XEmbeddedObject > FindOleObjectByName( const String& rName ); - SC_DLLPUBLIC void MakeTable( SCTAB nTab ); + SC_DLLPUBLIC void MakeTable( SCTAB nTab,bool _bNeedsNameCheck = true ); SCTAB GetVisibleTab() const { return nVisibleTab; } SC_DLLPUBLIC void SetVisibleTab(SCTAB nTab) { nVisibleTab = nTab; } @@ -586,6 +573,10 @@ public: SC_DLLPUBLIC void TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos); SC_DLLPUBLIC void SetVisible( SCTAB nTab, BOOL bVisible ); SC_DLLPUBLIC BOOL IsVisible( SCTAB nTab ) const; + BOOL IsStreamValid( SCTAB nTab ) const; + void SetStreamValid( SCTAB nTab, BOOL bSet, BOOL bIgnoreLock = FALSE ); + void LockStreamValid( bool bLock ); + bool IsStreamValidLocked() const { return mbStreamValidLocked; } BOOL IsPendingRowHeights( SCTAB nTab ) const; void SetPendingRowHeights( SCTAB nTab, BOOL bSet ); SC_DLLPUBLIC void SetLayoutRTL( SCTAB nTab, BOOL bRTL ); @@ -619,8 +610,8 @@ public: const String& aFileName, const String& aTabName ); - bool HasExternalRefManager() { return pExternalRefMgr.get(); } - SC_DLLPUBLIC ScExternalRefManager* GetExternalRefManager(); + bool HasExternalRefManager() const { return pExternalRefMgr.get(); } + SC_DLLPUBLIC ScExternalRefManager* GetExternalRefManager() const; bool IsInExternalReferenceMarking() const; void MarkUsedExternalReferences(); bool MarkUsedExternalReferences( ScTokenArray & rArr ); @@ -724,8 +715,8 @@ public: BOOL HasSubTotalCells( const ScRange& rRange ); SC_DLLPUBLIC void PutCell( const ScAddress&, ScBaseCell* pCell, BOOL bForceTab = FALSE ); - SC_DLLPUBLIC void PutCell( const ScAddress&, ScBaseCell* pCell, - ULONG nFormatIndex, BOOL bForceTab = FALSE); +//UNUSED2009-05 SC_DLLPUBLIC void PutCell( const ScAddress&, ScBaseCell* pCell, +//UNUSED2009-05 ULONG nFormatIndex, BOOL bForceTab = FALSE); SC_DLLPUBLIC void PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, BOOL bForceTab = FALSE ); SC_DLLPUBLIC void PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, @@ -841,6 +832,7 @@ public: void SetDirty(); void SetDirty( const ScRange& ); void SetTableOpDirty( const ScRange& ); // for Interpreter TableOp + void InterpretDirtyCells( const ScRangeList& rRanges ); void CalcAll(); SC_DLLPUBLIC void CalcAfterLoad(); void CompileAll(); @@ -972,12 +964,11 @@ public: void DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, USHORT nDelFlag); void DeleteAreaTab(const ScRange& rRange, USHORT nDelFlag); - void CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - BOOL bCut, ScDocument* pClipDoc, BOOL bAllTabs, - const ScMarkData* pMarks = NULL, - BOOL bKeepScenarioFlags = FALSE, - BOOL bIncludeObjects = FALSE, - BOOL bCloneNoteCaptions = TRUE); + + void CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc, + const ScMarkData* pMarks = NULL, bool bAllTabs = false, bool bKeepScenarioFlags = false, + bool bIncludeObjects = false, bool bCloneNoteCaptions = true); + void CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, ScDocument* pClipDoc = NULL); void CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, @@ -1005,6 +996,12 @@ public: BOOL bSkipAttrForEmpty = FALSE, const ScRangeList * pDestRanges = NULL ); + void CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark, + sal_uInt16 nInsFlag, ScDocument* pClipDoc, + bool bResetCut = true, bool bAsLink = false, + bool bIncludeFiltered = true, + bool bSkipAttrForEmpty = false); + void GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered); void GetClipStart(SCCOL& nClipX, SCROW& nClipY); @@ -1014,6 +1011,9 @@ public: SC_DLLPUBLIC void TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsLink ); + ScClipParam& GetClipParam(); + void SetClipParam(const ScClipParam& rParam); + void MixDocument( const ScRange& rRange, USHORT nFunction, BOOL bSkipEmpty, ScDocument* pSrcDoc ); @@ -1345,8 +1345,8 @@ public: SC_DLLPUBLIC void ClearPrintRanges( SCTAB nTab ); /** Adds a new print ranges. */ SC_DLLPUBLIC void AddPrintRange( SCTAB nTab, const ScRange& rNew ); - /** Removes all old print ranges and sets the passed print ranges. */ - void SetPrintRange( SCTAB nTab, const ScRange& rNew ); +//UNUSED2009-05 /** Removes all old print ranges and sets the passed print ranges. */ +//UNUSED2009-05 void SetPrintRange( SCTAB nTab, const ScRange& rNew ); /** Marks the specified sheet to be printed completely. Deletes old print ranges on the sheet! */ SC_DLLPUBLIC void SetPrintEntireSheet( SCTAB nTab ); SC_DLLPUBLIC void SetRepeatColRange( SCTAB nTab, const ScRange* pNew ); @@ -1683,7 +1683,7 @@ public: SC_DLLPUBLIC SfxItemPool* GetEnginePool() const; SC_DLLPUBLIC ScFieldEditEngine& GetEditEngine(); SC_DLLPUBLIC ScNoteEditEngine& GetNoteEngine(); - SfxItemPool& GetNoteItemPool(); +//UNUSED2009-05 SfxItemPool& GetNoteItemPool(); ScRefreshTimerControl* GetRefreshTimerControl() const { return pRefreshTimerControl; } @@ -1711,6 +1711,23 @@ public: SfxUndoManager* GetUndoManager(); private: // CLOOK-Impl-Methoden + /** + * Use this class as a locale variable to merge number formatter from + * another document, and set NULL pointer to pFormatExchangeList when + * done. + */ + class NumFmtMergeHandler + { + public: + explicit NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc); + ~NumFmtMergeHandler(); + + private: + ScDocument* mpDoc; + }; + + void MergeNumberFormatter(ScDocument* pSrcDoc); + void ImplCreateOptions(); // bei Gelegenheit auf on-demand umstellen? void ImplDeleteOptions(); @@ -1732,6 +1749,12 @@ private: // CLOOK-Impl-Methoden void UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); + void CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs); + void CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames); + void UpdateRangeNamesInFormulas( + ScClipRangeNameData& rRangeNames, const ScRangeList& rDestRanges, const ScMarkData& rMark, + SCCOL nXw, SCROW nYw); + BOOL HasPartOfMerged( const ScRange& rRange ); std::map< SCTAB, ScSortParam > mSheetSortParams; diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index defe627dd812..5966e446d0c3 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -75,6 +75,7 @@ class ScTableSheetObj; class SvxFmDrawPage; class SvxDrawPage; class ScRangeList; +class ScSheetSaveData; class SC_DLLPUBLIC ScModelObj : public SfxBaseModel, public com::sun::star::sheet::XSpreadsheetDocument, @@ -110,8 +111,10 @@ private: BOOL FillRenderMarkData( const com::sun::star::uno::Any& aSelection, ScMarkData& rMark, ScPrintSelectionStatus& rStatus ) const; + com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> GetFormatter(); rtl::OUString maBuildId; + sal_Int32 mnXlsWriteProtPass; protected: const SfxItemPropertySet& GetPropertySet() const { return aPropSet; } @@ -127,9 +130,9 @@ public: void UpdateAllRowHeights( const ScMarkData* pTabMark = NULL ); - ScDrawLayer* MakeDrawLayer(); void BeforeXMLLoading(); void AfterXMLLoading(sal_Bool bRet); + ScSheetSaveData* GetSheetSaveData(); bool HasChangesListeners() const; diff --git a/sc/inc/dpcachetable.hxx b/sc/inc/dpcachetable.hxx index 93cd12c4c937..2115eab7cc42 100644 --- a/sc/inc/dpcachetable.hxx +++ b/sc/inc/dpcachetable.hxx @@ -176,11 +176,6 @@ public: const String* getFieldName(sal_Int32 nIndex) const; - /** Get the field index (i.e. column ID in the original data source) based - on the string value that corresponds with the column title. It returns - -1 if no field matching the string value exists. */ - sal_Int32 getFieldIndex(const String& rStr) const; - /** Get the unique entries for a field specified by index. The caller must make sure that the table is filled before calling function, or it will get an empty collection. */ @@ -194,7 +189,6 @@ public: const ::std::hash_set<sal_Int32>& rRepeatIfEmptyDims); void clear(); - void swap(ScDPCacheTable& rOther); bool empty() const; private: diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index cffe735f287a..2dc8829485c8 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -55,8 +55,6 @@ class Rectangle; class SvStream; class ScDPSaveData; class ScDPOutput; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; class ScPivot; class ScPivotCollection; struct ScPivotParam; @@ -281,9 +279,7 @@ public: virtual ScDataObject* Clone() const; ScDPObject* operator[](USHORT nIndex) const {return (ScDPObject*)At(nIndex);} -#if OLD_PIVOT_IMPLEMENTATION - void ConvertOldTables( ScPivotCollection& rOldColl ); -#endif + void DeleteOnTab( SCTAB nTab ); void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index 44689bcf0772..d3d8d4354145 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -128,7 +128,6 @@ public: void SetName( const String& rNew ); // used if the source dim was renamed (groups) SC_DLLPUBLIC void SetOrientation(USHORT nNew); - void SetSubTotals(BOOL bSet); // to be removed! SC_DLLPUBLIC void SetSubTotals(long nCount, const USHORT* pFuncs); long GetSubTotalsCount() const { return nSubTotalCount; } USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; } diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 59996d08b8aa..3b1d8e0e206e 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -185,7 +185,7 @@ public: ScDPDimensions* GetDimensionsObject(); - void DumpState( ScDocument* pDoc, const ScAddress& rPos ); +//UNUSED2009-05 void DumpState( ScDocument* pDoc, const ScAddress& rPos ); // XDimensionsSupplier virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > @@ -428,7 +428,7 @@ public: const ::com::sun::star::sheet::DataPilotFieldReference& GetReferenceValue() const; - BOOL IsValidPage( const ScDPItemData& rData ); +//UNUSED2009-05 BOOL IsValidPage( const ScDPItemData& rData ); }; class ScDPHierarchies : public cppu::WeakImplHelper2< diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index 9b12dba52f1f..bf795f04fe1c 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -422,10 +422,13 @@ public: /** Source document meta-data container. */ struct SrcFileData { - String maFileName; + String maFileName; /// original file name as loaded from the file. + String maRealFileName; /// file name created from the relative name. String maRelativeName; String maFilterName; String maFilterOptions; + + void maybeCreateRealFileName(const String& rOwnDocName); }; public: @@ -576,7 +579,21 @@ public: */ void convertToAbsName(String& rFile) const; sal_uInt16 getExternalFileId(const String& rFile); - const String* getExternalFileName(sal_uInt16 nFileId) const; + + /** + * It returns a pointer to the name of the URI associated with a given + * external file ID. In case the original document has moved, it returns + * an URI adjusted for the relocation. + * + * @param nFileId file ID for an external document + * @param bForceOriginal If true, it always returns the original document + * URI even if the referring document has relocated. + * If false, it returns an URI adjusted for + * relocated document. + * + * @return const String* external document URI. + */ + const String* getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal = false); bool hasExternalFile(sal_uInt16 nFileId) const; bool hasExternalFile(const String& rFile) const; const SrcFileData* getExternalFileData(sal_uInt16 nFileId) const; @@ -585,8 +602,15 @@ public: const String* getRealRangeName(sal_uInt16 nFileId, const String& rRangeName) const; void refreshNames(sal_uInt16 nFileId); void breakLink(sal_uInt16 nFileId); - void switchSrcFile(sal_uInt16 nFileId, const String& rNewFile); + void switchSrcFile(sal_uInt16 nFileId, const String& rNewFile, const String& rNewFilter); + /** + * Set a relative file path for the specified file ID. Note that the + * caller must ensure that the passed URL is a valid relative URL. + * + * @param nFileId file ID for an external document + * @param rRelUrl relative URL + */ void setRelativeFileName(sal_uInt16 nFileId, const String& rRelUrl); /** @@ -607,8 +631,11 @@ public: * Re-generates relative names for all stored source files. This is * necessary when exporting to an ods document, to ensure that all source * files have their respective relative names for xlink:href export. + * + * @param rBaseFileUrl Absolute URL of the content.xml fragment of the + * document being exported. */ - void resetSrcFileData(); + void resetSrcFileData(const String& rBaseFileUrl); /** * Update a single referencing cell position. @@ -675,6 +702,19 @@ private: void maybeLinkExternalFile(sal_uInt16 nFileId); + /** + * Try to create a "real" file name from the relative path. The original + * file name may not point to the real document when the referencing and + * referenced documents have been moved. + * + * For the real file name to be created, the relative name should not be + * empty before calling this method, or the real file name will not be + * created. + * + * @param nFileId file ID for an external document + */ + void maybeCreateRealFileName(sal_uInt16 nFileId); + bool compileTokensByCell(const ScAddress& rCell); /** diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index e329f477d824..1f6dc13d04ce 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -86,13 +86,6 @@ extern "C" { #define SC_TRANSLITERATION_CASESENSE 0 #endif -// Remove the old pivot table implementation that the current data pilot -// implementation has effectively replaced. The old pivot code was still -// around to handle loading of the old binary format. Now that the old -// binary filter is handled by binfilter, we can safely remove the old pivot -// handling code. -#define OLD_PIVOT_IMPLEMENTATION 0 - //------------------------------------------------------------------------ struct LabelData; //------------------------------------------------------------------------ @@ -467,7 +460,7 @@ struct ScImportParam ScImportParam& operator= ( const ScImportParam& r ); BOOL operator== ( const ScImportParam& r ) const; - void Clear (); +//UNUSED2009-05 void Clear (); }; struct ScStringHashCode @@ -548,9 +541,15 @@ class ScGlobal static SvNumberFormatter* pEnglishFormatter; // for UNO / XML export static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XOrdinalSuffix> xOrdinalSuffix; + static CalendarWrapper* pCalendar; + static CollatorWrapper* pCaseCollator; + static CollatorWrapper* pCollator; + static ::utl::TransliterationWrapper* pTransliteration; + static ::utl::TransliterationWrapper* pCaseTransliteration; + static IntlWrapper* pScIntlWrapper; + static ::com::sun::star::lang::Locale* pLocale; public: - static ::com::sun::star::lang::Locale* pLocale; static SvtSysLocale* pSysLocale; // for faster access a pointer to the single instance provided by SvtSysLocale SC_DLLPUBLIC static const CharClass* pCharClass; @@ -558,15 +557,15 @@ public: SC_DLLPUBLIC static const LocaleDataWrapper* pLocaleData; SC_DLLPUBLIC static const LocaleDataWrapper* GetpLocaleData(); - static CalendarWrapper* pCalendar; - SC_DLLPUBLIC static CollatorWrapper* pCollator; - static CollatorWrapper* pCaseCollator; + static CalendarWrapper* GetCalendar(); + SC_DLLPUBLIC static CollatorWrapper* GetCollator(); + static CollatorWrapper* GetCaseCollator(); + static IntlWrapper* GetScIntlWrapper(); + static ::com::sun::star::lang::Locale* GetLocale(); - static ::utl::TransliterationWrapper* pTransliteration; SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration(); //CHINA001 + static ::utl::TransliterationWrapper* GetCaseTransliteration(); - static ::utl::TransliterationWrapper* pCaseTransliteration; - static IntlWrapper* pScIntlWrapper; SC_DLLPUBLIC static LanguageType eLnge; static sal_Unicode cListDelimiter; diff --git a/sc/inc/indexmap.hxx b/sc/inc/indexmap.hxx deleted file mode 100644 index 4db5deb78d4e..000000000000 --- a/sc/inc/indexmap.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: indexmap.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SC_INDEXMAP_HXX -#define _SC_INDEXMAP_HXX - - -#include <tools/solar.h> - - -class ScIndexMap -{ - // not implemented - ScIndexMap( const ScIndexMap& ); - ScIndexMap& operator=( const ScIndexMap& ); - -private: - USHORT* pMap; - USHORT nCount; - -public: - ScIndexMap( USHORT nEntries ); - ~ScIndexMap(); - - void SetPair( USHORT nEntry, USHORT nIndex1, USHORT nIndex2 ); - /// returns nIndex2 if found, else nIndex1 - USHORT Find( USHORT nIndex1 ) const; -}; - - -#endif // _SC_INDEXMAP_HXX - diff --git a/sc/inc/markarr.hxx b/sc/inc/markarr.hxx index 83a218887508..84d7a9d88a1a 100644 --- a/sc/inc/markarr.hxx +++ b/sc/inc/markarr.hxx @@ -65,7 +65,7 @@ public: void CopyMarksTo( ScMarkArray& rDestMarkArray ) const; BOOL Search( SCROW nRow, SCSIZE& nIndex ) const; - void DeleteArea(SCROW nStartRow, SCROW nEndRow); +//UNUSED2009-05 void DeleteArea(SCROW nStartRow, SCROW nEndRow); /// Including current row, may return -1 if bUp and not found SCsROW GetNextMarked( SCsROW nRow, BOOL bUp ) const; diff --git a/sc/inc/olinetab.hxx b/sc/inc/olinetab.hxx index 59846d7717a0..4d42accdf729 100644 --- a/sc/inc/olinetab.hxx +++ b/sc/inc/olinetab.hxx @@ -39,8 +39,6 @@ #define SC_OL_MAXDEPTH 7 class SvStream; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; class ScOutlineEntry : public ScDataObject diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index 66e87facfd9a..e77dd60f18bb 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -65,20 +65,9 @@ class SubTotal; #include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp> #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp> -#if OLD_PIVOT_IMPLEMENTATION -#define PIVOT_STYLE_INNER 0 -#define PIVOT_STYLE_RESULT 1 -#define PIVOT_STYLE_CATEGORY 2 -#define PIVOT_STYLE_TITLE 3 -#define PIVOT_STYLE_FIELDNAME 4 -#define PIVOT_STYLE_TOP 5 -#endif - class SvStream; class ScDocument; class ScUserListData; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; class ScProgress; struct LabelData; @@ -125,7 +114,7 @@ struct ScPivotParam ScPivotParam& operator= ( const ScPivotParam& r ); BOOL operator== ( const ScPivotParam& r ) const; - void Clear (); +//UNUSED2009-05 void Clear (); void ClearLabelData (); void ClearPivotArrays(); void SetLabelData ( LabelData** ppLabArr, @@ -142,228 +131,9 @@ struct ScPivotParam // ----------------------------------------------------------------------- -#if OLD_PIVOT_IMPLEMENTATION -struct PivotColRef -{ - SCSIZE nDataIndex; - SCSIZE nRecCount; - USHORT nFuncMask; - SCSIZE nIndex; - - PivotColRef() - { - nDataIndex = nRecCount = nIndex = 0; - nFuncMask = PIVOT_FUNC_NONE; - } -}; -#endif - typedef PivotField PivotFieldArr[PIVOT_MAXFIELD]; typedef PivotField PivotPageFieldArr[PIVOT_MAXPAGEFIELD]; -#if OLD_PIVOT_IMPLEMENTATION -class PivotScStrCollection : public ScStrCollection -{ - ScUserListData* pUserData; -public: - PivotScStrCollection(USHORT nLim = 4, USHORT nDel = 4, BOOL bDup = FALSE) : - ScStrCollection ( nLim, nDel, bDup ), - pUserData (NULL) { } - PivotScStrCollection(const PivotScStrCollection& rPivotScStrCollection) : - ScStrCollection ( rPivotScStrCollection ), - pUserData ( rPivotScStrCollection.pUserData) {} - - virtual ScDataObject* Clone() const; - virtual short Compare(ScDataObject* pKey1, ScDataObject* pKey2) const; - - TypedStrData* operator[]( const USHORT nIndex) const - { return (TypedStrData*)At(nIndex); } - void SetUserData(ScUserListData* pData) - { pUserData = pData; } - const String& GetString(USHORT nIndex) - { return ((TypedStrData*)At(nIndex))->GetString(); } - USHORT GetIndex(TypedStrData* pData) const; -}; - -class ScPivot : public ScDataObject -{ - ScDocument* pDoc; - ScQueryParam aQuery; - BOOL bHasHeader; - - BOOL bIgnoreEmpty; // Flags aus Dialog - BOOL bDetectCat; - BOOL bMakeTotalCol; - BOOL bMakeTotalRow; - - String aName; - String aTag; - SCSIZE nColNameCount; - String* pColNames; // Array - - SCCOL nSrcCol1; - SCROW nSrcRow1; - SCCOL nSrcCol2; - SCROW nSrcRow2; - SCTAB nSrcTab; - - SCCOL nDestCol1; - SCROW nDestRow1; - SCCOL nDestCol2; - SCROW nDestRow2; - SCTAB nDestTab; - - SCCOL nDataStartCol; - SCROW nDataStartRow; - - SCSIZE nColCount; - SCSIZE nRowCount; - SCSIZE nDataCount; - - PivotFieldArr aColArr; - PivotFieldArr aRowArr; - PivotFieldArr aDataArr; - - PivotScStrCollection* pColList[PIVOT_MAXFIELD]; // pro Zeile alle Eintraege - PivotScStrCollection* pRowList[PIVOT_MAXFIELD]; - PivotScStrCollection* pDataList; // Shortcut auf Col/RowList mit Daten - - SubTotal** ppDataArr; - SCSIZE nDataColCount; - SCSIZE nDataRowCount; - SCSIZE nRowIndex; - SCSIZE nColIndex; - SCSIZE nDataIndex; - SCSIZE nRecCount; - - PivotColRef* pColRef; - - BOOL bValidArea; - BOOL bDataAtCol; - -public: - ScPivot(ScDocument* pDocument); - ScPivot(const ScPivot& rPivot); - ~ScPivot(); - - virtual ScDataObject* Clone() const; - - ScPivot* CreateNew() const; - - BOOL Load(SvStream& rStream, ScMultipleReadHeader& rHdr ); - BOOL Store(SvStream& rStream, ScMultipleWriteHeader& rHdr ) const; - - void SetQuery(const ScQueryParam& rQuery); - void GetQuery(ScQueryParam& rQuery) const; - - void SetHeader(BOOL bHeader); - BOOL GetHeader() const; - void SetIgnoreEmpty(BOOL bIgnore); - BOOL GetIgnoreEmpty() const; - void SetDetectCat(BOOL bDetect); - BOOL GetDetectCat() const; - void SetMakeTotalCol(BOOL bSet); - BOOL GetMakeTotalCol() const; - void SetMakeTotalRow(BOOL bSet); - BOOL GetMakeTotalRow() const; - - void SetName(const String& rNew); - const String& GetName() const; - void SetTag(const String& rNew); - const String& GetTag() const; - - void SetSrcArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab); - void GetSrcArea(SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, SCTAB& rTab) const; - ScRange GetSrcArea() const; - - void SetDestPos(SCCOL nCol, SCROW nRow, SCTAB nTab); - void GetDestArea(SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, SCTAB& rTab) const; - ScRange GetDestArea() const; - - void SetColFields(const PivotField* pFieldArr, SCSIZE nCount); - void GetColFields(PivotField* pFieldArr, SCSIZE& rCount) const; - SCSIZE GetColFieldCount() const { return nColCount; } - - void SetRowFields(const PivotField* pFieldArr, SCSIZE nCount); - void GetRowFields(PivotField* pFieldArr, SCSIZE& rCount) const; - SCSIZE GetRowFieldCount() const { return nRowCount; } - - void SetDataFields(const PivotField* pFieldArr, SCSIZE nCount); - void GetDataFields(PivotField* pFieldArr, SCSIZE& rCount) const; - - void GetParam( ScPivotParam& rParam, ScQueryParam& rQuery, ScArea& rSrcArea ) const; - void SetParam( const ScPivotParam& rParam, const ScQueryParam& rQuery, - const ScArea& rSrcArea ); - - BOOL CreateData(BOOL bKeepDest = FALSE); - void DrawData(); - void ReleaseData(); - - BOOL IsPivotAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; - BOOL IsFilterAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; - BOOL GetColFieldAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, SCCOL& rField) const; - BOOL GetRowFieldAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, SCCOL& rField) const; - - // Referenz-Anpassung: - - void MoveSrcArea( SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab ); - void MoveDestArea( SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab ); - void ExtendSrcArea( SCCOL nNewEndCol, SCROW nNewEndRow ); - -private: - BOOL CreateFields(); - void CreateFieldData(); - void CalcArea(); - - void SetDataLine(SCCOL nCol, SCROW nRow, SCTAB nTab, SCSIZE nRIndex); - void SetFuncLine(SCCOL nCol, SCROW nRow, SCTAB nTab, USHORT nFunc, SCSIZE nIndex, SCSIZE nStartRIndex, SCSIZE nEndRIndex); - void ColToTable(SCSIZE nField, SCROW& nRow, ScProgress& rProgress); - void RowToTable(SCSIZE nField, SCCOL& nCol); - void SetFrame(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nWidth = 20); - void SetFrameHor(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - void SetFrameVer(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - void SetFontBold(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - void SetJustifyLeft(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - void SetJustifyRight(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - void SetStyle(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nId); - void SetButton(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - void SetValue(SCCOL nCol, SCROW nRow, const SubTotal& rTotal, USHORT nFunc); - SCROW GetCategoryRow( SCCOL nCol, SCROW nRow ); -}; - -//------------------------------------------------------------------------ -class ScPivotCollection : public ScCollection -{ - -private: - ScDocument* pDoc; -public: - ScPivotCollection(USHORT nLim = 4, USHORT nDel = 4, ScDocument* pDocument = NULL) : - ScCollection ( nLim, nDel), - pDoc ( pDocument ) {} - ScPivotCollection(const ScPivotCollection& rScPivotCollection) : - ScCollection ( rScPivotCollection ), - pDoc ( rScPivotCollection.pDoc ) {} - - virtual ScDataObject* Clone() const; - ScPivot* operator[]( const USHORT nIndex) const {return (ScPivot*)At(nIndex);} - ScPivot* GetPivotAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; - - BOOL Load( SvStream& rStream ); - BOOL Store( SvStream& rStream ) const; - - void UpdateReference(UpdateRefMode eUpdateRefMode, - SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); - void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ); - - BOOL operator==(const ScPivotCollection& rCmp) const; - - String CreateNewName( USHORT nMin = 1 ) const; -}; -#endif - //------------------------------------------------------------------------ struct LabelData diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx index 002adf9b77ce..9963cf65c895 100644 --- a/sc/inc/rangenam.hxx +++ b/sc/inc/rangenam.hxx @@ -37,11 +37,11 @@ #include "formula/grammar.hxx" #include "scdllapi.h" +#include <map> + //------------------------------------------------------------------------ class ScDocument; -class ScMultipleReadHeader; -class ScMultipleWriteHeader; namespace rtl { class OUStringBuffer; @@ -67,7 +67,6 @@ typedef USHORT RangeType; //------------------------------------------------------------------------ class ScTokenArray; -class ScIndexMap; class ScRangeData : public ScDataObject { @@ -89,6 +88,8 @@ private: friend class ScRangeName; ScRangeData( USHORT nIndex ); public: + typedef ::std::map<sal_uInt16, sal_uInt16> IndexMap; + SC_DLLPUBLIC ScRangeData( ScDocument* pDoc, const String& rName, const String& rSymbol, @@ -146,7 +147,7 @@ public: BOOL IsReference( ScRange& rRef, const ScAddress& rPos ) const; BOOL IsValidReference( ScRange& rRef ) const; - BOOL IsRangeAtCursor( const ScAddress&, BOOL bStartOnly ) const; +//UNUSED2009-05 BOOL IsRangeAtCursor( const ScAddress&, BOOL bStartOnly ) const; BOOL IsRangeAtBlock( const ScRange& ) const; void UpdateTabRef(SCTAB nOldTable, USHORT nFlag, SCTAB nNewTable); @@ -154,7 +155,7 @@ public: void ValidateTabRefs(); - void ReplaceRangeNamesInUse( const ScIndexMap& rMap ); + void ReplaceRangeNamesInUse( const IndexMap& rMap ); static void MakeValidName( String& rName ); SC_DLLPUBLIC static BOOL IsNameValid( const String& rName, ScDocument* pDoc ); @@ -203,7 +204,7 @@ public: virtual short Compare(ScDataObject* pKey1, ScDataObject* pKey2) const; virtual BOOL IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const; - ScRangeData* GetRangeAtCursor( const ScAddress&, BOOL bStartOnly ) const; +//UNUSED2009-05 ScRangeData* GetRangeAtCursor( const ScAddress&, BOOL bStartOnly ) const; SC_DLLPUBLIC ScRangeData* GetRangeAtBlock( const ScRange& ) const; SC_DLLPUBLIC BOOL SearchName( const String& rName, USHORT& rPos ) const; diff --git a/sc/inc/rechead.hxx b/sc/inc/rechead.hxx index 14be3ddcb325..a9e8a5cacd53 100644 --- a/sc/inc/rechead.hxx +++ b/sc/inc/rechead.hxx @@ -130,33 +130,6 @@ class SvStream; // ----------------------------------------------------------------------- -// "Automatischer" Record-Header mit Groessenangabe - -class ScReadHeader -{ -private: - SvStream& rStream; - ULONG nDataEnd; - -public: - ScReadHeader(SvStream& rNewStream); - ~ScReadHeader(); - - ULONG BytesLeft() const; -}; - -class ScWriteHeader -{ -private: - SvStream& rStream; - ULONG nDataPos; - sal_uInt32 nDataSize; - -public: - ScWriteHeader(SvStream& rNewStream, sal_uInt32 nDefault = 0); - ~ScWriteHeader(); -}; - // Header mit Groessenangaben fuer mehrere Objekte class ScMultipleReadHeader diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 8fb6b929337b..375eebe30964 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -675,7 +675,6 @@ #define FILE_MENU_END (SC_FUNCTION_START + 20) #define EDIT_MENU_START (FILE_MENU_END) -#define FID_PASTE_CONTENTS (EDIT_MENU_START) #define FID_DELETE_CELLCONTENTS (EDIT_MENU_START + 1) #define FID_DELETE_CELL (EDIT_MENU_START + 2) #define FID_DELETE_TABLE (EDIT_MENU_START + 3) @@ -856,8 +855,6 @@ #define RID_INPUTBAR_END (RID_INPUTBAR_START+1) #define DRAW_BAR_START (RID_INPUTBAR_END) -//! SID_OBJECT_MIRROR wird sicher mal allgemein -#define SID_OBJECT_MIRROR (DRAW_BAR_START) #define SID_DRAWTOABOVE (DRAW_BAR_START+15) #define SID_DRAWTOBELOW (DRAW_BAR_START+16) //#define SID_GROUP (DRAW_BAR_START+17) @@ -1106,10 +1103,6 @@ #define SID_DELETE_SCENARIO (SID_NEW_SLOTS+95) #define SID_EDIT_SCENARIO (SID_NEW_SLOTS+96) -#define SID_GET_CLPBRD_FORMAT_COUNT (SID_NEW_SLOTS+97) -#define SID_GET_CLPBRD_FORMAT_BY_IDX (SID_NEW_SLOTS+98) -#define SID_GET_CLPBRD_FORMAT_NAME (SID_NEW_SLOTS+99) - // idl Parameter --------------------------------------------------------- //aus sfx: #define FN_PARAM_1 (SC_PARAM_START) diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index 140d3dfe4c4a..7f3b5443d9d9 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -401,11 +401,11 @@ public: void MatTrans( ScMatrix& mRes) const; void MatCopy ( ScMatrix& mRes) const; - /** Copy upper left of this matrix to mRes matrix. - This matrix's dimensions must be greater or equal to the mRes matrix - dimensions. - */ - void MatCopyUpperLeft( ScMatrix& mRes) const; +//UNUSED2009-05 /** Copy upper left of this matrix to mRes matrix. +//UNUSED2009-05 This matrix's dimensions must be greater or equal to the mRes matrix +//UNUSED2009-05 dimensions. +//UNUSED2009-05 */ +//UNUSED2009-05 void MatCopyUpperLeft( ScMatrix& mRes) const; // Convert ScInterpreter::CompareMat values (-1,0,1) to boolean values void CompareEqual(); diff --git a/sc/inc/sheetdata.hxx b/sc/inc/sheetdata.hxx new file mode 100644 index 000000000000..63853f6bc675 --- /dev/null +++ b/sc/inc/sheetdata.hxx @@ -0,0 +1,183 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sheetdata.hxx,v $ + * $Revision: 1.16.32.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SHEETDATA_HXX +#define SC_SHEETDATA_HXX + +#include <xmloff/maptype.hxx> +#include <svx/editdata.hxx> +#include <vector> +#include <hash_set> + +#include "address.hxx" + +class ScAddress; +class SvXMLNamespaceMap; + + +struct ScStreamEntry +{ + sal_Int32 mnStartOffset; + sal_Int32 mnEndOffset; + + ScStreamEntry() : + mnStartOffset(-1), + mnEndOffset(-1) + { + } + + ScStreamEntry( sal_Int32 nStart, sal_Int32 nEnd ) : + mnStartOffset(nStart), + mnEndOffset(nEnd) + { + } +}; + +struct ScCellStyleEntry +{ + rtl::OUString maName; + ScAddress maCellPos; + + ScCellStyleEntry( const rtl::OUString& rName, const ScAddress& rPos ) : + maName(rName), + maCellPos(rPos) + { + } +}; + +struct ScNoteStyleEntry +{ + rtl::OUString maStyleName; + rtl::OUString maTextStyle; + ScAddress maCellPos; + + ScNoteStyleEntry( const rtl::OUString& rStyle, const rtl::OUString& rText, const ScAddress& rPos ) : + maStyleName(rStyle), + maTextStyle(rText), + maCellPos(rPos) + { + } +}; + +struct ScTextStyleEntry +{ + rtl::OUString maName; + ScAddress maCellPos; + ESelection maSelection; + + ScTextStyleEntry( const rtl::OUString& rName, const ScAddress& rPos, const ESelection& rSel ) : + maName(rName), + maCellPos(rPos), + maSelection(rSel) + { + } +}; + +struct ScLoadedNamespaceEntry +{ + rtl::OUString maPrefix; + rtl::OUString maName; + sal_uInt16 mnKey; + + ScLoadedNamespaceEntry( const rtl::OUString& rPrefix, const rtl::OUString& rName, sal_uInt16 nKey ) : + maPrefix(rPrefix), + maName(rName), + mnKey(nKey) + { + } +}; + +class ScSheetSaveData +{ + std::hash_set<rtl::OUString, rtl::OUStringHash> maInitialPrefixes; + std::vector<ScLoadedNamespaceEntry> maLoadedNamespaces; + + std::vector<ScCellStyleEntry> maCellStyles; + std::vector<ScCellStyleEntry> maColumnStyles; + std::vector<ScCellStyleEntry> maRowStyles; + std::vector<ScCellStyleEntry> maTableStyles; + std::vector<ScNoteStyleEntry> maNoteStyles; + std::vector<ScTextStyleEntry> maNoteParaStyles; + std::vector<ScTextStyleEntry> maNoteTextStyles; + std::vector<ScTextStyleEntry> maTextStyles; + std::vector<bool> maBlocked; + std::vector<ScStreamEntry> maStreamEntries; + std::vector<ScStreamEntry> maSaveEntries; + sal_Int32 mnStartTab; + sal_Int32 mnStartOffset; + + ScNoteStyleEntry maPreviousNote; + +public: + ScSheetSaveData(); + ~ScSheetSaveData(); + + void AddCellStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + void AddColumnStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + void AddRowStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + void AddTableStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + + void HandleNoteStyles( const rtl::OUString& rStyleName, const rtl::OUString& rTextName, const ScAddress& rCellPos ); + void AddNoteContentStyle( sal_uInt16 nFamily, const rtl::OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ); + + void AddTextStyle( const rtl::OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ); + + void BlockSheet( sal_Int32 nTab ); + bool IsSheetBlocked( sal_Int32 nTab ) const; + + void AddStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset ); + void GetStreamPos( sal_Int32 nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const; + bool HasStreamPos( sal_Int32 nTab ) const; + + void StartStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset ); + void EndStreamPos( sal_Int32 nEndOffset ); + + bool HasStartPos() const { return mnStartTab >= 0; } + + void ResetSaveEntries(); + void AddSavePos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset ); + void UseSaveEntries(); + + void StoreInitialNamespaces( const SvXMLNamespaceMap& rNamespaces ); + void StoreLoadedNamespaces( const SvXMLNamespaceMap& rNamespaces ); + bool AddLoadedNamespaces( SvXMLNamespaceMap& rNamespaces ) const; + + const std::vector<ScCellStyleEntry>& GetCellStyles() const { return maCellStyles; } + const std::vector<ScCellStyleEntry>& GetColumnStyles() const { return maColumnStyles; } + const std::vector<ScCellStyleEntry>& GetRowStyles() const { return maRowStyles; } + const std::vector<ScCellStyleEntry>& GetTableStyles() const { return maTableStyles; } + const std::vector<ScNoteStyleEntry>& GetNoteStyles() const { return maNoteStyles; } + const std::vector<ScTextStyleEntry>& GetNoteParaStyles() const { return maNoteParaStyles; } + const std::vector<ScTextStyleEntry>& GetNoteTextStyles() const { return maNoteTextStyles; } + const std::vector<ScTextStyleEntry>& GetTextStyles() const { return maTextStyles; } +}; + +#endif + diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx index 86db2815a0d8..1028bb5f7673 100644 --- a/sc/inc/stlpool.hxx +++ b/sc/inc/stlpool.hxx @@ -63,7 +63,7 @@ public: ScStyleSheet* FindCaseIns( const String& rName, SfxStyleFamily eFam ); - void SetForceStdName( const String* pSet ); +//UNUSED2009-05 void SetForceStdName( const String* pSet ); const String* GetForceStdName() const { return pForceStdName; } virtual SfxStyleSheetBase& Make( const String&, SfxStyleFamily eFam, diff --git a/sc/inc/subtotal.hxx b/sc/inc/subtotal.hxx index adc604151f35..92e03e140288 100644 --- a/sc/inc/subtotal.hxx +++ b/sc/inc/subtotal.hxx @@ -35,35 +35,6 @@ class SubTotal { -#if OLD_PIVOT_IMPLEMENTATION -private: - long nCount; - long nCount2; - double nSum; - double nSumSqr; - double nMax; - double nMin; - double nProduct; - BOOL bSumOk; - BOOL bSumSqrOk; - BOOL bProductOk; - USHORT nProgress; - -public: - SCSIZE nIndex; // Test - -public: - SubTotal(); - ~SubTotal(); - - void UpdateNoVal(); - void Update( double nVal ); - void Update( const SubTotal& rVal ); - - short Valid( USHORT nFunction ) const; - // return 0 => Fehler, -1 => kein Wert, 1 => ok - double Result( USHORT nFunction ) const; -#endif public: static BOOL SafePlus( double& fVal1, double fVal2); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 8b2227d48dbb..9fda5d522fdc 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -71,7 +71,6 @@ class ScStyleSheet; class ScTableLink; class ScTableProtection; class ScUserListData; -class ScIndexMap; struct RowInfo; struct ScFunctionData; struct ScLineFlags; @@ -127,6 +126,7 @@ private: // interne Verwaltung ------------------ BOOL bVisible; + BOOL bStreamValid; BOOL bPendingRowHeights; SCTAB nTab; @@ -193,6 +193,9 @@ public: BOOL IsVisible() const { return bVisible; } void SetVisible( BOOL bVis ); + BOOL IsStreamValid() const { return bStreamValid; } + void SetStreamValid( BOOL bSet, BOOL bIgnoreLock = FALSE ); + BOOL IsPendingRowHeights() const { return bPendingRowHeights; } void SetPendingRowHeights( BOOL bSet ); @@ -256,7 +259,7 @@ public: BOOL IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bIgnoreNotes = false ) const; void PutCell( const ScAddress&, ScBaseCell* pCell ); - void PutCell( const ScAddress&, ULONG nFormatIndex, ScBaseCell* pCell); +//UNUSED2009-05 void PutCell( const ScAddress&, ULONG nFormatIndex, ScBaseCell* pCell); void PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell ); void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell); // TRUE = Zahlformat gesetzt @@ -318,6 +321,8 @@ public: void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nDelFlag); void CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable, BOOL bKeepScenarioFlags, BOOL bCloneNoteCaptions); + void CopyToClip(const ScRangeList& rRanges, ScTable* pTable, + bool bKeepScenarioFlags, bool bCloneNoteCaptions); void CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy, USHORT nInsFlag, BOOL bAsLink, BOOL bSkipAttrForEmpty, ScTable* pTable); void StartListeningInArea( SCCOL nCol1, SCROW nRow1, @@ -435,7 +440,7 @@ public: void FindRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, std::set<USHORT>& rIndexes) const; void ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - const ScIndexMap& rMap ); + const ScRangeData::IndexMap& rMap ); void Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, double nMaxValue); @@ -459,7 +464,7 @@ public: const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop, const SvxBorderLine** ppRight, const SvxBorderLine** ppBottom ) const; - BOOL HasLines( const ScRange& rRange, Rectangle& rSizes ) const; +//UNUSED2009-05 BOOL HasLines( const ScRange& rRange, Rectangle& rSizes ) const; BOOL HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nMask ) const; BOOL HasAttribSelection( const ScMarkData& rMark, USHORT nMask ) const; BOOL ExtendMerge( SCCOL nStartCol, SCROW nStartRow, @@ -542,8 +547,8 @@ public: void ClearPrintRanges(); /** Adds a new print ranges. */ void AddPrintRange( const ScRange& rNew ); - /** Removes all old print ranges and sets the passed print ranges. */ - void SetPrintRange( const ScRange& rNew ); +//UNUSED2009-05 /** Removes all old print ranges and sets the passed print ranges. */ +//UNUSED2009-05 void SetPrintRange( const ScRange& rNew ); /** Marks the specified sheet to be printed completely. Deletes old print ranges! */ void SetPrintEntireSheet(); @@ -726,7 +731,7 @@ private: BOOL GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, BOOL bInSel, const ScMarkData& rMark) const; BOOL GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ); - void SetDrawPageSize(); + void SetDrawPageSize(bool bResetStreamValid = true); BOOL TestTabRefAbs(SCTAB nTable); void CompileDBFormula(); void CompileDBFormula( BOOL bCreateFormulaString ); diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index fdad032b8300..8ec7707874be 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -259,6 +259,8 @@ public: ScCellTextCursor(ScCellObj& rText); virtual ~ScCellTextCursor() throw(); + ScCellObj& GetCellObj() const { return rTextObj; } + // SvxUnoTextCursor methods reimplemented here: virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException); @@ -324,6 +326,15 @@ public: getStart() throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< + sal_Int8 >& aIdentifier ) + throw(::com::sun::star::uno::RuntimeException); + + static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); + static ScDrawTextCursor* getImplementation( const com::sun::star::uno::Reference< + com::sun::star::uno::XInterface> xObj ); }; diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx index cea9c154f04a..e41d81990378 100644 --- a/sc/inc/validat.hxx +++ b/sc/inc/validat.hxx @@ -200,8 +200,6 @@ public: ScValidationData* GetData( sal_uInt32 nKey ); - void ResetUsed(); - void CompileXML(); void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); |