diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-02-04 17:59:58 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-02-04 17:59:58 +0100 |
commit | 8c182c140ad1d45acd8c3cec4fedc1af8fcb9ba7 (patch) | |
tree | 4d2f9cdec7d8a1b0fa8672c02643f7087e13faf1 /sc/inc | |
parent | c7368b5dae43b7e1a89bb3884661439350a62cb3 (diff) | |
parent | 25b005cbda460837f063ddf996c1ec72d4f4865b (diff) |
CWS svxsplit: merge with m71
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/AccessibleFilterMenu.hxx | 194 | ||||
-rw-r--r-- | sc/inc/AccessibleFilterMenuItem.hxx | 124 | ||||
-rw-r--r-- | sc/inc/AccessibleFilterTopWindow.hxx | 104 | ||||
-rw-r--r-- | sc/inc/AccessibleGlobal.hxx | 72 | ||||
-rw-r--r-- | sc/inc/attrib.hxx | 16 | ||||
-rw-r--r-- | sc/inc/column.hxx | 2 | ||||
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/inc/dpgroup.hxx | 5 | ||||
-rw-r--r-- | sc/inc/dpobject.hxx | 42 | ||||
-rw-r--r-- | sc/inc/dpoutput.hxx | 7 | ||||
-rw-r--r-- | sc/inc/dpoutputgeometry.hxx | 80 | ||||
-rw-r--r-- | sc/inc/dpsave.hxx | 73 | ||||
-rw-r--r-- | sc/inc/dptabres.hxx | 5 | ||||
-rw-r--r-- | sc/inc/dptabsrc.hxx | 18 | ||||
-rw-r--r-- | sc/inc/fillinfo.hxx | 2 | ||||
-rw-r--r-- | sc/inc/global.hxx | 2 | ||||
-rw-r--r-- | sc/inc/miscuno.hxx | 17 | ||||
-rw-r--r-- | sc/inc/pivot.hxx | 46 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 5 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 2 | ||||
-rw-r--r-- | sc/inc/table.hxx | 1 | ||||
-rw-r--r-- | sc/inc/unonames.hxx | 4 |
22 files changed, 765 insertions, 58 deletions
diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx new file mode 100644 index 000000000000..76344a65ceda --- /dev/null +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -0,0 +1,194 @@ +/************************************************************************* + * + * 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: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEFILTERMENU_HXX +#define SC_ACCESSIBLEFILTERMENU_HXX + +#include "AccessibleContextBase.hxx" +#include "cppuhelper/implbase1.hxx" + +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> +#include <com/sun/star/accessibility/XAccessibleText.hpp> +#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp> +#include <com/sun/star/accessibility/TextSegment.hpp> + +#include <vector> + +namespace com { namespace sun { namespace star { + namespace accessibility { + struct AccessibleEventObject; + } +}}} + +class ScDocument; +class ScMenuFloatingWindow; + +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleSelection > ScAccessibleFilterMenu_BASE; + +class ScAccessibleFilterMenu : + public ScAccessibleContextBase, + public ScAccessibleFilterMenu_BASE +{ +public: + explicit ScAccessibleFilterMenu( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos, ScDocument* pDoc); + virtual ~ScAccessibleFilterMenu(); + + // XAccessibleComponent + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isVisible() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL grabFocus() + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getForeground() + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground() + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + + virtual ::rtl::OUString SAL_CALL getAccessibleName() + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleEventBroadcaster + + using ScAccessibleContextBase::addEventListener; + using ScAccessibleContextBase::removeEventListener; + + virtual void SAL_CALL + addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + // Remove an existing event listener. + virtual void SAL_CALL + removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + // XAccessibleSelection + + virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL clearAccessibleSelection() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL selectAllAccessibleChildren() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Int32 SAL_CALL getSelectedAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XInterface + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + + // XTypeProvider + + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + // non-UNO methods + + void appendMenuItem(const ::rtl::OUString& rName, bool bEnabled, size_t nMenuPos); + void setMenuPos(size_t nMenuPos); + void setEnabled(bool bEnabled); + +protected: + + sal_Int32 getMenuItemCount() const; + + virtual Rectangle GetBoundingBoxOnScreen() const + throw (::com::sun::star::uno::RuntimeException); + + virtual Rectangle GetBoundingBox() const + throw (::com::sun::star::uno::RuntimeException); + +private: + bool isSelected() const; + bool isFocused() const; + + void updateStates(); + +private: + ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > maMenuItems; + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet; + + size_t mnMenuPos; + ScMenuFloatingWindow* mpWindow; + ScDocument* mpDoc; + + bool mbEnabled:1; +}; + +#endif diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx new file mode 100644 index 000000000000..f5ad0fd5d74b --- /dev/null +++ b/sc/inc/AccessibleFilterMenuItem.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * 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: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEFILTERMENUITEM_HXX +#define SC_ACCESSIBLEFILTERMENUITEM_HXX + +#include "AccessibleContextBase.hxx" +#include "cppuhelper/implbase1.hxx" + +#include <com/sun/star/accessibility/XAccessibleAction.hpp> + +class ScMenuFloatingWindow; + +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleAction > ScAccessibleFilterMenuItem_BASE; + +class ScAccessibleFilterMenuItem : + public ScAccessibleContextBase, + public ScAccessibleFilterMenuItem_BASE +{ +public: + explicit ScAccessibleFilterMenuItem( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos); + + virtual ~ScAccessibleFilterMenuItem(); + + // XAccessibleContext + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + + virtual ::sal_Int32 SAL_CALL getAccessibleActionCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL + getAccessibleActionKeyBinding(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XInterface + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + + // Non-UNO Methods + + void setEnabled(bool bEnabled); + +protected: + + virtual Rectangle GetBoundingBoxOnScreen() const + throw (::com::sun::star::uno::RuntimeException); + + virtual Rectangle GetBoundingBox() const + throw (::com::sun::star::uno::RuntimeException); + +private: + bool isSelected() const; + bool isFocused() const; + void updateStateSet(); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet; + + ScMenuFloatingWindow* mpWindow; + ::rtl::OUString maName; + size_t mnMenuPos; + bool mbEnabled; +}; + +#endif diff --git a/sc/inc/AccessibleFilterTopWindow.hxx b/sc/inc/AccessibleFilterTopWindow.hxx new file mode 100644 index 000000000000..e901949286a1 --- /dev/null +++ b/sc/inc/AccessibleFilterTopWindow.hxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * 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: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEFILTERTOPWINDOW_HXX +#define SC_ACCESSIBLEFILTERTOPWINDOW_HXX + +//#include "AccessibleContextBase.hxx" +#include "AccessibleFilterMenu.hxx" +#include "cppuhelper/implbase1.hxx" + +class ScDPFieldPopupWindow; +class ScDocument; + +class ScAccessibleFilterTopWindow : public ScAccessibleFilterMenu +{ +public: + ScAccessibleFilterTopWindow( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScDPFieldPopupWindow* pWin, const ::rtl::OUString& rName, ScDocument* pDoc); + virtual ~ScAccessibleFilterTopWindow(); + + // XAccessibleContext + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + + // Non-UNO Methods + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + getAccessibleChildMenu(); + + enum ChildControlType { + LISTBOX, TOGGLE_ALL, SINGLE_ON_BTN, SINGLE_OFF_BTN, OK_BTN, CANCEL_BTN + }; + void setAccessibleChild( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& rAccessible, + ChildControlType eType); + +private: + /** The top menu part */ + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccMenu; + + /** check list box for field member visibility */ + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccListBox; + + /** check box for toggling all field member's visibility. */ + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccToggleAll; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccSingleOnBtn; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccSingleOffBtn; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccOkBtn; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccCancelBtn; + + ScDPFieldPopupWindow* mpWindow; + ScDocument* mpDoc; +}; + +#endif diff --git a/sc/inc/AccessibleGlobal.hxx b/sc/inc/AccessibleGlobal.hxx new file mode 100644 index 000000000000..9f17c2eaacae --- /dev/null +++ b/sc/inc/AccessibleGlobal.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEGLOBAL_HXX +#define SC_ACCESSIBLEGLOBAL_HXX + +#include <com/sun/star/accessibility/XAccessibleStateSet.hpp> +#include "cppuhelper/implbase1.hxx" + +#include <set> + +/** + * Generic XAccessibleStateSet implementation. + */ +class ScAccessibleStateSet : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleStateSet > +{ +public: + ScAccessibleStateSet(); + virtual ~ScAccessibleStateSet(); + + // XAccessibleStateSet + + virtual ::sal_Bool SAL_CALL isEmpty() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL containsAll( + const ::com::sun::star::uno::Sequence<sal_Int16>& aStateSet) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence<sal_Int16> SAL_CALL getStates() + throw (::com::sun::star::uno::RuntimeException); + + // Non-UNO Methods + + void insert(sal_Int16 nState); + void clear(); + +private: + ::std::set<sal_Int16> maStates; +}; + +#endif diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index 55bb707f4edb..9db8b4001690 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -42,13 +42,16 @@ // Flags fuer durch Merge verdeckte Zellen // und Control fuer Auto-Filter -#define SC_MF_HOR 1 -#define SC_MF_VER 2 -#define SC_MF_AUTO 4 -#define SC_MF_BUTTON 8 -#define SC_MF_SCENARIO 16 +#define SC_MF_HOR 0x0001 +#define SC_MF_VER 0x0002 +#define SC_MF_AUTO 0x0004 /// autofilter arrow +#define SC_MF_BUTTON 0x0008 /// field button for datapilot +#define SC_MF_SCENARIO 0x0010 +#define SC_MF_BUTTON_POPUP 0x0020 /// dp button with popup arrow +#define SC_MF_HIDDEN_MEMBER 0x0040 /// dp field button with presence of hidden member +#define SC_MF_DP_TABLE 0x0080 /// dp table output -#define SC_MF_ALL 31 +#define SC_MF_ALL 0x00FF class EditTextObject; @@ -103,6 +106,7 @@ public: BOOL HasAutoFilter() const { return ( GetValue() & SC_MF_AUTO ) != 0; } BOOL HasButton() const { return ( GetValue() & SC_MF_BUTTON ) != 0; } + bool HasDPTable() const { return ( GetValue() & SC_MF_DP_TABLE ) != 0; } BOOL IsScenario() const { return ( GetValue() & SC_MF_SCENARIO ) != 0; } }; diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 3f1fbfc1c88f..b69fcb384e04 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -161,7 +161,7 @@ public: SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; BOOL HasDataAt(SCROW nRow) const; BOOL HasVisibleDataAt(SCROW nRow) const; -//UNUSED2009-05 SCROW GetFirstDataPos() const; + SCROW GetFirstDataPos() const; SCROW GetLastDataPos() const; SCROW GetLastVisDataPos(BOOL bNotes) const; // ohne Broadcaster SCROW GetFirstVisDataPos(BOOL bNotes) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index f2f863f32b9e..6a9c5678a69e 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -868,6 +868,8 @@ public: USHORT GetErrCode( const ScAddress& ) const; + bool ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const; + void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ); SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx index 99dac0e517db..cb933f4d2a98 100644 --- a/sc/inc/dpgroup.hxx +++ b/sc/inc/dpgroup.hxx @@ -33,6 +33,7 @@ #include <vector> #include <hash_set> +#include <boost/shared_ptr.hpp> #include "dptabdat.hxx" #include "scdllapi.h" @@ -182,7 +183,7 @@ class ScDPGroupTableData : public ScDPTableData { typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > StringHashSet; - ScDPTableData* pSourceData; + ::boost::shared_ptr<ScDPTableData> pSourceData; long nSourceCount; ScDPGroupDimensionVec aGroups; ScDPNumGroupDimension* pNumGroups; // array[nSourceCount] @@ -200,7 +201,7 @@ class ScDPGroupTableData : public ScDPTableData public: // takes ownership of pSource - ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ); + ScDPGroupTableData( const ::boost::shared_ptr<ScDPTableData>& pSource, ScDocument* pDocument ); virtual ~ScDPGroupTableData(); void AddGroupDimension( const ScDPGroupDimension& rGroup ); diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 2dc8829485c8..ef7a2c491c50 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -36,8 +36,11 @@ #include "address.hxx" #include "collect.hxx" #include "dpoutput.hxx" +#include "pivot.hxx" #include <com/sun/star/sheet/XDimensionsSupplier.hpp> +#include <boost/shared_ptr.hpp> + //------------------------------------------------------------------ namespace com { namespace sun { namespace star { namespace sheet { @@ -64,6 +67,7 @@ class ScStrCollection; class TypedScStrCollection; struct PivotField; class ScDPCacheTable; +class ScDPTableData; struct ScDPServiceDesc { @@ -99,15 +103,19 @@ private: ScSheetSourceDesc* pSheetDesc; // for sheet data ScImportSourceDesc* pImpDesc; // for database data ScDPServiceDesc* pServDesc; // for external service + ::boost::shared_ptr<ScDPTableData> mpTableData; // cached data com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier> xSource; ScDPOutput* pOutput; BOOL bSettingsChanged; BOOL bAlive; // FALSE if only used to hold settings + sal_uInt16 mnAutoFormatIndex; BOOL bAllowMove; long nHeaderRows; // page fields plus filter button + bool mbHeaderLayout; // TRUE : grid, FALSE : standard + SC_DLLPRIVATE ScDPTableData* GetTableData(); SC_DLLPRIVATE void CreateObjects(); SC_DLLPRIVATE void CreateOutput(); @@ -135,6 +143,12 @@ public: void SetOutRange(const ScRange& rRange); const ScRange& GetOutRange() const { return aOutRange; } + void SetAutoFormatIndex (const sal_uInt16 nIndex); + sal_uInt16 GetAutoFormatIndex() const; + + void SetHeaderLayout(bool bUseGrid); + bool GetHeaderLayout() const; + void SetSheetDesc(const ScSheetSourceDesc& rDesc); void SetImportDesc(const ScImportSourceDesc& rDesc); void SetServiceData(const ScDPServiceDesc& rDesc); @@ -157,7 +171,14 @@ public: void SetTag(const String& rNew); const String& GetTag() const { return aTableTag; } - BOOL IsDimNameInUse( const String& rName ) const; + /** + * Data description cell displays the description of a data dimension if + * and only if there is only one data dimension. It's usually located at + * the upper-left corner of the table output. + */ + bool IsDataDescriptionCell(const ScAddress& rPos); + + bool IsDimNameInUse(const ::rtl::OUString& rName) const; String GetDimName( long nDim, BOOL& rIsDataLayout ); BOOL IsDuplicated( long nDim ); long GetDimCount(); @@ -190,16 +211,10 @@ public: sal_Int32 GetUsedHierarchy( sal_Int32 nDim ); BOOL GetMembersNA( sal_Int32 nDim, com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xMembers ); - BOOL GetMembers( sal_Int32 nDim, - com::sun::star::uno::Sequence< rtl::OUString >& rMembers, - com::sun::star::uno::Sequence< sal_Bool >* pVisible = 0, - com::sun::star::uno::Sequence< sal_Bool >* pShowDet = 0 ); - BOOL GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xMembers ); - BOOL GetMembers( sal_Int32 nDim, sal_Int32 nHier, - com::sun::star::uno::Sequence< rtl::OUString >& rMembers, - com::sun::star::uno::Sequence< sal_Bool >* pVisible = 0, - com::sun::star::uno::Sequence< sal_Bool >* pShowDet = 0 ); + + bool GetMemberNames( sal_Int32 nDim, ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames ); + bool GetMembers( sal_Int32 nDim, sal_Int32 nHier, ::std::vector<ScDPLabelData::Member>& rMembers ); void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); @@ -221,6 +236,8 @@ public: // (button attribute must be present) void RefreshAfterLoad(); + void BuildAllDimensionMembers(); + static BOOL HasRegisteredSources(); static com::sun::star::uno::Sequence<rtl::OUString> GetRegisteredSources(); static com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier> @@ -291,6 +308,11 @@ public: ScSimpleSharedString& GetSharedString(); + void FreeTable(ScDPObject* pDPObj); + SC_DLLPUBLIC bool InsertNewTable(ScDPObject* pDPObj); + + bool HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const; + ScDPCacheCell* getCacheCellFromPool(const ScDPCacheCell& rCell); void clearCacheCellPool(); }; diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx index 58001e1183a6..e3ab86423d4b 100644 --- a/sc/inc/dpoutput.hxx +++ b/sc/inc/dpoutput.hxx @@ -94,6 +94,7 @@ private: com::sun::star::uno::Sequence< com::sun::star::sheet::DataResult> > aData; BOOL bResultsError; + bool mbHasDataLayout; String aDataDescription; // Number format related parameters @@ -109,6 +110,7 @@ private: long nColCount; long nRowCount; long nHeaderSize; + bool mbHeaderLayout; // TRUE : grid, FALSE : standard SCCOL nTabStartCol; SCROW nTabStartRow; SCCOL nMemberStartCol; @@ -124,7 +126,7 @@ private: const com::sun::star::sheet::MemberResult& rData, BOOL bColHeader, long nLevel ); void FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, - BOOL bFrame = TRUE ); + bool bInTable, bool bPopup, bool bHasHiddenMember ); void CalcSizes(); /** Query which sub-area of the table the cell is in. See @@ -162,6 +164,9 @@ public: void GetMemberResultNames( ScStrCollection& rNames, long nDimension ); + void SetHeaderLayout(bool bUseGrid); + bool GetHeaderLayout() const; + static void GetDataDimensionNames( String& rSourceName, String& rGivenName, const com::sun::star::uno::Reference< com::sun::star::uno::XInterface>& xDim ); diff --git a/sc/inc/dpoutputgeometry.hxx b/sc/inc/dpoutputgeometry.hxx new file mode 100644 index 000000000000..b665c9cc88b4 --- /dev/null +++ b/sc/inc/dpoutputgeometry.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * 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: xmldpimp.cxx,v $ + * $Revision: 1.27.134.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DPOUTPUTGEOMETRY_HXX +#define SC_DPOUTPUTGEOMETRY_HXX + +#include "address.hxx" +#include <vector> + +class ScAddress; + +class SC_DLLPUBLIC ScDPOutputGeometry +{ +public: + enum FieldType { Column, Row, Page, Data, None }; + enum ImportType { ODF, XLS }; + + ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter, ImportType eImportType); + ~ScDPOutputGeometry(); + + /** + * @param nCount number of row fields, <b>excluding the data layout + * field if exists</b>. + */ + void setRowFieldCount(sal_uInt32 nCount); + void setColumnFieldCount(sal_uInt32 nCount); + void setPageFieldCount(sal_uInt32 nCount); + void setDataFieldCount(sal_uInt32 nCount); + + void getColumnFieldPositions(::std::vector<ScAddress>& rAddrs) const; + void getRowFieldPositions(::std::vector<ScAddress>& rAddrs) const; + void getPageFieldPositions(::std::vector<ScAddress>& rAddrs) const; + + SCROW getRowFieldHeaderRow() const; + + FieldType getFieldButtonType(const ScAddress& rPos) const; + +private: + ScDPOutputGeometry(); // disabled + +private: + ScRange maOutRange; + sal_uInt32 mnRowFields; /// number of row fields (data layout field NOT included!) + sal_uInt32 mnColumnFields; + sal_uInt32 mnPageFields; + sal_uInt32 mnDataFields; + + ImportType meImportType; + + bool mbShowFilter; +}; + +#endif diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index d3d8d4354145..86093ac8614b 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -34,9 +34,11 @@ #include <tools/string.hxx> #include <tools/list.hxx> #include <com/sun/star/sheet/XDimensionsSupplier.hpp> +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include "scdllapi.h" #include <hash_map> #include <list> +#include <memory> namespace com { namespace sun { namespace star { namespace sheet { struct DataPilotFieldReference; @@ -46,6 +48,7 @@ namespace com { namespace sun { namespace star { namespace sheet { } } } } class ScDPDimensionSaveData; +class ScDPTableData; // -------------------------------------------------------------------- // @@ -57,6 +60,7 @@ class ScDPSaveMember { private: String aName; + ::std::auto_ptr<rtl::OUString> mpLayoutName; // custom name to be displayed in the table. USHORT nVisibleMode; USHORT nShowDetailsMode; @@ -77,18 +81,23 @@ public: void SetName( const String& rNew ); // used if the source member was renamed (groups) + SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName ); + SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; + void RemoveLayoutName(); + void WriteToSource( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface>& xMember, sal_Int32 nPosition ); }; -class ScDPSaveDimension +class SC_DLLPUBLIC ScDPSaveDimension { private: String aName; - String* pLayoutName; // alternative name for layout, not used (yet) String* pSelectedPage; + ::std::auto_ptr<rtl::OUString> mpLayoutName; + ::std::auto_ptr<rtl::OUString> mpSubtotalName; BOOL bIsDataLayout; BOOL bDupFlag; USHORT nOrientation; @@ -127,43 +136,52 @@ public: void SetName( const String& rNew ); // used if the source dim was renamed (groups) - SC_DLLPUBLIC void SetOrientation(USHORT nNew); - SC_DLLPUBLIC void SetSubTotals(long nCount, const USHORT* pFuncs); + void SetOrientation(USHORT nNew); + void SetSubTotals(long nCount, const USHORT* pFuncs); long GetSubTotalsCount() const { return nSubTotalCount; } USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; } - SC_DLLPUBLIC void SetShowEmpty(BOOL bSet); + void SetShowEmpty(BOOL bSet); BOOL GetShowEmpty() const { return BOOL(nShowEmptyMode); } - SC_DLLPUBLIC void SetFunction(USHORT nNew); // enum GeneralFunction + void SetFunction(USHORT nNew); // enum GeneralFunction USHORT GetFunction() const { return nFunction; } void SetUsedHierarchy(long nNew); long GetUsedHierarchy() const { return nUsedHierarchy; } - SC_DLLPUBLIC void SetLayoutName(const String* pName); - SC_DLLPUBLIC const String& GetLayoutName() const; - SC_DLLPUBLIC BOOL HasLayoutName() const; + + void SetLayoutName(const ::rtl::OUString& rName); + const ::rtl::OUString* GetLayoutName() const; + void RemoveLayoutName(); + void SetSubtotalName(const ::rtl::OUString& rName); + const ::rtl::OUString* GetSubtotalName() const; + + bool IsMemberNameInUse(const ::rtl::OUString& rName) const; const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const { return pReferenceValue; } - SC_DLLPUBLIC void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); + void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const { return pSortInfo; } - SC_DLLPUBLIC void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); + void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const { return pAutoShowInfo; } - SC_DLLPUBLIC void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); + void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const { return pLayoutInfo; } - SC_DLLPUBLIC void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); + void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); - SC_DLLPUBLIC void SetCurrentPage( const String* pPage ); // NULL = no selection (all) - SC_DLLPUBLIC BOOL HasCurrentPage() const; - SC_DLLPUBLIC const String& GetCurrentPage() const; + void SetCurrentPage( const String* pPage ); // NULL = no selection (all) + BOOL HasCurrentPage() const; + const String& GetCurrentPage() const; USHORT GetOrientation() const { return nOrientation; } ScDPSaveMember* GetExistingMemberByName(const String& rName); - SC_DLLPUBLIC ScDPSaveMember* GetMemberByName(const String& rName); + ScDPSaveMember* GetMemberByName(const String& rName); void SetMemberPosition( const String& rName, sal_Int32 nNewPos ); void WriteToSource( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface>& xDim ); + + void UpdateMemberVisibility(const ::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData); + + bool HasInvisibleMember() const; }; @@ -179,6 +197,12 @@ private: BOOL bFilterButton; // not passed to DataPilotSource BOOL bDrillDown; // not passed to DataPilotSource + /** if true, all dimensions already have all of their member instances + * created. */ + bool mbDimensionMembersBuilt; + + ::std::auto_ptr<rtl::OUString> mpGrandTotalName; + public: SC_DLLPUBLIC ScDPSaveData(); ScDPSaveData(const ScDPSaveData& r); @@ -188,21 +212,26 @@ public: BOOL operator== ( const ScDPSaveData& r ) const; + SC_DLLPUBLIC void SetGrandTotalName(const ::rtl::OUString& rName); + SC_DLLPUBLIC const ::rtl::OUString* GetGrandTotalName() const; + const List& GetDimensions() const { return aDimList; } void AddDimension(ScDPSaveDimension* pDim) { aDimList.Insert(pDim, LIST_APPEND); } ScDPSaveDimension* GetDimensionByName(const String& rName); SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension(); + SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const; ScDPSaveDimension* DuplicateDimension(const String& rName); SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim); - SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName); + SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName) const; SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const String& rName); void RemoveDimensionByName(const String& rName); ScDPSaveDimension* GetInnermostDimension(USHORT nOrientation); + ScDPSaveDimension* GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation); long GetDataDimensionCount() const; @@ -229,6 +258,14 @@ public: const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; } SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied + void BuildAllDimensionMembers(ScDPTableData* pData); + + /** + * Check whether a dimension has one or more invisible members. + * + * @param rDimName dimension name + */ + SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const; }; diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx index b18ea8e56b76..a2574820da4a 100644 --- a/sc/inc/dptabres.hxx +++ b/sc/inc/dptabres.hxx @@ -41,6 +41,7 @@ #include <hash_map> #include <hash_set> #include <vector> +#include <memory> namespace com { namespace sun { namespace star { namespace sheet { struct DataPilotFieldReference; @@ -262,7 +263,7 @@ public: long GetMeasureCount() const { return nMeasCount; } ScSubTotalFunc GetMeasureFunction(long nMeasure) const; - String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc) const; + String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const; String GetMeasureDimensionName(long nMeasure) const; const ::com::sun::star::sheet::DataPilotFieldReference& GetMeasureRefVal(long nMeasure) const; USHORT GetMeasureRefOrient(long nMeasure) const; @@ -284,6 +285,8 @@ public: const ScDPItemData& rBaseData, long nBaseIndex ) const; BOOL HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, const ScDPItemData& rSecondData, long nSecondIndex ) const; + + const ScDPSource* GetSource() const; }; diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 3b1d8e0e206e..94229f5b1d35 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -33,6 +33,7 @@ #include <vector> #include <hash_map> +#include <memory> #include <tools/string.hxx> #include <tools/list.hxx> #include "global.hxx" // enum ScSubTotalFunc @@ -108,7 +109,7 @@ class ScDPSource : public cppu::WeakImplHelper6< com::sun::star::lang::XServiceInfo > { private: - ScDPTableData* pData; // data source + ScDPTableData* pData; // data source (ScDPObject manages its life time) ScDPDimensions* pDimensions; // api objects // settings: long nColDims[SC_DAPI_MAXFIELDS]; @@ -136,6 +137,8 @@ private: List aRowLevelList; BOOL bResultOverflow; + ::std::auto_ptr<rtl::OUString> mpGrandTotalName; + void CreateRes_Impl(); void FillMemberResults(); void FillLevelList( USHORT nOrientation, List& rList ); @@ -162,11 +165,15 @@ public: ScDPTableData* GetData() { return pData; } const ScDPTableData* GetData() const { return pData; } + void SetGrandTotalName(const ::rtl::OUString& rName); + const ::rtl::OUString* GetGrandTotalName() const; + USHORT GetOrientation(long nColumn); void SetOrientation(long nColumn, USHORT nNew); long GetPosition(long nColumn); long GetDataDimensionCount(); + ScDPDimension* GetDataDimension(long nIndex); String GetDataDimName(long nIndex); BOOL IsDataLayoutDimension(long nDim); USHORT GetDataLayoutOrientation(); @@ -333,12 +340,15 @@ private: long nUsedHier; USHORT nFunction; // enum GeneralFunction String aName; // if empty, take from source + ::std::auto_ptr<rtl::OUString> mpLayoutName; + ::std::auto_ptr<rtl::OUString> mpSubtotalName; long nSourceDim; // >=0 if dup'ed ::com::sun::star::sheet::DataPilotFieldReference aReferenceValue; // settings for "show data as" / "displayed value" BOOL bHasSelectedPage; String aSelectedPage; ScDPItemData* pSelectedData; // internal, temporary, created from aSelectedPage + sal_Bool mbHasHiddenMember; public: ScDPDimension( ScDPSource* pSrc, long nD ); @@ -350,6 +360,9 @@ public: ScDPDimension* CreateCloneObject(); ScDPHierarchies* GetHierarchiesObject(); + SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; + const ::rtl::OUString* GetSubtotalName() const; + // XNamed virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setName( const ::rtl::OUString& aName ) @@ -736,7 +749,7 @@ private: long nLev; ScDPItemData maData; -// String aCaption; // visible name (changeable by user) + ::std::auto_ptr<rtl::OUString> mpLayoutName; sal_Int32 nPosition; // manual sorting BOOL bVisible; @@ -750,6 +763,7 @@ public: BOOL IsNamedItem( const ScDPItemData& r ) const; String GetNameStr() const; void FillItemData( ScDPItemData& rData ) const; + SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; sal_Int32 Compare( const ScDPMember& rOther ) const; // visible order diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index b6d48254d06a..d0be5b0cb897 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -99,6 +99,8 @@ struct CellInfo BOOL bVOverlapped : 1; BOOL bAutoFilter : 1; BOOL bPushButton : 1; + bool bPopupButton: 1; + bool bFilterActive:1; BOOL bPrinted : 1; // bei Bedarf (Pagebreak-Modus) diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 1f6dc13d04ce..c938968ddfef 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -87,8 +87,6 @@ extern "C" { #endif //------------------------------------------------------------------------ -struct LabelData; -//------------------------------------------------------------------------ // die 1000 Namen des Calc... // Clipboard-Namen sind jetzt in so3/soapp.hxx diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx index 1486d3ce480b..df60b2822cb8 100644 --- a/sc/inc/miscuno.hxx +++ b/sc/inc/miscuno.hxx @@ -285,12 +285,29 @@ public: static sal_Int32 GetEnumProperty( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet>& xProp, const ::rtl::OUString& rName, long nDefault ); + static ::rtl::OUString GetStringProperty( + const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xProp, + const ::rtl::OUString& rName, const ::rtl::OUString& rDefault ); static sal_Bool GetBoolFromAny( const com::sun::star::uno::Any& aAny ); static sal_Int16 GetInt16FromAny( const com::sun::star::uno::Any& aAny ); static sal_Int32 GetInt32FromAny( const com::sun::star::uno::Any& aAny ); static sal_Int32 GetEnumFromAny( const com::sun::star::uno::Any& aAny ); static void SetBoolInAny( com::sun::star::uno::Any& rAny, sal_Bool bValue ); + + static void SetOptionalPropertyValue( + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, + const sal_Char* pPropName, const ::com::sun::star::uno::Any& rVal ); + + template<typename ValueType> + static void SetOptionalPropertyValue( + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, + const sal_Char* pPropName, const ValueType& rVal ) + { + ::com::sun::star::uno::Any any; + any <<= rVal; + SetOptionalPropertyValue(rPropSet, pPropName, any); + } }; diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index e77dd60f18bb..100463cb5542 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -53,6 +53,7 @@ #include "address.hxx" #include <vector> +#include <boost/shared_ptr.hpp> class SubTotal; #include "collect.hxx" @@ -69,7 +70,9 @@ class SvStream; class ScDocument; class ScUserListData; class ScProgress; -struct LabelData; +struct ScDPLabelData; + +typedef ::boost::shared_ptr<ScDPLabelData> ScDPLabelDataRef; // ----------------------------------------------------------------------- @@ -93,8 +96,7 @@ struct ScPivotParam SCCOL nCol; // Cursor Position / SCROW nRow; // bzw. Anfang des Zielbereiches SCTAB nTab; - LabelData** ppLabelArr; - SCSIZE nLabels; + ::std::vector<ScDPLabelDataRef> maLabelArray; PivotField aPageArr[PIVOT_MAXPAGEFIELD]; PivotField aColArr[PIVOT_MAXFIELD]; PivotField aRowArr[PIVOT_MAXFIELD]; @@ -115,10 +117,8 @@ struct ScPivotParam ScPivotParam& operator= ( const ScPivotParam& r ); BOOL operator== ( const ScPivotParam& r ) const; //UNUSED2009-05 void Clear (); - void ClearLabelData (); void ClearPivotArrays(); - void SetLabelData ( LabelData** ppLabArr, - SCSIZE nLab ); + void SetLabelData (const ::std::vector<ScDPLabelDataRef>& r); void SetPivotArrays ( const PivotField* pPageArr, const PivotField* pColArr, const PivotField* pRowArr, @@ -136,24 +136,45 @@ typedef PivotField PivotPageFieldArr[PIVOT_MAXPAGEFIELD]; //------------------------------------------------------------------------ -struct LabelData +struct ScDPLabelData { - String maName; /// Visible name of the dimension. + ::rtl::OUString maName; /// Original name of the dimension. + ::rtl::OUString maLayoutName; /// Layout name (display name) SCsCOL mnCol; USHORT mnFuncMask; /// Page/Column/Row subtotal function. sal_Int32 mnUsedHier; /// Used hierarchy. bool mbShowAll; /// true = Show all (also empty) results. bool mbIsValue; /// true = Sum or count in data field. + struct Member + { + ::rtl::OUString maName; + ::rtl::OUString maLayoutName; + bool mbVisible; + bool mbShowDetails; + + Member(); + + /** + * return the name that should be displayed in the dp dialogs i.e. + * when the layout name is present, use it, or else use the original + * name. + */ + ::rtl::OUString SC_DLLPUBLIC getDisplayName() const; + }; + ::std::vector<Member> maMembers; ::com::sun::star::uno::Sequence< ::rtl::OUString > maHiers; /// Hierarchies. - ::com::sun::star::uno::Sequence< ::rtl::OUString > maMembers; /// Members. - ::com::sun::star::uno::Sequence< sal_Bool > maVisible; /// Visibility of members. - ::com::sun::star::uno::Sequence< sal_Bool > maShowDet; /// Show details of members. ::com::sun::star::sheet::DataPilotFieldSortInfo maSortInfo; /// Sorting info. ::com::sun::star::sheet::DataPilotFieldLayoutInfo maLayoutInfo; /// Layout info. ::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo; /// AutoShow info. - explicit LabelData( const String& rName, short nCol, bool bIsValue ); + explicit ScDPLabelData( const String& rName, short nCol, bool bIsValue ); + + /** + * return the name that should be displayed in the dp dialogs i.e. when + * the layout name is present, use it, or else use the original name. + */ + ::rtl::OUString SC_DLLPUBLIC getDisplayName() const; }; // ============================================================================ @@ -171,7 +192,6 @@ struct ScDPFuncData // ============================================================================ -typedef LabelData ScDPLabelData; typedef std::vector< ScDPLabelData > ScDPLabelDataVec; typedef std::vector< String > ScDPNameVec; diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 8d3304867f78..62114c892ec3 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1441,6 +1441,8 @@ #define RID_IMG_H_DROP_URL (BMP_START + 5) #define RID_IMG_H_DROP_LINK (BMP_START + 6) #define RID_IMG_H_DROP_COPY (BMP_START + 7) +#define RID_IMG_SELECT_CURRENT (BMP_START + 8) +#define RID_IMG_UNSELECT_CURRENT (BMP_START + 9) #define RID_SCPTR_PIVOTCOL (BMP_START + 81) #define RID_SCPTR_PIVOTROW (BMP_START + 82) @@ -1632,8 +1634,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_POPUP_FILTER (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; } diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 94084aab4f1b..ba62b9a5de06 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -238,7 +238,7 @@ class AbstractScDPSubtotalDlg : public VclAbstractDialog //add for ScDPSubtotal { public: virtual USHORT GetFuncMask() const = 0; - virtual void FillLabelData( LabelData& rLabelData ) const = 0; + virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0; }; class AbstractScDPNumGroupDlg : public VclAbstractDialog diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 9fda5d522fdc..f400054d00b7 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -294,6 +294,7 @@ public: } ScBaseCell* GetCell( SCCOL nCol, SCROW nRow ) const; + void GetFirstDataPos(SCCOL& rCol, SCROW& rRow) const; void GetLastDataPos(SCCOL& rCol, SCROW& rRow) const; /** Returns the pointer to a cell note object at the passed cell address. */ diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 010e420feb42..18829290eb93 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -561,6 +561,10 @@ #define SC_UNO_ROWFIELDCOUNT "RowFieldCount" #define SC_UNO_COLUMNFIELDCOUNT "ColumnFieldCount" #define SC_UNO_DATAFIELDCOUNT "DataFieldCount" +#define SC_UNO_LAYOUTNAME "LayoutName" +#define SC_UNO_FIELD_SUBTOTALNAME "FieldSubtotalName" +#define SC_UNO_GRANDTOTAL_NAME "GrandTotalName" +#define SC_UNO_HAS_HIDDEN_MEMBER "HasHiddenMember" // (preliminary:) #define SC_UNO_REFVALUE "ReferenceValue" |