[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - sw/source
Attila Bakos (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 23 15:06:46 UTC 2020
sw/source/core/doc/textboxhelper.cxx | 15 +++++++++++++++
1 file changed, 15 insertions(+)
New commits:
commit 79e289859abfc7552d9dec2aff5d29a247b9a370
Author: Attila Bakos <bakos.attilakaroly at nisz.hu>
AuthorDate: Fri May 29 14:09:30 2020 +0200
Commit: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Thu Jul 23 17:06:09 2020 +0200
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 at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit a938ead6639777337267f613cb0dea9c326c15b0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99299
Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 9ea6fc96b719..34aed05a1fcf 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -34,6 +34,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>
@@ -686,6 +687,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:
@@ -697,6 +704,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)
@@ -717,6 +728,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;
More information about the Libreoffice-commits
mailing list