[PATCH] Change in core[libreoffice-4-0]: fdo#59437: SwFmtAnchor::SetAnchor: Anchors may be on StartNo...

Michael Stahl (via Code Review) gerrit at gerrit.libreoffice.org
Thu Jan 17 13:36:44 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1747

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/47/1747/1

fdo#59437: SwFmtAnchor::SetAnchor: Anchors may be on StartNodes

Assertion added in 90a0116ccb48388d91b21128fcac2e4609838581 wasn't quite
right.

Change-Id: Icac6c4e3932837ffaf170d9b18664e5b4ff579ff
(cherry picked from commit 0ed73a0817ad0ff0107cb297208252c0afe3b4a9)
---
M sw/source/core/layout/atrfrm.cxx
1 file changed, 5 insertions(+), 2 deletions(-)



diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index f5d7798..180b145 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1514,8 +1514,11 @@
 
 void SwFmtAnchor::SetAnchor( const SwPosition *pPos )
 {
-    // anchor only to paragraphs
-    assert(!pPos || dynamic_cast<SwTxtNode*>(&pPos->nNode.GetNode()));
+    // anchor only to paragraphs, or start nodes in case of FLY_AT_FLY
+    assert(!pPos
+            || ((FLY_AT_FLY == nAnchorId) &&
+                    dynamic_cast<SwStartNode*>(&pPos->nNode.GetNode()))
+            || 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 &&

-- 
To view, visit https://gerrit.libreoffice.org/1747
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icac6c4e3932837ffaf170d9b18664e5b4ff579ff
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Michael Stahl <mstahl at redhat.com>



More information about the LibreOffice mailing list