diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-22 10:06:26 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-22 10:06:26 +0000 |
commit | 7dd50f9ec124f2666dcfd1fd8bb02a1335a360ac (patch) | |
tree | 0aec8c1317128300fbf3c65695ceb294c5a5ecb7 /sc/inc | |
parent | 19b299cdb52a2dd4138885cf3487b34b7600f9f9 (diff) |
CWS-TOOLING: integrate CWS dr67
2009-04-08 13:23:56 +0200 dr r270638 : #i100534# reverted
2009-04-08 10:14:55 +0200 dr r270621 : CWS-TOOLING: rebase CWS dr67 to trunk@270033 (milestone: DEV300:m45)
2009-04-07 21:06:33 +0200 dr r270610 : #i100534# sc does not link in debug mode
2009-03-12 11:20:09 +0100 dr r269375 : #i10000# wae
2009-03-11 19:43:55 +0100 dr r269351 : #i10000# adjust oox namespace ids according to oox/inc/oox/core/namespaces.hxx
2009-03-11 15:38:52 +0100 dr r269339 : CWS-TOOLING: rebase CWS dr67 to trunk@269297 (milestone: DEV300:m43)
2009-02-27 15:20:21 +0100 dr r268598 : CWS-TOOLING: rebase CWS dr67 to trunk@268395 (milestone: DEV300:m42)
2009-02-19 13:32:17 +0100 dr r268277 : moved hf parser into page settings
2009-02-19 12:25:15 +0100 dr r268272 : renamed some structs according to chart filter
2009-02-16 15:51:31 +0100 dr r267823 : #i97873# import autosort settings from BIFF8/OOBIN/OOXML
2009-02-06 17:09:29 +0100 dr r267477 : #i97873# minor changes
2009-02-06 16:38:56 +0100 dr r267473 : #i97873# import date grouping settings from BIFF5/BIFF8/OOBIN/OOXML
2009-02-06 16:38:11 +0100 dr r267472 : #i97873# check min/max/step of passed GroupInfo
2009-02-06 16:35:13 +0100 dr r267471 : #i97873# more doc for createDategroup()
2009-02-06 13:53:42 +0100 dr r267459 : #i97873# make XDataPilotGrouping::createDateGroup() implementation working and robust against wrong input data
2009-02-06 13:52:16 +0100 dr r267458 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-06 12:35:49 +0100 dr r267453 : fix other IDLC warnings in sheet module
2009-02-06 12:05:19 +0100 dr r267448 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-02 17:58:46 +0100 dr r267284 : #i10000# rebase errors
2009-02-02 17:52:21 +0100 dr r267282 : #i10000# rebase errors
2009-02-02 17:35:58 +0100 dr r267280 : #i10000# rebase errors
2009-02-02 15:58:04 +0100 dr r267274 : CWS-TOOLING: rebase CWS dr67 to trunk@267171 (milestone: DEV300:m41)
2009-02-02 09:16:32 +0100 dr r267247 : #i97873# typo
2009-01-30 17:09:09 +0100 dr r267215 : #i97873# import numeric grouping settings for datapilot fields from BIFF5/BIFF8/OOBIN/OOXML
2009-01-29 16:36:24 +0100 dr r267154 : #i97873# import datapilot discrete grouping from BIFF5/BIFF8/OOBIN/OOXLS
2009-01-29 16:33:37 +0100 dr r267152 : #i97873# do not kill _all_ the other group fields when writing back DataPilotField::GroupInfo property
2009-01-29 14:15:45 +0100 dr r267133 : #i93839# remove ScChengeTrack::Load and ::Store, adapt xls export filter
2009-01-28 13:30:37 +0100 dr r267056 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-28 12:09:05 +0100 dr r267051 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-27 16:13:58 +0100 dr r267005 : #i97873# minor changes in DataPilot API implementation as preparation for additional changes needed for OOX import filter
2009-01-27 10:08:01 +0100 dr r266961 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-27 10:06:50 +0100 dr r266960 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-23 12:52:31 +0100 dr r266808 : #i97873# DP documentation extended
2009-01-21 20:07:15 +0100 dr r266702 : #i97873# this trivial patch adds BIFF5/BIFF8 pivot table import to the oox filter
2009-01-20 16:06:23 +0100 dr r266592 : select BIFF filter via env.var
2009-01-16 18:51:01 +0100 dr r266452 : #i97873# import page fields
2009-01-16 15:05:36 +0100 dr r266420 : #i97873# field item settings (collapsed/hidden), settings of hidden fields
2009-01-15 16:01:17 +0100 dr r266377 : #i97873# import OOXML7/OOBIN7 autoshow settings
2009-01-14 15:24:27 +0100 dr r266310 : #i97873# import auto show settings generated by MSO2003
2009-01-14 12:29:44 +0100 dr r266281 : #i97873# set global dp settings
2009-01-13 15:04:30 +0100 dr r266229 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-13 14:46:50 +0100 dr r266225 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-12 15:04:22 +0100 dr r266161 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 15:03:42 +0100 dr r266160 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 14:57:33 +0100 dr r266159 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-12 14:52:43 +0100 dr r266158 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-09 16:34:55 +0100 dr r266098 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 16:32:16 +0100 dr r266097 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 12:02:39 +0100 dr r266072 : #i97623# RTL handling changed after CWS rtlcontrols
2009-01-09 09:48:53 +0100 dr r266050 : #i158444# SXLI must be filled completely before starting CONTINUE
2009-01-08 18:50:08 +0100 dr r266032 : #158444# allow to disable dump of record positions
2009-01-08 15:46:45 +0100 dr r266020 : #i97873# data layout field handling
2009-01-08 15:45:45 +0100 dr r266019 : #i97873# data layout field handling
2009-01-08 15:42:25 +0100 dr r266018 : #i97873# data layout field handling
2009-01-02 17:28:32 +0100 dr r265844 : #i10000# unxmacxi warning
2009-01-02 16:59:13 +0100 dr r265842 : #i10000# rebase corrections
2009-01-02 16:44:44 +0100 dr r265838 : #i10000# rebase corrections
2009-01-02 11:32:44 +0100 dr r265834 : CWS-TOOLING: rebase CWS dr67 to trunk@265758 (milestone: DEV300:m38)
2008-12-29 16:55:40 +0100 dr r265822 : more pivot table import, field layout settings
2008-12-29 14:27:35 +0100 dr r265817 : more pivot table import, additions for data field settings
2008-12-26 14:39:21 +0100 dr r265805 : updates
2008-12-19 16:31:39 +0100 dr r265734 : typo
2008-12-19 16:30:00 +0100 dr r265733 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:43 +0100 dr r265732 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:07 +0100 dr r265731 : add API for sequence of DP field subtotal functions
2008-12-18 18:07:58 +0100 dr r265710 : #i96758# try to cache row default formatting and apply it at row ranges instead of single rows
2008-12-18 16:00:25 +0100 dr r265698 : more additions to pivot import
2008-12-17 13:38:19 +0100 dr r265599 : do not assert HIDDEN orientation
2008-12-12 13:51:29 +0100 dr r265415 : minor typos
2008-12-12 10:15:04 +0100 dr r265394 : pivot cache import extended to XLSB, added creation of cache data for missing/external sheets
2008-12-04 13:16:16 +0100 dr r264837 : #i96860# remove old dumper files
2008-12-04 12:17:38 +0100 dr r264834 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-04 12:16:38 +0100 dr r264833 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-03 14:51:05 +0100 dr r264784 : #i10000# warnings
2008-12-03 14:32:46 +0100 dr r264778 : #i10000# warning
2008-12-03 11:28:38 +0100 dr r264758 : #i96758# ignore zero-sized objects
2008-12-03 10:09:34 +0100 dr r264748 : #i96758# change ::oox::Property(Set|Map) keys to sal_Int32 property identifiers, to save construction of property names
2008-12-01 16:09:02 +0100 dr r264615 : #i96758# headerdoc
2008-12-01 14:49:04 +0100 dr r264607 : #i96758# import performance of formatted documents
2008-11-26 17:08:15 +0100 dr r264424 : make it more simple
2008-11-26 16:31:41 +0100 dr r264419 : c:crossesAt is for crossing axis, not for own axis. This is different to BIFF
2008-11-26 13:55:55 +0100 dr r264382 : #i86346# import of MissingValueTreatment from XLSX
2008-11-26 12:49:38 +0100 dr r264370 : #i86346# import/export of MissingValueTreatment from/to XLS
2008-11-25 17:48:59 +0100 dr r264320 : update row height with single progress bar when using 'IsAdjustHeightEnabled' document property
2008-11-25 17:24:26 +0100 dr r264319 : #i96438# disable importing comment text until API is fixed
2008-11-25 17:11:30 +0100 dr r264318 : #i90124# set control tooltips, patch from npower
2008-11-25 15:09:28 +0100 dr r264309 : #i94028# #i94991# update drawing objects when changing row height
2008-11-24 15:21:35 +0100 dr r264224 : prevent ::rtl::OUString::copy assertion
2008-11-24 15:19:39 +0100 dr r264223 : #i95183# #158573# handle non-ascii characters in sheet names in OOXML import
2008-11-24 12:54:30 +0100 dr r264221 : #i94157# support ESC key to leave full-screen in page preview
2008-11-21 18:15:17 +0100 dr r264165 : #i90360# disable chart perspective if it is set to 0
2008-11-21 18:14:41 +0100 dr r264164 : #i90360# disable chart perspective if it is set to 0
2008-11-21 17:43:26 +0100 dr r264155 : #i96140# missing parenth
2008-11-21 17:36:35 +0100 dr r264154 : #i96438# first steps of note import
2008-11-20 15:15:03 +0100 dr r264059 : get rid of ContextWrapper
2008-11-18 11:39:52 +0100 dr r263755 : #i78476# moved to CWS dr67
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/chgtrack.hxx | 4 | ||||
-rw-r--r-- | sc/inc/compressedarray.hxx | 2 | ||||
-rw-r--r-- | sc/inc/dapiuno.hxx | 401 | ||||
-rw-r--r-- | sc/inc/dpdimsave.hxx | 65 | ||||
-rw-r--r-- | sc/inc/unonames.hxx | 2 |
5 files changed, 305 insertions, 169 deletions
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index ba15daa3c4d9..cb56004520dd 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -1399,8 +1399,6 @@ public: void NotifyModified( ScChangeTrackMsgType eMsgType, ULONG nStartAction, ULONG nEndAction ); - SC_DLLPUBLIC BOOL Load( SvStream& rStrm, USHORT nVer ); - SC_DLLPUBLIC BOOL Store( SvStream& rStrm ); USHORT GetLoadedFileFormatVersion() const { return nLoadedFileFormatVersion; } @@ -1426,7 +1424,7 @@ public: { return bTime100thSeconds; } void AppendCloned( ScChangeAction* pAppend ); - ScChangeTrack* Clone( ScDocument* pDocument ) const; + SC_DLLPUBLIC ScChangeTrack* Clone( ScDocument* pDocument ) const; void MergeActionState( ScChangeAction* pAct, const ScChangeAction* pOtherAct ); #if DEBUG_CHANGETRACK String ToString() const; diff --git a/sc/inc/compressedarray.hxx b/sc/inc/compressedarray.hxx index f648a569a10f..ce7144008e2b 100644 --- a/sc/inc/compressedarray.hxx +++ b/sc/inc/compressedarray.hxx @@ -74,7 +74,7 @@ public: DataEntry() {} //! uninitialized }; - /** Contruct with nMaxAccess=MAXROW, for example. */ + /** Construct with nMaxAccess=MAXROW, for example. */ ScCompressedArray( A nMaxAccess, const D& rValue, size_t nDelta = nScCompressedArrayDelta ); diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index 8fe665ae6130..341300228869 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -37,24 +37,27 @@ #include <svtools/lstner.hxx> #include <svtools/itemprop.hxx> -#include <com/sun/star/sheet/XDataPilotTable.hpp> -#include <com/sun/star/sheet/XDataPilotTable2.hpp> -#include <com/sun/star/sheet/XDataPilotTables.hpp> -#include <com/sun/star/sheet/XDataPilotDescriptor.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/container/XEnumerationAccess.hpp> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/sheet/GeneralFunction.hpp> -#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> -#include <com/sun/star/sheet/XDataPilotField.hpp> -#include <com/sun/star/sheet/XDataPilotFieldGrouping.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/container/XNameContainer.hpp> + #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp> +#include <com/sun/star/sheet/DataPilotFieldGroupInfo.hpp> #include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp> +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/sheet/DataPilotFieldReference.hpp> #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp> -#include <com/sun/star/sheet/DataPilotFieldGroupInfo.hpp> +#include <com/sun/star/sheet/GeneralFunction.hpp> +#include <com/sun/star/sheet/XDataPilotDataLayoutFieldSupplier.hpp> +#include <com/sun/star/sheet/XDataPilotDescriptor.hpp> +#include <com/sun/star/sheet/XDataPilotField.hpp> +#include <com/sun/star/sheet/XDataPilotFieldGrouping.hpp> +#include <com/sun/star/sheet/XDataPilotTable.hpp> +#include <com/sun/star/sheet/XDataPilotTable2.hpp> +#include <com/sun/star/sheet/XDataPilotTables.hpp> + #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase4.hxx> @@ -81,20 +84,21 @@ class ScDataPilotTableObj; class ScDataPilotFieldObj; class ScDataPilotItemObj; -#define SC_FIELDORIENT_ALL USHRT_MAX - class ScDataPilotConversion { public: static com::sun::star::sheet::GeneralFunction FirstFunc( USHORT nBits ); static USHORT FunctionBit( com::sun::star::sheet::GeneralFunction eFunc ); -}; - + static void FillGroupInfo( + ::com::sun::star::sheet::DataPilotFieldGroupInfo& rInfo, + const ScDPNumGroupInfo& rGroupInfo ); +}; -// DataPilotTables Collection ist pro Tabelle +// ============================================================================ +/** DataPilotTables collection per sheet. */ class ScDataPilotTablesObj : public cppu::WeakImplHelper4< com::sun::star::sheet::XDataPilotTables, com::sun::star::container::XEnumerationAccess, @@ -106,7 +110,7 @@ private: ScDocShell* pDocShell; SCTAB nTab; - ScDataPilotTableObj* GetObjectByIndex_Impl(SCSIZE nIndex); + ScDataPilotTableObj* GetObjectByIndex_Impl( sal_Int32 nIndex ); ScDataPilotTableObj* GetObjectByName_Impl(const ::rtl::OUString& aName); public: @@ -161,10 +165,12 @@ public: throw(::com::sun::star::uno::RuntimeException); }; +// ============================================================================ // ScDataPilotDescriptorBase is never instantiated directly class ScDataPilotDescriptorBase : public com::sun::star::sheet::XDataPilotDescriptor, public com::sun::star::beans::XPropertySet, + public com::sun::star::sheet::XDataPilotDataLayoutFieldSupplier, public com::sun::star::lang::XServiceInfo, public com::sun::star::lang::XUnoTunnel, public com::sun::star::lang::XTypeProvider, @@ -172,8 +178,8 @@ class ScDataPilotDescriptorBase : public com::sun::star::sheet::XDataPilotDescri public SfxListener { private: - SfxItemPropertySet aPropSet; - ScDocShell* pDocShell; + SfxItemPropertySet maPropSet; + ScDocShell* pDocShell; public: ScDataPilotDescriptorBase(ScDocShell* pDocSh); @@ -256,6 +262,11 @@ public: ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + // XDataPilotDataLayoutFieldSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDataPilotField > + SAL_CALL getDataLayoutField() + throw(::com::sun::star::uno::RuntimeException); + // XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) @@ -274,6 +285,7 @@ public: // XServiceInfo is in derived classes }; +// ============================================================================ class ScDataPilotDescriptor : public ScDataPilotDescriptorBase { @@ -304,6 +316,7 @@ public: throw(::com::sun::star::uno::RuntimeException); }; +// ============================================================================ class ScDataPilotTableObj : public ScDataPilotDescriptorBase, public com::sun::star::sheet::XDataPilotTable2 @@ -369,23 +382,77 @@ public: throw(::com::sun::star::uno::RuntimeException); }; +// ============================================================================ -class ScDataPilotFieldsObj : public cppu::WeakImplHelper4< - com::sun::star::container::XEnumerationAccess, - com::sun::star::container::XIndexAccess, - com::sun::star::container::XNameAccess, - com::sun::star::lang::XServiceInfo> +struct ScFieldIdentifier +{ + ::rtl::OUString maFieldName; /// Source field name. + sal_Int32 mnFieldIdx; /// Field index (if several fields with same name exist). + bool mbDataLayout; /// True = data layout field collecting all data fields as items. + + inline explicit ScFieldIdentifier() : + mnFieldIdx( 0 ), mbDataLayout( false ) {} + + inline explicit ScFieldIdentifier( const ::rtl::OUString& rFieldName, sal_Int32 nFieldIdx, bool bDataLayout ) : + maFieldName( rFieldName ), mnFieldIdx( nFieldIdx ), mbDataLayout( bDataLayout ) {} +}; + +// ============================================================================ + +/** Base class of all implementation objects based on a DataPilot descriptor + or DataPilot table object. Wraps acquiring and releasing the parent. */ +class ScDataPilotChildObjBase { +protected: + explicit ScDataPilotChildObjBase( ScDataPilotDescriptorBase& rParent ); + explicit ScDataPilotChildObjBase( ScDataPilotDescriptorBase& rParent, const ScFieldIdentifier& rFieldId ); + virtual ~ScDataPilotChildObjBase(); + + /** Returns the wrapped DataPilot object (calls GetDPObject() at parent). */ + ScDPObject* GetDPObject() const; + /** Sets the passed DataPilot object (calls SetDPObject() at parent). */ + void SetDPObject( ScDPObject* pDPObject ); + + /** Returns the DataPilot dimension object related to the field described by maFieldId. */ + ScDPSaveDimension* GetDPDimension( ScDPObject** ppDPObject = 0 ) const; + + /** Returns the number of members for the field described by maFieldId. */ + sal_Int32 GetMemberCount() const; + /** Returns the collection of members for the field described by maFieldId. */ + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > + GetMembers() const; + +protected: + ScDataPilotDescriptorBase& mrParent; + ScFieldIdentifier maFieldId; + private: - ScDataPilotDescriptorBase* pParent; - USHORT nType; // DataPilotFieldOrientation oder SC_FIELDORIENT_ALL + ScDataPilotChildObjBase& operator=( const ScDataPilotChildObjBase& ); +}; - ScDataPilotFieldObj* GetObjectByIndex_Impl(SCSIZE nIndex) const; - ScDataPilotFieldObj* GetObjectByName_Impl(const ::rtl::OUString& aName) const; +// ============================================================================ +typedef ::cppu::WeakImplHelper4 +< + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::container::XNameAccess, + ::com::sun::star::lang::XServiceInfo +> +ScDataPilotFieldsObjImpl; + +/** Collection of all DataPilot fields, or of all fields from a specific dimension. */ +class ScDataPilotFieldsObj : public ScDataPilotChildObjBase, public ScDataPilotFieldsObjImpl +{ public: - ScDataPilotFieldsObj(ScDataPilotDescriptorBase* pPar, USHORT nTy); - virtual ~ScDataPilotFieldsObj(); + explicit ScDataPilotFieldsObj( + ScDataPilotDescriptorBase& rParent ); + + explicit ScDataPilotFieldsObj( + ScDataPilotDescriptorBase& rParent, + ::com::sun::star::sheet::DataPilotFieldOrientation eOrient ); + + virtual ~ScDataPilotFieldsObj(); // XNameAccess virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) @@ -420,51 +487,41 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); -}; - -struct ScFieldGroup -{ - ::rtl::OUString sName; - ::std::vector < ::rtl::OUString > aMembers; -}; -typedef ::std::vector < ScFieldGroup > ScFieldGroups; +private: + ScDataPilotFieldObj* GetObjectByIndex_Impl( sal_Int32 nIndex ) const; + ScDataPilotFieldObj* GetObjectByName_Impl( const ::rtl::OUString& rName ) const; +private: + ::com::sun::star::uno::Any maOrient; /// Field orientation, no value = all fields. +}; -struct ScFieldIdentifier -{ - String sFieldName; // source field name - sal_Bool bDataLayoutField; - sal_Int32 nRepeat; // to allow using one source column for several data fields - // nRepeat always counts in all fields, not just of one orientation +// ============================================================================ - ScFieldIdentifier() : - bDataLayoutField( sal_False ), nRepeat( 0 ) {} +typedef ::cppu::WeakImplHelper5 +< + ::com::sun::star::container::XNamed, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::sheet::XDataPilotField, + ::com::sun::star::sheet::XDataPilotFieldGrouping, + ::com::sun::star::lang::XServiceInfo +> +ScDataPilotFieldObjImpl; - ScFieldIdentifier( const String& rName, sal_Bool bDataLayout, sal_Int32 nRep ) : - sFieldName( rName ), bDataLayoutField( bDataLayout ), nRepeat( nRep ) {} -}; - -class ScDataPilotFieldObj : public cppu::WeakImplHelper5< - com::sun::star::container::XNamed, - com::sun::star::beans::XPropertySet, - com::sun::star::sheet::XDataPilotField, - com::sun::star::sheet::XDataPilotFieldGrouping, - com::sun::star::lang::XServiceInfo> +/** Implementation of a single DataPilot field. */ +class ScDataPilotFieldObj : public ScDataPilotChildObjBase, public ScDataPilotFieldObjImpl { -private: - com::sun::star::uno::Reference<com::sun::star::container::XIndexAccess> xItems; - SfxItemPropertySet aPropSet; - ScDataPilotDescriptorBase* pParent; - USHORT nSourceType; - ScFieldIdentifier aSourceIdent; - USHORT nLastFunc; // valid while type is HIDDEN (or PAGE) +public: + ScDataPilotFieldObj( + ScDataPilotDescriptorBase& rParent, + const ScFieldIdentifier& rIdent ); + ScDataPilotFieldObj( + ScDataPilotDescriptorBase& rParent, + const ScFieldIdentifier& rIdent, + const ::com::sun::star::uno::Any& rOrient ); -public: - ScDataPilotFieldObj(ScDataPilotDescriptorBase* pPar, - USHORT nST, const ScFieldIdentifier& rIdent); - virtual ~ScDataPilotFieldObj(); + virtual ~ScDataPilotFieldObj(); // XNamed virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); @@ -521,6 +578,8 @@ public: void setOrientation(com::sun::star::sheet::DataPilotFieldOrientation Orientation); com::sun::star::sheet::GeneralFunction getFunction(void) const; void setFunction(com::sun::star::sheet::GeneralFunction Function); + com::sun::star::uno::Sequence< com::sun::star::sheet::GeneralFunction > getSubtotals() const; + void setSubtotals(const com::sun::star::uno::Sequence< com::sun::star::sheet::GeneralFunction >& rFunctions); rtl::OUString getCurrentPage() const; void setCurrentPage(const rtl::OUString& sPage); sal_Bool getUseCurrentPage() const; @@ -536,10 +595,6 @@ public: sal_Bool getShowEmpty() const; void setShowEmpty(sal_Bool bShow); - void SetGroupInfo(const ScDPNumGroupInfo& rGroupInfo, - com::sun::star::sheet::DataPilotFieldGroupInfo& rInfo); - void FillGroupInfo(const ScDPSaveGroupDimension* pGroupDim, - const ScDPSaveNumGroupDimension* pNumGroupDim, com::sun::star::sheet::DataPilotFieldGroupInfo& rInfo); sal_Bool hasGroupInfo(); com::sun::star::sheet::DataPilotFieldGroupInfo getGroupInfo(); void setGroupInfo(const com::sun::star::sheet::DataPilotFieldGroupInfo* pInfo); @@ -562,20 +617,48 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > + mxItems; + SfxItemPropertySet maPropSet; + ::com::sun::star::uno::Any maOrient; }; -class ScDataPilotFieldGroupsObj : public cppu::WeakImplHelper4< - com::sun::star::container::XEnumerationAccess, - com::sun::star::container::XIndexAccess, - com::sun::star::container::XNameContainer, - com::sun::star::lang::XServiceInfo> +// ============================================================================ + +typedef ::std::vector< ::rtl::OUString > ScFieldGroupMembers; + +struct ScFieldGroup { -private: - ScFieldGroups aGroups; + ::rtl::OUString maName; + ScFieldGroupMembers maMembers; +}; + +typedef ::std::vector< ScFieldGroup > ScFieldGroups; + +// ============================================================================ + +typedef ::cppu::WeakImplHelper4 +< + ::com::sun::star::container::XNameContainer, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::lang::XServiceInfo +> +ScDataPilotFieldGroupsObjImpl; + +/** Implementation of all grouped items in a DataPilot field. + This is a stand-alone object without any connection to the base DataPilot + field. Grouping info has to be written back with the GroupInfo property of + the DataPilot field after modifying this object. + */ +class ScDataPilotFieldGroupsObj : public ScDataPilotFieldGroupsObjImpl +{ public: - ScDataPilotFieldGroupsObj(const ScFieldGroups& rGroups); - virtual ~ScDataPilotFieldGroupsObj(); + explicit ScDataPilotFieldGroupsObj( const ScFieldGroups& rGroups ); + virtual ~ScDataPilotFieldGroupsObj(); // XNameAccess virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) @@ -587,7 +670,7 @@ public: virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); - // XNameReplace + // XNameReplace virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, @@ -607,7 +690,7 @@ public: ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - // XIndexAccess + // XIndexAccess virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, @@ -630,34 +713,35 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); -}; -class ScDataPilotFieldGroupObj : public cppu::WeakImplHelper5< - com::sun::star::container::XEnumerationAccess, - com::sun::star::container::XIndexAccess, - com::sun::star::container::XNameContainer, - com::sun::star::container::XNamed, - com::sun::star::lang::XServiceInfo> -{ + // implementation + ScFieldGroup& getFieldGroup( const ::rtl::OUString& rName ) throw(::com::sun::star::uno::RuntimeException); + void renameFieldGroup( const ::rtl::OUString& rOldName, const ::rtl::OUString& rNewName ) throw(::com::sun::star::uno::RuntimeException); + private: - ScFieldGroup aGroup; + ScFieldGroups::iterator implFindByName( const ::rtl::OUString& rName ); -public: - ScDataPilotFieldGroupObj(const ScFieldGroup& rGroup); - virtual ~ScDataPilotFieldGroupObj(); +private: + ScFieldGroups maGroups; +}; - // XNamed - virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& aName ) - throw(::com::sun::star::uno::RuntimeException); +// ============================================================================ - // XNameReplace - virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, - const ::com::sun::star::uno::Any& aElement ) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::container::NoSuchElementException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); +typedef ::cppu::WeakImplHelper5 +< + ::com::sun::star::container::XNameContainer, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XServiceInfo +> +ScDataPilotFieldGroupObjImpl; + +class ScDataPilotFieldGroupObj : public ScDataPilotFieldGroupObjImpl +{ +public: + explicit ScDataPilotFieldGroupObj( ScDataPilotFieldGroupsObj& rParent, const ::rtl::OUString& rGroupName ); + virtual ~ScDataPilotFieldGroupObj(); // XNameAccess virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) @@ -669,7 +753,15 @@ public: virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); - // XNameContainer + // XNameReplace + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, + const ::com::sun::star::uno::Any& aElement ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNameContainer virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, @@ -681,7 +773,7 @@ public: ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - // XIndexAccess + // XIndexAccess virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, @@ -697,6 +789,11 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); + // XNamed + virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName( const ::rtl::OUString& aName ) + throw(::com::sun::star::uno::RuntimeException); + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); @@ -704,18 +801,26 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); -}; -class ScDataPilotFieldGroupItemObj : public cppu::WeakImplHelper2< - com::sun::star::container::XNamed, - com::sun::star::lang::XServiceInfo> -{ private: - rtl::OUString sName; + ScDataPilotFieldGroupsObj& mrParent; + ::rtl::OUString maGroupName; +}; + +// ============================================================================ + +typedef ::cppu::WeakImplHelper2 +< + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XServiceInfo +> +ScDataPilotFieldGroupItemObjImpl; +class ScDataPilotFieldGroupItemObj : public ScDataPilotFieldGroupItemObjImpl +{ public: - ScDataPilotFieldGroupItemObj(const rtl::OUString& rName); - virtual ~ScDataPilotFieldGroupItemObj(); + explicit ScDataPilotFieldGroupItemObj( ScDataPilotFieldGroupObj& rParent, const ::rtl::OUString& rName ); + virtual ~ScDataPilotFieldGroupItemObj(); // XNamed virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); @@ -729,23 +834,28 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); -}; -class ScDataPilotItemsObj : public cppu::WeakImplHelper4< - com::sun::star::container::XEnumerationAccess, - com::sun::star::container::XIndexAccess, - com::sun::star::container::XNameAccess, - com::sun::star::lang::XServiceInfo> -{ private: - ScDataPilotDescriptorBase* pParent; - ScFieldIdentifier aSourceIdent; // of the field + ScDataPilotFieldGroupObj& mrParent; + ::rtl::OUString maName; +}; + +// ============================================================================ - ScDataPilotItemObj* GetObjectByIndex_Impl(SCSIZE nIndex) const; +typedef ::cppu::WeakImplHelper4 +< + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::container::XNameAccess, + ::com::sun::star::lang::XServiceInfo +> +ScDataPilotItemsObjImpl; +class ScDataPilotItemsObj : public ScDataPilotChildObjBase, public ScDataPilotItemsObjImpl +{ public: - ScDataPilotItemsObj(ScDataPilotDescriptorBase* pPar, const ScFieldIdentifier& rIdent); - virtual ~ScDataPilotItemsObj(); + explicit ScDataPilotItemsObj( ScDataPilotDescriptorBase& rParent, const ScFieldIdentifier& rFieldId ); + virtual ~ScDataPilotItemsObj(); // XNameAccess virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) @@ -780,23 +890,30 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); -}; -class ScDataPilotItemObj : public cppu::WeakImplHelper3< - com::sun::star::container::XNamed, - com::sun::star::beans::XPropertySet, - com::sun::star::lang::XServiceInfo> -{ private: - SfxItemPropertySet aPropSet; - ScDataPilotDescriptorBase* pParent; - ScFieldIdentifier aSourceIdent; - SCSIZE nIndex; + ScDataPilotItemObj* GetObjectByIndex_Impl( sal_Int32 nIndex ) const; +}; +// ============================================================================ +typedef ::cppu::WeakImplHelper3 +< + ::com::sun::star::container::XNamed, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo +> +ScDataPilotItemObjImpl; + +class ScDataPilotItemObj : public ScDataPilotChildObjBase, public ScDataPilotItemObjImpl +{ public: - ScDataPilotItemObj(ScDataPilotDescriptorBase* pPar, const ScFieldIdentifier& rIdent, SCSIZE nI); - virtual ~ScDataPilotItemObj(); + explicit ScDataPilotItemObj( + ScDataPilotDescriptorBase& rParent, + const ScFieldIdentifier& rFieldId, + sal_Int32 nIndex ); + + virtual ~ScDataPilotItemObj(); // XNamed virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); @@ -851,7 +968,13 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +private: + SfxItemPropertySet maPropSet; + sal_Int32 mnIndex; }; +// ============================================================================ + #endif diff --git a/sc/inc/dpdimsave.hxx b/sc/inc/dpdimsave.hxx index 076e35763d4e..4c711eb67eb7 100644 --- a/sc/inc/dpdimsave.hxx +++ b/sc/inc/dpdimsave.hxx @@ -32,6 +32,7 @@ #define SC_DPDIMSAVE_HXX #include <vector> +#include <map> #include <tools/string.hxx> #include "dpgroup.hxx" // for ScDPNumGroupInfo #include "scdllapi.h" @@ -50,6 +51,8 @@ class ScDPSaveGroupDimension; // These have to be applied before the other ScDPSaveData settings. // +// ============================================================================ + class SC_DLLPUBLIC ScDPSaveGroupItem { String aGroupName; // name of group @@ -57,7 +60,6 @@ class SC_DLLPUBLIC ScDPSaveGroupItem public: ScDPSaveGroupItem( const String& rName ); - ScDPSaveGroupItem( const ScDPSaveGroupItem& r ); ~ScDPSaveGroupItem(); void AddToData( ScDPGroupDimension& rDataDim, SvNumberFormatter* pFormatter ) const; @@ -80,6 +82,8 @@ public: typedef ::std::vector<ScDPSaveGroupItem> ScDPSaveGroupItemVec; +// ============================================================================ + class SC_DLLPUBLIC ScDPSaveGroupDimension { String aSourceDim; // always the real source from the original data @@ -90,7 +94,7 @@ class SC_DLLPUBLIC ScDPSaveGroupDimension public: ScDPSaveGroupDimension( const String& rSource, const String& rName ); - ScDPSaveGroupDimension( const ScDPSaveGroupDimension& r ); + ScDPSaveGroupDimension( const String& rSource, const String& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart ); ~ScDPSaveGroupDimension(); void AddToData( ScDPGroupTableData& rData ) const; @@ -119,7 +123,7 @@ public: void Rename( const String& rNewName ); }; -typedef ::std::vector<ScDPSaveGroupDimension> ScDPSaveGroupDimensionVec; +// ============================================================================ class SC_DLLPUBLIC ScDPSaveNumGroupDimension { @@ -130,7 +134,7 @@ class SC_DLLPUBLIC ScDPSaveNumGroupDimension public: ScDPSaveNumGroupDimension( const String& rName, const ScDPNumGroupInfo& rInfo ); - ScDPSaveNumGroupDimension( const ScDPSaveNumGroupDimension& r ); + ScDPSaveNumGroupDimension( const String& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart ); ~ScDPSaveNumGroupDimension(); void AddToData( ScDPGroupTableData& rData ) const; @@ -145,46 +149,57 @@ public: void SetDateInfo( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart ); }; -typedef ::std::vector<ScDPSaveNumGroupDimension> ScDPSaveNumGroupDimensionVec; +// ============================================================================ class SC_DLLPUBLIC ScDPDimensionSaveData { - ScDPSaveGroupDimensionVec aGroupDimensions; - ScDPSaveNumGroupDimensionVec aNumGroupDimensions; - - - // not implemented - ScDPDimensionSaveData& operator=( const ScDPDimensionSaveData& ); - public: ScDPDimensionSaveData(); - ScDPDimensionSaveData( const ScDPDimensionSaveData& r ); ~ScDPDimensionSaveData(); bool operator==( const ScDPDimensionSaveData& r ) const; void WriteToData( ScDPGroupTableData& rData ) const; - String CreateGroupDimName( const String& rSourceName, const ScDPObject& rObject, bool bAllowSource, - const std::vector<String>* pDeletedNames ); - void AddGroupDimension( const ScDPSaveGroupDimension& rGroup ); - void RemoveGroupDimension( const String& rDimensionName ); + String CreateGroupDimName( const String& rSourceName, const ScDPObject& rObject, bool bAllowSource, const ::std::vector< String >* pDeletedNames ); + String CreateDateGroupDimName( sal_Int32 nDatePart, const ScDPObject& rObject, bool bAllowSource, const ::std::vector< String >* pDeletedNames ); + + void AddGroupDimension( const ScDPSaveGroupDimension& rGroupDim ); + void ReplaceGroupDimension( const ScDPSaveGroupDimension& rGroupDim ); + void RemoveGroupDimension( const String& rGroupDimName ); - void AddNumGroupDimension( const ScDPSaveNumGroupDimension& rGroup ); - void RemoveNumGroupDimension( const String& rDimensionName ); + void AddNumGroupDimension( const ScDPSaveNumGroupDimension& rGroupDim ); + void ReplaceNumGroupDimension( const ScDPSaveNumGroupDimension& rGroupDim ); + void RemoveNumGroupDimension( const String& rGroupDimName ); - const ScDPSaveGroupDimension* GetGroupDimForBase( const String& rBaseName ) const; - const ScDPSaveGroupDimension* GetNamedGroupDim( const String& rGroupDim ) const; - const ScDPSaveNumGroupDimension* GetNumGroupDim( const String& rName ) const; + const ScDPSaveGroupDimension* GetGroupDimForBase( const String& rBaseDimName ) const; + const ScDPSaveGroupDimension* GetNamedGroupDim( const String& rGroupDimName ) const; + const ScDPSaveGroupDimension* GetFirstNamedGroupDim( const String& rBaseDimName ) const; + const ScDPSaveGroupDimension* GetNextNamedGroupDim( const String& rGroupDimName ) const; + const ScDPSaveNumGroupDimension* GetNumGroupDim( const String& rGroupDimName ) const; - ScDPSaveGroupDimension* GetGroupDimAccForBase( const String& rBaseName ); - ScDPSaveGroupDimension* GetNamedGroupDimAcc( const String& rGroupDim ); - ScDPSaveNumGroupDimension* GetNumGroupDimAcc( const String& rName ); + ScDPSaveGroupDimension* GetGroupDimAccForBase( const String& rBaseDimName ); + ScDPSaveGroupDimension* GetNamedGroupDimAcc( const String& rGroupDimName ); + ScDPSaveGroupDimension* GetFirstNamedGroupDimAcc( const String& rBaseDimName ); + ScDPSaveGroupDimension* GetNextNamedGroupDimAcc( const String& rGroupDimName ); + + ScDPSaveNumGroupDimension* GetNumGroupDimAcc( const String& rGroupDimName ); bool HasGroupDimensions() const; sal_Int32 CollectDateParts( const String& rBaseDimName ) const; + +private: + typedef ::std::vector< ScDPSaveGroupDimension > ScDPSaveGroupDimVec; + typedef ::std::map< String, ScDPSaveNumGroupDimension > ScDPSaveNumGroupDimMap; + + ScDPDimensionSaveData& operator=( const ScDPDimensionSaveData& ); + + ScDPSaveGroupDimVec maGroupDims; + ScDPSaveNumGroupDimMap maNumGroupDims; }; +// ============================================================================ + #endif diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 38f08d91d162..19c23b96541a 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -239,6 +239,7 @@ // data pilot field #define SC_UNONAME_FUNCTION "Function" +#define SC_UNONAME_SUBTOTALS "Subtotals" #define SC_UNONAME_SELPAGE "SelectedPage" #define SC_UNONAME_USESELPAGE "UseSelectedPage" #define SC_UNONAME_HASREFERENCE "HasReference" @@ -570,7 +571,6 @@ #define SC_UNO_DRILLDOWN "DrillDownOnDoubleClick" #define SC_UNO_SHOWFILT "ShowFilterButton" - // range selection #define SC_UNONAME_INITVAL "InitialValue" #define SC_UNONAME_TITLE "Title" |