diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-04-26 19:20:22 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-04-26 19:28:55 +0200 |
commit | 17ca93a6e592d3109e47c756fcfe8ac975acae5f (patch) | |
tree | 1fa5aefa50a4634928b55f7ace35ece6bebf4666 /vcl | |
parent | 6d0005d95f20a326fe308a7c59dd2801f0d0b241 (diff) |
fdo#74336 need to transform dash length / dot length / distance
Dash length, dot length and distance also need to be world
transformed to be compatible with device metrics.
Change-Id: I57c04f5010006aaf8c1c32e0949cb39b7f2bc67d
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/wmf/winmtf.cxx | 22 | ||||
-rw-r--r-- | vcl/source/filter/wmf/winmtf.hxx | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 7aa73372c6f8..7c4b01d8f7ed 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -473,6 +473,20 @@ void WinMtfOutput::ImplMap( Font& rFont ) rFont.SetOrientation( 3600 - rFont.GetOrientation() ); } +sal_Int32 WinMtfOutput::ImplConvertWidth(const sal_Int32 aWidth) +{ + Size aSize(aWidth, 0); + return ImplMap(aSize).Width(); +} + +void WinMtfOutput::ImplMap(LineInfo& rLineInfo) +{ + rLineInfo.SetWidth(ImplConvertWidth(rLineInfo.GetWidth())); + rLineInfo.SetDashLen(ImplConvertWidth(rLineInfo.GetDashLen())); + rLineInfo.SetDotLen(ImplConvertWidth(rLineInfo.GetDotLen())); + rLineInfo.SetDistance(ImplConvertWidth(rLineInfo.GetDistance())); +} + Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon ) { sal_uInt16 nPoints = rPolygon.GetSize(); @@ -682,9 +696,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle ) else if ( eType == GDI_PEN ) { WinMtfLineStyle* pLineStyle = (WinMtfLineStyle*) pStyle; - Size aSize(pLineStyle->aLineInfo.GetWidth(), 0); - aSize = ImplMap(aSize); - pLineStyle->aLineInfo.SetWidth(aSize.Width()); + ImplMap(pLineStyle->aLineInfo); } } sal_uInt32 nIndex; @@ -716,9 +728,7 @@ void WinMtfOutput::CreateObject( sal_Int32 nIndex, GDIObjectType eType, void* pS else if ( eType == GDI_PEN ) { WinMtfLineStyle* pLineStyle = (WinMtfLineStyle*) pStyle; - Size aSize(pLineStyle->aLineInfo.GetWidth(), 0); - aSize = ImplMap(aSize); - pLineStyle->aLineInfo.SetWidth(aSize.Width()); + ImplMap(pLineStyle->aLineInfo); } } if ( (sal_uInt32)nIndex >= vGDIObj.size() ) diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx index 035686c25430..52b18483c32d 100644 --- a/vcl/source/filter/wmf/winmtf.hxx +++ b/vcl/source/filter/wmf/winmtf.hxx @@ -619,6 +619,8 @@ class WinMtfOutput Size ImplMap( const Size& rSz ); Rectangle ImplMap( const Rectangle& rRectangle ); void ImplMap( Font& rFont ); + sal_Int32 ImplConvertWidth(const sal_Int32 aWidth); + void ImplMap(LineInfo& rLineInfo); Polygon& ImplMap( Polygon& rPolygon ); PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon ); Polygon& ImplScale( Polygon& rPolygon ); |