summaryrefslogtreecommitdiff
path: root/sc/source/core/data/table2.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-05 19:21:22 -0500
committerFridrich Strba <fridrich@documentfoundation.org>2014-02-06 14:39:29 +0000
commita0fe08c6862f5debaa375cc35c6bcec64f1008dc (patch)
tree46ed84b72f6702deece1a9e4e8618e475b66a611 /sc/source/core/data/table2.cxx
parent0003e02b1c96e01607924873697a52fb813343ac (diff)
fdo#74556: Correctly handle note captions life cycles.
When copying notes to clipboard, we don't clone captions but leave them pointing to the original captions objects. Also, during undo and redo, we need to clear all caption pointers to prevent them from being deleted when the ScPostIt objects get deleted. The undo and redo of caption objects are handled in the drawing layer afterwards. Also, Have ReleaseNote() really release note rather than destroying it. (cherry picked from commit fe5d604ecf6de4935c622e0e95efc085c4a3cbfd) (cherry picked from commit bc504b5adfaeeac0b910b89b0c98ae564f1ff5b8) Change-Id: Ia1da7784d04a2183f21813b6914e78161aad39d7 Reviewed-on: https://gerrit.libreoffice.org/7887 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc/source/core/data/table2.cxx')
-rw-r--r--sc/source/core/data/table2.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index ce0909d0aeb2..7d49a0026d14 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1494,6 +1494,14 @@ ScPostIt* ScTable::GetNote(const SCCOL nCol, const SCROW nRow)
return pDocument->GetNote(nCol, nRow, nTab);
}
+ScPostIt* ScTable::ReleaseNote( SCCOL nCol, SCROW nRow )
+{
+ if (!ValidCol(nCol))
+ return NULL;
+
+ return aCol[nCol].ReleaseNote(nRow);
+}
+
size_t ScTable::GetNoteCount( SCCOL nCol ) const
{
if (!ValidCol(nCol))
@@ -1516,6 +1524,15 @@ void ScTable::CreateAllNoteCaptions()
aCol[i].CreateAllNoteCaptions();
}
+void ScTable::ForgetNoteCaptions( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
+{
+ if (!ValidCol(nCol1) || !ValidCol(nCol2))
+ return;
+
+ for (SCCOL i = nCol1; i <= nCol2; ++i)
+ aCol[i].ForgetNoteCaptions(nRow1, nRow2);
+}
+
void ScTable::GetAllNoteEntries( std::vector<sc::NoteEntry>& rNotes ) const
{
for (SCCOL nCol = 0; nCol < MAXCOLCOUNT; ++nCol)