summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2016-12-17 16:11:06 +0100
committerAndras Timar <andras.timar@collabora.com>2016-12-19 08:30:12 +0000
commited5e0a90aa445f5380a245a203caee6518d483cd (patch)
treecf72f6c55df77f744c26f9257a08fcd721dd8eea
parentd253963f460e5600eb886480306b01a6fbc27ee6 (diff)
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/32123 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 5694b4970e3af096130e172ac6968b10ed587a6f) Reviewed-on: https://gerrit.libreoffice.org/32127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index d822a71183e7..9b6a8c9eaa3a 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -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>
@@ -1009,7 +1010,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;
+ }
}
}