diff options
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 1e276998ca82..0d66639baf83 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -828,17 +828,14 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet const& const SfxPoolItem* pItem = aIter.GetCurItem(); const RndStdIds aAnchId = rShape.GetAnchor().GetAnchorId(); - if ((aAnchId == RndStdIds::FLY_AT_PAGE && rShape.GetAnchor().GetPageNum() != 0) - || ((aAnchId == RndStdIds::FLY_AT_PARA || aAnchId == RndStdIds::FLY_AT_CHAR) - && rShape.GetAnchor().GetContentAnchor())) + if (aAnchId == RndStdIds::FLY_AT_PAGE && rShape.GetAnchor().GetPageNum() != 0) { - SwFormatAnchor aNewAnch = pFormat->GetAnchor(); - if (rShape.GetAnchor().GetContentAnchor()) - aNewAnch.SetAnchor(rShape.GetAnchor().GetContentAnchor()); - if (rShape.GetAnchor().GetPageNum() > 0) - aNewAnch.SetPageNum(rShape.GetAnchor().GetPageNum()); - aNewAnch.SetType(rShape.GetAnchor().GetAnchorId()); - aTextBoxSet.Put(aNewAnch); + aTextBoxSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, rShape.GetAnchor().GetPageNum())); + } + if ((aAnchId == RndStdIds::FLY_AT_PARA || aAnchId == RndStdIds::FLY_AT_CHAR) + && rShape.GetAnchor().GetContentAnchor()) + { + aTextBoxSet.Put(rShape.GetAnchor()); } do { |