diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-12-13 01:36:33 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-12-13 01:39:29 +0100 |
commit | 90a0116ccb48388d91b21128fcac2e4609838581 (patch) | |
tree | 5325f5fa2145c8106423ab0c27ffa8d92edf7888 | |
parent | 2fc4af311656e7d019ca802d23444e5161f820ee (diff) |
SwFmtAnchor::SetAnchor(): assert that position is on SwTxtNode
Change-Id: I1c2a1cc2de4984cdcf1e5b8d0eafbd1471538e4a
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index a59d2d20ed3e..f5d7798b3dc5 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -98,6 +98,9 @@ #include <svl/cjkoptions.hxx> #include <switerator.hxx> #include <pagedeschint.hxx> +#ifndef NDEBUG +#include <ndtxt.hxx> +#endif using namespace ::com::sun::star; using ::rtl::OUString; @@ -1511,6 +1514,8 @@ SwFmtAnchor::~SwFmtAnchor() void SwFmtAnchor::SetAnchor( const SwPosition *pPos ) { + // anchor only to paragraphs + assert(!pPos || dynamic_cast<SwTxtNode*>(&pPos->nNode.GetNode())); m_pCntntAnchor .reset( (pPos) ? new SwPosition( *pPos ) : 0 ); // Flys anchored AT paragraph should not point into the paragraph content if (m_pCntntAnchor && |