summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-27 03:14:05 +0200
committerAndras Timar <andras.timar@collabora.com>2015-06-30 18:51:07 +0200
commitb04755f359be247c0f2db5488c275a6fbb5bbb96 (patch)
tree5901489fa23db97b0234b8353b1fdc1b2d67b116 /sc
parentb3d9176792787d73db0762816b4694c5c993ffc0 (diff)
tdf#90717 prevent crash, not really fixed
Try to resync shared group top and length. Change-Id: I31bd0db7c1dceb880a22274edc4c3f20ce253095 (cherry picked from commit d8541c2a62121894bf87c91f1f89aea1ea30d680) Reviewed-on: https://gerrit.libreoffice.org/16533 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/grouparealistener.cxx33
1 files changed, 32 insertions, 1 deletions
diff --git a/sc/source/core/tool/grouparealistener.cxx b/sc/source/core/tool/grouparealistener.cxx
index 86be4f736d92..ecfa15e0ee75 100644
--- a/sc/source/core/tool/grouparealistener.cxx
+++ b/sc/source/core/tool/grouparealistener.cxx
@@ -194,10 +194,41 @@ void FormulaGroupAreaListener::collectFormulaCells(
ScFormulaCell* const * pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow, nBlockSize);
if (!pp)
{
- SAL_WARN("sc", "GetFormulaCellBlockAddress not found");
+ SAL_WARN("sc.core", "GetFormulaCellBlockAddress not found");
return;
}
+ /* FIXME: this is tdf#90717, when deleting a row fixed size area listeners
+ * such as BCA_ALWAYS or entire row listeners are (rightly) not destroyed,
+ * but mnTopCellRow and mnGroupLen also not updated, which needs fixing.
+ * Until then pull things as straight as possible here in such situation
+ * and prevent crash. */
+ if (!(*pp)->IsSharedTop())
+ {
+ SCROW nRow = (*pp)->GetSharedTopRow();
+ if (nRow < 0)
+ SAL_WARN("sc.core", "FormulaGroupAreaListener::collectFormulaCells() no shared top");
+ else
+ {
+ SAL_WARN("sc.core","FormulaGroupAreaListener::collectFormulaCells() syncing mnTopCellRow from " <<
+ mnTopCellRow << " to " << nRow);
+ const_cast<FormulaGroupAreaListener*>(this)->mnTopCellRow = nRow;
+ pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow, nBlockSize);
+ if (!pp)
+ {
+ SAL_WARN("sc.core", "GetFormulaCellBlockAddress not found");
+ return;
+ }
+ }
+ }
+ SCROW nLen = (*pp)->GetSharedLength();
+ if (nLen != mnGroupLen)
+ {
+ SAL_WARN("sc.core", "FormulaGroupAreaListener::collectFormulaCells() syncing mnGroupLen from " <<
+ mnGroupLen << " to " << nLen);
+ const_cast<FormulaGroupAreaListener*>(this)->mnGroupLen = nLen;
+ }
+
/* FIXME: with tdf#89957 it happened that the actual block size in column
* AP (shifted from AO) of sheet 'w' was smaller than the remembered group
* length and correct. This is just a very ugly workaround, the real cause