sc/source/core/data/column3.cxx | 4 ++-- sc/source/core/data/document.cxx | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-)
New commits: commit 8ee9a8f96cbaa466d64cf644506fa95334c2016a Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri May 9 14:04:30 2014 -0400 fdo#77379: Don't return from the call. Notes are handled at the end. Returning prematurely would end up skipping pasting of notes. Change-Id: I79e0968023342a68fe729f31eb6cfc3cfacd5850 (cherry picked from commit f4673ccd5e26d38a28f297d64ed70ba719d21ef2) Reviewed-on: https://gerrit.libreoffice.org/9295 Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index ef726d1..6f5e4e2 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -881,7 +881,7 @@ public: case sc::element_type_string: { if (!bString) - return; + break; sc::string_block::const_iterator it = sc::string_block::begin(*node.data); std::advance(it, nOffset); @@ -905,7 +905,7 @@ public: case sc::element_type_edittext: { if (!bString) - return; + break; sc::edittext_block::const_iterator it = sc::edittext_block::begin(*node.data); std::advance(it, nOffset); commit f89b4a7de1669c75e33748dae438c7c6c2b6524e Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri May 9 11:44:51 2014 -0400 fdo#77806: Check the boundaries before accessing an array.... Change-Id: I0878f734599f566cde83183947cd7613c0f8d5c6 (cherry picked from commit a45973a90625f4b9e0f603154194f357ff2418d4) Reviewed-on: https://gerrit.libreoffice.org/9292 Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8c69412..47164be 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6113,14 +6113,30 @@ bool ScDocument::HasNote(const ScAddress& rPos) const { return HasNote(rPos.Col(), rPos.Row(), rPos.Tab()); } + bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) const { - const ScPostIt* pNote = maTabs[nTab]->aCol[nCol].GetCellNote(nRow); + if (!ValidColRow(nCol, nRow)) + return false; + + const ScTable* pTab = FetchTable(nTab); + if (!pTab) + return false; + + const ScPostIt* pNote = pTab->aCol[nCol].GetCellNote(nRow); return pNote != NULL; } + bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const { - return maTabs[nTab]->aCol[nCol].HasCellNotes(); + if (!ValidCol(nCol)) + return false; + + const ScTable* pTab = FetchTable(nTab); + if (!pTab) + return false; + + return pTab->aCol[nCol].HasCellNotes(); } bool ScDocument::HasTabNotes(SCTAB nTab) const _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits