summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/drawingmltypes.cxx2
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx22
2 files changed, 14 insertions, 10 deletions
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx
index 93c7c423330f..41b659082f77 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -73,7 +73,7 @@ double GetPositiveFixedPercentage( const OUString& sValue )
/** converts the attributes from an CT_TLPoint into an awt Point with 1/1000% */
awt::Point GetPointPercent( const Reference< XFastAttributeList >& xAttribs )
{
- return awt::Point( GetPercent( xAttribs->getOptionalValue( XML_x ) ), GetCoordinate( xAttribs->getOptionalValue( XML_y ) ) );
+ return awt::Point(GetPercent(xAttribs->getOptionalValue(XML_x)), GetPercent(xAttribs->getOptionalValue(XML_y)));
}
/** converts the ST_TextFontSize to point */
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index 625036a25a2f..ec720520e54c 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/animations/AnimationCalcMode.hpp>
#include <com/sun/star/animations/AnimationColorSpace.hpp>
#include <com/sun/star/animations/AnimationNodeType.hpp>
+#include <com/sun/star/animations/ValuePair.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/presentation/EffectCommands.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
@@ -82,6 +83,15 @@ namespace {
// only get first token.
return oox::ppt::convertAnimationValue(getAttributeEnumByAPIName(aNameList.getToken(0, ';')), rAny);
}
+
+ css::uno::Any convertPointPercent(const css::awt::Point& rPoint)
+ {
+ css::animations::ValuePair aPair;
+ // rPoint.X and rPoint.Y are in 1000th of a percent, but we only need ratio.
+ aPair.First <<= static_cast<double>(rPoint.X) / 100000.0;
+ aPair.Second <<= static_cast<double>(rPoint.Y) / 100000.0;
+ return makeAny(aPair);
+ }
}
namespace oox { namespace ppt {
@@ -651,25 +661,19 @@ namespace oox { namespace ppt {
case PPT_TOKEN( to ):
{
// CT_TLPoint
- awt::Point p = GetPointPercent( rAttribs.getFastAttributeList() );
- maTo <<= p.X;
- maTo <<= p.Y;
+ maTo = convertPointPercent(GetPointPercent(rAttribs.getFastAttributeList()));
return this;
}
case PPT_TOKEN( from ):
{
// CT_TLPoint
- awt::Point p = GetPointPercent( rAttribs.getFastAttributeList() );
- maFrom <<= p.X;
- maFrom <<= p.Y;
+ maFrom = convertPointPercent(GetPointPercent(rAttribs.getFastAttributeList()));
return this;
}
case PPT_TOKEN( by ):
{
// CT_TLPoint
- awt::Point p = GetPointPercent( rAttribs.getFastAttributeList() );
- maBy <<= p.X;
- maBy <<= p.Y;
+ maBy = convertPointPercent(GetPointPercent(rAttribs.getFastAttributeList()));
return this;
}
default: