diff options
author | Attila Bakos <bakos.attilakaroly@nisz.hu> | 2020-05-29 14:09:30 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-06-10 10:45:51 +0200 |
commit | a938ead6639777337267f613cb0dea9c326c15b0 (patch) | |
tree | af5788c1d9bcebde66ad3d972dc1003ade30ec20 /sw | |
parent | cb28054d831c38ef645f635ecd80475fb5735679 (diff) |
tdf#130802 SwTextBoxHelper::syncFlyFrameAttr: fix dragging
Dragging the selected shapes resulted broken text boxes:
the text showed outside of the shapes. This is fixed in
the case of paragraph, character and page anchoring.
Co-authored-by: Tibor Nagy (NISZ)
Change-Id: Iaea65ee26bad60c09ada4875636416d4a7c7e80b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95136
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 5f1462e2eb49..ae7084605e4c 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -35,6 +35,7 @@ #include <svl/itemiter.hxx> #include <comphelper/sequenceashashmap.hxx> #include <sal/log.hxx> +#include <svx/anchorid.hxx> #include <com/sun/star/document/XActionLockable.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> @@ -697,6 +698,12 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet const& const SfxPoolItem* pItem = aIter.GetCurItem(); do { + if (rShape.GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR) + { + SwFormatAnchor pShapeAnch = rShape.GetAnchor(); + aTextBoxSet.Put(pShapeAnch); + } + switch (pItem->Which()) { case RES_VERT_ORIENT: @@ -708,6 +715,10 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet const& if (!aRect.IsEmpty()) aOrient.SetPos(aOrient.GetPos() + aRect.getY()); + if (rShape.GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE) + { + aOrient.SetRelationOrient(rShape.GetVertOrient().GetRelationOrient()); + } aTextBoxSet.Put(aOrient); // restore height (shrunk for extending beyond the page bottom - tdf#91260) @@ -728,6 +739,10 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet const& if (!aRect.IsEmpty()) aOrient.SetPos(aOrient.GetPos() + aRect.getX()); + if (rShape.GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE) + { + aOrient.SetRelationOrient(rShape.GetHoriOrient().GetRelationOrient()); + } aTextBoxSet.Put(aOrient); } break; |