diff options
Diffstat (limited to 'sc/source/core/data/table2.cxx')
-rw-r--r-- | sc/source/core/data/table2.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index e640b31622f4..66c072d12cc0 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1600,6 +1600,21 @@ ScPostIt* ScTable::ReleaseNote( SCCOL nCol, SCROW nRow ) return aCol[nCol].ReleaseNote(nRow); } +ScPostIt* ScTable::GetNote( SCCOL nCol, SCROW nRow ) +{ + if (!ValidCol(nCol) || nCol >= MAXCOLCOUNT) + return nullptr; + return aCol[nCol].GetCellNote(nRow); +} + +void ScTable::SetNote( SCCOL nCol, SCROW nRow, ScPostIt* pNote ) +{ + if (!ValidColRow(nCol, nRow)) + return; + + CreateColumnIfNotExists(nCol).SetCellNote(nRow, std::move(pNote)); +} + size_t ScTable::GetNoteCount( SCCOL nCol ) const { if (!ValidCol(nCol)) @@ -3714,7 +3729,7 @@ void ScTable::CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW n if (bThisTab) { - aCell.release(aCol[nDestX], nDestY); + aCell.release(CreateColumnIfNotExists(nDestX), nDestY); SetPattern( nDestX, nDestY, *GetPattern( nCol, nRow ) ); } else |