summaryrefslogtreecommitdiffstats
path: root/svtools
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2011-04-28 14:49:33 +0200
committerPetr Mladek <pmladek@suse.cz>2011-04-28 14:49:33 +0200
commit6f160b2a44c855c5eaa2357c2730ea9de6be8f26 (patch)
tree8beea3aa51fbdd4459a17e54c3568c4bde422aaf /svtools
parentwmf-mm-text.diff: M_TEXT map mode support in wmf (bnc#417818) (diff)
downloadcore-6f160b2a44c855c5eaa2357c2730ea9de6be8f26.tar.gz
core-6f160b2a44c855c5eaa2357c2730ea9de6be8f26.zip
wmf-mm-text-1.diff: fix regression caused by wmf-mm-text.diff (bnc#417818)
make the fixed code run only when device size is set
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index 9d4875d83a51..b60ae0676cc9 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -380,10 +380,15 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
case MM_TEXT:
fX2 -= mnWinOrgX;
fY2 -= mnWinOrgY;
- fX2 *= 2540.0/mnUnitsPerInch;
- fY2 *= 2540.0/mnUnitsPerInch;
+ if( mnDevWidth != 1 || mnDevHeight != 1 ) {
+ fX2 *= 2540.0/mnUnitsPerInch;
+ fY2 *= 2540.0/mnUnitsPerInch;
+ }
fX2 += mnDevOrgX;
fY2 += mnDevOrgY;
+ fX2 *= (double)mnMillX * 100.0 / (double)mnPixX;
+ fY2 *= (double)mnMillY * 100.0 / (double)mnPixY;
+
break;
case MM_LOENGLISH :
{
@@ -461,8 +466,13 @@ Size WinMtfOutput::ImplMap( const Size& rSz )
switch( mnMapMode )
{
case MM_TEXT:
+ if( mnDevWidth != 1 && mnDevHeight != 1 ) {
fWidth *= 2540.0/mnUnitsPerInch;
fHeight*= 2540.0/mnUnitsPerInch;
+ } else {
+ fWidth *= (double)mnMillX * 100 / (double)mnPixX;
+ fHeight *= (double)mnMillY * 100 / (double)mnPixY;
+ }
break;
case MM_LOENGLISH :
{