diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-12-18 21:08:05 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-19 19:01:45 +0100 |
commit | b0c25b9f81780b15c94eaa1041c7b6240a03e572 (patch) | |
tree | 6a75b944511de3890636c57aac867d87d7ec0805 /sw/source/core | |
parent | ff87ba0139c1f98ca4b94a4a8f8be822f366cfea (diff) |
Correct the assertion
The anchor node passed to SwDoc::MakeFlySection may be non-content node,
e.g. a table node when a whole table is selected when inserting a frame.
Thus assertion must take into account if the bCalledFromShell flag is true.
Change-Id: I947ed9dfc4846a8c4fe430d80fb8286212e0b248
Reviewed-on: https://gerrit.libreoffice.org/46736
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 79827580ce7f6be4ff9017b516dc45c9eba5e01e)
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 641bfb282c0e..c95b43b0d451 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -328,7 +328,10 @@ SwFlyFrameFormat* SwDoc::MakeFlySection( RndStdIds eAnchorType, (SwNodeIndex( GetNodes().GetEndOfAutotext()), getIDocumentStylePoolAccess().GetTextCollFromPool( nCollId )); SwContentNode * pAnchorNode = pAnchorPos->nNode.GetNode().GetContentNode(); - assert(pAnchorNode); // pAnchorNode from cursor, must be valid + // pAnchorNode from cursor must be valid, unless a whole table is selected (in which + // case the node is not a content node, and pAnchorNode is nullptr). In the latter case, + // bCalledFromShell is false. + assert(!bCalledFromShell || pAnchorNode); const SfxPoolItem * pItem = nullptr; |