summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-11-27 12:12:42 +0100
committerAndras Timar <andras.timar@collabora.com>2013-11-27 06:38:47 -0600
commit22f63e3e7be99f13fd719ffc03aa78e34bd545af (patch)
treeddc8910094637fa46fd4525b6ccaddd28d32eed7
parentd32eea1634cff144a45c3ee6b0bb54e1cc7663c5 (diff)
fdo#61272: Do the mapping correctly both for WMF and EMF.
Turns out that for the WMF, we already had everything set up correctly, we were just overwriting the right settings with default data again :-) - fix that. Includes the following commits: * Revert "wmf-mm-text-1.diff: Fix WMF rendering, n#417818" * Revert "wmf-mm-text.diff: Fix WMF rendering, n#417818" * fdo#56886 EMF: Fixes some scaling problems of clipped regions, Twips Change-Id: I7ff859246dbaea3868438d3632f9adc60fc4ee37 Reviewed-on: https://gerrit.libreoffice.org/6829 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx33
-rw-r--r--vcl/source/filter/wmf/winmtf.hxx1
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx1
3 files changed, 1 insertions, 34 deletions
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index c8c6652af667..6d440843fb3c 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -374,19 +374,6 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
{
switch( mnMapMode )
{
- case MM_TEXT:
- fX2 -= mnWinOrgX;
- fY2 -= mnWinOrgY;
- if( mnDevWidth != 1 || mnDevHeight != 1 ) {
- fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
- fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/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;
@@ -471,15 +458,6 @@ Size WinMtfOutput::ImplMap( const Size& rSz )
{
switch( mnMapMode )
{
- case MM_TEXT:
- if( mnDevWidth != 1 && mnDevHeight != 1 ) {
- fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
- fHeight*= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
- } else {
- fWidth *= (double)mnMillX * 100 / (double)mnPixX;
- fHeight *= (double)mnMillY * 100 / (double)mnPixY;
- }
- break;
case MM_LOENGLISH :
{
fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*10;
@@ -916,7 +894,6 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
mbComplexClip ( false ),
mnGfxMode ( GM_COMPATIBLE ),
mnMapMode ( MM_TEXT ),
- mnUnitsPerInch ( 96 ),
mnDevOrgX ( 0 ),
mnDevOrgY ( 0 ),
mnDevWidth ( 1 ),
@@ -2025,7 +2002,7 @@ void WinMtfOutput::SetRefMill( const Size& rSize )
void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode )
{
mnMapMode = nMapMode;
- if ( nMapMode == MM_TEXT )
+ if ( nMapMode == MM_TEXT && !mbIsMapWinSet )
{
mnWinExtX = mnDevWidth;
mnWinExtY = mnDevHeight;
@@ -2039,14 +2016,6 @@ 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;
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index bec5d8ae3c7b..8e18f7e688b3 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -679,7 +679,6 @@ public:
sal_uInt32 GetMapMode() const { return mnMapMode; };
void SetMapMode( sal_uInt32 mnMapMode );
- void SetUnitsPerInch( sal_uInt16 nUnitsPerInch );
void SetWorldTransform( const XForm& rXForm );
void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode );
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 84b1a78d9537..3777c3b99373 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1108,7 +1108,6 @@ sal_Bool WMFReader::ReadHeader()
}
}
- pOut->SetUnitsPerInch( nUnitsPerInch );
pOut->SetWinOrg( aPlaceableBound.TopLeft() );
Size aWMFSize( labs( aPlaceableBound.GetWidth() ), labs( aPlaceableBound.GetHeight() ) );
pOut->SetWinExt( aWMFSize );