summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/column2.cxx23
-rw-r--r--sc/source/core/data/document.cxx11
-rw-r--r--sc/source/core/data/table2.cxx6
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx2
4 files changed, 42 insertions, 0 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 20d3ee7edf1a..6aef111d9b6a 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1229,6 +1229,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.
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 11b6507a381b..6bbe8358b4bc 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6188,6 +6188,17 @@ size_t ScDocument::GetNoteCount( SCTAB nTab, SCCOL nCol ) const
return pTab->GetNoteCount(nCol);
}
+void ScDocument::CreateAllNoteCaptions()
+{
+ TableContainer::iterator it = maTabs.begin(), itEnd = maTabs.end();
+ for (; it != itEnd; ++it)
+ {
+ ScTable* p = *it;
+ if (p)
+ p->CreateAllNoteCaptions();
+ }
+}
+
ScAddress ScDocument::GetNotePosition( size_t nIndex ) const
{
for (size_t nTab = 0; nTab < maTabs.size(); ++nTab)
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index ce4871afafe3..e81a5e218811 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1510,6 +1510,12 @@ SCROW ScTable::GetNotePosition( SCCOL nCol, size_t nIndex ) const
return aCol[nCol].GetNotePosition(nIndex);
}
+void ScTable::CreateAllNoteCaptions()
+{
+ for (SCCOL i = 0; i <= MAXCOL; ++i)
+ aCol[i].CreateAllNoteCaptions();
+}
+
void ScTable::GetAllNoteEntries( std::vector<sc::NoteEntry>& rNotes ) const
{
for (SCCOL nCol = 0; nCol < MAXCOLCOUNT; ++nCol)
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index c2ad8ec0ed92..5fdf5812bcf1 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -762,6 +762,8 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XCompon
sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
{
+ rDoc.CreateAllNoteCaptions();
+
uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
uno::Reference<xml::sax::XWriter> xWriter = xml::sax::Writer::create(xContext);