summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-07-13 20:15:55 +0200
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2014-09-10 19:55:12 +0000
commit508d2d2b1a6a23043c8c0f0d3fea4ec033ac2684 (patch)
tree48de7dd41a7eb0532209fe439ec310dd33571905
parent9099e21b89184bd4e39def497e483cac4a77ec5a (diff)
fdo#80926 Don't move anchors of invalid pages
If the anchor is valid, check if its page is valid too, before moving anchors on view change. Change-Id: Idffdfdb786cb29a105c06d652e6ad7315abfb4c5 Reviewed-on: https://gerrit.libreoffice.org/10976 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r--sw/source/core/view/vdraw.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index cfadd9e950dd..4ac29083c745 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -227,6 +227,17 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
{
continue;
}
+ else
+ {
+ // Actually this should never happen but currently layouting
+ // is broken. So don't move anchors, if the page is invalid.
+ // This should be turned into an DBG_ASSERT, once layouting is fixed!
+ const SwPageFrm *pPageFrm = pAnchor->FindPageFrm();
+ if (!pPageFrm || pPageFrm->IsInvalid() ) {
+ SAL_WARN( "sw.resizeview", "Trying to move anchor from invalid page - fix layouting!" );
+ continue;
+ }
+ }
// no move for drawing objects in header/footer
if ( pAnchor->FindFooterOrHeader() )