summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/cell.hxx1
-rw-r--r--sc/inc/column.hxx1
-rw-r--r--sc/inc/conditio.hxx8
-rw-r--r--sc/inc/document.hxx4
-rw-r--r--sc/inc/externalrefmgr.hxx75
-rw-r--r--sc/inc/table.hxx1
-rw-r--r--sc/inc/validat.hxx4
7 files changed, 94 insertions, 0 deletions
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 186a40d15..656d58905 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -381,6 +381,7 @@ public:
void CompileTokenArray( BOOL bNoListening = FALSE );
void CompileXML( ScProgress& rProgress ); // compile temporary string tokens
void CalcAfterLoad();
+ bool MarkUsedExternalReferences();
void Interpret();
inline BOOL IsIterCell() const { return bIsIterCell; }
inline USHORT GetSeenInIteration() const { return nSeenInIteration; }
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index f36b0c276..eff91ed76 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -279,6 +279,7 @@ public:
void CalcAfterLoad();
void CompileAll();
void CompileXML( ScProgress& rProgress );
+ bool MarkUsedExternalReferences();
void ResetChanged( SCROW nStartRow, SCROW nEndRow );
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 82d80a0e8..52d791999 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -149,6 +149,8 @@ public:
void SourceChanged( const ScAddress& rChanged );
+ bool MarkUsedExternalReferences() const;
+
protected:
virtual void DataChanged( const ScRange* pModified ) const;
ScDocument* GetDocument() const { return pDoc; }
@@ -240,6 +242,8 @@ public:
void SetUsed(BOOL bSet) { bIsUsed = bSet; }
BOOL IsUsed() const { return bIsUsed; }
+ bool MarkUsedExternalReferences() const;
+
// sortiert (per PTRARR) nach Index
// operator== nur fuer die Sortierung
BOOL operator ==( const ScConditionalFormat& r ) const { return nKey == r.nKey; }
@@ -278,6 +282,10 @@ public:
void SourceChanged( const ScAddress& rAddr );
+ /** Temporarily during save, returns RefManager's decision whether ALL
+ * references are marked now. */
+ bool MarkUsedExternalReferences() const;
+
BOOL operator==( const ScConditionalFormatList& r ) const; // fuer Ref-Undo
};
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index f0d682547..882032006 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -606,7 +606,11 @@ public:
const String& aFileName,
const String& aTabName );
+ bool HasExternalRefManager() { return pExternalRefMgr.get(); }
SC_DLLPUBLIC ScExternalRefManager* GetExternalRefManager();
+ bool IsInExternalReferenceMarking() const;
+ void MarkUsedExternalReferences();
+ bool MarkUsedExternalReferences( ScTokenArray & rArr );
BOOL HasDdeLinks() const;
BOOL HasAreaLinks() const;
diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index d20840f9d..dfb814596 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*);
};
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 71f443d40..ba4b02238 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -376,6 +376,7 @@ public:
void CalcAfterLoad();
void CompileAll();
void CompileXML( ScProgress& rProgress );
+ bool MarkUsedExternalReferences();
void UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx
index 7babc68a9..44b739007 100644
--- a/sc/inc/validat.hxx
+++ b/sc/inc/validat.hxx
@@ -205,6 +205,10 @@ public:
const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
void UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
+ /** Temporarily during save, returns RefManager's decision whether ALL
+ * references are marked now. */
+ bool MarkUsedExternalReferences() const;
+
BOOL operator==( const ScValidationDataList& r ) const; // fuer Ref-Undo
};