From b559137b68a273ef543711995ebf4f140cfe9149 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 27 Jul 2009 11:41:15 -0400 Subject: #i102141# initial port of patches from ooo-build, to implement a new HTML option dialog & associated changes in the core. --- sc/inc/column.hxx | 4 +++- sc/inc/document.hxx | 4 +++- sc/inc/filter.hxx | 8 ++++++-- sc/inc/sc.hrc | 3 +++ sc/inc/scabstdlg.hxx | 11 ++++++++++ sc/inc/stringutil.hxx | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ sc/inc/table.hxx | 3 ++- 7 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 sc/inc/stringutil.hxx (limited to 'sc/inc') diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index c66ecb960e7d..93861d7436cb 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -241,7 +241,9 @@ public: // TRUE = Zahlformat gesetzt BOOL SetString( SCROW nRow, SCTAB nTab, const String& rString, - formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO ); + formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO, + SvNumberFormatter* pFormatter = NULL, + bool bDetectNumberFormat = true ); void SetValue( SCROW nRow, const double& rVal); void SetError( SCROW nRow, const USHORT nError); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 17c3234a7723..ca56205d74a0 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -721,7 +721,9 @@ public: SC_DLLPUBLIC void PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, ULONG nFormatIndex, BOOL bForceTab = FALSE); // return TRUE = Zahlformat gesetzt - SC_DLLPUBLIC BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString ); + SC_DLLPUBLIC BOOL SetString( + SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, + SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal ); void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError); diff --git a/sc/inc/filter.hxx b/sc/inc/filter.hxx index 157795db2a42..8284447f2f05 100644 --- a/sc/inc/filter.hxx +++ b/sc/inc/filter.hxx @@ -42,6 +42,7 @@ class SvStream; class ScAddress; class ScDocument; class ScRange; +class SvNumberFormatter; // Return-Werte Im-/Exportfilter (ULONG) @@ -92,7 +93,9 @@ class ScEEAbsImport { virtual ~ScEEAbsImport() {} virtual ULONG Read( SvStream& rStream, const String& rBaseURL ) = 0; virtual ScRange GetRange() = 0; - virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0 ) = 0; + virtual void WriteToDocument( + BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0, + SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0; }; class ScFormatFilterPlugin { @@ -109,7 +112,8 @@ class ScFormatFilterPlugin { virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos, const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL ) = 0; virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange ) = 0; - virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE ) = 0; + virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, + BOOL bCalcWidthHeight = TRUE, SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0; // various import helpers virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ) = 0; diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 8fb6b929337b..ba3420f1d9c3 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1650,6 +1650,9 @@ #define MID_3 3 #define MID_4 4 +// Language chooser for text import filters. +#define RID_SCDLG_LANG_CHOOSER (SC_OOO_BUILD_START + 12) + #endif diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index f9895ff15ebb..89c33bcae13f 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -41,6 +41,7 @@ #include "sc.hrc" #include "global.hxx" #include "pivot.hxx" +#include "i18npool/lang.h" class ScAsciiOptions; class ScAutoFormat; @@ -289,6 +290,14 @@ class AbstractScImportOptionsDlg : public VclAbstractDialog //add for ScImportO public: virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0; }; + +class AbstractScLangChooserDlg : public VclAbstractDialog //add for ScLangChooserDlg +{ +public: + virtual LanguageType GetLanguageType() const = 0; + virtual bool IsDateConversionSet() const = 0; +}; + //-------Scabstract fractory --------------------------- class ScAbstractDialogFactory { @@ -299,6 +308,8 @@ public: SvStream* pInStream, int nId, sal_Unicode cSep = '\t') = 0; + virtual AbstractScLangChooserDlg * CreateScLangChooserDlg( Window* pParent, int nId ) = 0; + virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx new file mode 100644 index 000000000000..c50c0d8cf156 --- /dev/null +++ b/sc/inc/stringutil.hxx @@ -0,0 +1,56 @@ +/************************************************************************* + * + * 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: table.hxx,v $ + * $Revision: 1.35 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_STRINGUTIL_HXX +#define SC_STRINGUTIL_HXX + +#include "rtl/ustring.hxx" + +class ScStringUtil +{ +public: + /** + * Check if a given string is a simple decimal number (e.g. 12.345). We + * don't do any elaborate parsing here; we only check for the simplest + * case of decimal number format. + * + * @param rStr string to parse + * @param dsep decimal separator + * @param gsep group separator (aka thousands separator) + * @param rVal value of successfully parsed number + * + * @return true if the string is a valid number, false otherwise. + */ + static bool parseSimpleNumber( + const ::rtl::OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal); +}; + + +#endif diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 7d9bf90a3d81..fd1f806b688d 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -260,7 +260,8 @@ public: void PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell ); void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell); // TRUE = Zahlformat gesetzt - BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString ); + BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, + SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); void SetValue( SCCOL nCol, SCROW nRow, const double& rVal ); void SetError( SCCOL nCol, SCROW nRow, USHORT nError); -- cgit From 23d5998c325a7999f75448e70b315d12b639abc6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 27 Jul 2009 14:57:34 -0400 Subject: fixed build breakages. sc module is now buildable. --- sc/inc/optutil.hxx | 7 ++++--- sc/inc/sc.hrc | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/optutil.hxx b/sc/inc/optutil.hxx index a00b3495d766..15cc8ba79bb7 100644 --- a/sc/inc/optutil.hxx +++ b/sc/inc/optutil.hxx @@ -33,6 +33,7 @@ #include #include +#include "scdllapi.h" class ScOptionsUtil @@ -44,13 +45,13 @@ public: // ConfigItem for classes that use items from several sub trees -class ScLinkConfigItem : public utl::ConfigItem +class SC_DLLPUBLIC ScLinkConfigItem : public utl::ConfigItem { Link aCommitLink; public: - ScLinkConfigItem( const rtl::OUString rSubTree ); - ScLinkConfigItem( const rtl::OUString rSubTree, sal_Int16 nMode ); + ScLinkConfigItem( const rtl::OUString& rSubTree ); + ScLinkConfigItem( const rtl::OUString& rSubTree, sal_Int16 nMode ); void SetCommitLink( const Link& rLink ); virtual void Notify( const com::sun::star::uno::Sequence& aPropertyNames ); diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index ba3420f1d9c3..baf94c23748f 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1635,8 +1635,9 @@ #define RID_SCDLG_DOCPROTECTION (SC_DIALOGS_START + 149) #define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150) #define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) +#define RID_SCDLG_LANG_CHOOSER (SC_DIALOGS_START + 152) -#define SC_DIALOGS_END (SC_DIALOGS_START + 152) +#define SC_DIALOGS_END (SC_DIALOGS_START + 153) #ifndef STD_MASKCOLOR #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } @@ -1650,9 +1651,6 @@ #define MID_3 3 #define MID_4 4 -// Language chooser for text import filters. -#define RID_SCDLG_LANG_CHOOSER (SC_OOO_BUILD_START + 12) - #endif -- cgit From feeb99de89fc888b9397ddca882d121bdec2bef4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 6 Aug 2009 14:58:06 -0400 Subject: Change the identity of the import option dialog. Change the identity of the import option dialog from lang chooser to text import options, since the dialog now contains more than just the language option. --- sc/inc/sc.hrc | 2 +- sc/inc/scabstdlg.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index baf94c23748f..df07ed7a6d4c 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1635,7 +1635,7 @@ #define RID_SCDLG_DOCPROTECTION (SC_DIALOGS_START + 149) #define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150) #define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) -#define RID_SCDLG_LANG_CHOOSER (SC_DIALOGS_START + 152) +#define RID_SCDLG_TEXT_IMPORT_OPTIONS (SC_DIALOGS_START + 152) #define SC_DIALOGS_END (SC_DIALOGS_START + 153) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 89c33bcae13f..9dc272715bd8 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -291,7 +291,7 @@ public: virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0; }; -class AbstractScLangChooserDlg : public VclAbstractDialog //add for ScLangChooserDlg +class AbstractScTextImportOptionsDlg : public VclAbstractDialog //add for ScLangChooserDlg { public: virtual LanguageType GetLanguageType() const = 0; @@ -308,7 +308,7 @@ public: SvStream* pInStream, int nId, sal_Unicode cSep = '\t') = 0; - virtual AbstractScLangChooserDlg * CreateScLangChooserDlg( Window* pParent, int nId ) = 0; + virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg( Window* pParent, int nId ) = 0; virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg ScAutoFormat* pAutoFormat, -- cgit From 70a30bdb2f4459ec5b7fea546433f274f69c5f47 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 2 Dec 2009 17:31:38 -0500 Subject: #i107339# Allow ScMatrix objects to be re-sizable. --- sc/inc/scmatrix.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index 7f3b5443d9d9..0c4abc067d70 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -106,6 +106,7 @@ class SC_DLLPUBLIC ScMatrix void ResetIsString(); void DeleteIsString(); void CreateMatrix( SCSIZE nC, SCSIZE nR); + void Clear(); // pStr may be NULL, bFlag MUST NOT be 0 void PutStringEntry( const String* pStr, BYTE bFlag, SCSIZE nIndex ); @@ -178,6 +179,12 @@ public: /** Clone the matrix. */ ScMatrix* Clone() const; + /** + * Resize the matrix to specified new dimension. Note that this operation + * clears all stored values. + */ + void Resize( SCSIZE nC, SCSIZE nR); + /** Clone the matrix and extend it to the new size. nNewCols and nNewRows MUST be at least of the size of the original matrix. */ ScMatrix* CloneAndExtend( SCSIZE nNewCols, SCSIZE nNewRows ) const; -- cgit From fc01d8a544527bcd50b1e77140fc0f084afd414d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 5 Dec 2009 11:07:21 -0500 Subject: kohei04: #i107458# Removed hard-coded range separators. Previously, range separators were hard-coded for each address convention. But in the new code the separators are independent of address conventions or grammars. This code was one of the left-overs of the previous implementation. --- sc/inc/rangelst.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx index e2ceba32b2f1..f68e9174705e 100644 --- a/sc/inc/rangelst.hxx +++ b/sc/inc/rangelst.hxx @@ -58,10 +58,10 @@ public: USHORT Parse( const String&, ScDocument* = NULL, USHORT nMask = SCA_VALID, formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO, - char cDelimiter = 0 ); + sal_Unicode cDelimiter = 0 ); void Format( String&, USHORT nFlags = 0, ScDocument* = NULL, formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO, - char cDelimiter = 0 ) const; + sal_Unicode cDelimiter = 0 ) const; void Join( const ScRange&, BOOL bIsInList = FALSE ); BOOL UpdateReference( UpdateRefMode, ScDocument*, const ScRange& rWhere, -- cgit From aa86f94b494b5c23279c870e86563bd86eb5245d Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Fri, 11 Dec 2009 19:37:02 +0100 Subject: datapilotapi: #i42199# API access to all types of DataPilot tables --- sc/inc/dpsdbtab.hxx | 2 ++ sc/inc/unonames.hxx | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/dpsdbtab.hxx b/sc/inc/dpsdbtab.hxx index b837b5811aad..da5dda45601e 100644 --- a/sc/inc/dpsdbtab.hxx +++ b/sc/inc/dpsdbtab.hxx @@ -53,6 +53,8 @@ struct ScImportSourceDesc USHORT nType; // enum DataImportMode BOOL bNative; + ScImportSourceDesc() : nType(0), bNative(FALSE) {} + BOOL operator== ( const ScImportSourceDesc& rOther ) const { return aDBName == rOther.aDBName && aObject == rOther.aObject && diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 010e420feb42..f4c333656661 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -573,6 +573,15 @@ #define SC_UNO_RPTEMPTY "RepeatIfEmpty" #define SC_UNO_DRILLDOWN "DrillDownOnDoubleClick" #define SC_UNO_SHOWFILT "ShowFilterButton" +#define SC_UNO_IMPORTDESC "ImportDescriptor" +#define SC_UNO_SOURCESERV "SourceServiceName" +#define SC_UNO_SERVICEARG "ServiceArguments" + +// properties in data pilot descriptor ServiceArguments +#define SC_UNO_SOURCENAME "SourceName" +#define SC_UNO_OBJECTNAME "ObjectName" +#define SC_UNO_USERNAME "UserName" +#define SC_UNO_PASSWORD "Password" // range selection #define SC_UNONAME_INITVAL "InitialValue" -- cgit From ef7f35dbe9a0436970c489f6d4eed2d6f7ba7e45 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 15 Dec 2009 17:17:08 +0100 Subject: #i107439# BIFF export: write external link data correctly --- sc/inc/externalrefmgr.hxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index bf795f04fe1c..c618d75b1879 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -144,7 +144,7 @@ public: ~Table(); SC_DLLPUBLIC void setCell(SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uInt32 nFmtIndex = 0); - TokenRef getCell(SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex = NULL) const; + SC_DLLPUBLIC TokenRef getCell(SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex = NULL) const; bool hasRow( SCROW nRow ) const; /** Set/clear referenced status flag only if current status is not REFERENCED_PERMANENT. */ @@ -155,8 +155,12 @@ public: bool isReferenced() const; /// Obtain a sorted vector of rows. void getAllRows(::std::vector& rRows) const; + /// Returns the half-open range of used rows in this table. Returns [0,0) if table is empty. + SC_DLLPUBLIC ::std::pair< SCROW, SCROW > getRowRange() const; /// Obtain a sorted vector of columns. void getAllCols(SCROW nRow, ::std::vector& rCols) const; + /// Returns the half-open range of used columns in the specified row. Returns [0,0) if row is empty. + SC_DLLPUBLIC ::std::pair< SCCOL, SCCOL > getColRange( SCROW nRow ) const; void getAllNumberFormats(::std::vector& rNumFmts) const; private: @@ -470,6 +474,13 @@ public: * @return shared_ptr to the cache table instance */ ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, const String& rTabName, bool bCreateNew, size_t* pnIndex = 0); + + /** Returns a vector containing all (real) table names and cache tables of + the specified file. + + The index in the returned vector corresponds to the table index used to + access the cache table, e.g. in getCacheTable(). + */ void getAllCachedTableNames(sal_uInt16 nFileId, ::std::vector& rTabNames) const; /** -- cgit From 0ef3cc16ea48abb2b997788ef98639d7ed99dd52 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 13 Jan 2010 19:30:57 +0100 Subject: datapilotapi: #i108295# XModifyBroadcaster in ScDataPilotTableObj --- sc/inc/dapiuno.hxx | 19 ++++++++++++++++++- sc/inc/hints.hxx | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index c3d5db0bc72b..7857ce3b813b 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -34,6 +34,8 @@ #include "global.hxx" #include "dpobject.hxx" #include "rangeutl.hxx" // ScArea +#include "cellsuno.hxx" // for XModifyListenerArr_Impl + #include #include @@ -42,6 +44,7 @@ #include #include #include +#include #include #include @@ -316,11 +319,15 @@ public: // ============================================================================ class ScDataPilotTableObj : public ScDataPilotDescriptorBase, - public com::sun::star::sheet::XDataPilotTable2 + public com::sun::star::sheet::XDataPilotTable2, + public com::sun::star::util::XModifyBroadcaster { private: SCTAB nTab; String aName; + XModifyListenerArr_Impl aModifyListeners; + + void Refreshed_Impl(); public: ScDataPilotTableObj(ScDocShell* pDocSh, SCTAB nT, const String& rN); @@ -332,6 +339,8 @@ public: virtual void SAL_CALL acquire() throw(); virtual void SAL_CALL release() throw(); + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual ScDPObject* GetDPObject() const; virtual void SetDPObject(ScDPObject* pDPObj); @@ -364,6 +373,14 @@ public: throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + // XModifyBroadcaster + virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XModifyListener >& aListener ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XModifyListener >& aListener ) + throw (::com::sun::star::uno::RuntimeException); + // XTypeProvider (overloaded) virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); diff --git a/sc/inc/hints.hxx b/sc/inc/hints.hxx index 92c17caf9641..11d5001a3912 100644 --- a/sc/inc/hints.hxx +++ b/sc/inc/hints.hxx @@ -173,4 +173,16 @@ public: const ScImportParam& GetImportParam() const { return aParam; } }; +class ScDataPilotModifiedHint : public SfxHint +{ + String maName; + +public: + TYPEINFO(); + ScDataPilotModifiedHint( const String& rName ); + ~ScDataPilotModifiedHint(); + + const String& GetName() const { return maName; } +}; + #endif -- cgit From e0bff7cc71affce1166c09d7c95958dd1e2c4687 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 15 Jan 2010 12:00:39 +0100 Subject: dr74: migrate changes to hg --- sc/inc/rangelst.hxx | 2 ++ sc/inc/sc.hrc | 2 ++ 2 files changed, 4 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx index e2ceba32b2f1..39926ad262f0 100644 --- a/sc/inc/rangelst.hxx +++ b/sc/inc/rangelst.hxx @@ -43,6 +43,7 @@ class SC_DLLPUBLIC ScRangeList : public ScRangeListBase, public SvRefBase { private: using ScRangeListBase::operator==; + using ScRangeListBase::operator!=; public: ScRangeList() {} @@ -68,6 +69,7 @@ public: SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); ScRange* Find( const ScAddress& ) const; BOOL operator==( const ScRangeList& ) const; + BOOL operator!=( const ScRangeList& r ) const; BOOL Intersects( const ScRange& ) const; BOOL In( const ScRange& ) const; ULONG GetCellCount() const; diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 375eebe30964..37668fec72c8 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -265,6 +265,8 @@ #define HID_SC_RENAME_OBJECT ( HID_SC_TOOLBOX_START + 9 ) +#define HID_SC_REN_AFMT_DLG ( HID_SC_TOOLBOX_START + 10 ) + // Hilfe IDs fuer Submenus (max.50) ------------------------------------------ #define HID_SCMENU_EDIT ( HID_SC_MENU_START ) #define HID_SCMENU_FILL ( HID_SC_MENU_START + 1 ) -- cgit From 6a1e783a74418fd307d9092ea2809e50176f10ee Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 15 Jan 2010 15:21:56 +0100 Subject: dr75: #i101099# [Collaboration] Changes are not correctly shown --- sc/inc/chgtrack.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index 6707473f5610..a1c1468eefb9 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -311,7 +311,6 @@ protected: GetDeletedInAddress(), p ); } BOOL RemoveDeletedIn( const ScChangeAction* ); - void RemoveAllDeletedIn(); void SetDeletedIn( ScChangeAction* ); ScChangeActionLinkEntry* AddDeleted( ScChangeAction* p ) @@ -417,6 +416,7 @@ public: { return IsDeleteType() || IsDeletedIn(); } BOOL IsDeletedIn( const ScChangeAction* ) const; BOOL IsDeletedInDelType( ScChangeActionType ) const; + void RemoveAllDeletedIn(); const ScChangeActionLinkEntry* GetFirstDeletedEntry() const { return pLinkDeleted; } -- cgit From a1cbee0ff69113cd1530c894f97de2159a32be34 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 22 Jan 2010 16:16:36 +0100 Subject: chartmultiline: #i82971# complex categories (part4 - detect complex categories when creating charts from cell ranges and when detecting the arguments later (adapt implementation of XDataProvider->createDataSource & detectArguments) ) + #i86188# --- sc/inc/chart2uno.hxx | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx index dc0244dfcdb8..85ceaef9fefb 100644 --- a/sc/inc/chart2uno.hxx +++ b/sc/inc/chart2uno.hxx @@ -191,24 +191,6 @@ public: getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException); - /** - * Check the current list of reference tokens, and add the upper left - * corner of the minimum range that encloses all ranges if certain - * conditions are met. - * - * @param rRefTokens list of reference tokens - * - * @return true if the corner was added, false otherwise. - */ - static bool addUpperLeftCornerIfMissing(::std::vector& rRefTokens); - -private: - - void detectRangesFromDataSource(::std::vector& rRefTokens, - ::com::sun::star::chart::ChartDataRowSource& rRowSource, - bool& rRowSourceDetected, - const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xDataSource); - private: ScDocument* m_pDocument; -- cgit From 83ccb404e2829cba98cf0bb1290da489fd1f4c6c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 25 Jan 2010 15:57:05 -0500 Subject: koheicsvimport: #i108645# Store the dialog parameters only when the OK is pressed. --- sc/inc/scabstdlg.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc/inc') diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 98ec2b6b5a71..824761804349 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -69,6 +69,7 @@ class AbstractScImportAsciiDlg : public VclAbstractDialog //add for ScImportAsc public: virtual void GetOptions( ScAsciiOptions& rOpt ) = 0; virtual void SetTextToColumnsMode() = 0; + virtual void SaveParameters() = 0; }; -- cgit From 7f40d36d4ab443d1152ec932784c7f0d3cdbaa46 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 3 Feb 2010 17:59:00 +0100 Subject: datapilotperf: manual migration of changes by Wang Xu Ming from svn to hg --- sc/inc/collect.hxx | 14 ++- sc/inc/document.hxx | 23 +++++ sc/inc/dpcachetable.hxx | 134 +++++++++++++++---------- sc/inc/dpglobal.hxx | 208 ++++++++++++++++++++++++++++++++++++++ sc/inc/dpgroup.hxx | 52 +++++++--- sc/inc/dpobject.hxx | 40 ++------ sc/inc/dpsave.hxx | 20 +++- sc/inc/dpsdbtab.hxx | 18 ++-- sc/inc/dpshttab.hxx | 33 ++++-- sc/inc/dptabdat.hxx | 81 +++++++-------- sc/inc/dptablecache.hxx | 120 ++++++++++++++++++++++ sc/inc/dptabres.hxx | 262 +++++++++++++++++++++++++++++++++++------------- sc/inc/dptabsrc.hxx | 52 ++++++++-- sc/inc/global.hxx | 57 +---------- sc/inc/globstr.hrc | 5 +- sc/inc/pivot.hxx | 1 + 16 files changed, 820 insertions(+), 300 deletions(-) create mode 100644 sc/inc/dpglobal.hxx create mode 100644 sc/inc/dptablecache.hxx (limited to 'sc/inc') diff --git a/sc/inc/collect.hxx b/sc/inc/collect.hxx index dc7778d12da3..baf9b6b1146b 100644 --- a/sc/inc/collect.hxx +++ b/sc/inc/collect.hxx @@ -187,20 +187,18 @@ private: BOOL bCaseSensitive; public: - TypedScStrCollection( USHORT nLim = 4, USHORT nDel = 4, BOOL bDup = FALSE ) - : ScSortedCollection( nLim, nDel, bDup ) { bCaseSensitive = FALSE; } + TypedScStrCollection( USHORT nLim = 4, USHORT nDel = 4, BOOL bDup = FALSE ); - TypedScStrCollection( const TypedScStrCollection& rCpy ) - : ScSortedCollection( rCpy ) { bCaseSensitive = rCpy.bCaseSensitive; } - ~TypedScStrCollection(); + TypedScStrCollection( const TypedScStrCollection& rCpy ) + : ScSortedCollection( rCpy ) { bCaseSensitive = rCpy.bCaseSensitive; } + ~TypedScStrCollection(); virtual ScDataObject* Clone() const; virtual short Compare( ScDataObject* pKey1, ScDataObject* pKey2 ) const; - TypedStrData* operator[]( const USHORT nIndex) const - { return (TypedStrData*)At(nIndex); } + TypedStrData* operator[]( const USHORT nIndex) const; - void SetCaseSensitive( BOOL bSet ) { bCaseSensitive = bSet; } + void SetCaseSensitive( BOOL bSet ); BOOL FindText( const String& rStart, String& rResult, USHORT& rPos, BOOL bBack ) const; BOOL GetExactMatch( String& rString ) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 67d36861d10a..c32b2d4ed82e 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -48,6 +48,13 @@ #include #include +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +#include +#include "dpobject.hxx" +#include "dptabdat.hxx" +// End Comments + class KeyEvent; class OutputDevice; class SdrObject; @@ -257,6 +264,11 @@ private: ScRangeName* pRangeName; ScDBCollection* pDBCollection; ScDPCollection* pDPCollection; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + std::list m_listDPObjectsInClip; + std::list m_listDPObjectsCaches; + // End Comments ScChartCollection* pChartCollection; std::auto_ptr< ScTemporaryChartLock > apTemporaryChartLock; ScPatternAttr* pSelectionAttr; // Attribute eines Blocks @@ -489,6 +501,17 @@ public: SC_DLLPUBLIC ScDPCollection* GetDPCollection(); ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; ScDPObject* GetDPAtBlock( const ScRange& rBlock ) const; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + SC_DLLPUBLIC ScDPTableDataCache* GetDPObjectCache( long nID ); + SC_DLLPUBLIC ScDPTableDataCache* GetUsedDPObjectCache ( ScRange rRange ); + SC_DLLPUBLIC long AddDPObjectCache( ScDPTableDataCache* pData ); + SC_DLLPUBLIC void RemoveDPObjectCache( long nID ); + SC_DLLPUBLIC void RemoveUnusedDPObjectCaches(); + SC_DLLPUBLIC void GetUsedDPObjectCache( std::list& usedlist ); + SC_DLLPUBLIC long GetNewDPObjectCacheId (); + // End Comments + SC_DLLPUBLIC ScChartCollection* GetChartCollection() const; void StopTemporaryChartLock(); diff --git a/sc/inc/dpcachetable.hxx b/sc/inc/dpcachetable.hxx index 2115eab7cc42..676ae1221cd8 100644 --- a/sc/inc/dpcachetable.hxx +++ b/sc/inc/dpcachetable.hxx @@ -59,32 +59,37 @@ class ScRange; class ScDPDimension; class ScDPCollection; struct ScDPCacheCell; -struct ScDPItemData; +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +class ScDPItemData; +// End Comments class Date; +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +class ScDPTableDataCache; +struct ScDPValueData; +// End Comments // ---------------------------------------------------------------------------- -class ScDPCacheTable +class SC_DLLPUBLIC ScDPCacheTable { public: - - struct Cell - { - SCROW mnCategoryRef; - ScDPCacheCell* mpContent; - - Cell(); - ~Cell(); - }; - /** individual filter item used in SingleFilter and GroupFilter. */ struct FilterItem { - sal_Int32 mnMatchStrId; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + String maString; + // End Comments double mfValue; bool mbHasValue; FilterItem(); +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + bool match( const ScDPItemData& rCellData ) const; +// End Comments }; /** interface class used for filtering of rows. */ @@ -93,19 +98,26 @@ public: public: /** returns true if the matching condition is met for a single cell value, or false otherwise. */ - virtual bool match(const ScDPCacheCell& rCell) const = 0; +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + virtual bool match( const ScDPItemData& rCellData ) const = 0; +// End Comments }; /** ordinary single-item filter. */ class SingleFilter : public FilterBase { public: - explicit SingleFilter(ScSimpleSharedString& rSharedString, - sal_Int32 nMatchStrId, double fValue, bool bHasValue); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + explicit SingleFilter(String aString, double fValue, bool bHasValue); + // End Comments virtual ~SingleFilter(){} - virtual bool match(const ScDPCacheCell& rCell) const; - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + virtual bool match(const ScDPItemData& rCellData) const; + // End Comments const String getMatchString(); double getMatchValue() const; bool hasValue() const; @@ -114,25 +126,27 @@ public: explicit SingleFilter(); FilterItem maItem; - ScSimpleSharedString mrSharedString; }; /** multi-item (group) filter. */ class GroupFilter : public FilterBase { public: - GroupFilter(ScSimpleSharedString& rSharedString); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + GroupFilter(); + // End Comments virtual ~GroupFilter(){} - virtual bool match(const ScDPCacheCell& rCell) const; - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + virtual bool match( const ScDPItemData& rCellData ) const; + // End Comments void addMatchItem(const String& rStr, double fVal, bool bHasValue); size_t getMatchItemCount() const; private: - GroupFilter(); ::std::vector maItems; - ScSimpleSharedString mrSharedString; }; /** single filtering criterion. */ @@ -143,22 +157,26 @@ public: Criterion(); }; - - ScDPCacheTable(ScDPCollection* pCollection); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPCacheTable( ScDocument* pDoc,long nId ); + // End Comments ~ScDPCacheTable(); sal_Int32 getRowSize() const; sal_Int32 getColSize() const; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPTableDataCache* GetCache() const; /** Fill the internal table from the cell range provided. This function - assumes that the first row is the column header. */ - void fillTable(ScDocument* pDoc, const ScRange& rRange, const ScQueryParam& rQuery, BOOL* pSpecial, - bool bIgnoreEmptyRows); - + assumes that the first row is the column header. */ + void fillTable( const ScQueryParam& rQuery, BOOL* pSpecial, + bool bIgnoreEmptyRows, bool bRepeatIfEmpty ); /** Fill the internal table from database connection object. This function assumes that the first row is the column header. */ - void fillTable(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xRowSet, - const Date& rNullDate); + void fillTable(); + // End Comments /** Check whether a specified row is active or not. When a row is active, it is used in calculation of the results data. A row becomes inactive @@ -172,15 +190,23 @@ public: /** Get the cell instance at specified location within the data grid. Note that the data grid doesn't include the header row. Don't delete the returned object! */ - const ScDPCacheCell* getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const; - - const String* getFieldName(sal_Int32 nIndex) const; - - /** Get the unique entries for a field specified by index. The caller must + const ScDPItemData* getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const; + void getValue( ScDPValueData& rVal, SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const; + String getFieldName( SCCOL nIndex) const; + //End Comments + + /** 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; + + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + /** 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. */ - const TypedScStrCollection& getFieldEntries(sal_Int32 nIndex) const; - + const ::std::vector& getFieldEntries( sal_Int32 nColumn ) const; + // End Comments /** Filter the table based on the specified criteria, and copy the result to rTabData. This method is used, for example, to generate a drill-down data table. */ @@ -189,6 +215,7 @@ public: const ::std::hash_set& rRepeatIfEmptyDims); void clear(); + void swap(ScDPCacheTable& rOther); bool empty() const; private: @@ -203,26 +230,23 @@ private: */ bool isRowQualified(sal_Int32 nRow, const ::std::vector& rCriteria, const ::std::hash_set& rRepeatIfEmptyDims) const; void getValueData(ScDocument* pDoc, const ScAddress& rPos, ScDPCacheCell& rCell); - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + void InitNoneCache( ScDocument* pDoc ); + // End Comments private: - typedef ::boost::shared_ptr TypedScStrCollectionPtr; - - /** main data table. */ - ::std::vector< ::std::vector< ::ScDPCacheTable::Cell > > maTable; - - /** header string IDs */ - ::std::vector maHeader; - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance /** unique field entires for each field (column). */ - ::std::vector maFieldEntries; - + ::std::vector< ::std::vector > maFieldEntries; + // End Comments /** used to track visibility of rows. The first row below the header row has the index of 0. */ ::std::vector maRowsVisible; - - ScSimpleSharedString& mrSharedString; - ScDPCollection* mpCollection; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPTableDataCache* mpCache; + ScDPTableDataCache* mpNoneCache; + // End Comments }; - - #endif diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx new file mode 100644 index 000000000000..c4089be762c0 --- /dev/null +++ b/sc/inc/dpglobal.hxx @@ -0,0 +1,208 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009. + * Copyright 2009 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: dpglobal.hxx,v $ + * $Revision: 1.0 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +// Wang Xu Ming - DataPilot migration +// Buffer&&Performance +// +#ifndef _SC_DPGLOBAL_HXX +#define _SC_DPGLOBAL_HXX + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define MAX_LABELS (MAXCOL+1) + +#define MAX_PAGEFIELDS 10 // maximum count of fields for page area + +#define PIVOT_MAXFUNC 11 +#define PIVOT_FUNC_NONE 0x0000 +#define PIVOT_FUNC_SUM 0x0001 +#define PIVOT_FUNC_COUNT 0x0002 +#define PIVOT_FUNC_AVERAGE 0x0004 +#define PIVOT_FUNC_MAX 0x0008 +#define PIVOT_FUNC_MIN 0x0010 +#define PIVOT_FUNC_PRODUCT 0x0020 +#define PIVOT_FUNC_COUNT_NUM 0x0040 +#define PIVOT_FUNC_STD_DEV 0x0080 +#define PIVOT_FUNC_STD_DEVP 0x0100 +#define PIVOT_FUNC_STD_VAR 0x0200 +#define PIVOT_FUNC_STD_VARP 0x0400 +#define PIVOT_FUNC_AUTO 0x1000 + +#define DATA_RENAME_SEPARATOR "_" +#define __MAX_NUM_LEN 64 +#define __DECIMALPLACE 18 + +#define DP_PROP_COLUMNGRAND "ColumnGrand" +#define DP_PROP_FUNCTION "Function" +#define DP_PROP_IGNOREEMPTY "IgnoreEmptyRows" +#define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension" +#define DP_PROP_ISVISIBLE "IsVisible" +#define DP_PROP_ORIENTATION "Orientation" +#define DP_PROP_REPEATIFEMPTY "RepeatIfEmpty" +#define DP_PROP_ROWGRAND "RowGrand" +#define DP_PROP_SHOWDETAILS "ShowDetails" +#define DP_PROP_SHOWEMPTY "ShowEmpty" +#define DP_PROP_SUBTOTALS "SubTotals" +#define DP_PROP_USEDHIERARCHY "UsedHierarchy" +#define DP_PROP_FILTER "Filter" +#define DP_PROP_POSITION "Position" + +#define DBG_TRACESTR( x ) \ + {\ + ByteString aTemp( x , RTL_TEXTENCODING_UTF8 ); \ + DBG_TRACE( aTemp.GetBuffer() );\ + } + +class TypedStrData; +class ScDPObject; + +class SC_DLLPUBLIC ScDPItemData +{ +public: + enum { MK_VAL = 0x01, MK_DATA = MK_VAL<<1, MK_ERR = MK_DATA<<1, MK_DATE = MK_ERR<<1, MK_DATEPART = MK_DATE<<1 }; +private: + union + { + ULONG nNumFormat; + sal_Int32 mnDatePart; + }; + + String aString; + double fValue; + BYTE mbFlag; + //BOOL bHasValue: 1 ; + //BOOL bHasData: 1; + //BOOL bErr: 1; + + friend class ScDPTableDataCache; +public: + ScDPItemData() : fValue(0.0), nNumFormat( 0 ), mbFlag( 0 ){} + ScDPItemData( ULONG nNF, const String & rS, double fV, BYTE bF ):nNumFormat(nNF), aString(rS), fValue(fV), mbFlag( bF ){} + ScDPItemData( const String& rS, double fV = 0.0, BOOL bHV = FALSE, const ULONG nNumFormat = 0 , BOOL bData = TRUE) ; + ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nDocTab ); + + void SetString( const String& rS ) { aString = rS; mbFlag &= ~(MK_VAL|MK_DATE); nNumFormat = 0; mbFlag |= MK_DATA; } +// void SetValue ( double value , ULONG nNumFormat = 0 ) { bHasValue = TRUE; nNumFormat = 0;bHasData = TRUE; bDate = FALSE; fValue = value ;} + BOOL IsCaseInsEqual( const ScDPItemData& r ) const; + + size_t Hash() const; + + // exact equality + BOOL operator==( const ScDPItemData& r ) const; + // case insensitive equality + static sal_Int32 Compare( const ScDPItemData& rA, const ScDPItemData& rB ); + +#ifdef DEBUG + void dump() const; +#endif + +public: + BOOL IsHasData() const ; + BOOL IsHasErr() const ; + BOOL IsValue() const; + String GetString() const ; + double GetValue() const ; + ULONG GetNumFormat() const ; + BOOL HasStringData() const ; + BOOL IsDate() const; + BOOL HasDatePart() const; + void SetDate( BOOL b ) ; + + TypedStrData* CreateTypeString( ); + sal_uInt8 GetType() const; + BYTE & GetFlag() throw() { return mbFlag; } + const BYTE & GetFlag() const throw() { return const_cast(this)->GetFlag(); } +}; + +class SC_DLLPUBLIC ScDPItemDataPool +{ +public: + // construct + ScDPItemDataPool(void); + ScDPItemDataPool(const ScDPItemDataPool& r); + + virtual ~ScDPItemDataPool(void); + virtual const ScDPItemData* getData( sal_Int32 nId ); + virtual sal_Int32 getDataId( const ScDPItemData& aData ); + virtual sal_Int32 insertData( const ScDPItemData& aData ); +protected: + struct DataHashFunc : public std::unary_function< const ScDPItemData &, size_t > + { + size_t operator() (const ScDPItemData &rData) const { return rData.Hash(); } + }; + + typedef ::std::hash_multimap< ScDPItemData, sal_Int32, DataHashFunc > DataHash; + + ::std::vector< ScDPItemData > maItems; + DataHash maItemIds; +}; + +class ScDPInfoWnd; +class ScDocShell; +class ScTabViewShell; +namespace ScDPGlobal +{ +// used for core data + String GetFieldFuncString( const String& rSourceName, USHORT &rFuncMask, BOOL bIsValue ); + String GetFuncString( const String &rString, const USHORT nIndex ); + com::sun::star::uno::Reference DP_GetMembers( const com::sun::star::uno::Reference< + com::sun::star::sheet::XDimensionsSupplier>&rSrc, long nField ); +// common operation + String operator + ( const String & rL, const String &rR ); + Rectangle operator *( const Rectangle &rLeft, const std::pair & rRight ); +// used for DataPilot Panel + ScDPInfoWnd* GetDPInfoWnd( ScTabViewShell *pViewShell ); + bool ChkDPTableOverlap( ScDocument *pDestDoc, std::list & rClipboard, SCCOL nClipStartCol, SCROW nClipStartRow, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, USHORT nEndTab, BOOL bExcludeClip = FALSE ); + +} +#endif diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx index 99dac0e517db..a0d14a361b95 100644 --- a/sc/inc/dpgroup.hxx +++ b/sc/inc/dpgroup.hxx @@ -36,7 +36,10 @@ #include "dptabdat.hxx" #include "scdllapi.h" - +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +#include "dpglobal.hxx" +// End Comments class ScDocument; class SvNumberFormatter; @@ -75,8 +78,11 @@ public: sal_Int32 GetDatePart() const { return nDatePart; } const ScDPNumGroupInfo& GetNumInfo() const { return aNumInfo; } - void FillColumnEntries( TypedScStrCollection& rEntries, const TypedScStrCollection& rOriginal, - SvNumberFormatter* pFormatter ) const; + // Wang Xu Ming -- 2009-9-8 + // DataPilot Migration - Cache&&Performance + void FillColumnEntries( SCCOL nSourceDim, ScDPTableDataCache* pCahe , std::vector< SCROW >& rEntries, + const std::vector< SCROW >& rOriginal ) const; + // End Comments }; // -------------------------------------------------------------------- @@ -110,8 +116,10 @@ class ScDPGroupDimension String aGroupName; ScDPDateGroupHelper* pDateHelper; ScDPGroupItemVec aItems; - mutable TypedScStrCollection* pCollection; // collection of item names (cached) - + // Wang Xu Ming -- 2009-9-4 + // DataPilot Migration - Cache&&Performance + mutable ::std::vector< SCROW > maMemberEntries; + // End Comments public: ScDPGroupDimension( long nSource, const String& rNewName ); ScDPGroupDimension( const ScDPGroupDimension& rOther ); @@ -124,9 +132,12 @@ public: long GetSourceDim() const { return nSourceDim; } long GetGroupDim() const { return nGroupDim; } - const String& GetName() const { return aGroupName; } + const String& GetName() const { return aGroupName; } - const TypedScStrCollection& GetColumnEntries( const TypedScStrCollection& rOriginal, ScDocument* pDoc ) const; +// Wang Xu Ming -- 2009-9-2 +// DataPilot Migration - Cache&&Performance + const std::vector< SCROW >& GetColumnEntries( const ScDPCacheTable& rCacheTable, const std::vector< SCROW >& rOriginal ) const; +// End Comments const ScDPGroupItem* GetGroupForData( const ScDPItemData& rData ) const; // rData = entry in original dim. const ScDPGroupItem* GetGroupForName( const ScDPItemData& rName ) const; // rName = entry in group dim. const ScDPGroupItem* GetGroupByIndex( size_t nIndex ) const; @@ -148,7 +159,10 @@ class SC_DLLPUBLIC ScDPNumGroupDimension { ScDPNumGroupInfo aGroupInfo; // settings ScDPDateGroupHelper* pDateHelper; - mutable TypedScStrCollection* pCollection; // collection of item names (cached) +// Wang Xu Ming -- 2009-9-4 +// DataPilot Migration - Cache&&Performance + mutable ::std::vector< SCROW > maMemberEntries; +// End Comments mutable bool bHasNonInteger; // initialized in GetNumEntries mutable sal_Unicode cDecSeparator; // initialized in GetNumEntries @@ -160,14 +174,15 @@ public: ScDPNumGroupDimension& operator=( const ScDPNumGroupDimension& rOther ); - const TypedScStrCollection& GetNumEntries( const TypedScStrCollection& rOriginal, ScDocument* pDoc ) const; - const ScDPNumGroupInfo& GetInfo() const { return aGroupInfo; } bool HasNonInteger() const { return bHasNonInteger; } sal_Unicode GetDecSeparator() const { return cDecSeparator; } const ScDPDateGroupHelper* GetDateHelper() const { return pDateHelper; } + const std::vector< SCROW >& GetNumEntries( SCCOL nSourceDim, ScDPTableDataCache* pCache, + const std::vector< SCROW >& rOriginal ) const; + void MakeDateHelper( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart ); void DisposeData(); @@ -189,7 +204,11 @@ class ScDPGroupTableData : public ScDPTableData ScDocument* pDoc; StringHashSet aGroupNames; - void FillGroupValues( ScDPItemData* pItemData, long nCount, const long* pDims ); +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + void FillGroupValues( SCROW* pItemDataIndex, long nCount, const long* pDims ); + virtual long GetSourceDim( long nDim ); +// End Comments void CopyFields(const ::std::vector& rFieldDims, ::std::vector& rNewFieldDims); bool IsNumGroupDimension( long nDimension ) const; @@ -210,11 +229,18 @@ public: ScDocument* GetDocument() { return pDoc; } virtual long GetColumnCount(); - virtual const TypedScStrCollection& GetColumnEntries(long nColumn); +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + virtual long GetMembersCount( long nDim ); + virtual const std::vector< SCROW >& GetColumnEntries( long nColumn ) ; + virtual const ScDPItemData* GetMemberById( long nDim, long nId); + virtual long Compare( long nDim, long nDataId1, long nDataId2); + +// End Comments virtual String getDimensionName(long nColumn); virtual BOOL getIsDataLayoutDimension(long nColumn); virtual BOOL IsDateDimension(long nDim); - virtual UINT32 GetNumberFormat(long nDim); + virtual ULONG GetNumberFormat(long nDim); virtual void DisposeData(); virtual void SetEmptyFlags( BOOL bIgnoreEmptyRows, BOOL bRepeatIfEmpty ); diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 2dc8829485c8..40f8e75676d5 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -110,8 +110,18 @@ private: SC_DLLPRIVATE void CreateObjects(); SC_DLLPRIVATE void CreateOutput(); + BOOL bRefresh; + long mnCacheId; public: + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + inline void SetRefresh() { bRefresh = TRUE; } + const ScDPTableDataCache* GetCache() const; + long GetCacheId() const; + void SetCacheId( long nCacheId ); + ULONG RefreshCache(); + // End Comments ScDPObject( ScDocument* pD ); ScDPObject(const ScDPObject& r); virtual ~ScDPObject(); @@ -237,19 +247,6 @@ public: PivotField* pRefPageFields = NULL, SCSIZE nRefPageCount = 0 ); }; -// ============================================================================ - -struct ScDPCacheCell -{ - sal_Int32 mnStrId; - sal_uInt8 mnType; - double mfValue; - bool mbNumeric; - - ScDPCacheCell(); - ScDPCacheCell(const ScDPCacheCell& r); - ~ScDPCacheCell(); -}; // ============================================================================ @@ -257,20 +254,6 @@ class ScDPCollection : public ScCollection { private: ScDocument* pDoc; - ScSimpleSharedString maSharedString; - - struct CacheCellHash - { - size_t operator()(const ScDPCacheCell* pCell) const; - }; - struct CacheCellEqual - { - bool operator()(const ScDPCacheCell* p1, const ScDPCacheCell* p2) const; - }; - typedef ::std::hash_set CacheCellPoolType; - - CacheCellPoolType maCacheCellPool; - public: ScDPCollection(ScDocument* pDocument); ScDPCollection(const ScDPCollection& r); @@ -289,10 +272,7 @@ public: String CreateNewName( USHORT nMin = 1 ) const; - ScSimpleSharedString& GetSharedString(); - ScDPCacheCell* getCacheCellFromPool(const ScDPCacheCell& rCell); - void clearCacheCellPool(); }; diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index d3d8d4354145..40bca2faaa6c 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -83,6 +83,9 @@ public: }; +bool operator == (const ::com::sun::star::sheet::DataPilotFieldSortInfo &l, const ::com::sun::star::sheet::DataPilotFieldSortInfo &r ); +bool operator == (const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &l, const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &r ); +bool operator == (const ::com::sun::star::sheet::DataPilotFieldReference &l, const ::com::sun::star::sheet::DataPilotFieldReference &r ); class ScDPSaveDimension { private: @@ -164,6 +167,9 @@ public: void WriteToSource( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface>& xDim ); + void Refresh( const com::sun::star::uno::Reference< + com::sun::star::sheet::XDimensionsSupplier>& xSource , + const std::list & deletedDims); }; @@ -178,7 +184,10 @@ private: USHORT nRepeatEmptyMode; BOOL bFilterButton; // not passed to DataPilotSource BOOL bDrillDown; // not passed to DataPilotSource - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + long mnCacheId; + // End Comments public: SC_DLLPUBLIC ScDPSaveData(); ScDPSaveData(const ScDPSaveData& r); @@ -222,10 +231,15 @@ public: BOOL GetDrillDown() const { return bDrillDown; } void WriteToSource( const com::sun::star::uno::Reference< + com::sun::star::sheet::XDimensionsSupplier>& xSource ); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + void Refresh( const com::sun::star::uno::Reference< com::sun::star::sheet::XDimensionsSupplier>& xSource ); - BOOL IsEmpty() const; - + inline long GetCacheId() const{ return mnCacheId; } + inline void SetCacheId( long nCacheId ){ mnCacheId = nCacheId; } + // End Comments const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; } SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied diff --git a/sc/inc/dpsdbtab.hxx b/sc/inc/dpsdbtab.hxx index b837b5811aad..38ddc3380ab1 100644 --- a/sc/inc/dpsdbtab.hxx +++ b/sc/inc/dpsdbtab.hxx @@ -58,23 +58,25 @@ struct ScImportSourceDesc aObject == rOther.aObject && nType == rOther.nType && bNative == rOther.bNative; } -}; -class ScDatabaseDPData_Impl; + // Wang Xu Ming -- 2009-9-15 + // DataPilot Migration - Cache&&Performance + ScDPTableDataCache* GetExistDPObjectCache( ScDocument* pDoc ) const; + ScDPTableDataCache* CreateCache( ScDocument* pDoc , long nID ) const; + ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const; + long GetCacheId( ScDocument* pDoc, long nID ) const; + // End Comments +}; class ScDatabaseDPData : public ScDPTableData { private: - ScDatabaseDPData_Impl* pImpl; - - BOOL OpenDatabase(); - + ScDPCacheTable aCacheTable; public: - ScDatabaseDPData(ScDocument* pDoc, const ScImportSourceDesc& rImport); + ScDatabaseDPData(ScDocument* pDoc, const ScImportSourceDesc& rImport, long nCacheId = -1); virtual ~ScDatabaseDPData(); virtual long GetColumnCount(); - virtual const TypedScStrCollection& GetColumnEntries(long nColumn); virtual String getDimensionName(long nColumn); virtual BOOL getIsDataLayoutDimension(long nColumn); virtual BOOL IsDateDimension(long nDim); diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx index 0bcdbeee517e..d90b1fdb6cf5 100644 --- a/sc/inc/dpshttab.hxx +++ b/sc/inc/dpshttab.hxx @@ -43,8 +43,10 @@ namespace com { namespace sun { namespace star { namespace sheet { }}}} class ScDPDimension; -struct ScDPItemData; - +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +class ScDPItemData; +// End Comments // -------------------------------------------------------------------- // // implementation of ScDPTableData with sheet data @@ -58,25 +60,38 @@ struct ScSheetSourceDesc BOOL operator== ( const ScSheetSourceDesc& rOther ) const { return aSourceRange == rOther.aSourceRange && aQueryParam == rOther.aQueryParam; } +// Wang Xu Ming - DataPilot migration +// Buffer&&Performance + ScDPTableDataCache* CreateCache( ScDocument* pDoc, long nID = -1) const; + ULONG CheckValidate( ScDocument* pDoc ) const; + ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const; + ScDPTableDataCache* GetExistDPObjectCache ( ScDocument* pDoc ) const; + long GetCacheId( ScDocument* pDoc, long nID ) const; + +// End Comments }; -class ScSheetDPData_Impl; - class SC_DLLPUBLIC ScSheetDPData : public ScDPTableData { private: - ScSheetDPData_Impl* pImpl; + ScQueryParam aQuery; + BOOL* pSpecial; + BOOL bIgnoreEmptyRows; + BOOL bRepeatIfEmpty; + + ScDPCacheTable aCacheTable; public: - ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc ); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc, long nCacheId = -1 ); virtual ~ScSheetDPData(); - + // End Comments virtual long GetColumnCount(); - virtual const TypedScStrCollection& GetColumnEntries(long nColumn); virtual String getDimensionName(long nColumn); virtual BOOL getIsDataLayoutDimension(long nColumn); virtual BOOL IsDateDimension(long nDim); - virtual UINT32 GetNumberFormat(long nDim); + virtual ULONG GetNumberFormat(long nDim); virtual void DisposeData(); virtual void SetEmptyFlags( BOOL bIgnoreEmptyRows, BOOL bRepeatIfEmpty ); diff --git a/sc/inc/dptabdat.hxx b/sc/inc/dptabdat.hxx index 46c26b3f0bbe..40114a64cacf 100644 --- a/sc/inc/dptabdat.hxx +++ b/sc/inc/dptabdat.hxx @@ -34,7 +34,10 @@ #include "address.hxx" #include "dpoutput.hxx" #include "dpcachetable.hxx" - +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +#include "dptablecache.hxx" +// End Comments #include #include @@ -46,8 +49,6 @@ namespace com { namespace sun { namespace star { namespace sheet { struct DataPilotFieldFilter; }}}} -class TypedScStrCollection; -class ScSimpleSharedString; // ----------------------------------------------------------------------- @@ -74,28 +75,6 @@ class ScSimpleSharedString; // base class ScDPTableData to allow implementation with tabular data // by deriving only of this // - -struct ScDPItemData -{ - String aString; - double fValue; - BOOL bHasValue; - - ScDPItemData() : fValue(0.0), bHasValue(FALSE) {} - ScDPItemData( const String& rS, double fV = 0.0, BOOL bHV = FALSE ) : - aString(rS), fValue(fV), bHasValue( bHV ) {} - - void SetString( const String& rS ) { aString = rS; bHasValue = FALSE; } - BOOL IsCaseInsEqual( const ScDPItemData& r ) const; - - size_t Hash() const; - - // exact equality - BOOL operator==( const ScDPItemData& r ) const; - // case insensitive equality - static sal_Int32 Compare( const ScDPItemData& rA, const ScDPItemData& rB ); -}; - #define SC_VALTYPE_EMPTY 0 #define SC_VALTYPE_VALUE 1 #define SC_VALTYPE_STRING 2 @@ -116,15 +95,18 @@ class ScDPInitState; class ScDPResultMember; class ScDocument; -class ScDPTableData + class SC_DLLPUBLIC ScDPTableData { // cached data for GetDatePart long nLastDateVal; long nLastHier; long nLastLevel; long nLastRet; - ScSimpleSharedString& mrSharedString; - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + long mnCacheId; + const ScDocument* mpDoc; + // End Comments public: /** This structure stores dimension information used when calculating @@ -150,7 +132,10 @@ public: CalcInfo(); }; - ScDPTableData(ScDocument* pDoc); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPTableData(ScDocument* pDoc, long nCacheId ); + // End Comments virtual ~ScDPTableData(); long GetDatePart( long nDateVal, long nHierarchy, long nLevel ); @@ -159,11 +144,16 @@ public: //! or separate Str and ValueCollection virtual long GetColumnCount() = 0; - virtual const TypedScStrCollection& GetColumnEntries(long nColumn) = 0; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + virtual const std::vector< SCROW >& GetColumnEntries( long nColumn ) ; + long GetCacheId() const; + // End Comments virtual String getDimensionName(long nColumn) = 0; virtual BOOL getIsDataLayoutDimension(long nColumn) = 0; virtual BOOL IsDateDimension(long nDim) = 0; - virtual UINT32 GetNumberFormat(long nDim); + virtual ULONG GetNumberFormat(long nDim); + virtual UINT32 GetNumberFormatByIdx( NfIndexTableOffset ); virtual void DisposeData() = 0; virtual void SetEmptyFlags( BOOL bIgnoreEmptyRows, BOOL bRepeatIfEmpty ) = 0; @@ -179,23 +169,33 @@ public: // overloaded in ScDPGroupTableData: virtual BOOL IsBaseForGroup(long nDim) const; - virtual long GetGroupBase(long nGroupDim) const; + virtual long GetGroupBase(long nGroupDim) const; virtual BOOL IsNumOrDateGroup(long nDim) const; virtual BOOL IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex, const ScDPItemData& rBaseData, long nBaseIndex ) const; virtual BOOL HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, const ScDPItemData& rSecondData, long nSecondIndex ) const; - ScSimpleSharedString& GetSharedString(); - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + virtual long GetMembersCount( long nDim ); + virtual const ScDPItemData* GetMemberByIndex( long nDim, long nIndex ); + virtual const ScDPItemData* GetMemberById( long nDim, long nId); + virtual SCROW GetIdOfItemData( long nDim, const ScDPItemData& rData ); + virtual long GetSourceDim( long nDim ); + virtual long Compare( long nDim, long nDataId1, long nDataId2); + // End Comments protected: /** This structure stores vector arrays that hold intermediate data for each row during cache table iteration. */ struct CalcRowData { - ::std::vector aColData; - ::std::vector aRowData; - ::std::vector aPageData; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ::std::vector< SCROW > aColData; + ::std::vector< SCROW > aRowData; + ::std::vector< SCROW > aPageData; + // End Comments ::std::vector aValues; }; @@ -204,10 +204,11 @@ protected: void CalcResultsFromCacheTable(const ScDPCacheTable& rCacheTable, CalcInfo& rInfo, bool bAutoShow); private: + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance void GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRow, - const ::std::vector& rDims, ::std::vector& rItemData); + const ::std::vector& rDims, ::std::vector< SCROW >& rItemData); + // End Comments }; - - #endif diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx new file mode 100644 index 000000000000..a9449c573f8c --- /dev/null +++ b/sc/inc/dptablecache.hxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009. + * Copyright 2009 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: dptablecache.hxx,v $ + * $Revision: 1.0 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef DPTABLECACHE_HXX +#define DPTABLECACHE_HXX +// Wang Xu Ming -- 12/21/2008 +// Add Data Cache Support. +#ifndef SC_SCGLOB_HXX +#include "global.hxx" +#endif +//Added by PengYunQuan for SODC_16015 +#include +//end +#include +#include "dpglobal.hxx" + +#include +#include +#include + +class ScDPTableDataCache; +class TypedStrData; +// -------------------------------------------------------------------- +// +// base class ScDPTableData to allow implementation with tabular data +// by deriving only of this +// + +class SC_DLLPUBLIC ScDPTableDataCache +{ + long mnID; + ScDocument* mpDoc; + + long mnColumnCount; // Column count + + std::vector* mpTableDataValues; //Data Pilot Table's index - value map + std::vector* mpSourceData; //Data Pilot Table's Source data + std::vector* mpGlobalOrder; //Sorted members index + std::vector* mpIndexOrder; //Index the sorted number + std::vector mrLabelNames; //Source Label data + std::vector mbEmptyRow; //If empty row? + mutable ScDPItemDataPool maAdditionalDatas; +public: + SCROW GetOrder( long nDim, SCROW nIndex ) const; + SCROW GetIdByItemData( long nDim, String sItemData ) const; + SCROW GetIdByItemData( long nDim, const ScDPItemData& rData ) const; + + SCROW GetAdditionalItemID ( String sItemData ); + SCROW GetAdditionalItemID( const ScDPItemData& rData ); + + SCCOL GetDimensionIndex( String sName) const; + const ScDPItemData* GetSortedItemData( SCCOL nDim, SCROW nOrder ) const; + ULONG GetNumType ( ULONG nFormat ) const; + ULONG GetNumberFormat( long nDim ) const; + BOOL IsDateDimension( long nDim ) const ; + ULONG GetDimNumType( SCCOL nDim) const; + SCROW GetDimMemberCount( SCCOL nDim ) const; + + SCROW GetSortedItemDataId( SCCOL nDim, SCROW nOrder ) const; + const std::vector& GetDimMemberValues( SCCOL nDim )const; + void SetId( long nId ){ mnID = nId;} + void AddRow( ScDPItemData* pRow, USHORT nCount ); + bool InitFromDoc( ScDocument* pDoc, const ScRange& rRange ); + bool InitFromDataBase (const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& xRowSet, const Date& rNullDate); + + SCROW GetRowCount() const; + SCROW GetItemDataId( USHORT nDim, SCROW nRow, BOOL bRepeatIfEmpty ) const; + String GetDimensionName( USHORT nColumn ) const; + bool IsEmptyMember( SCROW nRow, USHORT nColumn ) const; + bool IsRowEmpty( SCROW nRow ) const; + bool IsValid() const; + bool ValidQuery( SCROW nRow, const ScQueryParam& rQueryParam, BOOL* pSpecial ); + + ScDocument* GetDoc() const;//ms-cache-core + long GetColumnCount() const; + long GetId() const; + + const ScDPItemData* GetItemDataById( long nDim, SCROW nId ) const; + + BOOL operator== ( const ScDPTableDataCache& r ) const; + +//construction + ScDPTableDataCache( ScDocument* pDoc ); +//deconstruction + virtual ~ScDPTableDataCache(); + +protected: +private: + void AddLabel( ScDPItemData* pData); + BOOL AddData( long nDim, ScDPItemData* itemData ); +}; + +#endif //DPTABLECACHE_HXX diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx index 6dfb782b2313..4b4756a04aeb 100644 --- a/sc/inc/dptabres.hxx +++ b/sc/inc/dptabres.hxx @@ -59,8 +59,10 @@ class ScDPResultMember; class ScDPResultVisibilityData; struct ScDPValueData; -struct ScDPItemData; - +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +class ScDPItemData; +// End Comments // // Member names that are being processed for InitFrom/LateInitFrom // (needed for initialization of grouped items) @@ -69,21 +71,26 @@ struct ScDPItemData; class ScDPInitState { long* pIndex; // array - ScDPItemData* pData; // array +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + SCROW* pData; // array + // End Comments long nCount; public: ScDPInitState(); ~ScDPInitState(); - void AddMember( long nSourceIndex, const ScDPItemData& rName ); + void AddMember( long nSourceIndex,SCROW nMember); void RemoveMember(); long GetCount() const { return nCount; } const long* GetSource() const { return pIndex; } - const ScDPItemData* GetNames() const { return pData; } - - const ScDPItemData* GetNameForIndex( long nIndexValue ) const; +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + const SCROW* GetNameIds() const { return pData; } + const SCROW GetNameIdForIndex( long nIndexValue ) const; +// End Comments }; typedef ::std::vector ScMemberSortOrder; @@ -232,6 +239,68 @@ class ScDPDataMember; #define SC_DPMEASURE_ALL -1 #define SC_DPMEASURE_ANY -2 +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + +struct MemberHashIndexFunc : public std::unary_function< const SCROW &, size_t > +{ + size_t operator() (const SCROW &rDataIndex) const { return rDataIndex; } +}; + +class ScDPParentDimData +{ +public: + const SCROW mnOrder; //! Ref + const ScDPDimension* mpParentDim; //! Ref + const ScDPLevel* mpParentLevel; //! Ref + const ScDPMember* mpMemberDesc; //! Ref + + ScDPParentDimData():mnOrder(-1), mpParentDim( NULL), mpParentLevel( NULL ), mpMemberDesc( NULL ){} + ScDPParentDimData( const SCROW nIndex, ScDPDimension* pDim, const ScDPLevel* pLev, const ScDPMember* pMember ): mnOrder( nIndex ), mpParentDim( pDim), mpParentLevel( pLev ), mpMemberDesc( pMember ){} +}; + +typedef std::vector DimMemberArray; +typedef std::hash_map < SCROW, ScDPParentDimData *, MemberHashIndexFunc> DimMemberHash; + +class ResultMembers +{ + DimMemberHash maMemberHash; + BOOL mbHasHideDetailsMember; +public: + ScDPParentDimData* FindMember( const SCROW& nIndex ) const; + void InsertMember( ScDPParentDimData* pNew ); + BOOL IsHasHideDetailsMembers() const { return mbHasHideDetailsMember; } + void SetHasHideDetailsMembers( BOOL b ) { mbHasHideDetailsMember=b; } + ResultMembers(); + virtual ~ResultMembers(); +}; + +class LateInitParams +{ +private: + const ::std::vector& mppDim; + const ::std::vector& mppLev; + + BOOL mbRow; + BOOL mbInitChild; + BOOL mbAllChildren; +public: + LateInitParams( const ::std::vector& ppDim, const ::std::vector& ppLev, + BOOL bRow, BOOL bInitChild = TRUE , BOOL bAllChildren = FALSE); + ~LateInitParams(); + + void SetInitChild( BOOL b ) { mbInitChild = b; } + void SetInitAllChildren( BOOL b ) { mbAllChildren = b; } + + inline ScDPDimension* GetDim( size_t nPos ) const { return mppDim[nPos];} + inline ScDPLevel* GetLevel( size_t nPos ) const { return mppLev[nPos];} + + inline BOOL GetInitChild() const {return mbInitChild; } + inline BOOL GetInitAllChild() const { return mbAllChildren; } + inline BOOL IsRow() const { return mbRow; } + BOOL IsEnd( size_t nPos ) const ; +}; +// End Comments class ScDPResultData { @@ -249,7 +318,7 @@ private: BOOL bDataAtRow; //! add "displayed values" settings - + mutable std::vector< ResultMembers* > mpDimMembers; public: ScDPResultData( ScDPSource* pSrc ); //! Ref ~ScDPResultData(); @@ -280,10 +349,18 @@ public: BOOL IsBaseForGroup( long nDim ) const; // any group long GetGroupBase( long nGroupDim ) const; BOOL IsNumOrDateGroup( long nDim ) const; + // Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance BOOL IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex, - const ScDPItemData& rBaseData, long nBaseIndex ) const; - BOOL HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, + long nBaseDataId, long nBaseIndex ) const; + BOOL IsInGroup( SCROW nGroupDataId, long nGroupIndex, + const ScDPItemData& rBaseData, long nBaseIndex ) const; + BOOL HasCommonElement( SCROW nFirstDataId, long nFirstIndex, const ScDPItemData& rSecondData, long nSecondIndex ) const; + + ResultMembers* GetDimResultMembers( long nDim , ScDPDimension* pDim , ScDPLevel* pLevel) const ; + +// End Comments }; @@ -291,9 +368,10 @@ class ScDPResultMember { private: const ScDPResultData* pResultData; - const ScDPDimension* pParentDim; //! Ref - const ScDPLevel* pParentLevel; //! Ref - const ScDPMember* pMemberDesc; //! Ref + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPParentDimData aParentDimData; + // End Comments ScDPResultDimension* pChildDimension; ScDPDataMember* pDataRoot; BOOL bHasElements; @@ -303,21 +381,30 @@ private: BOOL bAutoHidden; ScDPAggData aColTotal; // to store column totals + USHORT nMemberStep; // step to show details public: - ScDPResultMember( const ScDPResultData* pData, const ScDPDimension* pDim, - const ScDPLevel* pLev, const ScDPMember* pDesc, - BOOL bForceSub ); //! Ref - ~ScDPResultMember(); - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPResultMember( const ScDPResultData* pData, const ScDPParentDimData& rParentDimData, + BOOL bForceSub ); //! Ref + ScDPResultMember( const ScDPResultData* pData, BOOL bForceSub ); + // End Comments + ~ScDPResultMember(); + + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance void InitFrom( const ::std::vector& ppDim, - const ::std::vector& ppLev, - size_t nPos, - ScDPInitState& rInitState ); - void LateInitFrom( const ::std::vector& ppDim, - const ::std::vector& ppLev, - const ::std::vector& pItemData, - size_t nPos, - ScDPInitState& rInitState ); + const ::std::vector& ppLev, + size_t nPos, + ScDPInitState& rInitState, + BOOL bInitChild = TRUE ); + void LateInitFrom( + LateInitParams& rParams, + const ::std::vector< SCROW >& pItemData, + size_t nPos, + ScDPInitState& rInitState); + void CheckShowEmpty( BOOL bShow = FALSE ); + // End Comments String GetName() const; void FillItemData( ScDPItemData& rData ) const; BOOL IsValid() const; @@ -329,17 +416,22 @@ public: // BOOL SubTotalEnabled() const; long GetSubTotalCount( long* pUserSubStart = NULL ) const; - BOOL IsNamedItem( const ScDPItemData& r ) const; - bool IsValidEntry( const ::std::vector& aMembers ) const; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + BOOL IsNamedItem( SCROW nIndex ) const; + bool IsValidEntry( const ::std::vector< SCROW >& aMembers ) const; + // End Comments void SetHasElements() { bHasElements = TRUE; } void SetAutoHidden() { bAutoHidden = TRUE; } - void ProcessData( const ::std::vector& aChildMembers, - const ScDPResultDimension* pDataDim, - const ::std::vector& aDataMembers, - const ::std::vector& aValues ); - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + void ProcessData( const ::std::vector& aChildMembers, + const ScDPResultDimension* pDataDim, + const ::std::vector& aDataMembers, + const ::std::vector& aValues ); + // End Comments void FillMemberResults( com::sun::star::uno::Sequence< com::sun::star::sheet::MemberResult>* pSequences, long& rPos, long nMeasure, BOOL bRoot, @@ -369,9 +461,15 @@ public: ScDPDataMember* GetDataRoot() const { return pDataRoot; } - const ScDPDimension* GetParentDim() const { return pParentDim; } //! Ref - const ScDPLevel* GetParentLevel() const { return pParentLevel; } //! Ref - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + const ScDPDimension* GetParentDim() const { return aParentDimData.mpParentDim; } //! Ref + const ScDPLevel* GetParentLevel() const { return aParentDimData.mpParentLevel; } //! Ref + const ScDPMember* GetDPMember()const { return aParentDimData.mpMemberDesc; } //! Ref + inline SCROW GetOrder() const { return aParentDimData.mnOrder; } //! Ref + inline BOOL IsRoot() const { return GetParentLevel() == NULL; } + SCROW GetDataId( ) const ; + // End Comments ScDPAggData* GetColTotal( long nMeasure ) const; void FillVisibilityData(ScDPResultVisibilityData& rData) const; @@ -397,13 +495,17 @@ public: BOOL IsVisible() const; BOOL HasData( long nMeasure, const ScDPSubTotalState& rSubState ) const; - BOOL IsNamedItem( const ScDPItemData& r ) const; - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + BOOL IsNamedItem( SCROW r ) const; + // End Comments BOOL HasHiddenDetails() const; - void ProcessData( const ::std::vector& aChildMembers, const ::std::vector& aValues, - const ScDPSubTotalState& rSubState ); - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + void ProcessData( const ::std::vector< SCROW >& aChildMembers, const ::std::vector& aValues, + const ScDPSubTotalState& rSubState ); + // End Comments BOOL HasError( long nMeasure, const ScDPSubTotalState& rSubState ) const; double GetAggregate( long nMeasure, const ScDPSubTotalState& rSubState ) const; const ScDPAggData* GetConstAggData( long nMeasure, const ScDPSubTotalState& rSubState ) const; @@ -443,15 +545,13 @@ SV_DECL_PTRARR_DEL(ScDPDataMembers, ScDPDataMemberPtr, SC_DP_RES_GROW, SC_DP_RES class ScDPResultDimension { public : - struct MemberHashFunc : public std::unary_function< const ScDPItemData &, size_t > - { - size_t operator() (const ScDPItemData &rData) const { return rData.Hash(); } - }; - typedef std::vector MemberArray; - typedef std::hash_map MemberHash; - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + typedef std::vector MemberArray; + typedef std::map < SCROW , ScDPResultMember *> MemberHash; + // End Comments private: - const ScDPResultData* pResultData; + const ScDPResultData* pResultData; MemberArray maMemberArray; MemberHash maMemberHash; BOOL bInitialized; @@ -466,31 +566,47 @@ private: long nAutoMeasure; long nAutoCount; - ScDPResultMember* FindMember( const ScDPItemData& rData ) const; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPResultMember* FindMember( SCROW iData ) const; + ScDPResultMember* AddMember( const ScDPParentDimData& aData ); + ScDPResultMember* InsertMember( ScDPParentDimData* pMemberData ); + ResultMembers* GetResultMember( ScDPDimension* pDim, ScDPLevel* pLevel ); + void InitWithMembers( LateInitParams& rParams, + const ::std::vector< SCROW >& pItemData, + size_t nPos, + ScDPInitState& rInitState ); + // End Comments public: - ScDPResultDimension( const ScDPResultData* pData ); - ~ScDPResultDimension(); + ScDPResultDimension( const ScDPResultData* pData ); + ~ScDPResultDimension(); // allocates new members + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance void InitFrom( const ::std::vector& ppDim, - const ::std::vector& ppLev, - size_t nPos, - ScDPInitState& rInitState ); - void LateInitFrom( const ::std::vector& ppDim, - const ::std::vector& ppLev, - const ::std::vector& pItemData, - size_t nPos, - ScDPInitState& rInitState ); - + const ::std::vector& ppLev, + size_t nPos, + ScDPInitState& rInitState , BOOL bInitChild = TRUE ); + void LateInitFrom( LateInitParams& rParams, + const ::std::vector< SCROW >& pItemData, + size_t nPos, + ScDPInitState& rInitState ); + void CheckShowEmpty( BOOL bShow = FALSE ); + + // End Comments long GetSize(long nMeasure) const; - bool IsValidEntry( const ::std::vector& aMembers ) const; - // modifies existing members, allocates data dimensions - void ProcessData( const ::std::vector& aMembers, + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + bool IsValidEntry( const ::std::vector& aMembers ) const; + + // modifies existing members, allocates data dimensions + void ProcessData( const ::std::vector& aMembers, const ScDPResultDimension* pDataDim, - const ::std::vector& aDataMembers, + const ::std::vector& aDataMembers, const ::std::vector& aValues ) const; //! Test - + // End Comments void FillMemberResults( com::sun::star::uno::Sequence< com::sun::star::sheet::MemberResult>* pSequences, long nStart, long nMeasure ); @@ -560,9 +676,11 @@ public: ~ScDPDataDimension(); void InitFrom( const ScDPResultDimension* pDim ); // recursive - void ProcessData( const ::std::vector& aDataMembers, const ::std::vector& aValues, - const ScDPSubTotalState& rSubState ); - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + void ProcessData( const ::std::vector< SCROW >& aDataMembers, const ::std::vector& aValues, + const ScDPSubTotalState& rSubState ); + // End Comments void FillDataRow( const ScDPResultDimension* pRefDim, com::sun::star::uno::Sequence& rSequence, long nCol, long nMeasure, BOOL bIsSubTotalRow, @@ -596,7 +714,10 @@ public: class ScDPResultVisibilityData { public: - ScDPResultVisibilityData(ScSimpleSharedString& rSharedString, ScDPSource* pSource); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPResultVisibilityData( ScDPSource* pSource); + // End Comments ~ScDPResultVisibilityData(); void addVisibleMember(const String& rDimName, const ScDPItemData& rMemberItem); @@ -611,7 +732,6 @@ private: typedef ::std::hash_map DimMemberType; DimMemberType maDimensions; - ScSimpleSharedString& mrSharedString; ScDPSource* mpSource; }; diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 3b1d8e0e206e..3ed2f6a754a0 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -33,6 +33,10 @@ #include #include +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +#include +// End Comments #include #include #include "global.hxx" // enum ScSubTotalFunc @@ -59,7 +63,10 @@ #include #include #include - +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +#include "dpglobal.hxx" +// End Comments #include "dptabdat.hxx" namespace com { namespace sun { namespace star { @@ -73,7 +80,10 @@ namespace com { namespace sun { namespace star { class ScDPResultMember; class ScDPResultData; -struct ScDPItemData; +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance +class ScDPItemData; +// End Comments class ScDPTableData; // ------------------------------------------------------------------------ @@ -168,10 +178,18 @@ public: long GetDataDimensionCount(); String GetDataDimName(long nIndex); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPTableDataCache* GetCache(); + const ScDPItemData* GetItemDataById( long nDim, long nId ); + long GetDataLayoutDim(){ return pData->GetColumnCount(); } + SCROW GetMemberId( long nDim, const ScDPItemData& rData ); + // End Comments BOOL IsDataLayoutDimension(long nDim); USHORT GetDataLayoutOrientation(); BOOL IsDateDimension(long nDim); + UINT32 GetNumberFormat(long nDim); BOOL SubTotalAllowed(long nColumn); //! move to ScDPResultData @@ -429,6 +447,10 @@ public: const ::com::sun::star::sheet::DataPilotFieldReference& GetReferenceValue() const; //UNUSED2009-05 BOOL IsValidPage( const ScDPItemData& rData ); +// Wang Xu Ming -- 2009-8-17 +// DataPilot Migration - Cache&&Performance + BOOL IsVisible( const ScDPItemData& rData ); +// End Comments }; class ScDPHierarchies : public cppu::WeakImplHelper2< @@ -722,6 +744,12 @@ public: long getMinMembers() const; sal_Int32 GetIndexFromName( const ::rtl::OUString& rName ) const; // <0 if not found + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + const std::vector& GetGlobalOrder(); + const ScDPItemData* GetSrcItemDataByIndex( SCROW nIndex); + SCROW GetSrcItemsCount(); + // End Comments }; class ScDPMember : public cppu::WeakImplHelper3< @@ -735,7 +763,10 @@ private: long nHier; long nLev; - ScDPItemData maData; + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + SCROW mnDataId; + // End Comments // String aCaption; // visible name (changeable by user) sal_Int32 nPosition; // manual sorting @@ -743,14 +774,23 @@ private: BOOL bShowDet; public: - ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, - const String& rN, double fV, BOOL bHV ); + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, + SCROW nIndex /*const String& rN, double fV, BOOL bHV */); + // End Comments virtual ~ScDPMember(); BOOL IsNamedItem( const ScDPItemData& r ) const; String GetNameStr() const; void FillItemData( ScDPItemData& rData ) const; - + // Wang Xu Ming -- 2009-8-17 + // DataPilot Migration - Cache&&Performance + // const ScDPItemData& GetItemData() const{ return maData; } + const ScDPItemData& GetItemData() const; + inline SCROW GetItemDataId() const { return mnDataId; } + BOOL IsNamedItem( SCROW nIndex ) const; + // End Comments sal_Int32 Compare( const ScDPMember& rOther ) const; // visible order // XNamed diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 1f6dc13d04ce..0a694b2fe922 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -763,21 +763,6 @@ enum ScSubTotalFunc }; -#define PIVOT_MAXFUNC 11 -#define PIVOT_FUNC_NONE 0x0000 -#define PIVOT_FUNC_SUM 0x0001 -#define PIVOT_FUNC_COUNT 0x0002 -#define PIVOT_FUNC_AVERAGE 0x0004 -#define PIVOT_FUNC_MAX 0x0008 -#define PIVOT_FUNC_MIN 0x0010 -#define PIVOT_FUNC_PRODUCT 0x0020 -#define PIVOT_FUNC_COUNT_NUM 0x0040 -#define PIVOT_FUNC_STD_DEV 0x0080 -#define PIVOT_FUNC_STD_DEVP 0x0100 -#define PIVOT_FUNC_STD_VAR 0x0200 -#define PIVOT_FUNC_STD_VARP 0x0400 -#define PIVOT_FUNC_AUTO 0x1000 - // ----------------------------------------------------------------------- /* @@ -848,7 +833,7 @@ public: ~ScQueryParam(); SCSIZE GetEntryCount() const { return nEntryCount; } - ScQueryEntry& GetEntry(SCSIZE n) const { return pEntries[n]; } + ScQueryEntry& GetEntry(SCSIZE n) const; void Resize(SCSIZE nNew); ScQueryParam& operator= ( const ScQueryParam& r ); @@ -921,46 +906,6 @@ struct ScConsolidateParam void SetAreas ( ScArea* const* ppAreas, USHORT nCount ); }; -// ----------------------------------------------------------------------- - -class ScSimpleSharedString -{ -public: - static const sal_Int32 EMPTY = 0; - - ScSimpleSharedString(); - ScSimpleSharedString(const ScSimpleSharedString& r); - ~ScSimpleSharedString(); - - const String* getString(sal_Int32 nId); - sal_Int32 getStringId(const String& aStr); - sal_Int32 insertString(const String& aStr); - -private: - - /** internal shared string table implementation */ - class StringTable - { - public: - sal_Int32 insertString(const String& aStr); - sal_Int32 getStringId(const String& aStr); - const String* getString(sal_Int32 nId) const; - - StringTable(); - StringTable(const StringTable& r); - ~StringTable(); - - private: - typedef ::std::hash_map< String, sal_Int32, ScStringHashCode, ::std::equal_to< String > > SharedStrMap; - - ::std::vector maSharedStrings; - SharedStrMap maSharedStringIds; - sal_Int32 mnStrCount; - }; - - StringTable maStringTable; -}; - // ----------------------------------------------------------------------- extern ::utl::TransliterationWrapper* GetScGlobalpTransliteration();//CHINA001 extern const LocaleDataWrapper* GetScGlobalpLocaleData(); diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 97d77dc06fc5..b4547d8e7eab 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -573,7 +573,10 @@ #define STR_STYLE_FAMILY_CELL 433 #define STR_STYLE_FAMILY_PAGE 434 -#define STR_COUNT 435 +#define STR_ERR_DATAPILOTSOURCE 435 +#define STR_PIVOT_FIRSTROWEMPTYERR 436 +#define STR_PIVOT_ONLYONEROWERR 437 +#define STR_COUNT 438 #endif diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index e77dd60f18bb..b192fc966f02 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -51,6 +51,7 @@ #include "global.hxx" #include "address.hxx" +#include "dpglobal.hxx" #include -- cgit From 7b04aa28fd016f7fd3ce439abfad6801893a5e15 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Fri, 5 Feb 2010 15:35:28 +0100 Subject: datapilotperf: adapted to m71 --- sc/inc/dptablecache.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx index a9449c573f8c..7b637bf04d6f 100644 --- a/sc/inc/dptablecache.hxx +++ b/sc/inc/dptablecache.hxx @@ -36,7 +36,7 @@ #include "global.hxx" #endif //Added by PengYunQuan for SODC_16015 -#include +#include //end #include #include "dpglobal.hxx" -- cgit From b68f583b6576249532cf6529dcbb383e06ad02c3 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 8 Feb 2010 18:55:57 +0100 Subject: datapilotperf: compile without warnings --- sc/inc/dpglobal.hxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx index c4089be762c0..7de5947cc969 100644 --- a/sc/inc/dpglobal.hxx +++ b/sc/inc/dpglobal.hxx @@ -59,7 +59,8 @@ #include -#define MAX_LABELS (MAXCOL+1) +// moved from fieldwnd.hxx, see also SC_DAPI_MAXFIELDS +#define MAX_LABELS 256 #define MAX_PAGEFIELDS 10 // maximum count of fields for page area @@ -126,7 +127,7 @@ private: friend class ScDPTableDataCache; public: - ScDPItemData() : fValue(0.0), nNumFormat( 0 ), mbFlag( 0 ){} + ScDPItemData() : nNumFormat( 0 ), fValue(0.0), mbFlag( 0 ){} ScDPItemData( ULONG nNF, const String & rS, double fV, BYTE bF ):nNumFormat(nNF), aString(rS), fValue(fV), mbFlag( bF ){} ScDPItemData( const String& rS, double fV = 0.0, BOOL bHV = FALSE, const ULONG nNumFormat = 0 , BOOL bData = TRUE) ; ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nDocTab ); -- cgit From 5a22073581287b47b79157bccf42e45a10d0bb3d Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Mon, 8 Mar 2010 16:33:48 +0100 Subject: chart43: #i29848# chart-copy references original data instead of copied data --- sc/inc/charthelper.hxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx index b4c677d7c3c6..4fad54851797 100644 --- a/sc/inc/charthelper.hxx +++ b/sc/inc/charthelper.hxx @@ -29,9 +29,11 @@ #define SC_CHARTHELPER_HXX #include +#include "address.hxx" class ScDocument; class ScAddress; +class ScRangeList; /** Use this to handle charts in a calc document */ @@ -40,6 +42,7 @@ class ScChartHelper public: static USHORT DoUpdateAllCharts( ScDocument* pDoc ); static USHORT DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc ); //use this to replace ScDBFunc::DoUpdateCharts in future + static void AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc, ScDocument* pDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab ); }; #endif -- cgit From 6264cb25992b722e1858c15c6da5b74ae865617e Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Tue, 9 Mar 2010 09:55:16 +0100 Subject: chart43: #i29848# chart-copy references original data instead of copied data --- sc/inc/charthelper.hxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx index 4fad54851797..561aa0026e60 100644 --- a/sc/inc/charthelper.hxx +++ b/sc/inc/charthelper.hxx @@ -30,10 +30,7 @@ #include #include "address.hxx" - -class ScDocument; -class ScAddress; -class ScRangeList; +#include "global.hxx" /** Use this to handle charts in a calc document */ -- cgit From 79e1f10909b23774b042cfc3cd03b46a0e6b6d84 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Tue, 9 Mar 2010 13:40:33 +0100 Subject: datapilotperf: 64-bit buildbot error --- sc/inc/dpglobal.hxx | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 sc/inc/dpglobal.hxx (limited to 'sc/inc') diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx old mode 100644 new mode 100755 -- cgit From b62a698b9c0795df73e720b4168e26c14939226d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 9 Mar 2010 09:38:03 -0500 Subject: kohei04: tab to whitespace & BOOL to bool etc to make MSVC compiler happy. --- sc/inc/attarray.hxx | 2 +- sc/inc/column.hxx | 2 +- sc/inc/document.hxx | 6 +++--- sc/inc/table.hxx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 5cbe1bafd290..b4595cc1093a 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -151,7 +151,7 @@ public: BOOL HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, BOOL bLeft, BOOL bRight ) const; - BOOL HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const; + bool HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const; BOOL ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, BOOL bRefresh, BOOL bAttrs ); diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index b69fcb384e04..05a641a01c50 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -145,7 +145,7 @@ public: //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 HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const; BOOL HasAttribSelection( const ScMarkData& rMark, USHORT nMask ) const; BOOL ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index cc575b529d73..d84fc36b6e76 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -817,9 +817,9 @@ public: BOOL IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; BOOL IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; - SC_DLLPUBLIC BOOL HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, USHORT nMask ); - SC_DLLPUBLIC BOOL HasAttrib( const ScRange& rRange, USHORT nMask ); + SC_DLLPUBLIC bool HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, USHORT nMask ); + SC_DLLPUBLIC bool HasAttrib( const ScRange& rRange, USHORT nMask ); void GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, const SvxBorderLine** ppLeft, diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index f400054d00b7..d54d9ae6a4a2 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -466,7 +466,7 @@ public: const SvxBorderLine** ppRight, const SvxBorderLine** ppBottom ) 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 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, SCCOL& rEndCol, SCROW& rEndRow, -- cgit From a4d17fb0d40f2dc13d073df9d38a54c1ff1f3d21 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Wed, 10 Mar 2010 10:07:29 +0100 Subject: chart43: cleanup some chart code --- sc/inc/charthelper.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx index 561aa0026e60..50b8586bdace 100644 --- a/sc/inc/charthelper.hxx +++ b/sc/inc/charthelper.hxx @@ -32,6 +32,10 @@ #include "address.hxx" #include "global.hxx" +#include + +class SdrObject; + /** Use this to handle charts in a calc document */ class ScChartHelper @@ -40,6 +44,11 @@ public: static USHORT DoUpdateAllCharts( ScDocument* pDoc ); static USHORT DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc ); //use this to replace ScDBFunc::DoUpdateCharts in future static void AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc, ScDocument* pDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab ); + static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartFromSdrObject( SdrObject* pObject ); + static void GetChartRanges( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc, + ::com::sun::star::uno::Sequence< rtl::OUString >& rRanges ); + static void SetChartRanges( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc, + const ::com::sun::star::uno::Sequence< rtl::OUString >& rRanges ); }; #endif -- cgit From 9a2eef45f7810c79706cb7945e53eb05a988af57 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 11 Mar 2010 07:40:20 +0100 Subject: dtardon02: #i108503# remove empty files in sc --- sc/inc/eetext.hxx | 33 ---------------- sc/inc/scimpexpmsg.hxx | 105 ------------------------------------------------- 2 files changed, 138 deletions(-) delete mode 100644 sc/inc/eetext.hxx delete mode 100644 sc/inc/scimpexpmsg.hxx (limited to 'sc/inc') diff --git a/sc/inc/eetext.hxx b/sc/inc/eetext.hxx deleted file mode 100644 index 28ee0d5f09b2..000000000000 --- a/sc/inc/eetext.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SC_EETEXT_HXX -#define SC_EETEXT_HXX - -#endif - - diff --git a/sc/inc/scimpexpmsg.hxx b/sc/inc/scimpexpmsg.hxx deleted file mode 100644 index 5574edd12083..000000000000 --- a/sc/inc/scimpexpmsg.hxx +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SC_SCIMPEXPMSG_HXX -#define SC_SCIMPEXPMSG_HXX - - -#include -#include - -//UNUSED2008-05 enum ScImpExpMsg -//UNUSED2008-05 { -//UNUSED2008-05 SC_IMPEXPMSG_UNKNOWN -//UNUSED2008-05 }; -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 class String; -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 class ScImpExpLogMsg -//UNUSED2008-05 { -//UNUSED2008-05 private: -//UNUSED2008-05 ScImpExpMsg eId; -//UNUSED2008-05 String* pPos; -//UNUSED2008-05 String* pHint; -//UNUSED2008-05 protected: -//UNUSED2008-05 public: -//UNUSED2008-05 ScImpExpLogMsg( ScImpExpMsg eId ); -//UNUSED2008-05 ScImpExpLogMsg( ScImpExpMsg eId, const String& rPosition ); -//UNUSED2008-05 ScImpExpLogMsg( ScImpExpMsg eId, const String& rPosition, const String& rAdditionalHint ); -//UNUSED2008-05 ScImpExpLogMsg( const ScImpExpLogMsg& rCpy ); -//UNUSED2008-05 virtual ~ScImpExpLogMsg(); -//UNUSED2008-05 -//UNUSED2008-05 ScImpExpLogMsg& operator =( const ScImpExpLogMsg& rCpy ); -//UNUSED2008-05 -//UNUSED2008-05 void Set( ScImpExpMsg eId, const String* pPos = NULL, const String* pHint = NULL ); -//UNUSED2008-05 -//UNUSED2008-05 inline ScImpExpMsg GetId( void ) const; -//UNUSED2008-05 inline const String* GetPos( void ) const; -//UNUSED2008-05 inline const String* GetHint( void ) const; -//UNUSED2008-05 -//UNUSED2008-05 static String GetMsg( ScImpExpMsg eId ); -//UNUSED2008-05 inline String GetMsg( void ) const; -//UNUSED2008-05 }; -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 inline ScImpExpLogMsg& ScImpExpLogMsg::operator =( const ScImpExpLogMsg& r ) -//UNUSED2008-05 { -//UNUSED2008-05 Set( r.eId, r.pPos, r.pHint ); -//UNUSED2008-05 return *this; -//UNUSED2008-05 } -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 inline ScImpExpMsg ScImpExpLogMsg::GetId( void ) const -//UNUSED2008-05 { -//UNUSED2008-05 return eId; -//UNUSED2008-05 } -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 inline const String* ScImpExpLogMsg::GetPos( void ) const -//UNUSED2008-05 { -//UNUSED2008-05 return pPos; -//UNUSED2008-05 } -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 inline const String* ScImpExpLogMsg::GetHint( void ) const -//UNUSED2008-05 { -//UNUSED2008-05 return pHint; -//UNUSED2008-05 } -//UNUSED2008-05 -//UNUSED2008-05 -//UNUSED2008-05 inline String ScImpExpLogMsg::GetMsg( void ) const -//UNUSED2008-05 { -//UNUSED2008-05 return GetMsg( eId ); -//UNUSED2008-05 } - -#endif - - -- cgit From 6a30f2a3025a9db27d1230d9498570964cd74e3f Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 1 Apr 2010 16:52:08 +0200 Subject: #i10000# some catch-up fixes --- sc/inc/dptablecache.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx index 7b637bf04d6f..953c793093be 100644 --- a/sc/inc/dptablecache.hxx +++ b/sc/inc/dptablecache.hxx @@ -47,6 +47,8 @@ class ScDPTableDataCache; class TypedStrData; +struct ScQueryParam; + // -------------------------------------------------------------------- // // base class ScDPTableData to allow implementation with tabular data -- cgit From e8dab0a6df94cf0030c5297652b6b67b37e27e4b Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 31 Mar 2010 11:24:42 +0200 Subject: calc321stopper1: #i109372# on insert/remove rows/columns/cells: do not update cell position in note caption data before the cells have been moved in the document model --- sc/inc/document.hxx | 5 +++-- sc/inc/drwlayer.hxx | 8 ++++---- sc/inc/table.hxx | 10 +++++----- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 1d92962a56db..6f083a1fc199 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1095,7 +1095,8 @@ public: void UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - ScDocument* pUndoDoc = NULL, BOOL bIncludeDraw = TRUE ); + ScDocument* pUndoDoc = NULL, BOOL bIncludeDraw = TRUE, + bool bUpdateNoteCaptionPos = true ); SC_DLLPUBLIC void UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDoc, const ScMarkData& rMark, ScDocument* pUndoDoc = NULL ); @@ -1651,7 +1652,7 @@ public: BOOL IsExpandRefs() { return bExpandRefs; } SC_DLLPUBLIC void IncSizeRecalcLevel( SCTAB nTab ); - SC_DLLPUBLIC void DecSizeRecalcLevel( SCTAB nTab ); + SC_DLLPUBLIC void DecSizeRecalcLevel( SCTAB nTab, bool bUpdateNoteCaptionPos = true ); ULONG GetXMLImportedFormulaCount() const { return nXMLImportedFormulaCount; } void IncXMLImportedFormulaCount( ULONG nVal ) diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx index 563cf768b5ae..7dd9903f82a1 100644 --- a/sc/inc/drwlayer.hxx +++ b/sc/inc/drwlayer.hxx @@ -110,9 +110,9 @@ private: void MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, const Point& rMove, const Point& rTopLeft ); void MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2, - SCsCOL nDx,SCsROW nDy ); + SCsCOL nDx,SCsROW nDy, bool bUpdateNoteCaptionPos ); - void RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool bNegativePage ); + void RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos ); public: ScDrawLayer( ScDocument* pDocument, const String& rName ); @@ -155,7 +155,7 @@ public: void AddCalcUndo( SdrUndoAction* pUndo ); void MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2, - SCsCOL nDx,SCsROW nDy, BOOL bInsDel ); + SCsCOL nDx,SCsROW nDy, BOOL bInsDel, bool bUpdateNoteCaptionPos = true ); void WidthChanged( SCTAB nTab, SCCOL nCol, long nDifTwips ); void HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips ); @@ -173,7 +173,7 @@ public: SCTAB nSourceTab, const Rectangle& rSourceRange, const ScAddress& rDestPos, const Rectangle& rDestRange ); - void SetPageSize( USHORT nPageNo, const Size& rSize ); + void SetPageSize( USHORT nPageNo, const Size& rSize, bool bUpdateNoteCaptionPos = true ); // mirror or move between positive and negative positions for RTL void MirrorRTL( SdrObject* pObj ); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 0311c5093c4c..6c6bf1cccabd 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -422,11 +422,11 @@ public: void UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - ScDocument* pUndoDoc = NULL, BOOL bIncludeDraw = TRUE ); + ScDocument* pUndoDoc = NULL, BOOL bIncludeDraw = TRUE, bool bUpdateNoteCaptionPos = true ); void UpdateDrawRef( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); + SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bUpdateNoteCaptionPos = true ); void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest, ScDocument* pUndoDoc ); @@ -660,8 +660,8 @@ public: void FindConditionalFormat( ULONG nKey, ScRangeList& rRanges ); - void IncRecalcLevel() { ++nRecalcLvl; } - void DecRecalcLevel() { if (!--nRecalcLvl) SetDrawPageSize(); } + void IncRecalcLevel() { ++nRecalcLvl; } + void DecRecalcLevel( bool bUpdateNoteCaptionPos = true ) { if (!--nRecalcLvl) SetDrawPageSize(true, bUpdateNoteCaptionPos); } BOOL IsSortCollatorGlobal() const; void InitSortCollator( const ScSortParam& rPar ); @@ -735,7 +735,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(bool bResetStreamValid = true); + void SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos); BOOL TestTabRefAbs(SCTAB nTable); void CompileDBFormula(); void CompileDBFormula( BOOL bCreateFormulaString ); -- cgit From 9ba03e8299702945b1650f64d291f223a38a0a1f Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 31 Mar 2010 14:43:12 +0200 Subject: calc321stopper1: #i109372# reintroduced default values for arguments --- sc/inc/table.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 6c6bf1cccabd..bbf900f40c62 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -735,7 +735,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(bool bResetStreamValid, bool bUpdateNoteCaptionPos); + void SetDrawPageSize( bool bResetStreamValid = true, bool bUpdateNoteCaptionPos = true ); BOOL TestTabRefAbs(SCTAB nTable); void CompileDBFormula(); void CompileDBFormula( BOOL bCreateFormulaString ); -- cgit From 19e19bafa255e9ff6daa0b9504eaa88cf1bfa4fa Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Wed, 24 Feb 2010 12:16:42 +0100 Subject: calcfilterrange: #i109553# #160403# for filters (AutoFilter, StandardFilter, AdvancedFilter) shrink selected area to used data area and expand single selected row down to end of data --- sc/inc/document.hxx | 11 +++++++++-- sc/inc/global.hxx | 23 +++++++++++++++++++++++ sc/inc/table.hxx | 4 +++- 3 files changed, 35 insertions(+), 3 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index cc575b529d73..1d8986b1876f 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -866,10 +866,17 @@ public: USHORT GetErrCode( const ScAddress& ) const; - bool ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const; + /** Shrink a range to only include data area. + This is not the actually used area within the + selection, but the bounds of the sheet's data area + instead. */ + bool ShrinkToDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const; + + /** Shrink a range to only include used data area. */ + bool ShrinkToUsedDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const; void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, - SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ); + SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld, bool bOnlyDown ); SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; SC_DLLPUBLIC BOOL GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; SC_DLLPUBLIC BOOL GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index c938968ddfef..fafe1a3514f0 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -417,6 +417,29 @@ enum ScGetDBMode SC_DB_OLD // nicht neu anlegen }; +/// For ScDBFunc::GetDBData() +enum ScGetDBSelection +{ + /** Keep selection as is, expand to used data area if no selection. */ + SC_DBSEL_KEEP, + + /** Shrink selection to sheet's data area. */ + SC_DBSEL_SHRINK_TO_SHEET_DATA, + + /** Shrink selection to actually used data area within the selection. */ + SC_DBSEL_SHRINK_TO_USED_DATA, + + /** If only one row or portion thereof is selected, shrink row to used data + columns and select further rows down until end of data. If an area is + selected, shrink rows to actually used columns. Else, no selection, + expand to used data area. */ + SC_DBSEL_ROW_DOWN, + + /** Behave as if the range corresponding to a ScDBData area was selected, + for API use. */ + SC_DBSEL_FORCE_MARK +}; + enum ScLkUpdMode { //Verknuepfungen LM_ALWAYS, //immer aktualisieren diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index f400054d00b7..1edf239e49a8 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -377,7 +377,9 @@ public: SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow ); void GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, - BOOL bIncludeOld ); + BOOL bIncludeOld, bool bOnlyDown ) const; + + bool ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const; SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ); -- cgit