Kaydet (Commit) 08091afa authored tarafından Tamás Zolnai's avatar Tamás Zolnai

tdf#104722: Wrong text alignment when text box is smaller than the text inside

The default TextHorizontalAlignment is block. Setting
paragraph alignment (on UI) works when this text
alignment property is set to block (otherwise has no effect).
In general this works on this way, but the existing
algorithm did not work in those cases when the
text was bigger than the container shape.

Change-Id: I02dba76f8e3033a465bb14dc826521966bb30987
Reviewed-on: https://gerrit.libreoffice.org/32123Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 5694b497)
Reviewed-on: https://gerrit.libreoffice.org/32126
üst 7382c06d
......@@ -43,6 +43,7 @@
#include <editeng/escapementitem.hxx>
#include <editeng/svxenum.hxx>
#include <editeng/flditem.hxx>
#include <editeng/adjustitem.hxx>
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
#include <vcl/metaact.hxx>
#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
......@@ -1022,7 +1023,14 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
// else the alignment is wanted.
if(SDRTEXTHORZADJUST_BLOCK == eHAdj)
{
eHAdj = SDRTEXTHORZADJUST_CENTER;
SvxAdjust eAdjust = static_cast<const SvxAdjustItem&>(GetObjectItemSet().Get(EE_PARA_JUST)).GetAdjust();
switch(eAdjust)
{
case SVX_ADJUST_LEFT: eHAdj = SDRTEXTHORZADJUST_LEFT; break;
case SVX_ADJUST_RIGHT: eHAdj = SDRTEXTHORZADJUST_RIGHT; break;
case SVX_ADJUST_CENTER: eHAdj = SDRTEXTHORZADJUST_CENTER; break;
default: break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment