diff options
author | Armin Weiss <aw@openoffice.org> | 2006-12-13 15:57:09 +0000 |
---|---|---|
committer | Armin Weiss <aw@openoffice.org> | 2006-12-13 15:57:09 +0000 |
commit | f5895d9ed55f990e1d1281ff961f6a961775d6d4 (patch) | |
tree | f9c2ed653effef68496eb02932342f90d0aee3b9 /drawinglayer | |
parent | f92e40c650d6ee40b39714be06f0238bb2348b10 (diff) |
#i39532# adaptions for solaris version
Diffstat (limited to 'drawinglayer')
13 files changed, 93 insertions, 59 deletions
diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx index 70dacb52bc1d..f7e00a1ebe62 100644 --- a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx +++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: viewinformation2d.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-10-19 10:31:22 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,6 +36,13 @@ #ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX #define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX +// the solaris compiler defines 'sun' as '1'. To avoid that (and to allow +// pre-declarations of com/sun/star namespace), include sal/config.h here +// where sun is redefined as 'sun' (so i guess the problem is known). +#ifndef _SAL_CONFIG_H_ +#include <sal/config.h> +#endif + ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx index 8c4e3742c539..804e8d2971b0 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: baseprimitive2d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-11-28 11:03:56 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -69,7 +69,7 @@ virtual sal_uInt32 getPrimitiveID() const; #define ImplPrimitrive2DIDBlock(TheClass, a, b, c, d) \ - sal_uInt32 TheClass##::getPrimitiveID() const { return Create2DPrimitiveID(a, b, c, d); } + sal_uInt32 TheClass::getPrimitiveID() const { return Create2DPrimitiveID(a, b, c, d); } ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx index b90d0867a1e8..c10580ab8979 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: baseprimitive3d.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2006-11-07 15:49:05 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -69,7 +69,7 @@ virtual sal_uInt32 getPrimitiveID() const; #define ImplPrimitrive3DIDBlock(TheClass, a, b, c, d) \ - sal_uInt32 TheClass##::getPrimitiveID() const { return Create3DPrimitiveID(a, b, c, d); } + sal_uInt32 TheClass::getPrimitiveID() const { return Create3DPrimitiveID(a, b, c, d); } ////////////////////////////////////////////////////////////////////////////// // basePrimitive3D class diff --git a/drawinglayer/source/animation/makefile.mk b/drawinglayer/source/animation/makefile.mk index ef533c8a8614..a72bf10711f4 100644 --- a/drawinglayer/source/animation/makefile.mk +++ b/drawinglayer/source/animation/makefile.mk @@ -4,9 +4,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.2 $ +# $Revision: 1.3 $ # -# last change: $Author: aw $ $Date: 2006-08-09 16:47:02 $ +# last change: $Author: aw $ $Date: 2006-12-13 16:57:07 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -36,6 +36,7 @@ PRJ=..$/.. PRJNAME=drawinglayer TARGET=animation +ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- diff --git a/drawinglayer/source/attribute/makefile.mk b/drawinglayer/source/attribute/makefile.mk index 7e4bccd0b959..0cd599d2a84d 100644 --- a/drawinglayer/source/attribute/makefile.mk +++ b/drawinglayer/source/attribute/makefile.mk @@ -4,9 +4,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.1 $ +# $Revision: 1.2 $ # -# last change: $Author: aw $ $Date: 2006-08-09 16:47:33 $ +# last change: $Author: aw $ $Date: 2006-12-13 16:57:08 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -36,6 +36,7 @@ PRJ=..$/.. PRJNAME=drawinglayer TARGET=attribute +ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx index 37c062d10213..2d44825bf1af 100644 --- a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: helplineprimitive2d.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2006-11-07 15:49:08 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:08 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -94,7 +94,7 @@ namespace drawinglayer PolygonMarkerPrimitive2D* pNewA = new PolygonMarkerPrimitive2D(aLineA, getRGBColA(), getRGBColB(), fLogicDashLen); aTempPrimitiveTarget.push_back(pNewA); - const basegfx::B2DVector aPerpendicularNormalizedDirection(getPerpendicular(aNormalizedDirection)); + const basegfx::B2DVector aPerpendicularNormalizedDirection(basegfx::getPerpendicular(aNormalizedDirection)); const basegfx::B2DPoint aStartB(aViewPosition - aPerpendicularNormalizedDirection); const basegfx::B2DPoint aEndB(aViewPosition + aPerpendicularNormalizedDirection); basegfx::B2DPolygon aLineB; diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 5e1ee45c0d53..ce9e91d2958c 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: sceneprimitive2d.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-11-28 11:03:57 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:08 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -199,15 +199,15 @@ namespace drawinglayer { if(basegfx::fTools::equalZero(fShearX) && basegfx::fTools::equalZero(fRotate)) { - basegfx::B2DVector aScale, aTranslate; - double fRotate, fShearX; + basegfx::B2DVector aScaleB, aTranslateB; + double fRotateB, fShearXB; - pNewTextBitmap->getTransform().decompose(aScale, aTranslate, fRotate, fShearX); - basegfx::B2DVector aViewSize(basegfx::absolute(aScale)); - aViewSize *= rViewInformation.getViewTransformation(); + pNewTextBitmap->getTransform().decompose(aScaleB, aTranslateB, fRotateB, fShearXB); + basegfx::B2DVector aViewSizeB(basegfx::absolute(aScaleB)); + aViewSizeB *= rViewInformation.getViewTransformation(); const Size aSourceSizePixel(pNewTextBitmap->getBitmapEx().GetSizePixel()); - const bool bXEqual(aSourceSizePixel.getWidth() == basegfx::fround(aViewSize.getX())); - const bool bYEqual(aSourceSizePixel.getHeight() == basegfx::fround(aViewSize.getY())); + const bool bXEqual(aSourceSizePixel.getWidth() == basegfx::fround(aViewSizeB.getX())); + const bool bYEqual(aSourceSizePixel.getHeight() == basegfx::fround(aViewSizeB.getY())); OSL_ENSURE(bXEqual && bYEqual, "3D renderer produced non-pixel-aligned graphic (!)"); } } diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index a955065a80e1..9b09e324d413 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: textprimitive2d.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2006-11-07 15:49:09 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:08 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -334,10 +334,10 @@ namespace drawinglayer : TextSimplePortionPrimitive2D(rNewTransform, rText, rDXArray, rFontAttributes, rFontColor), meFontUnderline(eFontUnderline), meFontStrikeout(eFontStrikeout), + meFontEmphasisMark(eFontEmphasisMark), meFontRelief(eFontRelief), mbUnderlineAbove(bUnderlineAbove), mbWordLineMode(bWordLineMode), - meFontEmphasisMark(eFontEmphasisMark), mbEmphasisMarkAbove(bEmphasisMarkAbove), mbEmphasisMarkBelow(bEmphasisMarkBelow), mbShadow(bShadow), diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx index d9b9cd354530..107c689ab36c 100644 --- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: hatchtextureprimitive3d.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: aw $ $Date: 2006-11-07 15:49:10 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:08 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -94,10 +94,11 @@ namespace drawinglayer if(getChildren().hasElements()) { const Primitive3DSequence aSource(getChildren()); - const sal_Int32 nSourceCount(aSource.getLength()); + const sal_uInt32 nSourceCount(aSource.getLength()); std::vector< Primitive3DReference > aDestination; + sal_uInt32 a, b, c; - for(sal_Int32 a(0L); a < nSourceCount; a++) + for(a = 0L; a < nSourceCount; a++) { // get reference const Primitive3DReference xReference(aSource[a]); @@ -134,28 +135,27 @@ namespace drawinglayer basegfx::B3DPoint a3N; basegfx::B3DVector a3X, a3Y; bool b2N(false), b2X(false), b2Y(false); - sal_uInt32 a, b; - for(a = 0L; a < nPolyCount; a++) + for(b = 0L; b < nPolyCount; b++) { - const basegfx::B3DPolygon aPartPoly(aFillPolyPolygon.getB3DPolygon(a)); + const basegfx::B3DPolygon aPartPoly(aFillPolyPolygon.getB3DPolygon(b)); const sal_uInt32 nPointCount(aPartPoly.count()); basegfx::B2DPolygon aTexPolygon; - for(b = 0L; b < nPointCount; b++) + for(c = 0L; c < nPointCount; c++) { - const basegfx::B2DPoint a2Candidate(aPartPoly.getTextureCoordinate(b)); + const basegfx::B2DPoint a2Candidate(aPartPoly.getTextureCoordinate(c)); if(!b2N) { a2N = a2Candidate; - a3N = aPartPoly.getB3DPoint(b); + a3N = aPartPoly.getB3DPoint(c); b2N = true; } else if(!b2X && !a2N.equal(a2Candidate)) { a2X = a2Candidate - a2N; - a3X = aPartPoly.getB3DPoint(b) - a3N; + a3X = aPartPoly.getB3DPoint(c) - a3N; b2X = true; } else if(!b2Y && !a2N.equal(a2Candidate) && !a2X.equal(a2Candidate)) @@ -166,7 +166,7 @@ namespace drawinglayer if(!basegfx::fTools::equalZero(fCross)) { - a3Y = aPartPoly.getB3DPoint(b) - a3N; + a3Y = aPartPoly.getB3DPoint(c) - a3N; b2Y = true; } } @@ -300,9 +300,9 @@ namespace drawinglayer const sal_uInt32 nDestSize(aDestination.size()); aRetval.realloc(nDestSize); - for(sal_uInt32 b(0L); b < nDestSize; b++) + for(a = 0L; a < nDestSize; a++) { - aRetval[b] = aDestination[b]; + aRetval[a] = aDestination[a]; } } diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx index 8474600605af..db105a4677c9 100644 --- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrextrudelathetools3d.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:08 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -622,7 +622,7 @@ namespace drawinglayer basegfx::B3DPoint aCenter(basegfx::tools::getRange(rSliceVector[0L].getB3DPolyPolygon()).getCenter()); - for(sal_uInt32 a(0L); a < nLoopCount; a++) + for(a = 0L; a < nLoopCount; a++) { const basegfx::B3DPoint aNextCenter(basegfx::tools::getRange(rSliceVector[(a + 1L) % nNumSlices].getB3DPolyPolygon()).getCenter()); const double fLength(basegfx::B3DVector(aNextCenter - aCenter).getLength()); @@ -671,7 +671,13 @@ namespace drawinglayer if(bCreateNormals) { - const basegfx::B3DVector aNormal(aFront.count() ? -aFront.getB3DPolygon(0L).getNormal() : basegfx::B3DVector(0.0, 0.0, -1.0)); + basegfx::B3DVector aNormal(0.0, 0.0, -1.0); + + if(aFront.count()) + { + aNormal = -aFront.getB3DPolygon(0L).getNormal(); + } + impSetNormal(aFront, aNormal); if(bHasSlant) diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 79b5e1fc9c6a..377fee9340de 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: vclprocessor2d.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2006-11-28 11:03:57 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:09 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -960,12 +960,20 @@ namespace drawinglayer if(pContent) { + const double fConvertColor(1.0 / 255.0); + for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++) { for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++) { - const basegfx::BColor aBColor(rModifier.getModifiedColor(Color(pContent->GetPixel(y, x)).getBColor())); - pContent->SetPixel(y, x, BitmapColor(Color(aBColor))); + const BitmapColor aBMCol(pContent->GetColor(y, x)); + const basegfx::BColor aBSource( + (double)aBMCol.GetRed() * fConvertColor, + (double)aBMCol.GetGreen() * fConvertColor, + (double)aBMCol.GetBlue() * fConvertColor); + const basegfx::BColor aBDest(rModifier.getModifiedColor(aBSource)); + + pContent->SetPixel(y, x, BitmapColor(Color(aBDest))); } } @@ -1036,7 +1044,7 @@ namespace drawinglayer { // handle, there is no shear and no mirror bPrimitiveAccepted = true; - const Font aFont(getVclFontFromFontAttributes(rTextCandidate.getFontAttributes(), aScale, fRotate)); + const Font aFont(primitive2d::getVclFontFromFontAttributes(rTextCandidate.getFontAttributes(), aScale, fRotate)); const basegfx::B2DPoint aPoint(aLocalTransform * basegfx::B2DPoint(0.0, 0.0)); const Point aStartPoint(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())); diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index 6e04192319ff..5e3d821fbb8e 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: defaultprocessor3d.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-10-19 10:39:22 $ + * last change: $Author: aw $ $Date: 2006-12-13 16:57:09 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -683,9 +683,9 @@ namespace drawinglayer if(bUseTex) { - const basegfx::B2DPointInterpolator& rA(maGlobalTextureCoordinateInterpolators[rA.getTextureCoordinateIndex()]); - const basegfx::B2DPointInterpolator& rB(maGlobalTextureCoordinateInterpolators[rB.getTextureCoordinateIndex()]); - aTex = basegfx::B2DPointInterpolator(rA.getVal(), rB.getVal(), rA.getZVal(), rB.getZVal(), nSpanLength); + const basegfx::B2DPointInterpolator& rLA(maGlobalTextureCoordinateInterpolators[rA.getTextureCoordinateIndex()]); + const basegfx::B2DPointInterpolator& rLB(maGlobalTextureCoordinateInterpolators[rB.getTextureCoordinateIndex()]); + aTex = basegfx::B2DPointInterpolator(rLA.getVal(), rLB.getVal(), rLA.getZVal(), rLB.getZVal(), nSpanLength); } if(bUseNrm) @@ -1073,7 +1073,14 @@ namespace drawinglayer if(impIsValid(rUV, nX, nY)) { - rBColor = Color(mpRead->GetColor(nY, nX)).getBColor(); + const double fConvertColor(1.0 / 255.0); + const BitmapColor aBMCol(mpRead->GetColor(nY, nX)); + const basegfx::BColor aBSource( + (double)aBMCol.GetRed() * fConvertColor, + (double)aBMCol.GetGreen() * fConvertColor, + (double)aBMCol.GetBlue() * fConvertColor); + + rBColor = aBSource; } else { @@ -1087,7 +1094,10 @@ namespace drawinglayer if(impIsValid(rUV, nX, nY)) { - rfOpacity = ((double)(0xff - Color(mpRead->GetColor(nY, nX)).GetLuminance()) * (1.0 / 255.0)); + const BitmapColor aBMCol(mpRead->GetColor(nY, nX)); + const Color aColor(aBMCol.GetRed(), aBMCol.GetGreen(), aBMCol.GetBlue()); + + rfOpacity = ((double)(0xff - aColor.GetLuminance()) * (1.0 / 255.0)); } else { diff --git a/drawinglayer/source/texture/makefile.mk b/drawinglayer/source/texture/makefile.mk index 877a929a8f1e..941163ed32e2 100644 --- a/drawinglayer/source/texture/makefile.mk +++ b/drawinglayer/source/texture/makefile.mk @@ -4,9 +4,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.1 $ +# $Revision: 1.2 $ # -# last change: $Author: aw $ $Date: 2006-08-09 16:58:20 $ +# last change: $Author: aw $ $Date: 2006-12-13 16:57:09 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -36,6 +36,7 @@ PRJ=..$/.. PRJNAME=drawinglayer TARGET=texture +ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- |