summaryrefslogtreecommitdiff
path: root/svtools/source/filter.vcl/wmf/winmtf.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/filter.vcl/wmf/winmtf.cxx')
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index b0625567d5d6..b60ae0676cc9 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -377,6 +377,19 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
{
switch( mnMapMode )
{
+ case MM_TEXT:
+ fX2 -= mnWinOrgX;
+ fY2 -= mnWinOrgY;
+ 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 :
{
fX2 -= mnWinOrgX;
@@ -452,6 +465,15 @@ 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 :
{
fWidth *= 25.40;
@@ -894,6 +916,7 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
mbComplexClip ( false ),
mnGfxMode ( GM_COMPATIBLE ),
mnMapMode ( MM_TEXT ),
+ mnUnitsPerInch ( 96 ),
mnDevOrgX ( 0 ),
mnDevOrgY ( 0 ),
mnDevWidth ( 1 ),
@@ -2014,6 +2037,14 @@ void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode )
//-----------------------------------------------------------------------------------
+void WinMtfOutput::SetUnitsPerInch( sal_uInt16 nUnitsPerInch )
+{
+ if( nUnitsPerInch != 0 )
+ mnUnitsPerInch = nUnitsPerInch;
+}
+
+//-----------------------------------------------------------------------------------
+
void WinMtfOutput::SetWorldTransform( const XForm& rXForm )
{
maXForm.eM11 = rXForm.eM11;