summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-09 11:09:48 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-09 13:20:50 +0200
commite16b01a9e4e111b1267c4eec1f5d168e5c2b8e53 (patch)
tree017ccb40916fa3fb549e27de936c5c435c3a4c33 /oox
parent9defb89ede306b81a0c31a1afad9e71c95a30d32 (diff)
drawingML export: fix <a:srcRect> if graphic's map mode is pixels
Change-Id: Idbe399648c60e39c61e2be09a77b0648f57d3347
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4e1a0ceaa67b..f1ff69b6dfb1 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1063,7 +1063,13 @@ void DrawingML::WritePattFill( Reference< XPropertySet > rXPropSet )
void DrawingML::WriteSrcRect( Reference< XPropertySet > rXPropSet, const OUString& rURL )
{
- Size aOriginalSize( GraphicObject::CreateGraphicObjectFromURL( rURL ).GetPrefSize() );
+ GraphicObject aGraphicObject = GraphicObject::CreateGraphicObjectFromURL(rURL);
+ Size aOriginalSize = aGraphicObject.GetPrefSize();
+ const MapMode& rMapMode = aGraphicObject.GetPrefMapMode();
+
+ // GraphicCrop is in mm100, so in case the original size is in pixels, convert it over.
+ if (rMapMode.GetMapUnit() == MAP_PIXEL)
+ aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, MapMode(MAP_100TH_MM));
if ( GetProperty( rXPropSet, "GraphicCrop" ) )
{