diff options
Diffstat (limited to 'drawinglayer/source/primitive2d')
48 files changed, 513 insertions, 746 deletions
diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx index 2d696e5f6600..35cdc7e95bf8 100644 --- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -222,3 +223,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx index be13f6229f1c..44f8a138d5f5 100644 --- a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -114,3 +115,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx index 051f51f9731a..00dc22cd89a3 100644 --- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -276,3 +277,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx index 730a29749d23..8e780ce2d38a 100644 --- a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index 86c2ef1db123..9738e14b503d 100644 --- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,12 @@ #include <drawinglayer/primitive2d/borderlineprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> #include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolygonclipper.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <svtools/borderhelper.hxx> #include <numeric> +#include <algorithm> ////////////////////////////////////////////////////////////////////////////// @@ -41,131 +45,226 @@ namespace drawinglayer { namespace primitive2d { + basegfx::B2DPolyPolygon BorderLinePrimitive2D::getClipPolygon( ) const + { + basegfx::B2DPolygon clipPolygon; + + // Get the vectors + basegfx::B2DVector aVector( getEnd() - getStart() ); + aVector.normalize(); + const basegfx::B2DVector aPerpendicular(basegfx::getPerpendicular(aVector)); + + // Get the points + const basegfx::B2DVector aLeftOff(aPerpendicular * (-0.5 * (getWidth()))); + const basegfx::B2DVector aRightOff(aPerpendicular * (0.5 * (getWidth()))); + + const basegfx::B2DVector aSLVector( aLeftOff - ( getExtendLeftStart() * aVector ) ); + clipPolygon.append( basegfx::B2DPoint( getStart() + aSLVector * 2.0 ) ); + + clipPolygon.append( getStart( ) ); + + const basegfx::B2DVector aSRVector( aRightOff - ( getExtendRightStart() * aVector ) ); + clipPolygon.append( basegfx::B2DPoint( getStart() + aSRVector * 2.0 ) ); + + const basegfx::B2DVector aERVector( aRightOff + ( getExtendRightEnd() * aVector ) ); + clipPolygon.append( basegfx::B2DPoint( getEnd() + aERVector * 2.0 ) ); + + clipPolygon.append( getEnd( ) ); + + const basegfx::B2DVector aELVector( aLeftOff + ( getExtendLeftEnd() * aVector ) ); + clipPolygon.append( basegfx::B2DPoint( getEnd() + aELVector * 2.0 ) ); + + clipPolygon.setClosed( true ); + + return basegfx::B2DPolyPolygon( clipPolygon ); + } + Primitive2DSequence BorderLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence xRetval; - if(!getStart().equal(getEnd()) && (getCreateInside() || getCreateOutside())) + if(!getStart().equal(getEnd()) && ( isInsideUsed() || isOutsideUsed() ) ) { - if(isInsideUsed()) + // get data and vectors + const double fWidth(getWidth()); + basegfx::B2DVector aVector(getEnd() - getStart()); + aVector.normalize(); + const basegfx::B2DVector aPerpendicular(basegfx::getPerpendicular(aVector)); + + const basegfx::B2DPolyPolygon& aClipRegion = getClipPolygon( ); + + if(isOutsideUsed() && isInsideUsed()) { - // get data and vectors - const double fWidth(getWidth()); - basegfx::B2DVector aVector(getEnd() - getStart()); - aVector.normalize(); - const basegfx::B2DVector aPerpendicular(basegfx::getPerpendicular(aVector)); + const double fExt = getWidth( ); // Extend a lot: it'll be clipped after + + // both used, double line definition. Create left and right offset + xRetval.realloc(2); + sal_uInt32 nInsert(0); + + basegfx::B2DPolygon aGap; - if(isOutsideUsed()) { - // both used, double line definition. Create left and right offset - xRetval.realloc(getCreateInside() && getCreateOutside() ? 2 : 1); - sal_uInt32 nInsert(0); + // create geometry for left + const basegfx::B2DVector aLeftOff(aPerpendicular * (0.5 * (getCorrectedLeftWidth() - fWidth + 1))); + const basegfx::B2DPoint aTmpStart(getStart() + aLeftOff - ( fExt * aVector)); + const basegfx::B2DPoint aTmpEnd(getEnd() + aLeftOff + ( fExt * aVector)); + basegfx::B2DPolygon aLeft; - if(getCreateInside()) + if(leftIsHairline()) { - // create geometry for left - const basegfx::B2DVector aLeftOff(aPerpendicular * (0.5 * (getCorrectedLeftWidth() - fWidth))); - const basegfx::B2DPoint aTmpStart(getStart() + aLeftOff - (getExtendInnerStart() * aVector)); - const basegfx::B2DPoint aTmpEnd(getEnd() + aLeftOff + (getExtendInnerEnd() * aVector)); - basegfx::B2DPolygon aLeft; - - if(leftIsHairline()) - { - // create hairline primitive - aLeft.append(aTmpStart); - aLeft.append(aTmpEnd); - - xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D( - aLeft, - getRGBColor())); - } - else - { - // create filled polygon primitive. Already tried to create thick lines - // with the correct LineWidth, but this leads to problems when no AA - // is available and fat line special case reductions between 0.5 < x < 2.5 line widths - // are executed due to the FilledPolygon-do-not-paint-their-bottom-and-right-lines. - const basegfx::B2DVector aLineWidthOffset((getCorrectedLeftWidth() * 0.5) * aPerpendicular); - - aLeft.append(aTmpStart + aLineWidthOffset); - aLeft.append(aTmpEnd + aLineWidthOffset); - aLeft.append(aTmpEnd - aLineWidthOffset); - aLeft.append(aTmpStart - aLineWidthOffset); - aLeft.setClosed(true); - - xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D( - basegfx::B2DPolyPolygon(aLeft), getRGBColor())); - } - } + // create hairline primitive + aLeft.append(aTmpStart); + aLeft.append(aTmpEnd); - if(getCreateOutside()) + xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D( + aLeft, + getRGBColorLeft())); + + aGap.append( getStart() - getExtendLeftStart() * aVector ); + aGap.append( getEnd() + getExtendLeftEnd() * aVector ); + } + else { - // create geometry for right - const basegfx::B2DVector aRightOff(aPerpendicular * (0.5 * (fWidth - getCorrectedRightWidth()))); - const basegfx::B2DPoint aTmpStart(getStart() + aRightOff - (getExtendOuterStart() * aVector)); - const basegfx::B2DPoint aTmpEnd(getEnd() + aRightOff + (getExtendOuterEnd() * aVector)); - basegfx::B2DPolygon aRight; - - if(rightIsHairline()) - { - // create hairline primitive - aRight.append(aTmpStart); - aRight.append(aTmpEnd); - - xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D( - aRight, - getRGBColor())); - } - else - { - // create filled polygon primitive - const basegfx::B2DVector aLineWidthOffset((getCorrectedRightWidth() * 0.5) * aPerpendicular); - - aRight.append(aTmpStart + aLineWidthOffset); - aRight.append(aTmpEnd + aLineWidthOffset); - aRight.append(aTmpEnd - aLineWidthOffset); - aRight.append(aTmpStart - aLineWidthOffset); - aRight.setClosed(true); - - xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D( - basegfx::B2DPolyPolygon(aRight), getRGBColor())); - } + // create filled polygon primitive. Already tried to create thick lines + // with the correct LineWidth, but this leads to problems when no AA + // is available and fat line special case reductions between 0.5 < x < 2.5 line widths + // are executed due to the FilledPolygon-do-not-paint-their-bottom-and-right-lines. + const basegfx::B2DVector aLineWidthOffset((getCorrectedLeftWidth() * 0.5) * aPerpendicular); + + aLeft.append(aTmpStart + aLineWidthOffset); + aLeft.append(aTmpEnd + aLineWidthOffset); + aLeft.append(aTmpEnd - aLineWidthOffset); + aLeft.append(aTmpStart - aLineWidthOffset); + aLeft.setClosed(true); + + basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon( + aLeft, aClipRegion, true, false ); + + aGap.append( aTmpStart + aLineWidthOffset ); + aGap.append( aTmpEnd + aLineWidthOffset ); + + xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D( + aClipped, getRGBColorLeft())); } } - else + { - // single line, create geometry - basegfx::B2DPolygon aPolygon; - const double fMaxExtStart(::std::max(getExtendInnerStart(), getExtendOuterStart())); - const double fMaxExtEnd(::std::max(getExtendInnerEnd(), getExtendOuterEnd())); - const basegfx::B2DPoint aTmpStart(getStart() - (fMaxExtStart * aVector)); - const basegfx::B2DPoint aTmpEnd(getEnd() + (fMaxExtEnd * aVector)); - xRetval.realloc(1); + // create geometry for right + const basegfx::B2DVector aRightOff(aPerpendicular * (0.5 * (fWidth - getCorrectedRightWidth() + 1))); + const basegfx::B2DPoint aTmpStart(getStart() + aRightOff - ( fExt * aVector)); + const basegfx::B2DPoint aTmpEnd(getEnd() + aRightOff + ( fExt * aVector)); + basegfx::B2DPolygon aRight; - if(leftIsHairline()) + if(rightIsHairline()) { // create hairline primitive - aPolygon.append(aTmpStart); - aPolygon.append(aTmpEnd); + aRight.append(aTmpStart); + aRight.append(aTmpEnd); - xRetval[0] = Primitive2DReference(new PolygonHairlinePrimitive2D( - aPolygon, - getRGBColor())); + xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D( + aRight, + getRGBColorRight())); + + aGap.append( getStart() - getExtendRightStart() * aVector ); + aGap.append( getEnd() + getExtendRightEnd() * aVector ); } else { // create filled polygon primitive - const basegfx::B2DVector aLineWidthOffset((getCorrectedLeftWidth() * 0.5) * aPerpendicular); + const basegfx::B2DVector aLineWidthOffset((getCorrectedRightWidth() * 0.5) * aPerpendicular); + + aRight.append(aTmpStart + aLineWidthOffset); + aRight.append(aTmpEnd + aLineWidthOffset); + aRight.append(aTmpEnd - aLineWidthOffset); + aRight.append(aTmpStart - aLineWidthOffset); + aRight.setClosed(true); + + basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon( + aRight, aClipRegion, true, false ); + + xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D( + aClipped, getRGBColorRight())); + + aGap.append( aTmpEnd - aLineWidthOffset ); + aGap.append( aTmpStart - aLineWidthOffset ); + } + } + + if (hasGapColor() && aGap.count() == 4) + { + xRetval.realloc( xRetval.getLength() + 1 ); + // create geometry for filled gap + aGap.setClosed( true ); + + basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon( + aGap, aClipRegion, true, false ); + + xRetval[nInsert++] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + aClipped, getRGBColorGap() ) ); + } + } + else + { + // single line, create geometry + basegfx::B2DPolygon aPolygon; + const double fExt = getWidth( ); // Extend a lot: it'll be clipped after + const basegfx::B2DPoint aTmpStart(getStart() - (fExt * aVector)); + const basegfx::B2DPoint aTmpEnd(getEnd() + (fExt * aVector)); + xRetval.realloc(1); - aPolygon.append(aTmpStart + aLineWidthOffset); - aPolygon.append(aTmpEnd + aLineWidthOffset); - aPolygon.append(aTmpEnd - aLineWidthOffset); - aPolygon.append(aTmpStart - aLineWidthOffset); - aPolygon.setClosed(true); + // Get which is the line to show + bool bIsHairline = leftIsHairline(); + double nWidth = getCorrectedLeftWidth(); + basegfx::BColor aColor = getRGBColorLeft(); + if ( basegfx::fTools::equal( 0.0, mfLeftWidth ) ) + { + bIsHairline = rightIsHairline(); + nWidth = getCorrectedRightWidth(); + aColor = getRGBColorRight(); + } + + if(bIsHairline) + { + // create hairline primitive + aPolygon.append( getStart() ); + aPolygon.append( getEnd() ); + + xRetval[0] = Primitive2DReference(new PolygonHairlinePrimitive2D( + aPolygon, + aColor)); + } + else + { + // create filled polygon primitive + const basegfx::B2DVector aLineWidthOffset(((nWidth + 1) * 0.5) * aPerpendicular); - xRetval[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D( - basegfx::B2DPolyPolygon(aPolygon), getRGBColor())); + aPolygon.append( aTmpStart ); + aPolygon.append( aTmpEnd ); + + basegfx::B2DPolyPolygon aDashed = svtools::ApplyLineDashing( + aPolygon, getStyle(), MAP_100TH_MM ); + for (sal_uInt32 i = 0; i < aDashed.count(); i++ ) + { + basegfx::B2DPolygon aDash = aDashed.getB2DPolygon( i ); + basegfx::B2DPoint aDashStart = aDash.getB2DPoint( 0 ); + basegfx::B2DPoint aDashEnd = aDash.getB2DPoint( aDash.count() - 1 ); + + basegfx::B2DPolygon aDashPolygon; + aDashPolygon.append( aDashStart + aLineWidthOffset ); + aDashPolygon.append( aDashEnd + aLineWidthOffset ); + aDashPolygon.append( aDashEnd - aLineWidthOffset ); + aDashPolygon.append( aDashStart - aLineWidthOffset ); + aDashPolygon.setClosed( true ); + + basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon( + aDashPolygon, aClipRegion, true, false ); + + if ( aClipped.count() ) + aDashed.setB2DPolygon( i, aClipped.getB2DPolygon( 0 ) ); } + + xRetval[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon( aDashed ), aColor)); } } } @@ -179,26 +278,30 @@ namespace drawinglayer double fLeftWidth, double fDistance, double fRightWidth, - double fExtendInnerStart, - double fExtendInnerEnd, - double fExtendOuterStart, - double fExtendOuterEnd, - bool bCreateInside, - bool bCreateOutside, - const basegfx::BColor& rRGBColor) + double fExtendLeftStart, + double fExtendLeftEnd, + double fExtendRightStart, + double fExtendRightEnd, + const basegfx::BColor& rRGBColorRight, + const basegfx::BColor& rRGBColorLeft, + const basegfx::BColor& rRGBColorGap, + bool bHasGapColor, + const short nStyle) : BufferedDecompositionPrimitive2D(), maStart(rStart), maEnd(rEnd), mfLeftWidth(fLeftWidth), mfDistance(fDistance), mfRightWidth(fRightWidth), - mfExtendInnerStart(fExtendInnerStart), - mfExtendInnerEnd(fExtendInnerEnd), - mfExtendOuterStart(fExtendOuterStart), - mfExtendOuterEnd(fExtendOuterEnd), - maRGBColor(rRGBColor), - mbCreateInside(bCreateInside), - mbCreateOutside(bCreateOutside) + mfExtendLeftStart(fExtendLeftStart), + mfExtendLeftEnd(fExtendLeftEnd), + mfExtendRightStart(fExtendRightStart), + mfExtendRightEnd(fExtendRightEnd), + maRGBColorRight(rRGBColorRight), + maRGBColorLeft(rRGBColorLeft), + maRGBColorGap(rRGBColorGap), + mbHasGapColor(bHasGapColor), + mnStyle(nStyle) { } @@ -213,13 +316,15 @@ namespace drawinglayer && getLeftWidth() == rCompare.getLeftWidth() && getDistance() == rCompare.getDistance() && getRightWidth() == rCompare.getRightWidth() - && getExtendInnerStart() == rCompare.getExtendInnerStart() - && getExtendInnerEnd() == rCompare.getExtendInnerEnd() - && getExtendOuterStart() == rCompare.getExtendOuterStart() - && getExtendOuterEnd() == rCompare.getExtendOuterEnd() - && getCreateInside() == rCompare.getCreateInside() - && getCreateOutside() == rCompare.getCreateOutside() - && getRGBColor() == rCompare.getRGBColor()); + && getExtendLeftStart() == rCompare.getExtendLeftStart() + && getExtendLeftEnd() == rCompare.getExtendLeftEnd() + && getExtendRightStart() == rCompare.getExtendRightStart() + && getExtendRightEnd() == rCompare.getExtendRightEnd() + && getRGBColorRight() == rCompare.getRGBColorRight() + && getRGBColorLeft() == rCompare.getRGBColorLeft() + && getRGBColorGap() == rCompare.getRGBColorGap() + && hasGapColor() == rCompare.hasGapColor() + && getStyle() == rCompare.getStyle()); } return false; @@ -233,3 +338,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/chartprimitive2d.cxx b/drawinglayer/source/primitive2d/chartprimitive2d.cxx index 5bb7b8c860a0..87fdd094b8e9 100644 --- a/drawinglayer/source/primitive2d/chartprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/chartprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,3 +81,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/clippedborderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/clippedborderlineprimitive2d.cxx new file mode 100644 index 000000000000..874c61746d48 --- /dev/null +++ b/drawinglayer/source/primitive2d/clippedborderlineprimitive2d.cxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Novell Inc. ] + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx> +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> + +namespace drawinglayer +{ + namespace primitive2d + { + basegfx::B2DPolyPolygon ClippedBorderLinePrimitive2D::getClipPolygon( ) const + { + basegfx::B2DPolyPolygon aPolyPolygon; + aPolyPolygon.append( maIntersection ); + return aPolyPolygon; + } + + ClippedBorderLinePrimitive2D::ClippedBorderLinePrimitive2D( + const basegfx::B2DPoint& rStart, + const basegfx::B2DPoint& rEnd, + double fLeftWidth, + double fDistance, + double fRightWidth, + const basegfx::B2DPolygon& rIntersection, + const basegfx::BColor& rRGBColorRight, + const basegfx::BColor& rRGBColorLeft, + const basegfx::BColor& rRGBColorGap, + bool bHasGapColor, + const short nStyle) + : BorderLinePrimitive2D( rStart, rEnd, fLeftWidth,fDistance, fRightWidth, + 0.0, 0.0, 0.0, 0.0, rRGBColorRight, rRGBColorLeft, + rRGBColorGap, bHasGapColor, nStyle), + maIntersection( rIntersection ) + { + } + + bool ClippedBorderLinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(BorderLinePrimitive2D::operator==(rPrimitive)) + { + const ClippedBorderLinePrimitive2D& rCompare = (ClippedBorderLinePrimitive2D&)rPrimitive; + + return maIntersection == rCompare.maIntersection; + } + + return false; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(ClippedBorderLinePrimitive2D, PRIMITIVE2D_ID_CLIPPEDBORDERLINEPRIMITIVE2D) + + + } // namespace primitive2d +} // namespace drawinglayer + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx index 589b2c24bbb8..96ca10484549 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,7 +67,7 @@ namespace drawinglayer if(xSet.is()) { - uno::Any aValue(xSet->getPropertyValue(rtl::OUString::createFromAscii("DefaultControl"))); + uno::Any aValue(xSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultControl")))); rtl::OUString aUnoControlTypeName; if(aValue >>= aUnoControlTypeName) @@ -381,3 +382,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx index cf7b0339e966..167497181de3 100644 --- a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -114,3 +115,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx index ed82ed45e233..7e6964db7f55 100644 --- a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -166,3 +167,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/epsprimitive2d.cxx b/drawinglayer/source/primitive2d/epsprimitive2d.cxx index 7b23d4a9db96..b399b98e33ba 100644 --- a/drawinglayer/source/primitive2d/epsprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/epsprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,7 +44,7 @@ namespace drawinglayer Primitive2DSequence xRetval; const GDIMetaFile& rSubstituteContent = getMetaFile(); - if(rSubstituteContent.GetActionCount()) + if( rSubstituteContent.GetActionSize() ) { // the default decomposition will use the Metafile replacement visualisation. // To really use the Eps data, a renderer has to know and interpret this primitive @@ -101,3 +102,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx index 66497a1aef5e..dc5a228be2ba 100644 --- a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -140,3 +141,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx index 8659eb356405..fb19bebc87e7 100644 --- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -296,3 +297,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx index 4466081cae32..91e68f04e003 100644 --- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -159,3 +160,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index 3b52f2340f17..c6a8e35682b0 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,15 +53,6 @@ ////////////////////////////////////////////////////////////////////////////// // includes for testing MetafilePrimitive2D::create2DDecomposition -// this switch defines if the test code is included or not -#undef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE - -#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE -#include <vcl/gradient.hxx> -#include <vcl/pngread.hxx> -#include <vcl/lineinfo.hxx> -#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE - ////////////////////////////////////////////////////////////////////////////// namespace @@ -218,11 +210,6 @@ namespace drawinglayer namespace primitive2d { Primitive2DSequence GraphicPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& -#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE - rViewInformation -#else - /*rViewInformation*/ -#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE ) const { Primitive2DSequence aRetval; @@ -307,445 +294,6 @@ namespace drawinglayer case GRAPHIC_GDIMETAFILE : { -#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE - static bool bDoTest(false); - - if(bDoTest) - { - // All this is/was test code for testing MetafilePrimitive2D::create2DDecomposition - // extensively. It may be needed again when diverse actions need debugging, so i leave - // it in here, but take it out using USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE. - // Use it by compiling with the code, insert any DrawObject, convert to Metafile. The - // debugger will then stop here (when breakpoint set, of course). You may enter single - // parts of actions and/or change to true what You want to check. - GDIMetaFile aMtf; - VirtualDevice aOut; - const basegfx::B2DRange aRange(getB2DRange(rViewInformation)); - const Rectangle aRectangle( - basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()), - basegfx::fround(aRange.getMaxX()), basegfx::fround(aRange.getMaxY())); - const Point aOrigin(aRectangle.TopLeft()); - const Fraction aScaleX(aRectangle.getWidth()); - const Fraction aScaleY(aRectangle.getHeight()); - MapMode aMapMode(MAP_100TH_MM, aOrigin, aScaleX, aScaleY); - - Size aDummySize(2, 2); - aOut.SetOutputSizePixel(aDummySize); - aOut.EnableOutput(FALSE); - aOut.SetMapMode(aMapMode); - - aMtf.Clear(); - aMtf.Record(&aOut); - - const Fraction aNeutralFraction(1, 1); - const MapMode aRelativeMapMode( - MAP_RELATIVE, - Point(-aRectangle.Left(), -aRectangle.Top()), - aNeutralFraction, aNeutralFraction); - aOut.SetMapMode(aRelativeMapMode); - - if(false) - { - const sal_Int32 nHor(aRectangle.getWidth() / 4); - const sal_Int32 nVer(aRectangle.getHeight() / 4); - const Rectangle aCenteredRectangle( - aRectangle.Left() + nHor, aRectangle.Top() + nVer, - aRectangle.Right() - nHor, aRectangle.Bottom() - nVer); - aOut.SetClipRegion(aCenteredRectangle); - } - - if(false) - { - const Rectangle aRightRectangle(aRectangle.TopCenter(), aRectangle.BottomRight()); - aOut.IntersectClipRegion(aRightRectangle); - } - - if(false) - { - const Rectangle aRightRectangle(aRectangle.TopCenter(), aRectangle.BottomRight()); - const Rectangle aBottomRectangle(aRectangle.LeftCenter(), aRectangle.BottomRight()); - Region aRegion(aRightRectangle); - aRegion.Intersect(aBottomRectangle); - aOut.IntersectClipRegion(aRegion); - } - - if(false) - { - const sal_Int32 nHor(aRectangle.getWidth() / 10); - const sal_Int32 nVer(aRectangle.getHeight() / 10); - aOut.MoveClipRegion(nHor, nVer); - } - - if(false) - { - Wallpaper aWallpaper(Color(COL_BLACK)); - aOut.DrawWallpaper(aRectangle, aWallpaper); - } - - if(false) - { - Wallpaper aWallpaper(Gradient(GRADIENT_LINEAR, Color(COL_RED), Color(COL_GREEN))); - aOut.DrawWallpaper(aRectangle, aWallpaper); - } - - if(false) - { - SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ); - vcl::PNGReader aPNGReader(aRead); - BitmapEx aBitmapEx(aPNGReader.Read()); - Wallpaper aWallpaper(aBitmapEx); - aOut.DrawWallpaper(aRectangle, aWallpaper); - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - Color aColor(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)); - - for(sal_uInt32 a(0); a < 5000; a++) - { - const Point aPoint( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - - if(!(a % 3)) - { - aColor = Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)); - } - - aOut.DrawPixel(aPoint, aColor); - } - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(); - - for(sal_uInt32 a(0); a < 5000; a++) - { - const Point aPoint( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - aOut.DrawPixel(aPoint); - } - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(); - - Point aStart( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - Point aStop( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - - LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fHor / 50.0)); - bool bUseLineInfo(false); - - for(sal_uInt32 a(0); a < 20; a++) - { - if(!(a%6)) - { - bUseLineInfo = !bUseLineInfo; - } - - if(!(a%4)) - { - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - } - - if(a%3) - { - aStart = aStop; - aStop = Point( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - } - else - { - aStart = Point( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - aStop = Point( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - } - - if(bUseLineInfo) - { - aOut.DrawLine(aStart, aStop, aLineInfo); - } - else - { - aOut.DrawLine(aStart, aStop); - } - } - } - - if(false) - { - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.DrawRect(aRectangle); - } - - if(false) - { - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - const sal_uInt32 nHor(aRectangle.getWidth() / 10); - const sal_uInt32 nVer(aRectangle.getHeight() / 10); - aOut.DrawRect(aRectangle, nHor, nVer); - } - - if(false) - { - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.DrawEllipse(aRectangle); - } - - if(false) - { - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.DrawArc(aRectangle, aRectangle.TopLeft(), aRectangle.BottomCenter()); - } - - if(false) - { - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.DrawPie(aRectangle, aRectangle.TopLeft(), aRectangle.BottomCenter()); - } - - if(false) - { - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.DrawChord(aRectangle, aRectangle.TopLeft(), aRectangle.BottomCenter()); - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - - for(sal_uInt32 b(0); b < 5; b++) - { - const sal_uInt32 nCount(basegfx::fround(rand() * (20 / 32767.0))); - const bool bClose(basegfx::fround(rand() / 32767.0)); - Polygon aPolygon(nCount + (bClose ? 1 : 0)); - - for(sal_uInt32 a(0); a < nCount; a++) - { - const Point aPoint( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - aPolygon[a] = aPoint; - } - - if(bClose) - { - aPolygon[aPolygon.GetSize() - 1] = aPolygon[0]; - } - - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - - if(!(b%2)) - { - const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fHor / 50.0)); - aOut.DrawPolyLine(aPolygon, aLineInfo); - } - else - { - aOut.DrawPolyLine(aPolygon); - } - } - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - - for(sal_uInt32 b(0); b < 5; b++) - { - const sal_uInt32 nCount(basegfx::fround(rand() * (20 / 32767.0))); - const bool bClose(basegfx::fround(rand() / 32767.0)); - Polygon aPolygon(nCount + (bClose ? 1 : 0)); - - for(sal_uInt32 a(0); a < nCount; a++) - { - const Point aPoint( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - aPolygon[a] = aPoint; - } - - if(bClose) - { - aPolygon[aPolygon.GetSize() - 1] = aPolygon[0]; - } - - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.DrawPolygon(aPolygon); - } - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - PolyPolygon aPolyPolygon; - - for(sal_uInt32 b(0); b < 3; b++) - { - const sal_uInt32 nCount(basegfx::fround(rand() * (6 / 32767.0))); - const bool bClose(basegfx::fround(rand() / 32767.0)); - Polygon aPolygon(nCount + (bClose ? 1 : 0)); - - for(sal_uInt32 a(0); a < nCount; a++) - { - const Point aPoint( - aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)), - aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0))); - aPolygon[a] = aPoint; - } - - if(bClose) - { - aPolygon[aPolygon.GetSize() - 1] = aPolygon[0]; - } - - aPolyPolygon.Insert(aPolygon); - } - - aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0))); - aOut.DrawPolyPolygon(aPolyPolygon); - } - - if(false) - { - SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ); - vcl::PNGReader aPNGReader(aRead); - BitmapEx aBitmapEx(aPNGReader.Read()); - aOut.DrawBitmapEx(aRectangle.TopLeft(), aBitmapEx); - } - - if(false) - { - SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ); - vcl::PNGReader aPNGReader(aRead); - BitmapEx aBitmapEx(aPNGReader.Read()); - aOut.DrawBitmapEx(aRectangle.TopLeft(), aRectangle.GetSize(), aBitmapEx); - } - - if(false) - { - SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ); - vcl::PNGReader aPNGReader(aRead); - BitmapEx aBitmapEx(aPNGReader.Read()); - const Size aSizePixel(aBitmapEx.GetSizePixel()); - aOut.DrawBitmapEx( - aRectangle.TopLeft(), - aRectangle.GetSize(), - Point(0, 0), - Size(aSizePixel.Width() /2, aSizePixel.Height() / 2), - aBitmapEx); - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - const Point aPointA( - aRectangle.Left() + basegfx::fround(fHor * 0.2), - aRectangle.Top() + basegfx::fround(fVer * 0.3)); - const Point aPointB( - aRectangle.Left() + basegfx::fround(fHor * 0.2), - aRectangle.Top() + basegfx::fround(fVer * 0.5)); - const Point aPointC( - aRectangle.Left() + basegfx::fround(fHor * 0.2), - aRectangle.Top() + basegfx::fround(fVer * 0.7)); - const String aText(ByteString("Hello, World!"), RTL_TEXTENCODING_UTF8); - - const String aFontName(ByteString("Comic Sans MS"), RTL_TEXTENCODING_UTF8); - Font aFont(aFontName, Size(0, 1000)); - aFont.SetAlign(ALIGN_BASELINE); - aFont.SetColor(COL_RED); - //sal_Int32* pDXArray = new sal_Int32[aText.Len()]; - - aFont.SetOutline(true); - aOut.SetFont(aFont); - aOut.DrawText(aPointA, aText, 0, aText.Len()); - - aFont.SetShadow(true); - aOut.SetFont(aFont); - aOut.DrawText(aPointB, aText, 0, aText.Len()); - - aFont.SetRelief(RELIEF_EMBOSSED); - aOut.SetFont(aFont); - aOut.DrawText(aPointC, aText, 0, aText.Len()); - - //delete pDXArray; - } - - if(false) - { - const double fHor(aRectangle.getWidth()); - const double fVer(aRectangle.getHeight()); - const Point aPointA( - aRectangle.Left() + basegfx::fround(fHor * 0.2), - aRectangle.Top() + basegfx::fround(fVer * 0.3)); - const Point aPointB( - aRectangle.Left() + basegfx::fround(fHor * 0.2), - aRectangle.Top() + basegfx::fround(fVer * 0.5)); - const Point aPointC( - aRectangle.Left() + basegfx::fround(fHor * 0.2), - aRectangle.Top() + basegfx::fround(fVer * 0.7)); - const String aText(ByteString("Hello, World!"), RTL_TEXTENCODING_UTF8); - - const String aFontName(ByteString("Comic Sans MS"), RTL_TEXTENCODING_UTF8); - Font aFont(aFontName, Size(0, 1000)); - aFont.SetAlign(ALIGN_BASELINE); - aFont.SetColor(COL_RED); - - aOut.SetFont(aFont); - const sal_Int32 nWidth(aOut.GetTextWidth(aText, 0, aText.Len())); - aOut.DrawText(aPointA, aText, 0, aText.Len()); - aOut.DrawTextLine(aPointA, nWidth, STRIKEOUT_SINGLE, UNDERLINE_SINGLE, UNDERLINE_SMALLWAVE); - aOut.DrawTextLine(aPointB, nWidth, STRIKEOUT_SINGLE, UNDERLINE_SINGLE, UNDERLINE_SMALLWAVE); - aOut.DrawTextLine(aPointC, nWidth, STRIKEOUT_SINGLE, UNDERLINE_SINGLE, UNDERLINE_SMALLWAVE); - } - - aMtf.Stop(); - aMtf.WindStart(); - aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM)); - aMtf.SetPrefSize(Size(aRectangle.getWidth(), aRectangle.getHeight())); - - xPrimitive = Primitive2DReference( - new MetafilePrimitive2D( - aTransform, - aMtf)); - } - else - { -#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE // create MetafilePrimitive2D const GDIMetaFile& rMetafile = aTransformedGraphic.GetGDIMetaFile(); @@ -785,9 +333,6 @@ namespace drawinglayer aChildContent)); } } -#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE - } -#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE break; } @@ -953,3 +498,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx index fabf6a3e3f12..0439aa2436cf 100644 --- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -318,3 +319,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/groupprimitive2d.cxx b/drawinglayer/source/primitive2d/groupprimitive2d.cxx index 324007a6c7f3..25908a5b4c98 100644 --- a/drawinglayer/source/primitive2d/groupprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/groupprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx index 69e40ac5799b..e5d861806721 100644 --- a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -220,3 +221,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx index 2b3afeb0f8ed..c7bb66f60fdf 100644 --- a/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx @@ -1,13 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hittestprimitive3d.cxx,v $ - * - * $Revision: 1.1.2.1 $ - * - * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $ - * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. * @@ -73,3 +68,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/invertprimitive2d.cxx b/drawinglayer/source/primitive2d/invertprimitive2d.cxx index a1db78747cf4..7bd3be3cc596 100644 --- a/drawinglayer/source/primitive2d/invertprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/invertprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk deleted file mode 100644 index 77e59dca2469..000000000000 --- a/drawinglayer/source/primitive2d/makefile.mk +++ /dev/null @@ -1,91 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=drawinglayer -TARGET=primitive2d -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ---------------------------------- - -.INCLUDE : settings.mk - -# --- Files ------------------------------------- - -SLOFILES= \ - $(SLO)$/transparenceprimitive2d.obj \ - $(SLO)$/animatedprimitive2d.obj \ - $(SLO)$/baseprimitive2d.obj \ - $(SLO)$/backgroundcolorprimitive2d.obj \ - $(SLO)$/bitmapprimitive2d.obj \ - $(SLO)$/rendergraphicprimitive2d.obj \ - $(SLO)$/borderlineprimitive2d.obj \ - $(SLO)$/chartprimitive2d.obj \ - $(SLO)$/controlprimitive2d.obj \ - $(SLO)$/discretebitmapprimitive2d.obj \ - $(SLO)$/discreteshadowprimitive2d.obj \ - $(SLO)$/embedded3dprimitive2d.obj \ - $(SLO)$/epsprimitive2d.obj \ - $(SLO)$/fillbitmapprimitive2d.obj \ - $(SLO)$/fillgradientprimitive2d.obj \ - $(SLO)$/fillhatchprimitive2d.obj \ - $(SLO)$/graphicprimitive2d.obj \ - $(SLO)$/gridprimitive2d.obj \ - $(SLO)$/groupprimitive2d.obj \ - $(SLO)$/helplineprimitive2d.obj \ - $(SLO)$/hiddengeometryprimitive2d.obj \ - $(SLO)$/invertprimitive2d.obj \ - $(SLO)$/markerarrayprimitive2d.obj \ - $(SLO)$/pointarrayprimitive2d.obj \ - $(SLO)$/maskprimitive2d.obj \ - $(SLO)$/mediaprimitive2d.obj \ - $(SLO)$/metafileprimitive2d.obj \ - $(SLO)$/modifiedcolorprimitive2d.obj \ - $(SLO)$/pagepreviewprimitive2d.obj \ - $(SLO)$/polypolygonprimitive2d.obj \ - $(SLO)$/polygonprimitive2d.obj \ - $(SLO)$/primitivetools2d.obj \ - $(SLO)$/sceneprimitive2d.obj \ - $(SLO)$/sdrdecompositiontools2d.obj \ - $(SLO)$/shadowprimitive2d.obj \ - $(SLO)$/structuretagprimitive2d.obj \ - $(SLO)$/texteffectprimitive2d.obj \ - $(SLO)$/textenumsprimitive2d.obj \ - $(SLO)$/textlayoutdevice.obj \ - $(SLO)$/textlineprimitive2d.obj \ - $(SLO)$/textprimitive2d.obj \ - $(SLO)$/textstrikeoutprimitive2d.obj \ - $(SLO)$/textdecoratedprimitive2d.obj \ - $(SLO)$/texthierarchyprimitive2d.obj \ - $(SLO)$/transformprimitive2d.obj \ - $(SLO)$/unifiedtransparenceprimitive2d.obj \ - $(SLO)$/wallpaperprimitive2d.obj \ - $(SLO)$/wrongspellprimitive2d.obj - -# --- Targets ---------------------------------- - -.INCLUDE : target.mk diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx index 89ac404247ae..3bc4f8a4bafe 100644 --- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -155,3 +156,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/maskprimitive2d.cxx b/drawinglayer/source/primitive2d/maskprimitive2d.cxx index f1aae04d232f..a864cd7cd89e 100644 --- a/drawinglayer/source/primitive2d/maskprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/maskprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -74,3 +75,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx index dc867171a9b9..70b09b504118 100644 --- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index 9988eb884679..9b35f8109ddb 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -365,7 +366,7 @@ namespace ~PropertyHolders() { - while(maPropertyHolders.size()) + while(!maPropertyHolders.empty()) { delete maPropertyHolders.back(); maPropertyHolders.pop_back(); @@ -527,7 +528,7 @@ namespace void Pop() { OSL_ENSURE(maTargetHolders.size(), "TargetHolders: POP with no property holders (!)"); - if(maTargetHolders.size()) + if(!maTargetHolders.empty()) { delete maTargetHolders.back(); maTargetHolders.pop_back(); @@ -542,7 +543,7 @@ namespace ~TargetHolders() { - while(maTargetHolders.size()) + while(!maTargetHolders.empty()) { delete maTargetHolders.back(); maTargetHolders.pop_back(); @@ -632,7 +633,7 @@ namespace PropertyHolder& rProperties, basegfx::BColor aBColor) { - if(rPositions.size()) + if(!rPositions.empty()) { if(rProperties.getTransformation().isIdentity()) { @@ -1589,7 +1590,7 @@ namespace } } - if(aTargetVector.size()) + if(!aTargetVector.empty()) { // add created text primitive to target if(rProperty.getTransformation().isIdentity()) @@ -1662,9 +1663,9 @@ namespace PropertyHolders& rPropertyHolders, const drawinglayer::geometry::ViewInformation2D& rViewInformation) { - const sal_uInt32 nCount(rMetaFile.GetActionCount()); + const size_t nCount(rMetaFile.GetActionSize()); - for(sal_uInt32 nAction(0); nAction < nCount; nAction++) + for(size_t nAction(0); nAction < nCount; nAction++) { MetaAction* pAction = rMetaFile.GetAction(nAction); @@ -1687,7 +1688,7 @@ namespace if(pA->GetColor() != aLastColor) { - if(aPositions.size()) + if(!aPositions.empty()) { createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), aLastColor.getBColor()); aPositions.clear(); @@ -1703,7 +1704,7 @@ namespace nAction--; - if(aPositions.size()) + if(!aPositions.empty()) { createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), aLastColor.getBColor()); } @@ -1727,7 +1728,7 @@ namespace nAction--; - if(aPositions.size()) + if(!aPositions.empty()) { createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), rPropertyHolders.Current().getLineColor()); } @@ -2115,7 +2116,7 @@ namespace case META_TEXTRECT_ACTION : { /** CHECKED, WORKS WELL */ - // OSL_ENSURE(false, "META_TEXTRECT_ACTION requested (!)"); + // OSL_FAIL("META_TEXTRECT_ACTION requested (!)"); const MetaTextRectAction* pA = (const MetaTextRectAction*)pAction; const Rectangle& rRectangle = pA->GetRect(); const sal_uInt32 nStringLength(pA->GetText().Len()); @@ -2140,7 +2141,7 @@ namespace aTextLayouterDevice.addTextRectActions( rRectangle, pA->GetText(), pA->GetStyle(), aGDIMetaFile); - if(aGDIMetaFile.GetActionCount()) + if(aGDIMetaFile.GetActionSize()) { // cerate sub-content drawinglayer::primitive2d::Primitive2DSequence xSubContent; @@ -2729,7 +2730,7 @@ namespace } default : { - OSL_ENSURE(false, "interpretMetafile: META_MAPMODE_ACTION with unsupported MapUnit (!)"); + OSL_FAIL("interpretMetafile: META_MAPMODE_ACTION with unsupported MapUnit (!)"); break; } } @@ -2980,7 +2981,7 @@ namespace { const GDIMetaFile& rContent = pA->GetGDIMetaFile(); - if(rContent.GetActionCount()) + if(rContent.GetActionSize()) { // create the sub-content with no embedding specific to the // sub-metafile, this seems not to be used. @@ -3174,7 +3175,7 @@ namespace } default: { - OSL_ENSURE(false, "Unknown MetaFile Action (!)"); + OSL_FAIL("Unknown MetaFile Action (!)"); break; } } @@ -3282,3 +3283,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx index 73c647ea3c8c..2d7e22ffd542 100644 --- a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,3 +70,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx index 795ac14b1f91..dd4bc359adb7 100644 --- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -181,3 +182,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx index cf618c269569..94b3f9cb7a9a 100644 --- a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index 9623c02dc5bd..6a656445db40 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -508,10 +509,11 @@ namespace drawinglayer { // copy local polygon, it may be changed basegfx::B2DPolygon aLocalPolygon(getB2DPolygon()); + aLocalPolygon.removeDoublePoints(); basegfx::B2DPolyPolygon aArrowA; basegfx::B2DPolyPolygon aArrowB; - if(!aLocalPolygon.isClosed()) + if(!aLocalPolygon.isClosed() && aLocalPolygon.count() > 1) { // apply arrows const double fPolyLength(basegfx::tools::getLength(aLocalPolygon)); @@ -636,3 +638,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx index 4e01d5285c7a..e1102f8eeb35 100644 --- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -570,3 +571,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx b/drawinglayer/source/primitive2d/primitivetools2d.cxx index 5da1cd9a816c..af73fcf278a8 100644 --- a/drawinglayer/source/primitive2d/primitivetools2d.cxx +++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -168,3 +169,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 0820d6ba09c0..7d83868fa784 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -478,3 +479,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx index 9d90c35103d9..42c5d545f092 100644 --- a/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx +++ b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx @@ -1,13 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: sdrdecompositiontools3d.cxx,v $ - * - * $Revision: 1.7 $ - * - * last change: $Author: aw $ $Date: 2008-05-27 14:11:21 $ - * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. * @@ -128,3 +123,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index a9bfec89b490..1247ba2785b6 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -104,3 +105,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx index 8adcb6a10b82..e6a0a1ce8dc9 100644 --- a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx index a0d763e9e63f..6c60b3f22281 100644 --- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -209,7 +210,7 @@ namespace drawinglayer if(!xLocalBreakIterator.is()) { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF(::comphelper::getProcessServiceFactory()); - xLocalBreakIterator.set(xMSF->createInstance(rtl::OUString::createFromAscii("com.sun.star.i18n.BreakIterator")), ::com::sun::star::uno::UNO_QUERY); + xLocalBreakIterator.set(xMSF->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator"))), ::com::sun::star::uno::UNO_QUERY); } if(xLocalBreakIterator.is() && getTextLength()) @@ -235,6 +236,7 @@ namespace drawinglayer getFontAttribute().getSymbol(), getFontAttribute().getVertical(), getFontAttribute().getItalic(), + getFontAttribute().getMonospaced(), false, // no outline anymore, handled locally getFontAttribute().getRTL(), getFontAttribute().getBiDiStrong()); @@ -604,3 +606,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx index 94926f1043a4..41e51c6e9e2f 100644 --- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -237,3 +238,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx b/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx index 7172e38c0c2e..b9ad03531206 100644 --- a/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -119,3 +120,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx index fb26a8d463f4..4653a0437a3b 100644 --- a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -156,3 +157,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 9aafd195a707..330d597ba700 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,6 +30,8 @@ #include "precompiled_drawinglayer.hxx" #include <drawinglayer/primitive2d/textlayoutdevice.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/scoped_disposing_ptr.hxx> #include <vcl/timer.hxx> #include <vcl/virdev.hxx> #include <vcl/font.hxx> @@ -42,14 +45,33 @@ namespace { + class ImpTimedRefDev; + + //the scoped_timed_RefDev owns a ImpTimeRefDev and releases it on dtor + //or disposing of the default XComponentContext which causes the underlying + //OutputDevice to get released + // + //The ImpTimerRefDev itself, if the timeout ever gets hit, will call + //reset on the scoped_timed_RefDev to release the ImpTimerRefDev early + //if its unused for a few minutes + class scoped_timed_RefDev : public comphelper::scoped_disposing_ptr<ImpTimedRefDev> + { + public: + scoped_timed_RefDev() : comphelper::scoped_disposing_ptr<ImpTimedRefDev>((::com::sun::star::uno::Reference<com::sun::star::lang::XComponent>(::comphelper::getProcessComponentContext(), ::com::sun::star::uno::UNO_QUERY_THROW))) + { + } + }; + + class the_scoped_timed_RefDev : public rtl::Static<scoped_timed_RefDev, the_scoped_timed_RefDev> {}; + class ImpTimedRefDev : public Timer { - ImpTimedRefDev** mppStaticPointerOnMe; + scoped_timed_RefDev& mrOwnerOfMe; VirtualDevice* mpVirDev; sal_uInt32 mnUseCount; public: - ImpTimedRefDev(ImpTimedRefDev** ppStaticPointerOnMe); + ImpTimedRefDev(scoped_timed_RefDev& rOwnerofMe); ~ImpTimedRefDev(); virtual void Timeout(); @@ -57,8 +79,8 @@ namespace void releaseVirtualDevice(); }; - ImpTimedRefDev::ImpTimedRefDev(ImpTimedRefDev** ppStaticPointerOnMe) - : mppStaticPointerOnMe(ppStaticPointerOnMe), + ImpTimedRefDev::ImpTimedRefDev(scoped_timed_RefDev& rOwnerOfMe) + : mrOwnerOfMe(rOwnerOfMe), mpVirDev(0L), mnUseCount(0L) { @@ -69,22 +91,13 @@ namespace ImpTimedRefDev::~ImpTimedRefDev() { OSL_ENSURE(0L == mnUseCount, "destruction of a still used ImpTimedRefDev (!)"); - - if(mppStaticPointerOnMe && *mppStaticPointerOnMe) - { - *mppStaticPointerOnMe = 0L; - } - - if(mpVirDev) - { - delete mpVirDev; - } + delete mpVirDev; } void ImpTimedRefDev::Timeout() { // for obvious reasons, do not call anything after this - delete (this); + mrOwnerOfMe.reset(); } VirtualDevice& ImpTimedRefDev::acquireVirtualDevice() @@ -124,24 +137,23 @@ namespace drawinglayer { namespace primitive2d { - // static pointer here - static ImpTimedRefDev* pImpGlobalRefDev = 0L; - // static methods here VirtualDevice& acquireGlobalVirtualDevice() { - if(!pImpGlobalRefDev) - { - pImpGlobalRefDev = new ImpTimedRefDev(&pImpGlobalRefDev); - } + scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get(); + + if(!rStdRefDevice) + rStdRefDevice.reset(new ImpTimedRefDev(rStdRefDevice)); - return pImpGlobalRefDev->acquireVirtualDevice(); + return rStdRefDevice->acquireVirtualDevice(); } void releaseGlobalVirtualDevice() { - OSL_ENSURE(pImpGlobalRefDev, "releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)"); - pImpGlobalRefDev->releaseVirtualDevice(); + scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get(); + + OSL_ENSURE(rStdRefDevice, "releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)"); + rStdRefDevice->releaseVirtualDevice(); } TextLayouterDevice::TextLayouterDevice() @@ -346,13 +358,9 @@ namespace drawinglayer if(nTextLength) { aRetval.reserve(nTextLength); - sal_Int32* pArray = new sal_Int32[nTextLength]; - mrDevice.GetTextArray(rText, pArray, nIndex, nLength); - - for(sal_uInt32 a(0); a < nTextLength; a++) - { - aRetval.push_back(pArray[a]); - } + ::std::vector<sal_Int32> aArray(nTextLength); + mrDevice.GetTextArray(rText, &aArray[0], nIndex, nLength); + aRetval.assign(aArray.begin(), aArray.end()); } return aRetval; @@ -491,3 +499,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx index 74e4e3dbf1be..b76056b5a219 100644 --- a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -307,3 +308,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index f5566246ef91..b830f8fc01c9 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -237,7 +238,9 @@ namespace drawinglayer const ::std::vector< double >& rDXArray, const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale, - const basegfx::BColor& rFontColor) + const basegfx::BColor& rFontColor, + bool bFilled, + long nWidthToFill) : BufferedDecompositionPrimitive2D(), maTextTransform(rNewTransform), maText(rText), @@ -247,9 +250,11 @@ namespace drawinglayer maFontAttribute(rFontAttribute), maLocale(rLocale), maFontColor(rFontColor), - maB2DRange() + maB2DRange(), + mbFilled(bFilled), + mnWidthToFill(nWidthToFill) { -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 const xub_StrLen aStringLength(getText().Len()); OSL_ENSURE(aStringLength >= getTextPosition() && aStringLength >= getTextPosition() + getTextLength(), "TextSimplePortionPrimitive2D with text out of range (!)"); @@ -276,7 +281,9 @@ namespace drawinglayer && getDXArray() == rCompare.getDXArray() && getFontAttribute() == rCompare.getFontAttribute() && LocalesAreEqual(getLocale(), rCompare.getLocale()) - && getFontColor() == rCompare.getFontColor()); + && getFontColor() == rCompare.getFontColor() + && mbFilled == rCompare.mbFilled + && mnWidthToFill == rCompare.mnWidthToFill); } return false; @@ -337,3 +344,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx index 855b1bf178fa..98d7a64e2dfc 100644 --- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -284,3 +285,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/transformprimitive2d.cxx b/drawinglayer/source/primitive2d/transformprimitive2d.cxx index 39905ad42b5b..b3f1e2e1b0a3 100644 --- a/drawinglayer/source/primitive2d/transformprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/transformprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx index cfe1e184e89e..d5aec4d7434e 100644 --- a/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx @@ -1,13 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: alphaprimitive2d.cxx,v $ - * - * $Revision: 1.5 $ - * - * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $ - * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. * @@ -76,3 +71,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx index 6d930e40f5d7..b96c8967bdaf 100644 --- a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx @@ -1,13 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: UnifiedTransparencePrimitive2D.cxx,v $ - * - * $Revision: 1.5 $ - * - * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $ - * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. * @@ -134,3 +129,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx index efa51c75b611..0213ba90a6c6 100644 --- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -267,3 +268,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx index 10c6e1e7263e..825251036d7a 100644 --- a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -120,3 +121,5 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |