summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-07-27 17:12:01 +0200
committerDaniel Rentz <dr@openoffice.org>2010-07-27 17:12:01 +0200
commiteba961a2cc1b857d1fb6d7b3a2210253ae8a4feb (patch)
tree71fa16b98c6fd435e614fa8a91ff7a7fbf725f0a /sc/inc
parent7be8a197e4832b71bdedcf64d1ab2278d1244f5e (diff)
parent686b7955271806e65222a3a4bfe97365cab33a06 (diff)
mib17: rebase to DEV300_m84
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/AccessibleFilterTopWindow.hxx3
-rw-r--r--sc/inc/ViewSettingsSequenceDefines.hxx3
-rw-r--r--sc/inc/address.hxx13
-rw-r--r--sc/inc/attarray.hxx3
-rw-r--r--sc/inc/chartuno.hxx47
-rw-r--r--sc/inc/column.hxx9
-rw-r--r--sc/inc/dociter.hxx22
-rw-r--r--sc/inc/document.hxx146
-rw-r--r--sc/inc/docuno.hxx1
-rw-r--r--sc/inc/dpobject.hxx1
-rw-r--r--sc/inc/global.hxx9
-rw-r--r--sc/inc/globstr.hrc8
-rw-r--r--sc/inc/olinetab.hxx20
-rw-r--r--sc/inc/sc.hrc14
-rw-r--r--sc/inc/scabstdlg.hxx14
-rw-r--r--sc/inc/scextopt.hxx1
-rw-r--r--sc/inc/scmod.hxx2
-rw-r--r--sc/inc/segmenttree.hxx172
-rw-r--r--sc/inc/tabbgcolor.hxx54
-rw-r--r--sc/inc/table.hxx191
-rw-r--r--sc/inc/unonames.hxx3
-rw-r--r--sc/inc/unowids.hxx3
22 files changed, 590 insertions, 149 deletions
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/ViewSettingsSequenceDefines.hxx b/sc/inc/ViewSettingsSequenceDefines.hxx
index 9e787ea590fe..f23229d31a43 100644
--- a/sc/inc/ViewSettingsSequenceDefines.hxx
+++ b/sc/inc/ViewSettingsSequenceDefines.hxx
@@ -61,7 +61,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
@@ -77,6 +77,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/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<SCSIZE>::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/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 <svl/lstner.hxx>
#include <tools/string.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/propertycontainer.hxx>
#include <com/sun/star/table/XTableChart.hpp>
#include <com/sun/star/table/XTableCharts.hpp>
@@ -39,6 +41,7 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
+#include <cppuhelper/compbase4.hxx>
#include <cppuhelper/implbase4.hxx>
@@ -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
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 <tools/solar.h>
@@ -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 dd1d18e49a51..d995550a2f1d 100644
--- a/sc/inc/dociter.hxx
+++ b/sc/inc/dociter.hxx
@@ -36,6 +36,8 @@
#include <memory>
+#include <set>
+
class ScDocument;
class ScBaseCell;
class ScPatternAttr;
@@ -206,8 +208,6 @@ private:
::std::auto_ptr<ScDBQueryParamBase> mpParam;
::std::auto_ptr<DataAccess> mpData;
- bool GetThis(Value& rValue);
-
public:
ScDBQueryDataIterator(ScDocument* pDocument, ScDBQueryParamBase* pParam);
/// Does NOT reset rValue if no value found!
@@ -305,7 +305,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()
@@ -514,6 +513,23 @@ public:
const ScBaseCell* GetCell() const { return pFoundCell; }
};
+// ============================================================================
+
+class ScRowBreakIterator
+{
+public:
+ static SCROW NOT_FOUND;
+
+ explicit ScRowBreakIterator(::std::set<SCROW>& rBreaks);
+ SCROW first();
+ SCROW next();
+
+private:
+ ::std::set<SCROW>& mrBreaks;
+ ::std::set<SCROW>::const_iterator maItr;
+ ::std::set<SCROW>::const_iterator maEnd;
+};
+
#endif
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 47d4193accb1..83896f76378d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -44,6 +44,7 @@
#include <memory>
#include <map>
+#include <set>
// 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 {
@@ -162,6 +164,9 @@ namespace com { namespace sun { namespace star {
namespace script { namespace vba {
class XVBAEventProcessor;
} }
+ namespace sheet {
+ struct TablePageBreakData;
+ }
} } }
#include <svl/zforlist.hxx>
@@ -388,12 +393,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;
@@ -435,8 +440,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;
@@ -623,6 +626,9 @@ public:
Color& rColor, USHORT& rFlags ) const;
SC_DLLPUBLIC void SetScenarioData( SCTAB nTab, const String& rComment,
const Color& rColor, USHORT nFlags );
+ 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.
@@ -933,12 +939,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 );
@@ -1262,19 +1273,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;
@@ -1283,22 +1295,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,
@@ -1335,6 +1331,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<SCROW>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const;
+ SC_DLLPUBLIC void GetAllColBreaks(::std::set<SCCOL>& 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;
@@ -1356,8 +1390,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 );
@@ -1374,6 +1406,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;
@@ -1470,8 +1503,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 );
@@ -1508,8 +1539,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; }
@@ -1771,6 +1803,7 @@ public:
SfxUndoManager* GetUndoManager();
bool IsInVBAMode() const;
+ ScRowBreakIterator* GetRowBreakIterator(SCTAB nTab) const;
private: // CLOOK-Impl-Methoden
@@ -1833,53 +1866,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/docuno.hxx b/sc/inc/docuno.hxx
index 2c3ecee39e32..14c9515dfacb 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -115,7 +115,6 @@ private:
void HandleCalculateEvents();
rtl::OUString maBuildId;
- sal_Int32 mnXlsWriteProtPass;
protected:
const SfxItemPropertySet& GetPropertySet() const { return aPropSet; }
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,
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/globstr.hrc b/sc/inc/globstr.hrc
index a9c1997f74f5..31934067988a 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -571,9 +571,13 @@
#define STR_STYLE_FAMILY_PAGE 434
#define STR_ERR_DATAPILOTSOURCE 435
-#define STR_PIVOT_FIRSTROWEMPTYERR 436
+#define STR_PIVOT_FIRSTROWEMPTYERR 436
#define STR_PIVOT_ONLYONEROWERR 437
-#define STR_COUNT 438
+
+#define STR_UNDO_SET_TAB_BG_COLOR 438
+#define STR_UNDO_SET_MULTI_TAB_BG_COLOR 439
+
+#define STR_COUNT 440
#endif
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/sc.hrc b/sc/inc/sc.hrc
index ad60c62a9c7e..4a697dc57558 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -833,9 +833,11 @@
#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_EVENTS (TAB_POPUP_START+9)
+#define FID_TAB_MENU_SET_TAB_BG_COLOR (TAB_POPUP_START + 9)
+#define FID_TAB_SET_TAB_BG_COLOR (TAB_POPUP_START + 10)
+#define FID_TAB_EVENTS (TAB_POPUP_START+11)
-#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)
@@ -1424,7 +1426,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)
@@ -1632,8 +1637,9 @@
#define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151)
#define RID_SCDLG_TEXT_IMPORT_OPTIONS (SC_DIALOGS_START + 152)
#define RID_POPUP_FILTER (SC_DIALOGS_START + 153)
+#define RID_SCDLG_TAB_BG_COLOR (SC_DIALOGS_START + 154)
-#define SC_DIALOGS_END (SC_DIALOGS_START + 154)
+#define SC_DIALOGS_END (SC_DIALOGS_START + 155)
#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 d3c19bb539d5..442e62bdd9cb 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -286,6 +286,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:
@@ -435,6 +441,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 d4a845040010..ad3fd4b1b51e 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.
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 984e36bec03e..bd5d40709cd4 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -282,13 +282,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
SC_DLLPUBLIC BOOL RegisterRefWindow( USHORT nSlotId, Window *pWnd );
SC_DLLPUBLIC BOOL UnregisterRefWindow( USHORT nSlotId, Window *pWnd );
SC_DLLPUBLIC BOOL IsAliveRefDlg( USHORT nSlotId, Window *pWnd );
SC_DLLPUBLIC Window * Find1RefWindow( USHORT nSlotId, Window *pWndAncestor );
SC_DLLPUBLIC Window * Find1RefWindow( Window *pWndAncestor );
- //-->Added by PengYunQuan for Validity Cell Range Picker
};
#define SC_MOD() ( *(ScModule**) GetAppData(SHL_CALC) )
diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx
new file mode 100644
index 000000000000..195331c750ad
--- /dev/null
+++ b/sc/inc/segmenttree.hxx
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SC_SEGMENTTREE_HXX
+#define SC_SEGMENTTREE_HXX
+
+#include "address.hxx"
+
+#include <memory>
+
+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<ScFlatBoolSegmentsImpl> 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<ScFlatBoolSegmentsImpl> 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<ScFlatUInt16SegmentsImpl> mpImpl;
+};
+
+#endif
diff --git a/sc/inc/tabbgcolor.hxx b/sc/inc/tabbgcolor.hxx
new file mode 100644
index 000000000000..c2b2a63baf65
--- /dev/null
+++ b/sc/inc/tabbgcolor.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SC_TABBGCOLOR_HXX
+#define SC_TABBGCOLOR_HXX
+
+#include "tools/color.hxx"
+#include "address.hxx"
+
+#include <vector>
+
+struct ScUndoTabColorInfo
+{
+ SCTAB mnTabId;
+ Color maOldTabBgColor;
+ Color maNewTabBgColor;
+
+ bool IsDefaultOldTabBgColor() const;
+ bool IsDefaultNewTabBgColor() const;
+
+ explicit ScUndoTabColorInfo(SCTAB nTab);
+ ScUndoTabColorInfo(const ScUndoTabColorInfo& r);
+
+ typedef ::std::vector<ScUndoTabColorInfo> List;
+};
+
+#endif
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 850cae4d587b..78e5875b6879 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -39,12 +39,20 @@
#include "compressedarray.hxx"
#include <memory>
+#include <set>
+#include <boost/shared_ptr.hpp>
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<ScTableProtection> pTabProtection;
USHORT* pColWidth;
- ScSummableCompressedArray< SCROW, USHORT>* pRowHeight;
+ ::boost::shared_ptr<ScFlatUInt16RowSegments> mpRowHeights;
BYTE* pColFlags;
ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags;
+ ::boost::shared_ptr<ScFlatBoolColSegments> mpHiddenCols;
+ ::boost::shared_ptr<ScFlatBoolRowSegments> mpHiddenRows;
+ ::boost::shared_ptr<ScFlatBoolColSegments> mpFilteredCols;
+ ::boost::shared_ptr<ScFlatBoolRowSegments> mpFilteredRows;
+
+ ::std::set<SCROW> maRowPageBreaks;
+ ::std::set<SCROW> maRowManualBreaks;
+ ::std::set<SCCOL> maColPageBreaks;
+ ::std::set<SCCOL> maColManualBreaks;
ScOutlineTable* pOutlineTable;
@@ -157,8 +177,10 @@ private:
ScRangeList* pScenarioRanges;
Color aScenarioColor;
+ Color aTabBgColor;
USHORT nScenarioFlags;
BOOL bActiveScenario;
+ bool mbPageBreaksValid;
friend class ScDocument; // fuer FillInfo
friend class ScDocumentIterator;
@@ -219,6 +241,8 @@ public:
void SetScenarioComment( const String& rComment ) { aComment = rComment; }
const Color& GetScenarioColor() const { return aScenarioColor; }
void SetScenarioColor(const Color& rNew) { aScenarioColor = rNew; }
+ 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; }
@@ -374,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;
@@ -473,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,
@@ -590,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 );
@@ -626,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 );
@@ -643,6 +684,63 @@ public:
void RemoveManualBreaks();
BOOL HasManualBreaks() const;
+ void GetAllRowBreaks(::std::set<SCROW>& rBreaks, bool bPage, bool bManual) const;
+ void GetAllColBreaks(::std::set<SCCOL>& 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 );
@@ -760,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;
+ };
};
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 1e37e812efc1..2d011f425398 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -173,6 +173,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"
@@ -527,6 +528,7 @@
#define SC_UNO_ZOOMTYPE "ZoomType"
#define SC_UNO_ZOOMVALUE "ZoomValue"
#define SC_UNO_UPDTEMPL "UpdateFromTemplate"
+
/*Stampit enable/disable print cancel */
#define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel"
@@ -612,6 +614,7 @@
// --> PB 2004-08-23 #i33095# Security Options
#define SC_UNO_LOADREADONLY "LoadReadonly"
// <--
+#define SC_UNO_MODIFYPASSWORDINFO "ModifyPasswordInfo"
// FormulaParser
#define SC_UNO_COMPILEENGLISH "CompileEnglish"
diff --git a/sc/inc/unowids.hxx b/sc/inc/unowids.hxx
index f58c3248bf81..175022a0ba14 100644
--- a/sc/inc/unowids.hxx
+++ b/sc/inc/unowids.hxx
@@ -78,7 +78,8 @@
#define SC_WID_UNO_AUTOPRINT ( SC_WID_UNO_START + 38 )
#define SC_WID_UNO_ABSNAME ( SC_WID_UNO_START + 39 )
#define SC_WID_UNO_CODENAME ( SC_WID_UNO_START + 40 )
-#define SC_WID_UNO_END ( SC_WID_UNO_START + 40 )
+#define SC_WID_UNO_TABCOLOR ( SC_WID_UNO_START + 41 )
+#define SC_WID_UNO_END ( SC_WID_UNO_START + 41 )
inline BOOL IsScUnoWid( USHORT nWid )