summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2014-02-24 14:55:05 +0100
committerAndras Timar <andras.timar@collabora.com>2014-02-24 06:48:07 -0800
commit45cc86bf89cee298037bef9693a2ea22c3238673 (patch)
tree80f9844c4638ccef581a6823440b194eabe9cd7b
parent98554820e6109c3e3f4ea83bf036d9f20ef1685e (diff)
OOXML chart import: ignore rot values outside the valid range
Change-Id: I506a78a024d761d1d263a7bb1dcbf09a4bbcf4ef
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 8c3695993e43..dada09accac1 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1105,6 +1105,11 @@ void ObjectFormatter::convertTextRotation( PropertySet& rPropSet, const ModelRef
/* Chart2 expects rotation angle as double value in range of [0,360).
OOXML counts clockwise, Chart2 counts counterclockwise. */
double fAngle = static_cast< double >( bStacked ? 0 : rxTextProp->getTextProperties().moRotation.get( 0 ) );
+ // MS Office UI allows values only in range of [-90,90].
+ if ( fAngle <= -5400000.0 || fAngle >= 5400000.0 )
+ {
+ fAngle = 0.0;
+ }
fAngle = getDoubleIntervalValue< double >( -fAngle / 60000.0, 0.0, 360.0 );
rPropSet.setProperty( PROP_TextRotation, fAngle );
}