diff options
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/AccessibleFilterTopWindow.hxx | 3 | ||||
-rw-r--r-- | sc/inc/ViewSettingsSequenceDefines.hxx | 3 | ||||
-rw-r--r-- | sc/inc/address.hxx | 13 | ||||
-rw-r--r-- | sc/inc/attarray.hxx | 3 | ||||
-rw-r--r-- | sc/inc/cellsuno.hxx | 8 | ||||
-rw-r--r-- | sc/inc/chartuno.hxx | 47 | ||||
-rw-r--r-- | sc/inc/column.hxx | 9 | ||||
-rw-r--r-- | sc/inc/convuno.hxx | 41 | ||||
-rw-r--r-- | sc/inc/dociter.hxx | 22 | ||||
-rw-r--r-- | sc/inc/document.hxx | 154 | ||||
-rw-r--r-- | sc/inc/docuno.hxx | 2 | ||||
-rw-r--r-- | sc/inc/dpobject.hxx | 1 | ||||
-rwxr-xr-x | sc/inc/eventuno.hxx | 91 | ||||
-rw-r--r-- | sc/inc/funcuno.hxx | 3 | ||||
-rw-r--r-- | sc/inc/global.hxx | 9 | ||||
-rw-r--r-- | sc/inc/globstr.hrc | 8 | ||||
-rw-r--r-- | sc/inc/olinetab.hxx | 20 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 13 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 14 | ||||
-rw-r--r-- | sc/inc/scextopt.hxx | 1 | ||||
-rw-r--r-- | sc/inc/scmod.hxx | 2 | ||||
-rw-r--r-- | sc/inc/segmenttree.hxx | 172 | ||||
-rwxr-xr-x | sc/inc/sheetevents.hxx | 65 | ||||
-rw-r--r-- | sc/inc/tabbgcolor.hxx | 54 | ||||
-rw-r--r-- | sc/inc/table.hxx | 201 | ||||
-rw-r--r-- | sc/inc/unonames.hxx | 8 | ||||
-rw-r--r-- | sc/inc/unowids.hxx | 3 | ||||
-rw-r--r-- | sc/inc/viewuno.hxx | 5 |
28 files changed, 824 insertions, 151 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/cellsuno.hxx b/sc/inc/cellsuno.hxx index 13469b110455..a53f167b164a 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -90,6 +90,7 @@ #include <com/sun/star/document/XActionLockable.hpp> #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> #include <com/sun/star/sheet/XExternalSheetName.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> @@ -1002,7 +1003,8 @@ class ScTableSheetObj : public ScCellRangeObj, public com::sun::star::util::XProtectable, public com::sun::star::sheet::XScenario, public com::sun::star::sheet::XScenarioEnhanced, - public com::sun::star::sheet::XExternalSheetName + public com::sun::star::sheet::XExternalSheetName, + public com::sun::star::document::XEventsSupplier { friend class ScTableSheetsObj; // fuer insertByName() @@ -1207,6 +1209,10 @@ public: throw (::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException); + // XEventsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents() + throw (::com::sun::star::uno::RuntimeException); + // XPropertySet ueberladen wegen Sheet-Properties virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() 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/convuno.hxx b/sc/inc/convuno.hxx index 135ac055b2fe..0f93d6d6de0d 100644 --- a/sc/inc/convuno.hxx +++ b/sc/inc/convuno.hxx @@ -28,6 +28,7 @@ #ifndef SC_CONVUNO_HXX #define SC_CONVUNO_HXX +#include <algorithm> #include <i18npool/lang.h> #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> @@ -70,6 +71,19 @@ public: static inline void FillApiEndAddress( ::com::sun::star::table::CellAddress& rApiAddress, const ::com::sun::star::table::CellRangeAddress& rApiRange ); + + /** Returns true, if the passed ranges have at least one common cell. */ + static inline bool Intersects( + const ::com::sun::star::table::CellRangeAddress& rApiARange1, + const ::com::sun::star::table::CellRangeAddress& rApiARange2 ); + /** Returns true, if the passed address rApiInner is inside the passed range rApiOuter. */ + static inline bool Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellAddress& rApiInner ); + /** Returns true, if the passed range rApiInner is completely inside the passed range rApiOuter. */ + static inline bool Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellRangeAddress& rApiInner ); }; @@ -135,6 +149,33 @@ inline void ScUnoConversion::FillApiEndAddress( rApiAddress.Sheet = rApiRange.Sheet; } +inline bool ScUnoConversion::Intersects( + const ::com::sun::star::table::CellRangeAddress& rApiRange1, + const ::com::sun::star::table::CellRangeAddress& rApiRange2 ) +{ + return (rApiRange1.Sheet == rApiRange2.Sheet) && + (::std::max( rApiRange1.StartColumn, rApiRange2.StartColumn ) <= ::std::min( rApiRange1.EndColumn, rApiRange2.EndColumn )) && + (::std::max( rApiRange1.StartRow, rApiRange2.StartRow ) <= ::std::min( rApiRange1.EndRow, rApiRange2.EndRow )); +} + +inline bool ScUnoConversion::Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellAddress& rApiInner ) +{ + return (rApiOuter.Sheet == rApiInner.Sheet) && + (rApiOuter.StartColumn <= rApiInner.Column) && (rApiInner.Column <= rApiOuter.EndColumn) && + (rApiOuter.StartRow <= rApiInner.Row) && (rApiInner.Row <= rApiOuter.EndRow); +} + +inline bool ScUnoConversion::Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellRangeAddress& rApiInner ) +{ + return (rApiOuter.Sheet == rApiInner.Sheet) && + (rApiOuter.StartColumn <= rApiInner.StartColumn) && (rApiInner.EndColumn <= rApiOuter.EndColumn) && + (rApiOuter.StartRow <= rApiInner.StartRow) && (rApiInner.EndRow <= rApiOuter.EndRow); +} + //___________________________________________________________________ inline sal_Bool operator==( 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 768dc815a482..f7ae5e63f165 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 { @@ -159,6 +161,9 @@ namespace com { namespace sun { namespace star { namespace embed { class XEmbeddedObject; } + namespace sheet { + struct TablePageBreakData; + } } } } #include <svl/zforlist.hxx> @@ -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; @@ -616,6 +619,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. @@ -731,6 +737,14 @@ public: BOOL HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ); BOOL HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect ); + const ScSheetEvents* GetSheetEvents( SCTAB nTab ) const; + void SetSheetEvents( SCTAB nTab, const ScSheetEvents* pNew ); + bool HasSheetEventScript( sal_Int32 nEvent ) const; // on any sheet + + BOOL HasCalcNotification( SCTAB nTab ) const; + void SetCalcNotification( SCTAB nTab ); + void ResetCalcNotifications(); + SC_DLLPUBLIC ScOutlineTable* GetOutlineTable( SCTAB nTab, BOOL bCreate = FALSE ); BOOL SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline ); @@ -917,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 ); @@ -1246,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; @@ -1267,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, @@ -1319,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<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; @@ -1340,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 ); @@ -1358,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; @@ -1454,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 ); @@ -1492,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; } @@ -1750,6 +1790,7 @@ public: SfxUndoManager* GetUndoManager(); bool IsInVBAMode() const; + ScRowBreakIterator* GetRowBreakIterator(SCTAB nTab) const; private: // CLOOK-Impl-Methoden @@ -1812,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/docuno.hxx b/sc/inc/docuno.hxx index 15a0c5e72359..14c9515dfacb 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -112,9 +112,9 @@ private: const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rOptions, ScMarkData& rMark, ScPrintSelectionStatus& rStatus, String& rPagesStr ) const; com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> GetFormatter(); + 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/eventuno.hxx b/sc/inc/eventuno.hxx new file mode 100755 index 000000000000..f3ae72f0f1bf --- /dev/null +++ b/sc/inc/eventuno.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * 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: sheetdata.hxx,v $ + * $Revision: 1.16.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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_EVENTUNO_HXX +#define SC_EVENTUNO_HXX + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XNameReplace.hpp> +#include <cppuhelper/implbase2.hxx> +#include <svl/lstner.hxx> + +#include "global.hxx" + +class ScDocShell; + +class ScSheetEventsObj : public cppu::WeakImplHelper2< + com::sun::star::container::XNameReplace, + com::sun::star::lang::XServiceInfo>, + public SfxListener +{ +private: + ScDocShell* mpDocShell; + SCTAB mnTab; + +public: + ScSheetEventsObj(ScDocShell* pDocSh, SCTAB nT); + virtual ~ScSheetEventsObj(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // XNameReplace + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, + const ::com::sun::star::uno::Any& aElement ) + throw(::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) + throw(::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) + throw(::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw(::com::sun::star::uno::RuntimeException); +}; + +#endif + diff --git a/sc/inc/funcuno.hxx b/sc/inc/funcuno.hxx index 3eef9082e26d..4413782a0e2f 100644 --- a/sc/inc/funcuno.hxx +++ b/sc/inc/funcuno.hxx @@ -72,7 +72,8 @@ private: ScTempDocCache aDocCache; ScDocOptions* pOptions; SfxItemPropertyMap aPropertyMap; - BOOL bInvalid; + bool mbArray; + bool mbValid; public: ScFunctionAccess(); 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 c2bf3e96ed5c..4a697dc57558 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -833,8 +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_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) @@ -1423,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) @@ -1631,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 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. 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/sheetevents.hxx b/sc/inc/sheetevents.hxx new file mode 100755 index 000000000000..8f52efb990f7 --- /dev/null +++ b/sc/inc/sheetevents.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * 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: sheetdata.hxx,v $ + * $Revision: 1.16.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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SHEETEVENTS_HXX +#define SC_SHEETEVENTS_HXX + +#include <rtl/ustring.hxx> + +#define SC_SHEETEVENT_FOCUS 0 +#define SC_SHEETEVENT_UNFOCUS 1 +#define SC_SHEETEVENT_SELECT 2 +#define SC_SHEETEVENT_DOUBLECLICK 3 +#define SC_SHEETEVENT_RIGHTCLICK 4 +#define SC_SHEETEVENT_CHANGE 5 +#define SC_SHEETEVENT_CALCULATE 6 +#define SC_SHEETEVENT_COUNT 7 + +class ScSheetEvents +{ + rtl::OUString** mpScriptNames; + + void Clear(); + +public: + ScSheetEvents(); + ScSheetEvents(const ScSheetEvents& rOther); + ~ScSheetEvents(); + + const ScSheetEvents& operator= (const ScSheetEvents& rOther); + + const rtl::OUString* GetScript(sal_Int32 nEvent) const; + void SetScript(sal_Int32 nEvent, const rtl::OUString* pNew); + + static rtl::OUString GetEventName(sal_Int32 nEvent); +}; + +#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 aed123bd7a65..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; @@ -63,6 +71,7 @@ class ScPrintSaverTab; class ScProgress; class ScProgress; class ScRangeList; +class ScSheetEvents; class ScSortInfoArray; class ScStyleSheet; class ScTableLink; @@ -72,6 +81,9 @@ struct RowInfo; struct ScFunctionData; struct ScLineFlags; class CollatorWrapper; +class ScFlatUInt16RowSegments; +class ScFlatBoolRowSegments; +class ScFlatBoolColSegments; class ScTable @@ -111,13 +123,24 @@ 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; + ScSheetEvents* pSheetEvents; + SCCOL nTableAreaX; SCROW nTableAreaY; BOOL bTableAreaValid; @@ -126,6 +149,7 @@ private: BOOL bVisible; BOOL bStreamValid; BOOL bPendingRowHeights; + BOOL bCalcNotification; SCTAB nTab; USHORT nRecalcLvl; // Rekursionslevel Size-Recalc @@ -153,8 +177,10 @@ private: ScRangeList* pScenarioRanges; Color aScenarioColor; + Color aTabBgColor; USHORT nScenarioFlags; BOOL bActiveScenario; + bool mbPageBreaksValid; friend class ScDocument; // fuer FillInfo friend class ScDocumentIterator; @@ -189,6 +215,9 @@ public: void RemoveSubTotals( ScSubTotalParam& rParam ); BOOL DoSubTotals( ScSubTotalParam& rParam ); + const ScSheetEvents* GetSheetEvents() const { return pSheetEvents; } + void SetSheetEvents( const ScSheetEvents* pNew ); + BOOL IsVisible() const { return bVisible; } void SetVisible( BOOL bVis ); @@ -198,6 +227,9 @@ public: BOOL IsPendingRowHeights() const { return bPendingRowHeights; } void SetPendingRowHeights( BOOL bSet ); + BOOL GetCalcNotification() const { return bCalcNotification; } + void SetCalcNotification( BOOL bSet ); + BOOL IsLayoutRTL() const { return bLayoutRTL; } BOOL IsLoadingRTL() const { return bLoadingRTL; } void SetLayoutRTL( BOOL bSet ); @@ -209,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; } @@ -364,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; @@ -463,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, @@ -580,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 ); @@ -616,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 ); @@ -633,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 ); @@ -750,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 330251742870..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" @@ -632,5 +635,10 @@ #define SC_UNO_SHAREDOC "IsDocumentShared" +// EventDescriptor + +#define SC_UNO_EVENTTYPE "EventType" +#define SC_UNO_SCRIPT "Script" + #endif 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 ) diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx index 988602b2056f..19b5c60fd070 100644 --- a/sc/inc/viewuno.hxx +++ b/sc/inc/viewuno.hxx @@ -48,6 +48,8 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/datatransfer/XTransferableSupplier.hpp> +#include "address.hxx" + class ScTabViewShell; #define SC_VIEWPANE_ACTIVE 0xFFFF @@ -195,6 +197,7 @@ private: XViewPropertyChangeListenerArr_Impl aPropertyChgListeners; XMouseClickHandlerArr_Impl aMouseClickHandlers; XActivationEventListenerArr_Impl aActivationListeners; + SCTAB nPreviousTab; sal_Bool bDrawSelModeSet; ScViewPaneObj* GetObjectByIndex_Impl(USHORT nIndex) const; @@ -223,7 +226,7 @@ public: void SelectionChanged(); void VisAreaChanged(); void SheetChanged(); - sal_Bool IsMouseListening() { return aMouseClickHandlers.Count() > 0; } + bool IsMouseListening() const; sal_Bool MousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); sal_Bool MouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); |