diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-12-18 21:08:05 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-12-19 10:24:00 +0100 |
commit | 79827580ce7f6be4ff9017b516dc45c9eba5e01e (patch) | |
tree | f1aea9b39654aae3420144f4c403d127da3d620d /sw | |
parent | 6020bdf1c3bda0a05e40a212c484ce78d08c73b4 (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>
Diffstat (limited to 'sw')
-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 8b18199fff7a..3516ff000f80 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; |