summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/document.cxx20
-rw-r--r--sc/source/ui/app/transobj.cxx2
2 files changed, 16 insertions, 6 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index bc6673575b09..8c69412d1beb 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6109,21 +6109,21 @@ void ScDocument::SetNote(SCCOL nCol, SCROW nRow, SCTAB nTab, ScPostIt* pNote)
return maTabs[nTab]->aCol[nCol].SetCellNote(nRow, pNote);
}
-bool ScDocument::HasNote(const ScAddress& rPos)
+bool ScDocument::HasNote(const ScAddress& rPos) const
{
return HasNote(rPos.Col(), rPos.Row(), rPos.Tab());
}
-bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab)
+bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) const
{
- ScPostIt* pNote = maTabs[nTab]->aCol[nCol].GetCellNote(nRow);
+ const ScPostIt* pNote = maTabs[nTab]->aCol[nCol].GetCellNote(nRow);
return pNote != NULL;
}
-bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab)
+bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const
{
return maTabs[nTab]->aCol[nCol].HasCellNotes();
}
-bool ScDocument::HasTabNotes(SCTAB nTab)
+bool ScDocument::HasTabNotes(SCTAB nTab) const
{
bool hasNotes = false;
for (SCCOL nCol=0; nCol<MAXCOLCOUNT && !hasNotes; ++nCol)
@@ -6132,6 +6132,16 @@ bool ScDocument::HasTabNotes(SCTAB nTab)
return hasNotes;
}
+bool ScDocument::HasNotes() const
+{
+ for (SCTAB i = 0; i <= MAXTAB; ++i)
+ {
+ if (HasTabNotes(i))
+ return true;
+ }
+ return false;
+}
+
ScPostIt* ScDocument::ReleaseNote(const ScAddress& rPos)
{
ScTable* pTab = FetchTable(rPos.Tab());
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index b2187d5975f0..ec6bb4a211f1 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -643,7 +643,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
}
}
- if ( pDoc->GetDrawLayer() )
+ if (pDoc->GetDrawLayer() || pDoc->HasNotes())
pDocSh->MakeDrawLayer();
// cell range is copied to the original position, but on the first sheet