summaryrefslogtreecommitdiffstats
path: root/sc/inc/externalrefmgr.hxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-04-02 15:00:15 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-04-02 15:00:15 +0000
commitd847cf92cf4f2ee7927c3662f12e91ee84fb5331 (patch)
tree48f4071d5063581bf385fb87bbb904acf289b897 /sc/inc/externalrefmgr.hxx
parentCWS-TOOLING: integrate CWS cmcfixes56 (diff)
downloadcore-d847cf92cf4f2ee7927c3662f12e91ee84fb5331.tar.gz
core-d847cf92cf4f2ee7927c3662f12e91ee84fb5331.zip
CWS-TOOLING: integrate CWS calc31stopper4_DEV300
2009-03-25 11:52:59 +0100 nn r270010 : GetHTMLRangeNameList: call ScHTMLImport static method, not same method again (bug-id not available yet) 2009-03-20 14:24:51 +0100 er r269808 : #i100416# makeExternalRefStrImpl: don't care about a second sheet name if not needed 2009-03-20 13:14:30 +0100 er r269803 : carry along row position also for non-existing (empty) rows 2009-03-20 11:26:33 +0100 er r269790 : SUNWS12: declarator required in declaration; removed SC_DLLPRIVATE from inner class declaration 2009-03-19 19:40:09 +0100 er r269767 : #i100300# save only referenced tables of external data cache 2009-03-19 14:45:05 +0100 dr r269746 : #i100346# more places where checking docshell is needed 2009-03-19 14:13:20 +0100 fs r269744 : #i100349# do not delete the pool before all instances knowing it have been deleted 2009-03-19 11:35:45 +0100 dr r269735 : #i100346# always check docshell, is missing when pasting from clipboard 2009-03-19 09:39:49 +0100 dr r269728 : #i100332# remove debug statement, patch from kohei
Diffstat (limited to 'sc/inc/externalrefmgr.hxx')
-rw-r--r--sc/inc/externalrefmgr.hxx75
1 files changed, 75 insertions, 0 deletions
diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index 55d80751e957..b4c63101ec70 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -138,12 +138,18 @@ public:
SC_DLLPUBLIC void setCell(SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uInt32 nFmtIndex = 0);
TokenRef getCell(SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex = NULL) const;
bool hasRow( SCROW nRow ) const;
+ /// A temporary state used only during store to file.
+ bool isReferenced() const;
+ void setReferenced( bool bReferenced );
+ /// Obtain a sorted vector of rows.
void getAllRows(::std::vector<SCROW>& rRows) const;
+ /// Obtain a sorted vector of columns.
void getAllCols(SCROW nRow, ::std::vector<SCCOL>& rCols) const;
void getAllNumberFormats(::std::vector<sal_uInt32>& rNumFmts) const;
private:
RowsDataType maRows;
+ bool mbReferenced;
};
typedef ::boost::shared_ptr<Table> TableTypeRef;
@@ -202,6 +208,45 @@ public:
bool hasCacheTable(sal_uInt16 nFileId, const String& rTabName) const;
size_t getCacheTableCount(sal_uInt16 nFileId) const;
+ /**
+ * Set all tables of a document as referenced, used only during
+ * store-to-file.
+ * @returns <TRUE/> if ALL tables of ALL documents are marked.
+ */
+ bool setCacheDocReferenced( sal_uInt16 nFileId );
+
+ /**
+ * Set a table as referenced, used only during store-to-file.
+ * @returns <TRUE/> if ALL tables of ALL documents are marked.
+ */
+ bool setCacheTableReferenced( sal_uInt16 nFileId, const String& rTabName );
+ void setAllCacheTableReferencedStati( bool bReferenced );
+ bool areAllCacheTablesReferenced() const;
+private:
+ struct ReferencedStatus
+ {
+ struct DocReferenced
+ {
+ ::std::vector<bool> maTables;
+ bool mbAllTablesReferenced;
+ // Initially, documents have no tables but all referenced.
+ DocReferenced() : mbAllTablesReferenced(true) {}
+ };
+ typedef ::std::vector<DocReferenced> DocReferencedVec;
+
+ DocReferencedVec maDocs;
+ bool mbAllReferenced;
+
+ ReferencedStatus();
+ explicit ReferencedStatus( size_t nDocs );
+ void reset( size_t nDocs );
+ void checkAllDocs();
+
+ } maReferenced;
+ void addCacheTableToReferenced( sal_uInt16 nFileId, size_t nIndex );
+ void addCacheDocToReferenced( sal_uInt16 nFileId );
+public:
+
ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, size_t nTabIndex) const;
ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, const String& rTabName, bool bCreateNew, size_t* pnIndex);
@@ -434,6 +479,33 @@ public:
size_t getCacheTableCount(sal_uInt16 nFileId) const;
sal_uInt16 getExternalFileCount() const;
+ /**
+ * Mark all tables as referenced that are used by any LinkListener, used
+ * only during store-to-file.
+ * @returns <TRUE/> if ALL tables of ALL external documents are marked.
+ */
+ bool markUsedByLinkListeners();
+
+ /**
+ * Set all tables of a document as referenced, used only during
+ * store-to-file.
+ * @returns <TRUE/> if ALL tables of ALL external documents are marked.
+ */
+ bool setCacheDocReferenced( sal_uInt16 nFileId );
+
+ /**
+ * Set a table as referenced, used only during store-to-file.
+ * @returns <TRUE/> if ALL tables of ALL external documents are marked.
+ */
+ bool setCacheTableReferenced( sal_uInt16 nFileId, const String& rTabName );
+ void setAllCacheTableReferencedStati( bool bReferenced );
+
+ /**
+ * @returns <TRUE/> if setAllCacheTableReferencedStati(false) was called,
+ * <FALSE/> if setAllCacheTableReferencedStati(true) was called.
+ */
+ bool isInReferenceMarking() const { return bInReferenceMarking; }
+
void storeRangeNameTokens(sal_uInt16 nFileId, const String& rName, const ScTokenArray& rArray);
ScExternalRefCache::TokenRef getSingleRefToken(
@@ -618,6 +690,9 @@ private:
/** original source file index. */
::std::vector<SrcFileData> maSrcFiles;
+ /** Status whether in reference marking state. See isInReferenceMarking(). */
+ bool bInReferenceMarking;
+
AutoTimer maSrcDocTimer;
DECL_LINK(TimeOutHdl, AutoTimer*);
};