[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Nov 27 16:43:18 PST 2013


 sc/inc/document.hxx              |    5 +++++
 sc/source/core/data/column2.cxx  |   14 ++++++++++++++
 sc/source/core/data/document.cxx |    5 +++++
 sc/source/ui/docshell/docsh.cxx  |    1 +
 4 files changed, 25 insertions(+)

New commits:
commit 975a9e88d4ad9ebad23e377bb6fc4437186c92e8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Nov 27 19:43:08 2013 -0500

    Clear column data array cache when the document content changes.
    
    Change-Id: I09ffa455e79199e37ca6168753ec9ef4d5aa33dc

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0546ef0..e283b3d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2018,6 +2018,11 @@ public:
 
     formula::VectorRefArray FetchVectorRefArray( const ScAddress& rPos, SCROW nLength );
 
+    /**
+     * Called whenever the value of a cell inside the document is modified.
+     */
+    void CellContentModified();
+
     SvtBroadcaster* GetBroadcaster( const ScAddress& rPos );
     const SvtBroadcaster* GetBroadcaster( const ScAddress& rPos ) const;
     void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, const ScAddress& rTopPos, SCROW nLength );
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 8759c51..a39016a 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -2862,6 +2862,13 @@ void ScColumn::SetFormulaResults( SCROW nRow, const double* pResults, size_t nLe
         rCell.ResetDirty();
         rCell.SetChanged(true);
     }
+
+    std::vector<SCROW> aRows;
+    aRows.reserve(nLen);
+    for (size_t i = 0; i < nLen; ++i)
+        aRows.push_back(nRow+i);
+
+    BroadcastCells(aRows, SC_HINT_DATACHANGED);
 }
 
 void ScColumn::SetFormulaResults( SCROW nRow, const formula::FormulaTokenRef* pResults, size_t nLen )
@@ -2888,6 +2895,13 @@ void ScColumn::SetFormulaResults( SCROW nRow, const formula::FormulaTokenRef* pR
         rCell.ResetDirty();
         rCell.SetChanged(true);
     }
+
+    std::vector<SCROW> aRows;
+    aRows.reserve(nLen);
+    for (size_t i = 0; i < nLen; ++i)
+        aRows.push_back(nRow+i);
+
+    BroadcastCells(aRows, SC_HINT_DATACHANGED);
 }
 
 void ScColumn::SetNumberFormat( SCROW nRow, sal_uInt32 nNumberFormat )
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 931994a..2fa2b0e 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2313,6 +2313,11 @@ ScDocument::NumFmtMergeHandler::~NumFmtMergeHandler()
     mpDoc->pFormatExchangeList = NULL;
 }
 
+void ScDocument::CellContentModified()
+{
+    mpFormulaGroupCxt.reset();
+}
+
 SvtBroadcaster* ScDocument::GetBroadcaster( const ScAddress& rPos )
 {
     ScTable* pTab = FetchTable(rPos.Tab());
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 98b6be6..0760425 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -3047,6 +3047,7 @@ ScDocShellModificator::~ScDocShellModificator()
 void ScDocShellModificator::SetDocumentModified()
 {
     ScDocument* pDoc = rDocShell.GetDocument();
+    pDoc->CellContentModified();
     if ( !pDoc->IsImportingXML() )
     {
         // AutoCalcShellDisabled temporaer restaurieren


More information about the Libreoffice-commits mailing list