[Libreoffice-commits] .: 2 commits - sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Sun Mar 4 16:43:34 PST 2012


 sc/source/core/data/table2.cxx |   10 ++++++++++
 sc/source/core/data/table6.cxx |    6 ++++++
 2 files changed, 16 insertions(+)

New commits:
commit bbb80dfbfff998b55c665daf366499fdbd6605d0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Mar 5 00:20:48 2012 +0100

    add notes back to ScTable::SearchRangeForAllEmptyCells

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 1050413..3ef92e1 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1027,6 +1027,12 @@ bool ScTable::SearchRangeForAllEmptyCells(
                     {
                         ScAddress aCellPos(nCol, nRow, nTab);
                         pUndoDoc->PutCell(nCol, nRow, nTab, pCell->Clone(*pUndoDoc, aCellPos));
+                        ScNotes* pNotes = pUndoDoc->GetNotes(nTab);
+                        ScPostIt* pPostIt = maNotes.findByAddress(nCol, nRow);
+                        if (pPostIt)
+                        {
+                            pNotes->insert(nCol, nRow, pPostIt->Clone(ScAddress(nCol, nRow, nTab), *pUndoDoc, ScAddress(nCol, nRow, nTab), true));
+                        }
                     }
                     aCol[nCol].SetString(nRow, nTab, rSearchItem.GetReplaceString(), pDocument->GetAddressConvention());
                 }
commit 50506b3840980c671fde55b82954d253bd9e4ac1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Mar 5 00:12:33 2012 +0100

    readd note handling to CopyUpdated

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index f058d07..69021ce 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1077,6 +1077,16 @@ void ScTable::CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const
 {
     for (SCCOL i=0; i<=MAXCOL; i++)
         aCol[i].CopyUpdated( pPosTab->aCol[i], pDestTab->aCol[i] );
+
+    // insert notes with captions
+    for(ScNotes::iterator itr = pDestTab->maNotes.begin(); itr != pDestTab->maNotes.end(); ++itr)
+    {
+        SCCOL nCol = itr->first.first;
+        SCROW nRow = itr->first.second;
+        ScPostIt* pPostIt = itr->second;
+
+        pDestTab->maNotes.insert(nCol, nRow, pPostIt->Clone( ScAddress(nCol, nRow, nTab),*pDestTab->pDocument, ScAddress(nCol, nRow, pDestTab->nTab), true ));
+    }
 }
 
 void ScTable::InvalidateTableArea()


More information about the Libreoffice-commits mailing list