summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-06-13 07:46:17 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-06-13 07:46:17 +0000
commit6fa144da900469c0ff496b8af8057e7244fa6885 (patch)
tree28b7be5203608becbe38f7d54d46c8260d9addd4 /vcl
parent8efa7ea14df672d42560db49311faab83777a99b (diff)
INTEGRATION: CWS aquabmpfix02 (1.56.2); FILE MERGED
2008/06/05 13:37:30 hdu 1.56.2.4: #100000# WAE: tools-polygon hopefully has an USHORT life 2008/06/02 10:20:46 hdu 1.56.2.3: #i90247# cleanup OutputDevice::ImplSelectClipRegion() signature 2008/06/02 09:02:39 hdu 1.56.2.2: #i89828# reconstruct the correct polygon from OutputDevice::ImplSetTriangleClipRegion() argument 2008/06/02 08:44:39 hdu 1.56.2.1: #i89828# add and use OutputDevice::ImplGetDeviceTransformation() method
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/outdev.cxx50
1 files changed, 40 insertions, 10 deletions
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 279df8d49a48..cb4c90640837 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: outdev.cxx,v $
- * $Revision: 1.56 $
+ * $Revision: 1.57 $
*
* This file is part of OpenOffice.org.
*
@@ -172,11 +172,21 @@ static void ImplDeleteObjStack( ImplObjStack* pObjStack )
// -----------------------------------------------------------------------
-BOOL OutputDevice::ImplSelectClipRegion( SalGraphics* pGraphics, const Region& rRegion, OutputDevice *pOutDev )
+bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGraphics )
{
+ DBG_TESTSOLARMUTEX();
+
// TODO(Q3): Change from static to plain method - everybody's
// calling it with pOutDev=this!
- DBG_TESTSOLARMUTEX();
+ // => done, but only with minimal changes for now => TODO
+ OutputDevice* const pOutDev = this;
+ if( !pGraphics )
+ {
+ if( !mpGraphics )
+ if( !ImplGetGraphics() )
+ return false;
+ pGraphics = mpGraphics;
+ }
if( rRegion.HasPolyPolygon()
&& pGraphics->supportsOperation( OutDevSupport_B2DClip ) )
@@ -1017,7 +1027,7 @@ void OutputDevice::ImplInitClipRegion()
else
{
mbOutputClipped = FALSE;
- ImplSelectClipRegion( mpGraphics, aRegion, this );
+ ImplSelectClipRegion( aRegion );
}
mbClipRegionSet = TRUE;
}
@@ -1030,9 +1040,9 @@ void OutputDevice::ImplInitClipRegion()
else
{
mbOutputClipped = FALSE;
- ImplSelectClipRegion( mpGraphics,
+ ImplSelectClipRegion(
// #102532# Respect output offset also for clip region
- ImplPixelToDevicePixel( maRegion ), this );
+ ImplPixelToDevicePixel( maRegion ) );
}
mbClipRegionSet = TRUE;
@@ -1438,8 +1448,28 @@ void OutputDevice::ImplSetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
if( mpGraphics->supportsOperation( OutDevSupport_B2DClip ) )
{
+#if 0
::basegfx::B2DPolyPolygon aB2DPolyPolygon = rPolyPolygon.getB2DPolyPolygon();
- const ::basegfx::B2DHomMatrix aTransform = GetViewTransformation();
+#else
+ // getB2DPolyPolygon() "optimizes away" some points
+ // which prevents reliable undoing of the "triangle thingy" parameter
+ // so the toolspoly -> b2dpoly conversion has to be done manually
+ ::basegfx::B2DPolyPolygon aB2DPolyPolygon;
+ for( USHORT nPolyIdx = 0; nPolyIdx < rPolyPolygon.Count(); ++nPolyIdx )
+ {
+ const Polygon& rPolygon = rPolyPolygon[ nPolyIdx ];
+ ::basegfx::B2DPolygon aB2DPoly;
+ for( USHORT nPointIdx = 0; nPointIdx < rPolygon.GetSize(); ++nPointIdx )
+ {
+ const Point& rPoint = rPolygon[ nPointIdx ];
+ const ::basegfx::B2DPoint aB2DPoint( rPoint.X(), rPoint.Y() );
+ aB2DPoly.append( aB2DPoint );
+ }
+ aB2DPolyPolygon.append( aB2DPoly );
+ }
+#endif
+
+ const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
aB2DPolyPolygon.transform( aTransform );
// the rPolyPolygon argument is a "triangle thingy"
@@ -2384,7 +2414,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
&& mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
{
::basegfx::B2DPolygon aB2DPolyLine = rPoly.getB2DPolygon();
- const ::basegfx::B2DHomMatrix aTransform = GetViewTransformation();
+ const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
aB2DPolyLine.transform( aTransform );
const ::basegfx::B2DVector aB2DLineWidth( 1.0, 1.0 );
if( mpGraphics->DrawPolyLine( aB2DPolyLine, aB2DLineWidth, this ) )
@@ -2531,7 +2561,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
&& mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
{
::basegfx::B2DPolyPolygon aB2DPolyPolygon( rPoly.getB2DPolygon() );
- const ::basegfx::B2DHomMatrix aTransform = GetViewTransformation();
+ const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
aB2DPolyPolygon.transform( aTransform );
if( mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, 0.0, this ) )
return;
@@ -2595,7 +2625,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
&& mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
{
::basegfx::B2DPolyPolygon aB2DPolyPolygon = rPolyPoly.getB2DPolyPolygon();
- const ::basegfx::B2DHomMatrix aTransform = GetViewTransformation();
+ const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
aB2DPolyPolygon.transform( aTransform );
if( mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, 0.0, this ) )
return;