summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-05-30 14:35:09 +0200
committerAndras Timar <andras.timar@collabora.com>2014-05-31 10:43:12 +0000
commit1f29a3435b11bd6bfc60343953d8b072c7470746 (patch)
tree18cacb814cfe07f1e57d8b34b2d8eb81469ad890 /oox
parent2d89b1a029514935b60fbd3f7f7c5341a329bfc8 (diff)
bnc#870237: wrong text position in grouped list
In grouped list text area does not cover the whole shape but just a part of it at the top. To get the same visual effect modify text distance attribute. (cherry picked from commit 53c376d35b7223d53e8c9403390afe53d1f69089) Conflicts: sd/qa/unit/import-tests.cxx Change-Id: I32f30d0afbc1975f940c4562ec65f46596e97060 Reviewed-on: https://gerrit.libreoffice.org/9569 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/textbodyproperties.cxx6
-rw-r--r--oox/source/drawingml/transform2dcontext.cxx21
2 files changed, 23 insertions, 4 deletions
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index 9e538973201e..3861ebe78a1c 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -80,8 +80,10 @@ void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation )
// Hack for n#760986
// TODO: Preferred method would be to have a textbox on top
// of the shape and the place it according to the (off,ext)
- if( nOff == 0 && moTextOffX && mbAnchorCtr ) nVal = *moTextOffX;
- if( nOff == 1 && moTextOffY && mbAnchorCtr ) nVal = *moTextOffY;
+ if( nOff == 0 && moTextOffLeft && mbAnchorCtr ) nVal = *moTextOffLeft;
+ if( nOff == 1 && moTextOffUpper ) nVal = *moTextOffLeft;
+ if( nOff == 2 && moTextOffRight && mbAnchorCtr ) nVal = *moTextOffRight;
+ if( nOff == 3 && moTextOffLower ) nVal = *moTextOffLower;
if( nVal < 0 ) nVal = 0;
if( moInsets[i] )
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index d3a7c4b60b05..92166c494e37 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -62,12 +62,29 @@ ContextHandlerRef Transform2DContext::onCreateContext( sal_Int32 aElementToken,
OUString sXValue = rAttribs.getString( XML_x ).get();
OUString sYValue = rAttribs.getString( XML_y ).get();
if( !sXValue.isEmpty() )
- mrShape.getTextBody()->getTextProperties().moTextOffX = GetCoordinate( sXValue.toInt32() - mrShape.getPosition().X );
+ mrShape.getTextBody()->getTextProperties().moTextOffUpper = GetCoordinate( sXValue.toInt32() - mrShape.getPosition().X );
if( !sYValue.isEmpty() )
- mrShape.getTextBody()->getTextProperties().moTextOffY = GetCoordinate( sYValue.toInt32() - mrShape.getPosition().Y );
+ mrShape.getTextBody()->getTextProperties().moTextOffLeft = GetCoordinate( sYValue.toInt32() - mrShape.getPosition().Y );
}
break;
case A_TOKEN( ext ):
+ {
+ const OUString sXValue = rAttribs.getString( XML_cx ).get();
+ const OUString sYValue = rAttribs.getString( XML_cy ).get();
+ if( !sXValue.isEmpty() )
+ {
+ mrShape.getTextBody()->getTextProperties().moTextOffRight = GetCoordinate(mrShape.getSize().Width - sXValue.toInt32());
+ if( mrShape.getTextBody()->getTextProperties().moTextOffLeft )
+ *mrShape.getTextBody()->getTextProperties().moTextOffRight -= *mrShape.getTextBody()->getTextProperties().moTextOffLeft;
+ }
+ if( !sYValue.isEmpty() )
+ {
+ mrShape.getTextBody()->getTextProperties().moTextOffLower = GetCoordinate(mrShape.getSize().Height - sYValue.toInt32());
+ if( mrShape.getTextBody()->getTextProperties().moTextOffUpper )
+ *mrShape.getTextBody()->getTextProperties().moTextOffLower -= *mrShape.getTextBody()->getTextProperties().moTextOffUpper;
+
+ }
+ }
break;
}
return 0;