summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-12-13 01:36:33 +0100
committerMichael Stahl <mstahl@redhat.com>2012-12-13 12:31:48 +0100
commitefa1a63d940c942c805f18696ce304aa47e04ef3 (patch)
tree1e46c726fbacc4930ac2545ccca5d0b0ea78805c /sw
parent2ab2046fe7d939be02649b1c69f571cb19f9aeaa (diff)
SwFmtAnchor::SetAnchor(): assert that position is on SwTxtNode
Change-Id: I1c2a1cc2de4984cdcf1e5b8d0eafbd1471538e4a (cherry picked from commit 90a0116ccb48388d91b21128fcac2e4609838581)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/atrfrm.cxx5
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 &&