summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/drwbassh.cxx
diff options
context:
space:
mode:
authorAttila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>2020-11-03 15:05:00 +0100
committerLászló Németh <nemeth@numbertext.org>2020-11-24 11:31:40 +0100
commit3347d71b23595919e167bd49932675e77cbbdbbb (patch)
tree7ce27660cd544db00b8d84fdc67e27d01f66cbec /sw/source/uibase/shells/drwbassh.cxx
parent47bb1e449f8dd1668c4e50ab7df980f4e3de8319 (diff)
tdf#137546 sw: fix text position at textbox alignment
Follow-up of commit 06fd06597796d9e92117602245f3968c93707708 (tdf#124430 Writer Editing: Fix textbox aligning). Testing: 1. Insert a shape. Choose menu item "Add Text Box" of its local menu, and write a short text in it. 2. Choose menu item "Align->Right" of the local menu of the shape. The textbox is aligned to the right margin and before the fix, text position had changed slightly within the shape. (Only moving the textbox fixed it.) Change-Id: I758e0f65c8b51e09ac15a96e19819cb3ad3beacb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105253 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/uibase/shells/drwbassh.cxx')
-rw-r--r--sw/source/uibase/shells/drwbassh.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index 65f95858a480..f901f32cc15d 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -443,7 +443,8 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
if ( bAlignPossible )
{
const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if ( rMarkList.GetMarkCount() == 1 )
+ if (rMarkList.GetMarkCount() == 1
+ && !SwTextBoxHelper::hasTextFrame(rMarkList.GetMark(0)->GetMarkedSdrObj()))
{
sal_Int16 nHorizOrient = -1, nVertOrient = -1;
@@ -479,8 +480,6 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
aHOrient.SetHoriOrient( nHorizOrient );
pFrameFormat->SetFormatAttr(aHOrient);
- if (auto pTxFrm = SwTextBoxHelper::getOtherTextBoxFormat(pFrameFormat, RES_DRAWFRMFMT))
- pTxFrm->SetFormatAttr(aHOrient);
pSh->EndAction();
}
@@ -492,8 +491,6 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
aVOrient.SetVertOrient( nVertOrient );
pFrameFormat->SetFormatAttr(aVOrient);
- if (auto pTxFrm = SwTextBoxHelper::getOtherTextBoxFormat(pFrameFormat, RES_DRAWFRMFMT))
- pTxFrm->SetFormatAttr(aVOrient);
pSh->EndAction();
}