From 5ef0f1dc9a70c20fe6879832b782a0c34724353f Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@suse.cz>
Date: Thu, 11 Oct 2012 14:48:55 +0000
Subject: fdo#55493 fix RTF import of specific PNG image

The image was special in that the resulting Graphic's
GetPrefMapMode().GetMapUnit() wasn't MAP_PIXEL.

Change-Id: I681e344a042721b99f6cb2e599f9c65156d219a4
---
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d56307f..d0d0b7f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -674,7 +674,10 @@ int RTFDocumentImpl::resolvePict(bool bInline)
         Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic();
         Size aSize(aGraphic.GetPrefSize());
         MapMode aMap(MAP_100TH_MM);
-        aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, aMap );
+        if (aGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL)
+            aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap);
+        else
+            aSize = OutputDevice::LogicToLogic(aSize, aGraphic.GetPrefMapMode(), aMap);
         m_aStates.top().aPicture.nWidth = aSize.Width();
         m_aStates.top().aPicture.nHeight = aSize.Height();
     }
--
cgit v0.9.0.2-2-gbebe

