From 8599da1e97948cfe7f5730c175b9dc67691a0752 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 17 Sep 2009 15:48:04 -0400 Subject: #i5560# Applied & adjusted for the latest codebase the patches from go-oo. The original patches were contributed by Daniel Watson. --- sc/inc/ViewSettingsSequenceDefines.hxx | 3 ++- sc/inc/globstr.hrc | 5 +++- sc/inc/sc.hrc | 9 +++++++ sc/inc/scabstdlg.hxx | 14 +++++++++++ sc/inc/scextopt.hxx | 2 ++ sc/inc/tabbgcolor.hxx | 46 ++++++++++++++++++++++++++++++++++ sc/inc/unonames.hxx | 2 ++ 7 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 sc/inc/tabbgcolor.hxx (limited to 'sc/inc') diff --git a/sc/inc/ViewSettingsSequenceDefines.hxx b/sc/inc/ViewSettingsSequenceDefines.hxx index 38443e69fc07..ae8340076d06 100644 --- a/sc/inc/ViewSettingsSequenceDefines.hxx +++ b/sc/inc/ViewSettingsSequenceDefines.hxx @@ -64,7 +64,7 @@ // this are the defines for the position of the settings in the // TableViewSettingsSequence -#define SC_TABLE_VIEWSETTINGS_COUNT 14 +#define SC_TABLE_VIEWSETTINGS_COUNT 15 #define SC_CURSOR_X 0 #define SC_CURSOR_Y 1 @@ -80,6 +80,7 @@ #define SC_TABLE_ZOOM_TYPE 11 #define SC_TABLE_ZOOM_VALUE 12 #define SC_TABLE_PAGE_VIEW_ZOOM_VALUE 13 +#define SC_TABLE_TAB_BG_COLOR 14 #define SC_CURSORPOSITIONX "CursorPositionX" #define SC_CURSORPOSITIONY "CursorPositionY" diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 97d77dc06fc5..2728256e1f2b 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_UNDO_SET_TAB_BG_COLOR 435 +#define STR_UNDO_SET_MULTI_TAB_BG_COLOR 436 + +#define STR_COUNT 437 #endif diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 8fb6b929337b..2fa8fb459bc3 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1650,6 +1650,15 @@ #define MID_3 3 #define MID_4 4 +// Sheet tab color +#define FID_TAB_MENU_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 7) +#define FID_TAB_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 8) + +#define SCSTR_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 9) +#define SCSTR_NO_TAB_BG_COLOR (SC_OOO_BUILD_START + 10) + +#define RID_SCDLG_TAB_BG_COLOR (SC_OOO_BUILD_START + 11) + #endif diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index f9895ff15ebb..fb8416e52239 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -284,6 +284,12 @@ public: virtual void GetInputString( String& rString ) const = 0; }; +class AbstractScTabBgColorDlg : public VclAbstractDialog //add for ScTabBgColorDlg +{ +public: + virtual void GetSelectedColor( Color& rColor ) const = 0; +}; + class AbstractScImportOptionsDlg : public VclAbstractDialog //add for ScImportOptionsDlg { public: @@ -423,6 +429,14 @@ public: const String& rDefault, ULONG nHelpId , int nId ) = 0; + + virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg ( Window* pParent, //add for ScTabBgColorDlg + const String& rTitle, //Dialog Title + const String& rTabBgColorNoColorText, //Label for no tab color + const Color& rDefaultColor, //Currently selected Color + ULONG nHelpId , + int nId ) = 0; + virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent, //add for ScImportOptionsDlg int nId, BOOL bAscii = TRUE, diff --git a/sc/inc/scextopt.hxx b/sc/inc/scextopt.hxx index fdf05430cc69..be774ab69c66 100644 --- a/sc/inc/scextopt.hxx +++ b/sc/inc/scextopt.hxx @@ -80,6 +80,8 @@ struct ScExtTabSettings bool mbSelected; /// true = Sheet is selected. bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits. bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode. + Color maTabBgColor; /// Tab Bg Color + bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; explicit ScExtTabSettings(); }; diff --git a/sc/inc/tabbgcolor.hxx b/sc/inc/tabbgcolor.hxx new file mode 100644 index 000000000000..83b694af6219 --- /dev/null +++ b/sc/inc/tabbgcolor.hxx @@ -0,0 +1,46 @@ +/************************************************************************* + * + * 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: tabbgcolor.hxx,v $ + * $Revision: 1.00 $ + * + * 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_TABBGCOLOR_HXX +#define SC_TABBGCOLOR_HXX + +#include +#include + +struct ScUndoSetTabBgColorInfo +{ +public: + SCTAB nTabId; + Color aOldTabBgColor; + Color aNewTabBgColor; + BOOL IsDefaultOldTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;}; + BOOL IsDefaultNewTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;}; +}; +DECLARE_LIST( ScUndoSetTabBgColorInfoList, ScUndoSetTabBgColorInfo* ) +#endif diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 010e420feb42..73fc9cdea301 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -529,6 +529,8 @@ #define SC_UNO_ZOOMTYPE "ZoomType" #define SC_UNO_ZOOMVALUE "ZoomValue" #define SC_UNO_UPDTEMPL "UpdateFromTemplate" +#define SC_UNO_TABCOLOR "TabColor" + /*Stampit enable/disable print cancel */ #define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel" -- cgit From 1520eb90b5077da6d40d892feebd70790d359f25 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 17 Sep 2009 21:50:01 -0400 Subject: Fixed build breakages. Now the whole thing builds. --- sc/inc/sc.hrc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 2fa8fb459bc3..db555a5cc127 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -833,8 +833,10 @@ #define FID_TAB_INDEX (TAB_POPUP_START+6) #define FID_TAB_RTL (TAB_POPUP_START+7) #define FID_TAB_DESELECTALL (TAB_POPUP_START+8) +#define FID_TAB_MENU_SET_TAB_BG_COLOR (TAB_POPUP_START + 9) +#define FID_TAB_SET_TAB_BG_COLOR (TAB_POPUP_START + 10) -#define TAB_POPUP_END (DATA_MENU_END + 20) +#define TAB_POPUP_END (TAB_POPUP_START + 20) #define OBJBAR_FORMAT_START (TAB_POPUP_END) #define SID_ALIGNLEFT (OBJBAR_FORMAT_START+6) @@ -1430,7 +1432,10 @@ #define RID_SCSTR_ONCLICK (STR_START + 402) -#define STR_END RID_SCSTR_ONCLICK +#define SCSTR_SET_TAB_BG_COLOR (STR_START + 403) +#define SCSTR_NO_TAB_BG_COLOR (STR_START + 404) + +#define STR_END (SCSTR_NO_TAB_BG_COLOR) #define BMP_START (STR_END) @@ -1635,8 +1640,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_TAB_BG_COLOR (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,15 +1656,6 @@ #define MID_3 3 #define MID_4 4 -// Sheet tab color -#define FID_TAB_MENU_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 7) -#define FID_TAB_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 8) - -#define SCSTR_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 9) -#define SCSTR_NO_TAB_BG_COLOR (SC_OOO_BUILD_START + 10) - -#define RID_SCDLG_TAB_BG_COLOR (SC_OOO_BUILD_START + 11) - #endif -- cgit From cc0d82f6a35cf377214df4ab10f06ce64188948e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 22 Feb 2010 11:48:02 -0500 Subject: calctabcolor: Added data member to ScTable to store tab color. --- sc/inc/document.hxx | 2 ++ sc/inc/table.hxx | 3 +++ 2 files changed, 5 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index cc575b529d73..2c21d35861ae 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -588,6 +588,8 @@ public: Color& rColor, USHORT& rFlags ) const; SC_DLLPUBLIC void SetScenarioData( SCTAB nTab, const String& rComment, const Color& rColor, USHORT nFlags ); + Color GetTabColor( SCTAB nTab ) const; + void SetTabColor( SCTAB nTab, const Color& rColor ); void GetScenarioFlags( SCTAB nTab, USHORT& rFlags ) const; SC_DLLPUBLIC BOOL IsActiveScenario( SCTAB nTab ) const; SC_DLLPUBLIC void SetActiveScenario( SCTAB nTab, BOOL bActive ); // nur fuer Undo etc. diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index f400054d00b7..3b5a161328f2 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -155,6 +155,7 @@ private: ScRangeList* pScenarioRanges; Color aScenarioColor; + Color aTabColor; USHORT nScenarioFlags; BOOL bActiveScenario; @@ -210,6 +211,8 @@ public: void SetScenarioComment( const String& rComment ) { aComment = rComment; } const Color& GetScenarioColor() const { return aScenarioColor; } void SetScenarioColor(const Color& rNew) { aScenarioColor = rNew; } + const Color& GetTabColor() const; + void SetTabColor(const Color& rColor); USHORT GetScenarioFlags() const { return nScenarioFlags; } void SetScenarioFlags(USHORT nNew) { nScenarioFlags = nNew; } void SetActiveScenario(BOOL bSet) { bActiveScenario = bSet; } -- cgit From e91ccd784a2155f62195d3e80900741f3e6e970f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 22 Feb 2010 14:25:56 -0500 Subject: calctabcolor: Entirely removed storage of tabcolor from ScViewDataTable. --- sc/inc/document.hxx | 5 +++-- sc/inc/table.hxx | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 2c21d35861ae..b3591e9ac03f 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -588,8 +588,9 @@ public: Color& rColor, USHORT& rFlags ) const; SC_DLLPUBLIC void SetScenarioData( SCTAB nTab, const String& rComment, const Color& rColor, USHORT nFlags ); - Color GetTabColor( SCTAB nTab ) const; - void SetTabColor( SCTAB nTab, const Color& rColor ); + Color GetTabBgColor( SCTAB nTab ) const; + void SetTabBgColor( SCTAB nTab, const Color& rColor ); + bool IsDefaultTabBgColor( SCTAB nTab ) const; void GetScenarioFlags( SCTAB nTab, USHORT& rFlags ) const; SC_DLLPUBLIC BOOL IsActiveScenario( SCTAB nTab ) const; SC_DLLPUBLIC void SetActiveScenario( SCTAB nTab, BOOL bActive ); // nur fuer Undo etc. diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 3b5a161328f2..9f3dcdbff5e2 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -155,7 +155,7 @@ private: ScRangeList* pScenarioRanges; Color aScenarioColor; - Color aTabColor; + Color aTabBgColor; USHORT nScenarioFlags; BOOL bActiveScenario; @@ -211,8 +211,8 @@ public: void SetScenarioComment( const String& rComment ) { aComment = rComment; } const Color& GetScenarioColor() const { return aScenarioColor; } void SetScenarioColor(const Color& rNew) { aScenarioColor = rNew; } - const Color& GetTabColor() const; - void SetTabColor(const Color& rColor); + const Color& GetTabBgColor() const; + void SetTabBgColor(const Color& rColor); USHORT GetScenarioFlags() const { return nScenarioFlags; } void SetScenarioFlags(USHORT nNew) { nScenarioFlags = nNew; } void SetActiveScenario(BOOL bSet) { bActiveScenario = bSet; } -- cgit From a29b7cdc581f338473d08079216a06f346e7e6d6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 22 Feb 2010 19:11:55 -0500 Subject: calctabcolor: Export tab colors to ods via UNO's property. --- sc/inc/unowids.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/unowids.hxx b/sc/inc/unowids.hxx index aa75f9cc8404..9b05df2aee52 100644 --- a/sc/inc/unowids.hxx +++ b/sc/inc/unowids.hxx @@ -80,7 +80,8 @@ #define SC_WID_UNO_TABLAYOUT ( SC_WID_UNO_START + 37 ) #define SC_WID_UNO_AUTOPRINT ( SC_WID_UNO_START + 38 ) #define SC_WID_UNO_ABSNAME ( SC_WID_UNO_START + 39 ) -#define SC_WID_UNO_END ( SC_WID_UNO_START + 39 ) +#define SC_WID_UNO_TABCOLOR ( SC_WID_UNO_START + 40 ) +#define SC_WID_UNO_END ( SC_WID_UNO_START + 40 ) inline BOOL IsScUnoWid( USHORT nWid ) -- cgit From 6db6969532e2e4761d7ec1c1486983d6ed23192d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 22 Feb 2010 22:45:22 -0500 Subject: calctabcolor: Reworked Excel import/export to get them to work. --- sc/inc/document.hxx | 6 +++--- sc/inc/scextopt.hxx | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index b3591e9ac03f..39fe74b30669 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -588,9 +588,9 @@ public: Color& rColor, USHORT& rFlags ) const; SC_DLLPUBLIC void SetScenarioData( SCTAB nTab, const String& rComment, const Color& rColor, USHORT nFlags ); - Color GetTabBgColor( SCTAB nTab ) const; - void SetTabBgColor( SCTAB nTab, const Color& rColor ); - bool IsDefaultTabBgColor( SCTAB nTab ) const; + SC_DLLPUBLIC Color GetTabBgColor( SCTAB nTab ) const; + SC_DLLPUBLIC void SetTabBgColor( SCTAB nTab, const Color& rColor ); + SC_DLLPUBLIC bool IsDefaultTabBgColor( SCTAB nTab ) const; void GetScenarioFlags( SCTAB nTab, USHORT& rFlags ) const; SC_DLLPUBLIC BOOL IsActiveScenario( SCTAB nTab ) const; SC_DLLPUBLIC void SetActiveScenario( SCTAB nTab, BOOL bActive ); // nur fuer Undo etc. diff --git a/sc/inc/scextopt.hxx b/sc/inc/scextopt.hxx index be774ab69c66..fdf05430cc69 100644 --- a/sc/inc/scextopt.hxx +++ b/sc/inc/scextopt.hxx @@ -80,8 +80,6 @@ struct ScExtTabSettings bool mbSelected; /// true = Sheet is selected. bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits. bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode. - Color maTabBgColor; /// Tab Bg Color - bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; explicit ScExtTabSettings(); }; -- cgit From 55b416fdb7283c54c6d89ef1d750cca494940ef7 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 23 Feb 2010 17:21:02 -0500 Subject: calctabcolor: More tab to whitespace conversions & removed those ugly "Added by ..." markers. --- sc/inc/scmod.hxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index bf7f8810fec3..5403d086f80f 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -290,13 +290,11 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO void SetInSharedDocSaving( bool bNew ) { mbIsInSharedDocSaving = bNew; } bool IsInSharedDocSaving() const { return mbIsInSharedDocSaving; } - //Added by PengYunQuan for Validity Cell Range Picker }; #define SC_MOD() ( *(ScModule**) GetAppData(SHL_CALC) ) -- cgit From 2ab03deceb3343ca85fe0d87d952329d6ec3dde5 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 23 Feb 2010 19:04:41 -0500 Subject: calctabcolor: Use STL's container instead of using an internal List. We should avoid using List at all cost! --- sc/inc/tabbgcolor.hxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/tabbgcolor.hxx b/sc/inc/tabbgcolor.hxx index 83b694af6219..9c0ad6bf207d 100644 --- a/sc/inc/tabbgcolor.hxx +++ b/sc/inc/tabbgcolor.hxx @@ -30,8 +30,10 @@ #ifndef SC_TABBGCOLOR_HXX #define SC_TABBGCOLOR_HXX -#include -#include +#include "tools/color.hxx" +#include "address.hxx" + +#include struct ScUndoSetTabBgColorInfo { @@ -39,8 +41,13 @@ public: SCTAB nTabId; Color aOldTabBgColor; Color aNewTabBgColor; - BOOL IsDefaultOldTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;}; - BOOL IsDefaultNewTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;}; + bool IsDefaultOldTabBgColor() const { return aOldTabBgColor == Color(COL_AUTO) ? true : false; } + bool IsDefaultNewTabBgColor() const { return aOldTabBgColor == Color(COL_AUTO) ? true : false; } + + explicit ScUndoSetTabBgColorInfo(SCTAB nTab); + ScUndoSetTabBgColorInfo(const ScUndoSetTabBgColorInfo& r); }; -DECLARE_LIST( ScUndoSetTabBgColorInfoList, ScUndoSetTabBgColorInfo* ) + +typedef ::std::vector ScUndoSetTabBgColorInfoList; + #endif -- cgit From 88c02b23be641857baca869a48719512a74019f6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 23 Feb 2010 19:28:46 -0500 Subject: calctabcolor: Cleaned up a bit. 1) Keep the name of a struct shorter. 2) Data members should start with an 'm'. that sort of stuff... --- sc/inc/tabbgcolor.hxx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/tabbgcolor.hxx b/sc/inc/tabbgcolor.hxx index 9c0ad6bf207d..c2b2a63baf65 100644 --- a/sc/inc/tabbgcolor.hxx +++ b/sc/inc/tabbgcolor.hxx @@ -27,6 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ + #ifndef SC_TABBGCOLOR_HXX #define SC_TABBGCOLOR_HXX @@ -35,19 +36,19 @@ #include -struct ScUndoSetTabBgColorInfo +struct ScUndoTabColorInfo { -public: - SCTAB nTabId; - Color aOldTabBgColor; - Color aNewTabBgColor; - bool IsDefaultOldTabBgColor() const { return aOldTabBgColor == Color(COL_AUTO) ? true : false; } - bool IsDefaultNewTabBgColor() const { return aOldTabBgColor == Color(COL_AUTO) ? true : false; } - - explicit ScUndoSetTabBgColorInfo(SCTAB nTab); - ScUndoSetTabBgColorInfo(const ScUndoSetTabBgColorInfo& r); -}; + SCTAB mnTabId; + Color maOldTabBgColor; + Color maNewTabBgColor; + + bool IsDefaultOldTabBgColor() const; + bool IsDefaultNewTabBgColor() const; -typedef ::std::vector ScUndoSetTabBgColorInfoList; + explicit ScUndoTabColorInfo(SCTAB nTab); + ScUndoTabColorInfo(const ScUndoTabColorInfo& r); + + typedef ::std::vector List; +}; #endif -- cgit From 77fc63b415dcdbb231e640be0b401fa1dd604a0f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 23 Feb 2010 23:48:27 -0500 Subject: calctabcolor: Moved 'TabColor' name definition to a more appropriate place. --- sc/inc/unonames.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 541a03a45c63..50fadb8b4a2f 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -176,6 +176,7 @@ #define SC_UNONAME_COPYFORM "CopyFormulas" #define SC_UNONAME_TABLAYOUT "TableLayout" #define SC_UNONAME_AUTOPRINT "AutomaticPrintArea" +#define SC_UNONAME_TABCOLOR "TabColor" // LinkTarget #define SC_UNO_LINKDISPBIT "LinkDisplayBitmap" @@ -529,7 +530,6 @@ #define SC_UNO_ZOOMTYPE "ZoomType" #define SC_UNO_ZOOMVALUE "ZoomValue" #define SC_UNO_UPDTEMPL "UpdateFromTemplate" -#define SC_UNO_TABCOLOR "TabColor" /*Stampit enable/disable print cancel */ #define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel" -- cgit From 474fa54778169a231743efc1542e18cdf45913e1 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 26 Feb 2010 14:08:06 -0500 Subject: calctabcolor: #i109365# Removed some of unused methods. --- sc/inc/AccessibleFilterTopWindow.hxx | 3 --- sc/inc/dociter.hxx | 3 --- 2 files changed, 6 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/AccessibleFilterTopWindow.hxx b/sc/inc/AccessibleFilterTopWindow.hxx index 7d01317c6b8d..55fcb503f51b 100644 --- a/sc/inc/AccessibleFilterTopWindow.hxx +++ b/sc/inc/AccessibleFilterTopWindow.hxx @@ -58,9 +58,6 @@ public: // 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 }; diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx index dd1d18e49a51..f7216b9cff48 100644 --- a/sc/inc/dociter.hxx +++ b/sc/inc/dociter.hxx @@ -206,8 +206,6 @@ private: ::std::auto_ptr mpParam; ::std::auto_ptr mpData; - bool GetThis(Value& rValue); - public: ScDBQueryDataIterator(ScDocument* pDocument, ScDBQueryParamBase* pParam); /// Does NOT reset rValue if no value found! @@ -305,7 +303,6 @@ public: ScBaseCell* GetNext(); SCCOL GetCol() { return nCol; } SCROW GetRow() { return nRow; } - ULONG GetNumberFormat(); // setzt alle Entry.nField einen weiter, wenn Spalte // wechselt, fuer ScInterpreter ScHLookup() -- cgit From 5f676e442a566a27fa13fdc923e0b57ae93d09e1 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 3 Mar 2010 19:22:59 +0100 Subject: tl78: #i109779# password2modify: preparations in oox, import from xlsx --- sc/inc/docuno.hxx | 1 - 1 file changed, 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 95d9ebc35a7c..5eb88952b010 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -117,7 +117,6 @@ private: com::sun::star::uno::Reference GetFormatter(); rtl::OUString maBuildId; - sal_Int32 mnXlsWriteProtPass; protected: const SfxItemPropertySet& GetPropertySet() const { return aPropSet; } -- cgit From 3295b3c835de65c3c407881073025beef57c25e3 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 30 Mar 2010 16:34:51 +0200 Subject: tl78: #i110383# support password to modify --- sc/inc/unonames.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc/inc') diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index f5de35c9d033..1656299c3efb 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -610,6 +610,7 @@ // --> PB 2004-08-23 #i33095# Security Options #define SC_UNO_LOADREADONLY "LoadReadonly" // <-- +#define SC_UNO_MODIFYPASSWORDHASH "ModifyPasswordHash" // FormulaParser #define SC_UNO_COMPILEENGLISH "CompileEnglish" -- cgit From cbedc2f760a642cfb2c19bea504fdea940edb48a Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 21 May 2010 16:46:32 +0200 Subject: dr76: #i103453# import visual area for embedded documents --- sc/inc/scextopt.hxx | 1 - 1 file changed, 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/scextopt.hxx b/sc/inc/scextopt.hxx index b02df9816ef4..d7586fb8df95 100644 --- a/sc/inc/scextopt.hxx +++ b/sc/inc/scextopt.hxx @@ -38,7 +38,6 @@ /** Extended settings for the document, used in import/export filters. */ struct ScExtDocSettings { - ScRange maOleSize; /// Visible range if embedded. String maGlobCodeName; /// Global codename (VBA module name). double mfTabBarWidth; /// Width of the tabbar, relative to frame window width (0.0 ... 1.0). sal_uInt32 mnLinkCnt; /// Recursive counter for loading external documents. -- cgit From b6e1fdef1f74ddc7355db66b089c56ed61aee1c4 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 3 Jun 2010 00:10:45 +0200 Subject: tl78: #i110383# password to modify support for binary types only --- sc/inc/unonames.hxx | 1 - 1 file changed, 1 deletion(-) (limited to 'sc/inc') diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 1656299c3efb..f5de35c9d033 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -610,7 +610,6 @@ // --> PB 2004-08-23 #i33095# Security Options #define SC_UNO_LOADREADONLY "LoadReadonly" // <-- -#define SC_UNO_MODIFYPASSWORDHASH "ModifyPasswordHash" // FormulaParser #define SC_UNO_COMPILEENGLISH "CompileEnglish" -- cgit From 9e19a15a040e7bfabdf051b63f9a28383381741a Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 4 Jun 2010 20:08:33 +0200 Subject: calc55: #i112084# All charts in a Calc document are loaded when saving the document --- sc/inc/chartuno.hxx | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/chartuno.hxx b/sc/inc/chartuno.hxx index 795d655f3d06..fe261f26e517 100644 --- a/sc/inc/chartuno.hxx +++ b/sc/inc/chartuno.hxx @@ -31,6 +31,8 @@ #include "address.hxx" #include #include +#include +#include #include #include @@ -39,6 +41,7 @@ #include #include #include +#include #include @@ -113,12 +116,20 @@ public: }; -class ScChartObj : public cppu::WeakImplHelper4< - com::sun::star::table::XTableChart, - com::sun::star::document::XEmbeddedObjectSupplier, - com::sun::star::container::XNamed, - com::sun::star::lang::XServiceInfo >, - public SfxListener +typedef ::cppu::WeakComponentImplHelper4< + ::com::sun::star::table::XTableChart, + ::com::sun::star::document::XEmbeddedObjectSupplier, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XServiceInfo > ScChartObj_Base; + +typedef ::comphelper::OPropertyContainer ScChartObj_PBase; +typedef ::comphelper::OPropertyArrayUsageHelper< ScChartObj > ScChartObj_PABase; + +class ScChartObj : public ::comphelper::OBaseMutex + ,public ScChartObj_Base + ,public ScChartObj_PBase + ,public ScChartObj_PABase + ,public SfxListener { private: ScDocShell* pDocShell; @@ -128,12 +139,32 @@ private: void Update_Impl( const ScRangeListRef& rRanges, bool bColHeaders, bool bRowHeaders ); void GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool& rRowHeaders ) const; +protected: + // ::comphelper::OPropertySetHelper + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + using ::cppu::OPropertySetHelper::getFastPropertyValue; + virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + + // ::comphelper::OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const; + public: ScChartObj(ScDocShell* pDocSh, SCTAB nT, const String& rN); virtual ~ScChartObj(); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XComponent + virtual void SAL_CALL disposing(); + // XTableChart virtual sal_Bool SAL_CALL getHasColumnHeaders() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setHasColumnHeaders( sal_Bool bHasColumnHeaders ) @@ -163,6 +194,10 @@ public: throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); }; #endif -- cgit From 3de4d76f48fcde2915c94ba6a3541eb6cff69332 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 7 Jun 2010 19:26:06 +0200 Subject: #i94570# keep DataPilot table names unique, get document from DocShell in RefreshDPObject --- sc/inc/dpobject.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc/inc') diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 65e89ec75d41..44aa1daa9a92 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -276,6 +276,7 @@ public: virtual ScDataObject* Clone() const; ScDPObject* operator[](USHORT nIndex) const {return (ScDPObject*)At(nIndex);} + ScDPObject* GetByName(const String& rName) const; void DeleteOnTab( SCTAB nTab ); void UpdateReference( UpdateRefMode eUpdateRefMode, -- cgit From 4b599fe4ed40028ac8eabd87b955188ce1ff6367 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 15 Jun 2010 21:01:57 +0200 Subject: tl78v2: #i112427# Support password to modify in calc and writer ODF documents --- sc/inc/unonames.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc/inc') diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 330251742870..4cf609d3644f 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -612,6 +612,7 @@ // --> PB 2004-08-23 #i33095# Security Options #define SC_UNO_LOADREADONLY "LoadReadonly" // <-- +#define SC_UNO_MODIFYPASSWORDINFO "ModifyPasswordInfo" // FormulaParser #define SC_UNO_COMPILEENGLISH "CompileEnglish" -- cgit From b3579d71c6536ab1d03cc47249d582a574fd054a Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 23 Jun 2010 13:38:34 +0200 Subject: koheirowlimitperf: #i109369# #i109373# #i109384# #i109385# #i109386# #i109387# #i109388# #i109389# #i109391# #i109934# #i109935# #i110116# #i111531# #i111887# #i112190# #i30215# increased the row limit to 1 million, and integrated lots of speed optimization and bug fixes to ensure Calc remains usable after the row limit increase. --- sc/inc/address.hxx | 13 ++-- sc/inc/attarray.hxx | 3 +- sc/inc/column.hxx | 9 ++- sc/inc/dociter.hxx | 19 +++++ sc/inc/document.hxx | 143 +++++++++++++++++-------------------- sc/inc/global.hxx | 9 ++- sc/inc/olinetab.hxx | 20 +++--- sc/inc/segmenttree.hxx | 175 +++++++++++++++++++++++++++++++++++++++++++++ sc/inc/table.hxx | 188 +++++++++++++++++++++++++++++++++++++++++++------ 9 files changed, 454 insertions(+), 125 deletions(-) create mode 100644 sc/inc/segmenttree.hxx (limited to 'sc/inc') diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 3eef919e2f1b..c5d49632292e 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -82,9 +82,10 @@ const SCSIZE SCSIZE_MAX = ::std::numeric_limits::max(); // A define to handle critical sections we hopefully don't need very often. #define SC_ROWLIMIT_MORE_THAN_32K 1 /* set to 1 if we throw the switch */ -// The maximum values. Defines are needed for preprocessor checks in -// bcaslot.cxx, otherwise type safe constants are preferred. -#define MAXROWCOUNT_DEFINE 65536 +// The maximum values. Defines are needed for preprocessor checks, for example +// in bcaslot.cxx, otherwise type safe constants are preferred. +//#define MAXROWCOUNT_DEFINE 65536 +#define MAXROWCOUNT_DEFINE 1048576 #define MAXCOLCOUNT_DEFINE 1024 // Count values @@ -123,7 +124,11 @@ const SCROW SCROW_REPEAT_NONE = SCROW_MAX; // #if SC_ROWLIMIT_MORE_THAN_64K // #error row limit 64k // #endif -#define SC_ROWLIMIT_MORE_THAN_64K 0 /* set to 1 if we throw the switch */ +#if MAXROWCOUNT_DEFINE > 65536 +#define SC_ROWLIMIT_MORE_THAN_64K 1 +#else +#define SC_ROWLIMIT_MORE_THAN_64K 0 +#endif const SCROW SCROWS64K = 65536; // === old stuff defines ===================================================== diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index c82d607577bf..11b21bab0162 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -35,6 +35,7 @@ class ScDocument; class ScMarkArray; class ScPatternAttr; class ScStyleSheet; +class ScFlatBoolRowSegments; class Rectangle; class SfxItemPoolCache; @@ -154,7 +155,7 @@ public: BOOL bRefresh, BOOL bAttrs ); BOOL RemoveAreaMerge( SCROW nStartRow, SCROW nEndRow ); - void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset ); + void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ); BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const; void DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow); diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 503f0975c5c9..af6292bbd830 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -30,7 +30,6 @@ #include "markarr.hxx" #include "global.hxx" -#include "compressedarray.hxx" #include "address.hxx" #include "rangenam.hxx" #include @@ -65,7 +64,7 @@ class ScPostIt; struct ScFunctionData; struct ScLineFlags; struct ScMergePatternState; - +class ScFlatBoolRowSegments; #define COLUMN_DELTA 4 @@ -209,10 +208,10 @@ public: // UpdateSelectionFunction: Mehrfachselektion void UpdateSelectionFunction( const ScMarkData& rMark, ScFunctionData& rData, - const ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags, + ScFlatBoolRowSegments& rHiddenRows, BOOL bDoExclude, SCROW nExStartRow, SCROW nExEndRow ); void UpdateAreaFunction( ScFunctionData& rData, - const ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags, + ScFlatBoolRowSegments& rHiddenRows, SCROW nStartRow, SCROW nEndRow ); void CopyToColumn(SCROW nRow1, SCROW nRow2, USHORT nFlags, BOOL bMarked, @@ -329,7 +328,7 @@ public: const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, BOOL& rFound ) const; const ScStyleSheet* GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRow2 ) const; - void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset ); + void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ); BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const; /// May return -1 if not found diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx index f7216b9cff48..d995550a2f1d 100644 --- a/sc/inc/dociter.hxx +++ b/sc/inc/dociter.hxx @@ -36,6 +36,8 @@ #include +#include + class ScDocument; class ScBaseCell; class ScPatternAttr; @@ -511,6 +513,23 @@ public: const ScBaseCell* GetCell() const { return pFoundCell; } }; +// ============================================================================ + +class ScRowBreakIterator +{ +public: + static SCROW NOT_FOUND; + + explicit ScRowBreakIterator(::std::set& rBreaks); + SCROW first(); + SCROW next(); + +private: + ::std::set& mrBreaks; + ::std::set::const_iterator maItr; + ::std::set::const_iterator maEnd; +}; + #endif diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index cf52a13aceaa..f7ae5e63f165 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -44,6 +44,7 @@ #include #include +#include // Wang Xu Ming -- 2009-8-17 // DataPilot Migration - Cache&&Performance @@ -144,6 +145,7 @@ class SfxUndoManager; class ScFormulaParserPool; struct ScClipParam; struct ScClipRangeNameData; +class ScRowBreakIterator; namespace com { namespace sun { namespace star { namespace lang { @@ -159,6 +161,9 @@ namespace com { namespace sun { namespace star { namespace embed { class XEmbeddedObject; } + namespace sheet { + struct TablePageBreakData; + } } } } #include @@ -381,12 +386,12 @@ private: // kein Broadcast, keine Listener aufbauen waehrend aus einem anderen // Doc (per Filter o.ae.) inserted wird, erst bei CompileAll / CalcAfterLoad BOOL bInsertingFromOtherDoc; - BOOL bImportingXML; // special handling of formula text + bool bLoadingMedium; + bool bImportingXML; // special handling of formula text BOOL bXMLFromWrapper; // distinguish ScXMLImportWrapper from external component BOOL bCalcingAfterLoad; // in CalcAfterLoad TRUE // wenn temporaer keine Listener auf/abgebaut werden sollen BOOL bNoListening; - BOOL bLoadingDone; BOOL bIdleDisabled; BOOL bInLinkUpdate; // TableLink or AreaLink BOOL bChartListenerCollectionNeedsUpdate; @@ -428,8 +433,6 @@ private: sal_Int16 mnNamedRangesLockCount; - inline BOOL RowHidden( SCROW nRow, SCTAB nTab ); // FillInfo - public: SC_DLLPUBLIC ULONG GetCellCount() const; // alle Zellen SCSIZE GetCellCount(SCTAB nTab, SCCOL nCol) const; @@ -928,12 +931,17 @@ public: SCROW& rEndRow, BOOL bNotes = TRUE ) const; void InvalidateTableArea(); + SC_DLLPUBLIC BOOL GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const; + /** + * Find the maximum column position that contains printable data for the + * specified row range. The final column position must be equal or less + * than the initial value of rEndCol. + */ void ExtendPrintArea( OutputDevice* pDev, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow ); - SC_DLLPUBLIC SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, ScDirection eDir ); @@ -1257,19 +1265,20 @@ public: void DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ); void DeleteSelectionTab( SCTAB nTab, USHORT nDelFlag, const ScMarkData& rMark ); - // - SC_DLLPUBLIC void SetColWidth( SCCOL nCol, SCTAB nTab, USHORT nNewWidth ); SC_DLLPUBLIC void SetRowHeight( SCROW nRow, SCTAB nTab, USHORT nNewHeight ); SC_DLLPUBLIC void SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, USHORT nNewHeight ); - void SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bManual ); + + SC_DLLPUBLIC void SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, + USHORT nNewHeight ); + void SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bManual ); SC_DLLPUBLIC USHORT GetColWidth( SCCOL nCol, SCTAB nTab ) const; - SC_DLLPUBLIC USHORT GetRowHeight( SCROW nRow, SCTAB nTab ) const; + SC_DLLPUBLIC USHORT GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero = true ) const; SC_DLLPUBLIC ULONG GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const; - ULONG GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale ) const; - SC_DLLPUBLIC const ScSummableCompressedArray< SCROW, USHORT> & GetRowHeightArray( SCTAB nTab ) const; + SCROW GetRowForHeight( SCTAB nTab, ULONG nHeight ) const; + ULONG GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale ) const; SC_DLLPUBLIC ULONG GetColOffset( SCCOL nCol, SCTAB nTab ) const; SC_DLLPUBLIC ULONG GetRowOffset( SCROW nRow, SCTAB nTab ) const; @@ -1278,22 +1287,6 @@ public: USHORT GetCommonWidth( SCCOL nEndCol, SCTAB nTab ) const; - // All FastGet...() methods have no check for valid nTab! - // They access ScCompressedArray objects, so using the - // single row taking ones in loops to access a sequence of - // single rows is no good idea! Use specialized range - // taking methods instead, or iterators. - SC_DLLPUBLIC ULONG FastGetRowHeight( SCROW nStartRow, SCROW nEndRow, - SCTAB nTab ) const; - inline ULONG FastGetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, - SCTAB nTab, double fScale ) const; - SC_DLLPUBLIC inline USHORT FastGetRowHeight( SCROW nRow, SCTAB nTab ) const; - inline SCROW FastGetRowForHeight( SCTAB nTab, ULONG nHeight ) const; - inline SCROW FastGetFirstNonHiddenRow( SCROW nStartRow, SCTAB nTab ) const; - /** No check for flags whether row is hidden, height value - is returned unconditionally. */ - inline USHORT FastGetOriginalRowHeight( SCROW nRow, SCTAB nTab ) const; - SCROW GetHiddenRowCount( SCROW nRow, SCTAB nTab ) const; USHORT GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev, @@ -1330,6 +1323,44 @@ public: SC_DLLPUBLIC const ScBitMaskCompressedArray< SCROW, BYTE> & GetRowFlagsArray( SCTAB nTab ) const; SC_DLLPUBLIC ScBitMaskCompressedArray< SCROW, BYTE> & GetRowFlagsArrayModifiable( SCTAB nTab ); + SC_DLLPUBLIC void GetAllRowBreaks(::std::set& rBreaks, SCTAB nTab, bool bPage, bool bManual) const; + SC_DLLPUBLIC void GetAllColBreaks(::std::set& rBreaks, SCTAB nTab, bool bPage, bool bManual) const; + SC_DLLPUBLIC ScBreakType HasRowBreak(SCROW nRow, SCTAB nTab) const; + SC_DLLPUBLIC ScBreakType HasColBreak(SCCOL nCol, SCTAB nTab) const; + SC_DLLPUBLIC void SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual); + SC_DLLPUBLIC void SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual); + void RemoveRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual); + void RemoveColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual); + ::com::sun::star::uno::Sequence< + ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const; + + SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); + SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow); + SC_DLLPUBLIC bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol); + SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); + SC_DLLPUBLIC void SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden); + SC_DLLPUBLIC void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden); + SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + SC_DLLPUBLIC SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + + bool RowFiltered(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); + bool HasFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + bool ColFiltered(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); + SC_DLLPUBLIC void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bFiltered); + SC_DLLPUBLIC void SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bFiltered); + SCROW FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); + + /** + * Write all column row flags to table's flag data, because not all column + * row attributes are stored in the flag data members. This is necessary + * for ods export. + */ + void SyncColRowFlags(); + /// @return the index of the last row with any set flags (auto-pagebreak is ignored). SC_DLLPUBLIC SCROW GetLastFlaggedRow( SCTAB nTab ) const; @@ -1351,8 +1382,6 @@ public: BOOL GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault); BOOL GetRowDefault( SCTAB nTab, SCROW nRow, SCCOL nLastCol, SCCOL& nDefault); - BOOL IsFiltered( SCROW nRow, SCTAB nTab ) const; - BOOL UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, BOOL bShow ); BOOL UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bShow ); @@ -1369,6 +1398,7 @@ public: Size GetPageSize( SCTAB nTab ) const; void SetPageSize( SCTAB nTab, const Size& rSize ); void SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow ); + void InvalidatePageBreaks(SCTAB nTab); void UpdatePageBreaks( SCTAB nTab, const ScRange* pUserArea = NULL ); void RemoveManualBreaks( SCTAB nTab ); BOOL HasManualBreaks( SCTAB nTab ) const; @@ -1465,8 +1495,6 @@ public: void DoColResize( SCTAB nTab, SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd ); - // Idleberechnung der OutputDevice-Zelltextbreite - BOOL IsLoadingDone() const { return bLoadingDone; } void InvalidateTextWidth( const String& rStyleName ); void InvalidateTextWidth( SCTAB nTab ); void InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, BOOL bNumFormatChanged ); @@ -1503,8 +1531,9 @@ public: BOOL GetNoSetDirty() const { return bNoSetDirty; } void SetInsertingFromOtherDoc( BOOL bVal ) { bInsertingFromOtherDoc = bVal; } BOOL IsInsertingFromOtherDoc() const { return bInsertingFromOtherDoc; } - void SetImportingXML( BOOL bVal ); - BOOL IsImportingXML() const { return bImportingXML; } + void SetLoadingMedium( bool bVal ); + void SetImportingXML( bool bVal ); + bool IsImportingXML() const { return bImportingXML; } void SetXMLFromWrapper( BOOL bVal ); BOOL IsXMLFromWrapper() const { return bXMLFromWrapper; } void SetCalcingAfterLoad( BOOL bVal ) { bCalcingAfterLoad = bVal; } @@ -1761,6 +1790,7 @@ public: SfxUndoManager* GetUndoManager(); bool IsInVBAMode() const; + ScRowBreakIterator* GetRowBreakIterator(SCTAB nTab) const; private: // CLOOK-Impl-Methoden @@ -1823,53 +1853,6 @@ inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab ) mSheetSortParams[ nTab ] = rParam; } - -inline ULONG ScDocument::FastGetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, - SCTAB nTab, double fScale ) const -{ - return pTab[nTab]->pRowFlags->SumScaledCoupledArrayForCondition( nStartRow, - nEndRow, CR_HIDDEN, 0, *(pTab[nTab]->pRowHeight), fScale); -} - -inline USHORT ScDocument::FastGetRowHeight( SCROW nRow, SCTAB nTab ) const -{ - return ( pTab[nTab]->pRowFlags->GetValue(nRow) & CR_HIDDEN ) ? 0 : - pTab[nTab]->pRowHeight->GetValue(nRow); -} - -inline SCROW ScDocument::FastGetRowForHeight( SCTAB nTab, ULONG nHeight ) const -{ - ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter( - *(pTab[nTab]->pRowFlags), 0, MAXROW, CR_HIDDEN, 0, - *(pTab[nTab]->pRowHeight)); - ULONG nSum = 0; - for ( ; aIter; aIter.NextRange() ) - { - ULONG nNew = *aIter * (aIter.GetRangeEnd() - aIter.GetRangeStart() + 1); - if (nSum + nNew > nHeight) - { - for ( ; aIter && nSum <= nHeight; ++aIter ) - { - nSum += *aIter; - } - return aIter.GetPos(); - } - nSum += nNew; - } - return aIter.GetPos(); -} - -inline SCROW ScDocument::FastGetFirstNonHiddenRow( SCROW nStartRow, SCTAB nTab) const -{ - return pTab[nTab]->pRowFlags->GetFirstForCondition( nStartRow, MAXROW, - CR_HIDDEN, 0); -} - -inline USHORT ScDocument::FastGetOriginalRowHeight( SCROW nRow, SCTAB nTab ) const -{ - return pTab[nTab]->pRowHeight->GetValue(nRow); -} - #endif diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 23668aa6813d..8178eb4a01d2 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -203,13 +203,16 @@ const SCSIZE PIVOT_MAXPAGEFIELD = 10; // FILTERED und MANUALSIZE nur fuer Zeilen moeglich const BYTE CR_HIDDEN = 1; //const BYTE CR_MARKED = 2; -const BYTE CR_PAGEBREAK = 4; +//const BYTE CR_PAGEBREAK = 4; const BYTE CR_MANUALBREAK = 8; const BYTE CR_FILTERED = 16; const BYTE CR_MANUALSIZE = 32; +const BYTE CR_ALL = (CR_HIDDEN | CR_MANUALBREAK | CR_FILTERED | CR_MANUALSIZE); -// was davon kommt in die Datei: -#define CR_SAVEMASK ( ~CR_PAGEBREAK ) +typedef BYTE ScBreakType; +const ScBreakType BREAK_NONE = 0; +const ScBreakType BREAK_PAGE = 1; +const ScBreakType BREAK_MANUAL = 2; // Insert-/Delete-Flags const USHORT IDF_NONE = 0x0000; diff --git a/sc/inc/olinetab.hxx b/sc/inc/olinetab.hxx index 3ffc03f4a249..82a49b3ba025 100644 --- a/sc/inc/olinetab.hxx +++ b/sc/inc/olinetab.hxx @@ -30,24 +30,24 @@ #include "collect.hxx" -#include "compressedarray.hxx" #include "scdllapi.h" #define SC_OL_MAXDEPTH 7 class SvStream; +class ScTable; class ScOutlineEntry : public ScDataObject { SCCOLROW nStart; SCSIZE nSize; - BOOL bHidden; - BOOL bVisible; + bool bHidden; + bool bVisible; public: ScOutlineEntry( SCCOLROW nNewStart, SCCOLROW nNewSize, - BOOL bNewHidden = FALSE ); + bool bNewHidden = FALSE ); ScOutlineEntry( const ScOutlineEntry& rEntry ); virtual ScDataObject* Clone() const; @@ -55,14 +55,14 @@ public: SCCOLROW GetStart() const { return nStart; } SCSIZE GetSize() const { return nSize; } SCCOLROW GetEnd() const { return nStart+nSize-1; } - BOOL IsHidden() const { return bHidden; } // Gruppe versteckt - BOOL IsVisible() const { return bVisible; } // Control sichtbar? + bool IsHidden() const { return bHidden; } // Gruppe versteckt + bool IsVisible() const { return bVisible; } // Control sichtbar? void Move( SCsCOLROW nDelta ); void SetSize( SCSIZE nNewSize ); void SetPosSize( SCCOLROW nNewPos, SCSIZE nNewSize ); - void SetHidden( BOOL bNewHidden ); - void SetVisible( BOOL bNewVisible ); + void SetHidden( bool bNewHidden ); + void SetVisible( bool bNewVisible ); }; @@ -123,9 +123,7 @@ public: void InsertSpace( SCCOLROW nStartPos, SCSIZE nSize ); BOOL DeleteSpace( SCCOLROW nStartPos, SCSIZE nSize ); - BOOL ManualAction( SCCOLROW nStartPos, SCCOLROW nEndPos, - BOOL bShow, - const ScBitMaskCompressedArray< SCCOLROW, BYTE>& rHiddenFlags ); + bool ManualAction( SCCOLROW nStartPos, SCCOLROW nEndPos, bool bShow, ScTable& rTable, bool bCol ); void RemoveAll(); }; diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx new file mode 100644 index 000000000000..2900ad398149 --- /dev/null +++ b/sc/inc/segmenttree.hxx @@ -0,0 +1,175 @@ +/************************************************************************* + * + * 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: compressedarray.hxx,v $ + * $Revision: 1.7.32.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SEGMENTTREE_HXX +#define SC_SEGMENTTREE_HXX + +#include "address.hxx" + +#include + +class ScFlatBoolSegmentsImpl; + +class ScFlatBoolRowSegments +{ +public: + struct RangeData + { + SCROW mnRow1; + SCROW mnRow2; + bool mbValue; + }; + + class ForwardIterator + { + public: + explicit ForwardIterator(ScFlatBoolRowSegments& rSegs); + + bool getValue(SCROW nPos, bool& rVal); + SCROW getLastPos() const; + + private: + ScFlatBoolRowSegments& mrSegs; + + SCROW mnCurPos; + SCROW mnLastPos; + bool mbCurValue; + }; + + class RangeIterator + { + public: + explicit RangeIterator(ScFlatBoolRowSegments& rSegs); + bool getFirst(RangeData& rRange); + bool getNext(RangeData& rRange); + private: + ScFlatBoolRowSegments& mrSegs; + }; + + ScFlatBoolRowSegments(); + ScFlatBoolRowSegments(const ScFlatBoolRowSegments& r); + ~ScFlatBoolRowSegments(); + + void setTrue(SCROW nRow1, SCROW nRow2); + void setFalse(SCROW nRow1, SCROW nRow2); + bool getValue(SCROW nRow); + bool getRangeData(SCROW nRow, RangeData& rData); + void removeSegment(SCROW nRow1, SCROW nRow2); + void insertSegment(SCROW nRow, SCROW nSize, bool bSkipStartBoundary); + + SCROW findLastNotOf(bool bValue) const; + + void enableTreeSearch(bool bEnable); + void setInsertFromBack(bool bInsertFromBack); + +private: + ::std::auto_ptr mpImpl; +}; + +// ============================================================================ + +class ScFlatBoolColSegments +{ +public: + struct RangeData + { + SCCOL mnCol1; + SCCOL mnCol2; + bool mbValue; + }; + ScFlatBoolColSegments(); + ScFlatBoolColSegments(const ScFlatBoolColSegments& r); + ~ScFlatBoolColSegments(); + + void setTrue(SCCOL nCol1, SCCOL nCol2); + void setFalse(SCCOL nCol1, SCCOL nCol2); + bool getValue(SCCOL nCol); + bool getRangeData(SCCOL nCol, RangeData& rData); + void removeSegment(SCCOL nCol1, SCCOL nCol2); + void insertSegment(SCCOL nCol, SCCOL nSize, bool bSkipStartBoundary); + + void enableTreeSearch(bool bEnable); + void setInsertFromBack(bool bInsertFromBack); + +private: + ::std::auto_ptr mpImpl; +}; + +// ============================================================================ + +class ScFlatUInt16SegmentsImpl; + +class ScFlatUInt16RowSegments +{ +public: + struct RangeData + { + SCROW mnRow1; + SCROW mnRow2; + sal_uInt16 mnValue; + }; + + class ForwardIterator + { + public: + explicit ForwardIterator(ScFlatUInt16RowSegments& rSegs); + + bool getValue(SCROW nPos, sal_uInt16& rVal); + SCROW getLastPos() const; + + private: + ScFlatUInt16RowSegments& mrSegs; + + SCROW mnCurPos; + SCROW mnLastPos; + sal_uInt16 mnCurValue; + }; + + ScFlatUInt16RowSegments(sal_uInt16 nDefault); + ScFlatUInt16RowSegments(const ScFlatUInt16RowSegments& r); + ~ScFlatUInt16RowSegments(); + + void setValue(SCROW nRow1, SCROW nRow2, sal_uInt16 nValue); + sal_uInt16 getValue(SCROW nRow); + sal_uInt32 getSumValue(SCROW nRow1, SCROW nRow2); + bool getRangeData(SCROW nRow, RangeData& rData); + void removeSegment(SCROW nRow1, SCROW nRow2); + void insertSegment(SCROW nRow, SCROW nSize, bool bSkipStartBoundary); + + SCROW findLastNotOf(sal_uInt16 nValue) const; + + void enableTreeSearch(bool bEnable); + void setInsertFromBack(bool bInsertFromBack); + +private: + ::std::auto_ptr mpImpl; +}; + +#endif diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 6cc5a4d16aaa..78e5875b6879 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -39,12 +39,20 @@ #include "compressedarray.hxx" #include +#include +#include namespace utl { class SearchParam; class TextSearch; } +namespace com { namespace sun { namespace star { + namespace sheet { + struct TablePageBreakData; + } +} } } + class SfxItemSet; class SfxStyleSheetBase; class SvxBoxInfoItem; @@ -73,6 +81,9 @@ struct RowInfo; struct ScFunctionData; struct ScLineFlags; class CollatorWrapper; +class ScFlatUInt16RowSegments; +class ScFlatBoolRowSegments; +class ScFlatBoolColSegments; class ScTable @@ -112,10 +123,19 @@ private: ::std::auto_ptr pTabProtection; USHORT* pColWidth; - ScSummableCompressedArray< SCROW, USHORT>* pRowHeight; + ::boost::shared_ptr mpRowHeights; BYTE* pColFlags; ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags; + ::boost::shared_ptr mpHiddenCols; + ::boost::shared_ptr mpHiddenRows; + ::boost::shared_ptr mpFilteredCols; + ::boost::shared_ptr mpFilteredRows; + + ::std::set maRowPageBreaks; + ::std::set maRowManualBreaks; + ::std::set maColPageBreaks; + ::std::set maColManualBreaks; ScOutlineTable* pOutlineTable; @@ -160,6 +180,7 @@ private: Color aTabBgColor; USHORT nScenarioFlags; BOOL bActiveScenario; + bool mbPageBreaksValid; friend class ScDocument; // fuer FillInfo friend class ScDocumentIterator; @@ -377,7 +398,8 @@ public: void CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const; - void InvalidateTableArea() { bTableAreaValid = FALSE; } + void InvalidateTableArea(); + void InvalidatePageBreaks(); BOOL GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const; // FALSE = leer BOOL GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const; @@ -476,7 +498,7 @@ public: SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc); - void FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 ) const; + void FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 ); void GetBorderLines( SCCOL nCol, SCROW nRow, const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop, @@ -593,29 +615,49 @@ public: void SetRowHeight( SCROW nRow, USHORT nNewHeight ); BOOL SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeight, double nPPTX, double nPPTY ); + + /** + * Set specified row height to specified ranges. Don't check for drawing + * objects etc. Just set the row height. Nothing else. + * + * Note that setting a new row height via this function will not + * invalidate page breaks. + */ + void SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeight ); + // nPPT fuer Test auf Veraenderung void SetManualHeight( SCROW nStartRow, SCROW nEndRow, BOOL bManual ); - USHORT GetColWidth( SCCOL nCol ) const; - USHORT GetRowHeight( SCROW nRow ) const; - ULONG GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const; - ULONG GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ) const; - ULONG GetColOffset( SCCOL nCol ) const; - ULONG GetRowOffset( SCROW nRow ) const; + USHORT GetColWidth( SCCOL nCol ); + SC_DLLPUBLIC USHORT GetRowHeight( SCROW nRow, SCROW* pStartRow = NULL, SCROW* pEndRow = NULL, bool bHiddenAsZero = true ); + ULONG GetRowHeight( SCROW nStartRow, SCROW nEndRow ); + ULONG GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ); + ULONG GetColOffset( SCCOL nCol ); + ULONG GetRowOffset( SCROW nRow ); + + /** + * Get the last row such that the height of row 0 to the end row is as + * high as possible without exceeding the specified height value. + * + * @param nHeight maximum desired height + * + * @return SCROW last row of the range within specified height. + */ + SCROW GetRowForHeight(ULONG nHeight); USHORT GetOriginalWidth( SCCOL nCol ) const; USHORT GetOriginalHeight( SCROW nRow ) const; - USHORT GetCommonWidth( SCCOL nEndCol ) const; + USHORT GetCommonWidth( SCCOL nEndCol ); - SCROW GetHiddenRowCount( SCROW nRow ) const; + SCROW GetHiddenRowCount( SCROW nRow ); - void ShowCol(SCCOL nCol, BOOL bShow); - void ShowRow(SCROW nRow, BOOL bShow); - void DBShowRow(SCROW nRow, BOOL bShow); + void ShowCol(SCCOL nCol, bool bShow); + void ShowRow(SCROW nRow, bool bShow); + void DBShowRow(SCROW nRow, bool bShow); - void ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow); - void DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow); + void ShowRows(SCROW nRow1, SCROW nRow2, bool bShow); + void DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow); void SetColFlags( SCCOL nCol, BYTE nNewFlags ); void SetRowFlags( SCROW nRow, BYTE nNewFlags ); @@ -629,15 +671,11 @@ public: /// @return the index of the last changed row (flags and row height, auto pagebreak is ignored). SCROW GetLastChangedRow() const; - BOOL IsFiltered(SCROW nRow) const; - BYTE GetColFlags( SCCOL nCol ) const; BYTE GetRowFlags( SCROW nRow ) const; const ScBitMaskCompressedArray< SCROW, BYTE> * GetRowFlagsArray() const { return pRowFlags; } - const ScSummableCompressedArray< SCROW, USHORT> * GetRowHeightArray() const - { return pRowHeight; } BOOL UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, BOOL bShow ); BOOL UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, BOOL bShow ); @@ -646,6 +684,63 @@ public: void RemoveManualBreaks(); BOOL HasManualBreaks() const; + void GetAllRowBreaks(::std::set& rBreaks, bool bPage, bool bManual) const; + void GetAllColBreaks(::std::set& rBreaks, bool bPage, bool bManual) const; + bool HasRowPageBreak(SCROW nRow) const; + bool HasColPageBreak(SCCOL nCol) const; + bool HasRowManualBreak(SCROW nRow) const; + bool HasColManualBreak(SCCOL nCol) const; + + /** + * Get the row position of the next manual break that occurs at or below + * specified row. When no more manual breaks are present at or below + * the specified row, -1 is returned. + * + * @param nRow row at which the search begins. + * + * @return SCROW next row position with manual page break, or -1 if no + * more manual breaks are present. + */ + SCROW GetNextManualBreak(SCROW nRow) const; + + void RemoveRowPageBreaks(SCROW nStartRow, SCROW nEndRow); + void RemoveRowBreak(SCROW nRow, bool bPage, bool bManual); + void RemoveColBreak(SCCOL nCol, bool bPage, bool bManual); + void SetRowBreak(SCROW nRow, bool bPage, bool bManual); + void SetColBreak(SCCOL nCol, bool bPage, bool bManual); + ::com::sun::star::uno::Sequence< + ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData() const; + + bool RowHidden(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); + bool RowHidden(SCROW nRow, SCROW& rLastRow); + bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow); + bool ColHidden(SCCOL nCol, SCCOL& rLastCol); + bool ColHidden(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); + void SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden); + void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden); + void CopyColHidden(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol); + void CopyRowHidden(ScTable& rTable, SCROW nStartRow, SCROW nEndRow); + void CopyRowHeight(ScTable& rSrcTable, SCROW nStartRow, SCROW nEndRow, SCROW nSrcOffset); + SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow); + SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow); + SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow); + sal_uInt32 GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow); + + SCCOLROW LastHiddenColRow(SCCOLROW nPos, bool bCol); + + bool RowFiltered(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); + bool ColFiltered(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); + bool HasFilteredRows(SCROW nStartRow, SCROW nEndRow); + void CopyColFiltered(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol); + void CopyRowFiltered(ScTable& rTable, SCROW nStartRow, SCROW nEndRow); + void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, bool bFiltered); + void SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, bool bFiltered); + SCROW FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow); + SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow); + SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow); + + void SyncColRowFlags(); + void StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); void ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); @@ -763,14 +858,65 @@ private: void StartNeededListeners(); // only for cells where NeedsListening()==TRUE void SetRelNameDirty(); + void SetLoadingMedium(bool bLoading); + SCSIZE FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2, SCCOL nCol, SCROW nAttrRow1, SCROW nAttrRow2, SCSIZE nArrY, - const ScPatternAttr* pPattern, const SfxItemSet* pCondSet ) const; + const ScPatternAttr* pPattern, const SfxItemSet* pCondSet ); // idle calculation of OutputDevice text width for cell // also invalidates script type, broadcasts for "calc as shown" void InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, BOOL bNumFormatChanged, BOOL bBroadcast ); + + /** + * In case the cell text goes beyond the column width, move the max column + * position to the right. This is called from ExtendPrintArea. + */ + void MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY); + + /** + * Use this to iterate through non-empty visible cells in a single column. + */ + class VisibleDataCellIterator + { + public: + static SCROW ROW_NOT_FOUND; + + explicit VisibleDataCellIterator(ScFlatBoolRowSegments& rRowSegs, ScColumn& rColumn); + ~VisibleDataCellIterator(); + + /** + * Set the start row position. In case there is not visible data cell + * at the specified row position, it will move to the position of the + * first visible data cell below that point. + * + * @return First visible data cell if found, or NULL otherwise. + */ + ScBaseCell* reset(SCROW nRow); + + /** + * Find the next visible data cell position. + * + * @return Next visible data cell if found, or NULL otherwise. + */ + ScBaseCell* next(); + + /** + * Get the current row position. + * + * @return Current row position, or ROW_NOT_FOUND if the iterator + * doesn't point to a valid data cell position. + */ + SCROW getRow() const; + + private: + ScFlatBoolRowSegments& mrRowSegs; + ScColumn& mrColumn; + ScBaseCell* mpCell; + SCROW mnCurRow; + SCROW mnUBound; + }; }; -- cgit From 686b7955271806e65222a3a4bfe97365cab33a06 Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 24 Jun 2010 07:06:05 +0200 Subject: masterfix: #i10000# change fileheader --- sc/inc/segmenttree.hxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx index 2900ad398149..195331c750ad 100644 --- a/sc/inc/segmenttree.hxx +++ b/sc/inc/segmenttree.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: compressedarray.hxx,v $ - * $Revision: 1.7.32.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify -- cgit