summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2005-09-23 12:39:44 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2005-09-23 12:39:44 +0000
commit4e1054641ab4f5f7f8f8272b6da6e900291a8912 (patch)
treeb90ca7016097b4c35b1122b3eceeab3823dc4be6 /svtools
parenta16eaec9364d0c880858108e764c510aba8c7ed6 (diff)
INTEGRATION: CWS sj22 (1.41.372); FILE MERGED
2005/08/08 11:09:49 sj 1.41.372.3: RESYNC: (1.41-1.42); FILE MERGED 2005/07/29 09:35:12 sj 1.41.372.2: #i35252# fixed text mapping probkem 2005/06/30 08:45:00 sj 1.41.372.1: #i46928# fixed emf problem (ClosePath)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx39
1 files changed, 27 insertions, 12 deletions
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index 58a8249a9da1..2a9b1109567d 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: winmtf.cxx,v $
*
- * $Revision: 1.43 $
+ * $Revision: 1.44 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 15:46:18 $
+ * last change: $Author: hr $ $Date: 2005-09-23 13:39:44 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -178,6 +178,16 @@ void WinMtfPathObj::AddPolyPolygon( const PolyPolygon& rPolyPoly )
void WinMtfPathObj::ClosePath()
{
+ if ( Count() )
+ {
+ Polygon& rPoly = ((PolyPolygon&)*this)[ Count() - 1 ];
+ if ( rPoly.GetSize() > 2 )
+ {
+ Point aFirst( rPoly[ 0 ] );
+ if ( aFirst != rPoly[ rPoly.GetSize() - 1 ] )
+ rPoly.Insert( rPoly.GetSize(), aFirst, POLY_NORMAL );
+ }
+ }
bClosed = sal_True;
}
@@ -1420,7 +1430,9 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
VirtualDevice* pVDev = NULL;
- rPosition = ImplMap( nGfxMode == GM_ADVANCED ? Point() : rPosition );
+// rPosition = ImplMap( nGfxMode == GM_ADVANCED ? Point() : rPosition );
+ rPosition = ImplMap( rPosition );
+
sal_Int32 nOldGfxMode = GetGfxMode();
SetGfxMode( GM_COMPATIBLE );
if ( pDXArry )
@@ -1494,20 +1506,23 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
if ( nGfxMode == GM_ADVANCED )
{
+ // check whether there is a font rotation applied via transformation
Point aP1( ImplMap( Point() ) );
- Point aP2( ImplMap( Point( 0, aTmp.GetHeight() ) ) );
+ Point aP2( ImplMap( Point( 0, 100 ) ) );
aP2.X() -= aP1.X();
aP2.Y() -= aP1.Y();
double fX = aP2.X();
double fY = aP2.Y();
- double fHeight = sqrt( fX * fX + fY * fY );
- aTmp.SetHeight( (sal_Int32)fHeight );
-
- double fOrientation = acos( fX / sqrt( fX * fX + fY * fY ) ) * 57.29577951308;
- if ( fY > 0 )
- fOrientation = 360 - fOrientation;
- fOrientation += 90;
- aTmp.SetOrientation( sal_Int16( fOrientation * 10.0 ) );
+ if ( fX )
+ {
+ double fOrientation = acos( fX / sqrt( fX * fX + fY * fY ) ) * 57.29577951308;
+ if ( fY > 0 )
+ fOrientation = 360 - fOrientation;
+ fOrientation += 90;
+ fOrientation *= 10;
+ fOrientation += aTmp.GetOrientation();
+ aTmp.SetOrientation( sal_Int16( fOrientation ) );
+ }
}
if( mnTextAlign & ( TA_UPDATECP | TA_RIGHT_CENTER ) )