diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-02 13:21:35 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-02 13:28:27 -0500 |
commit | 018500a73f3b1082b6662b7c123dfe5158ae5752 (patch) | |
tree | 8185e9232676ca390cb37082fe374982d7bb6dd5 /sc/source/core/data/column2.cxx | |
parent | 31973b54efb1c607d7a53b0728264f8dd13bef0f (diff) |
fdo#74325: Ensure that all note objects have an sdr object before exporting.
Otherwise, if a note hasn't been displayed at least once before saving
that note would not get saved. In the future, we should modify the export
code to not rely on SdrObject to check the presence of note.
Change-Id: Ib7ca3ac00a0c9cdd3a01facda7af479ef172afbe
Diffstat (limited to 'sc/source/core/data/column2.cxx')
-rw-r--r-- | sc/source/core/data/column2.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 510ad177c9bf..7a58377ec683 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1227,6 +1227,29 @@ size_t ScColumn::GetNoteCount() const return nCount; } +namespace { + +class NoteCaptionCreator +{ + ScAddress maPos; +public: + NoteCaptionCreator( SCTAB nTab, SCCOL nCol ) : maPos(nCol,0,nTab) {} + + void operator() ( size_t nRow, ScPostIt* p ) + { + maPos.SetRow(nRow); + p->GetOrCreateCaption(maPos); + } +}; + +} + +void ScColumn::CreateAllNoteCaptions() +{ + NoteCaptionCreator aFunc(nTab, nCol); + sc::ProcessNote(maCellNotes, aFunc); +} + SCROW ScColumn::GetNotePosition( size_t nIndex ) const { // Return the row position of the nth note in the column. |