[ooo-build-commit] Branch 'ooo/OOO310' - 2 commits - basegfx/source comphelper/inc comphelper/source svtools/source vcl/aqua vcl/inc vcl/source vcl/unx vcl/win

Jan Holesovsky kendy at kemper.freedesktop.org
Mon Jul 20 18:19:43 PDT 2009


 basegfx/source/polygon/b2dlinegeometry.cxx       |  105 +++++++++-----
 basegfx/source/polygon/b2dpolygoncutandtouch.cxx |    9 -
 comphelper/inc/comphelper/uieventslogger.hxx     |    4 
 comphelper/source/misc/uieventslogger.cxx        |   37 ++--
 svtools/source/contnr/fileview.cxx               |    5 
 svtools/source/contnr/svtabbx.cxx                |   41 +++--
 vcl/aqua/source/gdi/salgdi.cxx                   |    5 
 vcl/inc/vcl/outdev.hxx                           |   14 +
 vcl/source/gdi/outdev.cxx                        |  172 ++++++++++++++++++-----
 vcl/unx/source/gdi/salgdi.cxx                    |    9 +
 vcl/win/source/gdi/salgdi_gdiplus.cxx            |   12 +
 11 files changed, 299 insertions(+), 114 deletions(-)

New commits:
commit 8d54b59a290fbe2492461f13155cb1bcb91cb0c7
Author: Oliver Bolte <obo at openoffice.org>
Date:   Fri Jul 17 06:24:42 2009 +0000

    CWS-TOOLING: integrate CWS aw074
    2009-07-06 13:21:50 +0200 aw  r273737 : CWS-TOOLING: rebase CWS aw074 to branches/OOO310 at 273700 (milestone: OOO310:m15)
    2009-07-06 11:12:35 +0200 aw  r273728 : #i102637# corrected condition to add gray frame to page visualisation objects
    2009-07-03 14:43:00 +0200 aw  r273702 : #i102380# always swap n GrafObjects on MasterPages synchronously
    2009-07-03 12:14:57 +0200 aw  r273686 : #i102548# corrected SdrPathPrimitive2D's usage of unit polygon
    2009-07-02 16:06:16 +0200 aw  r273662 : #i103255# added control when to show the draft graphic visualisation (in VOC, of course) and when not. Changed text visualisation to BlockText
    2009-07-01 17:36:55 +0200 aw  r273609 : #i103116# clear GaphicLink for interaction clone of graphic objets
    2009-07-01 16:42:09 +0200 aw  r273601 : #i101491# corrected some minor glitches in line geometry creation
    2009-06-30 18:47:44 +0200 aw  r273532 : #i102380# committed the cleanups/additions for the fix
    2009-06-26 13:16:17 +0200 aw  r273404 : #i101491# finetuning changes
    2009-06-26 13:15:57 +0200 aw  r273403 : #i101491# finetuning changes
    2009-06-25 16:31:26 +0200 aw  r273387 : #i101491# first version checkin for linux/mac tests
    2009-06-25 16:31:04 +0200 aw  r273386 : #i101491# first version checkin for linux/mac tests
    2009-06-24 15:35:05 +0200 aw  r273350 : #i101734# corrected VclMetafileProcessor2D::impTryToCreateSvtGraphicStroke to use the current ObjectTransformation
    2009-06-24 15:01:58 +0200 aw  r273348 : #i101811# added ViewInformation2D to renderChartPrimitive2D to allow embedding of object transformation to target MapMode
    2009-06-24 12:27:05 +0200 aw  r273328 : #i101980# use a hairline LineWitdth for SdrObject::TakeContour() calculation (like the old implementation did)
    2009-06-24 11:29:43 +0200 aw  r273321 : #i101781# corrected creation fallback for FullDrag for circle objects
    2009-06-23 17:26:58 +0200 aw  r273300 : #i101556# made primitive text attributes take versioned base text attribute sets into account

diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx
index a6e6652..cb14766 100644
--- a/basegfx/source/polygon/b2dlinegeometry.cxx
+++ b/basegfx/source/polygon/b2dlinegeometry.cxx
@@ -352,13 +352,12 @@ namespace basegfx
             // Unfortunately, while it would be geometrically correct to not add
             // the in-between points EdgeEnd and EdgeStart, it leads to rounding
             // errors when converting to integer polygon coordinates for painting
-            const B2DVector aEdgeVector(rEdge.getEndPoint() - rEdge.getStartPoint());
-
             if(rEdge.isBezier())
             {
                 // prepare target and data common for upper and lower
                 B2DPolygon aBezierPolygon;
-                const double fEdgeLength(aEdgeVector.getLength());
+                const B2DVector aPureEdgeVector(rEdge.getEndPoint() - rEdge.getStartPoint());
+                const double fEdgeLength(aPureEdgeVector.getLength());
                 const bool bIsEdgeLengthZero(fTools::equalZero(fEdgeLength));
                 const B2DVector aTangentA(rEdge.getTangent(0.0));
                 const B2DVector aTangentB(rEdge.getTangent(1.0));
@@ -441,7 +440,11 @@ namespace basegfx
             }
             else
             {
-                const B2DVector aPerpendEdgeVector(getNormalizedPerpendicular(aEdgeVector) * fHalfLineWidth);
+                // #i101491# emulate rEdge.getTangent call which applies a factor of 0.3 to the
+                // full-length edge vector to have numerically exactly the same results as in the
+                // createAreaGeometryForJoin implementation
+                const B2DVector aEdgeTangent((rEdge.getEndPoint() - rEdge.getStartPoint()) * 0.3);
+                const B2DVector aPerpendEdgeVector(getNormalizedPerpendicular(aEdgeTangent) * fHalfLineWidth);
                 B2DPolygon aEdgePolygon;
                 
                 // create upper edge
@@ -495,45 +498,75 @@ namespace basegfx
                 }
             }
 
-            // create first polygon part for edge
-            aEdgePolygon.append(aEndPoint);
-            aEdgePolygon.append(rPoint);
-            aEdgePolygon.append(aStartPoint);
-
-            if(B2DLINEJOIN_MITER == eJoin)
+            switch(eJoin)
             {
-                // Look for the cut point between start point along rTangentPrev and
-                // end point along rTangentEdge. -rTangentEdge should be used, but since
-                // the cut value is used for interpolating along the first edge, the negation
-                // is not needed since the same fCut will be found on the first edge.
-                // If it exists, insert it to complete the mitered fill polygon.
-                double fCutPos(0.0);
-                tools::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CUTFLAG_ALL, &fCutPos);
-
-                if(0.0 != fCutPos)
+                case B2DLINEJOIN_MITER :
                 {
-                    const B2DPoint aCutPoint(interpolate(aStartPoint, aStartPoint + rTangentPrev, fCutPos));
-                    aEdgePolygon.append(aCutPoint);
+                    aEdgePolygon.append(aEndPoint);
+                    aEdgePolygon.append(rPoint);
+                    aEdgePolygon.append(aStartPoint);
+                    
+                    // Look for the cut point between start point along rTangentPrev and
+                    // end point along rTangentEdge. -rTangentEdge should be used, but since
+                    // the cut value is used for interpolating along the first edge, the negation
+                    // is not needed since the same fCut will be found on the first edge.
+                    // If it exists, insert it to complete the mitered fill polygon.
+                    double fCutPos(0.0);
+                    tools::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CUTFLAG_ALL, &fCutPos);
+
+                    if(0.0 != fCutPos)
+                    {
+                        const B2DPoint aCutPoint(interpolate(aStartPoint, aStartPoint + rTangentPrev, fCutPos));
+                        aEdgePolygon.append(aCutPoint);
+                    }
+                    
+                    break;
                 }
-            }
-            else if(B2DLINEJOIN_ROUND == eJoin)
-            {
-                // use tooling to add needed EllipseSegment
-                double fAngleStart(atan2(rPerpendPrev.getY(), rPerpendPrev.getX()));
-                double fAngleEnd(atan2(rPerpendEdge.getY(), rPerpendEdge.getX()));
-                
-                // atan2 results are [-PI .. PI], consolidate to [0.0 .. 2PI]
-                if(fAngleStart < 0.0)
+                case B2DLINEJOIN_ROUND :
                 {
-                    fAngleStart += F_2PI;
-                }
+                    // use tooling to add needed EllipseSegment
+                    double fAngleStart(atan2(rPerpendPrev.getY(), rPerpendPrev.getX()));
+                    double fAngleEnd(atan2(rPerpendEdge.getY(), rPerpendEdge.getX()));
+                    
+                    // atan2 results are [-PI .. PI], consolidate to [0.0 .. 2PI]
+                    if(fAngleStart < 0.0)
+                    {
+                        fAngleStart += F_2PI;
+                    }
+
+                    if(fAngleEnd < 0.0)
+                    {
+                        fAngleEnd += F_2PI;
+                    }
 
-                if(fAngleEnd < 0.0)
+                    const B2DPolygon aBow(tools::createPolygonFromEllipseSegment(rPoint, fHalfLineWidth, fHalfLineWidth, fAngleStart, fAngleEnd));
+
+                    if(aBow.count() > 1)
+                    {
+                        // #i101491#
+                        // use the original start/end positions; the ones from bow creation may be numerically
+                        // different due to their different creation. To guarantee good merging quality with edges
+                        // and edge roundings (and to reduce point count)
+                        aEdgePolygon = aBow;
+                        aEdgePolygon.setB2DPoint(0, aStartPoint);
+                        aEdgePolygon.setB2DPoint(aEdgePolygon.count() - 1, aEndPoint);
+                        aEdgePolygon.append(rPoint);
+
+                        break;
+                    }
+                    else
+                    {
+                        // wanted fall-through to default
+                    }
+                }
+                default: // B2DLINEJOIN_BEVEL
                 {
-                    fAngleEnd += F_2PI;
+                    aEdgePolygon.append(aEndPoint);
+                    aEdgePolygon.append(rPoint);
+                    aEdgePolygon.append(aStartPoint);
+                    
+                    break;
                 }
-
-                aEdgePolygon.append(tools::createPolygonFromEllipseSegment(rPoint, fHalfLineWidth, fHalfLineWidth, fAngleStart, fAngleEnd));
             }
 
             // create last polygon part for edge
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 02ab827..5757d42 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -110,7 +110,10 @@ namespace basegfx
         {
             // #i76891# mergeTemporaryPointsAndPolygon redesigned to be able to correctly handle
             // single edges with/without control points
-            if(rTempPoints.size())
+            // #i101491# added counter for non-changing element count
+            const sal_uInt32 nTempPointCount(rTempPoints.size());
+
+            if(nTempPointCount)
             {
                 B2DPolygon aRetval;
                 const sal_uInt32 nCount(rCandidate.count());
@@ -138,7 +141,7 @@ namespace basegfx
                             double fLeftStart(0.0);
 
                             // now add all points targeted to be at this index
-                            while(nNewInd < rTempPoints.size() && rTempPoints[nNewInd].getIndex() == a)
+                            while(nNewInd < nTempPointCount && rTempPoints[nNewInd].getIndex() == a)
                             {
                                 const temporaryPoint& rTempPoint = rTempPoints[nNewInd++];
 
@@ -160,7 +163,7 @@ namespace basegfx
                         else
                         {
                             // add all points targeted to be at this index
-                            while(nNewInd < rTempPoints.size() && rTempPoints[nNewInd].getIndex() == a)
+                            while(nNewInd < nTempPointCount && rTempPoints[nNewInd].getIndex() == a)
                             {
                                 const temporaryPoint& rTempPoint = rTempPoints[nNewInd++];
                                 const B2DPoint aNewPoint(rTempPoint.getPoint());
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 1efd38e..932089f 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -976,6 +976,11 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
     if( rLineWidths.getX() != rLineWidths.getY() )
         return false;
 
+    // #i101491# Aqua does not support B2DLINEJOIN_NONE; return false to use
+    // the fallback (own geometry preparation)
+    if(basegfx::B2DLINEJOIN_NONE == eLineJoin)
+        return false;
+
     // setup line attributes
     CGLineJoin aCGLineJoin = kCGLineJoinMiter;
     switch( eLineJoin ) {
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 8cc2aed..7c52eaa 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -561,6 +561,20 @@ public:
     // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
     SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
 
+    // #i101491#
+    // Helper which holds the old line geometry creation and is extended to use AA when
+    // switched on. Advantage is that line geometry is only temporarily used for paint
+    SAL_DLLPRIVATE void ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo);
+    
+    // #i101491#
+    // Helper who implements the DrawPolyPolygon functionality for basegfx::B2DPolyPolygon
+    // without MetaFile processing
+    SAL_DLLPRIVATE void ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly);
+
+    // #i101491#
+    // Helper who tries to use SalGDI's DrawPolyLine direct and returns it's bool. Contains no AA check.
+    SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect(const basegfx::B2DPolygon& rB2DPolygon, double fLineWidth, basegfx::B2DLineJoin eLineJoin);
+
 protected:
                         OutputDevice();
 
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 739012f..9e9577c 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -68,6 +68,7 @@
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dlinegeometry.hxx>
 
 #include <com/sun/star/awt/XGraphics.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
@@ -2444,22 +2445,15 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
     if ( mbInitLineColor )
         ImplInitLineColor();
 
+    const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) 
+        && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
+        && ROP_OVERPAINT == GetRasterOp()
+        && IsLineColor());
+
     // use b2dpolygon drawing if possible
-    if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
+    if(bTryAA && ImpTryDrawPolyLineDirect(rPoly.getB2DPolygon(), 0.0, basegfx::B2DLINEJOIN_NONE))
     {
-        ::basegfx::B2DPolygon aB2DPolyLine = rPoly.getB2DPolygon();
-        const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
-        aB2DPolyLine.transform( aTransform );
-        const ::basegfx::B2DVector aB2DLineWidth( 1.0, 1.0 );
-
-        if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && (mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE))
-        {
-            // #i98289#
-            aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine);
-        }
-
-        if( mpGraphics->DrawPolyLine( aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_ROUND, this ) )
-            return;
+        return;
     }
 
     Polygon aPoly = ImplLogicToDevicePixel( rPoly );
@@ -2499,9 +2493,23 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
         return;
     }
 
+    // #i101491#
+    // Try direct Fallback to B2D-Version of DrawPolyLine
+    if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) 
+        && LINE_SOLID == rLineInfo.GetStyle())
+    {
+        DrawPolyLine(rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), basegfx::B2DLINEJOIN_ROUND);
+        return;
+    }
+
     if ( mpMetaFile )
         mpMetaFile->AddAction( new MetaPolyLineAction( rPoly, rLineInfo ) );
 
+    ImpDrawPolyLineWithLineInfo(rPoly, rLineInfo);
+}
+
+void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo)
+{
     USHORT nPoints = rPoly.GetSize();
 
     if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() )
@@ -2527,6 +2535,10 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
         return;
 
     const LineInfo aInfo( ImplLogicToDevicePixel( rLineInfo ) );
+    const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) 
+        && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
+        && ROP_OVERPAINT == GetRasterOp()
+        && IsLineColor());
 
     if( aInfo.GetWidth() > 1L )
     {
@@ -2540,9 +2552,32 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
         ImplInitLineColor();
         SetFillColor( aOldLineColor );
         ImplInitFillColor();
+        bool bDone(false);
+
+        if(bTryAA)
+        {
+            // #i101491# try AAed version
+            // Use old on-the-fly geometry preparation, combine with AA
+            bool bSuccess(true);
 
-        for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() )
-            mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->GetConstPointAry(), this );
+            for(const Polygon* pPoly = aLineCvt.ImplGetFirst(); bSuccess && pPoly; pPoly = aLineCvt.ImplGetNext())
+            {
+                bSuccess = mpGraphics->DrawPolyPolygon(basegfx::B2DPolyPolygon(pPoly->getB2DPolygon()), 0.0, this);
+            }
+
+            if(bSuccess)
+            {
+                bDone = true;
+            }
+        }
+
+        if(!bDone)
+        {
+            for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() )
+            {
+                mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->GetConstPointAry(), this );
+            }
+        }
 
         SetLineColor( aOldLineColor );
         SetFillColor( aOldFillColor );
@@ -2729,6 +2764,12 @@ void OutputDevice::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rB2DPolyPoly
         mpMetaFile->AddAction( new MetaPolyPolygonAction( PolyPolygon( rB2DPolyPoly ) ) );
 #endif
 
+    // call helper
+    ImpDrawPolyPolygonWithB2DPolyPolygon(rB2DPolyPoly);
+}
+
+void OutputDevice::ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly)
+{
     // AW: Do NOT paint empty PolyPolygons
     if(!rB2DPolyPoly.count())
         return;
@@ -2765,6 +2806,38 @@ void OutputDevice::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rB2DPolyPoly
 
 // -----------------------------------------------------------------------
 
+bool OutputDevice::ImpTryDrawPolyLineDirect(
+    const basegfx::B2DPolygon& rB2DPolygon,
+    double fLineWidth,
+    basegfx::B2DLineJoin eLineJoin)
+{
+    const basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
+    basegfx::B2DVector aB2DLineWidth(1.0, 1.0);
+    
+    // transform the line width if used
+    if( fLineWidth != 0.0 )
+    {
+        aB2DLineWidth = aTransform * ::basegfx::B2DVector( fLineWidth, fLineWidth );
+    }
+
+    // transform the polygon
+    basegfx::B2DPolygon aB2DPolygon(rB2DPolygon);
+    aB2DPolygon.transform(aTransform);
+    
+    if((mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE) 
+        && aB2DPolygon.count() < 1000)
+    {
+        // #i98289#, #i101491#
+        // better to remove doubles on device coordinates. Also assume from a given amount
+        // of points that the single edges are not long enough to smooth
+        aB2DPolygon.removeDoublePoints();
+        aB2DPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolygon);
+    }
+
+    // draw the polyline
+    return mpGraphics->DrawPolyLine(aB2DPolygon, aB2DLineWidth, eLineJoin, this);
+}
+
 void OutputDevice::DrawPolyLine(
     const basegfx::B2DPolygon& rB2DPolygon,
     double fLineWidth,
@@ -2808,37 +2881,62 @@ void OutputDevice::DrawPolyLine(
     if( mbInitLineColor )
         ImplInitLineColor();
 
-    // #i98289# use b2dpolygon drawing if possible
-    if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
+    const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) 
+        && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
+        && ROP_OVERPAINT == GetRasterOp()
+        && IsLineColor());
+
+    // use b2dpolygon drawing if possible
+    if(bTryAA && ImpTryDrawPolyLineDirect(rB2DPolygon, fLineWidth, eLineJoin))
     {
-        const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
-        ::basegfx::B2DVector aB2DLineWidth(1.0, 1.0);
-        
-        // transform the line width if used
-        if( fLineWidth != 0.0 )
-            aB2DLineWidth = aTransform * ::basegfx::B2DVector( fLineWidth, fLineWidth );
+        return;
+    }
+
+    // #i101491#
+    // no output yet; fallback to geometry decomposition and use filled polygon paint
+    // when line is fat and not too complex. ImpDrawPolyPolygonWithB2DPolyPolygon
+    // will do internal needed AA checks etc.
+    if(fLineWidth >= 2.5 
+        && rB2DPolygon.count()
+        && rB2DPolygon.count() <= 1000)
+    {
+        const double fHalfLineWidth((fLineWidth * 0.5) + 0.5);
+        const basegfx::B2DPolyPolygon aAreaPolyPolygon(basegfx::tools::createAreaGeometry(
+            rB2DPolygon, fHalfLineWidth, eLineJoin));
+
+        const Color aOldLineColor(maLineColor);
+        const Color aOldFillColor(maFillColor);
+
+        SetLineColor();
+        ImplInitLineColor();
+        SetFillColor(aOldLineColor);
+        ImplInitFillColor();
 
-        // transform the polygon
-        ::basegfx::B2DPolygon aB2DPL = rB2DPolygon;
-        aB2DPL.transform( aTransform );
-        
-        if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && (mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE))
+        ImpDrawPolyPolygonWithB2DPolyPolygon(aAreaPolyPolygon);
+
+        SetLineColor(aOldLineColor);
+        ImplInitLineColor();
+        SetFillColor(aOldFillColor);
+        SetFillColor(aOldLineColor);
+
+        if(bTryAA)
         {
-            // #i98289#
-            aB2DPL = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPL);
+            // when AA it is necessary to also paint the filled polygon's outline
+            // to avoid optical gaps
+            for(sal_uInt32 a(0); a < aAreaPolyPolygon.count(); a++)
+            {
+                ImpTryDrawPolyLineDirect(aAreaPolyPolygon.getB2DPolygon(a), 0.0, basegfx::B2DLINEJOIN_NONE);
+            }
         }
-
-        // draw the polyline
-        if( mpGraphics->DrawPolyLine( aB2DPL, aB2DLineWidth, eLineJoin, this ) )
-            return;
     }
 
-    // fallback to old polygon drawing if needed
+    // fallback to old polygon drawing if needed. This will really
+    // use ImplLineConverter, but still try to AA lines
     const Polygon aToolsPolygon( rB2DPolygon );
     LineInfo aLineInfo;
     if( fLineWidth != 0.0 )
         aLineInfo.SetWidth( static_cast<long>(fLineWidth+0.5) );
-    DrawPolyLine( aToolsPolygon, aLineInfo );
+    ImpDrawPolyLineWithLineInfo( aToolsPolygon, aLineInfo );
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index d385fc4..a818a44 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -1427,6 +1427,15 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
 
 bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin)
 {
+    // #i101491#
+    if(rPolygon.count() > 1000)
+    {
+        // the used basegfx::tools::createAreaGeometry is simply too
+        // expensive with very big polygons; fallback to caller (who
+        // should use ImplLineConverter normally)
+        return false;
+    }
+
     const XRenderPeer& rRenderPeer = XRenderPeer::GetInstance();
     if( !rRenderPeer.AreTrapezoidsSupported() )
         return false;
diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx
index 2dd51be..0e91f2e 100644
--- a/vcl/win/source/gdi/salgdi_gdiplus.cxx
+++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx
@@ -118,7 +118,11 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
 
         for(sal_uInt32 a(0); a < nCount; a++)
         {
-            aPath.StartFigure();
+            if(0 != a)
+            {
+                aPath.StartFigure(); // #i101491# not needed for first run
+            }
+
             impAddB2DPolygonToGDIPlusGraphicsPath(aPath, rPolyPolygon.getB2DPolygon(a));
             aPath.CloseFigure();
         }
@@ -176,6 +180,12 @@ bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon& rPolygon, const bas
         }
 
         impAddB2DPolygonToGDIPlusGraphicsPath(aPath, rPolygon);
+
+        if(rPolygon.isClosed())
+        {
+            // #i101491# needed to create the correct line joins
+            aPath.CloseFigure();
+        }
         
         if(getAntiAliasB2DDraw())
         {
commit 33063413eecea0ec7d4a364387b30dab88604fb2
Author: Oliver Bolte <obo at openoffice.org>
Date:   Fri Jul 17 04:31:21 2009 +0000

    CWS-TOOLING: integrate CWS mav53
    2009-06-29 13:42:56 +0200 hbrinkm  r273471 : #i101593# switched off optimization in table layout, that caused frames to be layouted incorrectly
    2009-06-25 12:29:11 +0200 cd  r273376 : #i101774# Don't rely on initialize call for VistaFilePicker
    2009-06-25 11:48:33 +0200 tl  r273373 : #i101420# Gnome accessibility fix
    2009-06-24 18:16:49 +0200 od  r273361 : #i97309 method <XMLTextParagraphExport::exportListChange(..)>
    	- export text:start-value at correct list item.
    2009-06-23 14:11:44 +0200 b_michaelsen  r273281 : #i103032#: cutting of URL-parameters for usage tracking
    2009-06-22 11:49:12 +0200 b_michaelsen  r273207 : #i102805#: Added usage tracking to SfxToolboxControl
    2009-06-22 11:46:00 +0200 b_michaelsen  r273205 : whitespace fixes
    2009-06-05 14:21:12 +0200 mav  r272683 : #i101741# check the file date only in document file locking context

diff --git a/comphelper/inc/comphelper/uieventslogger.hxx b/comphelper/inc/comphelper/uieventslogger.hxx
index 1c0599a..b797979 100644
--- a/comphelper/inc/comphelper/uieventslogger.hxx
+++ b/comphelper/inc/comphelper/uieventslogger.hxx
@@ -38,7 +38,7 @@
 #include <rtl/ustring.hxx>
 
 
-namespace comphelper 
+namespace comphelper
 {
     // this class is part of the OOo Improvement Program Core
     class COMPHELPER_DLLPUBLIC UiEventsLogger
@@ -46,7 +46,7 @@ namespace comphelper
         public:
             static sal_Bool isEnabled();
             static sal_Int32 getSessionLogEventCount();
-            static void appendDispatchOrigin( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args, const ::rtl::OUString& originapp, const ::rtl::OUString& originwidget); 
+            static void appendDispatchOrigin( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args, const ::rtl::OUString& originapp, const ::rtl::OUString& originwidget);
             static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> purgeDispatchOrigin(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args);
             static void logDispatch(const ::com::sun::star::util::URL& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args);
             static void logVcl(const ::rtl::OUString& parent_id, sal_Int32 window_type, const ::rtl::OUString& id, const ::rtl::OUString& method, const ::rtl::OUString& param);
diff --git a/comphelper/source/misc/uieventslogger.cxx b/comphelper/source/misc/uieventslogger.cxx
index 4954cd0..6734f81 100644
--- a/comphelper/source/misc/uieventslogger.cxx
+++ b/comphelper/source/misc/uieventslogger.cxx
@@ -101,7 +101,7 @@ namespace
     };
 }
 
-namespace comphelper 
+namespace comphelper
 {
     // declaration of implementation
     class UiEventsLogger_Impl;
@@ -111,7 +111,7 @@ namespace comphelper
             //typedefs and friends
             friend class UiEventsLogger;
             typedef UiEventsLogger_Impl* ptr;
-            
+
             // instance methods and data
             UiEventsLogger_Impl();
             void initializeLogger();
@@ -141,7 +141,7 @@ namespace comphelper
             Reference<XCsvLogFormatter> m_Formatter;
             map<OUString, OUString> m_OriginAppAbbr;
             map<OUString, OUString> m_OriginWidgetAbbr;
-            
+
 
             // static methods and data
             static ptr getInstance();
@@ -246,7 +246,7 @@ namespace comphelper
         args[old_length+1].Name = UiEventsLogger_Impl::LOGORIGINWIDGET;
         args[old_length+1].Value = static_cast<Any>(originwidget);
     }
-    
+
     Sequence<PropertyValue> UiEventsLogger::purgeDispatchOrigin(
         const Sequence<PropertyValue>& args)
     {
@@ -257,7 +257,7 @@ namespace comphelper
                 && args[source_idx].Name != UiEventsLogger_Impl::LOGORIGINWIDGET)
                 result[target_idx++] = args[source_idx];
         result.realloc(target_idx);
-        return result; 
+        return result;
     }
 
     void UiEventsLogger::logDispatch(
@@ -323,7 +323,7 @@ namespace comphelper
         {
             UiEventsLogger_Impl::instance->disposing();
             delete UiEventsLogger_Impl::instance;
-            UiEventsLogger_Impl::instance = NULL; 
+            UiEventsLogger_Impl::instance = NULL;
         }
     }
 
@@ -375,9 +375,10 @@ namespace comphelper
         }
         else
             logdata[2] = UNKNOWN_ORIGIN;
-        logdata[3] = url.Complete;
         if(url.Complete.match(URL_FILE))
             logdata[3] = URL_FILE;
+        else
+            logdata[3] = url.Main;
         m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata));
         m_SessionLogEventCount++;
     }
@@ -388,7 +389,7 @@ namespace comphelper
         logdata[0] = ETYPE_ROTATED;
         m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata));
     }
-    
+
     void UiEventsLogger_Impl::logVcl(
         const OUString& parent_id,
         sal_Int32 window_type,
@@ -415,7 +416,7 @@ namespace comphelper
     {
         FileBase::RC result = File::move(getCurrentPath(), getRotatedPath());
         if(result!=FileBase::E_None && result!=FileBase::E_NOENT)
-            m_Active = false; 
+            m_Active = false;
     }
 
     void UiEventsLogger_Impl::hotRotate()
@@ -445,7 +446,7 @@ namespace comphelper
             sm->createInstanceWithArguments(CSSL_FILEHANDLER, init_args);
         m_LogHandler = Reference<XLogHandler>(temp, UNO_QUERY);
     }
-    
+
     void UiEventsLogger_Impl::checkIdleTimeout()
     {
         TimeValue now;
@@ -454,7 +455,7 @@ namespace comphelper
             hotRotate();
         m_LastLogEventTime = now;
     }
-    
+
     OUString UiEventsLogger_Impl::getCurrentPath()
     {
         OUStringBuffer current_path(m_LogPath);
@@ -494,7 +495,7 @@ namespace comphelper
     void UiEventsLogger_Impl::initializeLogger()
     {
         Reference<XMultiServiceFactory> sm = getProcessServiceFactory();
-       
+
         // getting the Core Uno proxy object 
         // It will call disposing and make sure we clear all our references
         {
@@ -510,7 +511,7 @@ namespace comphelper
                 return;
             }
             xDesktop->addTerminateListener(xCore);
-        } 
+        }
         // getting the LoggerPool
         Reference<XLoggerPool> pool;
         {
@@ -518,10 +519,10 @@ namespace comphelper
                 sm->createInstance(CSSL_LOGGERPOOL);
             pool = Reference<XLoggerPool>(temp, UNO_QUERY);
         }
-            
+
         // getting the Logger
         m_Logger = pool->getNamedLogger(LOGGERNAME);
-        
+
         // getting the FileHandler
         prepareLogHandler();
 
@@ -553,12 +554,12 @@ namespace comphelper
         else
             m_Active = false;
     }
-    
+
     // private static UiEventsLogger_Impl 
     bool UiEventsLogger_Impl::shouldActivate()
     {
         return getEnabledFromCfg() && getEnabledFromCoreController();
-    } 
+    }
 
     OUString UiEventsLogger_Impl::getLogPathFromCfg()
     {
@@ -570,7 +571,7 @@ namespace comphelper
             CFG_LOGGING, CFG_OOOIMPROVEMENT, CFG_LOGPATH,
             ConfigurationHelper::E_READONLY
         ) >>= result;
-        
+
         Reference<XStringSubstitution> path_sub(
             sm->createInstance(CSSU_PATHSUB),
             UNO_QUERY);
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 2ac77de..4619989 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1065,7 +1065,10 @@ BOOL ViewTabListBox_Impl::DoubleClickHdl()
     ::rtl::OUString sRet = SvHeaderTabListBox::GetAccessibleObjectDescription( _eType, _nPos );
     if ( ::svt::BBTYPE_TABLECELL == _eType )
     {
-        sal_Int32 nRow = _nPos / GetColumnCount();
+        sal_Int32 nRow = -1;
+        const sal_uInt16 nColumnCount = GetColumnCount();
+        if (nColumnCount > 0)
+            nRow = _nPos / nColumnCount;
         SvLBoxEntry* pEntry = GetEntry( nRow );
         if ( pEntry )
         {
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index 03acf6d..30a2ec4 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -980,10 +980,12 @@ Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleCell( sal_Int32 _nR
 
     if ( !AreChildrenTransient() )
     {
+        const sal_uInt16 nColumnCount = GetColumnCount();
+
         // first call? -> initial list
         if ( m_aAccessibleChildren.empty() )
         {
-            sal_Int32 nCount = ( GetRowCount() + 1 ) * GetColumnCount();
+            sal_Int32 nCount = ( GetRowCount() + 1 ) * nColumnCount;
             m_aAccessibleChildren.assign( nCount, Reference< XAccessible >() );
         }
 
@@ -1021,8 +1023,9 @@ Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleColumnHeader( sal_u
     // first call? -> initial list
     if ( m_aAccessibleChildren.empty() )
     {
-        sal_Int32 nCount = AreChildrenTransient() ? GetColumnCount()
-                                                  : ( GetRowCount() + 1 ) * GetColumnCount();
+        const sal_uInt16 nColumnCount = GetColumnCount();
+        sal_Int32 nCount = AreChildrenTransient() ? 
+                nColumnCount : ( GetRowCount() + 1 ) * nColumnCount;
         m_aAccessibleChildren.assign( nCount, Reference< XAccessible >() );
     }
 
@@ -1098,9 +1101,12 @@ sal_Bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Poin
             if ( _nPos >= 0 )
             {
                 sal_uInt16 nColumnCount = GetColumnCount();
-                sal_Int32 nRow = _nPos / nColumnCount;
-                sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
-                aRetText = GetCellText( nRow, nColumn );
+                if (nColumnCount > 0)
+                {
+                    sal_Int32 nRow = _nPos / nColumnCount;
+                    sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
+                    aRetText = GetCellText( nRow, nColumn );
+                }
             }
             break;
         }
@@ -1135,16 +1141,19 @@ sal_Bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Poin
         static const String sVar2( RTL_CONSTASCII_USTRINGPARAM( "%2" ) );
 
         sal_uInt16 nColumnCount = GetColumnCount();
-        sal_Int32 nRow = _nPos / nColumnCount;
-        sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
-
-        String aText( SvtResId( STR_SVT_ACC_DESC_TABLISTBOX ) );
-        aText.SearchAndReplace( sVar1, String::CreateFromInt32( nRow ) );
-        String sColHeader = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( nColumn ) );
-        if ( sColHeader.Len() == 0 )
-            sColHeader = String::CreateFromInt32( nColumn );
-        aText.SearchAndReplace( sVar2, sColHeader );
-        aRetText = aText;
+        if (nColumnCount > 0)
+        {
+            sal_Int32 nRow = _nPos / nColumnCount;
+            sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
+
+            String aText( SvtResId( STR_SVT_ACC_DESC_TABLISTBOX ) );
+            aText.SearchAndReplace( sVar1, String::CreateFromInt32( nRow ) );
+            String sColHeader = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( nColumn ) );
+            if ( sColHeader.Len() == 0 )
+                sColHeader = String::CreateFromInt32( nColumn );
+            aText.SearchAndReplace( sVar2, sColHeader );
+            aRetText = aText;
+        }
     }
 
     return aRetText;


More information about the ooo-build-commit mailing list