diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-07-13 20:15:55 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-09-30 09:48:55 +0200 |
commit | ea863faba3e36c90f910159d81a6ff2757663de4 (patch) | |
tree | c01020bc9c30a36b6d0f8176ad566fd30b65da3e | |
parent | 7859a43777b8433a95d1c1a376dc829632aeaada (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>
(cherry picked from commit 508d2d2b1a6a23043c8c0f0d3fea4ec033ac2684)
-rw-r--r-- | sw/source/core/view/vdraw.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 136425ffd9cd..ce8e2fa73cfb 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -226,6 +226,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() ) |