diff options
473 files changed, 13279 insertions, 7817 deletions
diff --git a/autodoc/source/parser/cpp/c_rcode.cxx b/autodoc/source/parser/cpp/c_rcode.cxx index e8f688168d3f..dd62dbbae2e5 100644 --- a/autodoc/source/parser/cpp/c_rcode.cxx +++ b/autodoc/source/parser/cpp/c_rcode.cxx @@ -42,27 +42,6 @@ #include <x_parse.hxx> #include "pe_file.hxx" -#ifdef IRIX -// see i19418 incomplete type for cpp::PE_Namespace -#include "pe_namsp.hxx" -#include "pe_ignor.hxx" -#include "pe_defs.hxx" -#include "pe_vafu.hxx" -#include "pe_tydef.hxx" -#include "pe_tpltp.hxx" -#include "pe_type.hxx" -#include "pe_vari.hxx" -#include "pe_funct.hxx" -#include "pe_enum.hxx" -#include "pe_param.hxx" -#include "pe_class.hxx" -#include "pe_expression.hxx" -#include "pe_base.hxx" -#include "pe_enum.hxx" -#include "pe_enval.hxx" -#endif - - const uintt C_nNO_TRY = uintt(-1); diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index 76e297c3de8a..84dc21a1321a 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -495,8 +495,6 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d abGP.Append( "04" ); #elif defined SOLARIS && defined INTEL abGP.Append( "05" ); // Solaris x86 -#elif defined IRIX - abGP.Append( "06" ); #elif defined HPUX abGP.Append( "07" ); #elif defined FREEBSD diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx index c7c79d0cd6e9..10b023c5f68c 100644 --- a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx +++ b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx @@ -52,12 +52,22 @@ namespace basegfx B2DHomMatrix(const B2DHomMatrix& rMat); ~B2DHomMatrix(); + /** constructor to allow setting all needed values for a 3x2 matrix at once. The + parameter f_0x1 e.g. is the same as using set(0, 1, f) + */ + B2DHomMatrix(double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2); + /// unshare this matrix with all internally shared instances void makeUnique(); double get(sal_uInt16 nRow, sal_uInt16 nColumn) const; void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue); + /** allow setting all needed values for a 3x2 matrix in one call. The + parameter f_0x1 e.g. is the same as using set(0, 1, f) + */ + void set3x2(double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2); + // test if last line is default to see if last line needs to be // involved in calculations bool isLastLineDefault() const; diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx index 0b200b812bed..c90f673a8194 100644 --- a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx +++ b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx @@ -40,45 +40,190 @@ namespace basegfx { - class DecomposedB2DHomMatrixContainer + namespace tools { - private: - B2DHomMatrix maB2DHomMatrix; - B2DVector maScale; - B2DVector maTranslate; - double mfRotate; - double mfShearX; + /** If the rotation angle is an approximate multiple of pi/2, + force fSin/fCos to -1/0/1, to maintain orthogonality (which + might also be advantageous for the other cases, but: for + multiples of pi/2, the exact values _can_ be attained. It + would be largely unintuitive, if a 180 degrees rotation + would introduce slight roundoff errors, instead of exactly + mirroring the coordinate system) + */ + void createSinCosOrthogonal(double& o_rSin, double& rCos, double fRadiant); - // bitfield - unsigned mbDecomposed : 1; + /** Tooling methods for on-the-fly matrix generation e.g. for inline + multiplications + */ + B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY); + B2DHomMatrix createShearXB2DHomMatrix(double fShearX); + B2DHomMatrix createShearYB2DHomMatrix(double fShearY); + B2DHomMatrix createRotateB2DHomMatrix(double fRadiant); + B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY); - void impCheckDecompose() + /// inline versions for parameters as tuples + inline B2DHomMatrix createScaleB2DHomMatrix(const B2DTuple& rScale) { - if(!mbDecomposed) - { - maB2DHomMatrix.decompose(maScale, maTranslate, mfRotate, mfShearX); - mbDecomposed = true; - } + return createScaleB2DHomMatrix(rScale.getX(), rScale.getY()); + } + + inline B2DHomMatrix createTranslateB2DHomMatrix(const B2DTuple& rTranslate) + { + return createTranslateB2DHomMatrix(rTranslate.getX(), rTranslate.getY()); + } + + /** Tooling methods for faster completely combined matrix creation + when scale, shearX, rotation and translation needs to be done in + exactly that order. It's faster since it direcly calculates + each matrix value based on a symbolic calculation of the three + matrix multiplications. + Inline versions for parameters as tuples added, too. + */ + B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix( + double fScaleX, double fScaleY, + double fShearX, + double fRadiant, + double fTranslateX, double fTranslateY); + inline B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix( + const B2DTuple& rScale, + double fShearX, + double fRadiant, + const B2DTuple& rTranslate) + { + return createScaleShearXRotateTranslateB2DHomMatrix( + rScale.getX(), rScale.getY(), + fShearX, + fRadiant, + rTranslate.getX(), rTranslate.getY()); + } + + B2DHomMatrix createShearXRotateTranslateB2DHomMatrix( + double fShearX, + double fRadiant, + double fTranslateX, double fTranslateY); + inline B2DHomMatrix createShearXRotateTranslateB2DHomMatrix( + double fShearX, + double fRadiant, + const B2DTuple& rTranslate) + { + return createShearXRotateTranslateB2DHomMatrix( + fShearX, + fRadiant, + rTranslate.getX(), rTranslate.getY()); } - public: - DecomposedB2DHomMatrixContainer(const B2DHomMatrix& rB2DHomMatrix) - : maB2DHomMatrix(rB2DHomMatrix), - maScale(), - maTranslate(), - mfRotate(0.0), - mfShearX(0.0), - mbDecomposed(false) + B2DHomMatrix createScaleTranslateB2DHomMatrix( + double fScaleX, double fScaleY, + double fTranslateX, double fTranslateY); + inline B2DHomMatrix createScaleTranslateB2DHomMatrix( + const B2DTuple& rScale, + const B2DTuple& rTranslate) { + return createScaleTranslateB2DHomMatrix( + rScale.getX(), rScale.getY(), + rTranslate.getX(), rTranslate.getY()); } - // data access - const B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; } - const B2DVector& getScale() const { const_cast< DecomposedB2DHomMatrixContainer* >(this)->impCheckDecompose(); return maScale; } - const B2DVector& getTranslate() const { const_cast< DecomposedB2DHomMatrixContainer* >(this)->impCheckDecompose(); return maTranslate; } - double getRotate() const { const_cast< DecomposedB2DHomMatrixContainer* >(this)->impCheckDecompose(); return mfRotate; } - double getShearX() const { const_cast< DecomposedB2DHomMatrixContainer* >(this)->impCheckDecompose(); return mfShearX; } - }; + /// special for the often used case of rotation around a point + B2DHomMatrix createRotateAroundPoint( + double fPointX, double fPointY, + double fRadiant); + inline B2DHomMatrix createRotateAroundPoint( + const B2DTuple& rPoint, + double fRadiant) + { + return createRotateAroundPoint( + rPoint.getX(), rPoint.getY(), + fRadiant); + } + } // end of namespace tools +} // end of namespace basegfx + +/////////////////////////////////////////////////////////////////////////////// + +namespace basegfx +{ + namespace tools + { + class B2DHomMatrixBufferedDecompose + { + private: + B2DVector maScale; + B2DVector maTranslate; + double mfRotate; + double mfShearX; + + public: + B2DHomMatrixBufferedDecompose(const B2DHomMatrix& rB2DHomMatrix) + : maScale(), + maTranslate(), + mfRotate(0.0), + mfShearX(0.0) + { + rB2DHomMatrix.decompose(maScale, maTranslate, mfRotate, mfShearX); + } + + // data access + B2DHomMatrix getB2DHomMatrix() const + { + return createScaleShearXRotateTranslateB2DHomMatrix( + maScale, mfShearX, mfRotate, maTranslate); + } + + const B2DVector& getScale() const { return maScale; } + const B2DVector& getTranslate() const { return maTranslate; } + double getRotate() const { return mfRotate; } + double getShearX() const { return mfShearX; } + }; + } // end of namespace tools +} // end of namespace basegfx + +/////////////////////////////////////////////////////////////////////////////// + +namespace basegfx +{ + namespace tools + { + class B2DHomMatrixBufferedOnDemandDecompose + { + private: + B2DHomMatrix maB2DHomMatrix; + B2DVector maScale; + B2DVector maTranslate; + double mfRotate; + double mfShearX; + + // bitfield + unsigned mbDecomposed : 1; + + void impCheckDecompose() + { + if(!mbDecomposed) + { + maB2DHomMatrix.decompose(maScale, maTranslate, mfRotate, mfShearX); + mbDecomposed = true; + } + } + + public: + B2DHomMatrixBufferedOnDemandDecompose(const B2DHomMatrix& rB2DHomMatrix) + : maB2DHomMatrix(rB2DHomMatrix), + maScale(), + maTranslate(), + mfRotate(0.0), + mfShearX(0.0), + mbDecomposed(false) + { + } + + // data access + const B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; } + const B2DVector& getScale() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maScale; } + const B2DVector& getTranslate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maTranslate; } + double getRotate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfRotate; } + double getShearX() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfShearX; } + }; + } // end of namespace tools } // end of namespace basegfx /////////////////////////////////////////////////////////////////////////////// diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx index 5eff6b0b9cc1..47ff41b75e70 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx @@ -288,14 +288,6 @@ namespace basegfx */ B2DPolygon createPolygonFromCircle( const B2DPoint& rCenter, double fRadius ); - /** append a unit circle with one point and the control vectors to the given polygon - */ - void appendUnitCircleQuadrant(B2DPolygon& rPolygon, sal_uInt32 nQuadrant, bool bEndPoint); - - /** append a segment of unit circle with one point and the control vectors to the given polygon - */ - void appendUnitCircleQuadrantSegment(B2DPolygon& rPolygon, sal_uInt32 nQuadrant, double fStart, double fEnd, bool bEndPoint); - /** create a polygon which describes the unit circle and close it @param nStartQuadrant @@ -325,59 +317,6 @@ namespace basegfx */ B2DPolygon createPolygonFromEllipse( const B2DPoint& rCenter, double fRadiusX, double fRadiusY ); - /** append a unit circle with one point and the control vectors to the given polygon - */ - void appendUnitCircleQuadrant(B2DPolygon& rPolygon, sal_uInt32 nQuadrant); - - /** append a segment of unit circle with start point, the control vectors and end point to the given polygon - */ - void appendUnitCircleQuadrantSegment(B2DPolygon& rPolygon, sal_uInt32 nQuadrant, double fStart, double fEnd); - - /** Create an ellipse polygon with given radii. - - This method creates an ellipse approximation consisting of - four cubic bezier segments, which approximate the given - ellipse with an error of less than 0.5 percent. - - @param rCenter - Center point of the circle - - @param fRadiusX - Radius of the ellipse in X direction - - @param fRadiusY - Radius of the ellipse in Y direction - - @param fStart - Start angle where the ellipe segment starts in the range [0.0 .. 2PI[ - - @param fEnd - End angle where the ellipe segment ends in the range [0.0 .. 2PI[ - */ - B2DPolygon createPolygonFromEllipse( const B2DPoint& rCenter, double fRadiusX, double fRadiusY ); - - /** Create an ellipse polygon with given radii and the given angles, from start to end - - This method creates an ellipse approximation consisting of - four cubic bezier segments, which approximate the given - ellipse with an error of less than 0.5 percent. - - @param rCenter - Center point of the circle - - @param fRadiusX - Radius of the ellipse in X direction - - @param fRadiusY - Radius of the ellipse in Y direction - - @param fStart - Start angle where the ellipe segment starts in the range [0.0 .. 2PI[ - - @param fEnd - End angle where the ellipe segment ends in the range [0.0 .. 2PI[ - */ - /** Create an unit ellipse polygon with the given angles, from start to end */ B2DPolygon createPolygonFromEllipseSegment( const B2DPoint& rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd ); diff --git a/basegfx/source/matrix/b2dhommatrix.cxx b/basegfx/source/matrix/b2dhommatrix.cxx index 352113fa8ed3..a7777352effb 100644 --- a/basegfx/source/matrix/b2dhommatrix.cxx +++ b/basegfx/source/matrix/b2dhommatrix.cxx @@ -36,6 +36,9 @@ #include <hommatrixtemplate.hxx> #include <basegfx/tuple/b2dtuple.hxx> #include <basegfx/vector/b2dvector.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> + +/////////////////////////////////////////////////////////////////////////////// namespace basegfx { @@ -60,6 +63,17 @@ namespace basegfx { } + B2DHomMatrix::B2DHomMatrix(double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2) + : mpImpl( IdentityMatrix::get() ) // use common identity matrix, will be made unique with 1st set-call + { + mpImpl->set(0, 0, f_0x0); + mpImpl->set(0, 1, f_0x1); + mpImpl->set(0, 2, f_0x2); + mpImpl->set(1, 0, f_1x0); + mpImpl->set(1, 1, f_1x1); + mpImpl->set(1, 2, f_1x2); + } + B2DHomMatrix& B2DHomMatrix::operator=(const B2DHomMatrix& rMat) { mpImpl = rMat.mpImpl; @@ -81,6 +95,16 @@ namespace basegfx mpImpl->set(nRow, nColumn, fValue); } + void B2DHomMatrix::set3x2(double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2) + { + mpImpl->set(0, 0, f_0x0); + mpImpl->set(0, 1, f_0x1); + mpImpl->set(0, 2, f_0x2); + mpImpl->set(1, 0, f_1x0); + mpImpl->set(1, 1, f_1x1); + mpImpl->set(1, 2, f_1x2); + } + bool B2DHomMatrix::isLastLineDefault() const { return mpImpl->isLastLineDefault(); @@ -206,56 +230,9 @@ namespace basegfx if(!fTools::equalZero(fRadiant)) { double fSin(0.0); - double fCos(0.0); - - // is the rotation angle an approximate multiple of pi/2? - // If yes, force fSin/fCos to -1/0/1, to maintain - // orthogonality (which might also be advantageous for the - // other cases, but: for multiples of pi/2, the exact - // values _can_ be attained. It would be largely - // unintuitive, if a 180 degrees rotation would introduce - // slight roundoff errors, instead of exactly mirroring - // the coordinate system). - if( fTools::equalZero( fmod( fRadiant, F_PI2 ) ) ) - { - // determine quadrant - const sal_Int32 nQuad( - (4 + fround( 4/F_2PI*fmod( fRadiant, F_2PI ) )) % 4 ); - switch( nQuad ) - { - case 0: // -2pi,0,2pi - fSin = 0.0; - fCos = 1.0; - break; - - case 1: // -3/2pi,1/2pi - fSin = 1.0; - fCos = 0.0; - break; - - case 2: // -pi,pi - fSin = 0.0; - fCos = -1.0; - break; - - case 3: // -1/2pi,3/2pi - fSin = -1.0; - fCos = 0.0; - break; - - default: - OSL_ENSURE( false, - "B2DHomMatrix::rotate(): Impossible case reached" ); - } - } - else - { - // TODO(P1): Maybe use glibc's sincos here (though - // that's kinda non-portable...) - fSin = sin(fRadiant); - fCos = cos(fRadiant); - } + double fCos(1.0); + tools::createSinCosOrthogonal(fSin, fCos, fRadiant); Impl2DHomMatrix aRotMat; aRotMat.set(0, 0, fCos); @@ -474,104 +451,7 @@ namespace basegfx return true; } - -/* Old version: Used 3D decompose when shaer was involved and also a determinant test - (but only in that case). Keeping as comment since it also worked and to allow a - fallback in case the new version makes trouble somehow. Definitely missing in the 2nd - case is the sign correction for Y-Scale, this would need to be added following the above - pattern - - bool B2DHomMatrix::decompose(B2DTuple& rScale, B2DTuple& rTranslate, double& rRotate, double& rShearX) const - { - // when perspective is used, decompose is not made here - if(!mpImpl->isLastLineDefault()) - return false; - - // test for rotation and shear - if(fTools::equalZero(get(0, 1)) - && fTools::equalZero(get(1, 0))) - { - // no rotation and shear, direct value extraction - rRotate = rShearX = 0.0; - - // copy scale values - rScale.setX(get(0, 0)); - rScale.setY(get(1, 1)); - - // copy translation values - rTranslate.setX(get(0, 2)); - rTranslate.setY(get(1, 2)); - - return true; - } - else - { - // test if shear is zero. That's the case, if the unit vectors in the matrix - // are perpendicular -> scalar is zero - const ::basegfx::B2DVector aUnitVecX(get(0, 0), get(1, 0)); - const ::basegfx::B2DVector aUnitVecY(get(0, 1), get(1, 1)); - - if(fTools::equalZero(aUnitVecX.scalar(aUnitVecY))) - { - // no shear, direct value extraction - rShearX = 0.0; - - // calculate rotation - rShearX = 0.0; - rRotate = atan2(aUnitVecX.getY(), aUnitVecX.getX()); - - // calculate scale values - rScale.setX(aUnitVecX.getLength()); - rScale.setY(aUnitVecY.getLength()); - - // copy translation values - rTranslate.setX(get(0, 2)); - rTranslate.setY(get(1, 2)); - - return true; - } - else - { - // If determinant is zero, decomposition is not possible - if(0.0 == determinant()) - return false; - - // copy 2x2 matrix and translate vector to 3x3 matrix - ::basegfx::B3DHomMatrix a3DHomMat; - - a3DHomMat.set(0, 0, get(0, 0)); - a3DHomMat.set(0, 1, get(0, 1)); - a3DHomMat.set(1, 0, get(1, 0)); - a3DHomMat.set(1, 1, get(1, 1)); - a3DHomMat.set(0, 3, get(0, 2)); - a3DHomMat.set(1, 3, get(1, 2)); - - ::basegfx::B3DTuple r3DScale, r3DTranslate, r3DRotate, r3DShear; - - if(a3DHomMat.decompose(r3DScale, r3DTranslate, r3DRotate, r3DShear)) - { - // copy scale values - rScale.setX(r3DScale.getX()); - rScale.setY(r3DScale.getY()); - - // copy shear - rShearX = r3DShear.getX(); - - // copy rotate - rRotate = r3DRotate.getZ(); - - // copy translate - rTranslate.setX(r3DTranslate.getX()); - rTranslate.setY(r3DTranslate.getY()); - - return true; - } - } - } - - return false; - } */ - } // end of namespace basegfx +/////////////////////////////////////////////////////////////////////////////// // eof diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx index 59a1ff432fc7..2c71193f6352 100644 --- a/basegfx/source/matrix/b2dhommatrixtools.cxx +++ b/basegfx/source/matrix/b2dhommatrixtools.cxx @@ -38,6 +38,339 @@ namespace basegfx { + namespace tools + { + void createSinCosOrthogonal(double& o_rSin, double& o_rCos, double fRadiant) + { + if( fTools::equalZero( fmod( fRadiant, F_PI2 ) ) ) + { + // determine quadrant + const sal_Int32 nQuad( + (4 + fround( 4/F_2PI*fmod( fRadiant, F_2PI ) )) % 4 ); + switch( nQuad ) + { + case 0: // -2pi,0,2pi + o_rSin = 0.0; + o_rCos = 1.0; + break; + + case 1: // -3/2pi,1/2pi + o_rSin = 1.0; + o_rCos = 0.0; + break; + + case 2: // -pi,pi + o_rSin = 0.0; + o_rCos = -1.0; + break; + + case 3: // -1/2pi,3/2pi + o_rSin = -1.0; + o_rCos = 0.0; + break; + + default: + OSL_ENSURE( false, "createSinCos: Impossible case reached" ); + } + } + else + { + // TODO(P1): Maybe use glibc's sincos here (though + // that's kinda non-portable...) + o_rSin = sin(fRadiant); + o_rCos = cos(fRadiant); + } + } + + B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY) + { + B2DHomMatrix aRetval; + const double fOne(1.0); + + if(!fTools::equal(fScaleX, fOne)) + { + aRetval.set(0, 0, fScaleX); + } + + if(!fTools::equal(fScaleY, fOne)) + { + aRetval.set(1, 1, fScaleY); + } + + return aRetval; + } + + B2DHomMatrix createShearXB2DHomMatrix(double fShearX) + { + B2DHomMatrix aRetval; + + if(!fTools::equalZero(fShearX)) + { + aRetval.set(0, 1, fShearX); + } + + return aRetval; + } + + B2DHomMatrix createShearYB2DHomMatrix(double fShearY) + { + B2DHomMatrix aRetval; + + if(!fTools::equalZero(fShearY)) + { + aRetval.set(1, 0, fShearY); + } + + return aRetval; + } + + B2DHomMatrix createRotateB2DHomMatrix(double fRadiant) + { + B2DHomMatrix aRetval; + + if(!fTools::equalZero(fRadiant)) + { + double fSin(0.0); + double fCos(1.0); + + createSinCosOrthogonal(fSin, fCos, fRadiant); + aRetval.set(0, 0, fCos); + aRetval.set(1, 1, fCos); + aRetval.set(1, 0, fSin); + aRetval.set(0, 1, -fSin); + } + + return aRetval; + } + + B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY) + { + B2DHomMatrix aRetval; + + if(!(fTools::equalZero(fTranslateX) && fTools::equalZero(fTranslateY))) + { + aRetval.set(0, 2, fTranslateX); + aRetval.set(1, 2, fTranslateY); + } + + return aRetval; + } + + B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix( + double fScaleX, double fScaleY, + double fShearX, + double fRadiant, + double fTranslateX, double fTranslateY) + { + const double fOne(1.0); + + if(fTools::equal(fScaleX, fOne) && fTools::equal(fScaleY, fOne)) + { + /// no scale, take shortcut + return createShearXRotateTranslateB2DHomMatrix(fShearX, fRadiant, fTranslateX, fTranslateY); + } + else + { + /// scale used + if(fTools::equalZero(fShearX)) + { + /// no shear + if(fTools::equalZero(fRadiant)) + { + /// no rotate, take shortcut + return createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, fTranslateX, fTranslateY); + } + else + { + /// rotate and scale used, no shear + double fSin(0.0); + double fCos(1.0); + + createSinCosOrthogonal(fSin, fCos, fRadiant); + + B2DHomMatrix aRetval( + /* Row 0, Column 0 */ fCos * fScaleX, + /* Row 0, Column 1 */ fScaleY * -fSin, + /* Row 0, Column 2 */ fTranslateX, + /* Row 1, Column 0 */ fSin * fScaleX, + /* Row 1, Column 1 */ fScaleY * fCos, + /* Row 1, Column 2 */ fTranslateY); + + return aRetval; + } + } + else + { + /// scale and shear used + if(fTools::equalZero(fRadiant)) + { + /// scale and shear, but no rotate + B2DHomMatrix aRetval( + /* Row 0, Column 0 */ fScaleX, + /* Row 0, Column 1 */ fScaleY * fShearX, + /* Row 0, Column 2 */ fTranslateX, + /* Row 1, Column 0 */ 0.0, + /* Row 1, Column 1 */ fScaleY, + /* Row 1, Column 2 */ fTranslateY); + + return aRetval; + } + else + { + /// scale, shear and rotate used + double fSin(0.0); + double fCos(1.0); + + createSinCosOrthogonal(fSin, fCos, fRadiant); + + B2DHomMatrix aRetval( + /* Row 0, Column 0 */ fCos * fScaleX, + /* Row 0, Column 1 */ fScaleY * ((fCos * fShearX) - fSin), + /* Row 0, Column 2 */ fTranslateX, + /* Row 1, Column 0 */ fSin * fScaleX, + /* Row 1, Column 1 */ fScaleY * ((fSin * fShearX) + fCos), + /* Row 1, Column 2 */ fTranslateY); + + return aRetval; + } + } + } + } + + B2DHomMatrix createShearXRotateTranslateB2DHomMatrix( + double fShearX, + double fRadiant, + double fTranslateX, double fTranslateY) + { + if(fTools::equalZero(fShearX)) + { + /// no shear + if(fTools::equalZero(fRadiant)) + { + /// no shear, no rotate, take shortcut + return createTranslateB2DHomMatrix(fTranslateX, fTranslateY); + } + else + { + /// no shear, but rotate used + double fSin(0.0); + double fCos(1.0); + + createSinCosOrthogonal(fSin, fCos, fRadiant); + + B2DHomMatrix aRetval( + /* Row 0, Column 0 */ fCos, + /* Row 0, Column 1 */ -fSin, + /* Row 0, Column 2 */ fTranslateX, + /* Row 1, Column 0 */ fSin, + /* Row 1, Column 1 */ fCos, + /* Row 1, Column 2 */ fTranslateY); + + return aRetval; + } + } + else + { + /// shear used + if(fTools::equalZero(fRadiant)) + { + /// no rotate, but shear used + B2DHomMatrix aRetval( + /* Row 0, Column 0 */ 1.0, + /* Row 0, Column 1 */ fShearX, + /* Row 0, Column 2 */ fTranslateX, + /* Row 1, Column 0 */ 0.0, + /* Row 1, Column 1 */ 1.0, + /* Row 1, Column 2 */ fTranslateY); + + return aRetval; + } + else + { + /// shear and rotate used + double fSin(0.0); + double fCos(1.0); + + createSinCosOrthogonal(fSin, fCos, fRadiant); + + B2DHomMatrix aRetval( + /* Row 0, Column 0 */ fCos, + /* Row 0, Column 1 */ (fCos * fShearX) - fSin, + /* Row 0, Column 2 */ fTranslateX, + /* Row 1, Column 0 */ fSin, + /* Row 1, Column 1 */ (fSin * fShearX) + fCos, + /* Row 1, Column 2 */ fTranslateY); + + return aRetval; + } + } + } + + B2DHomMatrix createScaleTranslateB2DHomMatrix( + double fScaleX, double fScaleY, + double fTranslateX, double fTranslateY) + { + const double fOne(1.0); + + if(fTools::equal(fScaleX, fOne) && fTools::equal(fScaleY, fOne)) + { + /// no scale, take shortcut + return createTranslateB2DHomMatrix(fTranslateX, fTranslateY); + } + else + { + /// scale used + if(fTools::equalZero(fTranslateX) && fTools::equalZero(fTranslateY)) + { + /// no translate, but scale. + B2DHomMatrix aRetval; + + aRetval.set(0, 0, fScaleX); + aRetval.set(1, 1, fScaleY); + + return aRetval; + } + else + { + /// translate and scale + B2DHomMatrix aRetval( + /* Row 0, Column 0 */ fScaleX, + /* Row 0, Column 1 */ 0.0, + /* Row 0, Column 2 */ fTranslateX, + /* Row 1, Column 0 */ 0.0, + /* Row 1, Column 1 */ fScaleY, + /* Row 1, Column 2 */ fTranslateY); + + return aRetval; + } + } + } + + B2DHomMatrix createRotateAroundPoint( + double fPointX, double fPointY, + double fRadiant) + { + B2DHomMatrix aRetval; + + if(!fTools::equalZero(fRadiant)) + { + double fSin(0.0); + double fCos(1.0); + + createSinCosOrthogonal(fSin, fCos, fRadiant); + + aRetval.set3x2( + /* Row 0, Column 0 */ fCos, + /* Row 0, Column 1 */ -fSin, + /* Row 0, Column 2 */ (fPointX * (1.0 - fCos)) + (fSin * fPointY), + /* Row 1, Column 0 */ fSin, + /* Row 1, Column 1 */ fCos, + /* Row 1, Column 2 */ (fPointY * (1.0 - fCos)) - (fSin * fPointX)); + } + + return aRetval; + } + } // end of namespace tools } // end of namespace basegfx /////////////////////////////////////////////////////////////////////////////// diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index 1a9264ab769e..c22b5ea94011 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -40,6 +40,7 @@ #include <basegfx/range/b2drange.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/curve/b2dcubicbezier.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -85,11 +86,9 @@ namespace basegfx // get size of the arrow const B2DRange aArrowSize(getRange(rArrow)); - // build ArrowTransform - B2DHomMatrix aArrowTransform; - - // center in X, align with axis in Y - aArrowTransform.translate(-aArrowSize.getCenter().getX(), -aArrowSize.getMinimum().getY()); + // build ArrowTransform; center in X, align with axis in Y + B2DHomMatrix aArrowTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aArrowSize.getCenter().getX(), -aArrowSize.getMinimum().getY())); // scale to target size const double fArrowScale(fWidth / (aArrowSize.getRange().getX())); diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index f0d325942c07..87e44ed3d063 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -40,6 +40,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/curve/b2dcubicbezier.hxx> #include <basegfx/tools/rectcliptools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -361,11 +362,10 @@ namespace basegfx else if(rCandidate.count()) { const B2DVector aEdge(rPointB - rPointA); - B2DHomMatrix aMatrixTransform; B2DPolygon aCandidate(rCandidate); // translate and rotate polygon so that given edge is on x axis - aMatrixTransform.translate(-rPointA.getX(), -rPointA.getY()); + B2DHomMatrix aMatrixTransform(basegfx::tools::createTranslateB2DHomMatrix(-rPointA.getX(), -rPointA.getY())); aMatrixTransform.rotate(-atan2(aEdge.getY(), aEdge.getX())); aCandidate.transform(aMatrixTransform); @@ -395,11 +395,10 @@ namespace basegfx else if(rCandidate.count()) { const B2DVector aEdge(rPointB - rPointA); - B2DHomMatrix aMatrixTransform; B2DPolyPolygon aCandidate(rCandidate); // translate and rotate polygon so that given edge is on x axis - aMatrixTransform.translate(-rPointA.getX(), -rPointA.getY()); + B2DHomMatrix aMatrixTransform(basegfx::tools::createTranslateB2DHomMatrix(-rPointA.getX(), -rPointA.getY())); aMatrixTransform.rotate(-atan2(aEdge.getY(), aEdge.getX())); aCandidate.transform(aMatrixTransform); diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 7485387c6cb9..d62462b8c097 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -33,7 +33,6 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <osl/diagnose.h> #include <rtl/math.hxx> - #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/range/b2drange.hxx> @@ -43,6 +42,8 @@ #include <basegfx/matrix/b3dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/curve/b2dbeziertools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <osl/mutex.hxx> #include <numeric> #include <limits> @@ -54,6 +55,7 @@ #ifdef DBG_UTIL static double fAngleBoundStartValue = ANGLE_BOUND_START_VALUE; #endif +#define STEPSPERQUARTER (3) ////////////////////////////////////////////////////////////////////////////// @@ -1840,145 +1842,106 @@ namespace basegfx return createPolygonFromEllipse( rCenter, fRadius, fRadius ); } - void appendUnitCircleQuadrant(B2DPolygon& rPolygon, sal_uInt32 nQuadrant) + B2DPolygon impCreateUnitCircle(sal_uInt32 nStartQuadrant) { - const double fZero(0.0); - const double fOne(1.0); + B2DPolygon aUnitCircle; const double fKappa((M_SQRT2 - 1.0) * 4.0 / 3.0); + const double fScaledKappa(fKappa * (1.0 / STEPSPERQUARTER)); + const B2DHomMatrix aRotateMatrix(createRotateB2DHomMatrix(F_PI2 / STEPSPERQUARTER)); + + B2DPoint aPoint(1.0, 0.0); + B2DPoint aForward(1.0, fScaledKappa); + B2DPoint aBackward(1.0, -fScaledKappa); - // create closed unit-circle with 4 segments - switch(nQuadrant) + if(0 != nStartQuadrant) { - case 0 : // first quadrant - { - rPolygon.append(B2DPoint(fOne, fZero)); - rPolygon.appendBezierSegment(B2DPoint(fOne, fKappa), B2DPoint(fKappa, fOne), B2DPoint(fZero, fOne)); - break; - } - case 1 : // second quadrant - { - rPolygon.append(B2DPoint(fZero, fOne)); - rPolygon.appendBezierSegment(B2DPoint(-fKappa, fOne), B2DPoint(-fOne, fKappa), B2DPoint(-fOne, fZero)); - break; - } - case 2 : // third quadrant - { - rPolygon.append(B2DPoint(-fOne, fZero)); - rPolygon.appendBezierSegment(B2DPoint(-fOne, -fKappa), B2DPoint(-fKappa, -fOne), B2DPoint(fZero, -fOne)); - break; - } - default : // last quadrant - { - rPolygon.append(B2DPoint(fZero, -fOne)); - rPolygon.appendBezierSegment(B2DPoint(fKappa, -fOne), B2DPoint(fOne, -fKappa), B2DPoint(fOne, fZero)); - break; - } + const B2DHomMatrix aQuadrantMatrix(createRotateB2DHomMatrix(F_PI2 * (nStartQuadrant % 4))); + aPoint *= aQuadrantMatrix; + aBackward *= aQuadrantMatrix; + aForward *= aQuadrantMatrix; } - } - B2DPolygon createPolygonFromUnitCircle(sal_uInt32 nStartQuadrant) - { - B2DPolygon aRetval; + aUnitCircle.append(aPoint); - // create unit-circle with all 4 segments, close it - appendUnitCircleQuadrant(aRetval, nStartQuadrant % 4); nStartQuadrant++; - appendUnitCircleQuadrant(aRetval, nStartQuadrant % 4); nStartQuadrant++; - appendUnitCircleQuadrant(aRetval, nStartQuadrant % 4); nStartQuadrant++; - appendUnitCircleQuadrant(aRetval, nStartQuadrant % 4); nStartQuadrant++; - aRetval.setClosed(true); + for(sal_uInt32 a(0); a < STEPSPERQUARTER * 4; a++) + { + aPoint *= aRotateMatrix; + aBackward *= aRotateMatrix; + aUnitCircle.appendBezierSegment(aForward, aBackward, aPoint); + aForward *= aRotateMatrix; + } - // remove double points between segments created by segmented creation - aRetval.removeDoublePoints(); + aUnitCircle.setClosed(true); + aUnitCircle.removeDoublePoints(); - return aRetval; + return aUnitCircle; } - B2DPolygon createPolygonFromEllipse( const B2DPoint& rCenter, double fRadiusX, double fRadiusY ) + B2DPolygon createPolygonFromUnitCircle(sal_uInt32 nStartQuadrant) { - const double fOne(1.0); - B2DPolygon aRetval(createPolygonFromUnitCircle()); - - // transformation necessary? - const sal_Bool bScale(!fTools::equal(fRadiusX, fOne) || !fTools::equal(fRadiusY, fOne)); - const sal_Bool bTranslate(!rCenter.equalZero()); - - if(bScale || bTranslate) + switch(nStartQuadrant % 4) { - B2DHomMatrix aMatrix; - - if(bScale) - { - aMatrix.scale(fRadiusX, fRadiusY); - } - - if(bTranslate) + case 1 : { - aMatrix.translate(rCenter.getX(), rCenter.getY()); - } - - aRetval.transform(aMatrix); - } - - return aRetval; - } - - void appendUnitCircleQuadrantSegment(B2DPolygon& rPolygon, sal_uInt32 nQuadrant, double fStart, double fEnd) - { - OSL_ENSURE(fStart >= 0.0 && fStart <= 1.0, "appendUnitCircleQuadrantSegment: Access out of range (!)"); - OSL_ENSURE(fEnd >= 0.0 && fEnd <= 1.0, "appendUnitCircleQuadrantSegment: Access out of range (!)"); - OSL_ENSURE(fEnd >= fStart, "appendUnitCircleQuadrantSegment: Access out of range (!)"); - const double fOne(1.0); - const bool bStartIsZero(fTools::equalZero(fStart)); - const bool bEndIsOne(fTools::equal(fEnd, fOne)); + static B2DPolygon aUnitCircleStartQuadrantOne; - if(bStartIsZero && bEndIsOne) - { - // add completely - appendUnitCircleQuadrant(rPolygon, nQuadrant); - } - else - { - // split and add - B2DPolygon aQuadrant; - appendUnitCircleQuadrant(aQuadrant, nQuadrant); - const bool bStartEndEqual(fTools::equal(fStart, fEnd)); + if(!aUnitCircleStartQuadrantOne.count()) + { + ::osl::Mutex m_mutex; + aUnitCircleStartQuadrantOne = impCreateUnitCircle(1); + } - if(bStartEndEqual) + return aUnitCircleStartQuadrantOne; + } + case 2 : { - if(bStartIsZero) + static B2DPolygon aUnitCircleStartQuadrantTwo; + + if(!aUnitCircleStartQuadrantTwo.count()) { - // both zero, add start point - rPolygon.append(aQuadrant.getB2DPoint(0L)); + ::osl::Mutex m_mutex; + aUnitCircleStartQuadrantTwo = impCreateUnitCircle(2); } - else if(bEndIsOne) + + return aUnitCircleStartQuadrantTwo; + } + case 3 : + { + static B2DPolygon aUnitCircleStartQuadrantThree; + + if(!aUnitCircleStartQuadrantThree.count()) { - // both one, add end point - rPolygon.append(aQuadrant.getB2DPoint(1L)); + ::osl::Mutex m_mutex; + aUnitCircleStartQuadrantThree = impCreateUnitCircle(3); } - else - { - // both equal but not zero, add split point - B2DCubicBezier aCubicBezier( - aQuadrant.getB2DPoint(0L), aQuadrant.getNextControlPoint(0L), - aQuadrant.getPrevControlPoint(1L), aQuadrant.getB2DPoint(1L)); - aCubicBezier.split(fStart, &aCubicBezier, 0); - rPolygon.append(aCubicBezier.getEndPoint()); - } + return aUnitCircleStartQuadrantThree; } - else + default : // case 0 : { - B2DCubicBezier aCubicBezier( - aQuadrant.getB2DPoint(0L), aQuadrant.getNextControlPoint(0L), - aQuadrant.getPrevControlPoint(1L), aQuadrant.getB2DPoint(1L)); + static B2DPolygon aUnitCircleStartQuadrantZero; + + if(!aUnitCircleStartQuadrantZero.count()) + { + ::osl::Mutex m_mutex; + aUnitCircleStartQuadrantZero = impCreateUnitCircle(0); + } - aCubicBezier = aCubicBezier.snippet(fStart, fEnd); - rPolygon.append(aCubicBezier.getStartPoint()); - rPolygon.appendBezierSegment(aCubicBezier.getControlPointA(), aCubicBezier.getControlPointB(), aCubicBezier.getEndPoint()); + return aUnitCircleStartQuadrantZero; } } } + B2DPolygon createPolygonFromEllipse( const B2DPoint& rCenter, double fRadiusX, double fRadiusY ) + { + B2DPolygon aRetval(createPolygonFromUnitCircle()); + const B2DHomMatrix aMatrix(createScaleTranslateB2DHomMatrix(fRadiusX, fRadiusY, rCenter.getX(), rCenter.getY())); + + aRetval.transform(aMatrix); + + return aRetval; + } + B2DPolygon createPolygonFromUnitEllipseSegment( double fStart, double fEnd ) { B2DPolygon aRetval; @@ -2005,49 +1968,74 @@ namespace basegfx fEnd = 0.0; } - const sal_uInt32 nQuadrantStart(sal_uInt32(fStart / F_PI2) % 4L); - const sal_uInt32 nQuadrantEnd(sal_uInt32(fEnd / F_PI2) % 4L); - sal_uInt32 nCurrentQuadrant(nQuadrantStart); - bool bStartDone(false); - bool bEndDone(false); - - do + if(fTools::equal(fStart, fEnd)) { - if(!bStartDone && nQuadrantStart == nCurrentQuadrant) - { - if(nQuadrantStart == nQuadrantEnd && fTools::moreOrEqual(fEnd, fStart)) - { - // both in one quadrant and defining the complete segment, create start to end - double fSplitOffsetStart((fStart - (nCurrentQuadrant * F_PI2)) / F_PI2); - double fSplitOffsetEnd((fEnd - (nCurrentQuadrant * F_PI2)) / F_PI2); - appendUnitCircleQuadrantSegment(aRetval, nCurrentQuadrant, fSplitOffsetStart, fSplitOffsetEnd); - bStartDone = bEndDone = true; - } - else - { - // create start to quadrant end - const double fSplitOffsetStart((fStart - (nCurrentQuadrant * F_PI2)) / F_PI2); - appendUnitCircleQuadrantSegment(aRetval, nCurrentQuadrant, fSplitOffsetStart, 1.0); - bStartDone = true; - } - } - else if(!bEndDone && nQuadrantEnd == nCurrentQuadrant) + // same start and end angle, add single point + aRetval.append(B2DPoint(cos(fStart), sin(fStart))); + } + else + { + const sal_uInt32 nSegments(STEPSPERQUARTER * 4); + const double fAnglePerSegment(F_PI2 / STEPSPERQUARTER); + const sal_uInt32 nStartSegment(sal_uInt32(fStart / fAnglePerSegment) % nSegments); + const sal_uInt32 nEndSegment(sal_uInt32(fEnd / fAnglePerSegment) % nSegments); + const double fKappa((M_SQRT2 - 1.0) * 4.0 / 3.0); + const double fScaledKappa(fKappa * (1.0 / STEPSPERQUARTER)); + + B2DPoint aSegStart(cos(fStart), sin(fStart)); + aRetval.append(aSegStart); + + if(nStartSegment == nEndSegment && fTools::more(fEnd, fStart)) { - // create quadrant start to end - const double fSplitOffsetEnd((fEnd - (nCurrentQuadrant * F_PI2)) / F_PI2); - appendUnitCircleQuadrantSegment(aRetval, nCurrentQuadrant, 0.0, fSplitOffsetEnd); - bEndDone = true; + // start and end in one sector and in the right order, create in one segment + const B2DPoint aSegEnd(cos(fEnd), sin(fEnd)); + const double fFactor(fScaledKappa * ((fEnd - fStart) / fAnglePerSegment)); + + aRetval.appendBezierSegment( + aSegStart + (B2DPoint(-aSegStart.getY(), aSegStart.getX()) * fFactor), + aSegEnd - (B2DPoint(-aSegEnd.getY(), aSegEnd.getX()) * fFactor), + aSegEnd); } else { - // add quadrant completely - appendUnitCircleQuadrant(aRetval, nCurrentQuadrant); - } + double fSegEndRad((nStartSegment + 1) * fAnglePerSegment); + double fFactor(fScaledKappa * ((fSegEndRad - fStart) / fAnglePerSegment)); + B2DPoint aSegEnd(cos(fSegEndRad), sin(fSegEndRad)); - // next step - nCurrentQuadrant = (nCurrentQuadrant + 1L) % 4L; + aRetval.appendBezierSegment( + aSegStart + (B2DPoint(-aSegStart.getY(), aSegStart.getX()) * fFactor), + aSegEnd - (B2DPoint(-aSegEnd.getY(), aSegEnd.getX()) * fFactor), + aSegEnd); + + sal_uInt32 nSegment((nStartSegment + 1) % nSegments); + aSegStart = aSegEnd; + + while(nSegment != nEndSegment) + { + // No end in this sector, add full sector. + fSegEndRad = (nSegment + 1) * fAnglePerSegment; + aSegEnd = B2DPoint(cos(fSegEndRad), sin(fSegEndRad)); + + aRetval.appendBezierSegment( + aSegStart + (B2DPoint(-aSegStart.getY(), aSegStart.getX()) * fScaledKappa), + aSegEnd - (B2DPoint(-aSegEnd.getY(), aSegEnd.getX()) * fScaledKappa), + aSegEnd); + + nSegment = (nSegment + 1) % nSegments; + aSegStart = aSegEnd; + } + + // End in this sector + const double fSegStartRad(nSegment * fAnglePerSegment); + fFactor = fScaledKappa * ((fEnd - fSegStartRad) / fAnglePerSegment); + aSegEnd = B2DPoint(cos(fEnd), sin(fEnd)); + + aRetval.appendBezierSegment( + aSegStart + (B2DPoint(-aSegStart.getY(), aSegStart.getX()) * fFactor), + aSegEnd - (B2DPoint(-aSegEnd.getY(), aSegEnd.getX()) * fFactor), + aSegEnd); + } } - while(!(bStartDone && bEndDone)); // remove double points between segments created by segmented creation aRetval.removeDoublePoints(); @@ -2058,28 +2046,9 @@ namespace basegfx B2DPolygon createPolygonFromEllipseSegment( const B2DPoint& rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd ) { B2DPolygon aRetval(createPolygonFromUnitEllipseSegment(fStart, fEnd)); + const B2DHomMatrix aMatrix(createScaleTranslateB2DHomMatrix(fRadiusX, fRadiusY, rCenter.getX(), rCenter.getY())); - // transformation necessary? - const double fOne(1.0); - const sal_Bool bScale(!fTools::equal(fRadiusX, fOne) || !fTools::equal(fRadiusY, fOne)); - const sal_Bool bTranslate(!rCenter.equalZero()); - - if(bScale || bTranslate) - { - B2DHomMatrix aMatrix; - - if(bScale) - { - aMatrix.scale(fRadiusX, fRadiusY); - } - - if(bTranslate) - { - aMatrix.translate(rCenter.getX(), rCenter.getY()); - } - - aRetval.transform(aMatrix); - } + aRetval.transform(aMatrix); return aRetval; } @@ -2709,11 +2678,7 @@ namespace basegfx if(nPointCount) { - B2DHomMatrix aMatrix; - - aMatrix.translate(-rCenter.getX(), -rCenter.getY()); - aMatrix.rotate(fAngle); - aMatrix.translate(rCenter.getX(), rCenter.getY()); + const B2DHomMatrix aMatrix(basegfx::tools::createRotateAroundPoint(rCenter, fAngle)); aRetval.transform(aMatrix); } diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index 2247c237d90f..e38ec3809fb1 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -36,6 +36,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <rtl/ustring.hxx> #include <rtl/math.hxx> @@ -705,7 +706,7 @@ namespace basegfx // |y1'| = |-sin phi cos phi| |(y1 - y2)/2| const B2DPoint p1(nLastX, nLastY); const B2DPoint p2(nX, nY); - B2DHomMatrix aTransform; aTransform.rotate(-fPhi*M_PI/180); + B2DHomMatrix aTransform(basegfx::tools::createRotateB2DHomMatrix(-fPhi*M_PI/180)); const B2DPoint p1_prime( aTransform * B2DPoint(((p1-p2)/2.0)) ); @@ -797,8 +798,7 @@ namespace basegfx fTheta1, fTheta2 )); // transform ellipse by rotation & move to final center - aTransform.identity(); - aTransform.scale(fRX,fRY); + aTransform = basegfx::tools::createScaleB2DHomMatrix(fRX, fRY); aTransform.translate(aCenter_prime.getX(), aCenter_prime.getY()); aTransform.rotate(fPhi*M_PI/180); diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index 9e78039cd590..51989899ebf4 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -32,9 +32,9 @@ #include "precompiled_basegfx.hxx" #include <basegfx/tools/gradienttools.hxx> - #include <basegfx/point/b2dpoint.hxx> #include <basegfx/range/b2drange.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> namespace basegfx { @@ -79,9 +79,8 @@ namespace basegfx B2DPoint aCenter(0.5, 0.5); aCenter *= o_rGradientInfo.maTextureTransform; - o_rGradientInfo.maTextureTransform.translate(-aCenter.getX(), -aCenter.getY()); - o_rGradientInfo.maTextureTransform.rotate(fAngle); - o_rGradientInfo.maTextureTransform.translate(aCenter.getX(), aCenter.getY()); + o_rGradientInfo.maTextureTransform = basegfx::tools::createRotateAroundPoint(aCenter, fAngle) + * o_rGradientInfo.maTextureTransform; } // add object translate @@ -158,9 +157,8 @@ namespace basegfx B2DPoint aCenter(0.5, 0.5); aCenter *= o_rGradientInfo.maTextureTransform; - o_rGradientInfo.maTextureTransform.translate(-aCenter.getX(), -aCenter.getY()); - o_rGradientInfo.maTextureTransform.rotate(fAngle); - o_rGradientInfo.maTextureTransform.translate(aCenter.getX(), aCenter.getY()); + o_rGradientInfo.maTextureTransform = basegfx::tools::createRotateAroundPoint(aCenter, fAngle) + * o_rGradientInfo.maTextureTransform; } } @@ -232,9 +230,8 @@ namespace basegfx B2DPoint aCenter(0.5, 0.5); aCenter *= o_rGradientInfo.maTextureTransform; - o_rGradientInfo.maTextureTransform.translate(-aCenter.getX(), -aCenter.getY()); - o_rGradientInfo.maTextureTransform.rotate(fAngle); - o_rGradientInfo.maTextureTransform.translate(aCenter.getX(), aCenter.getY()); + o_rGradientInfo.maTextureTransform = basegfx::tools::createRotateAroundPoint(aCenter, fAngle) + * o_rGradientInfo.maTextureTransform; } // add defined offsets after rotation diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index 6d8fcd83edb0..05dbe5b1c823 100755 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -44,8 +44,8 @@ #include <basegfx/tools/canvastools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> - #include <basegfx/tools/unopolypolygon.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> using namespace ::com::sun::star; @@ -138,9 +138,7 @@ namespace unotools if( !aOffset.equalZero() ) { - B2DHomMatrix aTranslate; - aTranslate.translate( aOffset.getX(), aOffset.getY() ); - + const B2DHomMatrix aTranslate(tools::createTranslateB2DHomMatrix(aOffset)); aSrcPoly.transform( aTranslate ); } diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx index ab6715467dba..1bd15702e143 100644 --- a/basegfx/test/basegfx2d.cxx +++ b/basegfx/test/basegfx2d.cxx @@ -484,8 +484,13 @@ public: } while ( nIndex >= 0 ); + // Adapted number of spaces to 50 and 67 because of the new circle construction + // methods which produce more points and thus more spaces, too. Use both since + // depending on float precision and the getContinuity() implemetation using + // fTools::equal, linux and mac produce more 'C' than 'S' statements, while WIN32 + // uses more 'S' statements (as it should be for circles) CPPUNIT_ASSERT_MESSAGE("exporting to circle does not produce the expected number of coordinates", - nCount==18); + nCount==67 || nCount==50); const B2DPolygon aRect( tools::createPolygonFromRect( B2DRange(0.0,0.0,4000.0,4000.0) )); diff --git a/berkeleydb/makefile.mk b/berkeleydb/makefile.mk index bc5df6964bc5..c6b50c6001cf 100644 --- a/berkeleydb/makefile.mk +++ b/berkeleydb/makefile.mk @@ -110,13 +110,7 @@ CXXFLAGS+:=$(ARCH_FLAGS) BUILD_DIR=$(CONFIGURE_DIR) BUILD_DIR_OUT=$(CONFIGURE_DIR) - -.IF "$(OS)"=="IRIX" -CONFIGURE_ACTION= $(CONFIG_SHELL) ..$/dist$/configure -BUILD_ACTION=gmake -.ELSE BUILD_ACTION=make -.ENDIF OUT2LIB=$(BUILD_DIR)$/.libs$/libdb*$(DLLPOST) OUT2INC= \ diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx index 1aca0f480b6a..e901a110213f 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx @@ -61,7 +61,9 @@ static typelib_TypeClass cpp2uno_call( sal_Int64 * pRegisterReturn /* space for register return */ ) { int ng = 0; //number of gpr registers used +#ifndef __NO_FPRS__ int nf = 0; //number of fpr regsiters used +#endif void ** pCppStack; //temporary stack pointer // gpreg: [ret *], this, [gpr params] @@ -123,11 +125,23 @@ static typelib_TypeClass cpp2uno_call( { case typelib_TypeClass_DOUBLE: +#ifndef __NO_FPRS__ if (nf < 8) { pCppArgs[nPos] = fpreg; pUnoArgs[nPos] = fpreg; nf++; fpreg += 2; +#else + if (ng & 1) { + ng++; + gpreg++; + } + if (ng < 8) { + pCppArgs[nPos] = gpreg; + pUnoArgs[nPos] = gpreg; + ng += 2; + gpreg += 2; +#endif } else { if (((long)ovrflw) & 4) ovrflw++; pCppArgs[nPos] = ovrflw; @@ -139,6 +153,7 @@ static typelib_TypeClass cpp2uno_call( case typelib_TypeClass_FLOAT: // fpreg are all double values so need to // modify fpreg to be a single word float value +#ifndef __NO_FPRS__ if (nf < 8) { float tmp = (float) (*((double *)fpreg)); (*((float *) fpreg)) = tmp; @@ -146,6 +161,13 @@ static typelib_TypeClass cpp2uno_call( pUnoArgs[nPos] = fpreg; nf++; fpreg += 2; +#else + if (ng < 8) { + pCppArgs[nPos] = gpreg; + pUnoArgs[nPos] = gpreg; + ng++; + gpreg++; +#endif } else { #if 0 /* abi is not being followed correctly */ if (((long)ovrflw) & 4) ovrflw++; @@ -164,11 +186,11 @@ static typelib_TypeClass cpp2uno_call( case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: - if (ng < 7) { - if (ng & 1) { - ng++; - gpreg++; - } + if (ng & 1) { + ng++; + gpreg++; + } + if (ng < 8) { pCppArgs[nPos] = gpreg; pUnoArgs[nPos] = gpreg; ng += 2; @@ -488,10 +510,12 @@ static typelib_TypeClass cpp_mediate( static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpregptr, void** fpregptr, void** ovrflw) { sal_Int32 gpreg[8]; - double fpreg[8]; - memcpy( gpreg, gpregptr, 32); + +#ifndef __NO_FPRS__ + double fpreg[8]; memcpy( fpreg, fpregptr, 64); +#endif volatile long nRegReturn[2]; @@ -499,10 +523,14 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg // fprintf(stderr,"in cpp_vtable_call nVtableOffset is %x\n",nVtableOffset); // fflush(stderr); - sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False; - typelib_TypeClass aType = - cpp_mediate( nFunctionIndex, nVtableOffset, (void**)gpreg, (void**)fpreg, ovrflw, (sal_Int64*)nRegReturn ); + cpp_mediate( nFunctionIndex, nVtableOffset, (void**)gpreg, +#ifndef __NO_FPRS__ + (void**)fpreg, +#else + NULL, +#endif + ovrflw, (sal_Int64*)nRegReturn ); switch( aType ) { @@ -524,13 +552,25 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg break; case typelib_TypeClass_FLOAT: +#ifndef __NO_FPRS__ __asm__( "lfs 1,%0\n\t" : : "m" (*((float*)nRegReturn)) ); + #else + __asm__( "lwz 3,%0\n\t" : : + "m"(nRegReturn[0]) ); +#endif break; case typelib_TypeClass_DOUBLE: +#ifndef __NO_FPRS__ __asm__( "lfd 1,%0\n\t" : : "m" (*((double*)nRegReturn)) ); +#else + __asm__( "lwz 3,%0\n\t" : : + "m"(nRegReturn[0]) ); + __asm__( "lwz 4,%0\n\t" : : + "m"(nRegReturn[1]) ); +#endif break; case typelib_TypeClass_HYPER: @@ -577,6 +617,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal // # next save fpr 1 to fpr 8 (aligned to 8) + // if dedicated floating point registers are used // stfd f1,-2016(r1) // stfd f2,-2008(r1) // stfd f3,-2000(r1) @@ -604,6 +645,10 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal // #now load up the pointer to the saved fpr registers // addi r6,r1,-2016 + // if no dedicated floating point registers are used than we have NULL + // pointer there + // li r6, 0 + // // #now load up the pointer to the overflow call stack // addi r7,r1,8 @@ -617,6 +662,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal * p++ = 0x9101f814; * p++ = 0x9121f818; * p++ = 0x9141f81c; +#ifndef __NO_FPRS__ * p++ = 0xd821f820; * p++ = 0xd841f828; * p++ = 0xd861f830; @@ -625,6 +671,17 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal * p++ = 0xd8c1f848; * p++ = 0xd8e1f850; * p++ = 0xd901f858; +#else + /* these nops could be replaced with a smaller codeSnippetSize - 8 * 4 */ + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; +#endif * p++ = 0x3c600000 | (((unsigned long)cpp_vtable_call) >> 16); * p++ = 0x60630000 | (((unsigned long)cpp_vtable_call) & 0x0000FFFF); * p++ = 0x7c6903a6; @@ -633,7 +690,11 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal * p++ = 0x3c800000 | (((unsigned long)vtableOffset) >> 16); * p++ = 0x60840000 | (((unsigned long)vtableOffset) & 0x0000FFFF); * p++ = 0x38a1f800; +#ifndef __NO_FPRS__ * p++ = 0x38c1f820; +#else + * p++ = 0x38c00000; +#endif * p++ = 0x38e10008; * p++ = 0x4e800420; return (code + codeSnippetSize); diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx index 28ad7dc83ed7..adb10dae24c7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx @@ -137,8 +137,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; MutexGuard guard( m_mutex ); - t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); - if (iFind == m_rttis.end()) + t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); + if (iRttiFind == m_rttis.end()) { // RTTI symbol OStringBuffer buf( 64 ); @@ -202,7 +202,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } else { - rtti = iFind->second; + rtti = iRttiFind->second; } return rtti; diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx index 2a8626733f24..8c527df2d48c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx @@ -74,12 +74,14 @@ static void callVirtualMethod( void (*ptr)(); int gpr[8]; // storage for gpregisters, map to r3-r10 int off; // offset used to find function +#ifndef __NO_FPRS__ double fpr[8]; // storage for fpregisters, map to f1-f8 - int n; // number of gprs mapped so far int f; // number of fprs mapped so far + double dret; // temporary function return values +#endif + int n; // number of gprs mapped so far long *p; // pointer to parameter overflow area int c; // character of parameter type being decoded - double dret; // temporary function return values int iret, iret2; // Because of the Power PC calling conventions we could be passing @@ -93,7 +95,7 @@ static void callVirtualMethod( // Note: could require up to 2*nStackLongs words of parameter stack area // if the call has many float parameters (i.e. floats take up only 1 - // word on the stack but take 2 words in parameter area in the + // word on the stack but double takes 2 words in parameter area in the // stack frame . // Update! floats on the outgoing parameter stack only take up 1 word @@ -119,7 +121,9 @@ static void callVirtualMethod( // now begin to load the C++ function arguments into storage n = 0; +#ifndef __NO_FPRS__ f = 0; +#endif // now we need to parse the entire signature string */ // until we get the END indicator */ @@ -143,8 +147,16 @@ static void callVirtualMethod( c = *pPT; switch (c) { case 'D': /* type is double */ +#ifndef __NO_FPRS__ if (f < 8) { fpr[f++] = *((double *)pStackLongs); /* store in register */ +#else + if (n & 1) + n++; + if (n < 8) { + gpr[n++] = *pStackLongs; + gpr[n++] = *(pStackLongs+1); +#endif } else { if (((long) p) & 4) p++; @@ -163,8 +175,13 @@ static void callVirtualMethod( store floats as a *single* word on outgoing parameter stack to match what gcc actually does */ +#ifndef __NO_FPRS__ if (f < 8) { fpr[f++] = *((float *)pStackLongs); +#else + if (n < 8) { + gpr[n++] = *pStackLongs; +#endif } else { #if 0 /* if abi were followed */ if (((long) p) & 4) @@ -243,6 +260,7 @@ static void callVirtualMethod( "lwz 8, 20(%0)\n\t" "lwz 9, 24(%0)\n\t" "lwz 10, 28(%0)\n\t" +#ifndef __NO_FPRS__ "lfd 1, 0(%1)\n\t" "lfd 2, 8(%1)\n\t" "lfd 3, 16(%1)\n\t" @@ -252,16 +270,24 @@ static void callVirtualMethod( "lfd 7, 48(%1)\n\t" "lfd 8, 56(%1)\n\t" : : "r" (gpr), "r" (fpr) +#else + : : "r" (gpr) +#endif : "0", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ); (*ptr)(); __asm__ __volatile__ ( - "mr %1, 3\n\t" - "mr %2, 4\n\t" - "fmr %0, 1\n\t" - : "=f" (dret), "=r" (iret), "=r" (iret2) : ); + "mr %0, 3\n\t" + "mr %1, 4\n\t" +#ifndef __NO_FPRS__ + "fmr %2, 1\n\t" + : "=r" (iret), "=r" (iret2), "=f" (dret) +#else + : "=r" (iret), "=r" (iret2) +#endif + : ); switch( eReturnType ) { @@ -284,10 +310,21 @@ static void callVirtualMethod( *(unsigned char*)pRegisterReturn = (unsigned char)iret; break; case typelib_TypeClass_FLOAT: +#ifndef __NO_FPRS__ *(float*)pRegisterReturn = (float)dret; +#else + ((unsigned int*)pRegisterReturn)[0] = iret; +#endif break; case typelib_TypeClass_DOUBLE: +#ifndef __NO_FPRS__ *(double*)pRegisterReturn = dret; +#else + ((unsigned int*)pRegisterReturn)[0] = iret; + ((unsigned int*)pRegisterReturn)[1] = iret2; +#endif + break; + default: break; } } @@ -399,6 +436,8 @@ static void cpp_call( case typelib_TypeClass_UNSIGNED_HYPER: *pPT++ = 'H'; pCppStack += sizeof(sal_Int32); // extra long + default: + break; } // no longer needed @@ -518,7 +557,6 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); - typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; switch (pMemberDescr->eTypeClass) { diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index c1e938446e77..fc5a9af1ac5c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -121,16 +121,14 @@ static typelib_TypeClass cpp2uno_call( for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; - typelib_TypeDescription * pParamTypeDescr = 0; - TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); int nUsedGPR = 0; int nUsedSSE = 0; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 bool bFitsRegisters = #endif x86_64::examine_argument( rParam.pTypeRef, false, nUsedGPR, nUsedSSE ); - if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ) ) // value + if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( rParam.pTypeRef ) ) // value { // Simple types must fit exactly one register on x86_64 OSL_ASSERT( bFitsRegisters && ( ( nUsedSSE == 1 && nUsedGPR == 0 ) || ( nUsedSSE == 0 && nUsedGPR == 1 ) ) ); @@ -155,12 +153,12 @@ static typelib_TypeClass cpp2uno_call( else pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw++; } - - // no longer needed - TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } else // struct <= 16 bytes || ptr to complex value || ref { + typelib_TypeDescription * pParamTypeDescr = 0; + TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); + void *pCppStack; if ( nr_gpr < x86_64::MAX_GPR_REGS ) { diff --git a/bridges/source/remote/urp/urp_reader.cxx b/bridges/source/remote/urp/urp_reader.cxx index dd9ff0af80ec..f2ac4f3e9dc7 100644 --- a/bridges/source/remote/urp/urp_reader.cxx +++ b/bridges/source/remote/urp/urp_reader.cxx @@ -372,8 +372,8 @@ inline sal_Bool OReaderThread::readFlags( struct MessageFlags *pFlags ) } pFlags->bSynchronous = ( HDRFLAG_SYNCHRONOUS & moreFlags ); pFlags->bMustReply = ( HDRFLAG_MUSTREPLY & moreFlags ); - OSL_ENSURE( pFlags->bSynchronous && pFlags->bMustReply || - ! pFlags->bSynchronous && !pFlags->bMustReply, + OSL_ENSURE( (pFlags->bSynchronous && pFlags->bMustReply) || + (!pFlags->bSynchronous && !pFlags->bMustReply), "urp-bridge : customized calls currently not supported !"); } diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 9cf2dd978759..5469010f2745 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -958,6 +958,7 @@ namespace cairocanvas void CanvasHelper::doPolyPolygonPath( const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, Operation aOperation, + bool bNoLineJoin, const uno::Sequence< rendering::Texture >* pTextures, Cairo* pCairo ) const { @@ -967,10 +968,46 @@ namespace cairocanvas if( !pCairo ) pCairo = mpCairo.get(); - doPolyPolygonImplementation( rPolyPoly, aOperation, - pCairo, pTextures, - mpSurfaceProvider, - xPolyPolygon->getFillRule() ); + if(bNoLineJoin && Stroke == aOperation) + { + // emulate rendering::PathJoinType::NONE by painting single edges + for(sal_uInt32 a(0); a < rPolyPoly.count(); a++) + { + const basegfx::B2DPolygon aCandidate(rPolyPoly.getB2DPolygon(a)); + const sal_uInt32 nPointCount(aCandidate.count()); + + if(nPointCount) + { + const sal_uInt32 nEdgeCount(aCandidate.isClosed() ? nPointCount + 1: nPointCount); + basegfx::B2DPolygon aEdge; + aEdge.append(aCandidate.getB2DPoint(0)); + aEdge.append(basegfx::B2DPoint(0.0, 0.0)); + + for(sal_uInt32 a(0); a < nEdgeCount; a++) + { + const sal_uInt32 nNextIndex((a + 1) % nPointCount); + aEdge.setB2DPoint(1, aCandidate.getB2DPoint(nNextIndex)); + aEdge.setNextControlPoint(0, aCandidate.getNextControlPoint(a)); + aEdge.setPrevControlPoint(1, aCandidate.getPrevControlPoint(nNextIndex)); + + doPolyPolygonImplementation( aEdge, aOperation, + pCairo, pTextures, + mpSurfaceProvider, + xPolyPolygon->getFillRule() ); + + // prepare next step + aEdge.setB2DPoint(0, aEdge.getB2DPoint(1)); + } + } + } + } + else + { + doPolyPolygonImplementation( rPolyPoly, aOperation, + pCairo, pTextures, + mpSurfaceProvider, + xPolyPolygon->getFillRule() ); + } } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* , @@ -1039,9 +1076,12 @@ namespace cairocanvas break; } + bool bNoLineJoin(false); + switch( strokeAttributes.JoinType ) { // cairo doesn't have join type NONE so we use MITER as it's pretty close case rendering::PathJoinType::NONE: + bNoLineJoin = true; case rendering::PathJoinType::MITER: cairo_set_line_join( mpCairo.get(), CAIRO_LINE_JOIN_MITER ); break; @@ -1063,7 +1103,7 @@ namespace cairocanvas // TODO(rodo) use LineArray of strokeAttributes - doPolyPolygonPath( xPolyPolygon, Stroke ); + doPolyPolygonPath( xPolyPolygon, Stroke, bNoLineJoin ); cairo_restore( mpCairo.get() ); } else diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx index 1e69a9f41e5b..90d365d63b3c 100644 --- a/canvas/source/cairo/cairo_canvashelper.hxx +++ b/canvas/source/cairo/cairo_canvashelper.hxx @@ -276,6 +276,7 @@ namespace cairocanvas void doPolyPolygonPath( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, Operation aOperation, + bool bNoLineJoin = false, const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >* pTextures=NULL, ::cairo::Cairo* pCairo=NULL ) const; diff --git a/canvas/source/directx/dx_canvashelper.cxx b/canvas/source/directx/dx_canvashelper.cxx index 0642b6c50efb..607f7c076e21 100755 --- a/canvas/source/directx/dx_canvashelper.cxx +++ b/canvas/source/directx/dx_canvashelper.cxx @@ -46,6 +46,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/tools/canvastools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <comphelper/sequence.hxx> #include <canvas/canvastools.hxx> @@ -367,7 +368,11 @@ namespace dxcanvas pGraphics->GetPixelOffsetMode() ); pGraphics->SetPixelOffsetMode( Gdiplus::PixelOffsetModeNone ); - aPen.SetMiterLimit( static_cast< Gdiplus::REAL >(strokeAttributes.MiterLimit) ); + const bool bIsMiter(rendering::PathJoinType::MITER == strokeAttributes.JoinType); + const bool bIsNone(rendering::PathJoinType::NONE == strokeAttributes.JoinType); + + if(bIsMiter) + aPen.SetMiterLimit( static_cast< Gdiplus::REAL >(strokeAttributes.MiterLimit) ); const ::std::vector< Gdiplus::REAL >& rDashArray( ::comphelper::sequenceToContainer< ::std::vector< Gdiplus::REAL > >( @@ -380,9 +385,10 @@ namespace dxcanvas aPen.SetLineCap( gdiCapFromCap(strokeAttributes.StartCapType), gdiCapFromCap(strokeAttributes.EndCapType), Gdiplus::DashCapFlat ); - aPen.SetLineJoin( gdiJoinFromJoin(strokeAttributes.JoinType) ); + if(!bIsNone) + aPen.SetLineJoin( gdiJoinFromJoin(strokeAttributes.JoinType) ); - GraphicsPathSharedPtr pPath( tools::graphicsPathFromXPolyPolygon2D( xPolyPolygon ) ); + GraphicsPathSharedPtr pPath( tools::graphicsPathFromXPolyPolygon2D( xPolyPolygon, bIsNone ) ); // TODO(E1): Return value Gdiplus::Status hr = pGraphics->DrawPath( &aPen, pPath.get() ); @@ -733,10 +739,8 @@ namespace dxcanvas // add output offset if( !maOutputOffset.equalZero() ) { - ::basegfx::B2DHomMatrix aOutputOffset; - aOutputOffset.translate( maOutputOffset.getX(), - maOutputOffset.getY() ); - + const basegfx::B2DHomMatrix aOutputOffset(basegfx::tools::createTranslateB2DHomMatrix( + maOutputOffset.getX(), maOutputOffset.getY())); aTransform = aOutputOffset * aTransform; } @@ -774,10 +778,8 @@ namespace dxcanvas // add output offset if( !maOutputOffset.equalZero() ) { - ::basegfx::B2DHomMatrix aOutputOffset; - aOutputOffset.translate( maOutputOffset.getX(), - maOutputOffset.getY() ); - + const basegfx::B2DHomMatrix aOutputOffset(basegfx::tools::createTranslateB2DHomMatrix( + maOutputOffset.getX(), maOutputOffset.getY())); aTransform = aOutputOffset * aTransform; } diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx index f291d197c4de..73a2d49bfb62 100755 --- a/canvas/source/directx/dx_canvashelper_texturefill.cxx +++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx @@ -43,6 +43,7 @@ #include <basegfx/numeric/ftools.hxx> #include <basegfx/tools/tools.hxx> #include <basegfx/tools/canvastools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <canvas/parametricpolypolygon.hxx> @@ -452,8 +453,7 @@ namespace dxcanvas aFillBrush.SetColor( aFillColor ); const double nCurrScale( (nStepCount-i)/(double)nStepCount ); - aScaleMatrix.identity(); - aScaleMatrix.translate( -0.5, -0.5 ); + aScaleMatrix = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5); // handle anisotrophic polygon scaling if( rValues.mnAspectRatio < 1.0 ) diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 40164c9a1d87..4f5b92d6bcb5 100755 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.cxx @@ -194,7 +194,8 @@ namespace dxcanvas void graphicsPathFromB2DPolygon( GraphicsPathSharedPtr& rOutput, ::std::vector< Gdiplus::PointF >& rPoints, - const ::basegfx::B2DPolygon& rPoly ) + const ::basegfx::B2DPolygon& rPoly, + bool bNoLineJoin) { const sal_uInt32 nPoints( rPoly.count() ); @@ -241,7 +242,18 @@ namespace dxcanvas rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.getX()), static_cast<Gdiplus::REAL>(rPoint.getY()) ); - rOutput->AddBeziers( &rPoints[0], nCurrOutput ); + if(bNoLineJoin && nCurrOutput > 7) + { + for(sal_uInt32 a(3); a < nCurrOutput; a+=3) + { + rOutput->StartFigure(); + rOutput->AddBezier(rPoints[a - 3], rPoints[a - 2], rPoints[a - 1], rPoints[a]); + } + } + else + { + rOutput->AddBeziers( &rPoints[0], nCurrOutput ); + } } else { @@ -251,7 +263,20 @@ namespace dxcanvas // Therefore, simply don't pass the last two // points here. if( nCurrOutput > 3 ) - rOutput->AddBeziers( &rPoints[0], nCurrOutput-2 ); + { + if(bNoLineJoin && nCurrOutput > 7) + { + for(sal_uInt32 a(3); a < nCurrOutput; a+=3) + { + rOutput->StartFigure(); + rOutput->AddBezier(rPoints[a - 3], rPoints[a - 2], rPoints[a - 1], rPoints[a]); + } + } + else + { + rOutput->AddBeziers( &rPoints[0], nCurrOutput-2 ); + } + } } } else @@ -267,10 +292,27 @@ namespace dxcanvas static_cast<Gdiplus::REAL>(rPoint.getY()) ); } - rOutput->AddLines( &rPoints[0], nPoints ); + if(bNoLineJoin && nPoints > 2) + { + for(sal_uInt32 a(1); a < nPoints; a++) + { + rOutput->StartFigure(); + rOutput->AddLine(rPoints[a - 1], rPoints[a]); + } + + if(bClosedPolygon) + { + rOutput->StartFigure(); + rOutput->AddLine(rPoints[nPoints - 1], rPoints[0]); + } + } + else + { + rOutput->AddLines( &rPoints[0], nPoints ); + } } - if( bClosedPolygon ) + if( bClosedPolygon && !bNoLineJoin ) rOutput->CloseFigure(); } } @@ -426,17 +468,17 @@ namespace dxcanvas return pRes; } - GraphicsPathSharedPtr graphicsPathFromB2DPolygon( const ::basegfx::B2DPolygon& rPoly ) + GraphicsPathSharedPtr graphicsPathFromB2DPolygon( const ::basegfx::B2DPolygon& rPoly, bool bNoLineJoin ) { GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); ::std::vector< Gdiplus::PointF > aPoints; - graphicsPathFromB2DPolygon( pRes, aPoints, rPoly ); + graphicsPathFromB2DPolygon( pRes, aPoints, rPoly, bNoLineJoin ); return pRes; } - GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly ) + GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, bool bNoLineJoin ) { GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); ::std::vector< Gdiplus::PointF > aPoints; @@ -446,24 +488,25 @@ namespace dxcanvas { graphicsPathFromB2DPolygon( pRes, aPoints, - rPoly.getB2DPolygon( nCurrPoly ) ); + rPoly.getB2DPolygon( nCurrPoly ), + bNoLineJoin); } return pRes; } - GraphicsPathSharedPtr graphicsPathFromXPolyPolygon2D( const uno::Reference< rendering::XPolyPolygon2D >& xPoly ) + GraphicsPathSharedPtr graphicsPathFromXPolyPolygon2D( const uno::Reference< rendering::XPolyPolygon2D >& xPoly, bool bNoLineJoin ) { LinePolyPolygon* pPolyImpl = dynamic_cast< LinePolyPolygon* >( xPoly.get() ); if( pPolyImpl ) { - return pPolyImpl->getGraphicsPath(); + return pPolyImpl->getGraphicsPath( bNoLineJoin ); } else { return tools::graphicsPathFromB2DPolyPolygon( - polyPolygonFromXPolyPolygon2D( xPoly ) ); + polyPolygonFromXPolyPolygon2D( xPoly ), bNoLineJoin ); } } diff --git a/canvas/source/directx/dx_impltools.hxx b/canvas/source/directx/dx_impltools.hxx index 072d1063235d..222b1a927305 100755 --- a/canvas/source/directx/dx_impltools.hxx +++ b/canvas/source/directx/dx_impltools.hxx @@ -107,11 +107,18 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromRealPoint2DSequence( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& ); - GraphicsPathSharedPtr graphicsPathFromB2DPolygon( const ::basegfx::B2DPolygon& rPoly ); - GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly ); + GraphicsPathSharedPtr graphicsPathFromB2DPolygon( + const ::basegfx::B2DPolygon& rPoly, + bool bNoLineJoin = false); + + GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon( + const ::basegfx::B2DPolyPolygon& rPoly, + bool bNoLineJoin = false); + + GraphicsPathSharedPtr graphicsPathFromXPolyPolygon2D( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&, + bool bNoLineJoin = false ); - GraphicsPathSharedPtr graphicsPathFromXPolyPolygon2D( const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& ); bool drawGdiPlusBitmap( const GraphicsSharedPtr& rGraphics, const BitmapSharedPtr& rBitmap ); bool drawDIBits( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, diff --git a/canvas/source/directx/dx_linepolypolygon.cxx b/canvas/source/directx/dx_linepolypolygon.cxx index e63adc3dc613..9a5569384eae 100755 --- a/canvas/source/directx/dx_linepolypolygon.cxx +++ b/canvas/source/directx/dx_linepolypolygon.cxx @@ -46,14 +46,14 @@ namespace dxcanvas { } - GraphicsPathSharedPtr LinePolyPolygon::getGraphicsPath() const + GraphicsPathSharedPtr LinePolyPolygon::getGraphicsPath( bool bNoLineJoin ) const { // generate GraphicsPath only on demand (gets deleted as soon // as any of the modifying methods above touches the // B2DPolyPolygon). if( !mpPath ) { - mpPath = tools::graphicsPathFromB2DPolyPolygon( getPolyPolygonUnsafe() ); + mpPath = tools::graphicsPathFromB2DPolyPolygon( getPolyPolygonUnsafe(), bNoLineJoin ); mpPath->SetFillMode( const_cast<LinePolyPolygon*>(this)->getFillRule() == rendering::FillRule_EVEN_ODD ? Gdiplus::FillModeAlternate : Gdiplus::FillModeWinding ); } diff --git a/canvas/source/directx/dx_linepolypolygon.hxx b/canvas/source/directx/dx_linepolypolygon.hxx index 431cd1b87b4f..3e061d76e768 100755 --- a/canvas/source/directx/dx_linepolypolygon.hxx +++ b/canvas/source/directx/dx_linepolypolygon.hxx @@ -45,7 +45,7 @@ namespace dxcanvas public: explicit LinePolyPolygon( const ::basegfx::B2DPolyPolygon& ); - GraphicsPathSharedPtr getGraphicsPath() const; + GraphicsPathSharedPtr getGraphicsPath( bool bNoLineJoin = false) const; private: // overridden, to clear mpPath diff --git a/canvas/source/simplecanvas/simplecanvasimpl.cxx b/canvas/source/simplecanvas/simplecanvasimpl.cxx index 185979b0220e..7ca251458d22 100644 --- a/canvas/source/simplecanvas/simplecanvasimpl.cxx +++ b/canvas/source/simplecanvas/simplecanvasimpl.cxx @@ -46,6 +46,7 @@ #include <comphelper/servicedecl.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "canvas/canvastools.hxx" @@ -287,10 +288,7 @@ namespace ::sal_Int8 nTextDirection ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - - basegfx::B2DHomMatrix offsetTransform; - offsetTransform.translate(aOutPos.X,aOutPos.Y); - + const basegfx::B2DHomMatrix offsetTransform(basegfx::tools::createTranslateB2DHomMatrix(aOutPos.X,aOutPos.Y)); rendering::RenderState aRenderState( createStrokingRenderState() ); tools::appendToRenderState(aRenderState, offsetTransform); @@ -305,10 +303,7 @@ namespace const geometry::RealPoint2D& aLeftTop ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - - basegfx::B2DHomMatrix offsetTransform; - offsetTransform.translate(aLeftTop.X,aLeftTop.Y); - + const basegfx::B2DHomMatrix offsetTransform(basegfx::tools::createTranslateB2DHomMatrix(aLeftTop.X,aLeftTop.Y)); rendering::RenderState aRenderState( createStrokingRenderState() ); tools::appendToRenderState(aRenderState, offsetTransform); diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx index 23d6124e4cb8..278789637c72 100644 --- a/canvas/source/tools/canvastools.cxx +++ b/canvas/source/tools/canvastools.cxx @@ -63,6 +63,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/tools/canvastools.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <cppuhelper/compbase1.hxx> #include <rtl/instance.hxx> @@ -679,9 +680,8 @@ namespace canvas i_transformation ); // now move resulting left,top point of bounds to (0,0) - ::basegfx::B2DHomMatrix aCorrectedTransform; - aCorrectedTransform.translate( -aTransformedRect.getMinX(), - -aTransformedRect.getMinY() ); + const basegfx::B2DHomMatrix aCorrectedTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aTransformedRect.getMinX(), -aTransformedRect.getMinY())); // prepend to original transformation o_transform = aCorrectedTransform * i_transformation; @@ -745,9 +745,8 @@ namespace canvas transformation ); // now move resulting left,top point of bounds to (0,0) - ::basegfx::B2DHomMatrix aCorrectedTransform; - aCorrectedTransform.translate( -aTransformedRect.getMinX(), - -aTransformedRect.getMinY() ); + basegfx::B2DHomMatrix aCorrectedTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aTransformedRect.getMinX(), -aTransformedRect.getMinY())); // scale to match outRect const double xDenom( aTransformedRect.getWidth() ); diff --git a/canvas/source/tools/surface.cxx b/canvas/source/tools/surface.cxx index c3161758ea3e..96162f6d78af 100644 --- a/canvas/source/tools/surface.cxx +++ b/canvas/source/tools/surface.cxx @@ -33,6 +33,7 @@ #include "surface.hxx" #include <basegfx/polygon/b2dpolygonclipper.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <comphelper/scopeguard.hxx> #include <boost/bind.hpp> @@ -150,9 +151,8 @@ namespace canvas // 4) scale to normalized device coordinates // 5) flip y-axis // 6) translate to account for viewport transform - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate(maSourceOffset.getX(), - maSourceOffset.getY()); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + maSourceOffset.getX(), maSourceOffset.getY())); aTransform = aTransform * rTransform; aTransform.translate(::basegfx::fround(rPos.getX()), ::basegfx::fround(rPos.getY())); @@ -277,8 +277,7 @@ namespace canvas // 1) offset of surface subarea // 2) surface transform // 3) translation to output position [rPos] - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate(aPos1.getX(),aPos1.getY()); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(aPos1.getX(), aPos1.getY())); aTransform = aTransform * rTransform; aTransform.translate(::basegfx::fround(rPos.getX()), ::basegfx::fround(rPos.getY())); @@ -380,7 +379,7 @@ namespace canvas // be transformed by the overall transform and uv coordinates will // be calculated from the result, and this is why we need to use // integer coordinates here... - ::basegfx::B2DHomMatrix aTransform; + basegfx::B2DHomMatrix aTransform; aTransform = aTransform * rTransform; aTransform.translate(::basegfx::fround(rPos.getX()), ::basegfx::fround(rPos.getY())); diff --git a/configure.in b/configure.in index 17cc81f905f5..0ce538aeed8e 100644 --- a/configure.in +++ b/configure.in @@ -115,10 +115,6 @@ AC_ARG_ENABLE(qadevooo, [ --disable-qadevooo OO.o includes some qa testsuites which some packagers may wish to build without ],,enable_qadevooo="yes") -AC_ARG_ENABLE(fontooo, -[ --disable-fontooo disable FontOOo - (useful for distributions using fontconfig for OOo) -],,enable_fontooo="yes") AC_ARG_ENABLE(mathmldtd, [ --disable-mathmldtd disable mathmldtd (useful for distributions that want to avoid packaging @@ -131,9 +127,6 @@ AC_ARG_ENABLE(evolution2, AC_ARG_WITH(system-stdlibs, [ --with-system-stdlibs use libstdc++/libgcc_s already on system ],,checkforstdlibproblems=yes) -AC_ARG_WITH(system-mspack, -[ --with-system-mspack use libmspack already installed on system -],,) AC_ARG_ENABLE(cups, [ --disable-cups disable cups support in the psprint project ],,enable_cups=yes) @@ -786,12 +779,6 @@ AC_ARG_WITH(build-version, Usage: --with-build-version="Built by Jim" ],with_build_version=$withval) -AC_ARG_ENABLE(sgistl, -[ --enable-sgistl for IRIX users, use this option option to build - OpenOffice.org using SGI's STL. - - Usage: --enable-sgistl=yes -],,) AC_ARG_WITH(alloc, [ --with-alloc Define which allocator to build with (choices are oo, system, tcmalloc) @@ -939,9 +926,6 @@ case "$build_os" in test_cups=yes test_randr=yes test_freetype=yes - if getconf GNU_LIBPTHREAD_VERSION |grep -q NPTL; then - PTHREAD_CFLAGS="-DNPTL" - fi _os=Linux ;; gnu) @@ -1021,12 +1005,6 @@ case "$build_os" in PTHREAD_LIBS="-pthread -lpthread" _os=NetBSD ;; - irix*) - test_cups=no - test_randr=no - test_freetype=yes - _os=IRIX - ;; aix*) test_cups=no test_randr=no @@ -1635,31 +1613,6 @@ fi AC_SUBST(HAVE_LD_HASH_STYLE) dnl =================================================================== -dnl Test the IRIX SGI Mips pro compiler -dnl =================================================================== -if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then - if test "$CC" = "cc"; then - AC_PATH_PROGS(_cc, cc) - COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"` - AC_MSG_CHECKING([the SGI MIPSpro C compiler version]) - dnl cc -version outputs to standard error!!!! - _mipspro_version=`$CC -version 2>&1 | $AWK '{ print $4 }'` - _mipspro_major=`echo $_mipspro_version | $AWK -F. '{ print $1 }'` - if test "$_mipspro_major" != "7"; then - AC_MSG_ERROR([found version "$_mipspro_version", use version 7.2+ of the SGI MIPSpro C compiler]) - else - _mipspro_minor=`echo $_mipspro_version | $AWK -F. '{ if ($2 <= 1) print "false"; else print "true" }'` - if test "$_mipspro_minor" = "false"; then - AC_MSG_ERROR([found version "$_mipspro_version", use version 7.2+ of the SGI MIPSpro C compiler]) - else - dnl compiler will do - AC_MSG_RESULT([checked]) - fi - fi - fi -fi - -dnl =================================================================== dnl Test the Compaq compiler for OSF1 dnl =================================================================== if test "$_os" = "OSF1"; then @@ -2288,21 +2241,6 @@ if test "$_os" = "Darwin"; then fi fi dnl =================================================================== -dnl Extra checking for the IRIX compiler -dnl =================================================================== -if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then - dnl MIPSpro C++ compiler packaged with MIPSpro C compiler - if test "$CC" = "cc"; then - AC_MSG_CHECKING([SGI MIPSpro C++ Compiler]) - if test "$CXX" != "CC"; then - AC_MSG_WARN([SGI MIPSpro C++ was not found]) - echo "SGI MIPSpro C++ was not found" >> warn - else - AC_MSG_RESULT([checked]) - fi - fi -fi -dnl =================================================================== dnl Extra checking for the OSF compiler dnl =================================================================== if test "$_os" = "OSF1"; then @@ -2444,23 +2382,6 @@ if test "$_os" = "SunOS"; then fi dnl =================================================================== -dnl Checks for SGI STL -dnl =================================================================== -if test -n "$enable_sgistl" && "$enable_sgistl" != "no"; then - if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then - AC_MSG_CHECKING([for SGI STL]) - if test -d /usr/include/CC ; then - AC_MSG_RESULT([yes.]) - - else - AC_MSG_RESULT([not found.]) - fi - else - AC_MSG_ERROR([Option --enable-sgistl is only valid for IRIX]) - fi -else - -dnl =================================================================== dnl Checks for what the default STL should be dnl =================================================================== AC_MSG_CHECKING([what the default STL should be]) @@ -2543,19 +2464,6 @@ dnl =================================================================== else AC_MSG_ERROR([STLport libraries not found]) fi - elif test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then - if test -f "$STLPORT4/lib/libstlport_mipspro_41.so"; then - AC_MSG_RESULT([checked]) - else - if test -f "$STLPORT4/lib/libstlport_gcc.so"; then - AC_MSG_RESULT([checked]) - elif test -f "$STLPORT4/lib/libstlport.so"; then - AC_MSG_RESULT([checked]) - STLPORT_VER=500 - else - AC_MSG_ERROR([STLport libraries not found]) - fi - fi else if test -f "$STLPORT4/lib/libstlport_gcc.so"; then AC_MSG_RESULT([checked]) @@ -2572,7 +2480,6 @@ dnl =================================================================== echo "using stlport. Warning, breaks your ABI compatability!" >>warn fi fi -fi if test -z "$STLPORT4"; then STLPORT4="NO_STLPORT4" @@ -2713,11 +2620,18 @@ _ACEOF if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then gccvisbroken=yes else - if $EGREP -q '@PLT|\$stub|\(PLT\)' visibility.s; then - gccvisbroken=no; - else - gccvisbroken=yes; - fi + case "$build_cpu" in + i?86|x86_64) + if $EGREP -q '@PLT' visibility.s; then + gccvisbroken=no + else + gccvisbroken=yes + fi + ;; + *) + gccvisbroken=no + ;; + esac fi rm -f visibility.s @@ -3351,9 +3265,6 @@ if test "$_os" != "WINNT" -a \( "z$enable_epm" = "z" -o "$enable_epm" != "no" \) OSF1) PKGFORMAT=setld ;; - IRIX) - PKGFORMAT=tardist - ;; # we never should get here since we check the arciecture/os at the beginning, # but go sure... *) @@ -6286,47 +6197,6 @@ fi AC_SUBST(ENABLE_KAB) dnl =================================================================== -dnl Test whether to include FontOOo -dnl =================================================================== -AC_MSG_CHECKING([whether to include FontOOo]) -if test -n "$enable_fontooo"; then - if test "$enable_fontooo" = "no"; then - AC_MSG_RESULT([no]) - WITH_FONTOOO=NO - SCPDEFS="$SCPDEFS -DWITHOUT_FONTOOO" - else - AC_MSG_RESULT([yes]) - WITH_FONTOOO=YES - BUILD_TYPE="$BUILD_TYPE MSFONTEXTRACT" - fi -else - AC_MSG_RESULT([no]) - WITH_FONTOOO=NO - SCPDEFS="$SCPDEFS -DWITHOUT_FONTOOO" -fi -AC_SUBST(WITH_FONTOOO) - -if test "$WITH_FONTOOO" = "YES"; then - dnl =============================================================== - dnl Check whether to use libmspack from system - dnl =============================================================== - AC_MSG_CHECKING([whether to use system libmspack]) - if test -n "$with_system_mspack" -o -n "$with_system_libs" && \ - test "$with_system_mspack" != "no"; then - AC_MSG_RESULT([yes]) - SYSTEM_MSPACK=YES - AC_CHECK_HEADER(mspack.h, [], - [AC_MSG_ERROR([mspack.h not found, install libmspack])], []) - AC_CHECK_LIB(mspack, mspack_create_cab_decompressor, [], - [AC_MSG_ERROR(libmspack not installed or functional)], []) - else - AC_MSG_RESULT([no]) - SYSTEM_MSPACK=NO - fi -fi -AC_SUBST(SYSTEM_MSPACK) - -dnl =================================================================== dnl Test whether to include MathMLDTD dnl =================================================================== AC_MSG_CHECKING([whether to include MathMLDTD]) diff --git a/cppcanvas/source/mtfrenderer/bitmapaction.cxx b/cppcanvas/source/mtfrenderer/bitmapaction.cxx index 355dd336e2c5..4f54b10c4879 100644 --- a/cppcanvas/source/mtfrenderer/bitmapaction.cxx +++ b/cppcanvas/source/mtfrenderer/bitmapaction.cxx @@ -35,25 +35,21 @@ #include <com/sun/star/rendering/XBitmap.hpp> #include <com/sun/star/rendering/RepaintResult.hpp> #include <com/sun/star/rendering/XCachedPrimitive.hpp> - #include <vcl/bitmapex.hxx> #include <tools/gen.hxx> #include <vcl/canvastools.hxx> - #include <canvas/canvastools.hxx> - #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/vector/b2dsize.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/tools/canvastools.hxx> - #include <boost/utility.hpp> - #include "cachedprimitivebase.hxx" #include "bitmapaction.hxx" #include "outdevstate.hxx" #include "mtftools.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> using namespace ::com::sun::star; @@ -112,9 +108,7 @@ namespace cppcanvas // Setup transformation such that the next render call is // moved rPoint away. - ::basegfx::B2DHomMatrix aLocalTransformation; - aLocalTransformation.translate( rDstPoint.getX(), - rDstPoint.getY() ); + const basegfx::B2DHomMatrix aLocalTransformation(basegfx::tools::createTranslateB2DHomMatrix(rDstPoint)); ::canvas::tools::appendToRenderState( maState, aLocalTransformation ); @@ -144,15 +138,12 @@ namespace cppcanvas // moved rPoint away, and scaled according to the ratio // given by src and dst size. const ::Size aBmpSize( rBmpEx.GetSizePixel() ); - ::basegfx::B2DHomMatrix aLocalTransformation; const ::basegfx::B2DVector aScale( rDstSize.getX() / aBmpSize.Width(), rDstSize.getY() / aBmpSize.Height() ); - aLocalTransformation.scale( aScale.getX(), aScale.getY() ); - aLocalTransformation.translate( rDstPoint.getX(), - rDstPoint.getY() ); - ::canvas::tools::appendToRenderState( maState, - aLocalTransformation ); + const basegfx::B2DHomMatrix aLocalTransformation(basegfx::tools::createScaleTranslateB2DHomMatrix( + aScale, rDstPoint)); + ::canvas::tools::appendToRenderState( maState, aLocalTransformation ); // correct clip (which is relative to original transform) tools::modifyClip( maState, diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index c6f9a295b332..8ea2ae453a97 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -34,19 +34,14 @@ #include <canvas/debug.hxx> #include <tools/diagnose_ex.h> #include <canvas/verbosetrace.hxx> - #include <osl/mutex.hxx> #include <vos/mutex.hxx> #include <vcl/svapp.hxx> - #include <rtl/logfile.hxx> - #include <comphelper/sequence.hxx> #include <comphelper/anytostring.hxx> #include <cppuhelper/exc_hlp.hxx> - #include <cppcanvas/canvas.hxx> - #include <com/sun/star/rendering/XGraphicDevice.hpp> #include <com/sun/star/rendering/TexturingMode.hpp> #include <com/sun/star/rendering/XParametricPolyPolygon2DFactory.hpp> @@ -59,7 +54,6 @@ #include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/rendering/PathCapType.hpp> #include <com/sun/star/rendering/PathJoinType.hpp> - #include <basegfx/tools/canvastools.hxx> #include <basegfx/numeric/ftools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> @@ -73,7 +67,6 @@ #include <basegfx/tuple/b2dtuple.hxx> #include <basegfx/polygon/b2dpolygonclipper.hxx> #include <basegfx/polygon/b2dpolypolygoncutter.hxx> - #include <canvas/canvastools.hxx> #include <vcl/canvastools.hxx> #include <vcl/salbtype.hxx> @@ -84,11 +77,9 @@ #include <vcl/graphictools.hxx> #include <tools/poly.hxx> #include <i18npool/mslangid.hxx> - #include <implrenderer.hxx> #include <tools.hxx> #include <outdevstate.hxx> - #include <action.hxx> #include <bitmapaction.hxx> #include <lineaction.hxx> @@ -96,15 +87,13 @@ #include <polypolyaction.hxx> #include <textaction.hxx> #include <transparencygroupaction.hxx> - #include <vector> #include <algorithm> #include <iterator> - #include <boost/scoped_array.hpp> - #include "mtftools.hxx" #include "outdevstate.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> using namespace ::com::sun::star; @@ -286,10 +275,25 @@ namespace (getState( rParms.mrStates ).mapModeTransform * aWidth).getX(); // setup reasonable defaults - o_rStrokeAttributes.MiterLimit = 1.0; + o_rStrokeAttributes.MiterLimit = 15.0; // 1.0 was no good default; GDI+'s limit is 10.0, our's is 15.0 o_rStrokeAttributes.StartCapType = rendering::PathCapType::BUTT; o_rStrokeAttributes.EndCapType = rendering::PathCapType::BUTT; - o_rStrokeAttributes.JoinType = rendering::PathJoinType::MITER; + + switch(rLineInfo.GetLineJoin()) + { + default: // B2DLINEJOIN_NONE, B2DLINEJOIN_MIDDLE + o_rStrokeAttributes.JoinType = rendering::PathJoinType::NONE; + break; + case basegfx::B2DLINEJOIN_BEVEL: + o_rStrokeAttributes.JoinType = rendering::PathJoinType::BEVEL; + break; + case basegfx::B2DLINEJOIN_MITER: + o_rStrokeAttributes.JoinType = rendering::PathJoinType::MITER; + break; + case basegfx::B2DLINEJOIN_ROUND: + o_rStrokeAttributes.JoinType = rendering::PathJoinType::ROUND; + break; + } if( LINE_DASH == rLineInfo.GetStyle() ) { @@ -729,12 +733,11 @@ namespace cppcanvas fabs( aBounds.getHeight()*sin(nRotation) ) + fabs( aBounds.getWidth()*cos(nRotation) ))); - aTextureTransformation.scale( nScale, nScale ); - - // translate back origin to center of + // scale and translate back origin to center of // primitive - aTextureTransformation.translate( 0.5*aBounds.getWidth(), - 0.5*aBounds.getHeight() ); + aTextureTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix( + nScale, nScale, 0.5*aBounds.getWidth(), 0.5*aBounds.getHeight()) + * aTextureTransformation; } break; @@ -856,9 +859,8 @@ namespace cppcanvas aTextureTransformation.scale( nScaleX, nScaleY ); // rotate texture according to gradient rotation - aTextureTransformation.translate( -0.5*nScaleX, -0.5*nScaleY ); - aTextureTransformation.rotate( nRotation ); - aTextureTransformation.translate( 0.5*nScaleX, 0.5*nScaleY ); + aTextureTransformation = basegfx::tools::createRotateAroundPoint(0.5*nScaleX, 0.5*nScaleY, nRotation) + * aTextureTransformation; aTextureTransformation.translate( nOffsetX, nOffsetY ); } diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx index e4e227955da6..b6a548aa49be 100644 --- a/cppcanvas/source/mtfrenderer/mtftools.cxx +++ b/cppcanvas/source/mtfrenderer/mtftools.cxx @@ -34,10 +34,8 @@ #include <canvas/debug.hxx> #include <tools/diagnose_ex.h> #include <canvas/verbosetrace.hxx> - #include <com/sun/star/rendering/RenderState.hpp> #include <com/sun/star/rendering/XCanvas.hpp> - #include <basegfx/numeric/ftools.hxx> #include <basegfx/tools/canvastools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -45,16 +43,15 @@ #include <basegfx/range/b2drectangle.hxx> #include <basegfx/vector/b2dvector.hxx> #include <canvas/canvastools.hxx> - #include <vcl/gdimtf.hxx> #include <vcl/metaact.hxx> #include <vcl/virdev.hxx> #include <vcl/metric.hxx> #include <tools/poly.hxx> - #include "mtftools.hxx" #include "outdevstate.hxx" #include "polypolyaction.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> @@ -111,9 +108,9 @@ namespace cppcanvas const ::Size aSizePixel( rVDev.LogicToPixel( aSizeLogic ) ); - o_rMatrix.identity(); - o_rMatrix.scale( aSizePixel.Width() / (double)aSizeLogic.Width(), - aSizePixel.Height() / (double)aSizeLogic.Height() ); + o_rMatrix = basegfx::tools::createScaleB2DHomMatrix( + aSizePixel.Width() / (double)aSizeLogic.Width(), + aSizePixel.Height() / (double)aSizeLogic.Height() ); return o_rMatrix; } diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index f1191e6e57f3..038b68c3008e 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -48,6 +48,7 @@ #include <basegfx/vector/b2dsize.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <tools/gen.hxx> #include <vcl/canvastools.hxx> @@ -93,9 +94,7 @@ namespace cppcanvas NULL, &rState.fontRotation ); - ::basegfx::B2DHomMatrix aLocalTransformation; - - aLocalTransformation.rotate( rState.fontRotation ); + basegfx::B2DHomMatrix aLocalTransformation(basegfx::tools::createRotateB2DHomMatrix(rState.fontRotation)); aLocalTransformation.translate( rStartPoint.getX(), rStartPoint.getY() ); ::canvas::tools::appendToRenderState( o_rRenderState, diff --git a/cpputools/source/sp2bv/makefile.mk b/cpputools/source/sp2bv/makefile.mk index 2b80d6e431c6..e9ca09bff6df 100644 --- a/cpputools/source/sp2bv/makefile.mk +++ b/cpputools/source/sp2bv/makefile.mk @@ -34,7 +34,7 @@ PRJ=..$/.. PRJNAME=cpputools TARGET=sp2bv TARGETTYPE=CUI -.IF "$(OS)"!="IRIX" && "$(OS)" != "MACOSX" +.IF "$(OS)" != "MACOSX" # hack to get stdc++ linked NO_DEFAULT_STL=TRUE .ENDIF diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 08626f051f82..9dd722d0d7ed 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -46,7 +46,6 @@ #include "tabline.hrc" #include "helpid.hrc" #include <svx/dialmgr.hxx> - #include <svx/svdobj.hxx> #include <svx/svdopath.hxx> #include "svx/drawitem.hxx" @@ -61,6 +60,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/dialogs.hrc> #define DLGWIN this->GetParent()->GetParent() @@ -456,9 +456,8 @@ IMPL_LINK( SvxLineEndDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) basegfx::B2DRange aNewRange(basegfx::tools::getRange(aNewPolyPolygon)); // Normalisieren - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate(-aNewRange.getMinX(), -aNewRange.getMinY()); - aNewPolyPolygon.transform(aMatrix); + aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix( + -aNewRange.getMinX(), -aNewRange.getMinY())); // Loeschen des angelegten PolyObjektes SdrObject::Free( pConvPolyObj ); diff --git a/curl/makefile.mk b/curl/makefile.mk index d3ad3ba28bae..2d26a876a556 100644 --- a/curl/makefile.mk +++ b/curl/makefile.mk @@ -74,11 +74,7 @@ CONFIGURE_ACTION=.$/configure CONFIGURE_FLAGS= --without-ssl --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)" LDFLAGS="$(curl_LDFLAGS)" BUILD_DIR=$(CONFIGURE_DIR)$/lib -.IF "$(OS)"=="IRIX" -BUILD_ACTION=gmake -.ELSE BUILD_ACTION=$(GNUMAKE) -.ENDIF BUILD_FLAGS+= -j$(EXTMAXPROCESS) OUT2LIB=$(BUILD_DIR)$/.libs$/libcurl$(DLLPOST).3 diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst index fe688e2c4b44..5ec84bca7d37 100644 --- a/desktop/prj/d.lst +++ b/desktop/prj/d.lst @@ -93,7 +93,7 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms ..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res -..\%__SRC%\misc\soffice.sh %_DEST%\bin%_EXT%\soffice +..\%__SRC%\misc\soffice.sh-expanded %_DEST%\bin%_EXT%\soffice ..\%__SRC%\misc\sbase.sh %_DEST%\bin%_EXT%\sbase ..\%__SRC%\misc\scalc.sh %_DEST%\bin%_EXT%\scalc ..\%__SRC%\misc\sdraw.sh %_DEST%\bin%_EXT%\sdraw diff --git a/desktop/scripts/makefile.mk b/desktop/scripts/makefile.mk index 52750ca0b44f..001ead351928 100644 --- a/desktop/scripts/makefile.mk +++ b/desktop/scripts/makefile.mk @@ -54,7 +54,18 @@ UNIXTEXT= \ $(MISC)$/unopkg.sh .IF "$(OS)" != "MACOSX" + +ALLTAR: $(MISC)$/soffice.sh-expanded + +$(MISC)/soffice.sh-expanded: $(MISC)/soffice.sh +.IF "$(OS)" == "LINUX" && "$(CPUNAME)" == "POWERPC" + $(SED) 's/^#@# //' $< > $@ +.ELSE + $(COPY) $< $@ +.ENDIF + UNIXTEXT+= $(MISC)$/soffice.sh + .ENDIF .INCLUDE : target.mk diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh index 7895d3ed1cd9..0690e9647f35 100644 --- a/desktop/scripts/soffice.sh +++ b/desktop/scripts/soffice.sh @@ -43,11 +43,8 @@ export SAL_ENABLE_FILE_LOCKING # working on your system. # SAL_NOOPENGL=true; export SAL_NOOPENGL -# the following test is needed on Linux PPC with IBM j2sdk142 -if [ "`uname -s`" = "Linux" -a "`uname -m`" = "ppc" ] ; then - JITC_PROCESSOR_TYPE=6 - export JITC_PROCESSOR_TYPE -fi +# The following is needed on Linux PPC with IBM j2sdk142: +#@# export JITC_PROCESSOR_TYPE=6 # resolve installation directory sd_cwd="`pwd`" @@ -129,11 +126,13 @@ export PATH "$sd_prog/$sd_binary" "$@" & trap 'kill -9 $!' TERM wait $! +sd_ret=$? -while [ $? -eq 79 ] +while [ $sd_ret -eq 79 ] do "$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" & wait $! + sd_ret=$? done -exit +exit $sd_ret diff --git a/desktop/source/pagein/makefile.mk b/desktop/source/pagein/makefile.mk index 85cbb4d3c9fd..626412877250 100644 --- a/desktop/source/pagein/makefile.mk +++ b/desktop/source/pagein/makefile.mk @@ -81,21 +81,25 @@ $(MISC)$/$(TARGET)-calc : makefile.mk @echo Making: $@ @-echo $(DLLPRE)sc$(DFTDLLPOST) > $@ @-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@ + @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@ $(MISC)$/$(TARGET)-draw : makefile.mk @echo Making: $@ @-echo $(DLLPRE)sd$(DFTDLLPOST) > $@ @-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@ + @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@ $(MISC)$/$(TARGET)-impress : makefile.mk @echo Making: $@ @-echo $(DLLPRE)sd$(DFTDLLPOST) > $@ @-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@ + @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@ $(MISC)$/$(TARGET)-writer : makefile.mk @echo Making: $@ @-echo $(DLLPRE)sw$(DFTDLLPOST) > $@ @-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@ + @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@ # sorted in approx. reverse load order (ld.so.1) $(MISC)$/$(TARGET)-common : makefile.mk @@ -121,7 +125,7 @@ $(MISC)$/$(TARGET)-common : makefile.mk @-echo $(DLLPRE)ucb1$(DLLPOST) >> $@ @-echo configmgr2$(UNODLLPOST) >> $@ # - @-echo $(DLLPRE)dtransX11$(DFTDLLPOST) >> $@ + @-echo $(DLLPRE)dtrans$(DLLPOST) >> $@ @-echo $(DLLPRE)vclplug_gen$(DFTDLLPOST) >> $@ .IF "$(ENABLE_GTK)" != "" @-echo $(DLLPRE)vclplug_gtk$(DFTDLLPOST) >> $@ @@ -130,7 +134,6 @@ $(MISC)$/$(TARGET)-common : makefile.mk @-echo $(DLLPRE)vclplug_kde$(DFTDLLPOST) >> $@ .ENDIF # ENABLE_KDE # - @-echo $(DLLPRE)psp$(DFTDLLPOST) >> $@ @-echo $(DLLPRE)basegfx$(DFTDLLPOST) >> $@ @-echo $(DLLPRE)sot$(DFTDLLPOST) >> $@ @-echo $(DLLPRE)xcr$(DFTDLLPOST) >> $@ diff --git a/desktop/source/pkgchk/unopkg/makefile.mk b/desktop/source/pkgchk/unopkg/makefile.mk index 3562fad961d9..4a1f409f4564 100644 --- a/desktop/source/pkgchk/unopkg/makefile.mk +++ b/desktop/source/pkgchk/unopkg/makefile.mk @@ -49,6 +49,7 @@ PRJINC += ..$/..$/deployment ..$/.. CFLAGS+=-DSYSTEM_DB -I$(DB_INCLUDES) .ENDIF +.IF "$(LINK_SO)"!="" APP1TARGET = so$/unopkg APP1OBJS = $(OBJFILES) APP1STDLIBS = $(SALLIB) $(UNOPKGAPPLIB) @@ -59,6 +60,7 @@ APP1RPATH = BRAND APP1ICON = $(SOLARRESDIR)$/icons/so9_main_app.ico APP1LINKRES = $(MISC)$/$(TARGET)1.res .ENDIF +.ENDIF # "$(LINK_SO)"!="" APP2TARGET = unopkg APP2OBJS = $(OBJFILES) diff --git a/desktop/util/makefile.mk b/desktop/util/makefile.mk index 05f129b3c5fc..82cad8c095ad 100644 --- a/desktop/util/makefile.mk +++ b/desktop/util/makefile.mk @@ -79,6 +79,7 @@ RESLIB1SRSFILES= $(SRS)$/desktop.srs \ $(SRS)$/wizard.srs .IF "$(L10N_framework)"=="" +.IF "$(LINK_SO)"=="TRUE" .IF "$(GUI)" != "OS2" APP1TARGET=so$/$(TARGET) APP1NOSAL=TRUE @@ -119,12 +120,6 @@ APP1STDLIBS = \ $(VOSLIB) -.IF "$(GUI)" == "UNX" -.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD" -APP1STDLIBS+= -lXext -.ENDIF -.ENDIF - APP1DEPN= $(APP1RES) verinfo.rc .IF "$(GUI)" == "WNT" @@ -143,6 +138,8 @@ APP1STACK=10000000 .ENDIF # "$(GUI)" != "OS2" +.ENDIF # "$(LINK_SO)"=="TRUE" + APP5TARGET=soffice APP5NOSAL=TRUE APP5RPATH=BRAND @@ -206,6 +203,7 @@ APP5LINKRES=$(MISC)$/ooffice.res .ENDIF # OS2 .IF "$(GUI)" == "WNT" +.IF "$(LINK_SO)"=="TRUE" APP6TARGET=so$/officeloader APP6RES=$(RES)$/soloader.res APP6NOSAL=TRUE @@ -218,6 +216,7 @@ APP6OBJS = \ $(OBJ)$/officeloader.obj \ $(SOLARLIBDIR)$/pathutils-obj.obj STDLIB6=$(ADVAPI32LIB) $(SHELL32LIB) $(SHLWAPILIB) +.ENDIF # "$(LINK_SO)"=="TRUE" APP7TARGET=officeloader APP7RES=$(RES)$/ooloader.res @@ -265,7 +264,9 @@ $(APP6TARGETN) : $(MISC)$/binso_created.flg ALLTAR: $(MISC)$/$(TARGET).exe.manifest ALLTAR: $(MISC)$/$(TARGET).bin.manifest ALLTAR: $(BIN)$/$(TARGET).bin +.IF "$(LINK_SO)"=="TRUE" ALLTAR: $(BIN)$/so$/$(TARGET).bin +.ENDIF # "$(LINK_SO)"=="TRUE" .ENDIF # WNT .IF "$(GUI)" == "OS2" @@ -276,23 +277,29 @@ $(BIN)$/soffice_oo$(EXECPOST) : $(APP5TARGETN) $(COPY) $< $@ .IF "$(GUI)" != "OS2" +.IF "$(LINK_SO)"=="TRUE" $(BIN)$/so$/soffice_so$(EXECPOST) : $(APP1TARGETN) $(COPY) $< $@ -ALLTAR : $(BIN)$/so$/soffice_so$(EXECPOST) $(BIN)$/soffice_oo$(EXECPOST) - +ALLTAR : $(BIN)$/so$/soffice_so$(EXECPOST) +.ENDIF # "$(LINK_SO)"=="TRUE" +ALLTAR : $(BIN)$/soffice_oo$(EXECPOST) .ENDIF .IF "$(OS)" == "MACOSX" +.IF "$(LINK_SO)"=="TRUE" $(BIN)$/so$/soffice_mac$(EXECPOST) : $(APP1TARGETN) $(COPY) $< $@ +ALLTAR : $(BIN)$/so$/soffice_mac$(EXECPOST) +.ENDIF # "$(LINK_SO)"=="TRUE" + $(BIN)$/soffice_mac$(EXECPOST) : $(APP5TARGETN) $(COPY) $< $@ -ALLTAR : $(BIN)$/so$/soffice_mac$(EXECPOST) $(BIN)$/soffice_mac$(EXECPOST) +ALLTAR : $(BIN)$/soffice_mac$(EXECPOST) -.ENDIF +.ENDIF # "$(OS)" == "MACOSX" .IF "$(GUI)" == "WNT" diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc index 8f1840afbed9..105933ff130d 100644 --- a/desktop/util/verinfo.rc +++ b/desktop/util/verinfo.rc @@ -101,42 +101,42 @@ VS_VERSION_INFO versioninfo } } -2 ICON "icons\\so9_writer_doc.ico" -3 ICON "icons\\so9_writer_tem.ico" -4 ICON "icons\\so9_calc_doc.ico" -5 ICON "icons\\so9_calc_tem.ico" -6 ICON "icons\\so9_draw_doc.ico" -7 ICON "icons\\so9_draw_tem.ico" -8 ICON "icons\\so9_impress_doc.ico" -9 ICON "icons\\so9_impress_tem.ico" -10 ICON "icons\\so9_impress_doc.ico" -11 ICON "icons\\so9_global_doc.ico" -12 ICON "icons\\so9_html_doc.ico" -13 ICON "icons\\so9_chart_doc.ico" -14 ICON "icons\\so9_base_doc.ico" -15 ICON "icons\\so9_math_doc.ico" -16 ICON "icons\\so9_empty_tem.ico" -17 ICON "icons\\so9_macro_doc.ico" +2 ICON "icons\\oasis-text.ico" +3 ICON "icons\\oasis-text-template.ico" +4 ICON "icons\\oasis-spreadsheet.ico" +5 ICON "icons\\oasis-spreadsheet-template.ico" +6 ICON "icons\\oasis-drawing.ico" +7 ICON "icons\\oasis-drawing-template.ico" +8 ICON "icons\\oasis-presentation.ico" +9 ICON "icons\\oasis-presentation-template.ico" +10 ICON "icons\\oasis-presentation-template.ico" +11 ICON "icons\\oasis-master-document.ico" +12 ICON "icons\\oasis-web-template.ico" +13 ICON "icons\\oasis-empty-document.ico" +14 ICON "icons\\oasis-database.ico" +15 ICON "icons\\oasis-formula.ico" +16 ICON "icons\\empty-template.ico" +17 ICON "icons\\empty-document.ico" 18 ICON "icons\\so8-configuration.ico" 19 ICON "icons\\so8-open.ico" -20 ICON "icons\\so8-image-doc.ico" +20 ICON "icons\\empty-document.ico" 21 ICON "icons\\so9_writer_app.ico" 22 ICON "icons\\so9_calc_app.ico" 23 ICON "icons\\so9_draw_app.ico" 24 ICON "icons\\so9_impress_app.ico" 25 ICON "icons\\so9_math_app.ico" 26 ICON "icons\\so9_base_app.ico" -27 ICON "icons\\so9_empty_doc.ico" -28 ICON "icons\\so7-writer-doc.ico" -29 ICON "icons\\so7-writer-tem.ico" -30 ICON "icons\\so7-calc-doc.ico" -31 ICON "icons\\so7-calc-tem.ico" -32 ICON "icons\\so7-draw-doc.ico" -33 ICON "icons\\so7-draw-tem.ico" -34 ICON "icons\\so7-impress-doc.ico" -35 ICON "icons\\so7-impress-tem.ico" -36 ICON "icons\\so7-master-doc.ico" -37 ICON "icons\\so7-chart-doc.ico" -38 ICON "icons\\so7-base-doc.ico" -39 ICON "icons\\so7-math-doc.ico" +27 ICON "icons\\oasis-empty-document.ico" +28 ICON "icons\\text.ico" +29 ICON "icons\\text-template.ico" +30 ICON "icons\\spreadsheet.ico" +31 ICON "icons\\spreadsheet-template.ico" +32 ICON "icons\\drawing.ico" +33 ICON "icons\\drawing-template.ico" +34 ICON "icons\\presentation.ico" +35 ICON "icons\\presentation-template.ico" +36 ICON "icons\\master-document.ico" +37 ICON "icons\\empty-document.ico" +38 ICON "icons\\database.ico" +39 ICON "icons\\formula.ico" 40 ICON "icons\\oxt-extension.ico" diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp index fb29c13d3a1c..c51dcd105bfd 100644 --- a/desktop/win32/source/setup/setup.cpp +++ b/desktop/win32/source/setup/setup.cpp @@ -76,6 +76,7 @@ #define PARAM_PATCH TEXT( " /update " ) #define PARAM_REG_ALL_MSO_TYPES TEXT( "REGISTER_ALL_MSO_TYPES=1 " ) #define PARAM_REG_NO_MSO_TYPES TEXT( "REGISTER_NO_MSO_TYPES=1 " ) +#define PARAM_SILENTINSTALL TEXT( " /QB" ) #define PARAM_RUNNING TEXT( "ignore_running" ) #define CMDLN_REG_ALL_MSO_TYPES TEXT( "msoreg=1" ) @@ -85,6 +86,11 @@ #define ADVAPI32_DLL TEXT( "advapi32.dll" ) #define PROFILE_NAME TEXT( "setup.ini" ) +#define RUNTIME_X64_NAME TEXT( "redist\\vcredist_x64.exe" ) +#define RUNTIME_X86_NAME TEXT( "redist\\vcredist_x86.exe" ) +#define PRODUCTCODE_X86 TEXT( "{E503B4BF-F7BB-3D5F-8BC8-F694B1CFF942}" ) +#define PRODUCTCODE_X64 TEXT( "{350AA351-21FA-3270-8B7A-835434E766AD}" ) + #define MSIAPI_DllGetVersion "DllGetVersion" #define ADVAPI32API_CheckTokenMembership "CheckTokenMembership" @@ -1897,6 +1903,114 @@ boolean SetupAppX::IsPatchInstalled( TCHAR* pBaseDir, TCHAR* pFileName ) } //-------------------------------------------------------------------------- +boolean SetupAppX::InstallRuntimes( TCHAR *sProductCode, TCHAR *sRuntimePath ) +{ + INSTALLSTATE nRet = MsiQueryProductState( sProductCode ); + OutputDebugStringFormat( TEXT( "MsiQueryProductState returned <%d>\r\n" ), nRet ); + if ( nRet == INSTALLSTATE_DEFAULT ) + return true; + + Log( TEXT( " Will install runtime <%s>\r\n" ), sRuntimePath ); + OutputDebugStringFormat( TEXT( " Will install runtime <%s>\r\n" ), sRuntimePath ); + + STARTUPINFO aSUI; + PROCESS_INFORMATION aPI; + + ZeroMemory( (void*)&aPI, sizeof( PROCESS_INFORMATION ) ); + ZeroMemory( (void*)&aSUI, sizeof( STARTUPINFO ) ); + + aSUI.cb = sizeof(STARTUPINFO); + aSUI.dwFlags = STARTF_USESHOWWINDOW; + aSUI.wShowWindow = SW_SHOW; + + DWORD nCmdLineLength = lstrlen( sRuntimePath ) + lstrlen( PARAM_SILENTINSTALL ) + 2; + TCHAR *sCmdLine = new TCHAR[ nCmdLineLength ]; + + if ( FAILED( StringCchCopy( sCmdLine, nCmdLineLength, sRuntimePath ) ) || + FAILED( StringCchCat( sCmdLine, nCmdLineLength, PARAM_SILENTINSTALL ) ) ) + { + delete [] sCmdLine; + SetError( ERROR_INSTALL_FAILURE ); + return false; + } + + if ( !WIN::CreateProcess( NULL, sCmdLine, NULL, NULL, FALSE, + CREATE_DEFAULT_ERROR_MODE, NULL, NULL, + &aSUI, &aPI ) ) + { + Log( TEXT( "ERROR: Could not create process %s.\r\n" ), sCmdLine ); + SetError( WIN::GetLastError() ); + delete [] sCmdLine; + return false; + } + + DWORD nResult = WaitForProcess( aPI.hProcess ); + bool bRet = true; + + if( ERROR_SUCCESS != nResult ) + { + Log( TEXT( "ERROR: While waiting for %s.\r\n" ), sCmdLine ); + SetError( nResult ); + bRet = false; + } + else + { + GetExitCodeProcess( aPI.hProcess, &nResult ); + SetError( nResult ); + + if ( nResult != ERROR_SUCCESS ) + { + TCHAR sBuf[80]; + StringCchPrintf( sBuf, 80, TEXT("Warning: install runtime returned %u.\r\n"), nResult ); + Log( sBuf ); + } + else + Log( TEXT( " Installation of runtime completed successfully.\r\n" ) ); + } + + CloseHandle( aPI.hProcess ); + + delete [] sCmdLine; + + return bRet; +} + +//-------------------------------------------------------------------------- +boolean SetupAppX::InstallRuntimes() +{ + TCHAR *sRuntimePath = 0; + SYSTEM_INFO siSysInfo; + + GetNativeSystemInfo(&siSysInfo); + + OutputDebugStringFormat( TEXT( "found architecture<%d>\r\n" ), siSysInfo.wProcessorArchitecture ); + + if ( siSysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ) + { + if ( GetPathToFile( RUNTIME_X64_NAME, &sRuntimePath ) ) + InstallRuntimes( PRODUCTCODE_X64, sRuntimePath ); + else + Log( TEXT( "ERROR: no installer for x64 runtime libraries found!" ) ); + + if ( sRuntimePath ) + { + delete [] sRuntimePath; + sRuntimePath = 0; + } + } + + if ( GetPathToFile( RUNTIME_X86_NAME, &sRuntimePath ) ) + InstallRuntimes( PRODUCTCODE_X86, sRuntimePath ); + else + Log( TEXT( "ERROR: no installer for x86 runtime libraries found!" ) ); + + if ( sRuntimePath ) + delete [] sRuntimePath; + + return true; +} + +//-------------------------------------------------------------------------- //-------------------------------------------------------------------------- LanguageDataX::LanguageDataX( LPTSTR pData ) { diff --git a/desktop/win32/source/setup/setup.hxx b/desktop/win32/source/setup/setup.hxx index 72785cc75b31..169254db87ab 100644 --- a/desktop/win32/source/setup/setup.hxx +++ b/desktop/win32/source/setup/setup.hxx @@ -119,12 +119,13 @@ private: LPTSTR *pNext, boolean bStripQuotes = false ); boolean IsAdmin(); - boolean GetCommandLine(); boolean IsTerminalServerInstalled() const; void AddFileToPatchList( TCHAR* pPath, TCHAR* pFile ); boolean IsPatchInstalled( TCHAR* pBaseDir, TCHAR* pFileName ); + boolean InstallRuntimes( TCHAR* pProductCode, TCHAR* pFileName ); + public: SetupAppX(); ~SetupAppX(); @@ -136,6 +137,7 @@ public: virtual boolean ChooseLanguage( long& rLanguage ); virtual boolean CheckVersion(); virtual boolean CheckForUpgrade(); + virtual boolean InstallRuntimes(); virtual boolean Install( long nLanguage ); virtual UINT GetError() const; diff --git a/desktop/win32/source/setup/setup_main.cxx b/desktop/win32/source/setup/setup_main.cxx index 515363749c55..6c96bde46b12 100644 --- a/desktop/win32/source/setup/setup_main.cxx +++ b/desktop/win32/source/setup/setup_main.cxx @@ -124,6 +124,9 @@ extern "C" int __stdcall WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, int ) if ( ! pSetup->ChooseLanguage( nLanguage ) ) throw pSetup->GetError(); + if ( ! pSetup->InstallRuntimes() ) + throw pSetup->GetError(); + if ( ! pSetup->Install( nLanguage ) ) throw pSetup->GetError(); } diff --git a/desktop/win32/source/setup/setup_main.hxx b/desktop/win32/source/setup/setup_main.hxx index 67b54adc0d2a..28200fcae757 100644 --- a/desktop/win32/source/setup/setup_main.hxx +++ b/desktop/win32/source/setup/setup_main.hxx @@ -53,6 +53,7 @@ public: virtual boolean ChooseLanguage( long& rLanguage ) = 0; virtual boolean CheckVersion() = 0; virtual boolean CheckForUpgrade() = 0; + virtual boolean InstallRuntimes() = 0; virtual boolean Install( long nLanguage ) = 0; virtual UINT GetError() const = 0; diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx index 4e316232bd81..376e1d626927 100644 --- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx @@ -36,7 +36,7 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX -#include <vcl/bitmap.hxx> +#include <vcl/bitmapex.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/vector/b2dvector.hxx> @@ -56,7 +56,7 @@ namespace drawinglayer { class FillBitmapAttribute { - Bitmap maBitmap; + BitmapEx maBitmapEx; basegfx::B2DPoint maTopLeft; basegfx::B2DVector maSize; @@ -64,11 +64,15 @@ namespace drawinglayer unsigned mbTiling : 1; public: - FillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling); + FillBitmapAttribute( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rTopLeft, + const basegfx::B2DVector& rSize, + bool bTiling); bool operator==(const FillBitmapAttribute& rCandidate) const; // data access - const Bitmap& getBitmap() const { return maBitmap; } + const BitmapEx& getBitmapEx() const { return maBitmapEx; } const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; } const basegfx::B2DVector& getSize() const { return maSize; } bool getTiling() const { return mbTiling; } diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx new file mode 100644 index 000000000000..d8eed659f5e7 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: strokeattribute.hxx,v $ + * + * $Revision: 1.5 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX + +#include <sal/config.h> +#include <sal/types.h> +#include <tools/string.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + /** FontAttribute class + + This attribute class is able to hold all parameters needed/used + to completely define the parametrisation of a text portion. + */ + class FontAttribute + { + private: + /// core data + String maFamilyName; // Font Family Name + String maStyleName; // Font Style Name + sal_uInt16 mnWeight; // Font weight + + /// bitfield + unsigned mbSymbol : 1; // Symbol Font Flag + unsigned mbVertical : 1; // Vertical Text Flag + unsigned mbItalic : 1; // Italic Flag + unsigned mbOutline : 1; // Outline Flag + unsigned mbRTL : 1; // RTL Flag + unsigned mbBiDiStrong : 1; // BiDi Flag + // TODO: pair kerning and CJK kerning + + public: + /// constructor + FontAttribute( + const String& rFamilyName, + const String& rStyleName, + sal_uInt16 nWeight, + bool bSymbol = false, + bool bVertical = false, + bool bItalic = false, + bool bOutline = false, + bool bRTL = false, + bool bBiDiStrong = false) + : maFamilyName(rFamilyName), + maStyleName(rStyleName), + mnWeight(nWeight), + mbSymbol(bSymbol), + mbVertical(bVertical), + mbItalic(bItalic), + mbOutline(bOutline), + mbRTL(bRTL), + mbBiDiStrong(bBiDiStrong) + { + } + + FontAttribute() + : maFamilyName(), + maStyleName(), + mnWeight(0), + mbSymbol(false), + mbVertical(false), + mbItalic(false), + mbOutline(false), + mbRTL(false), + mbBiDiStrong(false) + { + } + + /// compare operator + bool operator==(const FontAttribute& rCompare) const; + + /// data read access + const String& getFamilyName() const { return maFamilyName; } + const String& getStyleName() const { return maStyleName; } + sal_uInt16 getWeight() const { return mnWeight; } + bool getSymbol() const { return mbSymbol; } + bool getVertical() const { return mbVertical; } + bool getItalic() const { return mbItalic; } + bool getOutline() const { return mbOutline; } + bool getRTL() const { return mbRTL; } + bool getBiDiStrong() const { return mbBiDiStrong; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx index 6fdf3200543c..10288b70bd1b 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx @@ -44,23 +44,52 @@ namespace drawinglayer { namespace primitive2d { + /** AlphaPrimitive2D class + + This is the basic primitive for applying freely defined transparence + to freely defined content. The basic idea is to associate a content + which is defined as a sequence of primitives and hold as child content + in the GroupPrimitive2D with an alpha channel also defined as a sequence + of primitives and hold in the Alpha member. + + The basic definition is to use the Alpha content as Alpha-Mask by + interpreting the Alpha-content not as RGB, but as Luminance alpha mask + using the common RGB_to_luminance definition as e.g. used by VCL. + + The defining geometry is the Range of the child primitive sequence, + this means the renderers will/shall use this geometric information for + rendering, not the alpha one. The alpha one should/will be clipped + accordingly. + */ class AlphaPrimitive2D : public GroupPrimitive2D { private: - Primitive2DSequence maAlpha; // transparence sequence + /// The Alpha-Mask who's RGB-Values are interpreted as Luminance + Primitive2DSequence maAlpha; public: + /** constructor + + @param rChildren + The content which is defined to have a transparency. The + range of this primitive is defined by this content + + @param rAlpha + The definition of the Alpha-channel for this primitive. It + will be interpreted as mask by interpreting as gray values + using the common RGB_to_luminance definitions + */ AlphaPrimitive2D( const Primitive2DSequence& rChildren, const Primitive2DSequence& rAlpha); - // get data + /// data read access const Primitive2DSequence& getAlpha() const { return maAlpha; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx index 41ae18b30fc9..cd6133dc54d8 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx @@ -38,6 +38,7 @@ #include <drawinglayer/primitive2d/groupprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// // predefines @@ -51,50 +52,59 @@ namespace drawinglayer { namespace primitive2d { + /** AnimatedSwitchPrimitive2D class + + This is the basic class for simple, animated primitives. The basic idea + is to have an animation definition (AnimationEntry) who's basic + functionality is to return a state value for any given animation time in + the range of [0.0 .. 1.0]. Depending on the state, the decomposition + calculates an index, which of the members of the child vector is to + be visualized. + + An example: For blinking, the Child vector should exist of two entries; + for values of [0.0 .. 0.5] the first, else the last entry will be used. + This mechanism is not limited to two entries, though. + */ class AnimatedSwitchPrimitive2D : public GroupPrimitive2D { private: - // the animation definition which allows translation of a point in time - // to an animation state [0.0 .. 1.0]. This member contains a cloned - // definition and is owned by this implementation + /** + The animation definition which allows translation of a point in time + to an animation state [0.0 .. 1.0]. This member contains a cloned + definition and is owned by this implementation. + */ animation::AnimationEntry* mpAnimationEntry; - // the last remembered decompose time, created and used by getDecomposition() for - // buffering purposes - double mfDecomposeViewTime; - - // bitfield - // flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate - // between both types if they are on/off + /// bitfield + /** flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate + between both types if they are on/off + */ unsigned mbIsTextAnimation : 1; - protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - public: + /// constructor AnimatedSwitchPrimitive2D( const animation::AnimationEntry& rAnimationEntry, const Primitive2DSequence& rChildren, bool bIsTextAnimation); + + /// destructor - needed due to mpAnimationEntry virtual ~AnimatedSwitchPrimitive2D(); - // get data + /// data read access const animation::AnimationEntry& getAnimationEntry() const { return *mpAnimationEntry; } bool isTextAnimation() const { return mbIsTextAnimation; } bool isGraphicAnimation() const { return !isTextAnimation(); } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range - virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() - // The getDecomposition is overloaded here since the decompose is dependent of the point in time, - // so the default implementation is nut useful here, it needs to be handled locally + /** The getDecomposition is overloaded here since the decompose is dependent of the point in time, + so the default implementation is nut useful here, it needs to be handled locally + */ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d @@ -106,84 +116,63 @@ namespace drawinglayer { namespace primitive2d { + /** AnimatedBlinkPrimitive2D class + + Basically the same mechanism as in AnimatedSwitchPrimitive2D, but the + decomposition is specialized in delivering the children in the + range [0.0.. 0.5] and an empty sequence else + */ class AnimatedBlinkPrimitive2D : public AnimatedSwitchPrimitive2D { protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - public: + /// constructor AnimatedBlinkPrimitive2D( const animation::AnimationEntry& rAnimationEntry, const Primitive2DSequence& rChildren, bool bIsTextAnimation); - // provide unique ID + /// create local decomposition + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -// helper class for AnimatedInterpolatePrimitive2D namespace drawinglayer { namespace primitive2d { - class BufferedMatrixDecompose - { - private: - // the matrix itself - basegfx::B2DHomMatrix maB2DHomMatrix; - - // the decomposition - basegfx::B2DVector maScale; - basegfx::B2DVector maTranslate; - double mfRotate; - double mfShearX; - - // flag if already decomposed, used by ensureDecompose() - bool mbDecomposed; + /** AnimatedInterpolatePrimitive2D class - public: - BufferedMatrixDecompose(const basegfx::B2DHomMatrix& rMatrix); - void ensureDecompose() const; - - // data access - const basegfx::B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; } - const basegfx::B2DVector& getScale() const { return maScale; } - const basegfx::B2DVector& getTranslate() const { return maTranslate; } - double getRotate() const { return mfRotate; } - double getShearX() const { return mfShearX; } - }; - } // end of anonymous namespace -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive2d - { + Specialized on multi-step animations based on matrix transformations. The + Child sequelce will be embedded in a matrix transformation. That transformation + will be linearly combined from the decomposed values and the animation value + to allow a smooth animation. + */ class AnimatedInterpolatePrimitive2D : public AnimatedSwitchPrimitive2D { private: - // the transformations - std::vector< BufferedMatrixDecompose > maMatrixStack; + /// the transformations + std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose > maMatrixStack; protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - public: + /// constructor AnimatedInterpolatePrimitive2D( const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack, const animation::AnimationEntry& rAnimationEntry, const Primitive2DSequence& rChildren, bool bIsTextAnimation); - // provide unique ID + /// create local decomposition + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx index 65977cfd4241..85cf5e236d4f 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx @@ -46,35 +46,48 @@ namespace drawinglayer { namespace primitive2d { - class BackgroundColorPrimitive2D : public BasePrimitive2D + /** BackgroundColorPrimitive2D class + + This primitive is defined to fill the whole visible Viewport with + the given color (and thus decomposes to a filled polygon). This + makes it a view-depnendent primitive by definition. It only has + a valid decomposition if a valid Viewport is given in the + ViewInformation2D at decomposition time. + + It will try to buffer it's last decomposition using maLastViewport + to detect changes in the get2DDecomposition call. + */ + class BackgroundColorPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the fill color to use basegfx::BColor maBColor; - // the last used viewInformation, used from getDecomposition for buffering + /// the last used viewInformation, used from getDecomposition for buffering basegfx::B2DRange maLastViewport; protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor BackgroundColorPrimitive2D( const basegfx::BColor& rBColor); - // get data + /// data read access const basegfx::BColor& getBColor() const { return maBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get 2d range + /// get B2Drange virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() - // Overload standard getDecomposition call to be view-dependent here + /// Overload standard getDecomposition call to be view-dependent here virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx index b05c60394ecd..6cf45ffefe54 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -43,16 +43,17 @@ #include <basegfx/range/b2drange.hxx> ////////////////////////////////////////////////////////////////////////////// -// defines for DeclPrimitrive2DIDBlock and ImplPrimitrive2DIDBlock -// Added to be able to simply change identification stuff later, e.g. add -// a identification string and/or ID to the interface and to the implementation -// ATM used to delclare implement getPrimitiveID() +/** defines for DeclPrimitrive2DIDBlock and ImplPrimitrive2DIDBlock + Added to be able to simply change identification stuff later, e.g. add + a identification string and/or ID to the interface and to the implementation + ATM used to delclare implement getPrimitive2DID() +*/ #define DeclPrimitrive2DIDBlock() \ - virtual sal_uInt32 getPrimitiveID() const; + virtual sal_uInt32 getPrimitive2DID() const; #define ImplPrimitrive2DIDBlock(TheClass, TheID) \ - sal_uInt32 TheClass::getPrimitiveID() const { return TheID; } + sal_uInt32 TheClass::getPrimitive2DID() const { return TheID; } ////////////////////////////////////////////////////////////////////////////// // predefines @@ -61,6 +62,13 @@ namespace drawinglayer { namespace geometry { class ViewInformation2D; }} +namespace drawinglayer { namespace primitive2d { + /// typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference + typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase; + typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference; + typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence; +}} + ////////////////////////////////////////////////////////////////////////////// // basePrimitive2D class @@ -68,101 +76,222 @@ namespace drawinglayer { namespace primitive2d { - // typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference - typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase; - typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference; - typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence; - - // base class for all C++ implementations of com::sun::star::graphic::XPrimitive2D. This class - // is strongly virtual due to the lack of getPrimitiveID() implementation. This is by purpose, this - // base class shall not be incarnated and be used directly as a XPrimitive2D. + /** BasePrimitive2D class + + Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D + + This class is strongly virtual due to the lack of getPrimitiveID() implementation. + This is by purpose, this base class shall not be incarnated and be used directly as + a XPrimitive2D. + + Is is derived from boost::noncopyable to make clear that a primitive is a read-only + instance and copying or changing values is not intended. The idea is to hold all data + needed for visualisation of this primitive in unchangeable form. + + It is derived from comphelper::OBaseMutex to have a Mutex at hand; in a base + implementation this may not be needed, but e.g. when buffering at last decomposition + in a local member, multiple threads may try to decompose at the same time, so locking + is needed to avoid race conditions seen from the UNO object implementation. + + A method to get a simplified representation is provided by get2DDecomposition. The + default implementation returns an empty sequence. The idea is that processors + using this primitive and do not know it, may get the decomposition and process + these instead. An example is e.g. a fat line, who's decomposition may contain + the geometric representation of that line using filled polygon prmimitives. When + the renderer knows how to handle fat lines, he may proccess this primitive directly; + if not he can use the decomposition. With this functionality, renderers may operate by + knowing only a small set of primitives. + + When a primitive does not implement get2DDecomposition, it is called a 'Basic Primitive' and + belongs to the set of primitives which a processor should be able to handle. Practice + will define this minimal sets of primitives. When defined and the concept is prooved, + unique UNO APIs may be defined/implemented for these set to allow more intense work + with primitives using UNO. + + Current Basic 2D Primitives are: + + - BitmapPrimitive2D (bitmap data, evtl. with alpha) + - MetafilePrimitive2D (VCL Metafile, currently no decomposition, but planned, so may vanish) + - PointArrayPrimitive2D (single points) + - PolygonHairlinePrimitive2D (hairline curves/polygons) + - PolyPolygonColorPrimitive2D (colored polygons) + + All other implemented primitives have a defined decomposition and can thus be + decomposed downt to this small set. + + A renderer implementing support for this minimal set of primitives can completely + render primitive-based visualisations. Of course, he also has to take states into account + which are representated by GroupPrimitive2D derivations, see groupprimitive2d.hxx + + To support getting the geometric BoundRect, getB2DRange is used. The default + implementation will use the get2DDecomposition result and merge a range from the + entries. Thus, an implementation is only necessary for the Basic Primitives, but + of course speedups are possible (and are used) by implementing the method at higher-level + primitives. + + For primitive identification, getPrimitiveID is used currently in this implementations + to allow a fast switch/case processing. This needs a unique identifier mechanism which + currently uses defines (see drawinglayer_primitivetypes2d.hxx). For UNO prmitive API + it will be needed to add a unique descriptor (Name?) later to the API. + + This base implementation provides mappings from the methods from XPrimitive2D + (getDecomposition/getRange) to the appropriate methods in the C++ implementations + (get2DDecomposition/getB2DRange). The PropertyValue ViewParameters is converted to + the appropriate C++ implementation class ViewInformation2D. + + This base class does not implement any buffering; e.g. buffering the decompositon + and/or the range. These may be buffered anytime since the definition is that the primitive + is read-only and thus unchangeable. This implies that the decomposition and/or getting + the range will lead to the same result as last time, under the precondition that + the parameter ViewInformation2D is the same as the last one. This is usually the case + for view-independent primitives which are defined by not using ViewInformation2D + in their get2DDecomposition/getB2DRange implementations. + */ class BasePrimitive2D : private boost::noncopyable, protected comphelper::OBaseMutex, public BasePrimitive2DImplBase { private: - // a sequence used for buffering the last createLocalDecomposition() result. Use - // the protected access methods to change. Only implementations of getDecomposition() - // should make use. - Primitive2DSequence maLocalDecomposition; - protected: - // access methods to maLocalDecomposition. The usage of this methods may allow - // later thread-safe stuff to be added if needed. Only to be used by getDecomposition() - // implementations for buffering the last decomposition. - const Primitive2DSequence& getLocalDecomposition() const { return maLocalDecomposition; } - void setLocalDecomposition(const Primitive2DSequence& rNew) { maLocalDecomposition = rNew; } - - // method which is to be used to implement the local decomposition of a 2D primitive. The default - // implementation will just return an empty decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - public: - // constructor + // constructor/destructor BasePrimitive2D(); + virtual ~BasePrimitive2D(); - // the ==operator is mainly needed to allow testing newly-created primitives against their last - // incarnation which buffers/holds the made decompositions. The default implementation - // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then - // based on this implementation + /** the ==operator is mainly needed to allow testing newly-created primitives against their last + incarnation which buffers/holds the made decompositions. The default implementation + uses getPrimitive2DID()-calls to test if it's the same ID at last. Overloaded implementation are then + based on this implementation + */ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; bool operator!=( const BasePrimitive2D& rPrimitive ) const { return !operator==(rPrimitive); } - // The default implementation will use getDecomposition results to create the range + /// The default implementation will use getDecomposition results to create the range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID for fast identifying of known primitive implementations in renderers. These use - // the the defines from primitivetypes2d.hxx to define unique IDs. - // This method is normally defined using DeclPrimitrive2DIDBlock() - virtual sal_uInt32 getPrimitiveID() const = 0; + /** provide unique ID for fast identifying of known primitive implementations in renderers. These use + the the defines from primitivetypes2d.hxx to define unique IDs. + This method is normally defined using DeclPrimitrive2DIDBlock() + */ + virtual sal_uInt32 getPrimitive2DID() const = 0; - // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty. - // It will set maLocalDecomposition to this obtained decomposition to buffer it. - // If the decomposition is also ViewInformation2D-dependent, this method needs to be overloaded and the - // ViewInformation2D for the last decomposition need to be remembered, too, and be used in the next call to decide if - // the buffered decomposition may be reused or not. + /// The default implementation will return an empty sequence virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; // // Methods from XPrimitive2D // - // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It - // will construct a ViewInformation2D from the ViewParameters for that purpose + /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It + will construct a ViewInformation2D from the ViewParameters for that purpose + */ virtual Primitive2DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException ); - // The getRange implementation for UNO API will use getRange from this implementation. It - // will construct a ViewInformation2D from the ViewParameters for that purpose + /** The getRange implementation for UNO API will use getRange from this implementation. It + will construct a ViewInformation2D from the ViewParameters for that purpose + */ virtual ::com::sun::star::geometry::RealRectangle2D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException ); }; } // end of namespace primitive2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// +// BufferedDecompositionPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + /** BufferedDecompositionPrimitive2D class + + Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D + which want to buffer the decomoposition result + + Buffering the decomposition is the most-used buffering and is thus used my most + primitive implementations which support a decomposition as base class. + + The buffering is done by holding the last decomposition in the local parameter + maBuffered2DDecomposition. The default implementation of get2DDecomposition checks + if maBuffered2DDecomposition is empty. If yes, it uses create2DDecomposition + to create the content. In all cases, maBuffered2DDecomposition is returned. + + For view-dependent primitives derived from Primitive2DBufferDecomposition more needs + to be done when the decomposition depends on parts of the parameter ViewInformation2D. + This defines a standard method for processing these: + + Implement a view-dependent get2DDecomposition doing te following steps: + (a) Locally extract needed parameters from ViewInformation2D to new, local parameters + (this may be a complete local copy of ViewInformation2D) + (b) If a buffered decomposition exists, ckeck if one of the new local parameters + differs from the corresponding locally remembered (as member) ones. If yes, + clear maBuffered2DDecomposition + (d) call baseclass::get2DDecomposition which will use create2DDecomposition + to fill maBuffered2DDecomposition if it's empty + (e) copy the new local parameters to the corresponding locally remembered ones + to identify if a new decomposition is needed at the next call + (f) return maBuffered2DDecomposition + */ + class BufferedDecompositionPrimitive2D + : public BasePrimitive2D + { + private: + /// a sequence used for buffering the last create2DDecomposition() result + Primitive2DSequence maBuffered2DDecomposition; + + protected: + /** access methods to maBuffered2DDecomposition. The usage of this methods may allow + later thread-safe stuff to be added if needed. Only to be used by getDecomposition() + implementations for buffering the last decomposition. + */ + const Primitive2DSequence& getBuffered2DDecomposition() const { return maBuffered2DDecomposition; } + void setBuffered2DDecomposition(const Primitive2DSequence& rNew) { maBuffered2DDecomposition = rNew; } + + /** method which is to be used to implement the local decomposition of a 2D primitive. The default + implementation will just return an empty decomposition + */ + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + // constructor/destructor + BufferedDecompositionPrimitive2D(); + + /** The getDecomposition default implementation will on demand use create2DDecomposition() if + maBuffered2DDecomposition is empty. It will set maBuffered2DDecomposition to this obtained decomposition + to buffer it. If the decomposition is also ViewInformation2D-dependent, this method needs to be + overloaded and the ViewInformation2D for the last decomposition need to be remembered, too, and + be used in the next call to decide if the buffered decomposition may be reused or not. + */ + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// // tooling namespace drawinglayer { namespace primitive2d { - // get B2DRange from a given Primitive2DReference + /// get B2DRange from a given Primitive2DReference basegfx::B2DRange getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation); - // get B2DRange from a given Primitive2DSequence + /// get B2DRange from a given Primitive2DSequence basegfx::B2DRange getB2DRangeFromPrimitive2DSequence(const Primitive2DSequence& rCandidate, const geometry::ViewInformation2D& aViewInformation); - // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D) - // and using compare operator + /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D) + and using compare operator + */ bool arePrimitive2DReferencesEqual(const Primitive2DReference& rA, const Primitive2DReference& rB); - // compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally + /// compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB); - // concatenate sequence + /// concatenate sequence void appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource); - // concatenate single Primitive2D + /// concatenate single Primitive2D void appendPrimitive2DReferenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DReference& rSource); } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx index d295c6ab4b89..f5de130febf9 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx @@ -47,28 +47,41 @@ namespace drawinglayer { namespace primitive2d { + /** BitmapPrimitive2D class + + This class is the central primitive for Bitmap-based primitives. + It provides RGBA-based bitmaps, currently using a BitmapEx from VCL. + This may change in the future to any other, maybe more general base + class providing 24bit RGBA. + */ class BitmapPrimitive2D : public BasePrimitive2D { private: + /// the RGBA Bitmap-data BitmapEx maBitmapEx; + + /** the object transformation from unit coordinates, defining + size, shear, rotate and position + */ basegfx::B2DHomMatrix maTransform; public: + /// constructor BitmapPrimitive2D( const BitmapEx& rBitmapEx, const basegfx::B2DHomMatrix& rTransform); - // get data + /// data read access const BitmapEx& getBitmapEx() const { return maBitmapEx; } const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx index 504ada20f8ac..b13528184f3b 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx @@ -46,25 +46,41 @@ namespace drawinglayer { namespace primitive2d { - class BorderLinePrimitive2D : public BasePrimitive2D + /** BorderLinePrimitive2D class + + This is the basic primitive to build frames around objects, e.g. tables. + It defines a single or double line from Start to nd using the LeftWidth, + Distance and RightWidth definitions. + The LineStart/End overlap is defined by the Extend(Inner|Outer)(Start|End) + definitions. + */ + class BorderLinePrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the line definition basegfx::B2DPoint maStart; basegfx::B2DPoint maEnd; + + /// the widths of single/double line double mfLeftWidth; double mfDistance; double mfRightWidth; + + /// edge overlap sizes double mfExtendInnerStart; double mfExtendInnerEnd; double mfExtendOuterStart; double mfExtendOuterEnd; + + /// the line color basegfx::BColor maRGBColor; - // bitfield + /// bitfield + /// flags to influence inside/outside creation unsigned mbCreateInside : 1; unsigned mbCreateOutside : 1; - // helpers + /// local helpers double getCorrectedLeftWidth() const { return basegfx::fTools::equal(1.0, mfLeftWidth) ? 0.0 : mfLeftWidth; @@ -106,10 +122,11 @@ namespace drawinglayer } protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor BorderLinePrimitive2D( const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd, @@ -124,7 +141,7 @@ namespace drawinglayer bool bCreateOutside, const basegfx::BColor& rRGBColor); - // get data + /// data read access const basegfx::B2DPoint& getStart() const { return maStart; } const basegfx::B2DPoint& getEnd() const { return maEnd; } double getLeftWidth() const { return mfLeftWidth; } @@ -138,10 +155,10 @@ namespace drawinglayer bool getCreateOutside() const { return mbCreateOutside; } const basegfx::BColor& getRGBColor() const { return maRGBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx index 95c53347debb..b153e04ee1cb 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx @@ -46,6 +46,12 @@ namespace drawinglayer { namespace primitive2d { + /** ChartPrimitive2D class + + This is a helper primitive which decomposes to the ChartMetaFile + visualisation. It is used to allow specific renderers to do something + direct for visualising the chart. + */ class ChartPrimitive2D : public GroupPrimitive2D { private: diff --git a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx index 0e69cb7bdfc0..5dd55405adf7 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx @@ -47,63 +47,74 @@ namespace drawinglayer { namespace primitive2d { - class ControlPrimitive2D : public BasePrimitive2D + /** ControlPrimitive2D class + + Base class for ControlPrimitive handling. It decoposes to a + graphical representation (Bitmap data) of the control. This + representation is limited to a quadratic pixel maximum defined + in the applicatin settings. + */ + class ControlPrimitive2D : public BufferedDecompositionPrimitive2D { private: - // object's base data + /// object's base data basegfx::B2DHomMatrix maTransform; com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel; - // the created an cached awt::XControl + /// the created an cached awt::XControl com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxXControl; - // the last used scaling, used from getDecomposition for buffering + /// the last used scaling, used from getDecomposition for buffering basegfx::B2DVector maLastViewScaling; - // used from getXControl() to create a local awt::XControl which is remembered in mxXControl - // and from thereon always used and returned by getXControl() + /** used from getXControl() to create a local awt::XControl which is remembered in mxXControl + and from thereon always used and returned by getXControl() + */ void createXControl(); - // single local decompositions, used from createLocalDecomposition() + /// single local decompositions, used from create2DDecomposition() Primitive2DReference createBitmapDecomposition(const geometry::ViewInformation2D& rViewInformation) const; Primitive2DReference createPlaceholderDecomposition(const geometry::ViewInformation2D& rViewInformation) const; protected: - // local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor ControlPrimitive2D( const basegfx::B2DHomMatrix& rTransform, const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel); - // constructor with an additional XControl as parameter to allow to hand it over at incarnation time - // if it exists. This will avoid to create a 2nd one on demand in createXControl() - // and thus double the XControls. + /** constructor with an additional XControl as parameter to allow to hand it over at incarnation time + if it exists. This will avoid to create a 2nd one on demand in createXControl() + and thus double the XControls. + */ ControlPrimitive2D( const basegfx::B2DHomMatrix& rTransform, const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel, const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& rxXControl); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& getControlModel() const { return mxControlModel; } - // mxControl access. This will on demand create the awt::XControl using createXControl() - // if it does not exist. It may already have been created or even handed over at - // incarnation + /** mxControl access. This will on demand create the awt::XControl using createXControl() + if it does not exist. It may already have been created or even handed over at + incarnation + */ const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& getXControl() const; - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() - // Overload standard getDecomposition call to be view-dependent here + /// Overload standard getDecomposition call to be view-dependent here virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx new file mode 100644 index 000000000000..04ddb73460fa --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: bitmapprimitive2d.hxx,v $ + * + * $Revision: 1.4 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// +// DiscreteBitmapPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + /** DiscreteBitmapPrimitive2D class + + This class defines a view-dependent BitmapPrimitive which has a + logic position for the top-left position and is always to be + painted in 1:1 pixel resolution. It will never be sheared, rotated + or scaled with the view. + */ + class DiscreteBitmapPrimitive2D : public ObjectAndViewTransformationDependentPrimitive2D + { + private: + /// the RGBA Bitmap-data + BitmapEx maBitmapEx; + + /** the top-left object position */ + basegfx::B2DPoint maTopLeft; + + protected: + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + DiscreteBitmapPrimitive2D( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rTopLeft); + + /// data read access + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 8d5d089f5800..d287482389b5 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -103,6 +103,12 @@ #define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52) #define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53) #define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54) +#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55) +#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56) +#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57) +#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58) +#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59) +#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60) ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx index e0da8a36c3f5..c27b6874891f 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx @@ -42,52 +42,65 @@ #include <basegfx/matrix/b2dhommatrix.hxx> ////////////////////////////////////////////////////////////////////////////// -// BackgroundColorPrimitive2D class +// Embedded3DPrimitive2D class namespace drawinglayer { namespace primitive2d { - class Embedded3DPrimitive2D : public BasePrimitive2D + /** Embedded3DPrimitive2D class + + This is a helper primitive which allows embedding of single 3D + primitives to the 2D primitive logic. It will get the scene it's + involved and thus the 3D transformation. With this information it + is able to provide 2D range data for a 3D primitive. + + This primitive will not be visualized and decomposes to a yellow + 2D rectangle to visualize that this should never be visualized + */ + class Embedded3DPrimitive2D : public BufferedDecompositionPrimitive2D { private: - // the sequence of 3d primitives + /// the sequence of 3d primitives primitive3d::Primitive3DSequence mxChildren3D; - // the 2D scene object transformation + /// the 2D scene object transformation basegfx::B2DHomMatrix maObjectTransformation; - // the 3D transformations + /// the 3D transformations geometry::ViewInformation3D maViewInformation3D; - // if the embedded 3D primitives contain shadow, these parameters are needed - // to extract the shadow wich is a sequence od 2D primitives and may expand - // the 2D range. Since every single 3D object in a scene may individually - // have shadow or not, these values need to be provided and prepared. The shadow - // distance itself (a 2D transformation) is part of the 3D shadow definition + /** if the embedded 3D primitives contain shadow, these parameters are needed + to extract the shadow wich is a sequence od 2D primitives and may expand + the 2D range. Since every single 3D object in a scene may individually + have shadow or not, these values need to be provided and prepared. The shadow + distance itself (a 2D transformation) is part of the 3D shadow definition + */ basegfx::B3DVector maLightNormal; double mfShadowSlant; basegfx::B3DRange maScene3DRange; - // the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked) + /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked) Primitive2DSequence maShadowPrimitives; - // #i96669# add simple range buffering for this primitive + /// #i96669# add simple range buffering for this primitive basegfx::B2DRange maB2DRange; - // bitfield - // flag if given 3D geometry is already cheched for shadow definitions and 2d shadows - // are created in maShadowPrimitives + /// bitfield + /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows + are created in maShadowPrimitives + */ unsigned mbShadow3DChecked : 1; - // private helpers + /// private helpers bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor Embedded3DPrimitive2D( const primitive3d::Primitive3DSequence& rxChildren3D, const basegfx::B2DHomMatrix& rObjectTransformation, @@ -96,7 +109,7 @@ namespace drawinglayer double fShadowSlant, const basegfx::B3DRange& rScene3DRange); - // get data + /// get data const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; } const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; } @@ -104,13 +117,13 @@ namespace drawinglayer double getShadowSlant() const { return mfShadowSlant; } const basegfx::B3DRange& getScene3DRange() const { return maScene3DRange; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx new file mode 100644 index 000000000000..0ebb29e153ec --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: backgroundcolorprimitive2d.hxx,v $ + * + * $Revision: 1.3 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <vcl/gfxlink.hxx> +#include <vcl/gdimtf.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** EpsPrimitive2D class */ + class EpsPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + /// the geometry definition + basegfx::B2DHomMatrix maEpsTransform; + + /// the Eps content definition + GfxLink maGfxLink; + + /// the replacement content definition + GDIMetaFile maMetaFile; + + protected: + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + EpsPrimitive2D( + const basegfx::B2DHomMatrix& rEpsTransform, + const GfxLink& rGfxLink, + const GDIMetaFile& rMetaFile); + + /// data read access + const basegfx::B2DHomMatrix& getEpsTransform() const { return maEpsTransform; } + const GfxLink& getGfxLink() const { return maGfxLink; } + const GDIMetaFile& getMetaFile() const { return maMetaFile; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + /// get B2Drange + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx index 1811b9bfaad9..7d2b084a9356 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx @@ -47,32 +47,49 @@ namespace drawinglayer { namespace primitive2d { - class FillBitmapPrimitive2D : public BasePrimitive2D + /** FillBitmapPrimitive2D class + + This class defines a bitmap filling for a rectangular area. The + Range is defined by the Transformation, the fill by the FillBitmapAttribute. + There, the fill consists of a Bitmap (not transparent) defining the fill data + and a Point/Vector pair defining the relative position/size [0.0 .. 1.0] + inside the area where the bitmap is positioned. A flag defines then if this + is tiled or not. + + Renderers should handle this primitive; it has a geometrically correct + decomposition, but on pixel oututs the areas where the tiled pieces are + aligned tend to show up (one overlapping or empty pixel) + */ + class FillBitmapPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the geometric definition basegfx::B2DHomMatrix maTransformation; + + /// the fill attributes attribute::FillBitmapAttribute maFillBitmap; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor FillBitmapPrimitive2D( const basegfx::B2DHomMatrix& rTransformation, const attribute::FillBitmapAttribute& rFillBitmap); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; } - // compare operator + /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx index ef5a52c6ddcf..0fd084c6fad0 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx @@ -40,38 +40,77 @@ #include <drawinglayer/attribute/fillattribute.hxx> ////////////////////////////////////////////////////////////////////////////// -// FillbitmapPrimitive2D class +// predefines + +namespace basegfx { class B2DPolygon; } + +////////////////////////////////////////////////////////////////////////////// +// FillGradientPrimitive2D class namespace drawinglayer { namespace primitive2d { - class FillGradientPrimitive2D : public BasePrimitive2D + /** FillGradientPrimitive2D class + + This class defines a gradient filling for a rectangular area. The + Range is defined by the Transformation, the gradient by the FillGradientAttribute. + + The decomposition will deliver the decomposed gradient, e.g. for an ellipse + gradient the various ellipses in various color steps will be created. + + I have added functionality to create both versions of filled decompositions: + Those who overlap and non-overlapping ones. The overlapping version is the + default one since it works with and without AntiAliasing. The non-overlapping + version is used in the MetafilePrimitive2D decomposition when the old XOR + paint was recorded. + */ + class FillGradientPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the geometric definition basegfx::B2DRange maObjectRange; + + /// the gradient definition attribute::FillGradientAttribute maFillGradient; + /// local helpers + void generateMatricesAndColors( + std::vector< basegfx::B2DHomMatrix >& rMatrices, + std::vector< basegfx::BColor >& rColors) const; + Primitive2DSequence createOverlappingFill( + const std::vector< basegfx::B2DHomMatrix >& rMatrices, + const std::vector< basegfx::BColor >& rColors, + const basegfx::B2DPolygon& rUnitPolygon) const; + Primitive2DSequence createNonOverlappingFill( + const std::vector< basegfx::B2DHomMatrix >& rMatrices, + const std::vector< basegfx::BColor >& rColors, + const basegfx::B2DPolygon& rUnitPolygon) const; + protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local helper + Primitive2DSequence createFill(bool bOverlapping) const; + + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor FillGradientPrimitive2D( const basegfx::B2DRange& rObjectRange, const attribute::FillGradientAttribute& rFillGradient); - // get data + /// data read access const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx index 04410429d4a3..1df3bb103eb0 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx @@ -40,41 +40,56 @@ #include <drawinglayer/attribute/fillattribute.hxx> ////////////////////////////////////////////////////////////////////////////// -// FillbitmapPrimitive2D class +// FillHatchPrimitive2D class namespace drawinglayer { namespace primitive2d { - class FillHatchPrimitive2D : public BasePrimitive2D + /** FillHatchPrimitive2D class + + This class defines a hatch filling for a rectangular area. The + Range is defined by the Transformation, the hatch by the FillHatchAttribute. + If the background is to be filled, a flag in FillHatchAttribute is set and + the BColor defines the background color. + + The decomposition will deliver the hatch lines. + */ + class FillHatchPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the geometric definition basegfx::B2DRange maObjectRange; + + /// the hatch definition attribute::FillHatchAttribute maFillHatch; + + /// hatch background color (if used) basegfx::BColor maBColor; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor FillHatchPrimitive2D( const basegfx::B2DRange& rObjectRange, const basegfx::BColor& rBColor, const attribute::FillHatchAttribute& rFillHatch); - // get data + /// data read access const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; } const basegfx::BColor& getBColor() const { return maBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx index 6d3826e7ee22..e6adcacc97e0 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx @@ -46,18 +46,39 @@ namespace drawinglayer { namespace primitive2d { - class GraphicPrimitive2D : public BasePrimitive2D + /** GraphicPrimitive2D class + + Primitive to hold graphics defined by GraphicObject and GraphicAttr + combination. This includes MetaFiles and diverse pixel-oriented graphic + formats. It even includes animated GIFs, Croppings and other changes + defined in GraphicAttr. + + This makes the decomposition contain a wide variety of possibilites, + too. From a simple BitmapPrimitive over AnimatedSwitchPrimitive2D, + MetafilePrimitive2D (with and without embedding in a masking when e.g. + the Metafile is bigger than the geometry) and embeddings in + TransformPrimitive2D and MaskPrimitive2D for croppings. + + The primitive geometry area is defined by Transform. + */ + class GraphicPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the geometric definition basegfx::B2DHomMatrix maTransform; + + /// the GraphicObject with all it's content possibilities GraphicObject maGraphicObject; + + /// The GraphicAttr with all it's modification possibilities GraphicAttr maGraphicAttr; protected: - // local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor(s) GraphicPrimitive2D( const basegfx::B2DHomMatrix& rTransform, const GraphicObject& rGraphicObject, @@ -66,19 +87,19 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rTransform, const GraphicObject& rGraphicObject); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } const GraphicObject& getGraphicObject() const { return maGraphicObject; } const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; } bool isTransparent() const; - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx index f0aad415bfce..4ba83fc75c88 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx @@ -48,29 +48,47 @@ namespace drawinglayer { namespace primitive2d { - class GridPrimitive2D : public BasePrimitive2D + /** GridPrimitive2D class + + This primitive is specialized to Grid visualisation. The graphic definition + (Transform) contains the whole grid area, but will of course be combined + with the visible area (Viewport) when decomposed. Also a reolution-dependent + point reduction is used to not create too much grid visualisation data. This + makes this primitive highly view-dependent and it dynamically buffers + the last decomposition dependent from the Viewport used. + */ + class GridPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// The geometry definition for the grid area basegfx::B2DHomMatrix maTransform; + + /// grid layout definitions double mfWidth; double mfHeight; double mfSmallestViewDistance; double mfSmallestSubdivisionViewDistance; sal_uInt32 mnSubdivisionsX; sal_uInt32 mnSubdivisionsY; + + /// Grid color for single-pixel grid points basegfx::BColor maBColor; + + /// The Bitmap (with alpha) for grid cross points BitmapEx maCrossMarker; - // the last used object to view transformtion and the last Viewport, - // used from getDecomposition for decide buffering + /** the last used object to view transformtion and the last Viewport, + used from getDecomposition for decide buffering + */ basegfx::B2DHomMatrix maLastObjectToViewTransformation; basegfx::B2DRange maLastViewport; protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor GridPrimitive2D( const basegfx::B2DHomMatrix& rTransform, double fWidth, @@ -82,7 +100,7 @@ namespace drawinglayer const basegfx::BColor& rBColor, const BitmapEx& rCrossMarker); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } double getWidth() const { return mfWidth; } double getHeight() const { return mfHeight; } @@ -93,16 +111,16 @@ namespace drawinglayer const basegfx::BColor& getBColor() const { return maBColor; } const BitmapEx& getCrossMarker() const { return maCrossMarker; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get 2d range + /// get 2d range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() - // Overload standard getDecomposition call to be view-dependent here + /// Overload standard getDecomposition call to be view-dependent here virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx index 855e65ba98f8..89b49420a3e7 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx @@ -45,27 +45,58 @@ namespace drawinglayer { namespace primitive2d { + /** GroupPrimitive2D class + + Baseclass for all grouping 2D primitives + + The grouping primitive in it's basic form is capable of holding + a child primitive content and returns it on decomposition on default. + It is used for two main purposes, but more may apply: + + - to transport extended information, e.g. for text classification, + see e.g. TextHierarchy*Primitive2D implementations. Since they + decompose to their child content, renderers not aware/interested + in that extra information will just ignore these primitives + + - to encapsulate common geometry, e.g. the ShadowPrimitive2D implements + applying a generic shadow to a child sequence by adding the needed + offset and color stuff in the decomposition + + In most cases the decomposition is straightforward, so by default + this primitive will not buffer the result and is not derived from + BufferedDecompositionPrimitive2D, but from BasePrimitive2D. + + A renderer has to take GroupPrimitive2D derivations into account which + are used to hold a state. + + Current Basic 2D StatePrimitives are: + + - AlphaPrimitive2D (objects with freely defined transparence) + - InvertPrimitive2D (for XOR) + - MaskPrimitive2D (for masking) + - ModifiedColorPrimitive2D (for a stack of color modifications) + - TransformPrimitive2D (for a transformation stack) + */ class GroupPrimitive2D : public BasePrimitive2D { private: - // the children. Declared private since this shall never be changed at all after construction + /// the children. Declared private since this shall never be changed at all after construction Primitive2DSequence maChildren; - protected: - // local decomposition. Implementation will just return children - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - public: - // constructor + /// constructor GroupPrimitive2D(const Primitive2DSequence& rChildren); - // data access + /// data read access const Primitive2DSequence& getChildren() const { return maChildren; } - // compare operator + /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; - // provide unique ID + /// local decomposition. Implementation will just return children + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx index 4e8357a3eac1..a1171cb846e0 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx @@ -47,32 +47,52 @@ namespace drawinglayer { namespace primitive2d { + /** HelplineStyle2D definition + + The available styles of Helplines + */ enum HelplineStyle2D { HELPLINESTYLE2D_POINT, HELPLINESTYLE2D_LINE }; - class HelplinePrimitive2D : public BasePrimitive2D + /** HelplinePrimitive2D class + + This primitive provides a view-dependent helpline definition. The Helpline + is defined by a line equation (Point and vector) and a style. When the style + is a line, dependent from Viewport the visible part of that Helpline is + constructed. For Point, a cross is constructed. This primitive is highly + view-dependent. + + The visualisation uses the two given colors to create a dashed line with + the given dash length. + */ + class HelplinePrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// Helpline geometry definition basegfx::B2DPoint maPosition; basegfx::B2DVector maDirection; HelplineStyle2D meStyle; + + /// Helpline style definition basegfx::BColor maRGBColA; basegfx::BColor maRGBColB; double mfDiscreteDashLength; - // the last used object to view transformtion and the last Viewport, - // used from getDecomposition for decide buffering + /** the last used object to view transformtion and the last Viewport, + used from getDecomposition for decide buffering + */ basegfx::B2DHomMatrix maLastObjectToViewTransformation; basegfx::B2DRange maLastViewport; protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor HelplinePrimitive2D( const basegfx::B2DPoint& rPosition, const basegfx::B2DVector& rDirection, @@ -81,7 +101,7 @@ namespace drawinglayer const basegfx::BColor& aRGBColB, double fDiscreteDashLength); - // get data + /// data read access const basegfx::B2DPoint getPosition() const { return maPosition; } const basegfx::B2DVector getDirection() const { return maDirection; } HelplineStyle2D getStyle() const { return meStyle; } @@ -89,13 +109,13 @@ namespace drawinglayer const basegfx::BColor& getRGBColB() const { return maRGBColB; } double getDiscreteDashLength() const { return mfDiscreteDashLength; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() - // Overload standard getDecomposition call to be view-dependent here + /// Overload standard getDecomposition call to be view-dependent here virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx index 2bbcad315eb3..3b69c685c985 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx @@ -44,30 +44,35 @@ namespace drawinglayer { namespace primitive2d { - // This primitive is used to represent geometry for non-visible objects, - // e.g. a PresObj's outline. To still be able to use primitives for HitTest - // functionality, the 2d decompositions will produce an as much as possible - // simplified line geometry encapsulated in this primtive when there is no - // line geometry. In a further enchanced version this may change to 'if neither - // filled nor lines' creation criteria. The whole primitive decomposes to nothing, - // so no one not knowing it will be influenced. Only helper processors for hit test - // (and maybe BoundRect extractors) will use it and it's children subcontent. + /** HitTestPrimitive2D class + + This primitive is used to represent geometry for non-visible objects, + e.g. a PresObj's outline. To still be able to use primitives for HitTest + functionality, the 2d decompositions will produce an as much as possible + simplified line geometry encapsulated in this primtive when there is no + line geometry. In a further enchanced version this may change to 'if neither + filled nor lines' creation criteria. The whole primitive decomposes to nothing, + so no one not knowing it will be influenced. Only helper processors for hit test + (and maybe BoundRect extractors) will use it and it's children subcontent. + */ class HitTestPrimitive2D : public GroupPrimitive2D { - protected: - // local decomposition. Implementation will return empty Primitive2DSequence - // since this is no visualisation data - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - public: + /// constructor HitTestPrimitive2D(const Primitive2DSequence& rChildren); - // despite returning an empty decomposition since it's no visualisation data, - // range calculation is intended to use invisible replacement geometry, so - // the local implementation will return the children's range + /** despite returning an empty decomposition since it's no visualisation data, + range calculation is intended to use invisible replacement geometry, so + the local implementation will return the children's range + */ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /** local decomposition. Implementation will return empty Primitive2DSequence + since this is no visualisation data + */ + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx index ae7a316e03da..85f1c6510c5a 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx @@ -44,12 +44,23 @@ namespace drawinglayer { namespace primitive2d { + /** InvertPrimitive2D class + + This is a helper class which encapsulates geometry that should be + painted XOR, e.g. old cursor visualisations. It decomposes to + it's content, so when not supporting it, the contained geometry + will be visualized normally. + Unfortunately this is still needed, but hard to support on various + systems. XOR painting needs read access to the target, so modern + graphic systems tend to not support it anymore. + */ class InvertPrimitive2D : public GroupPrimitive2D { public: + /// constructor InvertPrimitive2D(const Primitive2DSequence& rChildren); - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx index 350471f4aff3..cc4c054f8bb3 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx @@ -41,38 +41,55 @@ #include <vcl/bitmapex.hxx> ////////////////////////////////////////////////////////////////////////////// -// MarkerPrimitive2D class +// MarkerArrayPrimitive2D class namespace drawinglayer { namespace primitive2d { - class MarkerArrayPrimitive2D : public BasePrimitive2D + /** MarkerArrayPrimitive2D class + + This primtive defines an array of markers. Their size is defined + in pixels and independent from the view transformation which makes + this primitive highly view-dependent. It is also transformation + invariant, so that the bitmap is always visualized unscaled and + unrotated. + It is used e.g. for grid position visualisation. The given Bitmap + (with alpha) is defined to be visible centered at each of the given + positions. + It decomposes to the needed number of BitmapPrimitive2D's, so it would + be efficient to handle it directly in a renderer. + */ + class MarkerArrayPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the positions for the marker std::vector< basegfx::B2DPoint > maPositions; + + /// the marker definintion to visualize BitmapEx maMarker; protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor MarkerArrayPrimitive2D( const std::vector< basegfx::B2DPoint >& rPositions, const BitmapEx& rMarker); - // get data + /// data read access const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; } const BitmapEx& getMarker() const { return maMarker; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx index 9be17376941e..e5cb12e6e87c 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx @@ -45,23 +45,42 @@ namespace drawinglayer { namespace primitive2d { + /** MaskPrimitive2D class + + This is the central masking primitive. It's a grouping + primitive and contains a PolyPolygon which defines the visible + area. Only visualisation parts of the Child primitive sequence + inside of the mask PolyPolygon is defined to be visible. + + This primitive should be handled by a renderer. If it is not handled, + it decomposes to it's Child content, and thus the visualisation would + contaiun no clips. + + The geometrc range of this primitive is completely defined by the Mask + PolyPolygon since by definition nothing outside of the mask is visible. + */ class MaskPrimitive2D : public GroupPrimitive2D { private: + /// the mask PolyPolygon basegfx::B2DPolyPolygon maMask; public: + /// constructor MaskPrimitive2D( const basegfx::B2DPolyPolygon& rMask, const Primitive2DSequence& rChildren); - // get data + /// data read access const basegfx::B2DPolyPolygon& getMask() const { return maMask; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx index 019fdc69bd3f..e5f884f09294 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx @@ -46,38 +46,55 @@ namespace drawinglayer { namespace primitive2d { - class MediaPrimitive2D : public BasePrimitive2D + /** MediaPrimitive2D class + + This is a unified primitive for Media visualisation, e.g. animations + or sounds. It's geometry is defined by Transform. For conveinience, + it also contains a discrete border size (aka Pixels) which will be added + if used. This makes it a view-dependent primitive. It also gets a filled + background and the decomposition will try to create a graphic representation + if te content (defined by the URL), e.g. a still frome for animated stuff. + */ + class MediaPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the geometry definition basegfx::B2DHomMatrix maTransform; + + /// the content definition rtl::OUString maURL; + + /// style: background color basegfx::BColor maBackgroundColor; + + /// discrete border (in 'pixels') sal_uInt32 mnDiscreteBorder; protected: - // local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor MediaPrimitive2D( const basegfx::B2DHomMatrix& rTransform, const rtl::OUString& rURL, const basegfx::BColor& rBackgroundColor, sal_uInt32 nDiscreteBorder); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } const rtl::OUString& getURL() const { return maURL; } const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; } sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx index 23eb5dd1b36e..0cbd7e4628cb 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx @@ -47,28 +47,55 @@ namespace drawinglayer { namespace primitive2d { - class MetafilePrimitive2D : public BasePrimitive2D + /** MediaPrimitive2D class + + This is the MetaFile representing primitive. It's geometry is defined + by MetaFileTransform. The content (defined by MetaFile) will be scaled + to the geometric definiton by using PrefMapMode and PrefSize of the + Metafile. + + It has shown that this not always guarantees that all Metafile content + is inside the geometric definition, but this primitive defines that this + is the case to allow a getB2DRange implementation. If it cannot be + guaranteed that the Metafile is inside the geometric definition, it should + be embedded to a MaskPrimitive2D. + + This primitive has no decomposition yet, so when not supported by a renderer, + it will not be visualized. + + In the future, a decomposition implementation would be appreciated and would + have many advantages; Metafile would no longer have to be rendered by + sub-systems and a standard way for converting Metafiles would exist. + */ + class MetafilePrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the geometry definition basegfx::B2DHomMatrix maMetaFileTransform; + + /// the content definition GDIMetaFile maMetaFile; + protected: + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor MetafilePrimitive2D( const basegfx::B2DHomMatrix& rMetaFileTransform, const GDIMetaFile& rMetaFile); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransform() const { return maMetaFileTransform; } const GDIMetaFile& getMetaFile() const { return maMetaFile; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx index 903ba89c9a5b..e93dd523e0b7 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx @@ -45,23 +45,42 @@ namespace drawinglayer { namespace primitive2d { + /** ModifiedColorPrimitive2D class + + This primitive is a grouping primitive and allows to define + how the colors of it's child content shall be modified for + visualisation. This can be (and is) used e.g. for generic shadow + visualisation by forcing all color usages of the contained + sub-content to the shadow color. + + For the possibilities of color modifications, please refer + to the basegfx::BColorModifier definitions in basegfx. For + processing there is tooling in basegfx to build a stack of + BColorModifiers to always be able to proccess the correct + colors. + + If a renderer does not handle this primitive, the content will + be visualized unchanged. + */ class ModifiedColorPrimitive2D : public GroupPrimitive2D { private: + /// The ColorModifier to use basegfx::BColorModifier maColorModifier; public: + /// constructor ModifiedColorPrimitive2D( const Primitive2DSequence& rChildren, const basegfx::BColorModifier& rColorModifier); - // get data + /// data read access const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx index edba5455ff0a..5eca0ac2ab13 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx @@ -36,7 +36,7 @@ #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX -#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <com/sun/star/drawing/XDrawPage.hpp> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -46,57 +46,66 @@ namespace drawinglayer { namespace primitive2d { - // This primitive is needed to have the correct XDrawPage as ViewInformation for decomposing - // the page contents (given as childs of the GroupPrimitive2D here) if these contain e.g. - // view-dependent (in this case XDrawPage-dependent) text fields like PageNumber. If You want - // those primitives to be visualized correctly, Your renderer needs to locally correct it's - // ViewInformation2D to reference the new XDrawPage. - class PagePreviewPrimitive2D : public GroupPrimitive2D + /** PagePreviewPrimitive2D class + + This primitive is needed to have the correct XDrawPage as ViewInformation for decomposing + the page contents (given as PageContent here) if these contain e.g. + view-dependent (in this case XDrawPage-dependent) text fields like PageNumber. If You want + those primitives to be visualized correctly, Your renderer needs to locally correct it's + ViewInformation2D to reference the new XDrawPage. + */ + class PagePreviewPrimitive2D : public BufferedDecompositionPrimitive2D { private: - // the XDrawPage visualized by this primitive. When we go forward with primitives - // this will not only be used by the renderers to provide the correct decompose - // graphic attribute context, but also to completely create the page's sub-content. + /** the XDrawPage visualized by this primitive. When we go forward with primitives + this will not only be used by the renderers to provide the correct decompose + graphic attribute context, but also to completely create the page's sub-content. + */ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxDrawPage; - // the own geometry + /// the PageContent + Primitive2DSequence maPageContent; + + /// the own geometry basegfx::B2DHomMatrix maTransform; - // content width and height + /// content width and height double mfContentWidth; double mfContentHeight; - // bitfield - // flag to allow keeping the aspect ratio + /// bitfield + /// flag to allow keeping the aspect ratio unsigned mbKeepAspectRatio : 1; protected: - // local decomposition. Implementation will just return children - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. Implementation will just return children + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PagePreviewPrimitive2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage, const basegfx::B2DHomMatrix& rTransform, double fContentWidth, double fContentHeight, - const Primitive2DSequence& rChildren, + const Primitive2DSequence& rPageContent, bool bKeepAspectRatio); - // get data + /// data read access const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& getXDrawPage() const { return mxDrawPage; } + const Primitive2DSequence& getPageContent() const { return maPageContent; } const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } double getContentWidth() const { return mfContentWidth; } double getContentHeight() const { return mfContentHeight; } bool getKeepAspectRatio() const { return mbKeepAspectRatio; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // own getB2DRange + /// own getB2DRange virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx index bdd4142b0584..793c96444bac 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx @@ -40,37 +40,51 @@ #include <basegfx/color/bcolor.hxx> ////////////////////////////////////////////////////////////////////////////// -// MarkerPrimitive2D class +// PointArrayPrimitive2D class namespace drawinglayer { namespace primitive2d { + /** PointArrayPrimitive2D class + + This primitive defines single,discrete 'pixels' for the given + positions in the given color. This makes it view-dependent since + the logic size of a 'pixel' depends on the view transformation. + + This is one of the non-decomposable primitives, so a renderer + should proccess it (Currently it is only used for grid visualisation, + but this may change). + */ class PointArrayPrimitive2D : public BasePrimitive2D { private: + /// the array of positions std::vector< basegfx::B2DPoint > maPositions; + + /// the color to use basegfx::BColor maRGBColor; - // #i96669# add simple range buffering for this primitive - basegfx::B2DRange maB2DRange; + /// #i96669# add simple range buffering for this primitive + basegfx::B2DRange maB2DRange; public: + /// constructor PointArrayPrimitive2D( const std::vector< basegfx::B2DPoint >& rPositions, const basegfx::BColor& rRGBColor); - // get data + /// data read access const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; } const basegfx::BColor& getRGBColor() const { return maRGBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx index 48ec5e80aa09..4c6f5b49bf01 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx @@ -49,26 +49,40 @@ namespace drawinglayer { namespace primitive2d { + /** PolygonHairlinePrimitive2D class + + This primitive defines a Hairline. Since hairlines are view-dependent, + this primitive is view-dependent, too. + + This is one of the non-decomposable primitives, so a renderer + should proccess it. + */ class PolygonHairlinePrimitive2D : public BasePrimitive2D { private: + /// the hairline geometry basegfx::B2DPolygon maPolygon; + + /// the hairline color basegfx::BColor maBColor; public: - PolygonHairlinePrimitive2D(const basegfx::B2DPolygon& rPolygon, const basegfx::BColor& rBColor); + /// constructor + PolygonHairlinePrimitive2D( + const basegfx::B2DPolygon& rPolygon, + const basegfx::BColor& rBColor); - // get data + /// data read access const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; } const basegfx::BColor& getBColor() const { return maBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -81,44 +95,59 @@ namespace drawinglayer { namespace primitive2d { - class PolygonMarkerPrimitive2D : public BasePrimitive2D + /** PolygonMarkerPrimitive2D class + + This primitive defines a two-colored marker hairline which is + dashed with the given dash length. Since hairlines are view-dependent, + this primitive is view-dependent, too. + + It will be decomposed to the needed PolygonHairlinePrimitive2D if + not handled directly by a renderer. + */ + class PolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the marker hairline geometry basegfx::B2DPolygon maPolygon; + + /// the two colors basegfx::BColor maRGBColorA; basegfx::BColor maRGBColorB; + + /// the dash distance in 'pixels' double mfDiscreteDashLength; - // decomposition is view-dependent, remember last InverseObjectToViewTransformation + /// decomposition is view-dependent, remember last InverseObjectToViewTransformation basegfx::B2DHomMatrix maLastInverseObjectToViewTransformation; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolygonMarkerPrimitive2D( const basegfx::B2DPolygon& rPolygon, const basegfx::BColor& rRGBColorA, const basegfx::BColor& rRGBColorB, double fDiscreteDashLength); - // get data + /// data read access const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; } const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } double getDiscreteDashLength() const { return mfDiscreteDashLength; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // get local decomposition. Overloaded since this decomposition is view-dependent + /// get local decomposition. Overloaded since this decomposition is view-dependent virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -131,39 +160,52 @@ namespace drawinglayer { namespace primitive2d { - class PolygonStrokePrimitive2D : public BasePrimitive2D + /** PolygonStrokePrimitive2D class + + This primitive defines a line with line width, line join, line color + and stroke attributes. It will be decomposed dependent on the definition + to the needed primitives, e.g. filled PolyPolygons for fat lines. + */ + class PolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the line geometry basegfx::B2DPolygon maPolygon; + + /// the line attributes like width, join and color attribute::LineAttribute maLineAttribute; + + /// the line stroking (if used) attribute::StrokeAttribute maStrokeAttribute; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolygonStrokePrimitive2D( const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::StrokeAttribute& rStrokeAttribute); + /// constructor without stroking PolygonStrokePrimitive2D( const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute); - // get data + /// data read access basegfx::B2DPolygon getB2DPolygon() const { return maPolygon; } const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; } const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -176,17 +218,24 @@ namespace drawinglayer { namespace primitive2d { + /** PolygonWavePrimitive2D class + + This primitive defines a waveline based on a PolygonStrokePrimitive2D + where the wave is defined by wave width and wave length. + */ class PolygonWavePrimitive2D : public PolygonStrokePrimitive2D { private: + /// wave definition double mfWaveWidth; double mfWaveHeight; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolygonWavePrimitive2D( const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, @@ -194,23 +243,24 @@ namespace drawinglayer double fWaveWidth, double fWaveHeight); + /// constructor without stroking PolygonWavePrimitive2D( const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, double fWaveWidth, double fWaveHeight); - // get data + /// data read access double getWaveWidth() const { return mfWaveWidth; } double getWaveHeight() const { return mfWaveHeight; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -223,17 +273,25 @@ namespace drawinglayer { namespace primitive2d { + /** PolygonStrokeArrowPrimitive2D class + + This primitive defines a PolygonStrokePrimitive2D which is extended + eventually by start and end definitions which are normally used for + arrows. + */ class PolygonStrokeArrowPrimitive2D : public PolygonStrokePrimitive2D { private: + /// geometric definitions for line start and end attribute::LineStartEndAttribute maStart; attribute::LineStartEndAttribute maEnd; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolygonStrokeArrowPrimitive2D( const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, @@ -241,23 +299,24 @@ namespace drawinglayer const attribute::LineStartEndAttribute& rStart, const attribute::LineStartEndAttribute& rEnd); + /// constructor without stroking PolygonStrokeArrowPrimitive2D( const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::LineStartEndAttribute& rStart, const attribute::LineStartEndAttribute& rEnd); - // get data + /// data read access const attribute::LineStartEndAttribute& getStart() const { return maStart; } const attribute::LineStartEndAttribute& getEnd() const { return maEnd; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx index 9991a3109e10..187e89f42e97 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx @@ -51,30 +51,40 @@ namespace drawinglayer { namespace primitive2d { - class PolyPolygonHairlinePrimitive2D : public BasePrimitive2D + /** PolyPolygonHairlinePrimitive2D class + + This primitive defines a multi-PolygonHairlinePrimitive2D and is + just for convenience. The definition is not different from the single + defined PolygonHairlinePrimitive2Ds. + */ + class PolyPolygonHairlinePrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the hairline geometry basegfx::B2DPolyPolygon maPolyPolygon; + + /// the hairline color basegfx::BColor maBColor; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor); - // get data + /// data read access basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; } const basegfx::BColor& getBColor() const { return maBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -87,38 +97,50 @@ namespace drawinglayer { namespace primitive2d { - class PolyPolygonMarkerPrimitive2D : public BasePrimitive2D + /** PolyPolygonMarkerPrimitive2D class + + This primitive defines a multi-PolygonMarkerPrimitive2D and is + just for convenience. The definition is not different from the single + defined PolygonMarkerPrimitive2Ds. + */ + class PolyPolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the marker hairline geometry basegfx::B2DPolyPolygon maPolyPolygon; + + /// the two colors basegfx::BColor maRGBColorA; basegfx::BColor maRGBColorB; + + /// the dash distance in 'pixels' double mfDiscreteDashLength; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolyPolygonMarkerPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rRGBColorA, const basegfx::BColor& rRGBColorB, double fDiscreteDashLength); - // get data + // data read access basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; } const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } double getDiscreteDashLength() const { return mfDiscreteDashLength; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -131,39 +153,52 @@ namespace drawinglayer { namespace primitive2d { - class PolyPolygonStrokePrimitive2D : public BasePrimitive2D + /** PolyPolygonStrokePrimitive2D class + + This primitive defines a multi-PolygonStrokePrimitive2D and is + just for convenience. The definition is not different from the single + defined PolygonStrokePrimitive2Ds. + */ + class PolyPolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the line geometry basegfx::B2DPolyPolygon maPolyPolygon; + + /// the line attributes like width, join and color attribute::LineAttribute maLineAttribute; + + /// the line stroking (if used) attribute::StrokeAttribute maStrokeAttribute; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolyPolygonStrokePrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::StrokeAttribute& rStrokeAttribute); + /// constructor without stroking PolyPolygonStrokePrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, const attribute::LineAttribute& rLineAttribute); - // get data + /// data read access basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; } const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; } const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -176,17 +211,25 @@ namespace drawinglayer { namespace primitive2d { + /** PolyPolygonStrokePrimitive2D class + + This primitive defines a multi-PolygonStrokeArrowPrimitive2D and is + just for convenience. The definition is not different from the single + defined PolygonStrokeArrowPrimitive2Ds. + */ class PolyPolygonStrokeArrowPrimitive2D : public PolyPolygonStrokePrimitive2D { private: + /// geometric definitions for line start and end attribute::LineStartEndAttribute maStart; attribute::LineStartEndAttribute maEnd; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolyPolygonStrokeArrowPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, const attribute::LineAttribute& rLineAttribute, @@ -194,23 +237,24 @@ namespace drawinglayer const attribute::LineStartEndAttribute& rStart, const attribute::LineStartEndAttribute& rEnd); + /// constructor without stroking PolyPolygonStrokeArrowPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::LineStartEndAttribute& rStart, const attribute::LineStartEndAttribute& rEnd); - // get data + /// data read access const attribute::LineStartEndAttribute& getStart() const { return maStart; } const attribute::LineStartEndAttribute& getEnd() const { return maEnd; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -223,28 +267,38 @@ namespace drawinglayer { namespace primitive2d { + /** PolyPolygonColorPrimitive2D class + + This primitive defines a PolyPolygon filled with a single color. + This is one of the non-decomposable primitives, so a renderer + should proccess it. + */ class PolyPolygonColorPrimitive2D : public BasePrimitive2D { private: + /// the PolyPolygon geometry basegfx::B2DPolyPolygon maPolyPolygon; + + /// the polygon fill color basegfx::BColor maBColor; public: + /// constructor PolyPolygonColorPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor); - // get data + /// data read access const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } const basegfx::BColor& getBColor() const { return maBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -257,28 +311,39 @@ namespace drawinglayer { namespace primitive2d { - class PolyPolygonGradientPrimitive2D : public PolyPolygonColorPrimitive2D + /** PolyPolygonColorPrimitive2D class + + This primitive defines a PolyPolygon filled with a gradient. The + decomosition will create a MaskPrimitive2D containing a + FillGradientPrimitive2D. + */ + class PolyPolygonGradientPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the PolyPolygon geometry + basegfx::B2DPolyPolygon maPolyPolygon; + + /// the gradient definition attribute::FillGradientAttribute maFillGradient; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolyPolygonGradientPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, - const basegfx::BColor& rBColor, const attribute::FillGradientAttribute& rFillGradient); - // get data + /// data read access + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -291,28 +356,44 @@ namespace drawinglayer { namespace primitive2d { - class PolyPolygonHatchPrimitive2D : public PolyPolygonColorPrimitive2D + /** PolyPolygonHatchPrimitive2D class + + This primitive defines a PolyPolygon filled with a hatch. The + decomosition will create a MaskPrimitive2D containing a + FillHatchPrimitive2D. + */ + class PolyPolygonHatchPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the PolyPolygon geometry + basegfx::B2DPolyPolygon maPolyPolygon; + + /// the hatch background color (if used) + basegfx::BColor maBackgroundColor; + + /// the hatch definition attribute::FillHatchAttribute maFillHatch; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolyPolygonHatchPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, - const basegfx::BColor& rBColor, + const basegfx::BColor& rBackgroundColor, const attribute::FillHatchAttribute& rFillHatch); - // get data + /// data read access + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } + const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; } const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -325,28 +406,39 @@ namespace drawinglayer { namespace primitive2d { - class PolyPolygonBitmapPrimitive2D : public PolyPolygonColorPrimitive2D + /** PolyPolygonBitmapPrimitive2D class + + This primitive defines a PolyPolygon filled with bitmap data + (including alpha). The decomosition will create a MaskPrimitive2D + containing a FillBitmapPrimitive2D. + */ + class PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// the PolyPolygon geometry + basegfx::B2DPolyPolygon maPolyPolygon; + + /// the bitmap fill definition (may include tiling) attribute::FillBitmapAttribute maFillBitmap; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor PolyPolygonBitmapPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, - const basegfx::BColor& rBColor, const attribute::FillBitmapAttribute& rFillBitmap); - // get data + /// data read access + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx index bd561cbab21a..a095c558ba12 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx @@ -37,70 +37,163 @@ #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX #include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> ////////////////////////////////////////////////////////////////////////////// -// tooling class for BasePrimitive2D baseed classes which are view-dependent -// regarding the size of a discrete unit. The implementation of get2DDecomposition -// guards the buffered local decomposition and ensures that a createLocalDecomposition -// implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit() namespace drawinglayer { namespace primitive2d { - class DiscreteMetricDependentPrimitive2D : public BasePrimitive2D + /** DiscreteMetricDependentPrimitive2D class + + tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent + regarding the size of a discrete unit. The implementation of get2DDecomposition + guards the buffered local decomposition and ensures that a create2DDecomposition + implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit() + */ + class DiscreteMetricDependentPrimitive2D : public BufferedDecompositionPrimitive2D { private: - // the last used fDiscreteUnit definitions for decomposition. Since this - // is checked and updated from get2DDecomposition() it will be current and - // usable in createLocalDecomposition() + /** the last used fDiscreteUnit definitions for decomposition. Since this + is checked and updated from get2DDecomposition() it will be current and + usable in create2DDecomposition() + */ double mfDiscreteUnit; public: + /// constructor DiscreteMetricDependentPrimitive2D() - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), mfDiscreteUnit(0.0) { } - // data access + /// data read access double getDiscreteUnit() const { return mfDiscreteUnit; } - // get local decomposition. Overloaded since this decomposition is view-dependent + /// get local decomposition. Overloaded since this decomposition is view-dependent virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -// tooling class for BasePrimitive2D baseed classes which are view-dependent -// regarding the viewport. The implementation of get2DDecomposition -// guards the buffered local decomposition and ensures that a createLocalDecomposition -// implementation may use an up-to-date Viewport accessible using getViewport() namespace drawinglayer { namespace primitive2d { - class ViewportDependentPrimitive2D : public BasePrimitive2D + /** ViewportDependentPrimitive2D class + + tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent + regarding the viewport. The implementation of get2DDecomposition + guards the buffered local decomposition and ensures that a create2DDecomposition + implementation may use an up-to-date Viewport accessible using getViewport() + */ + class ViewportDependentPrimitive2D : public BufferedDecompositionPrimitive2D { private: - // the last used Viewport definition for decomposition. Since this - // is checked and updated from get2DDecomposition() it will be current and - // usable in createLocalDecomposition() + /** the last used Viewport definition for decomposition. Since this + is checked and updated from get2DDecomposition() it will be current and + usable in create2DDecomposition() + */ basegfx::B2DRange maViewport; public: + /// constructor ViewportDependentPrimitive2D() - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maViewport() { } - // data access + /// data read access const basegfx::B2DRange& getViewport() const { return maViewport; } - // get local decomposition. Overloaded since this decomposition is view-dependent + /// get local decomposition. Overloaded since this decomposition is view-dependent + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** ViewTransformationDependentPrimitive2D class + + tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent + regarding the complete Viewtransformation. The implementation of get2DDecomposition + guards the buffered local decomposition and ensures that a create2DDecomposition + implementation may use an up-to-date ViewTransformation accessible using getViewTransformation() + */ + class ViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + /** the last used ViewTransformation definition for decomposition. Since this + is checked and updated from get2DDecomposition() it will be current and + usable in create2DDecomposition() + */ + basegfx::B2DHomMatrix maViewTransformation; + + public: + /// constructor + ViewTransformationDependentPrimitive2D() + : BufferedDecompositionPrimitive2D(), + maViewTransformation() + { + } + + /// data read access + const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; } + + /// get local decomposition. Overloaded since this decomposition is view-dependent + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** ObjectAndViewTransformationDependentPrimitive2D class + + tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent + and Object-Transform dependent. The implementation of get2DDecomposition + guards the buffered local decomposition and ensures that a create2DDecomposition + implementation may use an up-to-date ViewTransformation accessible using getViewTransformation() + and an object transformation via getObjectTransformation() + */ + class ObjectAndViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + /** the last used ViewTransformation and the last ObjectTransformation + definition for decomposition. Since this is checked and updated from + get2DDecomposition() it will be current and usable in create2DDecomposition() + */ + basegfx::B2DHomMatrix maViewTransformation; + basegfx::B2DHomMatrix maObjectTransformation; + + public: + /// constructor + ObjectAndViewTransformationDependentPrimitive2D() + : BufferedDecompositionPrimitive2D(), + maViewTransformation(), + maObjectTransformation() + { + } + + /// data read access + const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; } + const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } + + /// get local decomposition. Overloaded since this decomposition is view-dependent virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx index 8ffc9a332e5c..65d2bdf67f92 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx @@ -49,33 +49,60 @@ namespace drawinglayer { namespace primitive2d { - class ScenePrimitive2D : public BasePrimitive2D + /** ScenePrimitive2D class + + This primitive defines a 3D scene as a 2D primitive and is the anchor point + for a 3D visualisation. The decomposition is view-dependent and will try to + re-use already rendered 3D content. + + The rendering is done using the default-3D renderer from basegfx which supports + AntiAliasing. + + The 2D primitive's geometric range is defined completely by the + ObjectTransformation combined with evtl. 2D shadows from the 3D objects. The + shadows of 3D objects are 2D polygons, projected with the 3D transformation. + + This is the class a renderer may process directly when he wants to implement + an own (e.g. system-specific) 3D renderer. + */ + class ScenePrimitive2D : public BufferedDecompositionPrimitive2D { private: - primitive3d::Primitive3DSequence mxChildren3D; // the 3d sub-primitives - attribute::SdrSceneAttribute maSdrSceneAttribute; // 3d scene attribute set - attribute::SdrLightingAttribute maSdrLightingAttribute; // lighting attribute set - basegfx::B2DHomMatrix maObjectTransformation; // object transformation for scene for 2d definition - geometry::ViewInformation3D maViewInformation3D; // scene transformation set and object transformation + /// the 3D geometry definition + primitive3d::Primitive3DSequence mxChildren3D; + + /// 3D scene attribute set + attribute::SdrSceneAttribute maSdrSceneAttribute; + + /// lighting attribute set + attribute::SdrLightingAttribute maSdrLightingAttribute; + + /// object transformation for scene for 2D definition + basegfx::B2DHomMatrix maObjectTransformation; + + /// scene transformation set and object transformation + geometry::ViewInformation3D maViewInformation3D; - // the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked) + /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked) Primitive2DSequence maShadowPrimitives; - // bitfield - // flag if given 3D geometry is already cheched for shadow definitions and 2d shadows - // are created in maShadowPrimitives + /// bitfield + /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows + are created in maShadowPrimitives + */ unsigned mbShadow3DChecked : 1; - // the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition + /// the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition double mfOldDiscreteSizeX; double mfOldDiscreteSizeY; basegfx::B2DRange maOldUnitVisiblePart; - // the last created BitmapEx, e.g. for fast HitTest. This does not really need - // memory since BitmapEx is internally RefCounted + /** the last created BitmapEx, e.g. for fast HitTest. This does not really need + memory since BitmapEx is internally RefCounted + */ BitmapEx maOldRenderedBitmap; - // private helpers + /// private helpers bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const; void calculateDiscreteSizes( const geometry::ViewInformation2D& rViewInformation, @@ -84,28 +111,30 @@ namespace drawinglayer basegfx::B2DRange& rUnitVisibleRange) const; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: - // public helpers - // Geometry extractor. Shadow will be added as in createLocalDecomposition, but - // the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This - // helper is useful e.g. for Contour extraction or HitTests. + /// public helpers + /** Geometry extractor. Shadow will be added as in create2DDecomposition, but + the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This + helper is useful e.g. for Contour extraction or HitTests. + */ Primitive2DSequence getGeometry2D() const; Primitive2DSequence getShadow2D(const geometry::ViewInformation2D& rViewInformation) const; - // Fast HitTest which uses the last buffered BitmapEx from the last - // rendered area if available. The return value describes if the check - // could be done with the current information, so do NOT use o_rResult - // when it returns false. o_rResult will be changed on return true and - // then contains a definitive answer if content of this scene is hit or - // not. On return false, it is normally necessary to use the geometric - // HitTest (see CutFindProcessor usages). The given HitPoint - // has to be in logic coordinates in scene's ObjectCoordinateSystem. + /** Fast HitTest which uses the last buffered BitmapEx from the last + rendered area if available. The return value describes if the check + could be done with the current information, so do NOT use o_rResult + when it returns false. o_rResult will be changed on return true and + then contains a definitive answer if content of this scene is hit or + not. On return false, it is normally necessary to use the geometric + HitTest (see CutFindProcessor usages). The given HitPoint + has to be in logic coordinates in scene's ObjectCoordinateSystem. + */ bool tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const; - // constructor/destructor + /// constructor ScenePrimitive2D( const primitive3d::Primitive3DSequence& rxChildren3D, const attribute::SdrSceneAttribute& rSdrSceneAttribute, @@ -113,23 +142,23 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rObjectTransformation, const geometry::ViewInformation3D& rViewInformation3D); - // get data + /// data ead access const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; } const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return maSdrSceneAttribute; } const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return maSdrLightingAttribute; } const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() - // get local decomposition. Overloaded since this decomposition is view-dependent + /// get local decomposition. Overloaded since this decomposition is view-dependent virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx index b749000ee566..0e3f7258441a 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx @@ -46,33 +46,50 @@ namespace drawinglayer { namespace primitive2d { + /** ShadowPrimitive2D class + + This primitive defines a generic shadow geometry construction + for 2D objects. It decomposes to a TransformPrimitive2D embedded + into a ModifiedColorPrimitive2D. + + It's for primtive usage convenience, so that not everyone has + to implement the generic shadow construction by himself. + + The same geometry as sequence of primitives is used as geometry and + as shadow. Since these are RefCounted Uno-Api objects, no extra objects + are needed for the shadow itself; all the local decompositions of the + original geometry can be reused from the renderer for shadow visualisation. + */ class ShadowPrimitive2D : public GroupPrimitive2D { private: + /// the shadow transformation, normally just an offset basegfx::B2DHomMatrix maShadowTransform; - basegfx::BColor maShadowColor; - protected: - // create decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// the shadow color to which all geometry is to be forced + basegfx::BColor maShadowColor; public: + /// constructor ShadowPrimitive2D( const basegfx::B2DHomMatrix& rShadowTransform, const basegfx::BColor& rShadowColor, const Primitive2DSequence& rChildren); - // get data + /// data read access const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; } const basegfx::BColor& getShadowColor() const { return maShadowColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// create decomposition + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx index 9ccb91e7bebd..c86e4c91bb86 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx @@ -45,30 +45,34 @@ namespace drawinglayer { namespace primitive2d { - // This class is used to provode simple support for adding grouped - // pdf writer structured element information like used in sd from - // unomodel.cxx where a ViewObjectContactRedirector is used to add - // such information for diverse objects. - // This primitive encapsulates these and the VCLPdfRenderer uses it - // to apply the needed infos directly to the pdf export in a compatible - // way. - // If a renderer ignores this, it just decomposes to it's child - // content. + /** StructureTagPrimitive2D class + + This class is used to provode simple support for adding grouped + pdf writer structured element information like used in sd from + unomodel.cxx where a ViewObjectContactRedirector is used to add + such information for diverse objects. + This primitive encapsulates these and the VCLPdfRenderer uses it + to apply the needed infos directly to the pdf export in a compatible + way. + If a renderer ignores this, it just decomposes to it's child + content. + */ class StructureTagPrimitive2D : public GroupPrimitive2D { private: - // the PDF structure element this grouping represents + /// the PDF structure element this grouping represents vcl::PDFWriter::StructElement maStructureElement; public: + /// constructor StructureTagPrimitive2D( const vcl::PDFWriter::StructElement& rStructureElement, const Primitive2DSequence& rChildren); - // data access + /// data read access const vcl::PDFWriter::StructElement& getStructureElement() const { return maStructureElement; } - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx index 69023873760a..fe41c2e1824a 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx @@ -37,13 +37,14 @@ #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX #include <drawinglayer/primitive2d/textprimitive2d.hxx> +#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// // predeclarations -namespace basegfx { - class DecomposedB2DHomMatrixContainer; -} // end of namespace basegfx +namespace basegfx { namespace tools { + class B2DHomMatrixBufferedOnDemandDecompose; +}} namespace com { namespace sun { namespace star { namespace i18n { struct Boundary; @@ -55,153 +56,102 @@ namespace drawinglayer { namespace primitive2d { - // This is used for both underline and overline - enum FontUnderline - { - FONT_UNDERLINE_NONE, - FONT_UNDERLINE_SINGLE, - FONT_UNDERLINE_DOUBLE, - FONT_UNDERLINE_DOTTED, - FONT_UNDERLINE_DASH, - FONT_UNDERLINE_LONGDASH, - FONT_UNDERLINE_DASHDOT, - FONT_UNDERLINE_DASHDOTDOT, - FONT_UNDERLINE_SMALLWAVE, - FONT_UNDERLINE_WAVE, - FONT_UNDERLINE_DOUBLEWAVE, - FONT_UNDERLINE_BOLD, - FONT_UNDERLINE_BOLDDOTTED, - FONT_UNDERLINE_BOLDDASH, - FONT_UNDERLINE_BOLDLONGDASH, - FONT_UNDERLINE_BOLDDASHDOT, - FONT_UNDERLINE_BOLDDASHDOTDOT, - FONT_UNDERLINE_BOLDWAVE - }; - - enum FontStrikeout - { - FONT_STRIKEOUT_NONE, - FONT_STRIKEOUT_SINGLE, - FONT_STRIKEOUT_DOUBLE, - FONT_STRIKEOUT_BOLD, - FONT_STRIKEOUT_SLASH, - FONT_STRIKEOUT_X - }; - - enum FontEmphasisMark - { - FONT_EMPHASISMARK_NONE, - FONT_EMPHASISMARK_DOT, - FONT_EMPHASISMARK_CIRCLE, - FONT_EMPHASISMARK_DISC, - FONT_EMPHASISMARK_ACCENT - }; - - enum FontRelief - { - FONT_RELIEF_NONE, - FONT_RELIEF_EMBOSSED, - FONT_RELIEF_ENGRAVED - }; + /** TextDecoratedPortionPrimitive2D class + This primitive expands the TextSimplePortionPrimitive2D by common + decorations used in the office. It can be decomposed and will create + a TextSimplePortionPrimitive2D and all the contained decorations (if used) + as geometry. + */ class TextDecoratedPortionPrimitive2D : public TextSimplePortionPrimitive2D { private: + /// decoration definitions basegfx::BColor maOverlineColor; basegfx::BColor maTextlineColor; - FontUnderline meFontOverline; - FontUnderline meFontUnderline; - FontStrikeout meFontStrikeout; - FontEmphasisMark meFontEmphasisMark; - FontRelief meFontRelief; + TextLine meFontOverline; + TextLine meFontUnderline; + TextStrikeout meTextStrikeout; + TextEmphasisMark meTextEmphasisMark; + TextRelief meTextRelief; - // bitfield + /// bitfield unsigned mbUnderlineAbove : 1; unsigned mbWordLineMode : 1; unsigned mbEmphasisMarkAbove : 1; unsigned mbEmphasisMarkBelow : 1; unsigned mbShadow : 1; - // helper methods - void impCreateTextLine( - std::vector< Primitive2DReference >& rTarget, - basegfx::DecomposedB2DHomMatrixContainer& rDecTrans, - const basegfx::B2DHomMatrix &rUnscaledTransform, - FontUnderline eLineStyle, - double fLineOffset, - double fLineHeight, - double fLineWidth, - const basegfx::BColor& rLineColor) const; - + /// helper methods void impCreateGeometryContent( std::vector< Primitive2DReference >& rTarget, - basegfx::DecomposedB2DHomMatrixContainer& rDecTrans, + basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans, const String& rText, xub_StrLen aTextPosition, xub_StrLen aTextLength, const ::std::vector< double >& rDXArray, - const FontAttributes& rFontAttributes) const; + const attribute::FontAttribute& rFontAttribute) const; void impCorrectTextBoundary( ::com::sun::star::i18n::Boundary& rNextWordBoundary) const; void impSplitSingleWords( std::vector< Primitive2DReference >& rTarget, - basegfx::DecomposedB2DHomMatrixContainer& rDecTrans) const; + basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans) const; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor TextDecoratedPortionPrimitive2D( - // TextSimplePortionPrimitive2D parameters + /// TextSimplePortionPrimitive2D parameters const basegfx::B2DHomMatrix& rNewTransform, const String& rText, xub_StrLen aTextPosition, xub_StrLen aTextLength, const ::std::vector< double >& rDXArray, - const FontAttributes& rFontAttributes, + const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale, const basegfx::BColor& rFontColor, - // local parameters + /// local parameters const basegfx::BColor& rOverlineColor, const basegfx::BColor& rTextlineColor, - FontUnderline eFontOverline = FONT_UNDERLINE_NONE, - FontUnderline eFontUnderline = FONT_UNDERLINE_NONE, + TextLine eFontOverline = TEXT_LINE_NONE, + TextLine eFontUnderline = TEXT_LINE_NONE, bool bUnderlineAbove = false, - FontStrikeout eFontStrikeout = FONT_STRIKEOUT_NONE, + TextStrikeout eTextStrikeout = TEXT_STRIKEOUT_NONE, bool bWordLineMode = false, - FontEmphasisMark eFontEmphasisMark = FONT_EMPHASISMARK_NONE, + TextEmphasisMark eTextEmphasisMark = TEXT_EMPHASISMARK_NONE, bool bEmphasisMarkAbove = true, bool bEmphasisMarkBelow = false, - FontRelief eFontRelief = FONT_RELIEF_NONE, + TextRelief eTextRelief = TEXT_RELIEF_NONE, bool bShadow = false); - // get data - FontUnderline getFontOverline() const { return meFontOverline; } - FontUnderline getFontUnderline() const { return meFontUnderline; } - FontStrikeout getFontStrikeout() const { return meFontStrikeout; } - FontEmphasisMark getFontEmphasisMark() const { return meFontEmphasisMark; } - FontRelief getFontRelief() const { return meFontRelief; } + /// data read access + TextLine getFontOverline() const { return meFontOverline; } + TextLine getFontUnderline() const { return meFontUnderline; } + TextStrikeout getTextStrikeout() const { return meTextStrikeout; } + TextEmphasisMark getTextEmphasisMark() const { return meTextEmphasisMark; } + TextRelief getTextRelief() const { return meTextRelief; } basegfx::BColor getOverlineColor() const { return maOverlineColor; } basegfx::BColor getTextlineColor() const { return maTextlineColor; } - bool getUnderlineAbove() const { return mbUnderlineAbove; } bool getWordLineMode() const { return mbWordLineMode; } bool getEmphasisMarkAbove() const { return mbEmphasisMarkAbove; } bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow; } bool getShadow() const { return mbShadow; } - // compare operator + /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx index 128b1ea5a210..77b64d16ea24 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx @@ -36,7 +36,7 @@ #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX -#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -45,6 +45,7 @@ namespace drawinglayer { namespace primitive2d { + /** TextEffectStyle2D definition */ enum TextEffectStyle2D { TEXTEFFECTSTYLE2D_RELIEF_EMBOSSED_DEFAULT, @@ -54,46 +55,59 @@ namespace drawinglayer TEXTEFFECTSTYLE2D_OUTLINE }; - class TextEffectPrimitive2D : public GroupPrimitive2D + /** TextEffectPrimitive2D class + + This primitive embeds text primitives (normally, as can be seen can + also be used for any other primitives) which have some TextEffect applied + and create the needed geometry and embedding on decomposition. + */ + class TextEffectPrimitive2D : public BufferedDecompositionPrimitive2D { private: - // the style to apply, the direction and the rotation center + /// the text (or other) content + Primitive2DSequence maTextContent; + + /// the style to apply, the direction and the rotation center const basegfx::B2DPoint maRotationCenter; double mfDirection; TextEffectStyle2D meTextEffectStyle2D; - // the last used object to view transformtion used from getDecomposition - // for decide buffering + /** the last used object to view transformtion used from getDecomposition + for decide buffering + */ basegfx::B2DHomMatrix maLastObjectToViewTransformation; protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// construcor TextEffectPrimitive2D( - const Primitive2DSequence& rChildren, + const Primitive2DSequence& rTextContent, const basegfx::B2DPoint& rRotationCenter, double fDirection, TextEffectStyle2D eTextEffectStyle2D); - // get data + /// data read access + const Primitive2DSequence& getTextContent() const { return maTextContent; } const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; } double getDirection() const { return mfDirection; } TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // own get range implementation to solve more effective. Content is by definition displaced - // by a fixed discrete unit, thus the contained geometry needs only once be asked for it's - // own basegfx::B2DRange + /** own get range implementation to solve more effective. Content is by definition displaced + by a fixed discrete unit, thus the contained geometry needs only once be asked for it's + own basegfx::B2DRange + */ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() - // Overload standard getDecomposition call to be view-dependent here + /// Overload standard getDecomposition call to be view-dependent here virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx new file mode 100644 index 000000000000..b0e7dc8c241e --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wrongspellprimitive2d.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <vcl/vclenum.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** TextLine definition + + This is used for both underline and overline + */ + enum TextLine + { + TEXT_LINE_NONE, + TEXT_LINE_SINGLE, + TEXT_LINE_DOUBLE, + TEXT_LINE_DOTTED, + TEXT_LINE_DASH, + TEXT_LINE_LONGDASH, + TEXT_LINE_DASHDOT, + TEXT_LINE_DASHDOTDOT, + TEXT_LINE_SMALLWAVE, + TEXT_LINE_WAVE, + TEXT_LINE_DOUBLEWAVE, + TEXT_LINE_BOLD, + TEXT_LINE_BOLDDOTTED, + TEXT_LINE_BOLDDASH, + TEXT_LINE_BOLDLONGDASH, + TEXT_LINE_BOLDDASHDOT, + TEXT_LINE_BOLDDASHDOTDOT, + TEXT_LINE_BOLDWAVE + }; + + /** helper to convert LineStyle */ + TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle); + FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle); + + /** FontStrikeout definition */ + enum TextStrikeout + { + TEXT_STRIKEOUT_NONE, + TEXT_STRIKEOUT_SINGLE, + TEXT_STRIKEOUT_DOUBLE, + TEXT_STRIKEOUT_BOLD, + TEXT_STRIKEOUT_SLASH, + TEXT_STRIKEOUT_X + }; + + /** helper to convert FontStrikeout */ + TextStrikeout mapFontStrikeoutToTextStrikeout(::FontStrikeout eFontStrikeout); + ::FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eFontStrikeout); + + /** TextEmphasisMark definition */ + enum TextEmphasisMark + { + TEXT_EMPHASISMARK_NONE, + TEXT_EMPHASISMARK_DOT, + TEXT_EMPHASISMARK_CIRCLE, + TEXT_EMPHASISMARK_DISC, + TEXT_EMPHASISMARK_ACCENT + }; + + /** TextRelief definition */ + enum TextRelief + { + TEXT_RELIEF_NONE, + TEXT_RELIEF_EMBOSSED, + TEXT_RELIEF_ENGRAVED + }; + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx index 1160704c0fa3..3f9c02b6e9bd 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx @@ -45,17 +45,23 @@ namespace drawinglayer { namespace primitive2d { - // text format hierarchy helper class. It decomposes to it's - // content, so all direct renderers may ignore it. If You need - // to know more about line hierarchies You may react on it and - // also need to take care that the source of data uses it. + /** TextHierarchyLinePrimitive2D class + + Text format hierarchy helper class. It decomposes to it's + content, so all direct renderers may ignore it. If You need + to know more about line hierarchies You may react on it and + also need to take care that the source of data uses it. + + This primitive encapsulates text lines. + */ class TextHierarchyLinePrimitive2D : public GroupPrimitive2D { private: public: + /// constructor TextHierarchyLinePrimitive2D(const Primitive2DSequence& rChildren); - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -67,14 +73,18 @@ namespace drawinglayer { namespace primitive2d { - // see TextHierarchyLinePrimitive2D comment + /** TextHierarchyBulletPrimitive2D class + + This primitive encapsulates text bullets. + */ class TextHierarchyBulletPrimitive2D : public GroupPrimitive2D { private: public: + /// constructor TextHierarchyBulletPrimitive2D(const Primitive2DSequence& rChildren); - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -86,14 +96,18 @@ namespace drawinglayer { namespace primitive2d { - // see TextHierarchyLinePrimitive2D comment + /** TextHierarchyParagraphPrimitive2D class + + This primitive encapsulates text paragraphs. + */ class TextHierarchyParagraphPrimitive2D : public GroupPrimitive2D { private: public: + /// constructor TextHierarchyParagraphPrimitive2D(const Primitive2DSequence& rChildren); - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -105,14 +119,18 @@ namespace drawinglayer { namespace primitive2d { - // see TextHierarchyLinePrimitive2D comment + /** TextHierarchyBlockPrimitive2D class + + This primitive encapsulates text blocks. + */ class TextHierarchyBlockPrimitive2D : public GroupPrimitive2D { private: public: + /// constructor TextHierarchyBlockPrimitive2D(const Primitive2DSequence& rChildren); - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -124,19 +142,28 @@ namespace drawinglayer { namespace primitive2d { - // type enum + /** FieldType definition */ enum FieldType { - FIELD_TYPE_COMMON, // unspecified. If more info is needed for a FieldType, - // create a new type and it's handling - FIELD_TYPE_PAGE, // uses "FIELD_SEQ_BEGIN;PageField" -> special handling - FIELD_TYPE_URL // uses URL as string -> special handling + /** unspecified. If more info is needed for a FieldType, + create a new type and it's handling + */ + FIELD_TYPE_COMMON, + + /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */ + FIELD_TYPE_PAGE, + + /** uses URL as string -> special handling */ + FIELD_TYPE_URL }; - // see TextHierarchyLinePrimitive2D comment. - // Also: This type uses a type enum to transport the encapsulated field - // type. Also added is a String which is type-dependent. E.g. for URL - // fields, it contains the URL. + /** TextHierarchyFieldPrimitive2D class + + This primitive encapsulates text fields. + Also: This type uses a type enum to transport the encapsulated field + type. Also added is a String which is type-dependent. E.g. for URL + fields, it contains the URL. + */ class TextHierarchyFieldPrimitive2D : public GroupPrimitive2D { private: @@ -144,19 +171,20 @@ namespace drawinglayer rtl::OUString maString; public: + /// constructor TextHierarchyFieldPrimitive2D( const Primitive2DSequence& rChildren, const FieldType& rFieldType, const rtl::OUString& rString); - // get data + /// data read access FieldType getType() const { return meType; } const rtl::OUString& getString() const { return maString; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d @@ -168,20 +196,24 @@ namespace drawinglayer { namespace primitive2d { - // #i97628# - // Primitive to encapsulate text from an active text edit; some - // renderers need to suppress this output due to painting the - // edited text in e.g. an OutlinerEditView. It's derived from - // GroupPrimitive2D, so the implicit decomposition will use the - // content. To suppress, this primitive needs to be parsed by - // the renderer without taking any action + /** TextHierarchyEditPrimitive2D class + + #i97628# + Primitive to encapsulate text from an active text edit; some + renderers need to suppress this output due to painting the + edited text in e.g. an OutlinerEditView. It's derived from + GroupPrimitive2D, so the implicit decomposition will use the + content. To suppress, this primitive needs to be parsed by + the renderer without taking any action. + */ class TextHierarchyEditPrimitive2D : public GroupPrimitive2D { private: public: + /// constructor TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren); - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx index df09718a7582..f3de43c22fd7 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx @@ -49,9 +49,10 @@ class VirtualDevice; class Font; class String; class OutputDevice; +class GDIMetaFile; -namespace drawinglayer { namespace primitive2d { - class FontAttributes; +namespace drawinglayer { namespace attribute { + class FontAttribute; }} namespace basegfx { @@ -66,18 +67,27 @@ namespace drawinglayer { namespace primitive2d { + /** TextLayouterDevice class + + This helper class exists to isolate all accesses to VCL + text formatting/handling functionality for primitive implementations. + When in the future FontHandling may move to an own library independent + from VCL, primitives will be prepared. + */ class TextLayouterDevice { - // internally used VirtualDevice + /// internally used VirtualDevice VirtualDevice& mrDevice; public: + /// constructor/destructor TextLayouterDevice(); ~TextLayouterDevice(); + /// tooling methods void setFont(const Font& rFont); - void setFontAttributes( - const FontAttributes& rFontAttributes, + void setFontAttribute( + const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY, const ::com::sun::star::lang::Locale & rLocale); @@ -105,6 +115,15 @@ namespace drawinglayer const String& rText, xub_StrLen nIndex, xub_StrLen nLength) const; + + double getFontAscent() const; + double getFontDescent() const; + + void addTextRectActions( + const Rectangle& rRectangle, + const String& rText, + sal_uInt16 nStyle, + GDIMetaFile& rGDIMetaFile); }; } // end of namespace primitive2d } // end of namespace drawinglayer @@ -116,23 +135,25 @@ namespace drawinglayer { namespace primitive2d { - // Create a VCL-Font based on the definitions in FontAttributes - // and the given FontScaling. The FontScaling defines the FontHeight - // (fFontScaleY) and the FontWidth (fFontScaleX). The combination of - // both defines FontStretching, where no stretching happens at - // fFontScaleY == fFontScaleX - Font getVclFontFromFontAttributes( - const FontAttributes& rFontAttributes, + /** Create a VCL-Font based on the definitions in FontAttribute + and the given FontScaling. The FontScaling defines the FontHeight + (fFontScaleY) and the FontWidth (fFontScaleX). The combination of + both defines FontStretching, where no stretching happens at + fFontScaleY == fFontScaleX + */ + Font getVclFontFromFontAttribute( + const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY, double fFontRotation, const ::com::sun::star::lang::Locale & rLocale); - // Generate FontAttributes DataSet derived from the given VCL-Font. - // The FontScaling with fFontScaleY, fFontScaleX relationship (see - // above) will be set in return parameter o_rSize to allow further - // processing - FontAttributes getFontAttributesFromVclFont( + /** Generate FontAttribute DataSet derived from the given VCL-Font. + The FontScaling with fFontScaleY, fFontScaleX relationship (see + above) will be set in return parameter o_rSize to allow further + processing + */ + attribute::FontAttribute getFontAttributeFromVclFont( basegfx::B2DVector& o_rSize, const Font& rFont, bool bRTL, diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx new file mode 100644 index 000000000000..a103d607e85f --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: textdecoratedprimitive2d.hxx,v $ + * + * $Revision: 1.6 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/color/bcolor.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class TextLinePrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + /// geometric definitions + basegfx::B2DHomMatrix maObjectTransformation; + double mfWidth; + double mfOffset; + double mfHeight; + + /// decoration definitions + TextLine meTextLine; + basegfx::BColor maLineColor; + + protected: + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + TextLinePrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + double fOffset, + double fHeight, + TextLine eTextLine, + const basegfx::BColor& rLineColor); + + /// data read access + const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } + double getWidth() const { return mfWidth; } + double getOffset() const { return mfOffset; } + double getHeight() const { return mfHeight; } + TextLine getTextLine() const { return meTextLine; } + const basegfx::BColor& getLineColor() const { return maLineColor; } + + /// compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx index d7f9bdb1e89a..bbcd8e335e23 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx @@ -43,6 +43,7 @@ #include <basegfx/color/bcolor.hxx> #include <vector> #include <com/sun/star/lang/Locale.hpp> +#include <drawinglayer/attribute/fontattribute.hxx> ////////////////////////////////////////////////////////////////////////////// // predefines @@ -60,123 +61,91 @@ namespace drawinglayer { namespace primitive2d { - class FontAttributes + /** TextSimplePortionPrimitive2D class + + This is the basic primitive for representing a text portion. It contains + all needed information. If it is not handled by a renderer, it's decomposition + will provide the text PolyPolygon outlines as filled polygons, correctly + transformed. + + To get better text quality, it is suggested to handle tis primitive directly + in a renderer. In that case, e.g. hintings on the system can be supported. + */ + class TextSimplePortionPrimitive2D : public BufferedDecompositionPrimitive2D { private: - // core data - String maFamilyName; // Font Family Name - String maStyleName; // Font Style Name - sal_uInt16 mnWeight; // Font weight - - // bitfield - unsigned mbSymbol : 1; // Symbol Font Flag - unsigned mbVertical : 1; // Vertical Text Flag - unsigned mbItalic : 1; // Italic Flag - unsigned mbOutline : 1; // Outline Flag - unsigned mbRTL : 1; // RTL Flag - unsigned mbBiDiStrong : 1; // BiDi Flag - // TODO: pair kerning and CJK kerning + /// text range transformation from unit range ([0.0 .. 1.0]) to text range + basegfx::B2DHomMatrix maTextTransform; - public: - FontAttributes( - const String& rFamilyName, - const String& rStyleName, - sal_uInt16 nWeight, - bool bSymbol = false, - bool bVertical = false, - bool bItalic = false, - bool bOutline = false, - bool bRTL = false, - bool bBiDiStrong = false) - : maFamilyName(rFamilyName), - maStyleName(rStyleName), - mnWeight(nWeight), - mbSymbol(bSymbol), - mbVertical(bVertical), - mbItalic(bItalic), - mbOutline(bOutline), - mbRTL(bRTL), - mbBiDiStrong(bBiDiStrong) - { - } - - // compare operator - bool operator==(const FontAttributes& rCompare) const; - - // data access - const String& getFamilyName() const { return maFamilyName; } - const String& getStyleName() const { return maStyleName; } - sal_uInt16 getWeight() const { return mnWeight; } - bool getSymbol() const { return mbSymbol; } - bool getVertical() const { return mbVertical; } - bool getItalic() const { return mbItalic; } - bool getOutline() const { return mbOutline; } - bool getRTL() const { return mbRTL; } - bool getBiDiStrong() const { return mbBiDiStrong; } - }; - } // end of namespace primitive2d -} // end of namespace drawinglayer + /// The text, used from maTextPosition up to maTextPosition + maTextLength + String maText; -////////////////////////////////////////////////////////////////////////////// + /// The index from where on maText is used + xub_StrLen maTextPosition; -namespace drawinglayer -{ - namespace primitive2d - { - class TextSimplePortionPrimitive2D : public BasePrimitive2D - { - private: - basegfx::B2DHomMatrix maTextTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range - String maText; // the text, used from maTextPosition up to maTextPosition + maTextLength - xub_StrLen maTextPosition; // the index from where on maText is used - xub_StrLen maTextLength; // the length for maText usage, starting from maTextPosition - ::std::vector< double > maDXArray; // the DX array scale-independent in unit coordinates - FontAttributes maFontAttributes; // the font to use - ::com::sun::star::lang::Locale maLocale; // the Locale for the text - basegfx::BColor maFontColor; // font color - - // #i96669# add simple range buffering for this primitive + /// The length for maText usage, starting from maTextPosition + xub_StrLen maTextLength; + + /// The DX array scale-independent in unit coordinates + ::std::vector< double > maDXArray; + + /// The font to use + attribute::FontAttribute maFontAttribute; + + /// The Locale for the text + ::com::sun::star::lang::Locale maLocale; + + /// font color + basegfx::BColor maFontColor; + + /// #i96669# add simple range buffering for this primitive basegfx::B2DRange maB2DRange; protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor TextSimplePortionPrimitive2D( const basegfx::B2DHomMatrix& rNewTransform, const String& rText, xub_StrLen aTextPosition, xub_StrLen aTextLength, const ::std::vector< double >& rDXArray, - const FontAttributes& rFontAttributes, + const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale, const basegfx::BColor& rFontColor); - // helpers - // get text outlines as polygons and their according ObjectTransformation. Handles all - // the necessary VCL outline extractins, scaling adaptions and other stuff. + /// helpers + /** get text outlines as polygons and their according ObjectTransformation. Handles all + the necessary VCL outline extractins, scaling adaptions and other stuff. + */ void getTextOutlinesAndTransformation(basegfx::B2DPolyPolygonVector& rTarget, basegfx::B2DHomMatrix& rTransformation) const; - // get data + /// data read access const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; } const String& getText() const { return maText; } xub_StrLen getTextPosition() const { return maTextPosition; } xub_StrLen getTextLength() const { return maTextLength; } const ::std::vector< double >& getDXArray() const { return maDXArray; } - const FontAttributes& getFontAttributes() const { return maFontAttributes; } + const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; } const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; } const basegfx::BColor& getFontColor() const { return maFontColor; } - // compare operator + /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; + + /// small helper to have a compare operator for Locale + bool LocalesAreEqual(const ::com::sun::star::lang::Locale& rA, const ::com::sun::star::lang::Locale& rB); + } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx new file mode 100644 index 000000000000..34d7d31fb93a --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx @@ -0,0 +1,167 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: textdecoratedprimitive2d.hxx,v $ + * + * $Revision: 1.6 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/color/bcolor.hxx> +#include <drawinglayer/attribute/fontattribute.hxx> +#include <com/sun/star/lang/Locale.hpp> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + /// geometric definitions + basegfx::B2DHomMatrix maObjectTransformation; + double mfWidth; + + /// decoration definitions + basegfx::BColor maFontColor; + + public: + /// constructor + BaseTextStrikeoutPrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + const basegfx::BColor& rFontColor); + + /// data read access + const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } + double getWidth() const { return mfWidth; } + const basegfx::BColor& getFontColor() const { return maFontColor; } + + /// compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D + { + private: + sal_Unicode maStrikeoutChar; + attribute::FontAttribute maFontAttribute; + ::com::sun::star::lang::Locale maLocale; + + protected: + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + TextCharacterStrikeoutPrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + const basegfx::BColor& rFontColor, + sal_Unicode aStrikeoutChar, + const attribute::FontAttribute& rFontAttribute, + const ::com::sun::star::lang::Locale& rLocale); + + /// data read access + sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; } + const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; } + const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; } + + /// compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D + { + private: + double mfHeight; + double mfOffset; + TextStrikeout meTextStrikeout; + + protected: + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + TextGeometryStrikeoutPrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + const basegfx::BColor& rFontColor, + double fHeight, + double fOffset, + TextStrikeout eTextStrikeout); + + /// data read access + double getHeight() const { return mfHeight; } + double getOffset() const { return mfOffset; } + TextStrikeout getTextStrikeout() const { return meTextStrikeout; } + + /// compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx index 1646667342af..1723cc708ea8 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx @@ -45,26 +45,47 @@ namespace drawinglayer { namespace primitive2d { + /** TransformPrimitive2D class + + This is one of the basic grouping primitives and it provides + embedding a sequence of primitives (a geometry) into a + transformation. All renderers have to handle this, usually by + building a current transformation stack (linear combination) + and applying this to all to-be-rendered geometry. If not handling + this, the output will be mostly wrong since this primitive is + widely used. + + It does transform by embedding an existing geometry into a + transformation as Child-content. This allows re-usage of the + refcounted Uno-Api primitives and their existung, buffered + decompositions. + + It could e.g. be used to show a single object geometry in 1000 + different, transformed states without the need to create those + thousand primitive contents. + */ class TransformPrimitive2D : public GroupPrimitive2D { private: + // the transformation to apply to the child geometry basegfx::B2DHomMatrix maTransformation; public: + /// constructor TransformPrimitive2D( const basegfx::B2DHomMatrix& rTransformation, const Primitive2DSequence& rChildren); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // get range + /// get range virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx index 44f3f738b67e..6e8970e7bee5 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx @@ -44,27 +44,37 @@ namespace drawinglayer { namespace primitive2d { + /** UnifiedAlphaPrimitive2D class + + This primitive encapsualtes a child hierarchy and defines + that it shall be visualized with the given transparency. That + transparency is unique for all contained geometry, so that + e.g. overlapping polygons in the child geometry will not show + regions of combined transparency, but be all rendered with the + defined, single transparency. + */ class UnifiedAlphaPrimitive2D : public GroupPrimitive2D { private: - double mfAlpha; // unified transparence - - protected: - // create decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// the unified alpha transparence + double mfAlpha; public: + /// constructor UnifiedAlphaPrimitive2D( const Primitive2DSequence& rChildren, double fAlpha); - // get data + /// data read access double getAlpha() const { return mfAlpha; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// create decomposition + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx new file mode 100644 index 000000000000..ffe47cfe1b72 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: bitmapprimitive2d.hxx,v $ + * + * $Revision: 1.4 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> +#include <vcl/wall.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** WallpaperBitmapPrimitive2D class + + This is a specialized primtive for the Wallpaper definitions included in + VCL and Metafiles. The extraordinary about the bitmap definition part of + the Wallpaper is that it uses PIXEL size of the given Bitmap and not + the logic and/or discrete size derived by PrefMapMode/PrefSize methods. + To emulate this, a ViewTransformation dependent primitive is needed which + takes over the correct scaling(s). + + Since a specialized primitive is needed anyways, i opted to also add the + layouting which is dependent from WallpaperStyle; thus it does not need + to be handled anywhere else in the future. + */ + class WallpaperBitmapPrimitive2D : public ViewTransformationDependentPrimitive2D + { + private: + basegfx::B2DRange maObjectRange; + BitmapEx maBitmapEx; + WallpaperStyle meWallpaperStyle; + + protected: + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + WallpaperBitmapPrimitive2D( + const basegfx::B2DRange& rObjectRange, + const BitmapEx& rBitmapEx, + WallpaperStyle eWallpaperStyle); + + /// data read access + const basegfx::B2DRange& getLocalObjectRange() const { return maObjectRange; } + const BitmapEx& getBitmapEx() const { return maBitmapEx ; } + WallpaperStyle getWallpaperStyle() const { return meWallpaperStyle; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + /// get B2Drange + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx index 8bd739298059..3ceae01ed3b2 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx @@ -47,35 +47,53 @@ namespace drawinglayer { namespace primitive2d { - class WrongSpellPrimitive2D : public BasePrimitive2D + /** WrongSpellPrimitive2D class + + This is a helper primitive to hold evtl. WrongSpell visualisations + in the sequence of primitives. The primitive holds this information + separated form the TextPortions to where it belongs to tot expand the + TextSimplePortionPrimitive2D more as needed. + + A renderer who does not want to visualize this (if contained at all) + can detect and ignore this primitive. If it's decomposition is used, + it will be visualized as red wavelines. + + The geometric definition defines a line on the X-Axis (no Y-coordinates) + which will when transformed by Transformation, create the coordinate data. + */ + class WrongSpellPrimitive2D : public BufferedDecompositionPrimitive2D { private: + /// geometry definition basegfx::B2DHomMatrix maTransformation; double mfStart; double mfStop; + + /// color (usually red) basegfx::BColor maColor; protected: - // create local decomposition - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: + /// constructor WrongSpellPrimitive2D( const basegfx::B2DHomMatrix& rTransformation, double fStart, double fStop, const basegfx::BColor& rColor); - // get data + /// data read access const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } double getStart() const { return mfStart; } double getStop() const { return mfStop; } const basegfx::BColor& getColor() const { return maColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx index faeac28b0c0c..9bf56edb2c53 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx @@ -43,16 +43,17 @@ #include <basegfx/range/b3drange.hxx> ////////////////////////////////////////////////////////////////////////////// -// defines for DeclPrimitrive3DIDBlock and ImplPrimitrive3DIDBlock -// Added to be able to simply change identification stuff later, e.g. add -// a identification string and/or ID to the interface and to the implementation -// ATM used to delclare implement getPrimitiveID() +/** defines for DeclPrimitrive3DIDBlock and ImplPrimitrive3DIDBlock + Added to be able to simply change identification stuff later, e.g. add + a identification string and/or ID to the interface and to the implementation + ATM used to delclare implement getPrimitive3DID() + */ #define DeclPrimitrive3DIDBlock() \ - virtual sal_uInt32 getPrimitiveID() const; + virtual sal_uInt32 getPrimitive3DID() const; #define ImplPrimitrive3DIDBlock(TheClass, TheID) \ - sal_uInt32 TheClass::getPrimitiveID() const { return TheID; } + sal_uInt32 TheClass::getPrimitive3DID() const { return TheID; } ////////////////////////////////////////////////////////////////////////////// // predefines @@ -61,6 +62,13 @@ namespace drawinglayer { namespace geometry { class ViewInformation3D; }} +namespace drawinglayer { namespace primitive3d { + /// typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference + typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase; + typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference; + typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence; +}} + ////////////////////////////////////////////////////////////////////////////// // basePrimitive3D class @@ -68,99 +76,145 @@ namespace drawinglayer { namespace primitive3d { - // typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference - typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase; - typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference; - typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence; + /** BasePrimitive3D class + + Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D + + The description/functionality is identical with the 2D case in baseprimitive2d.hxx, + please see there for detailed information. + Current Basic 3D Primitives are: + + - PolygonHairlinePrimitive3D (for 3D hairlines) + - PolyPolygonMaterialPrimitive3D (for 3D filled plane polygons) + + That's all for 3D! + */ class BasePrimitive3D : private boost::noncopyable, protected comphelper::OBaseMutex, public BasePrimitive3DImplBase { private: - // a sequence used for buffering the last createLocalDecomposition() result. Use - // the protected access methods to change. Only implementations of getDecomposition() - // should make use. - Primitive3DSequence maLocalDecomposition; - protected: - // access methods to maLocalDecomposition. The usage of this methods may allow - // later thread-safe stuff to be added if needed. Only to be used by getDecomposition() - // implementations for buffering the last decomposition. - const Primitive3DSequence& getLocalDecomposition() const { return maLocalDecomposition; } - void setLocalDecomposition(const Primitive3DSequence& rNew) { maLocalDecomposition = rNew; } - - // method which is to be used to implement the local decomposition of a 2D primitive. The default - // implementation will just return an empty decomposition - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; - public: - // constructor + // constructor/destructor BasePrimitive3D(); + virtual ~BasePrimitive3D(); - // the ==operator is mainly needed to allow testing newly-created high level primitives against their last - // incarnation which buffers/holds the decompositionsThe default implementation - // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then - // based on this implementation + /** the ==operator is mainly needed to allow testing newly-created high level primitives against their last + incarnation which buffers/holds the decompositionsThe default implementation + uses getPrimitive3DID()-calls to test if it's the same ID at last. Overloaded implementation are then + based on this implementation. + */ virtual bool operator==( const BasePrimitive3D& rPrimitive ) const; bool operator!=( const BasePrimitive3D& rPrimitive ) const { return !operator==(rPrimitive); } - // This method is for places where using the C++ implementation directly is possible. The subprocessing - // and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation - // will use getDecomposition results to create the range + /** This method is for places where using the C++ implementation directly is possible. The subprocessing + and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation + will use getDecomposition results to create the range + */ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID for fast identifying of known primitive implementations in renderers. These use - // the the defines from primitivetypes3d.hxx to define unique IDs. - virtual sal_uInt32 getPrimitiveID() const = 0; + /** provide unique ID for fast identifying of known primitive implementations in renderers. These use + the the defines from primitivetypes3d.hxx to define unique IDs. + */ + virtual sal_uInt32 getPrimitive3DID() const = 0; - // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty. - // It will set maLocalDecomposition to this obtained decomposition to buffer it. - // If the decomposition is also ViewInformation-dependent, this method needs to be overloaded and the - // ViewInformation for the last decomposition needs to be remembered, too, and be used in the next call to decide if - // the buffered decomposition may be reused or not. + /// The default implementation returns an empty sequence virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; // // Methods from XPrimitive3D // - // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It - // will get the ViewInformation from the ViewParameters for that purpose + /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It + will get the ViewInformation from the ViewParameters for that purpose + */ virtual Primitive3DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException ); - // the getRange default implemenation will use getDecomposition to create the range information from merging - // getRange results from the single local decomposition primitives. + /** the getRange default implemenation will use getDecomposition to create the range information from merging + getRange results from the single local decomposition primitives. + */ virtual ::com::sun::star::geometry::RealRectangle3D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException ); }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// +// BufferedDecompositionPrimitive3D class + +namespace drawinglayer +{ + namespace primitive3d + { + /** BufferedDecompositionPrimitive3D class + + Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D + + The description/functionality is identical with the 2D case in baseprimitive2d.hxx, + please see there for detailed information + */ + class BufferedDecompositionPrimitive3D + : public BasePrimitive3D + { + private: + /// a sequence used for buffering the last create3DDecomposition() result + Primitive3DSequence maBuffered3DDecomposition; + + protected: + /** access methods to maBuffered3DDecomposition. The usage of this methods may allow + later thread-safe stuff to be added if needed. Only to be used by getDecomposition() + implementations for buffering the last decomposition. + */ + const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; } + void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; } + + /** method which is to be used to implement the local decomposition of a 2D primitive. The default + implementation will just return an empty decomposition + */ + virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + + public: + // constructor + BufferedDecompositionPrimitive3D(); + + /** The getDecomposition default implementation will on demand use create3DDecomposition() if + maBuffered3DDecomposition is empty. It will set maBuffered3DDecomposition to this obtained decomposition + to buffer it. If the decomposition is also ViewInformation-dependent, this method needs to be + overloaded and the ViewInformation for the last decomposition needs to be remembered, too, and + be used in the next call to decide if the buffered decomposition may be reused or not. + */ + virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + }; + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// // tooling namespace drawinglayer { namespace primitive3d { - // get B3DRange from a given Primitive3DReference + /// get B3DRange from a given Primitive3DReference basegfx::B3DRange getB3DRangeFromPrimitive3DReference(const Primitive3DReference& rCandidate, const geometry::ViewInformation3D& aViewInformation); - // get range3D from a given Primitive3DSequence + /// get range3D from a given Primitive3DSequence basegfx::B3DRange getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, const geometry::ViewInformation3D& aViewInformation); - // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D) - // and using compare operator + /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D) + and using compare operator + */ bool arePrimitive3DReferencesEqual(const Primitive3DReference& rA, const Primitive3DReference& rB); - // compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally + /// compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally bool arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB); - // concatenate sequence + /// concatenate sequence void appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource); - // concatenate single Primitive3D + /// concatenate single Primitive3D void appendPrimitive3DReferenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DReference& rSource); } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx index 029b4c664fe2..69e406c75d67 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx @@ -44,27 +44,45 @@ namespace drawinglayer { namespace primitive3d { + /** GroupPrimitive3D class + + Baseclass for all grouping 3D primitives + + The description/functionality is identical with the 2D case in groupprimitive2d.hxx, + please see there for detailed information. + + Current Basic 3D StatePrimitives are: + + - ModifiedColorPrimitive3D (for a stack of color modifications) + - ShadowPrimitive3D (for 3D objects with shadow; this is a special case + since the shadow of a 3D primitive is a 2D primitive set) + - TexturePrimitive3D (with the following variations) + - GradientTexturePrimitive3D (for 3D gradient fill) + - BitmapTexturePrimitive3D (for 3D Bitmap fill) + - AlphaTexturePrimitive3D (for 3D transparence) + - HatchTexturePrimitive3D (for 3D hatch fill) + - TransformPrimitive3D (for a transformation stack) + */ class GroupPrimitive3D : public BasePrimitive3D { private: - // the children. Declared private since this shall never be changed at all after construction + /// the children. Declared private since this shall never be changed at all after construction Primitive3DSequence maChildren; - protected: - // local decomposition. Implementation will just return children - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; - public: - // constructor + /// constructor GroupPrimitive3D(const Primitive3DSequence& rChildren); - // data access + /// data read access Primitive3DSequence getChildren() const { return maChildren; } - // compare operator + /// compare operator virtual bool operator==( const BasePrimitive3D& rPrimitive ) const; - // provide unique ID + /// local decomposition. Implementation will just return children + virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx index c1feccaaa10c..2675a1284779 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx @@ -44,16 +44,32 @@ namespace drawinglayer { namespace primitive3d { + /** HatchTexturePrimitive3D class + + HatchTexturePrimitive3D is derived from GroupPrimitive3D, but implements + a decomposition which is complicated enough for buffering. Since the group + primitive has no default buffering, it is necessary here to add a local + buffering mechanism for the decomposition + */ class HatchTexturePrimitive3D : public TexturePrimitive3D { private: + /// the hatch definition attribute::FillHatchAttribute maHatch; + /// the buffered decomposed hatch + Primitive3DSequence maBuffered3DDecomposition; + protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// helper: local decomposition + Primitive3DSequence impCreate3DDecomposition() const; + + /// local access methods to maBufferedDecomposition + const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; } + void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; } public: + /// constructor HatchTexturePrimitive3D( const attribute::FillHatchAttribute& rHatch, const Primitive3DSequence& rChildren, @@ -61,13 +77,16 @@ namespace drawinglayer bool bModulate, bool bFilter); - // get data + /// data read access const attribute::FillHatchAttribute& getHatch() const { return maHatch; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// local decomposition. + virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx index 28029f223b1b..4779241033b0 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx @@ -44,32 +44,37 @@ namespace drawinglayer { namespace primitive3d { - // This primitive is used to represent geometry for non-visible objects, - // e.g. a 3D cube without fill attributes. To still be able to use - // primitives for HitTest functionality, the 3d decompositions produce - // an as much as possible simplified fill geometry encapsulated in this - // primtive when there is no fill geometry. Currently, the 3d hit test - // uses only areas, so maybe in a further enchanced version this will change - // to 'if neither filled nor lines' creation criteria. The whole primitive - // decomposes to nothing, so no one not knowing it will be influenced. Only - // helper processors for hit test (and maybe BoundRect extractors) will - // use it and it's children subcontent. + /** HitTestPrimitive3D class + + This primitive is used to represent geometry for non-visible objects, + e.g. a 3D cube without fill attributes. To still be able to use + primitives for HitTest functionality, the 3d decompositions produce + an as much as possible simplified fill geometry encapsulated in this + primtive when there is no fill geometry. Currently, the 3d hit test + uses only areas, so maybe in a further enchanced version this will change + to 'if neither filled nor lines' creation criteria. The whole primitive + decomposes to nothing, so no one not knowing it will be influenced. Only + helper processors for hit test (and maybe BoundRect extractors) will + use it and it's children subcontent. + */ class HitTestPrimitive3D : public GroupPrimitive3D { - protected: - // local decomposition. Implementation will return empty Primitive3DSequence - // since this is no visualisation data - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; - public: + /// constructor HitTestPrimitive3D(const Primitive3DSequence& rChildren); - // despite returning an empty decomposition since it's no visualisation data, - // range calculation is intended to use invisible replacement geometry, so - // the local implementation will return the children's range + /** despite returning an empty decomposition since it's no visualisation data, + range calculation is intended to use invisible replacement geometry, so + the local implementation will return the children's range + */ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /** local decomposition. Implementation will return empty Primitive3DSequence + since this is no visualisation data + */ + virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx index 0771e8117fc5..3840bf71a397 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx @@ -45,23 +45,32 @@ namespace drawinglayer { namespace primitive3d { + /** ModifiedColorPrimitive3D class + + This primitive is a grouping primitive and allows to define + how the colors of it's child content shall be modified for + visualisation. Please see the ModifiedColorPrimitive2D + description for more info. + */ class ModifiedColorPrimitive3D : public GroupPrimitive3D { private: + /// The ColorModifier to use basegfx::BColorModifier maColorModifier; public: + /// constructor ModifiedColorPrimitive3D( const Primitive3DSequence& rChildren, const basegfx::BColorModifier& rColorModifier); - // get data + /// data read access const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx index 9de2dc5949e7..c73850e4f794 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx @@ -48,28 +48,40 @@ namespace drawinglayer { namespace primitive3d { + /** PolygonHairlinePrimitive3D class + + This primitive defines a Hairline in 3D. Since hairlines are view-dependent, + this primitive is view-dependent, too. + + This is one of the non-decomposable 3D primitives, so a renderer + should proccess it. + */ class PolygonHairlinePrimitive3D : public BasePrimitive3D { private: + /// the hairline geometry basegfx::B3DPolygon maPolygon; + + /// the hairline color basegfx::BColor maBColor; public: + /// constructor PolygonHairlinePrimitive3D( const basegfx::B3DPolygon& rPolygon, const basegfx::BColor& rBColor); - // get data + /// data read access const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; } const basegfx::BColor& getBColor() const { return maBColor; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d @@ -81,36 +93,49 @@ namespace drawinglayer { namespace primitive3d { - class PolygonStrokePrimitive3D : public BasePrimitive3D + /** PolygonStrokePrimitive3D class + + This primitive defines a 3D line with line width, line join, line color + and stroke attributes. It will be decomposed dependent on the definition + to the needed primitives, e.g. filled Tubes for fat lines. + */ + class PolygonStrokePrimitive3D : public BufferedDecompositionPrimitive3D { private: + /// the line geometry basegfx::B3DPolygon maPolygon; + + /// the line attributes like width, join and color attribute::LineAttribute maLineAttribute; + + /// the line stroking (if used) attribute::StrokeAttribute maStrokeAttribute; protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// local decomposition. + virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; public: + /// constructor PolygonStrokePrimitive3D( const basegfx::B3DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::StrokeAttribute& rStrokeAttribute); + /// constructor without stroking PolygonStrokePrimitive3D( const basegfx::B3DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute); - // get data + /// data read access basegfx::B3DPolygon getB3DPolygon() const { return maPolygon; } const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; } const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx index 8a9b293a8c5e..f5d45f7c1639 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx @@ -52,19 +52,38 @@ namespace drawinglayer { namespace primitive3d { + /** PolygonStrokePrimitive3D class + + This 3D primitive extends a 3D hairline to a 3D tube which is + e.g. used for fat lines in 3D. It's decomposition will create all + 3D objects needed for the line tubes and the edge roundings + in full 3D. + */ class PolygonTubePrimitive3D : public PolygonHairlinePrimitive3D { private: + /// hold the last decompositon since it's expensive + Primitive3DSequence maLast3DDecomposition; + + /// visualisation parameters double mfRadius; double mfDegreeStepWidth; double mfMiterMinimumAngle; basegfx::B2DLineJoin maLineJoin; protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /** access methods to maLast3DDecomposition. The usage of this methods may allow + later thread-safe stuff to be added if needed. Only to be used by getDecomposition() + implementations for buffering the last decomposition. + */ + const Primitive3DSequence& getLast3DDecomposition() const { return maLast3DDecomposition; } + void setLast3DDecomposition(const Primitive3DSequence& rNew) { maLast3DDecomposition = rNew; } + + /// local decomposition. + Primitive3DSequence impCreate3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; public: + /// constructor PolygonTubePrimitive3D( const basegfx::B3DPolygon& rPolygon, const basegfx::BColor& rBColor, @@ -72,16 +91,21 @@ namespace drawinglayer double fDegreeStepWidth = 10.0 * F_PI180, double fMiterMinimumAngle = 15.0 * F_PI180); - // get data + /// data read access double getRadius() const { return mfRadius; } double getDegreeStepWidth() const { return mfDegreeStepWidth; } double getMiterMinimumAngle() const { return mfMiterMinimumAngle; } basegfx::B2DLineJoin getLineJoin() const { return maLineJoin; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /** local decomposition. Use own buffering since we are not derived from + BufferedDecompositionPrimitive3D + */ + virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx index 1c5b9e400bbb..091e8181e38f 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx @@ -46,33 +46,45 @@ namespace drawinglayer { namespace primitive3d { + /** PolyPolygonMaterialPrimitive3D class + + This primitive defines a planar 3D PolyPolygon filled with a single color. + This is one of the non-decomposable primitives, so a renderer + should proccess it. + + It is assumed here that the PolyPolgon is a single plane in 3D. + */ class PolyPolygonMaterialPrimitive3D : public BasePrimitive3D { private: + /// the PolyPolygon geometry basegfx::B3DPolyPolygon maPolyPolygon; + + /// the fill parameters attribute::MaterialAttribute3D maMaterial; - // bitfield + /// bitfield unsigned mbDoubleSided : 1; public: + /// constructor PolyPolygonMaterialPrimitive3D( const basegfx::B3DPolyPolygon& rPolyPolygon, const attribute::MaterialAttribute3D& rMaterial, bool bDoubleSided); - // get data + /// data read access const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; } const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; } bool getDoubleSided() const { return mbDoubleSided; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx index 57f31a46a557..b3a57f2677dc 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx @@ -44,26 +44,33 @@ namespace drawinglayer { namespace primitive3d { + /** SdrCubePrimitive3D class + + This 3D primitive expands the SdrPrimitive3D to a 3D cube definition. + The cube is implicitely in unit coordinates and the given transformation + defines it's geometry in space. + */ class SdrCubePrimitive3D : public SdrPrimitive3D { protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// local decomposition. + virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; public: + /// constructor SdrCubePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx index 772e030781fe..5b793a6928f8 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx @@ -42,6 +42,7 @@ ////////////////////////////////////////////////////////////////////////////// // predefines + namespace basegfx { class B3DPolygon; class B3DPolyPolygon; diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx index 43ae13d4625f..b80198d127d2 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx @@ -53,7 +53,7 @@ namespace drawinglayer { namespace primitive3d { - // Slice3D types + /** SliceType3D definition */ enum SliceType3D { SLICETYPE3D_REGULAR, // normal geoemtry Slice3D @@ -61,7 +61,7 @@ namespace drawinglayer SLICETYPE3D_BACKCAP // back cap }; - // class to hold one Slice3D + /// class to hold one Slice3D class Slice3D { protected: @@ -92,10 +92,10 @@ namespace drawinglayer SliceType3D getSliceType() const { return maSliceType; } }; - // typedef for a group of Slice3Ds + /// typedef for a group of Slice3Ds typedef ::std::vector< Slice3D > Slice3DVector; - // helpers for creation + /// helpers for creation void createLatheSlices( Slice3DVector& rSliceVector, const basegfx::B2DPolyPolygon& rSource, @@ -117,7 +117,7 @@ namespace drawinglayer bool bCloseFront, bool bCloseBack); - // helpers for geometry extraction + /// helpers for geometry extraction basegfx::B3DPolyPolygon extractHorizontalLinesFromSlice(const Slice3DVector& rSliceVector, bool bCloseHorLines); basegfx::B3DPolyPolygon extractVerticalLinesFromSlice(const Slice3DVector& rSliceVector); diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx index a6d386bf194a..a810e0f5ec8e 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx @@ -45,23 +45,34 @@ namespace drawinglayer { namespace primitive3d { + /** SdrExtrudePrimitive3D class + + This 3D primitive expands the SdrPrimitive3D to a 3D extrude definition. + The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D + and gets extruded in Z-Direction by Depth. + + Various possibilities e.g. for creating diagonals (edge roudings in 3D) + and similar are given. + + The decomposition will create all necessary 3D planes for visualisation. + */ class SdrExtrudePrimitive3D : public SdrPrimitive3D { private: - // geometry helper for slices + /// geometry helper for slices basegfx::B2DPolyPolygon maCorrectedPolyPolygon; Slice3DVector maSlices; - // primitive data + /// primitive geometry data basegfx::B2DPolyPolygon maPolyPolygon; double mfDepth; double mfDiagonal; double mfBackScale; - // decomposition data when ReducedLineGeometry is used, see get3DDecomposition + /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition geometry::ViewInformation3D* mpLastRLGViewInformation; - // bitfield + /// bitfield unsigned mbSmoothNormals : 1; // Plane self unsigned mbSmoothHorizontalNormals : 1; // always unsigned mbSmoothLids : 1; // Front/back @@ -69,17 +80,18 @@ namespace drawinglayer unsigned mbCloseFront : 1; unsigned mbCloseBack : 1; - // create slices + /// create slices void impCreateSlices(); - // get (evtl. create) slices + /// get (evtl. create) slices const Slice3DVector& getSlices() const; protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// local decomposition. + virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; public: + /// constructor SdrExtrudePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, @@ -97,7 +109,7 @@ namespace drawinglayer bool bCloseBack); virtual ~SdrExtrudePrimitive3D(); - // data access + /// data read access const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; } double getDepth() const { return mfDepth; } double getDiagonal() const { return mfDiagonal; } @@ -109,16 +121,16 @@ namespace drawinglayer bool getCloseFront() const { return mbCloseFront; } bool getCloseBack() const { return mbCloseBack; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // Overloaded to allow for reduced line mode to decide if to buffer decomposition or not + /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx index 99d06e256431..084ce5bce35e 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx @@ -45,14 +45,25 @@ namespace drawinglayer { namespace primitive3d { + /** SdrLathePrimitive3D class + + This 3D primitive expands the SdrPrimitive3D to a 3D rotation definition. + The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D + and gets rotated around the Y-Axis. + + Various possibilities e.g. for creating diagonals (edge roudings in 3D) + and similar are given. + + The decomposition will create all necessary 3D planes for visualisation. + */ class SdrLathePrimitive3D : public SdrPrimitive3D { private: - // geometry helper for slices + /// geometry helper for slices basegfx::B2DPolyPolygon maCorrectedPolyPolygon; Slice3DVector maSlices; - // primitive data + /// primitive geometry data basegfx::B2DPolyPolygon maPolyPolygon; sal_uInt32 mnHorizontalSegments; sal_uInt32 mnVerticalSegments; @@ -60,10 +71,10 @@ namespace drawinglayer double mfBackScale; double mfRotation; - // decomposition data when ReducedLineGeometry is used, see get3DDecomposition + /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition geometry::ViewInformation3D* mpLastRLGViewInformation; - // bitfield + /// bitfield unsigned mbSmoothNormals : 1; // Plane self unsigned mbSmoothHorizontalNormals : 1; // always unsigned mbSmoothLids : 1; // Front/back @@ -71,14 +82,14 @@ namespace drawinglayer unsigned mbCloseFront : 1; unsigned mbCloseBack : 1; - // create slices + /// create slices void impCreateSlices(); - // get (evtl. create) slices + /// get (evtl. create) slices const Slice3DVector& getSlices() const; protected: - // local helpers + /// local helpers void impCreateOutlines( const geometry::ViewInformation3D& rViewInformation, const basegfx::B3DPolygon& rLoopA, @@ -90,10 +101,11 @@ namespace drawinglayer const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd) const; - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// local decomposition. + virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; public: + /// constructor SdrLathePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, @@ -113,7 +125,7 @@ namespace drawinglayer bool bCloseBack); virtual ~SdrLathePrimitive3D(); - // data access + /// data read access const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; } sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; } sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; } @@ -127,16 +139,16 @@ namespace drawinglayer bool getCloseFront() const { return mbCloseFront; } bool getCloseBack() const { return mbCloseBack; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // Overloaded to allow for reduced line mode to decide if to buffer decomposition or not + /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx index 4eec829afeb5..a6c68bd16da8 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx @@ -44,17 +44,28 @@ namespace drawinglayer { namespace primitive3d { + /** SdrPolyPolygonPrimitive3D class + + This 3D primitive defines a PolyPolgon in space which may have + Line- and FillStyles and extra 3D surface attributes. It is assumed + that the given 3D PolyPolgon (which may contain texture and normal + information) is planar in 3D. + + The decomposition will include all needed 3D data for visualisation, + including FatLines and fill styles. + */ class SdrPolyPolygonPrimitive3D : public SdrPrimitive3D { private: - // the polyPolygon evtl with normals and texture coordinates + /// the planar polyPolygon evtl with normals and texture coordinates basegfx::B3DPolyPolygon maPolyPolygon3D; protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// local decomposition. + virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; public: + /// constructor SdrPolyPolygonPrimitive3D( const basegfx::B3DPolyPolygon& rPolyPolygon3D, const basegfx::B3DHomMatrix& rTransform, @@ -62,16 +73,16 @@ namespace drawinglayer const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); - // data access + /// data access const basegfx::B3DPolyPolygon& getPolyPolygon3D() const { return maPolyPolygon3D; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx index 6b381445716e..4dd620848387 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx @@ -47,39 +47,49 @@ namespace drawinglayer { + /** SdrPrimitive3D class + + Base class for the more complicated geometric primitives, so + derive from buffered primitive to allow overloading of + create3DDecomposition there. + */ namespace primitive3d { - class SdrPrimitive3D : public BasePrimitive3D + class SdrPrimitive3D : public BufferedDecompositionPrimitive3D { private: + /// object surface attributes basegfx::B3DHomMatrix maTransform; basegfx::B2DVector maTextureSize; attribute::SdrLineFillShadowAttribute maSdrLFSAttribute; attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute; protected: - // Standard implementation for primitive3D which - // will use maTransform as range and expand by evtl. line width / 2 + /** Standard implementation for primitive3D which + will use maTransform as range and expand by evtl. line width / 2 + */ basegfx::B3DRange getStandard3DRange() const; - // implementation for primitive3D which - // will use given Slice3Ds and expand by evtl. line width / 2 + /** implementation for primitive3D which + will use given Slice3Ds and expand by evtl. line width / 2 + */ basegfx::B3DRange get3DRangeFromSlices(const Slice3DVector& rSlices) const; public: + /// constructor SdrPrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); - // data access + /// data read access const basegfx::B3DHomMatrix& getTransform() const { return maTransform; } const basegfx::B2DVector& getTextureSize() const { return maTextureSize; } const attribute::SdrLineFillShadowAttribute& getSdrLFSAttribute() const { return maSdrLFSAttribute; } const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx index 358298e30456..52e646e6b4dc 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx @@ -44,17 +44,25 @@ namespace drawinglayer { namespace primitive3d { + /** SdrSpherePrimitive3D class + + This 3D primitive expands the SdrPrimitive3D to a 3D sphere definition. + The sphere is implicitely in unit coordinates and the given transformation + defines it's geometry in space. + */ class SdrSpherePrimitive3D : public SdrPrimitive3D { private: + /// additional geometry definitions sal_uInt32 mnHorizontalSegments; sal_uInt32 mnVerticalSegments; protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// local decomposition. + virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; public: + /// constructor SdrSpherePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, @@ -63,17 +71,17 @@ namespace drawinglayer sal_uInt32 nHorizontalSegments, sal_uInt32 nVerticalSegments); - // data access + /// data read access sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; } sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx index d511c89a9998..cb8e9cd385d0 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx @@ -46,17 +46,29 @@ namespace drawinglayer { namespace primitive3d { + /** ShadowPrimitive3D class + + This 3D grouping primitive is used to define a shadow for + 3d geometry by embedding it. The shadow of 3D objects are + 2D polygons, so the shadow transformation is a 2D transformation. + + If the Shadow3D flag is set, the shadow definition has to be + combined with the scene and camera definition to create the correct + projected shadow 2D-Polygons. + */ class ShadowPrimitive3D : public GroupPrimitive3D { protected: + /// 2D shadow definition basegfx::B2DHomMatrix maShadowTransform; basegfx::BColor maShadowColor; double mfShadowTransparence; - // bitfield + /// bitfield unsigned mbShadow3D : 1; public: + /// constructor ShadowPrimitive3D( const basegfx::B2DHomMatrix& rShadowTransform, const basegfx::BColor& rShadowColor, @@ -64,16 +76,16 @@ namespace drawinglayer bool bShadow3D, const Primitive3DSequence& rChildren); - // get data + /// data read access const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; } const basegfx::BColor& getShadowColor() const { return maShadowColor; } double getShadowTransparence() const { return mfShadowTransparence; } bool getShadow3D() const { return mbShadow3D; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx index 15b8e1265709..f8b81e357ea5 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx @@ -47,31 +47,39 @@ namespace drawinglayer { namespace primitive3d { + /** TexturePrimitive3D class + + This 3D grouping primitive is used to define a texture for + 3d geometry by embedding it. It is used as bae class for + extended texture definitions + */ class TexturePrimitive3D : public GroupPrimitive3D { private: + /// texture geometry definition basegfx::B2DVector maTextureSize; - // bitfield - // flag if texture shall be modulated with white interpolated color + /// bitfield + /// flag if texture shall be modulated with white interpolated color unsigned mbModulate : 1; - // flag if texture shall be filtered + /// flag if texture shall be filtered unsigned mbFilter : 1; public: + /// constructor TexturePrimitive3D( const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, bool bFilter); - // get data + /// data read access const basegfx::B2DVector& getTextureSize() const { return maTextureSize; } bool getModulate() const { return mbModulate; } bool getFilter() const { return mbFilter; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; }; } // end of namespace primitive3d @@ -83,27 +91,34 @@ namespace drawinglayer { namespace primitive3d { + /** UnifiedAlphaTexturePrimitive3D class + + This 3D primitive expands TexturePrimitive3D to a unified + alpha (transparence) texture definition. All 3D primitives + embedded here will be shown with the given transparency. + */ class UnifiedAlphaTexturePrimitive3D : public TexturePrimitive3D { private: + /// transparency definition double mfTransparence; - protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; - public: + /// constructor UnifiedAlphaTexturePrimitive3D( double fTransparence, const Primitive3DSequence& rChildren); - // get data + /// data read access double getTransparence() const { return mfTransparence; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// local decomposition. + virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d @@ -115,16 +130,20 @@ namespace drawinglayer { namespace primitive3d { + /** GradientTexturePrimitive3D class + + This 3D primitive expands TexturePrimitive3D to a gradient texture + definition. All 3D primitives embedded here will be shown with the + defined gradient. + */ class GradientTexturePrimitive3D : public TexturePrimitive3D { private: + /// the gradient definition attribute::FillGradientAttribute maGradient; - protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; - public: + /// constructor GradientTexturePrimitive3D( const attribute::FillGradientAttribute& rGradient, const Primitive3DSequence& rChildren, @@ -132,13 +151,13 @@ namespace drawinglayer bool bModulate, bool bFilter); - // get data + /// data read access const attribute::FillGradientAttribute& getGradient() const { return maGradient; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d @@ -150,30 +169,34 @@ namespace drawinglayer { namespace primitive3d { + /** BitmapTexturePrimitive3D class + + This 3D primitive expands TexturePrimitive3D to a bitmap texture + definition. All 3D primitives embedded here will be shown with the + defined bitmap (maybe tiled if defined). + */ class BitmapTexturePrimitive3D : public TexturePrimitive3D { private: - attribute::FillBitmapAttribute maBitmap; - - protected: - // local decomposition. - virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + /// bitmap fill attribute + attribute::FillBitmapAttribute maFillBitmapAttribute; public: + /// constructor BitmapTexturePrimitive3D( - const attribute::FillBitmapAttribute& rBitmap, + const attribute::FillBitmapAttribute& rFillBitmapAttribute, const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, bool bFilter); - // get data - const attribute::FillBitmapAttribute& getBitmap() const { return maBitmap; } + /// data read access + const attribute::FillBitmapAttribute& getFillBitmapAttribute() const { return maFillBitmapAttribute; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d @@ -185,18 +208,26 @@ namespace drawinglayer { namespace primitive3d { + /** AlphaTexturePrimitive3D class + + This 3D primitive expands TexturePrimitive3D to a alpha texture + definition. For alpha definition, a gradient is used. The values in + that gradient will be interpreted as luminance Alpha-Values. All 3D + primitives embedded here will be shown with the defined transparence. + */ class AlphaTexturePrimitive3D : public GradientTexturePrimitive3D { public: + /// constructor AlphaTexturePrimitive3D( const attribute::FillGradientAttribute& rGradient, const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize); - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx index 720f28445dec..bbf2b8444969 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx @@ -45,26 +45,37 @@ namespace drawinglayer { namespace primitive3d { + /** TransformPrimitive3D class + + This is one of the basic grouping 3D primitives and it provides + embedding a sequence of primitives (a geometry) into a + 3D transformation. + + Please see the description for TransformPrimitive2D since these + primitives are pretty similar. + */ class TransformPrimitive3D : public GroupPrimitive3D { private: + // the 3D transformation to apply basegfx::B3DHomMatrix maTransformation; public: + /// constructor TransformPrimitive3D( const basegfx::B3DHomMatrix& rTransformation, const Primitive3DSequence& rChildren); - // get data + /// data read access const basegfx::B3DHomMatrix& getTransformation() const { return maTransformation; } - // compare operator + /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get range + /// get range virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - // provide unique ID + /// provide unique ID DeclPrimitrive3DIDBlock() }; } // end of namespace primitive3d diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx index 66ca140c2e56..ff77cc3fd5d0 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx @@ -64,6 +64,7 @@ namespace drawinglayer { namespace primitive2d { class PolygonStrokePrimitive2D; class ControlPrimitive2D; class PagePreviewPrimitive2D; + class EpsPrimitive2D; }} ////////////////////////////////////////////////////////////////////////////// @@ -113,6 +114,7 @@ namespace drawinglayer void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate); void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate); void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate); + void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D); ///////////////////////////////////////////////////////////////////////////// // DrawMode adaption support diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst index 1ba3c2e7b614..ee5b96d98a03 100644 --- a/drawinglayer/prj/d.lst +++ b/drawinglayer/prj/d.lst @@ -39,6 +39,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\sceneprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sceneprimitive2d.hxx ..\inc\drawinglayer\primitive2d\shadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\shadowprimitive2d.hxx ..\inc\drawinglayer\primitive2d\structuretagprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\structuretagprimitive2d.hxx +..\inc\drawinglayer\primitive2d\textenumsprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textenumsprimitive2d.hxx ..\inc\drawinglayer\primitive2d\texteffectprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\texteffectprimitive2d.hxx ..\inc\drawinglayer\primitive2d\textlayoutdevice.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textlayoutdevice.hxx ..\inc\drawinglayer\primitive2d\textprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textprimitive2d.hxx @@ -98,6 +99,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d mkdir: %_DEST%\inc%_EXT%\drawinglayer\attribute ..\inc\drawinglayer\attribute\fillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillattribute.hxx ..\inc\drawinglayer\attribute\fillbitmapattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillbitmapattribute.hxx +..\inc\drawinglayer\attribute\fontattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fontattribute.hxx ..\inc\drawinglayer\attribute\materialattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\materialattribute3d.hxx ..\inc\drawinglayer\attribute\sdrallattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrallattribute3d.hxx ..\inc\drawinglayer\attribute\sdrattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrattribute.hxx diff --git a/drawinglayer/source/attribute/fillbitmapattribute.cxx b/drawinglayer/source/attribute/fillbitmapattribute.cxx index 539e85ab2733..99afb234bda5 100644 --- a/drawinglayer/source/attribute/fillbitmapattribute.cxx +++ b/drawinglayer/source/attribute/fillbitmapattribute.cxx @@ -44,8 +44,12 @@ namespace drawinglayer { namespace attribute { - FillBitmapAttribute::FillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling) - : maBitmap(rBitmap), + FillBitmapAttribute::FillBitmapAttribute( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rTopLeft, + const basegfx::B2DVector& rSize, + bool bTiling) + : maBitmapEx(rBitmapEx), maTopLeft(rTopLeft), maSize(rSize), mbTiling(bTiling) @@ -54,10 +58,10 @@ namespace drawinglayer bool FillBitmapAttribute::operator==(const FillBitmapAttribute& rCandidate) const { - return (maBitmap == rCandidate.maBitmap - && maTopLeft == rCandidate.maTopLeft - && maSize == rCandidate.maSize - && mbTiling == rCandidate.mbTiling); + return (getBitmapEx() == rCandidate.getBitmapEx() + && getTopLeft() == rCandidate.getTopLeft() + && getSize() == rCandidate.getSize() + && getTiling() == rCandidate.getTiling()); } } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx new file mode 100644 index 000000000000..5163e2f6a59a --- /dev/null +++ b/drawinglayer/source/attribute/fontattribute.cxx @@ -0,0 +1,63 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: strokeattribute.cxx,v $ + * + * $Revision: 1.3 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/attribute/fontattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + bool FontAttribute::operator==(const FontAttribute& rCompare) const + { + return (getFamilyName() == rCompare.getFamilyName() + && getStyleName() == rCompare.getStyleName() + && getWeight() == rCompare.getWeight() + && getSymbol() == rCompare.getSymbol() + && getVertical() == rCompare.getVertical() + && getItalic() == rCompare.getItalic() + && getOutline() == rCompare.getOutline() + && getRTL() == rCompare.getRTL() + && getBiDiStrong() == rCompare.getBiDiStrong()); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/makefile.mk b/drawinglayer/source/attribute/makefile.mk index fa91224e64b6..65f899f67177 100644 --- a/drawinglayer/source/attribute/makefile.mk +++ b/drawinglayer/source/attribute/makefile.mk @@ -47,6 +47,7 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES= \ $(SLO)$/fillattribute.obj \ $(SLO)$/fillbitmapattribute.obj \ + $(SLO)$/fontattribute.obj \ $(SLO)$/materialattribute3d.obj \ $(SLO)$/sdrallattribute3d.obj \ $(SLO)$/sdrattribute.obj \ diff --git a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx index c35d0ba5c15f..d7e9090b0f62 100644 --- a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx +++ b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx @@ -228,7 +228,7 @@ namespace drawinglayer aBitmapSize.setY(aBitmapSize.getY() / fRangeHeight); } - return FillBitmapAttribute(aBitmap, aBitmapTopLeft, aBitmapSize, mbTiling); + return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, mbTiling); } } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx index 706684c5f7d8..3a3fd68831db 100644 --- a/drawinglayer/source/geometry/viewinformation2d.cxx +++ b/drawinglayer/source/geometry/viewinformation2d.cxx @@ -157,7 +157,7 @@ namespace drawinglayer mxExtendedInformation[nExtendedInsert++] = rProp; // for performance reasons, also cache content locally - sal_Bool bSalBool = sal_True; + sal_Bool bSalBool(false); rProp.Value >>= bSalBool; mbReducedDisplayQuality = bSalBool; } diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx index 13f1f699f1ab..df38c627ec9f 100644 --- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx @@ -52,33 +52,12 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence AnimatedSwitchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const - { - if(getChildren().hasElements()) - { - const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime())); - const sal_uInt32 nLen(getChildren().getLength()); - sal_uInt32 nIndex(basegfx::fround(fState * (double)nLen)); - - if(nIndex >= nLen) - { - nIndex = nLen - 1L; - } - - const Primitive2DReference xRef(getChildren()[nIndex], uno::UNO_QUERY_THROW); - return Primitive2DSequence(&xRef, 1L); - } - - return Primitive2DSequence(); - } - AnimatedSwitchPrimitive2D::AnimatedSwitchPrimitive2D( const animation::AnimationEntry& rAnimationEntry, const Primitive2DSequence& rChildren, bool bIsTextAnimation) : GroupPrimitive2D(rChildren), mpAnimationEntry(0), - mfDecomposeViewTime(0.0), mbIsTextAnimation(bIsTextAnimation) { // clone given animation description @@ -105,29 +84,22 @@ namespace drawinglayer Primitive2DSequence AnimatedSwitchPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { - ::osl::MutexGuard aGuard( m_aMutex ); - - if(getLocalDecomposition().hasElements() && mfDecomposeViewTime != rViewInformation.getViewTime()) + if(getChildren().hasElements()) { - // conditions of last local decomposition have changed, delete - const_cast< AnimatedSwitchPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); - } + const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime())); + const sal_uInt32 nLen(getChildren().getLength()); + sal_uInt32 nIndex(basegfx::fround(fState * (double)nLen)); - if(!getLocalDecomposition().hasElements()) - { - // remember time - const_cast< AnimatedSwitchPrimitive2D* >(this)->mfDecomposeViewTime = rViewInformation.getViewTime(); - } + if(nIndex >= nLen) + { + nIndex = nLen - 1L; + } - // use parent implementation - return GroupPrimitive2D::get2DDecomposition(rViewInformation); - } + const Primitive2DReference xRef(getChildren()[nIndex], uno::UNO_QUERY_THROW); + return Primitive2DSequence(&xRef, 1L); + } - basegfx::B2DRange AnimatedSwitchPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const - { - // to get range from decomposition and not from group content, call implementation from - // BasePrimitive2D here - return BasePrimitive2D::getB2DRange(rViewInformation); + return Primitive2DSequence(); } // provide unique ID @@ -142,7 +114,15 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence AnimatedBlinkPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + AnimatedBlinkPrimitive2D::AnimatedBlinkPrimitive2D( + const animation::AnimationEntry& rAnimationEntry, + const Primitive2DSequence& rChildren, + bool bIsTextAnimation) + : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation) + { + } + + Primitive2DSequence AnimatedBlinkPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { if(getChildren().hasElements()) { @@ -157,14 +137,6 @@ namespace drawinglayer return Primitive2DSequence(); } - AnimatedBlinkPrimitive2D::AnimatedBlinkPrimitive2D( - const animation::AnimationEntry& rAnimationEntry, - const Primitive2DSequence& rChildren, - bool bIsTextAnimation) - : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation) - { - } - // provide unique ID ImplPrimitrive2DIDBlock(AnimatedBlinkPrimitive2D, PRIMITIVE2D_ID_ANIMATEDBLINKPRIMITIVE2D) @@ -172,41 +144,30 @@ namespace drawinglayer } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -// helper class for AnimatedInterpolatePrimitive2D namespace drawinglayer { namespace primitive2d { - BufferedMatrixDecompose::BufferedMatrixDecompose(const basegfx::B2DHomMatrix& rMatrix) - : maB2DHomMatrix(rMatrix), - maScale(0.0, 0.0), - maTranslate(0.0, 0.0), - mfRotate(0.0), - mfShearX(0.0), - mbDecomposed(false) + AnimatedInterpolatePrimitive2D::AnimatedInterpolatePrimitive2D( + const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack, + const animation::AnimationEntry& rAnimationEntry, + const Primitive2DSequence& rChildren, + bool bIsTextAnimation) + : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation), + maMatrixStack() { - } + // copy matrices to locally pre-decomposed matrix stack + const sal_uInt32 nCount(rmMatrixStack.size()); + maMatrixStack.reserve(nCount); - void BufferedMatrixDecompose::ensureDecompose() const - { - if(!mbDecomposed) + for(sal_uInt32 a(0L); a < nCount; a++) { - BufferedMatrixDecompose* pThis = const_cast< BufferedMatrixDecompose* >(this); - maB2DHomMatrix.decompose(pThis->maScale, pThis->maTranslate, pThis->mfRotate, pThis->mfShearX); - pThis->mbDecomposed = true; + maMatrixStack.push_back(basegfx::tools::B2DHomMatrixBufferedDecompose(rmMatrixStack[a])); } } - } // end of anonymous namespace -} // end of namespace drawinglayer -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive2d - { - Primitive2DSequence AnimatedInterpolatePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence AnimatedInterpolatePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { const sal_uInt32 nSize(maMatrixStack.size()); @@ -227,21 +188,18 @@ namespace drawinglayer const sal_uInt32 nIndA(sal_uInt32(floor(fIndex))); const double fOffset(fIndex - (double)nIndA); basegfx::B2DHomMatrix aTargetTransform; + std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose >::const_iterator aMatA(maMatrixStack.begin() + nIndA); if(basegfx::fTools::equalZero(fOffset)) { // use matrix from nIndA directly - aTargetTransform = maMatrixStack[nIndA].getB2DHomMatrix(); + aTargetTransform = aMatA->getB2DHomMatrix(); } else { - // interpolate. Get involved matrices and ensure they are decomposed + // interpolate. Get involved buffered decomposed matrices const sal_uInt32 nIndB((nIndA + 1L) % nSize); - std::vector< BufferedMatrixDecompose >::const_iterator aMatA(maMatrixStack.begin() + nIndA); - std::vector< BufferedMatrixDecompose >::const_iterator aMatB(maMatrixStack.begin() + nIndB); - - aMatA->ensureDecompose(); - aMatB->ensureDecompose(); + std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose >::const_iterator aMatB(maMatrixStack.begin() + nIndB); // interpolate for fOffset [0.0 .. 1.0[ const basegfx::B2DVector aScale(basegfx::interpolate(aMatA->getScale(), aMatB->getScale(), fOffset)); @@ -250,10 +208,8 @@ namespace drawinglayer const double fShearX(((aMatB->getShearX() - aMatA->getShearX()) * fOffset) + aMatA->getShearX()); // build matrix for state - aTargetTransform.scale(aScale.getX(), aScale.getY()); - aTargetTransform.shearX(fShearX); - aTargetTransform.rotate(fRotate); - aTargetTransform.translate(aTranslate.getX(), aTranslate.getY()); + aTargetTransform = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale, fShearX, fRotate, aTranslate); } // create new transform primitive reference, return new sequence @@ -266,23 +222,6 @@ namespace drawinglayer } } - AnimatedInterpolatePrimitive2D::AnimatedInterpolatePrimitive2D( - const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack, - const animation::AnimationEntry& rAnimationEntry, - const Primitive2DSequence& rChildren, - bool bIsTextAnimation) - : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation), - maMatrixStack() - { - // copy matrices - const sal_uInt32 nCount(rmMatrixStack.size()); - - for(sal_uInt32 a(0L); a < nCount; a++) - { - maMatrixStack.push_back(BufferedMatrixDecompose(rmMatrixStack[a])); - } - } - // provide unique ID ImplPrimitrive2DIDBlock(AnimatedInterpolatePrimitive2D, PRIMITIVE2D_ID_ANIMATEDINTERPOLATEPRIMITIVE2D) diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx index cff797451954..d425b1ea3138 100644 --- a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx @@ -54,7 +54,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence BackgroundColorPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence BackgroundColorPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { if(!rViewInformation.getViewport().isEmpty()) { @@ -70,7 +70,7 @@ namespace drawinglayer BackgroundColorPrimitive2D::BackgroundColorPrimitive2D( const basegfx::BColor& rBColor) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maBColor(rBColor), maLastViewport() { @@ -78,7 +78,7 @@ namespace drawinglayer bool BackgroundColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const BackgroundColorPrimitive2D& rCompare = (BackgroundColorPrimitive2D&)rPrimitive; @@ -98,20 +98,20 @@ namespace drawinglayer { ::osl::MutexGuard aGuard( m_aMutex ); - if(getLocalDecomposition().hasElements() && (maLastViewport != rViewInformation.getViewport())) + if(getBuffered2DDecomposition().hasElements() && (maLastViewport != rViewInformation.getViewport())) { // conditions of last local decomposition have changed, delete - const_cast< BackgroundColorPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< BackgroundColorPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember ViewRange const_cast< BackgroundColorPrimitive2D* >(this)->maLastViewport = rViewInformation.getViewport(); } // use parent implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx index 63941512bfb0..dffde631b8c3 100644 --- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx @@ -50,20 +50,18 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence BasePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + BasePrimitive2D::BasePrimitive2D() + : BasePrimitive2DImplBase(m_aMutex) { - return Primitive2DSequence(); } - BasePrimitive2D::BasePrimitive2D() - : BasePrimitive2DImplBase(m_aMutex), - maLocalDecomposition() + BasePrimitive2D::~BasePrimitive2D() { } bool BasePrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const { - return (getPrimitiveID() == rPrimitive.getPrimitiveID()); + return (getPrimitive2DID() == rPrimitive.getPrimitive2DID()); } basegfx::B2DRange BasePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const @@ -71,17 +69,9 @@ namespace drawinglayer return getB2DRangeFromPrimitive2DSequence(get2DDecomposition(rViewInformation), rViewInformation); } - Primitive2DSequence BasePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence BasePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { - ::osl::MutexGuard aGuard( m_aMutex ); - - if(!getLocalDecomposition().hasElements()) - { - const Primitive2DSequence aNewSequence(createLocalDecomposition(rViewInformation)); - const_cast< BasePrimitive2D* >(this)->setLocalDecomposition(aNewSequence); - } - - return getLocalDecomposition(); + return Primitive2DSequence(); } Primitive2DSequence SAL_CALL BasePrimitive2D::getDecomposition( const uno::Sequence< beans::PropertyValue >& rViewParameters ) throw ( uno::RuntimeException ) @@ -99,6 +89,38 @@ namespace drawinglayer } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence BufferedDecompositionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + return Primitive2DSequence(); + } + + BufferedDecompositionPrimitive2D::BufferedDecompositionPrimitive2D() + : BasePrimitive2D(), + maBuffered2DDecomposition() + { + } + + Primitive2DSequence BufferedDecompositionPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const + { + ::osl::MutexGuard aGuard( m_aMutex ); + + if(!getBuffered2DDecomposition().hasElements()) + { + const Primitive2DSequence aNewSequence(create2DDecomposition(rViewInformation)); + const_cast< BufferedDecompositionPrimitive2D* >(this)->setBuffered2DDecomposition(aNewSequence); + } + + return getBuffered2DDecomposition(); + } + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// // tooling namespace drawinglayer diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx index 5900900bcf06..43de0ef3b514 100644 --- a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx @@ -65,8 +65,8 @@ namespace drawinglayer { const BitmapPrimitive2D& rCompare = (BitmapPrimitive2D&)rPrimitive; - return (maBitmapEx == rCompare.maBitmapEx - && maTransform == rCompare.maTransform); + return (getBitmapEx() == rCompare.getBitmapEx() + && getTransform() == rCompare.getTransform()); } return false; diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index ba73f920cb08..1341a22f0d89 100644 --- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx @@ -49,7 +49,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence BorderLinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence BorderLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence xRetval; @@ -194,7 +194,7 @@ namespace drawinglayer bool bCreateInside, bool bCreateOutside, const basegfx::BColor& rRGBColor) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maStart(rStart), maEnd(rEnd), mfLeftWidth(fLeftWidth), @@ -212,7 +212,7 @@ namespace drawinglayer bool BorderLinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const BorderLinePrimitive2D& rCompare = (BorderLinePrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx index 6241eeb2fa73..5d536fa8812f 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -54,6 +54,7 @@ #include <svtools/optionsdrawinglayer.hxx> #include <toolkit/awt/vclxwindow.hxx> #include <vcl/window.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -230,12 +231,8 @@ namespace drawinglayer } // short form for scale and translate transformation - basegfx::B2DHomMatrix aBitmapTransform; - - aBitmapTransform.set(0L, 0L, aBitmapSizeLogic.getX()); - aBitmapTransform.set(1L, 1L, aBitmapSizeLogic.getY()); - aBitmapTransform.set(0L, 2L, aTranslate.getX()); - aBitmapTransform.set(1L, 2L, aTranslate.getY()); + const basegfx::B2DHomMatrix aBitmapTransform(basegfx::tools::createScaleTranslateB2DHomMatrix( + aBitmapSizeLogic.getX(), aBitmapSizeLogic.getY(), aTranslate.getX(), aTranslate.getY())); // create primitive xRetval = new BitmapPrimitive2D(BitmapEx(aContent), aBitmapTransform); @@ -266,7 +263,7 @@ namespace drawinglayer return xRetval; } - Primitive2DSequence ControlPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence ControlPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { // try to create a bitmap decomposition. If that fails for some reason, // at least create a replacement decomposition. @@ -283,7 +280,7 @@ namespace drawinglayer ControlPrimitive2D::ControlPrimitive2D( const basegfx::B2DHomMatrix& rTransform, const uno::Reference< awt::XControlModel >& rxControlModel) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), mxControlModel(rxControlModel), mxXControl(), @@ -295,7 +292,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rTransform, const uno::Reference< awt::XControlModel >& rxControlModel, const uno::Reference< awt::XControl >& rxXControl) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), mxControlModel(rxControlModel), mxXControl(rxXControl), @@ -316,7 +313,7 @@ namespace drawinglayer bool ControlPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { // use base class compare operator - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const ControlPrimitive2D& rCompare = (ControlPrimitive2D&)rPrimitive; @@ -365,23 +362,23 @@ namespace drawinglayer ::osl::MutexGuard aGuard( m_aMutex ); const basegfx::B2DVector aNewScaling(rViewInformation.getObjectToViewTransformation() * basegfx::B2DVector(1.0, 1.0)); - if(getLocalDecomposition().hasElements()) + if(getBuffered2DDecomposition().hasElements()) { if(!maLastViewScaling.equal(aNewScaling)) { // conditions of last local decomposition have changed, delete - const_cast< ControlPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< ControlPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember ViewTransformation const_cast< ControlPrimitive2D* >(this)->maLastViewScaling = aNewScaling; } // use parent implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx new file mode 100644 index 000000000000..6e3a5b8e516e --- /dev/null +++ b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: bitmapprimitive2d.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. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx> +#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence DiscreteBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + // use getViewTransformation() and getObjectTransformation() from + // ObjectAndViewTransformationDependentPrimitive2D to create a BitmapPrimitive2D + // with the correct mapping + Primitive2DSequence xRetval; + + if(!getBitmapEx().IsEmpty()) + { + // get discrete size + const Size& rSizePixel = getBitmapEx().GetSizePixel(); + const basegfx::B2DVector aDiscreteSize(rSizePixel.Width(), rSizePixel.Height()); + + // get inverse ViewTransformation + basegfx::B2DHomMatrix aInverseViewTransformation(getViewTransformation()); + aInverseViewTransformation.invert(); + + // get size and position in world coordinates + const basegfx::B2DVector aWorldSize(aInverseViewTransformation * aDiscreteSize); + const basegfx::B2DPoint aWorldTopLeft(getObjectTransformation() * getTopLeft()); + + // build object matrix in world coordinates so that the top-left + // position remains, but eventual transformations (e.g. rotations) + // in the ObjectToView stack remain and get correctly applied + basegfx::B2DHomMatrix aObjectTransform; + + aObjectTransform.set(0, 0, aWorldSize.getX()); + aObjectTransform.set(1, 1, aWorldSize.getY()); + aObjectTransform.set(0, 2, aWorldTopLeft.getX()); + aObjectTransform.set(1, 2, aWorldTopLeft.getY()); + + // get inverse ObjectTransformation + basegfx::B2DHomMatrix aInverseObjectTransformation(getObjectTransformation()); + aInverseObjectTransformation.invert(); + + // transform to object coordinate system + aObjectTransform = aInverseObjectTransformation * aObjectTransform; + + // create BitmapPrimitive2D with now object-local coordinate data + const Primitive2DReference xRef(new BitmapPrimitive2D(getBitmapEx(), aObjectTransform)); + xRetval = Primitive2DSequence(&xRef, 1); + } + + return xRetval; + } + + DiscreteBitmapPrimitive2D::DiscreteBitmapPrimitive2D( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rTopLeft) + : ObjectAndViewTransformationDependentPrimitive2D(), + maBitmapEx(rBitmapEx), + maTopLeft(rTopLeft) + { + } + + bool DiscreteBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(ObjectAndViewTransformationDependentPrimitive2D::operator==(rPrimitive)) + { + const DiscreteBitmapPrimitive2D& rCompare = (DiscreteBitmapPrimitive2D&)rPrimitive; + + return (getBitmapEx() == rCompare.getBitmapEx() + && getTopLeft() == rCompare.getTopLeft()); + } + + return false; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(DiscreteBitmapPrimitive2D, PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx index 5805c02a61ed..0c0a863733de 100644 --- a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx @@ -84,7 +84,7 @@ namespace drawinglayer return maShadowPrimitives.hasElements(); } - Primitive2DSequence Embedded3DPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence Embedded3DPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { // use info to create a yellow 2d rectangle, similar to empty 3d scenes and/or groups const basegfx::B2DRange aLocal2DRange(getB2DRange(rViewInformation)); @@ -102,7 +102,7 @@ namespace drawinglayer const basegfx::B3DVector& rLightNormal, double fShadowSlant, const basegfx::B3DRange& rScene3DRange) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), mxChildren3D(rxChildren3D), maObjectTransformation(rObjectTransformation), maViewInformation3D(rViewInformation3D), @@ -118,7 +118,7 @@ namespace drawinglayer bool Embedded3DPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const Embedded3DPrimitive2D& rCompare = static_cast< const Embedded3DPrimitive2D& >(rPrimitive); diff --git a/drawinglayer/source/primitive2d/epsprimitive2d.cxx b/drawinglayer/source/primitive2d/epsprimitive2d.cxx new file mode 100644 index 000000000000..5854e90cfb9f --- /dev/null +++ b/drawinglayer/source/primitive2d/epsprimitive2d.cxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: backgroundcolorprimitive2d.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. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive2d/epsprimitive2d.hxx> +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <drawinglayer/primitive2d/metafileprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence EpsPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence xRetval; + const GDIMetaFile& rSubstituteContent = getMetaFile(); + + if(rSubstituteContent.GetActionCount()) + { + // the default decomposition will use the Metafile replacement visualisation. + // To really use the Eps data, a renderer has to know and interpret this primitive + // directly. + xRetval.realloc(1); + + xRetval[0] = Primitive2DReference( + new MetafilePrimitive2D( + getEpsTransform(), + rSubstituteContent)); + } + + return xRetval; + } + + EpsPrimitive2D::EpsPrimitive2D( + const basegfx::B2DHomMatrix& rEpsTransform, + const GfxLink& rGfxLink, + const GDIMetaFile& rMetaFile) + : BufferedDecompositionPrimitive2D(), + maEpsTransform(rEpsTransform), + maGfxLink(rGfxLink), + maMetaFile(rMetaFile) + { + } + + bool EpsPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) + { + const EpsPrimitive2D& rCompare = (EpsPrimitive2D&)rPrimitive; + + return (getEpsTransform() == rCompare.getEpsTransform() + && getGfxLink().IsEqual(rCompare.getGfxLink()) + && getMetaFile() == rCompare.getMetaFile()); + } + + return false; + } + + basegfx::B2DRange EpsPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + // use own implementation to quickly answer the getB2DRange question. + basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0); + aRetval.transform(getEpsTransform()); + + return aRetval; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(EpsPrimitive2D, PRIMITIVE2D_ID_EPSPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx index 125c2cb42193..ab9e9d19f6d2 100644 --- a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx @@ -54,9 +54,9 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence FillBitmapPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence FillBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { - const Size aTileSizePixel(getFillBitmap().getBitmap().GetSizePixel()); + const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel()); Primitive2DSequence aRetval; // is there a tile with some size at all? @@ -79,7 +79,7 @@ namespace drawinglayer aNewMatrix *= getTransformation(); // create bitmap primitive and add to result - const Primitive2DReference xRef(new BitmapPrimitive2D(BitmapEx(getFillBitmap().getBitmap()), aNewMatrix)); + const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix)); aRetval[a] = xRef; } } @@ -94,7 +94,7 @@ namespace drawinglayer aObjectTransform *= getTransformation(); // create bitmap primitive and add exclusive to decomposition (hand over ownership) - const Primitive2DReference xRef(new BitmapPrimitive2D(BitmapEx(getFillBitmap().getBitmap()), aObjectTransform)); + const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform)); aRetval = Primitive2DSequence(&xRef, 1L); } } @@ -105,7 +105,7 @@ namespace drawinglayer FillBitmapPrimitive2D::FillBitmapPrimitive2D( const basegfx::B2DHomMatrix& rTransformation, const attribute::FillBitmapAttribute& rFillBitmap) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransformation(rTransformation), maFillBitmap(rFillBitmap) { @@ -113,7 +113,7 @@ namespace drawinglayer bool FillBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const FillBitmapPrimitive2D& rCompare = static_cast< const FillBitmapPrimitive2D& >(rPrimitive); diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx index ff0c031b38a1..625dae6cb93a 100644 --- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx @@ -54,37 +54,27 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence FillGradientPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + void FillGradientPrimitive2D::generateMatricesAndColors( + std::vector< basegfx::B2DHomMatrix >& rMatrices, + std::vector< basegfx::BColor >& rColors) const { - const attribute::GradientStyle aGradientStyle(maFillGradient.getStyle()); - ::std::vector< basegfx::B2DHomMatrix > aMatrices; - ::std::vector< basegfx::BColor > aColors; - basegfx::B2DPolygon aUnitPolygon; - sal_uInt32 nSteps(maFillGradient.getSteps()); - - if(attribute::GRADIENTSTYLE_RADIAL == aGradientStyle || attribute::GRADIENTSTYLE_ELLIPTICAL == aGradientStyle) - { - const basegfx::B2DPoint aCircleCenter(0.5, 0.5); - aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5); - } - else - { - aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)); - } + rMatrices.clear(); + rColors.clear(); // make sure steps is not too high/low const basegfx::BColor aStart(maFillGradient.getStartColor()); const basegfx::BColor aEnd(maFillGradient.getEndColor()); const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5)); + sal_uInt32 nSteps(maFillGradient.getSteps()); - if(nSteps == 0L) + if(nSteps == 0) { nSteps = nMaxSteps; } - if(nSteps < 2L) + if(nSteps < 2) { - nSteps = 2L; + nSteps = 2; } if(nSteps > nMaxSteps) @@ -92,82 +82,184 @@ namespace drawinglayer nSteps = nMaxSteps; } - switch(aGradientStyle) + switch(maFillGradient.getStyle()) { case attribute::GRADIENTSTYLE_LINEAR: { texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle()); - aGradient.appendTransformations(aMatrices); - aGradient.appendColors(aColors); + aGradient.appendTransformations(rMatrices); + aGradient.appendColors(rColors); break; } case attribute::GRADIENTSTYLE_AXIAL: { texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle()); - aGradient.appendTransformations(aMatrices); - aGradient.appendColors(aColors); + aGradient.appendTransformations(rMatrices); + aGradient.appendColors(rColors); break; } case attribute::GRADIENTSTYLE_RADIAL: { texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY()); - aGradient.appendTransformations(aMatrices); - aGradient.appendColors(aColors); + aGradient.appendTransformations(rMatrices); + aGradient.appendColors(rColors); break; } case attribute::GRADIENTSTYLE_ELLIPTICAL: { texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle()); - aGradient.appendTransformations(aMatrices); - aGradient.appendColors(aColors); + aGradient.appendTransformations(rMatrices); + aGradient.appendColors(rColors); break; } case attribute::GRADIENTSTYLE_SQUARE: { texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle()); - aGradient.appendTransformations(aMatrices); - aGradient.appendColors(aColors); + aGradient.appendTransformations(rMatrices); + aGradient.appendColors(rColors); break; } case attribute::GRADIENTSTYLE_RECT: { texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle()); - aGradient.appendTransformations(aMatrices); - aGradient.appendColors(aColors); + aGradient.appendTransformations(rMatrices); + aGradient.appendColors(rColors); break; } } + } + Primitive2DSequence FillGradientPrimitive2D::createOverlappingFill( + const std::vector< basegfx::B2DHomMatrix >& rMatrices, + const std::vector< basegfx::BColor >& rColors, + const basegfx::B2DPolygon& rUnitPolygon) const + { // prepare return value - Primitive2DSequence aRetval(aColors.size() ? aMatrices.size() + 1L : aMatrices.size()); + Primitive2DSequence aRetval(rColors.size() ? rMatrices.size() + 1 : rMatrices.size()); // create solid fill with start color - if(aColors.size()) + if(rColors.size()) { // create primitive - const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())), aColors[0L])); - aRetval[0L] = xRef; + const Primitive2DReference xRef( + new PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())), + rColors[0])); + aRetval[0] = xRef; } // create solid fill steps - for(sal_uInt32 a(0L); a < aMatrices.size(); a++) + for(sal_uInt32 a(0); a < rMatrices.size(); a++) { // create part polygon - basegfx::B2DPolygon aNewPoly(aUnitPolygon); - aNewPoly.transform(aMatrices[a]); + basegfx::B2DPolygon aNewPoly(rUnitPolygon); + aNewPoly.transform(rMatrices[a]); // create solid fill - const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aNewPoly), aColors[a + 1L])); - aRetval[a + 1L] = xRef; + const Primitive2DReference xRef( + new PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aNewPoly), + rColors[a + 1])); + aRetval[a + 1] = xRef; + } + + return aRetval; + } + + Primitive2DSequence FillGradientPrimitive2D::createNonOverlappingFill( + const std::vector< basegfx::B2DHomMatrix >& rMatrices, + const std::vector< basegfx::BColor >& rColors, + const basegfx::B2DPolygon& rUnitPolygon) const + { + // prepare return value + Primitive2DSequence aRetval; + const sal_uInt32 nMatricesSize(rMatrices.size()); + + if(nMatricesSize) + { + basegfx::B2DPolygon aOuterPoly(rUnitPolygon); + aOuterPoly.transform(rMatrices[0]); + basegfx::B2DPolyPolygon aCombinedPolyPoly(aOuterPoly); + const sal_uInt32 nEntryCount(rColors.size() ? rMatrices.size() + 1 : rMatrices.size()); + sal_uInt32 nIndex(0); + + aRetval.realloc(nEntryCount); + + if(rColors.size()) + { + basegfx::B2DRange aOuterPolyRange(aOuterPoly.getB2DRange()); + aOuterPolyRange.expand(getObjectRange()); + aCombinedPolyPoly.append(basegfx::tools::createPolygonFromRect(aOuterPolyRange)); + aRetval[nIndex++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(aCombinedPolyPoly, rColors[0])); + aCombinedPolyPoly = basegfx::B2DPolyPolygon(aOuterPoly); + } + + for(sal_uInt32 a(1); a < nMatricesSize - 1; a++) + { + basegfx::B2DPolygon aInnerPoly(rUnitPolygon); + aInnerPoly.transform(rMatrices[a]); + aCombinedPolyPoly.append(aInnerPoly); + aRetval[nIndex++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(aCombinedPolyPoly, rColors[a])); + aCombinedPolyPoly = basegfx::B2DPolyPolygon(aInnerPoly); + } + + if(rColors.size()) + { + aRetval[nIndex] = Primitive2DReference(new PolyPolygonColorPrimitive2D( + aCombinedPolyPoly, rColors[rColors.size() - 1])); + } } return aRetval; } + Primitive2DSequence FillGradientPrimitive2D::createFill(bool bOverlapping) const + { + // prepare shape of the Unit Polygon + basegfx::B2DPolygon aUnitPolygon; + + if(attribute::GRADIENTSTYLE_RADIAL == maFillGradient.getStyle() + || attribute::GRADIENTSTYLE_ELLIPTICAL == maFillGradient.getStyle()) + { + const basegfx::B2DPoint aCircleCenter(0.5, 0.5); + aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5); + } + else + { + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)); + } + + // get the transform matrices and colors (where colors + // will have one more entry that matrices) + std::vector< basegfx::B2DHomMatrix > aMatrices; + std::vector< basegfx::BColor > aColors; + generateMatricesAndColors(aMatrices, aColors); + + if(bOverlapping) + { + return createOverlappingFill(aMatrices, aColors, aUnitPolygon); + } + else + { + return createNonOverlappingFill(aMatrices, aColors, aUnitPolygon); + } + } + + Primitive2DSequence FillGradientPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + // default creates overlapping fill which works with AntiAliasing and without. + // The non-overlapping version does not create single filled polygons, but + // PolyPolygons where each one describes a 'ring' for the gradient such + // that the rings will not overlap. This is useful fir the old XOR-paint + // 'trick' of VCL which is recorded in Metafiles; so this version may be + // used from the MetafilePrimitive2D in it's decomposition. + return createFill(true); + } + FillGradientPrimitive2D::FillGradientPrimitive2D( const basegfx::B2DRange& rObjectRange, const attribute::FillGradientAttribute& rFillGradient) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maObjectRange(rObjectRange), maFillGradient(rFillGradient) { @@ -175,7 +267,7 @@ namespace drawinglayer bool FillGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx index 06d04111686d..9e6e69516d43 100644 --- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx @@ -55,7 +55,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence FillHatchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence FillHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // create hatch const basegfx::BColor aHatchColor(maFillHatch.getColor()); @@ -125,7 +125,7 @@ namespace drawinglayer const basegfx::B2DRange& rObjectRange, const basegfx::BColor& rBColor, const attribute::FillHatchAttribute& rFillHatch) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maObjectRange(rObjectRange), maFillHatch(rFillHatch), maBColor(rBColor) @@ -134,7 +134,7 @@ namespace drawinglayer bool FillHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index 1ed826dab562..6d1540594dc9 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -56,6 +56,18 @@ #include <vcl/svapp.hxx> ////////////////////////////////////////////////////////////////////////////// +// 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 { @@ -211,19 +223,52 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence GraphicPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + 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; if(255L != getGraphicAttr().GetTransparency()) { - // get transformed graphic. Suppress rotation and cropping, only filtering is needed - // here (and may be replaced later on). Cropping is handled below as mask primitive (if set) + Primitive2DReference xPrimitive; + + // do not apply mirroring from GraphicAttr to the Metafile by calling + // GetTransformedGraphic, this will try to mirror the Metafile using Scale() + // at the Metafile. This again calls Scale at the single MetaFile actions, + // but this implementation never worked. I reworked that implementations, + // but for security reasons i will try not to use it. + basegfx::B2DHomMatrix aTransform(getTransform()); + + if(getGraphicAttr().IsMirrored()) + { + // content needs mirroring + const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_HORZ); + const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_VERT); + + // mirror by applying negative scale to the unit primitive and + // applying the object transformation on it. + aTransform = basegfx::tools::createScaleB2DHomMatrix( + bHMirr ? -1.0 : 1.0, + bVMirr ? -1.0 : 1.0); + aTransform.translate( + bHMirr ? 1.0 : 0.0, + bVMirr ? 1.0 : 0.0); + aTransform = getTransform() * aTransform; + } + + // Get transformed graphic. Suppress rotation and cropping, only filtering is needed + // here (and may be replaced later on). Cropping is handled below as mask primitive (if set). + // Also need to suppress mirroring, it is part of the transformation now (see above). GraphicAttr aSuppressGraphicAttr(getGraphicAttr()); - aSuppressGraphicAttr.SetCrop(0L, 0L, 0L, 0L); + aSuppressGraphicAttr.SetCrop(0, 0, 0, 0); aSuppressGraphicAttr.SetRotation(0); - Graphic aTransformedGraphic(getGraphicObject().GetTransformedGraphic(&aSuppressGraphicAttr)); - Primitive2DReference xPrimitive; + aSuppressGraphicAttr.SetMirrorFlags(0); + const Graphic aTransformedGraphic(getGraphicObject().GetTransformedGraphic(&aSuppressGraphicAttr)); switch(aTransformedGraphic.GetType()) { @@ -244,7 +289,7 @@ namespace drawinglayer { animation::AnimationEntryFixed aTime((double)aData.stepTime(a), (double)a / (double)aData.count()); aAnimationLoop.append(aTime); - const Primitive2DReference xRef(new BitmapPrimitive2D(aData.stepBitmapEx(a), getTransform())); + const Primitive2DReference xRef(new BitmapPrimitive2D(aData.stepBitmapEx(a), aTransform)); aBitmapPrimitives[a] = xRef; } @@ -258,7 +303,7 @@ namespace drawinglayer } else { - xPrimitive = Primitive2DReference(new BitmapPrimitive2D(aTransformedGraphic.GetBitmapEx(), getTransform())); + xPrimitive = Primitive2DReference(new BitmapPrimitive2D(aTransformedGraphic.GetBitmapEx(), aTransform)); } break; @@ -266,37 +311,480 @@ namespace drawinglayer case GRAPHIC_GDIMETAFILE : { - // create MetafilePrimitive2D - const GDIMetaFile& rMetafile = aTransformedGraphic.GetGDIMetaFile(); - - xPrimitive = Primitive2DReference( - new MetafilePrimitive2D( - getTransform(), - rMetafile)); - - // #i100357# find out if clipping is needed for this primitive. Unfortunately, - // there exist Metafiles who's content is bigger than the proposed PrefSize set - // at them. This is an error, but we need to work around this - const Size aMetaFilePrefSize(rMetafile.GetPrefSize()); - const Size aMetaFileRealSize( - const_cast< GDIMetaFile& >(rMetafile).GetBoundRect( - *Application::GetDefaultDevice()).GetSize()); - - if(aMetaFileRealSize.getWidth() > aMetaFilePrefSize.getWidth() - || aMetaFileRealSize.getHeight() > aMetaFilePrefSize.getHeight()) +#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE + static bool bDoTest(false); + + if(bDoTest) { - // clipping needed. Embed to MaskPrimitive2D. Create childs and mask polygon - const primitive2d::Primitive2DSequence aChildContent(&xPrimitive, 1); - basegfx::B2DPolygon aMaskPolygon( - basegfx::tools::createPolygonFromRect( - basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); - aMaskPolygon.transform(getTransform()); + // 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 Graphic aGraphic(getGraphicObject().GetGraphic()); + const GDIMetaFile& rMetafile = aTransformedGraphic.GetGDIMetaFile(); xPrimitive = Primitive2DReference( - new MaskPrimitive2D( - basegfx::B2DPolyPolygon(aMaskPolygon), - aChildContent)); + new MetafilePrimitive2D( + aTransform, + rMetafile)); + + // #i100357# find out if clipping is needed for this primitive. Unfortunately, + // there exist Metafiles who's content is bigger than the proposed PrefSize set + // at them. This is an error, but we need to work around this + const Size aMetaFilePrefSize(rMetafile.GetPrefSize()); + const Size aMetaFileRealSize( + const_cast< GDIMetaFile& >(rMetafile).GetBoundRect( + *Application::GetDefaultDevice()).GetSize()); + + if(aMetaFileRealSize.getWidth() > aMetaFilePrefSize.getWidth() + || aMetaFileRealSize.getHeight() > aMetaFilePrefSize.getHeight()) + { + // clipping needed. Embed to MaskPrimitive2D. Create childs and mask polygon + const primitive2d::Primitive2DSequence aChildContent(&xPrimitive, 1); + basegfx::B2DPolygon aMaskPolygon( + basegfx::tools::createPolygonFromRect( + basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + aMaskPolygon.transform(aTransform); + + xPrimitive = Primitive2DReference( + new MaskPrimitive2D( + basegfx::B2DPolyPolygon(aMaskPolygon), + aChildContent)); + } +#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE } +#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE break; } @@ -319,7 +807,9 @@ namespace drawinglayer getTransform().decompose(aScale, aTranslate, fRotate, fShearX); // create ranges. The current object range is just scale and translate - const basegfx::B2DRange aCurrent(aTranslate.getX(), aTranslate.getY(), aTranslate.getX() + aScale.getX(), aTranslate.getY() + aScale.getY()); + const basegfx::B2DRange aCurrent( + aTranslate.getX(), aTranslate.getY(), + aTranslate.getX() + aScale.getX(), aTranslate.getY() + aScale.getY()); // calculate scalings between real image size and logic object size. This // is necessary since the crop values are relative to original bitmap size @@ -369,11 +859,15 @@ namespace drawinglayer // build new object transformation for transform primitive which contains xPrimitive basegfx::B2DHomMatrix aNewObjectTransform(getTransform()); aNewObjectTransform.invert(); - aNewObjectTransform.scale(aCropped.getWidth(), aCropped.getHeight()); - aNewObjectTransform.translate(aCropped.getMinX() - aCurrent.getMinX(), aCropped.getMinY() - aCurrent.getMinY()); - aNewObjectTransform.shearX(fShearX); - aNewObjectTransform.rotate(fRotate); - aNewObjectTransform.translate(aTranslate.getX(), aTranslate.getY()); + aNewObjectTransform = basegfx::tools::createScaleTranslateB2DHomMatrix( + aCropped.getWidth(), aCropped.getHeight(), + aCropped.getMinX() - aCurrent.getMinX(), aCropped.getMinY() - aCurrent.getMinY()) + * aNewObjectTransform; + + // add shear, rotate and translate using combined matrix to speedup + const basegfx::B2DHomMatrix aCombinedMatrix(basegfx::tools::createShearXRotateTranslateB2DHomMatrix( + fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); + aNewObjectTransform = aCombinedMatrix * aNewObjectTransform; // prepare TransformPrimitive2D with xPrimitive const Primitive2DReference xTransformPrimitive(new TransformPrimitive2D(aNewObjectTransform, Primitive2DSequence(&xPrimitive, 1L))); @@ -410,7 +904,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rTransform, const GraphicObject& rGraphicObject, const GraphicAttr& rGraphicAttr) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maGraphicObject(rGraphicObject), maGraphicAttr(rGraphicAttr) @@ -420,7 +914,7 @@ namespace drawinglayer GraphicPrimitive2D::GraphicPrimitive2D( const basegfx::B2DHomMatrix& rTransform, const GraphicObject& rGraphicObject) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maGraphicObject(rGraphicObject), maGraphicAttr() @@ -429,7 +923,7 @@ namespace drawinglayer bool GraphicPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const GraphicPrimitive2D& rCompare = (GraphicPrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx index df4171309389..d2bd4b9d5243 100644 --- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx @@ -42,6 +42,7 @@ #include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -53,7 +54,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence GridPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence GridPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence aRetval; @@ -65,10 +66,8 @@ namespace drawinglayer getTransform().decompose(aScale, aTranslate, fRotate, fShearX); // create grid matrix which transforms from scaled logic to view - basegfx::B2DHomMatrix aRST; - aRST.shearX(fShearX); - aRST.rotate(fRotate); - aRST.translate(aTranslate.getX(), aTranslate.getY()); + basegfx::B2DHomMatrix aRST(basegfx::tools::createShearXRotateTranslateB2DHomMatrix( + fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); aRST *= rViewInformation.getObjectToViewTransformation(); // get step widths @@ -248,7 +247,7 @@ namespace drawinglayer sal_uInt32 nSubdivisionsY, const basegfx::BColor& rBColor, const BitmapEx& rCrossMarker) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), mfWidth(fWidth), mfHeight(fHeight), @@ -265,7 +264,7 @@ namespace drawinglayer bool GridPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const GridPrimitive2D& rCompare = (GridPrimitive2D&)rPrimitive; @@ -299,16 +298,16 @@ namespace drawinglayer { ::osl::MutexGuard aGuard( m_aMutex ); - if(getLocalDecomposition().hasElements()) + if(getBuffered2DDecomposition().hasElements()) { if(maLastViewport != rViewInformation.getViewport() || maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation()) { // conditions of last local decomposition have changed, delete - const_cast< GridPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< GridPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember ViewRange and ViewTransformation const_cast< GridPrimitive2D* >(this)->maLastObjectToViewTransformation = rViewInformation.getObjectToViewTransformation(); @@ -316,7 +315,7 @@ namespace drawinglayer } // use parent implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/groupprimitive2d.cxx b/drawinglayer/source/primitive2d/groupprimitive2d.cxx index ae899af6e84d..c9e2a1ea1438 100644 --- a/drawinglayer/source/primitive2d/groupprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/groupprimitive2d.cxx @@ -49,12 +49,6 @@ namespace drawinglayer { namespace primitive2d { - /// default: just return children, so all renderers not supporting group will use it's content - Primitive2DSequence GroupPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const - { - return getChildren(); - } - GroupPrimitive2D::GroupPrimitive2D( const Primitive2DSequence& rChildren ) : BasePrimitive2D(), maChildren(rChildren) @@ -77,6 +71,12 @@ namespace drawinglayer return false; } + /// default: just return children, so all renderers not supporting group will use it's content + Primitive2DSequence GroupPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + return getChildren(); + } + // provide unique ID ImplPrimitrive2DIDBlock(GroupPrimitive2D, PRIMITIVE2D_ID_GROUPPRIMITIVE2D) diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx index 3232e635b561..251ac110acd6 100644 --- a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx @@ -54,7 +54,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence HelplinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence HelplinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { std::vector< BasePrimitive2D* > aTempPrimitiveTarget; @@ -167,7 +167,7 @@ namespace drawinglayer const basegfx::BColor& rRGBColA, const basegfx::BColor& rRGBColB, double fDiscreteDashLength) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPosition(rPosition), maDirection(rDirection), meStyle(eStyle), @@ -181,7 +181,7 @@ namespace drawinglayer bool HelplinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const HelplinePrimitive2D& rCompare = (HelplinePrimitive2D&)rPrimitive; @@ -200,16 +200,16 @@ namespace drawinglayer { ::osl::MutexGuard aGuard( m_aMutex ); - if(getLocalDecomposition().hasElements()) + if(getBuffered2DDecomposition().hasElements()) { if(maLastViewport != rViewInformation.getViewport() || maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation()) { // conditions of last local decomposition have changed, delete - const_cast< HelplinePrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< HelplinePrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember ViewRange and ViewTransformation const_cast< HelplinePrimitive2D* >(this)->maLastObjectToViewTransformation = rViewInformation.getObjectToViewTransformation(); @@ -217,7 +217,7 @@ namespace drawinglayer } // use parent implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx b/drawinglayer/source/primitive2d/hittestprimitive2d.cxx index daf65abd81d4..137f8cf8ad5c 100644 --- a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/hittestprimitive2d.cxx @@ -49,12 +49,6 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence HitTestPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const - { - // return empty sequence - return Primitive2DSequence(); - } - HitTestPrimitive2D::HitTestPrimitive2D( const Primitive2DSequence& rChildren) : GroupPrimitive2D(rChildren) @@ -66,6 +60,12 @@ namespace drawinglayer return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation); } + Primitive2DSequence HitTestPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + // return empty sequence + return Primitive2DSequence(); + } + // provide unique ID ImplPrimitrive2DIDBlock(HitTestPrimitive2D, PRIMITIVE2D_ID_HITTESTPRIMITIVE2D) diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk index e10d1ddbcc71..c9a3cc191a35 100644 --- a/drawinglayer/source/primitive2d/makefile.mk +++ b/drawinglayer/source/primitive2d/makefile.mk @@ -53,7 +53,9 @@ SLOFILES= \ $(SLO)$/borderlineprimitive2d.obj \ $(SLO)$/chartprimitive2d.obj \ $(SLO)$/controlprimitive2d.obj \ + $(SLO)$/discretebitmapprimitive2d.obj \ $(SLO)$/embedded3dprimitive2d.obj \ + $(SLO)$/epsprimitive2d.obj \ $(SLO)$/fillbitmapprimitive2d.obj \ $(SLO)$/fillgradientprimitive2d.obj \ $(SLO)$/fillhatchprimitive2d.obj \ @@ -77,12 +79,16 @@ SLOFILES= \ $(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)$/unifiedalphaprimitive2d.obj \ + $(SLO)$/wallpaperprimitive2d.obj \ $(SLO)$/wrongspellprimitive2d.obj # --- Targets ---------------------------------- diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx index 5737b9ef6cec..acb2335c0d1f 100644 --- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx @@ -55,7 +55,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence MarkerArrayPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence MarkerArrayPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence xRetval; const std::vector< basegfx::B2DPoint >& rPositions = getPositions(); @@ -100,7 +100,7 @@ namespace drawinglayer MarkerArrayPrimitive2D::MarkerArrayPrimitive2D( const std::vector< basegfx::B2DPoint >& rPositions, const BitmapEx& rMarker) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPositions(rPositions), maMarker(rMarker) { @@ -108,7 +108,7 @@ namespace drawinglayer bool MarkerArrayPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const MarkerArrayPrimitive2D& rCompare = (MarkerArrayPrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive2d/maskprimitive2d.cxx b/drawinglayer/source/primitive2d/maskprimitive2d.cxx index 20a4c98db67d..b32abae874ca 100644 --- a/drawinglayer/source/primitive2d/maskprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/maskprimitive2d.cxx @@ -69,6 +69,11 @@ namespace drawinglayer return false; } + basegfx::B2DRange MaskPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + return getMask().getB2DRange(); + } + // provide unique ID ImplPrimitrive2DIDBlock(MaskPrimitive2D, PRIMITIVE2D_ID_MASKPRIMITIVE2D) diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx index 7799b8e66d0e..ba8f81448968 100644 --- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx @@ -53,7 +53,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence MediaPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence MediaPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence xRetval(1); @@ -114,7 +114,7 @@ namespace drawinglayer const rtl::OUString& rURL, const basegfx::BColor& rBackgroundColor, sal_uInt32 nDiscreteBorder) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maURL(rURL), maBackgroundColor(rBackgroundColor), @@ -124,7 +124,7 @@ namespace drawinglayer bool MediaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const MediaPrimitive2D& rCompare = (MediaPrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index 2d1c0428a6a3..2fb3d119d4bd 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -39,6 +39,39 @@ #include <drawinglayer/primitive2d/metafileprimitive2d.hxx> #include <basegfx/tools/canvastools.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <basegfx/color/bcolor.hxx> +#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx> +#include <vcl/lineinfo.hxx> +#include <drawinglayer/attribute/lineattribute.hxx> +#include <drawinglayer/attribute/strokeattribute.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <vcl/metaact.hxx> +#include <drawinglayer/primitive2d/transformprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx> +#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> +#include <vcl/salbtype.hxx> +#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx> +#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx> +#include <vcl/svapp.hxx> +#include <drawinglayer/primitive2d/alphaprimitive2d.hxx> +#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx> +#include <drawinglayer/primitive2d/maskprimitive2d.hxx> +#include <basegfx/polygon/b2dpolygonclipper.hxx> +#include <drawinglayer/primitive2d/invertprimitive2d.hxx> +#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx> +#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx> +#include <drawinglayer/primitive2d/wallpaperprimitive2d.hxx> +#include <drawinglayer/primitive2d/textprimitive2d.hxx> +#include <drawinglayer/primitive2d/textlayoutdevice.hxx> +#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx> +#include <i18npool/mslangid.hxx> +#include <drawinglayer/primitive2d/textlineprimitive2d.hxx> +#include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx> +#include <drawinglayer/primitive2d/epsprimitive2d.hxx> +#include <numeric> ////////////////////////////////////////////////////////////////////////////// @@ -46,14 +79,2980 @@ using namespace com::sun::star; ////////////////////////////////////////////////////////////////////////////// +namespace +{ + /** helper class for graphic context + + This class allows to hold a complete status of classic + VCL OutputDevice stati. This data is needed for correct + interpretation of the MetaFile action flow. + */ + class PropertyHolder + { + private: + /// current transformation (aka MapMode) + basegfx::B2DHomMatrix maTransformation; + MapUnit maMapUnit; + + /// current colors + basegfx::BColor maLineColor; + basegfx::BColor maFillColor; + basegfx::BColor maTextColor; + basegfx::BColor maTextFillColor; + basegfx::BColor maTextLineColor; + basegfx::BColor maOverlineColor; + + /// clipping, font, etc. + Region maRegion; + Font maFont; + RasterOp maRasterOp; + sal_uInt32 mnLayoutMode; + LanguageType maLanguageType; + sal_uInt16 mnPushFlags; + + /// bitfield + /// contains all active markers + bool mbLineColor : 1; + bool mbFillColor : 1; + bool mbTextColor : 1; + bool mbTextFillColor : 1; + bool mbTextLineColor : 1; + bool mbOverlineColor : 1; + bool mbRegion : 1; + + public: + PropertyHolder() + : maTransformation(), + maMapUnit(MAP_100TH_MM), + maLineColor(), + maFillColor(), + maTextColor(COL_BLACK), + maTextFillColor(), + maTextLineColor(), + maOverlineColor(), + maRegion(), + maFont(), + maRasterOp(ROP_OVERPAINT), + mnLayoutMode(0), + maLanguageType(0), + mnPushFlags(0), + mbLineColor(false), + mbFillColor(false), + mbTextColor(true), + mbTextFillColor(false), + mbTextLineColor(false), + mbOverlineColor(false), + mbRegion(false) + { + } + + ~PropertyHolder() + { + } + + /// read/write accesses + const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } + void setTransformation(const basegfx::B2DHomMatrix& rNew) { if(rNew != maTransformation) maTransformation = rNew; } + + MapUnit getMapUnit() const { return maMapUnit; } + void setMapUnit(MapUnit eNew) { if(eNew != maMapUnit) maMapUnit = eNew; } + + const basegfx::BColor& getLineColor() const { return maLineColor; } + void setLineColor(const basegfx::BColor& rNew) { if(rNew != maLineColor) maLineColor = rNew; } + bool getLineColorActive() const { return mbLineColor; } + void setLineColorActive(bool bNew) { if(bNew != mbLineColor) mbLineColor = bNew; } + + const basegfx::BColor& getFillColor() const { return maFillColor; } + void setFillColor(const basegfx::BColor& rNew) { if(rNew != maFillColor) maFillColor = rNew; } + bool getFillColorActive() const { return mbFillColor; } + void setFillColorActive(bool bNew) { if(bNew != mbFillColor) mbFillColor = bNew; } + + const basegfx::BColor& getTextColor() const { return maTextColor; } + void setTextColor(const basegfx::BColor& rNew) { if(rNew != maTextColor) maTextColor = rNew; } + bool getTextColorActive() const { return mbTextColor; } + void setTextColorActive(bool bNew) { if(bNew != mbTextColor) mbTextColor = bNew; } + + const basegfx::BColor& getTextFillColor() const { return maTextFillColor; } + void setTextFillColor(const basegfx::BColor& rNew) { if(rNew != maTextFillColor) maTextFillColor = rNew; } + bool getTextFillColorActive() const { return mbTextFillColor; } + void setTextFillColorActive(bool bNew) { if(bNew != mbTextFillColor) mbTextFillColor = bNew; } + + const basegfx::BColor& getTextLineColor() const { return maTextLineColor; } + void setTextLineColor(const basegfx::BColor& rNew) { if(rNew != maTextLineColor) maTextLineColor = rNew; } + bool getTextLineColorActive() const { return mbTextLineColor; } + void setTextLineColorActive(bool bNew) { if(bNew != mbTextLineColor) mbTextLineColor = bNew; } + + const basegfx::BColor& getOverlineColor() const { return maOverlineColor; } + void setOverlineColor(const basegfx::BColor& rNew) { if(rNew != maOverlineColor) maOverlineColor = rNew; } + bool getOverlineColorActive() const { return mbOverlineColor; } + void setOverlineColorActive(bool bNew) { if(bNew != mbOverlineColor) mbOverlineColor = bNew; } + + const Region& getRegion() const { return maRegion; } + void setRegion(const Region& rRegion) { if(rRegion != maRegion) maRegion = rRegion; } + bool getRegionActive() const { return mbRegion; } + void setRegionActive(bool bNew) { if(bNew != mbRegion) mbRegion = bNew; } + + const Font& getFont() const { return maFont; } + void setFont(const Font& rFont) { if(rFont != maFont) maFont = rFont; } + + const RasterOp& getRasterOp() const { return maRasterOp; } + void setRasterOp(const RasterOp& rRasterOp) { if(rRasterOp != maRasterOp) maRasterOp = rRasterOp; } + bool isRasterOpInvert() const { return (ROP_XOR == maRasterOp || ROP_INVERT == maRasterOp); } + bool isRasterOpForceBlack() const { return ROP_0 == maRasterOp; } + bool isRasterOpActive() const { return isRasterOpInvert() || isRasterOpForceBlack(); } + + sal_uInt32 getLayoutMode() const { return mnLayoutMode; } + void setLayoutMode(sal_uInt32 nNew) { if(nNew != mnLayoutMode) mnLayoutMode = nNew; } + + LanguageType getLanguageType() const { return maLanguageType; } + void setLanguageType(LanguageType aNew) { if(aNew != maLanguageType) maLanguageType = aNew; } + + sal_uInt16 getPushFlags() const { return mnPushFlags; } + void setPushFlags(sal_uInt16 nNew) { if(nNew != mnPushFlags) mnPushFlags = nNew; } + + bool getLineOrFillActive() const { return (mbLineColor || mbFillColor); } + }; +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// + +namespace +{ + /** stack for properites + + This class builds a stack based on the PropertyHolder + class. It encapsulates the pointer/new/delete usage to + make it safe and implements the push/pop as needed by a + VCL Metafile interpreter. The critical part here are the + flag values VCL OutputDevice uses here; not all stuff is + pushed and thus needs to be copied at pop. + */ + class PropertyHolders + { + private: + std::vector< PropertyHolder* > maPropertyHolders; + + public: + PropertyHolders() + { + maPropertyHolders.push_back(new PropertyHolder()); + } + + sal_uInt32 size() + { + return maPropertyHolders.size(); + } + + void Push(sal_uInt16 nPushFlags) + { + if(nPushFlags) + { + OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: PUSH with no property holders (!)"); + PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back()); + pNew->setPushFlags(nPushFlags); + maPropertyHolders.push_back(pNew); + } + } + + void Pop() + { + OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: POP with no property holders (!)"); + const sal_uInt32 nSize(maPropertyHolders.size()); + + if(nSize) + { + const PropertyHolder* pTip = maPropertyHolders.back(); + const sal_uInt16 nPushFlags(pTip->getPushFlags()); + + if(nPushFlags) + { + if(nSize > 1) + { + // copy back content for all non-set flags + PropertyHolder* pLast = maPropertyHolders[nSize - 2]; + + if(PUSH_ALL != nPushFlags) + { + if(!(nPushFlags & PUSH_LINECOLOR )) + { + pLast->setLineColor(pTip->getLineColor()); + pLast->setLineColorActive(pTip->getLineColorActive()); + } + if(!(nPushFlags & PUSH_FILLCOLOR )) + { + pLast->setFillColor(pTip->getFillColor()); + pLast->setFillColorActive(pTip->getFillColorActive()); + } + if(!(nPushFlags & PUSH_FONT )) + { + pLast->setFont(pTip->getFont()); + } + if(!(nPushFlags & PUSH_TEXTCOLOR )) + { + pLast->setTextColor(pTip->getTextColor()); + pLast->setTextColorActive(pTip->getTextColorActive()); + } + if(!(nPushFlags & PUSH_MAPMODE )) + { + pLast->setTransformation(pTip->getTransformation()); + pLast->setMapUnit(pTip->getMapUnit()); + } + if(!(nPushFlags & PUSH_CLIPREGION )) + { + pLast->setRegion(pTip->getRegion()); + pLast->setRegionActive(pTip->getRegionActive()); + } + if(!(nPushFlags & PUSH_RASTEROP )) + { + pLast->setRasterOp(pTip->getRasterOp()); + } + if(!(nPushFlags & PUSH_TEXTFILLCOLOR )) + { + pLast->setTextFillColor(pTip->getTextFillColor()); + pLast->setTextFillColorActive(pTip->getTextFillColorActive()); + } + if(!(nPushFlags & PUSH_TEXTALIGN )) + { + if(pLast->getFont().GetAlign() != pTip->getFont().GetAlign()) + { + Font aFont(pLast->getFont()); + aFont.SetAlign(pTip->getFont().GetAlign()); + pLast->setFont(aFont); + } + } + if(!(nPushFlags & PUSH_REFPOINT )) + { + // not supported + } + if(!(nPushFlags & PUSH_TEXTLINECOLOR )) + { + pLast->setTextLineColor(pTip->getTextLineColor()); + pLast->setTextLineColorActive(pTip->getTextLineColorActive()); + } + if(!(nPushFlags & PUSH_TEXTLAYOUTMODE )) + { + pLast->setLayoutMode(pTip->getLayoutMode()); + } + if(!(nPushFlags & PUSH_TEXTLANGUAGE )) + { + pLast->setLanguageType(pTip->getLanguageType()); + } + if(!(nPushFlags & PUSH_OVERLINECOLOR )) + { + pLast->setOverlineColor(pTip->getOverlineColor()); + pLast->setOverlineColorActive(pTip->getOverlineColorActive()); + } + } + } + + // execute the pop + delete maPropertyHolders.back(); + maPropertyHolders.pop_back(); + } + } + } + + PropertyHolder& Current() + { + OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: CURRENT with no property holders (!)"); + return *maPropertyHolders.back(); + } + + ~PropertyHolders() + { + while(maPropertyHolders.size()) + { + delete maPropertyHolders.back(); + maPropertyHolders.pop_back(); + } + } + }; +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// + +namespace +{ + /** helper to convert a Region to a B2DPolyPolygon + when it does not yet contain one. In the future + this may be expanded to merge the polygons created + from rectangles or use a special algo to directly turn + the spans of regions to a single, already merged + PolyPolygon. + */ + basegfx::B2DPolyPolygon getB2DPolyPolygonFromRegion(const Region& rRegion) + { + basegfx::B2DPolyPolygon aRetval; + + if(!rRegion.IsEmpty()) + { + Region aRegion(rRegion); + aRetval = aRegion.GetB2DPolyPolygon(); + + if(!aRetval.count()) + { + RegionHandle aRegionHandle(aRegion.BeginEnumRects()); + Rectangle aRegionRectangle; + + while(aRegion.GetEnumRects(aRegionHandle, aRegionRectangle)) + { + if(!aRegionRectangle.IsEmpty()) + { + const basegfx::B2DRange aRegionRange( + aRegionRectangle.Left(), aRegionRectangle.Top(), + aRegionRectangle.Right(), aRegionRectangle.Bottom()); + aRetval.append(basegfx::tools::createPolygonFromRect(aRegionRange)); + } + } + + aRegion.EndEnumRects(aRegionHandle); + } + } + + return aRetval; + } +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// + +namespace +{ + /** Helper class to buffer and hold a Primive target vector. It + encapsulates the new/delete functionality and aloows to work + on pointers of the implementation classes. All data will + be converted to uno sequences of uno references when accessing the + data. + */ + class TargetHolder + { + private: + std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aTargets; + + public: + TargetHolder() + : aTargets() + { + } + + ~TargetHolder() + { + const sal_uInt32 nCount(aTargets.size()); + + for(sal_uInt32 a(0); a < nCount; a++) + { + delete aTargets[a]; + } + } + + sal_uInt32 size() + { + return aTargets.size(); + } + + void append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate) + { + if(pCandidate) + { + aTargets.push_back(pCandidate); + } + } + + drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence(const PropertyHolder& rPropertyHolder) + { + const sal_uInt32 nCount(aTargets.size()); + drawinglayer::primitive2d::Primitive2DSequence xRetval(nCount); + + for(sal_uInt32 a(0); a < nCount; a++) + { + xRetval[a] = aTargets[a]; + } + + // All Targets were pointers, but do not need to be deleted since they + // were converted to UNO API references now, so they stay as long as + // referenced. Do NOT delete the C++ implementation classes here, but clear + // the buffer to not delete them in the destructor. + aTargets.clear(); + + if(xRetval.hasElements() && rPropertyHolder.getRegionActive()) + { + const Region& rRegion = rPropertyHolder.getRegion(); + + if(!rRegion.IsEmpty()) + { + basegfx::B2DPolyPolygon aClipPolyPolygon(getB2DPolyPolygonFromRegion(rRegion)); + + if(aClipPolyPolygon.count()) + { + aClipPolyPolygon.transform(rPropertyHolder.getTransformation()); + + const drawinglayer::primitive2d::Primitive2DReference xMask( + new drawinglayer::primitive2d::MaskPrimitive2D( + aClipPolyPolygon, + xRetval)); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xMask, 1); + } + } + } + + return xRetval; + } + }; +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// + +namespace +{ + /** Helper class which builds a stack on the TargetHolder class */ + class TargetHolders + { + private: + std::vector< TargetHolder* > maTargetHolders; + + public: + TargetHolders() + { + maTargetHolders.push_back(new TargetHolder()); + } + + sal_uInt32 size() + { + return maTargetHolders.size(); + } + + void Push() + { + maTargetHolders.push_back(new TargetHolder()); + } + + void Pop() + { + OSL_ENSURE(maTargetHolders.size(), "TargetHolders: POP with no property holders (!)"); + if(maTargetHolders.size()) + { + delete maTargetHolders.back(); + maTargetHolders.pop_back(); + } + } + + TargetHolder& Current() + { + OSL_ENSURE(maTargetHolders.size(), "TargetHolders: CURRENT with no property holders (!)"); + return *maTargetHolders.back(); + } + + ~TargetHolders() + { + while(maTargetHolders.size()) + { + delete maTargetHolders.back(); + maTargetHolders.pop_back(); + } + } + }; +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** NonOverlappingFillGradientPrimitive2D class + + This is a special version of the FillGradientPrimitive2D which decomposes + to a non-overlapping geometry version of the gradient. This needs to be + used to support the old XOR paint-'trick'. + + It does not need an own identifier since a renderer who wants to interpret + it itself may do so. It just overloads the decomposition of the C++ + implementation class to do an alternative decomposition. + */ + class NonOverlappingFillGradientPrimitive2D : public FillGradientPrimitive2D + { + protected: + /// local decomposition. + virtual Primitive2DSequence create2DDecomposition( + const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + NonOverlappingFillGradientPrimitive2D( + const basegfx::B2DRange& rObjectRange, + const attribute::FillGradientAttribute& rFillGradient) + : FillGradientPrimitive2D(rObjectRange, rFillGradient) + { + } + }; + + Primitive2DSequence NonOverlappingFillGradientPrimitive2D::create2DDecomposition( + const geometry::ViewInformation2D& /*rViewInformation*/) const + { + return createFill(false); + } + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace +{ + /** helper to convert a MapMode to a transformation */ + basegfx::B2DHomMatrix getTransformFromMapMode(const MapMode& rMapMode) + { + basegfx::B2DHomMatrix aMapping; + const Fraction aNoScale(1, 1); + const Point& rOrigin(rMapMode.GetOrigin()); + + if(0 != rOrigin.X() || 0 != rOrigin.Y()) + { + aMapping.translate(rOrigin.X(), rOrigin.Y()); + } + + if(rMapMode.GetScaleX() != aNoScale || rMapMode.GetScaleY() != aNoScale) + { + aMapping.scale( + double(rMapMode.GetScaleX()), + double(rMapMode.GetScaleY())); + } + + return aMapping; + } + + /** helper to create a PointArrayPrimitive2D based on current context */ + void createPointArrayPrimitive( + const std::vector< basegfx::B2DPoint >& rPositions, + TargetHolder& rTarget, + PropertyHolder& rProperties, + basegfx::BColor aBColor) + { + if(rPositions.size()) + { + if(rProperties.getTransformation().isIdentity()) + { + rTarget.append( + new drawinglayer::primitive2d::PointArrayPrimitive2D( + rPositions, + aBColor)); + } + else + { + std::vector< basegfx::B2DPoint > aPositions(rPositions); + + for(sal_uInt32 a(0); a < aPositions.size(); a++) + { + aPositions[a] = rProperties.getTransformation() * aPositions[a]; + } + + rTarget.append( + new drawinglayer::primitive2d::PointArrayPrimitive2D( + aPositions, + aBColor)); + } + } + } + + /** helper to create a PolygonHairlinePrimitive2D based on current context */ + void createHairlinePrimitive( + const basegfx::B2DPolygon& rLinePolygon, + TargetHolder& rTarget, + PropertyHolder& rProperties) + { + if(rLinePolygon.count()) + { + basegfx::B2DPolygon aLinePolygon(rLinePolygon); + aLinePolygon.transform(rProperties.getTransformation()); + rTarget.append( + new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( + aLinePolygon, + rProperties.getLineColor())); + } + } + + /** helper to create a PolyPolygonColorPrimitive2D based on current context */ + void createFillPrimitive( + const basegfx::B2DPolyPolygon& rFillPolyPolygon, + TargetHolder& rTarget, + PropertyHolder& rProperties) + { + if(rFillPolyPolygon.count()) + { + basegfx::B2DPolyPolygon aFillPolyPolygon(rFillPolyPolygon); + aFillPolyPolygon.transform(rProperties.getTransformation()); + rTarget.append( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + aFillPolyPolygon, + rProperties.getFillColor())); + } + } + + /** helper to create a PolygonStrokePrimitive2D based on current context */ + void createLinePrimitive( + const basegfx::B2DPolygon& rLinePolygon, + const LineInfo& rLineInfo, + TargetHolder& rTarget, + PropertyHolder& rProperties) + { + if(rLinePolygon.count()) + { + const bool bDashDotUsed(LINE_DASH == rLineInfo.GetStyle()); + const bool bWidthUsed(rLineInfo.GetWidth() > 1); + + if(bDashDotUsed || bWidthUsed) + { + basegfx::B2DPolygon aLinePolygon(rLinePolygon); + aLinePolygon.transform(rProperties.getTransformation()); + const drawinglayer::attribute::LineAttribute aLineAttribute( + rProperties.getLineColor(), + bWidthUsed ? rLineInfo.GetWidth() : 0.0, + rLineInfo.GetLineJoin()); + + if(bDashDotUsed) + { + ::std::vector< double > fDotDashArray; + const double fDashLen(rLineInfo.GetDashLen()); + const double fDotLen(rLineInfo.GetDotLen()); + const double fDistance(rLineInfo.GetDistance()); + + for(sal_uInt16 a(0); a < rLineInfo.GetDashCount(); a++) + { + fDotDashArray.push_back(fDashLen); + fDotDashArray.push_back(fDistance); + } + + for(sal_uInt16 b(0); b < rLineInfo.GetDotCount(); b++) + { + fDotDashArray.push_back(fDotLen); + fDotDashArray.push_back(fDistance); + } + + const double fAccumulated(::std::accumulate(fDotDashArray.begin(), fDotDashArray.end(), 0.0)); + const drawinglayer::attribute::StrokeAttribute aStrokeAttribute( + fDotDashArray, + fAccumulated); + + rTarget.append( + new drawinglayer::primitive2d::PolygonStrokePrimitive2D( + aLinePolygon, + aLineAttribute, + aStrokeAttribute)); + } + else + { + rTarget.append( + new drawinglayer::primitive2d::PolygonStrokePrimitive2D( + aLinePolygon, + aLineAttribute)); + } + } + else + { + createHairlinePrimitive(rLinePolygon, rTarget, rProperties); + } + } + } + + /** helper to create needed line and fill primitives based on current context */ + void createHairlineAndFillPrimitive( + const basegfx::B2DPolygon& rPolygon, + TargetHolder& rTarget, + PropertyHolder& rProperties) + { + if(rProperties.getFillColorActive()) + { + createFillPrimitive(basegfx::B2DPolyPolygon(rPolygon), rTarget, rProperties); + } + + if(rProperties.getLineColorActive()) + { + createHairlinePrimitive(rPolygon, rTarget, rProperties); + } + } + + /** helper to create needed line and fill primitives based on current context */ + void createHairlineAndFillPrimitive( + const basegfx::B2DPolyPolygon& rPolyPolygon, + TargetHolder& rTarget, + PropertyHolder& rProperties) + { + if(rProperties.getFillColorActive()) + { + createFillPrimitive(rPolyPolygon, rTarget, rProperties); + } + + if(rProperties.getLineColorActive()) + { + for(sal_uInt32 a(0); a < rPolyPolygon.count(); a++) + { + createHairlinePrimitive(rPolyPolygon.getB2DPolygon(a), rTarget, rProperties); + } + } + } + + /** helper to create DiscreteBitmapPrimitive2D based on current context. + The DiscreteBitmapPrimitive2D is especially created for this usage + since no other usage defines a bitmap visualisation based on top-left + position and size in pixels. At the end it will create a view-dependent + transformed embedding of a BitmapPrimitive2D. + */ + void createBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const Point& rPoint, + TargetHolder& rTarget, + PropertyHolder& rProperties) + { + if(!rBitmapEx.IsEmpty()) + { + basegfx::B2DPoint aPoint(rPoint.X(), rPoint.Y()); + aPoint = rProperties.getTransformation() * aPoint; + + rTarget.append( + new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D( + rBitmapEx, + aPoint)); + } + } + + /** helper to create BitmapPrimitive2D based on current context */ + void createBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const Point& rPoint, + const Size& rSize, + TargetHolder& rTarget, + PropertyHolder& rProperties) + { + if(!rBitmapEx.IsEmpty()) + { + basegfx::B2DHomMatrix aObjectTransform; + + aObjectTransform.set(0, 0, rSize.Width()); + aObjectTransform.set(1, 1, rSize.Height()); + aObjectTransform.set(0, 2, rPoint.X()); + aObjectTransform.set(1, 2, rPoint.Y()); + + aObjectTransform = rProperties.getTransformation() * aObjectTransform; + + rTarget.append( + new drawinglayer::primitive2d::BitmapPrimitive2D( + rBitmapEx, + aObjectTransform)); + } + } + + /** helper to create a regular BotmapEx from a MaskAction (definitions + which use a bitmap without alpha but define one of the colors as + transparent) + */ + BitmapEx createMaskBmpEx(const Bitmap& rBitmap, const Color& rMaskColor) + { + const Color aWhite(COL_WHITE); + BitmapPalette aBiLevelPalette(2); + + aBiLevelPalette[0] = aWhite; + aBiLevelPalette[1] = rMaskColor; + + Bitmap aMask(rBitmap.CreateMask(aWhite)); + Bitmap aSolid(rBitmap.GetSizePixel(), 1, &aBiLevelPalette); + + aSolid.Erase(rMaskColor); + + return BitmapEx(aSolid, aMask); + } + + /** helper to convert from a VCL Gradient definition to the corresponding + data for primitive representation + */ + drawinglayer::attribute::FillGradientAttribute createFillGradientAttribute(const Gradient& rGradient) + { + const Color aStartColor(rGradient.GetStartColor()); + const sal_uInt16 nStartIntens(rGradient.GetStartIntensity()); + basegfx::BColor aStart(aStartColor.getBColor()); + + if(nStartIntens != 100) + { + const basegfx::BColor aBlack; + aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01); + } + + const Color aEndColor(rGradient.GetEndColor()); + const sal_uInt16 nEndIntens(rGradient.GetEndIntensity()); + basegfx::BColor aEnd(aEndColor.getBColor()); + + if(nEndIntens != 100) + { + const basegfx::BColor aBlack; + aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01); + } + + drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GRADIENTSTYLE_RECT); + + switch(rGradient.GetStyle()) + { + case GRADIENT_LINEAR : + { + aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_LINEAR; + break; + } + case GRADIENT_AXIAL : + { + aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_AXIAL; + break; + } + case GRADIENT_RADIAL : + { + aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RADIAL; + break; + } + case GRADIENT_ELLIPTICAL : + { + aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_ELLIPTICAL; + break; + } + case GRADIENT_SQUARE : + { + aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_SQUARE; + break; + } + default : // GRADIENT_RECT + { + aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RECT; + break; + } + } + + return drawinglayer::attribute::FillGradientAttribute( + aGradientStyle, + (double)rGradient.GetBorder() * 0.01, + (double)rGradient.GetOfsX() * 0.01, + (double)rGradient.GetOfsY() * 0.01, + (double)rGradient.GetAngle() * F_PI1800, + aStart, + aEnd, + rGradient.GetSteps()); + } + + /** helper to convert from a VCL Hatch definition to the corresponding + data for primitive representation + */ + drawinglayer::attribute::FillHatchAttribute createFillHatchAttribute(const Hatch& rHatch) + { + drawinglayer::attribute::HatchStyle aHatchStyle(drawinglayer::attribute::HATCHSTYLE_SINGLE); + + switch(rHatch.GetStyle()) + { + default : // case HATCH_SINGLE : + { + aHatchStyle = drawinglayer::attribute::HATCHSTYLE_SINGLE; + } + case HATCH_DOUBLE : + { + aHatchStyle = drawinglayer::attribute::HATCHSTYLE_DOUBLE; + } + case HATCH_TRIPLE : + { + aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE; + } + } + + return drawinglayer::attribute::FillHatchAttribute( + aHatchStyle, + (double)rHatch.GetDistance(), + (double)rHatch.GetAngle() * F_PI1800, + rHatch.GetColor().getBColor(), + false); + } + + /** helper to take needed action on ClipRegion change. This method needs to be called + on any Region change, e.g. at the obvious actions doing this, but also at pop-calls + whcih change the Region of the current context. It takes care of creating the + current embeddec context, set the new Region at the context and eventually prepare + a new target for embracing new geometry to the current region + */ + void HandleNewClipRegion( + const Region* pRegion, + TargetHolders& rTargetHolders, + PropertyHolders& rPropertyHolders) + { + // process evtl. created primitives which belong to the current region settings + if(rPropertyHolders.Current().getRegionActive() && rTargetHolders.size() > 1) + { + drawinglayer::primitive2d::Primitive2DSequence aSubContent; + + if(!rPropertyHolders.Current().getRegion().IsEmpty() && rTargetHolders.Current().size()) + { + aSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current()); + } + + rTargetHolders.Pop(); + + if(aSubContent.hasElements()) + { + rTargetHolders.Current().append( + new drawinglayer::primitive2d::GroupPrimitive2D( + aSubContent)); + } + } + + // apply new settings + const bool bNewActive(pRegion && !pRegion->IsEmpty()); + rPropertyHolders.Current().setRegionActive(bNewActive); + + if(bNewActive) + { + rPropertyHolders.Current().setRegion(*pRegion); + + // prepare new content holder for new active region + rTargetHolders.Push(); + } + } + + /** helper to handle the change of RasterOp. It takes care of encapsulating all current + geometry to the current RasterOp (if changed) and needs to be called on any RasterOp + change. It will also start a new geometry target to embrace to the new RasterOp if + a changuing RasterOp is used. Currently, ROP_XOR and ROP_INVERT are supported using + InvertPrimitive2D, and ROP_0 by using a ModifiedColorPrimitive2D to force to black paint + */ + void HandleNewRasterOp( + RasterOp aRasterOp, + TargetHolders& rTargetHolders, + PropertyHolders& rPropertyHolders) + { + // check if currently active + if(rPropertyHolders.Current().isRasterOpActive() && rTargetHolders.size() > 1) + { + drawinglayer::primitive2d::Primitive2DSequence aSubContent; + + if(rTargetHolders.Current().size()) + { + aSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current()); + } + + rTargetHolders.Pop(); + + if(aSubContent.hasElements()) + { + if(rPropertyHolders.Current().isRasterOpForceBlack()) + { + // force content to black + rTargetHolders.Current().append( + new drawinglayer::primitive2d::ModifiedColorPrimitive2D( + aSubContent, + basegfx::BColorModifier(basegfx::BColor(0.0, 0.0, 0.0)))); + } + else // if(rPropertyHolders.Current().isRasterOpInvert()) + { + // invert content + rTargetHolders.Current().append( + new drawinglayer::primitive2d::InvertPrimitive2D( + aSubContent)); + } + } + } + + // apply new settings + rPropertyHolders.Current().setRasterOp(aRasterOp); + + // check if now active + if(rPropertyHolders.Current().isRasterOpActive()) + { + // prepare new content holder for new invert + rTargetHolders.Push(); + } + } + + /** helper to create needed data to emulate the VCL Wallpaper Metafile action. + It is a quite mighty action. This helper is for simple color filled background. + */ + drawinglayer::primitive2d::BasePrimitive2D* CreateColorWallpaper( + const basegfx::B2DRange& rRange, + const basegfx::BColor& rColor, + PropertyHolder& rPropertyHolder) + { + basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(rRange)); + aOutline.transform(rPropertyHolder.getTransformation()); + + return new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aOutline), + rColor); + } + + /** helper to create needed data to emulate the VCL Wallpaper Metafile action. + It is a quite mighty action. This helper is for gradient filled background. + */ + drawinglayer::primitive2d::BasePrimitive2D* CreateGradientWallpaper( + const basegfx::B2DRange& rRange, + const Gradient& rGradient, + PropertyHolder& rPropertyHolder) + { + const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient)); + + if(aAttribute.getStartColor() == aAttribute.getEndColor()) + { + // not really a gradient. Create filled rectangle + return CreateColorWallpaper(rRange, aAttribute.getStartColor(), rPropertyHolder); + } + else + { + // really a gradient + drawinglayer::primitive2d::BasePrimitive2D* pRetval = + new drawinglayer::primitive2d::FillGradientPrimitive2D( + rRange, + aAttribute); + + if(!rPropertyHolder.getTransformation().isIdentity()) + { + const drawinglayer::primitive2d::Primitive2DReference xPrim(pRetval); + const drawinglayer::primitive2d::Primitive2DSequence xSeq(&xPrim, 1); + + pRetval = new drawinglayer::primitive2d::TransformPrimitive2D( + rPropertyHolder.getTransformation(), + xSeq); + } + + return pRetval; + } + } + + /** helper to create needed data to emulate the VCL Wallpaper Metafile action. + It is a quite mighty action. This helper decides if color and/or gradient + background is needed for the wnated bitmap fill and then creates the needed + WallpaperBitmapPrimitive2D. This primitive was created for this purpose and + takes over all needed logic of orientations and tiling. + */ + void CreateAndAppendBitmapWallpaper( + basegfx::B2DRange aWallpaperRange, + const Wallpaper& rWallpaper, + TargetHolder& rTarget, + PropertyHolder& rProperty) + { + const BitmapEx aBitmapEx(rWallpaper.GetBitmap()); + const WallpaperStyle eWallpaperStyle(rWallpaper.GetStyle()); + + // if bitmap visualisation is transparent, maybe background + // needs to be filled. Create background + if(aBitmapEx.IsTransparent() + || (WALLPAPER_TILE != eWallpaperStyle && WALLPAPER_SCALE != eWallpaperStyle)) + { + if(rWallpaper.IsGradient()) + { + rTarget.append( + CreateGradientWallpaper( + aWallpaperRange, + rWallpaper.GetGradient(), + rProperty)); + } + else if(!rWallpaper.GetColor().GetTransparency()) + { + rTarget.append( + CreateColorWallpaper( + aWallpaperRange, + rWallpaper.GetColor().getBColor(), + rProperty)); + } + } + + // use wallpaper rect if set + if(rWallpaper.IsRect() && !rWallpaper.GetRect().IsEmpty()) + { + aWallpaperRange = basegfx::B2DRange( + rWallpaper.GetRect().Left(), rWallpaper.GetRect().Top(), + rWallpaper.GetRect().Right(), rWallpaper.GetRect().Bottom()); + } + + drawinglayer::primitive2d::BasePrimitive2D* pBitmapWallpaperFill = + new drawinglayer::primitive2d::WallpaperBitmapPrimitive2D( + aWallpaperRange, + aBitmapEx, + eWallpaperStyle); + + if(rProperty.getTransformation().isIdentity()) + { + // add directly + rTarget.append(pBitmapWallpaperFill); + } + else + { + // when a transformation is set, embed to it + const drawinglayer::primitive2d::Primitive2DReference xPrim(pBitmapWallpaperFill); + + rTarget.append( + new drawinglayer::primitive2d::TransformPrimitive2D( + rProperty.getTransformation(), + drawinglayer::primitive2d::Primitive2DSequence(&xPrim, 1))); + } + } + + /** helper to decide UnderlineAbove for text primitives */ + bool isUnderlineAbove(const Font& rFont) + { + if(!rFont.IsVertical()) + { + return false; + } + + if((LANGUAGE_JAPANESE == rFont.GetLanguage()) || (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage())) + { + // the underline is right for Japanese only + return true; + } + + return false; + } + + void createFontAttributeTransformAndAlignment( + drawinglayer::attribute::FontAttribute& rFontAttribute, + basegfx::B2DHomMatrix& rTextTransform, + basegfx::B2DVector& rAlignmentOffset, + PropertyHolder& rProperty) + { + const Font& rFont = rProperty.getFont(); + basegfx::B2DVector aFontScaling; + + rFontAttribute = drawinglayer::attribute::FontAttribute( + drawinglayer::primitive2d::getFontAttributeFromVclFont( + aFontScaling, + rFont, + 0 != (rProperty.getLayoutMode() & TEXT_LAYOUT_BIDI_RTL), + 0 != (rProperty.getLayoutMode() & TEXT_LAYOUT_BIDI_STRONG))); + + // add FontScaling + rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY()); + + // take text align into account + if(ALIGN_BASELINE != rFont.GetAlign()) + { + drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice; + aTextLayouterDevice.setFont(rFont); + + if(ALIGN_TOP == rFont.GetAlign()) + { + rAlignmentOffset.setY(aTextLayouterDevice.getFontAscent()); + } + else // ALIGN_BOTTOM + { + rAlignmentOffset.setY(-aTextLayouterDevice.getFontDescent()); + } + + rTextTransform.translate(rAlignmentOffset.getX(), rAlignmentOffset.getY()); + } + + // add FontRotation (if used) + if(rFont.GetOrientation()) + { + rTextTransform.rotate(-rFont.GetOrientation() * F_PI1800); + } + } + + /** helper which takes complete care for creating the needed text primitives. It + takes care of decorated stuff and all the geometry adaptions needed + */ + void proccessMetaTextAction( + const Point& rTextStartPosition, + const XubString& rText, + sal_uInt16 nTextStart, + sal_uInt16 nTextLength, + sal_Int32* pDXArray, + TargetHolder& rTarget, + PropertyHolder& rProperty) + { + drawinglayer::primitive2d::BasePrimitive2D* pResult = 0; + const Font& rFont = rProperty.getFont(); + std::vector< double > aDXArray; + basegfx::B2DVector aAlignmentOffset(0.0, 0.0); + + if(nTextLength) + { + drawinglayer::attribute::FontAttribute aFontAttribute; + basegfx::B2DHomMatrix aTextTransform; + + // fill parameters derived from current font + createFontAttributeTransformAndAlignment( + aFontAttribute, + aTextTransform, + aAlignmentOffset, + rProperty); + + // add TextStartPosition + aTextTransform.translate(rTextStartPosition.X(), rTextStartPosition.Y()); + + // preapare DXArray (if used) + if(pDXArray && nTextLength) + { + aDXArray.reserve(nTextLength); + + for(xub_StrLen a(0); a < nTextLength; a++) + { + aDXArray.push_back((double)(*(pDXArray + a))); + } + } + + // prepare FontColor and Locale + const basegfx::BColor aFontColor(rProperty.getTextColor()); + const com::sun::star::lang::Locale aLocale(MsLangId::convertLanguageToLocale(rProperty.getLanguageType())); + const bool bWordLineMode(rFont.IsWordLineMode()); + + const bool bDecoratedIsNeeded( + UNDERLINE_NONE != rFont.GetOverline() + || UNDERLINE_NONE != rFont.GetUnderline() + || STRIKEOUT_NONE != rFont.GetStrikeout() + || EMPHASISMARK_NONE != (rFont.GetEmphasisMark() & EMPHASISMARK_STYLE) + || RELIEF_NONE != rFont.GetRelief() + || rFont.IsShadow() + || bWordLineMode); + + if(bDecoratedIsNeeded) + { + // prepare overline, underline and srikeout data + const drawinglayer::primitive2d::TextLine eFontOverline(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rFont.GetOverline())); + const drawinglayer::primitive2d::TextLine eFontUnderline(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rFont.GetUnderline())); + const drawinglayer::primitive2d::TextStrikeout eTextStrikeout(drawinglayer::primitive2d::mapFontStrikeoutToTextStrikeout(rFont.GetStrikeout())); + + // check UndelineAbove + const bool bUnderlineAbove(drawinglayer::primitive2d::TEXT_LINE_NONE != eFontUnderline && isUnderlineAbove(rFont)); + + // prepare emphasis mark data + drawinglayer::primitive2d::TextEmphasisMark eTextEmphasisMark(drawinglayer::primitive2d::TEXT_EMPHASISMARK_NONE); + + switch(rFont.GetEmphasisMark() & EMPHASISMARK_STYLE) + { + case EMPHASISMARK_DOT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DOT; break; + case EMPHASISMARK_CIRCLE : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_CIRCLE; break; + case EMPHASISMARK_DISC : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DISC; break; + case EMPHASISMARK_ACCENT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_ACCENT; break; + } + + const bool bEmphasisMarkAbove(rFont.GetEmphasisMark() & EMPHASISMARK_POS_ABOVE); + const bool bEmphasisMarkBelow(rFont.GetEmphasisMark() & EMPHASISMARK_POS_BELOW); + + // prepare font relief data + drawinglayer::primitive2d::TextRelief eTextRelief(drawinglayer::primitive2d::TEXT_RELIEF_NONE); + + switch(rFont.GetRelief()) + { + case RELIEF_EMBOSSED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_EMBOSSED; break; + case RELIEF_ENGRAVED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_ENGRAVED; break; + default : break; // RELIEF_NONE, FontRelief_FORCE_EQUAL_SIZE + } + + // prepare shadow/outline data + const bool bShadow(rFont.IsShadow()); + + // TextDecoratedPortionPrimitive2D is needed, create one + pResult = new drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D( + + // attributes for TextSimplePortionPrimitive2D + aTextTransform, + rText, + nTextStart, + nTextLength, + aDXArray, + aFontAttribute, + aLocale, + aFontColor, + + // attributes for TextDecoratedPortionPrimitive2D + rProperty.getOverlineColorActive() ? rProperty.getOverlineColor() : aFontColor, + rProperty.getTextLineColorActive() ? rProperty.getTextLineColor() : aFontColor, + eFontOverline, + eFontUnderline, + bUnderlineAbove, + eTextStrikeout, + bWordLineMode, + eTextEmphasisMark, + bEmphasisMarkAbove, + bEmphasisMarkBelow, + eTextRelief, + bShadow); + } + else + { + // TextSimplePortionPrimitive2D is enough + pResult = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( + aTextTransform, + rText, + nTextStart, + nTextLength, + aDXArray, + aFontAttribute, + aLocale, + aFontColor); + } + } + + if(pResult && rProperty.getTextFillColorActive()) + { + // text background is requested, add and encapsulate both to new primitive + drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice; + aTextLayouterDevice.setFont(rFont); + + // get text width + double fTextWidth(0.0); + + if(aDXArray.empty()) + { + fTextWidth = aTextLayouterDevice.getTextWidth(rText, nTextStart, nTextLength); + } + else + { + fTextWidth = aDXArray.back(); + } + + if(basegfx::fTools::more(fTextWidth, 0.0)) + { + // build text range + const basegfx::B2DRange aTextRange( + 0.0, -aTextLayouterDevice.getFontAscent(), + fTextWidth, aTextLayouterDevice.getFontDescent()); + + // create Transform + basegfx::B2DHomMatrix aTextTransform; + + aTextTransform.translate(aAlignmentOffset.getX(), aAlignmentOffset.getY()); + + if(rFont.GetOrientation()) + { + aTextTransform.rotate(-rFont.GetOrientation() * F_PI1800); + } + + aTextTransform.translate(rTextStartPosition.X(), rTextStartPosition.Y()); + + // prepare Primitive2DSequence, put text in foreground + drawinglayer::primitive2d::Primitive2DSequence aSequence(2); + aSequence[1] = drawinglayer::primitive2d::Primitive2DReference(pResult); + + // prepare filled polygon + basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aTextRange)); + aOutline.transform(aTextTransform); + + aSequence[0] = drawinglayer::primitive2d::Primitive2DReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aOutline), + rProperty.getTextFillColor())); + + // set as group at pResult + pResult = new drawinglayer::primitive2d::GroupPrimitive2D(aSequence); + } + } + + if(pResult) + { + // add created text primitive to target + if(rProperty.getTransformation().isIdentity()) + { + rTarget.append(pResult); + } + else + { + // when a transformation is set, embed to it + const drawinglayer::primitive2d::Primitive2DReference aReference(pResult); + + rTarget.append( + new drawinglayer::primitive2d::TransformPrimitive2D( + rProperty.getTransformation(), + drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1))); + } + } + } + + /** helper which takes complete care for creating the needed textLine primitives */ + void proccessMetaTextLineAction( + const MetaTextLineAction& rAction, + TargetHolder& rTarget, + PropertyHolder& rProperty) + { + const double fLineWidth(fabs((double)rAction.GetWidth())); + + if(fLineWidth > 0.0) + { + const drawinglayer::primitive2d::TextLine aOverlineMode(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rAction.GetOverline())); + const drawinglayer::primitive2d::TextLine aUnderlineMode(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rAction.GetUnderline())); + const drawinglayer::primitive2d::TextStrikeout aTextStrikeout(drawinglayer::primitive2d::mapFontStrikeoutToTextStrikeout(rAction.GetStrikeout())); + + const bool bOverlineUsed(drawinglayer::primitive2d::TEXT_LINE_NONE != aOverlineMode); + const bool bUnderlineUsed(drawinglayer::primitive2d::TEXT_LINE_NONE != aUnderlineMode); + const bool bStrikeoutUsed(drawinglayer::primitive2d::TEXT_STRIKEOUT_NONE != aTextStrikeout); + + if(bUnderlineUsed || bStrikeoutUsed || bOverlineUsed) + { + std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aTargetVector; + basegfx::B2DVector aAlignmentOffset(0.0, 0.0); + drawinglayer::attribute::FontAttribute aFontAttribute; + basegfx::B2DHomMatrix aTextTransform; + + // fill parameters derived from current font + createFontAttributeTransformAndAlignment( + aFontAttribute, + aTextTransform, + aAlignmentOffset, + rProperty); + + // add TextStartPosition + aTextTransform.translate(rAction.GetStartPoint().X(), rAction.GetStartPoint().Y()); + + // prepare TextLayouter (used in most cases) + drawinglayer::primitive2d::TextLayouterDevice aTextLayouter; + aTextLayouter.setFont(rProperty.getFont()); + + if(bOverlineUsed) + { + // create primitive geometry for overline + aTargetVector.push_back( + new drawinglayer::primitive2d::TextLinePrimitive2D( + aTextTransform, + fLineWidth, + aTextLayouter.getOverlineOffset(), + aTextLayouter.getOverlineHeight(), + aOverlineMode, + rProperty.getOverlineColor())); + } + + if(bUnderlineUsed) + { + // create primitive geometry for underline + aTargetVector.push_back( + new drawinglayer::primitive2d::TextLinePrimitive2D( + aTextTransform, + fLineWidth, + aTextLayouter.getUnderlineOffset(), + aTextLayouter.getUnderlineHeight(), + aUnderlineMode, + rProperty.getTextLineColor())); + } + + if(bStrikeoutUsed) + { + // create primitive geometry for strikeout + if(drawinglayer::primitive2d::TEXT_STRIKEOUT_SLASH == aTextStrikeout + || drawinglayer::primitive2d::TEXT_STRIKEOUT_X == aTextStrikeout) + { + // strikeout with character + const sal_Unicode aStrikeoutChar( + drawinglayer::primitive2d::TEXT_STRIKEOUT_SLASH == aTextStrikeout ? '/' : 'X'); + const com::sun::star::lang::Locale aLocale(MsLangId::convertLanguageToLocale( + rProperty.getLanguageType())); + + aTargetVector.push_back( + new drawinglayer::primitive2d::TextCharacterStrikeoutPrimitive2D( + aTextTransform, + fLineWidth, + rProperty.getTextColor(), + aStrikeoutChar, + aFontAttribute, + aLocale)); + } + else + { + // strikeout with geometry + aTargetVector.push_back( + new drawinglayer::primitive2d::TextGeometryStrikeoutPrimitive2D( + aTextTransform, + fLineWidth, + rProperty.getTextColor(), + aTextLayouter.getUnderlineHeight(), + aTextLayouter.getStrikeoutOffset(), + aTextStrikeout)); + } + } + + if(aTargetVector.size()) + { + // add created text primitive to target + if(rProperty.getTransformation().isIdentity()) + { + for(sal_uInt32 a(0); a < aTargetVector.size(); a++) + { + rTarget.append(aTargetVector[a]); + } + } + else + { + // when a transformation is set, embed to it + drawinglayer::primitive2d::Primitive2DSequence xTargets(aTargetVector.size()); + + for(sal_uInt32 a(0); a < aTargetVector.size(); a++) + { + xTargets[a] = drawinglayer::primitive2d::Primitive2DReference(aTargetVector[a]); + } + + rTarget.append( + new drawinglayer::primitive2d::TransformPrimitive2D( + rProperty.getTransformation(), + xTargets)); + } + } + } + } + + } + + /** This is the main interpreter method. It is designed to handle the given Metafile + completely inside the given context and target. It may use and modify the context and + target. This design allows to call itself recursively wich adapted contexts and + targets as e.g. needed for the META_FLOATTRANSPARENT_ACTION where the content is expressed + as a metafile as sub-content. + + This interpreter is as free of VCL functionality as possible. It uses VCL data classes + (else reading the data would not be possible), but e.g. does NOT use a local OutputDevice + as most other MetaFile interpreters/exporters do to hold and work with the current context. + This is necessary to be able to get away from the strong internal VCL-binding. + + It tries to combine e.g. pixel and/or point actions and to stitch together single line primitives + where possible (which is not trivial with the possible line geometry definitions). + + It tries to handle clipping no longer as Regions and spans of Rectangles, but as PolyPolygon + ClipRegions with (where possible) high precision by using the best possible data quality + from the Region. The Region is unavoidable as data container, but nowadays allows the transport + of Polygon-based clip regions. Where this is not used, a Polygon is constructed from the + Region ranges. All primitive clipping uses the MaskPrimitive2D with Polygon-based clipping. + + I have marked the single MetaActions with: + + SIMPLE, DONE: + Simple, e.g nothing to do or value setting in the context + + CHECKED, WORKS WELL: + Thoroughly tested with extra written test code which created a replacement + Metafile just to test this action in various combinations + + NEEDS IMPLEMENTATION: + Not implemented and asserted, but also no usage found, neither in own Metafile + creations, nor in EMF/WMF imports (checked with a whole bunch of critical EMF/WMF + bugdocs) + + For more commens, see the single action implementations. + */ + void interpretMetafile( + const GDIMetaFile& rMetaFile, + TargetHolders& rTargetHolders, + PropertyHolders& rPropertyHolders, + const drawinglayer::geometry::ViewInformation2D& rViewInformation) + { + const sal_uInt32 nCount(rMetaFile.GetActionCount()); + + for(sal_uInt32 nAction(0); nAction < nCount; nAction++) + { + MetaAction* pAction = rMetaFile.GetAction(nAction); + + switch(pAction->GetType()) + { + case META_NULL_ACTION : + { + /** SIMPLE, DONE */ + break; + } + case META_PIXEL_ACTION : + { + /** CHECKED, WORKS WELL */ + std::vector< basegfx::B2DPoint > aPositions; + Color aLastColor(COL_BLACK); + + while(META_PIXEL_ACTION == pAction->GetType() && nAction < nCount) + { + const MetaPixelAction* pA = (const MetaPixelAction*)pAction; + + if(pA->GetColor() != aLastColor) + { + if(aPositions.size()) + { + createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), aLastColor.getBColor()); + aPositions.clear(); + } + + aLastColor = pA->GetColor(); + } + + const Point& rPoint = pA->GetPoint(); + aPositions.push_back(basegfx::B2DPoint(rPoint.X(), rPoint.Y())); + nAction++; if(nAction < nCount) pAction = rMetaFile.GetAction(nAction); + } + + nAction--; + + if(aPositions.size()) + { + createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), aLastColor.getBColor()); + } + + break; + } + case META_POINT_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineColorActive()) + { + std::vector< basegfx::B2DPoint > aPositions; + + while(META_POINT_ACTION == pAction->GetType() && nAction < nCount) + { + const MetaPointAction* pA = (const MetaPointAction*)pAction; + const Point& rPoint = pA->GetPoint(); + aPositions.push_back(basegfx::B2DPoint(rPoint.X(), rPoint.Y())); + nAction++; if(nAction < nCount) pAction = rMetaFile.GetAction(nAction); + } + + nAction--; + + if(aPositions.size()) + { + createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), rPropertyHolders.Current().getLineColor()); + } + } + + break; + } + case META_LINE_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineColorActive()) + { + basegfx::B2DPolygon aLinePolygon; + LineInfo aLineInfo; + + while(META_LINE_ACTION == pAction->GetType() && nAction < nCount) + { + const MetaLineAction* pA = (const MetaLineAction*)pAction; + const Point& rStartPoint = pA->GetStartPoint(); + const Point& rEndPoint = pA->GetEndPoint(); + const basegfx::B2DPoint aStart(rStartPoint.X(), rStartPoint.Y()); + const basegfx::B2DPoint aEnd(rEndPoint.X(), rEndPoint.Y()); + + if(aLinePolygon.count()) + { + if(pA->GetLineInfo() == aLineInfo + && aStart == aLinePolygon.getB2DPoint(aLinePolygon.count() - 1)) + { + aLinePolygon.append(aEnd); + } + else + { + aLineInfo.SetLineJoin(basegfx::B2DLINEJOIN_NONE); // It were lines; force to NONE + createLinePrimitive(aLinePolygon, aLineInfo, rTargetHolders.Current(), rPropertyHolders.Current()); + aLinePolygon.clear(); + aLineInfo = pA->GetLineInfo(); + aLinePolygon.append(aStart); + aLinePolygon.append(aEnd); + } + } + else + { + aLineInfo = pA->GetLineInfo(); + aLinePolygon.append(aStart); + aLinePolygon.append(aEnd); + } + + nAction++; if(nAction < nCount) pAction = rMetaFile.GetAction(nAction); + } + + nAction--; + + if(aLinePolygon.count()) + { + aLineInfo.SetLineJoin(basegfx::B2DLINEJOIN_NONE); // It were lines; force to NONE + createLinePrimitive(aLinePolygon, aLineInfo, rTargetHolders.Current(), rPropertyHolders.Current()); + } + } + + break; + } + case META_RECT_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineOrFillActive()) + { + const MetaRectAction* pA = (const MetaRectAction*)pAction; + const Rectangle& rRectangle = pA->GetRect(); + + if(!rRectangle.IsEmpty()) + { + const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + + if(!aRange.isEmpty()) + { + const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange)); + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + } + } + + break; + } + case META_ROUNDRECT_ACTION : + { + /** CHECKED, WORKS WELL */ + /** The original OutputDevice::DrawRect paints nothing when nHor or nVer is zero; but just + because the tools::Polygon operator creating the rounding does produce nonsense. I assume + this an error and create an unrounded rectangle in that case (implicit in + createPolygonFromRect) + */ + if(rPropertyHolders.Current().getLineOrFillActive()) + { + const MetaRoundRectAction* pA = (const MetaRoundRectAction*)pAction; + const Rectangle& rRectangle = pA->GetRect(); + + if(!rRectangle.IsEmpty()) + { + const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + + if(!aRange.isEmpty()) + { + const sal_uInt32 nHor(pA->GetHorzRound()); + const sal_uInt32 nVer(pA->GetVertRound()); + basegfx::B2DPolygon aOutline; + + if(nHor || nVer) + { + double fRadiusX((nHor * 2.0) / (aRange.getWidth() > 0.0 ? aRange.getWidth() : 1.0)); + double fRadiusY((nVer * 2.0) / (aRange.getHeight() > 0.0 ? aRange.getHeight() : 1.0)); + fRadiusX = std::max(0.0, std::min(1.0, fRadiusX)); + fRadiusY = std::max(0.0, std::min(1.0, fRadiusY)); + + aOutline = basegfx::tools::createPolygonFromRect(aRange, fRadiusX, fRadiusY); + } + else + { + aOutline = basegfx::tools::createPolygonFromRect(aRange); + } + + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + } + } + + break; + } + case META_ELLIPSE_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineOrFillActive()) + { + const MetaEllipseAction* pA = (const MetaEllipseAction*)pAction; + const Rectangle& rRectangle = pA->GetRect(); + + if(!rRectangle.IsEmpty()) + { + const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + + if(!aRange.isEmpty()) + { + const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromEllipse( + aRange.getCenter(), aRange.getWidth() * 0.5, aRange.getHeight() * 0.5)); + + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + } + } + + break; + } + case META_ARC_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineColorActive()) + { + const MetaArcAction* pA = (const MetaArcAction*)pAction; + const Polygon aToolsPoly(pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_ARC); + const basegfx::B2DPolygon aOutline(aToolsPoly.getB2DPolygon()); + + createHairlinePrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_PIE_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineOrFillActive()) + { + const MetaPieAction* pA = (const MetaPieAction*)pAction; + const Polygon aToolsPoly(pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_PIE); + const basegfx::B2DPolygon aOutline(aToolsPoly.getB2DPolygon()); + + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_CHORD_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineOrFillActive()) + { + const MetaChordAction* pA = (const MetaChordAction*)pAction; + const Polygon aToolsPoly(pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_CHORD); + const basegfx::B2DPolygon aOutline(aToolsPoly.getB2DPolygon()); + + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_POLYLINE_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineColorActive()) + { + const MetaPolyLineAction* pA = (const MetaPolyLineAction*)pAction; + createLinePrimitive(pA->GetPolygon().getB2DPolygon(), pA->GetLineInfo(), rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_POLYGON_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineOrFillActive()) + { + const MetaPolygonAction* pA = (const MetaPolygonAction*)pAction; + basegfx::B2DPolygon aOutline(pA->GetPolygon().getB2DPolygon()); + + // the metafile play interprets the polygons from MetaPolygonAction + // always as closed and always paints an edge from last to first point, + // so force to closed here to emulate that + if(aOutline.count() > 1 && !aOutline.isClosed()) + { + aOutline.setClosed(true); + } + + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_POLYPOLYGON_ACTION : + { + /** CHECKED, WORKS WELL */ + if(rPropertyHolders.Current().getLineOrFillActive()) + { + const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*)pAction; + basegfx::B2DPolyPolygon aPolyPolygonOutline(pA->GetPolyPolygon().getB2DPolyPolygon()); + + // the metafile play interprets the single polygons from MetaPolyPolygonAction + // always as closed and always paints an edge from last to first point, + // so force to closed here to emulate that + for(sal_uInt32 b(0); b < aPolyPolygonOutline.count(); b++) + { + basegfx::B2DPolygon aPolygonOutline(aPolyPolygonOutline.getB2DPolygon(b)); + + if(aPolygonOutline.count() > 1 && !aPolygonOutline.isClosed()) + { + aPolygonOutline.setClosed(true); + aPolyPolygonOutline.setB2DPolygon(b, aPolygonOutline); + } + } + + createHairlineAndFillPrimitive(aPolyPolygonOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_TEXT_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaTextAction* pA = (const MetaTextAction*)pAction; + + if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive()) + { + proccessMetaTextAction( + pA->GetPoint(), + pA->GetText(), + pA->GetIndex(), + pA->GetLen(), + 0, + rTargetHolders.Current(), + rPropertyHolders.Current()); + } + + break; + } + case META_TEXTARRAY_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaTextArrayAction* pA = (const MetaTextArrayAction*)pAction; + + if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive()) + { + proccessMetaTextAction( + pA->GetPoint(), + pA->GetText(), + pA->GetIndex(), + pA->GetLen(), + pA->GetDXArray(), + rTargetHolders.Current(), + rPropertyHolders.Current()); + } + + break; + } + case META_STRETCHTEXT_ACTION : + { + /** NEEDS IMPLEMENTATION */ + OSL_ENSURE(false, "META_STRETCHTEXT_ACTION requested (!)"); + // use OutputDevice::GetTextArray() to map the... + // const MetaStretchTextAction* pA = (const MetaStretchTextAction*)pAction; + break; + } + case META_TEXTRECT_ACTION : + { + /** CHECKED, WORKS WELL */ + // OSL_ENSURE(false, "META_TEXTRECT_ACTION requested (!)"); + const MetaTextRectAction* pA = (const MetaTextRectAction*)pAction; + const Rectangle& rRectangle = pA->GetRect(); + + if(!rRectangle.IsEmpty() && 0 != pA->GetText().Len()) + { + // The problem with this action is that it describes unlayouted text + // and the layout capabilities are in EditEngine/Outliner in SVX. The + // same problem is true for VCL which internally has implementations + // to layout text in this case. There exists even a call + // OutputDevice::AddTextRectActions(...) to create the needed actions + // as 'sub-content' of a Metafile. Unfortunately i do not have an + // OutputDevice here since this interpreter tries to work without + // VCL AFAP. + // Since AddTextRectActions is the only way as long as we do not have + // a simple text layouter available, i will try to add it to the + // TextLayouterDevice isloation. + drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice; + aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont()); + GDIMetaFile aGDIMetaFile; + + aTextLayouterDevice.addTextRectActions( + rRectangle, pA->GetText(), pA->GetStyle(), aGDIMetaFile); + + if(aGDIMetaFile.GetActionCount()) + { + // cerate sub-content + drawinglayer::primitive2d::Primitive2DSequence xSubContent; + { + rTargetHolders.Push(); + interpretMetafile(aGDIMetaFile, rTargetHolders, rPropertyHolders, rViewInformation); + xSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current()); + rTargetHolders.Pop(); + } + + if(xSubContent.hasElements()) + { + // add with transformation + rTargetHolders.Current().append( + new drawinglayer::primitive2d::TransformPrimitive2D( + rPropertyHolders.Current().getTransformation(), + xSubContent)); + } + } + } + + break; + } + case META_BMP_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaBmpAction* pA = (const MetaBmpAction*)pAction; + const BitmapEx aBitmapEx(pA->GetBitmap()); + + createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); + + break; + } + case META_BMPSCALE_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*)pAction; + const Bitmap aBitmapEx(pA->GetBitmap()); + + createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + + break; + } + case META_BMPSCALEPART_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*)pAction; + const Bitmap& rBitmap = pA->GetBitmap(); + + if(!rBitmap.IsEmpty()) + { + Bitmap aCroppedBitmap(rBitmap); + const Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize()); + + if(!aCropRectangle.IsEmpty()) + { + aCroppedBitmap.Crop(aCropRectangle); + } + + const BitmapEx aCroppedBitmapEx(aCroppedBitmap); + createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_BMPEX_ACTION : + { + /** CHECKED, WORKS WELL: Simply same as META_BMP_ACTION */ + const MetaBmpExAction* pA = (const MetaBmpExAction*)pAction; + const BitmapEx& rBitmapEx = pA->GetBitmapEx(); + + createBitmapExPrimitive(rBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); + + break; + } + case META_BMPEXSCALE_ACTION : + { + /** CHECKED, WORKS WELL: Simply same as META_BMPSCALE_ACTION */ + const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*)pAction; + const BitmapEx& rBitmapEx = pA->GetBitmapEx(); + + createBitmapExPrimitive(rBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + + break; + } + case META_BMPEXSCALEPART_ACTION : + { + /** CHECKED, WORKS WELL: Simply same as META_BMPSCALEPART_ACTION */ + const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*)pAction; + const BitmapEx& rBitmapEx = pA->GetBitmapEx(); + + if(!rBitmapEx.IsEmpty()) + { + BitmapEx aCroppedBitmapEx(rBitmapEx); + const Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize()); + + if(!aCropRectangle.IsEmpty()) + { + aCroppedBitmapEx.Crop(aCropRectangle); + } + + createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_MASK_ACTION : + { + /** CHECKED, WORKS WELL: Simply same as META_BMP_ACTION */ + const MetaMaskAction* pA = (const MetaMaskAction*)pAction; + const BitmapEx aBitmapEx(createMaskBmpEx(pA->GetBitmap(), pA->GetColor())); + + createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); + + break; + } + case META_MASKSCALE_ACTION : + { + /** CHECKED, WORKS WELL: Simply same as META_BMPSCALE_ACTION */ + const MetaMaskScaleAction* pA = (const MetaMaskScaleAction*)pAction; + const BitmapEx aBitmapEx(createMaskBmpEx(pA->GetBitmap(), pA->GetColor())); + + createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + + break; + } + case META_MASKSCALEPART_ACTION : + { + /** CHECKED, WORKS WELL: Simply same as META_BMPSCALEPART_ACTION */ + const MetaMaskScalePartAction* pA = (const MetaMaskScalePartAction*)pAction; + const Bitmap& rBitmap = pA->GetBitmap(); + + if(!rBitmap.IsEmpty()) + { + Bitmap aCroppedBitmap(rBitmap); + const Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize()); + + if(!aCropRectangle.IsEmpty()) + { + aCroppedBitmap.Crop(aCropRectangle); + } + + const BitmapEx aCroppedBitmapEx(createMaskBmpEx(aCroppedBitmap, pA->GetColor())); + createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + } + + break; + } + case META_GRADIENT_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaGradientAction* pA = (const MetaGradientAction*)pAction; + const Rectangle& rRectangle = pA->GetRect(); + + if(!rRectangle.IsEmpty()) + { + basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + + if(!aRange.isEmpty()) + { + const Gradient& rGradient = pA->GetGradient(); + const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient)); + + if(aAttribute.getStartColor() == aAttribute.getEndColor()) + { + // not really a gradient. Create filled rectangle + const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange)); + createFillPrimitive(basegfx::B2DPolyPolygon(aOutline), rTargetHolders.Current(), rPropertyHolders.Current()); + } + else + { + // really a gradient + aRange.transform(rPropertyHolders.Current().getTransformation()); + + if(rPropertyHolders.Current().isRasterOpInvert()) + { + // use a special version of FillGradientPrimitive2D which creates + // non-overlapping geometry on decomposition to makethe old XOR + // paint 'trick' work. + rTargetHolders.Current().append( + new drawinglayer::primitive2d::NonOverlappingFillGradientPrimitive2D( + aRange, + aAttribute)); + } + else + { + rTargetHolders.Current().append( + new drawinglayer::primitive2d::FillGradientPrimitive2D( + aRange, + aAttribute)); + } + } + } + } + + break; + } + case META_HATCH_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaHatchAction* pA = (const MetaHatchAction*)pAction; + basegfx::B2DPolyPolygon aOutline(pA->GetPolyPolygon().getB2DPolyPolygon()); + + if(aOutline.count()) + { + const Hatch& rHatch = pA->GetHatch(); + const drawinglayer::attribute::FillHatchAttribute aAttribute(createFillHatchAttribute(rHatch)); + + aOutline.transform(rPropertyHolders.Current().getTransformation()); + + const basegfx::B2DRange aObjectRange(aOutline.getB2DRange()); + const drawinglayer::primitive2d::Primitive2DReference aFillHatch( + new drawinglayer::primitive2d::FillHatchPrimitive2D( + aObjectRange, + basegfx::BColor(), + aAttribute)); + + rTargetHolders.Current().append( + new drawinglayer::primitive2d::MaskPrimitive2D( + aOutline, + drawinglayer::primitive2d::Primitive2DSequence(&aFillHatch, 1))); + } + + break; + } + case META_WALLPAPER_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaWallpaperAction* pA = (const MetaWallpaperAction*)pAction; + Rectangle aWallpaperRectangle(pA->GetRect()); + + if(!aWallpaperRectangle.IsEmpty()) + { + const Wallpaper& rWallpaper = pA->GetWallpaper(); + const WallpaperStyle eWallpaperStyle(rWallpaper.GetStyle()); + basegfx::B2DRange aWallpaperRange( + aWallpaperRectangle.Left(), aWallpaperRectangle.Top(), + aWallpaperRectangle.Right(), aWallpaperRectangle.Bottom()); + + if(WALLPAPER_NULL != eWallpaperStyle) + { + if(rWallpaper.IsBitmap()) + { + // create bitmap background. Caution: This + // also will create gradient/color background(s) + // when the bitmap is transparent or not tiled + CreateAndAppendBitmapWallpaper( + aWallpaperRange, + rWallpaper, + rTargetHolders.Current(), + rPropertyHolders.Current()); + } + else if(rWallpaper.IsGradient()) + { + // create gradient background + rTargetHolders.Current().append( + CreateGradientWallpaper( + aWallpaperRange, + rWallpaper.GetGradient(), + rPropertyHolders.Current())); + } + else if(!rWallpaper.GetColor().GetTransparency()) + { + // create color background + rTargetHolders.Current().append( + CreateColorWallpaper( + aWallpaperRange, + rWallpaper.GetColor().getBColor(), + rPropertyHolders.Current())); + } + } + } + + break; + } + case META_CLIPREGION_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaClipRegionAction* pA = (const MetaClipRegionAction*)pAction; + + if(pA->IsClipping()) + { + // new clipping + HandleNewClipRegion(&pA->GetRegion(), rTargetHolders, rPropertyHolders); + } + else + { + // end clipping + HandleNewClipRegion(0, rTargetHolders, rPropertyHolders); + } + + break; + } + case META_ISECTRECTCLIPREGION_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*)pAction; + const Rectangle& rRectangle = pA->GetRect(); + + if(rRectangle.IsEmpty()) + { + // intersect with empty rectangle will always give empty + // region; start new clipping with empty region + const Region aNewRegion; + HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders); + } + else + { + if(rPropertyHolders.Current().getRegionActive()) + { + if(rPropertyHolders.Current().getRegion().IsEmpty()) + { + // nothing to do, empty active clip region will stay + // empty when intersecting + } + else + { + // AND existing region and new rectangle + const basegfx::B2DPolyPolygon aOriginalPolyPolygon( + getB2DPolyPolygonFromRegion(rPropertyHolders.Current().getRegion())); + basegfx::B2DPolyPolygon aClippedPolyPolygon; + + if(aOriginalPolyPolygon.count()) + { + const basegfx::B2DRange aIntersectRange( + rRectangle.Left(), rRectangle.Top(), + rRectangle.Right(), rRectangle.Bottom()); + + aClippedPolyPolygon = basegfx::tools::clipPolyPolygonOnRange( + aOriginalPolyPolygon, aIntersectRange, true, false); + } + + if(aClippedPolyPolygon != aOriginalPolyPolygon) + { + // start new clipping with intersected region + const Region aNewRegion(aClippedPolyPolygon); + HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders); + } + } + } + else + { + // start new clipping with rectangle + const Region aNewRegion(rRectangle); + HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders); + } + } + + break; + } + case META_ISECTREGIONCLIPREGION_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*)pAction; + const Region& rNewRegion = pA->GetRegion(); + + if(rNewRegion.IsEmpty()) + { + // intersect with empty region will always give empty + // region; start new clipping with empty region + const Region aNewRegion; + HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders); + } + else + { + if(rPropertyHolders.Current().getRegionActive()) + { + if(rPropertyHolders.Current().getRegion().IsEmpty()) + { + // nothing to do, empty active clip region will stay empty + // when intersecting with any region + } + else + { + // AND existing and new region + const basegfx::B2DPolyPolygon aOriginalPolyPolygon( + getB2DPolyPolygonFromRegion(rPropertyHolders.Current().getRegion())); + basegfx::B2DPolyPolygon aClippedPolyPolygon; + + if(aOriginalPolyPolygon.count()) + { + const basegfx::B2DPolyPolygon aClipPolyPolygon( + getB2DPolyPolygonFromRegion(rNewRegion)); + + if(aClipPolyPolygon.count()) + { + aClippedPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon( + aOriginalPolyPolygon, aClipPolyPolygon, true, false); + } + } + + if(aClippedPolyPolygon != aOriginalPolyPolygon) + { + // start new clipping with intersected region + const Region aNewRegion(aClippedPolyPolygon); + HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders); + } + } + } + else + { + // start new clipping with new region + HandleNewClipRegion(&rNewRegion, rTargetHolders, rPropertyHolders); + } + } + + break; + } + case META_MOVECLIPREGION_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*)pAction; + + if(rPropertyHolders.Current().getRegionActive()) + { + if(rPropertyHolders.Current().getRegion().IsEmpty()) + { + // nothing to do + } + else + { + // move using old interface + Region aRegion(rPropertyHolders.Current().getRegion()); + + const sal_Int32 nHor(pA->GetHorzMove()); + const sal_Int32 nVer(pA->GetVertMove()); + + if(0 != nHor || 0 != nVer) + { + aRegion.Move(nHor, nVer); + HandleNewClipRegion(&aRegion, rTargetHolders, rPropertyHolders); + } + } + } + + break; + } + case META_LINECOLOR_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaLineColorAction* pA = (const MetaLineColorAction*)pAction; + const bool bActive(pA->IsSetting()); + + rPropertyHolders.Current().setLineColorActive(bActive); + if(bActive) + rPropertyHolders.Current().setLineColor(pA->GetColor().getBColor()); + + break; + } + case META_FILLCOLOR_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaFillColorAction* pA = (const MetaFillColorAction*)pAction; + const bool bActive(pA->IsSetting()); + + rPropertyHolders.Current().setFillColorActive(bActive); + if(bActive) + rPropertyHolders.Current().setFillColor(pA->GetColor().getBColor()); + + break; + } + case META_TEXTCOLOR_ACTION : + { + /** SIMPLE, DONE */ + const MetaTextColorAction* pA = (const MetaTextColorAction*)pAction; + const bool bActivate(COL_TRANSPARENT != pA->GetColor().GetColor()); + + rPropertyHolders.Current().setTextColorActive(bActivate); + rPropertyHolders.Current().setTextColor(pA->GetColor().getBColor()); + + break; + } + case META_TEXTFILLCOLOR_ACTION : + { + /** SIMPLE, DONE */ + const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*)pAction; + const bool bWithColorArgument(pA->IsSetting()); + + if(bWithColorArgument) + { + // emulate OutputDevice::SetTextFillColor(...) WITH argument + const Color& rFontFillColor = pA->GetColor(); + rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor()); + rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor()); + } + else + { + // emulate SetFillColor() <- NO argument (!) + rPropertyHolders.Current().setTextFillColorActive(false); + } + + break; + } + case META_TEXTALIGN_ACTION : + { + /** SIMPLE, DONE */ + const MetaTextAlignAction* pA = (const MetaTextAlignAction*)pAction; + const TextAlign aNewTextAlign = pA->GetTextAlign(); + + // TextAlign is applied to the current font (as in + // OutputDevice::SetTextAlign which would be used when + // playing the Metafile) + if(rPropertyHolders.Current().getFont().GetAlign() != aNewTextAlign) + { + Font aNewFont(rPropertyHolders.Current().getFont()); + aNewFont.SetAlign(aNewTextAlign); + rPropertyHolders.Current().setFont(aNewFont); + } + + break; + } + case META_MAPMODE_ACTION : + { + /** CHECKED, WORKS WELL */ + // the most necessary MapMode to be interpreted is MAP_RELATIVE, + // but also the others may occur. Even not yet supported ones + // may need to be added here later + const MetaMapModeAction* pA = (const MetaMapModeAction*)pAction; + const MapMode& rMapMode = pA->GetMapMode(); + basegfx::B2DHomMatrix aMapping; + + if(MAP_RELATIVE == rMapMode.GetMapUnit()) + { + aMapping = getTransformFromMapMode(rMapMode); + } + else + { + switch(rMapMode.GetMapUnit()) + { + case MAP_100TH_MM : + { + if(MAP_TWIP == rPropertyHolders.Current().getMapUnit()) + { + // MAP_TWIP -> MAP_100TH_MM + const double fTwipTo100thMm(127.0 / 72.0); + aMapping.scale(fTwipTo100thMm, fTwipTo100thMm); + } + break; + } + case MAP_TWIP : + { + if(MAP_100TH_MM == rPropertyHolders.Current().getMapUnit()) + { + // MAP_100TH_MM -> MAP_TWIP + const double f100thMmToTwip(72.0 / 127.0); + aMapping.scale(f100thMmToTwip, f100thMmToTwip); + } + break; + } + default : + { + OSL_ENSURE(false, "interpretMetafile: META_MAPMODE_ACTION with unsupported MapUnit (!)"); + break; + } + } + + aMapping = getTransformFromMapMode(rMapMode) * aMapping; + rPropertyHolders.Current().setMapUnit(rMapMode.GetMapUnit()); + } + + if(!aMapping.isIdentity()) + { + aMapping = aMapping * rPropertyHolders.Current().getTransformation(); + rPropertyHolders.Current().setTransformation(aMapping); + } + + break; + } + case META_FONT_ACTION : + { + /** SIMPLE, DONE */ + const MetaFontAction* pA = (const MetaFontAction*)pAction; + rPropertyHolders.Current().setFont(pA->GetFont()); + Size aFontSize(pA->GetFont().GetSize()); + + if(0 == aFontSize.Height()) + { + // this should not happen but i got Metafiles where this was the + // case. A height needs to be guessed (similar to OutputDevice::ImplNewFont()) + Font aCorrectedFont(pA->GetFont()); + + // guess 16 pixel (as in VCL) + aFontSize = Size(0, 16); + + // convert to target MapUnit if not pixels + aFontSize = Application::GetDefaultDevice()->LogicToLogic( + aFontSize, MAP_PIXEL, rPropertyHolders.Current().getMapUnit()); + + aCorrectedFont.SetSize(aFontSize); + rPropertyHolders.Current().setFont(aCorrectedFont); + } + + // older Metafiles have no META_TEXTCOLOR_ACTION which defines + // the FontColor now, so use the Font's color when not transparent + const Color& rFontColor = pA->GetFont().GetColor(); + const bool bActivate(COL_TRANSPARENT != rFontColor.GetColor()); + + if(bActivate) + { + rPropertyHolders.Current().setTextColor(rFontColor.getBColor()); + } + + // caution: do NOT decativate here on transparet, see + // OutputDevice::SetFont(..) for more info + // rPropertyHolders.Current().setTextColorActive(bActivate); + + // for fill color emulate a MetaTextFillColorAction with !transparent as bool, + // see OutputDevice::SetFont(..) the if(mpMetaFile) case + if(bActivate) + { + const Color& rFontFillColor = pA->GetFont().GetFillColor(); + rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor()); + rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor()); + } + else + { + rPropertyHolders.Current().setTextFillColorActive(false); + } + + break; + } + case META_PUSH_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaPushAction* pA = (const MetaPushAction*)pAction; + rPropertyHolders.Push(pA->GetFlags()); + + break; + } + case META_POP_ACTION : + { + /** CHECKED, WORKS WELL */ + const bool bRegionMayChange(rPropertyHolders.Current().getPushFlags() & PUSH_CLIPREGION); + const bool bRasterOpMayChange(rPropertyHolders.Current().getPushFlags() & PUSH_RASTEROP); + + if(bRegionMayChange && rPropertyHolders.Current().getRegionActive()) + { + // end evtl. clipping + HandleNewClipRegion(0, rTargetHolders, rPropertyHolders); + } + + if(bRasterOpMayChange && rPropertyHolders.Current().isRasterOpActive()) + { + // end evtl. RasterOp + HandleNewRasterOp(ROP_OVERPAINT, rTargetHolders, rPropertyHolders); + } + + rPropertyHolders.Pop(); + + if(bRasterOpMayChange && rPropertyHolders.Current().isRasterOpActive()) + { + // start evtl. RasterOp + HandleNewRasterOp(rPropertyHolders.Current().getRasterOp(), rTargetHolders, rPropertyHolders); + } + + if(bRegionMayChange && rPropertyHolders.Current().getRegionActive()) + { + // start evtl. clipping + HandleNewClipRegion(&rPropertyHolders.Current().getRegion(), rTargetHolders, rPropertyHolders); + } + + break; + } + case META_RASTEROP_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaRasterOpAction* pA = (const MetaRasterOpAction*)pAction; + const RasterOp aRasterOp = pA->GetRasterOp(); + + HandleNewRasterOp(aRasterOp, rTargetHolders, rPropertyHolders); + + break; + } + case META_TRANSPARENT_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaTransparentAction* pA = (const MetaTransparentAction*)pAction; + const basegfx::B2DPolyPolygon aOutline(pA->GetPolyPolygon().getB2DPolyPolygon()); + + if(aOutline.count()) + { + const sal_uInt16 nTransparence(pA->GetTransparence()); + + if(0 == nTransparence) + { + // not transparent + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + } + else if(nTransparence >= 100) + { + // fully or more than transparent + } + else + { + // transparent. Create new target + rTargetHolders.Push(); + + // create primitives there and get them + createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current()); + const drawinglayer::primitive2d::Primitive2DSequence aSubContent( + rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current())); + + // back to old target + rTargetHolders.Pop(); + + if(aSubContent.hasElements()) + { + rTargetHolders.Current().append( + new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + aSubContent, + nTransparence * 0.01)); + } + } + } + + break; + } + case META_EPS_ACTION : + { + /** CHECKED, WORKS WELL */ + // To support this action, i have added a EpsPrimitive2D which will + // by default decompose to the Metafile replacement data. To support + // this EPS on screen, the renderer visualizing this has to support + // that primitive and visualize the Eps file (e.g. printing) + const MetaEPSAction* pA = (const MetaEPSAction*)pAction; + const Rectangle aRectangle(pA->GetPoint(), pA->GetSize()); + + if(!aRectangle.IsEmpty()) + { + // create object transform + basegfx::B2DHomMatrix aObjectTransform; + + aObjectTransform.set(0, 0, aRectangle.GetWidth()); + aObjectTransform.set(1, 1, aRectangle.GetHeight()); + aObjectTransform.set(0, 2, aRectangle.Left()); + aObjectTransform.set(1, 2, aRectangle.Top()); + + // add current transformation + aObjectTransform = rPropertyHolders.Current().getTransformation() * aObjectTransform; + + // embed using EpsPrimitive + rTargetHolders.Current().append( + new drawinglayer::primitive2d::EpsPrimitive2D( + aObjectTransform, + pA->GetLink(), + pA->GetSubstitute())); + } + + break; + } + case META_REFPOINT_ACTION : + { + /** SIMPLE, DONE */ + // only used for hatch and line pattern offsets, pretty much no longer + // supported today + // const MetaRefPointAction* pA = (const MetaRefPointAction*)pAction; + break; + } + case META_TEXTLINECOLOR_ACTION : + { + /** SIMPLE, DONE */ + const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*)pAction; + const bool bActive(pA->IsSetting()); + + rPropertyHolders.Current().setTextLineColorActive(bActive); + if(bActive) + rPropertyHolders.Current().setTextLineColor(pA->GetColor().getBColor()); + + break; + } + case META_TEXTLINE_ACTION : + { + /** CHECKED, WORKS WELL */ + // actually creates overline, underline and strikeouts, so + // these should be isolated from TextDecoratedPortionPrimitive2D + // to own primitives. Done, available now. + // + // This Metaaction seems not to be used (was not used in any + // checked files). It's used in combination with the current + // Font. + const MetaTextLineAction* pA = (const MetaTextLineAction*)pAction; + + proccessMetaTextLineAction( + *pA, + rTargetHolders.Current(), + rPropertyHolders.Current()); + + break; + } + case META_FLOATTRANSPARENT_ACTION : + { + /** CHECKED, WORKS WELL */ + const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*)pAction; + const Rectangle aTargetRectangle(pA->GetPoint(), pA->GetSize()); + + if(!aTargetRectangle.IsEmpty()) + { + const GDIMetaFile& rContent = pA->GetGDIMetaFile(); + + if(rContent.GetActionCount()) + { + // create the sub-content with no embedding specific to the + // sub-metafile, this seems not to be used. + drawinglayer::primitive2d::Primitive2DSequence xSubContent; + { + rTargetHolders.Push(); + interpretMetafile(rContent, rTargetHolders, rPropertyHolders, rViewInformation); + xSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current()); + rTargetHolders.Pop(); + } + + if(xSubContent.hasElements()) + { + // check if gradient is a real gradient + const Gradient& rGradient = pA->GetGradient(); + const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient)); + + if(aAttribute.getStartColor() == aAttribute.getEndColor()) + { + // not really a gradient; create UnifiedAlphaPrimitive2D + rTargetHolders.Current().append( + new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + xSubContent, + aAttribute.getStartColor().luminance())); + } + else + { + // really a gradient. Create gradient sub-content (with correct scaling) + basegfx::B2DRange aRange( + aTargetRectangle.Left(), aTargetRectangle.Top(), + aTargetRectangle.Right(), aTargetRectangle.Bottom()); + aRange.transform(rPropertyHolders.Current().getTransformation()); + + // prepare gradient for alpha content + const drawinglayer::primitive2d::Primitive2DReference xAlpha( + new drawinglayer::primitive2d::FillGradientPrimitive2D( + aRange, + aAttribute)); + + // create alpha primitive + rTargetHolders.Current().append( + new drawinglayer::primitive2d::AlphaPrimitive2D( + xSubContent, + drawinglayer::primitive2d::Primitive2DSequence(&xAlpha, 1))); + } + } + } + } + + break; + } + case META_GRADIENTEX_ACTION : + { + /** SIMPLE, DONE */ + // This is only a data holder which is interpreted inside comment actions, + // see META_COMMENT_ACTION for more info + // const MetaGradientExAction* pA = (const MetaGradientExAction*)pAction; + break; + } + case META_LAYOUTMODE_ACTION : + { + /** SIMPLE, DONE */ + const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*)pAction; + rPropertyHolders.Current().setLayoutMode(pA->GetLayoutMode()); + break; + } + case META_TEXTLANGUAGE_ACTION : + { + /** SIMPLE, DONE */ + const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*)pAction; + rPropertyHolders.Current().setLanguageType(pA->GetTextLanguage()); + break; + } + case META_OVERLINECOLOR_ACTION : + { + /** SIMPLE, DONE */ + const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*)pAction; + const bool bActive(pA->IsSetting()); + + rPropertyHolders.Current().setOverlineColorActive(bActive); + if(bActive) + rPropertyHolders.Current().setOverlineColor(pA->GetColor().getBColor()); + + break; + } + case META_COMMENT_ACTION : + { + /** CHECKED, WORKS WELL */ + // I already implemented + // XPATHFILL_SEQ_BEGIN, XPATHFILL_SEQ_END + // XPATHSTROKE_SEQ_BEGIN, XPATHSTROKE_SEQ_END, + // but opted to remove these again; it works well without them + // and makes the code less dependent from those Metafile Add-Ons + const MetaCommentAction* pA = (const MetaCommentAction*)pAction; + + if(COMPARE_EQUAL == pA->GetComment().CompareIgnoreCaseToAscii("XGRAD_SEQ_BEGIN")) + { + // XGRAD_SEQ_BEGIN, XGRAD_SEQ_END should be supported since the + // pure recorded paint of the gradients uses the XOR paint functionality + // ('trick'). This is (and will be) broblematic with AntAliasing, so it's + // better to use this info + const MetaGradientExAction* pMetaGradientExAction = 0; + bool bDone(false); + sal_uInt32 b(nAction + 1); + + for(; !bDone && b < nCount; b++) + { + pAction = rMetaFile.GetAction(b); + + if(META_GRADIENTEX_ACTION == pAction->GetType()) + { + pMetaGradientExAction = (const MetaGradientExAction*)pAction; + } + else if(META_COMMENT_ACTION == pAction->GetType()) + { + if(COMPARE_EQUAL == ((const MetaCommentAction*)pAction)->GetComment().CompareIgnoreCaseToAscii("XGRAD_SEQ_END")) + { + bDone = true; + } + } + } + + if(bDone && pMetaGradientExAction) + { + // consume actions and skip forward + nAction = b - 1; + + // get geometry data + basegfx::B2DPolyPolygon aPolyPolygon(pMetaGradientExAction->GetPolyPolygon().getB2DPolyPolygon()); + + if(aPolyPolygon.count()) + { + // transform geometry + aPolyPolygon.transform(rPropertyHolders.Current().getTransformation()); + + // get and check if gradient is a real gradient + const Gradient& rGradient = pMetaGradientExAction->GetGradient(); + const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient)); + + if(aAttribute.getStartColor() == aAttribute.getEndColor()) + { + // not really a gradient + rTargetHolders.Current().append( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + aPolyPolygon, + aAttribute.getStartColor())); + } + else + { + // really a gradient + rTargetHolders.Current().append( + new drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D( + aPolyPolygon, + aAttribute)); + } + } + } + } + + break; + } + default: + { + OSL_ENSURE(false, "Unknown MetaFile Action (!)"); + break; + } + } + } + } +} // end of anonymous namespace + +////////////////////////////////////////////////////////////////////////////// + namespace drawinglayer { namespace primitive2d { + Primitive2DSequence MetafilePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const + { + // prepare target and porperties; each will have one default entry + TargetHolders aTargetHolders; + PropertyHolders aPropertyHolders; + + // set target MapUnit at Properties + aPropertyHolders.Current().setMapUnit(getMetaFile().GetPrefMapMode().GetMapUnit()); + + // interpret the Metafile + interpretMetafile(getMetaFile(), aTargetHolders, aPropertyHolders, rViewInformation); + + // get the content. There should be ony one target, as in the start condition, + // but iterating will be the right thing to do when some push/pop is not closed + Primitive2DSequence xRetval; + + while(aTargetHolders.size() > 1) + { + appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, + aTargetHolders.Current().getPrimitive2DSequence(aPropertyHolders.Current())); + aTargetHolders.Pop(); + } + + appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, + aTargetHolders.Current().getPrimitive2DSequence(aPropertyHolders.Current())); + + if(xRetval.hasElements()) + { + // get target size + const Rectangle aMtfTarget(getMetaFile().GetPrefMapMode().GetOrigin(), getMetaFile().GetPrefSize()); + + // create transformation + basegfx::B2DHomMatrix aAdaptedTransform; + + aAdaptedTransform.translate(-aMtfTarget.Left(), -aMtfTarget.Top()); + aAdaptedTransform.scale( + aMtfTarget.getWidth() ? 1.0 / aMtfTarget.getWidth() : 1.0, + aMtfTarget.getHeight() ? 1.0 / aMtfTarget.getHeight() : 1.0); + aAdaptedTransform = getTransform() * aAdaptedTransform; + + // embed to target transformation + const Primitive2DReference aEmbeddedTransform( + new TransformPrimitive2D( + aAdaptedTransform, + xRetval)); + + xRetval = Primitive2DSequence(&aEmbeddedTransform, 1); + } + + return xRetval; + } + MetafilePrimitive2D::MetafilePrimitive2D( const basegfx::B2DHomMatrix& rMetaFileTransform, const GDIMetaFile& rMetaFile) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maMetaFileTransform(rMetaFileTransform), maMetaFile(rMetaFile) { @@ -61,7 +3060,7 @@ namespace drawinglayer bool MetafilePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const MetafilePrimitive2D& rCompare = (MetafilePrimitive2D&)rPrimitive; @@ -74,8 +3073,13 @@ namespace drawinglayer basegfx::B2DRange MetafilePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const { + // use own implementation to quickly answer the getB2DRange question. The + // MetafilePrimitive2D assumes that all geometry is inside of the shape. If + // this is not the case (i have already seen some wrong Metafiles) it should + // be embedded to a MaskPrimitive2D basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0); aRetval.transform(getTransform()); + return aRetval; } diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx index 01a82299682d..b747c79ee0c7 100644 --- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx @@ -42,6 +42,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <drawinglayer/primitive2d/transformprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -53,10 +54,10 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PagePreviewPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence PagePreviewPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence xRetval; - Primitive2DSequence aContent(getChildren()); + Primitive2DSequence aContent(getPageContent()); if(aContent.hasElements() && basegfx::fTools::more(getContentWidth(), 0.0) @@ -112,9 +113,9 @@ namespace drawinglayer } // add the missing object transformation aspects - aPageTrans.shearX(fShearX); - aPageTrans.rotate(fRotate); - aPageTrans.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aCombined(basegfx::tools::createShearXRotateTranslateB2DHomMatrix( + fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); + aPageTrans = aCombined * aPageTrans; } else { @@ -139,10 +140,11 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rTransform, double fContentWidth, double fContentHeight, - const Primitive2DSequence& rChildren, + const Primitive2DSequence& rPageContent, bool bKeepAspectRatio) - : GroupPrimitive2D(rChildren), + : BufferedDecompositionPrimitive2D(), mxDrawPage(rxDrawPage), + maPageContent(rPageContent), maTransform(rTransform), mfContentWidth(fContentWidth), mfContentHeight(fContentHeight), @@ -152,11 +154,12 @@ namespace drawinglayer bool PagePreviewPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(GroupPrimitive2D::operator==(rPrimitive)) + if(BasePrimitive2D::operator==(rPrimitive)) { const PagePreviewPrimitive2D& rCompare = static_cast< const PagePreviewPrimitive2D& >(rPrimitive); return (getXDrawPage() == rCompare.getXDrawPage() + && getPageContent() == rCompare.getPageContent() && getTransform() == rCompare.getTransform() && getContentWidth() == rCompare.getContentWidth() && getContentHeight() == rCompare.getContentHeight() diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index b5212da54688..69cbd046efd2 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -110,7 +110,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolygonMarkerPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence PolygonMarkerPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { // calculate logic DashLength const basegfx::B2DVector aDashVector(rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(getDiscreteDashLength(), 0.0)); @@ -147,7 +147,7 @@ namespace drawinglayer const basegfx::BColor& rRGBColorA, const basegfx::BColor& rRGBColorB, double fDiscreteDashLength) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPolygon(rPolygon), maRGBColorA(rRGBColorA), maRGBColorB(rRGBColorB), @@ -158,7 +158,7 @@ namespace drawinglayer bool PolygonMarkerPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolygonMarkerPrimitive2D& rCompare = (PolygonMarkerPrimitive2D&)rPrimitive; @@ -198,7 +198,7 @@ namespace drawinglayer ::osl::MutexGuard aGuard( m_aMutex ); bool bNeedNewDecomposition(false); - if(getLocalDecomposition().hasElements()) + if(getBuffered2DDecomposition().hasElements()) { if(rViewInformation.getInverseObjectToViewTransformation() != maLastInverseObjectToViewTransformation) { @@ -209,10 +209,10 @@ namespace drawinglayer if(bNeedNewDecomposition) { // conditions of last local decomposition have changed, delete - const_cast< PolygonMarkerPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< PolygonMarkerPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember last used InverseObjectToViewTransformation PolygonMarkerPrimitive2D* pThat = const_cast< PolygonMarkerPrimitive2D* >(this); @@ -220,7 +220,7 @@ namespace drawinglayer } // use parent implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID @@ -235,7 +235,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolygonStrokePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolygonStrokePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { if(getB2DPolygon().count()) { @@ -307,7 +307,7 @@ namespace drawinglayer const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::StrokeAttribute& rStrokeAttribute) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPolygon(rPolygon), maLineAttribute(rLineAttribute), maStrokeAttribute(rStrokeAttribute) @@ -317,7 +317,7 @@ namespace drawinglayer PolygonStrokePrimitive2D::PolygonStrokePrimitive2D( const basegfx::B2DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPolygon(rPolygon), maLineAttribute(rLineAttribute), maStrokeAttribute() @@ -326,7 +326,7 @@ namespace drawinglayer bool PolygonStrokePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolygonStrokePrimitive2D& rCompare = (PolygonStrokePrimitive2D&)rPrimitive; @@ -348,7 +348,7 @@ namespace drawinglayer { // if line is mitered, use parent call since mitered line // geometry may use more space than the geometry grown by half line width - aRetval = BasePrimitive2D::getB2DRange(rViewInformation); + aRetval = BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation); } else { @@ -392,7 +392,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolygonWavePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolygonWavePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence aRetval; @@ -505,7 +505,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolygonStrokeArrowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolygonStrokeArrowPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // copy local polygon, it may be changed basegfx::B2DPolygon aLocalPolygon(getB2DPolygon()); @@ -614,7 +614,7 @@ namespace drawinglayer if(getStart().isActive() || getEnd().isActive()) { // use decomposition when line start/end is used - return BasePrimitive2D::getB2DRange(rViewInformation); + return BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation); } else { diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx index 9dd14aeb11e3..55c334434c70 100644 --- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx @@ -57,7 +57,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolyPolygonHairlinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolyPolygonHairlinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon()); const sal_uInt32 nCount(aPolyPolygon.count()); @@ -80,7 +80,7 @@ namespace drawinglayer } PolyPolygonHairlinePrimitive2D::PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPolyPolygon(rPolyPolygon), maBColor(rBColor) { @@ -88,7 +88,7 @@ namespace drawinglayer bool PolyPolygonHairlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolyPolygonHairlinePrimitive2D& rCompare = (PolyPolygonHairlinePrimitive2D&)rPrimitive; @@ -117,7 +117,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolyPolygonMarkerPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolyPolygonMarkerPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon()); const sal_uInt32 nCount(aPolyPolygon.count()); @@ -144,7 +144,7 @@ namespace drawinglayer const basegfx::BColor& rRGBColorA, const basegfx::BColor& rRGBColorB, double fDiscreteDashLength) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPolyPolygon(rPolyPolygon), maRGBColorA(rRGBColorA), maRGBColorB(rRGBColorB), @@ -154,7 +154,7 @@ namespace drawinglayer bool PolyPolygonMarkerPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolyPolygonMarkerPrimitive2D& rCompare = (PolyPolygonMarkerPrimitive2D&)rPrimitive; @@ -185,7 +185,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolyPolygonStrokePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolyPolygonStrokePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon()); const sal_uInt32 nCount(aPolyPolygon.count()); @@ -211,7 +211,7 @@ namespace drawinglayer const basegfx::B2DPolyPolygon& rPolyPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::StrokeAttribute& rStrokeAttribute) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPolyPolygon(rPolyPolygon), maLineAttribute(rLineAttribute), maStrokeAttribute(rStrokeAttribute) @@ -221,7 +221,7 @@ namespace drawinglayer PolyPolygonStrokePrimitive2D::PolyPolygonStrokePrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, const attribute::LineAttribute& rLineAttribute) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maPolyPolygon(rPolyPolygon), maLineAttribute(rLineAttribute), maStrokeAttribute() @@ -230,7 +230,7 @@ namespace drawinglayer bool PolyPolygonStrokePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolyPolygonStrokePrimitive2D& rCompare = (PolyPolygonStrokePrimitive2D&)rPrimitive; @@ -268,7 +268,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolyPolygonStrokeArrowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolyPolygonStrokeArrowPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon()); const sal_uInt32 nCount(aPolyPolygon.count()); @@ -343,7 +343,7 @@ namespace drawinglayer if(getStart().isActive() || getEnd().isActive()) { // use decomposition when line start/end is used - return BasePrimitive2D::getB2DRange(rViewInformation); + return BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation); } else { @@ -404,7 +404,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolyPolygonGradientPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolyPolygonGradientPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // create SubSequence with FillGradientPrimitive2D const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); @@ -420,16 +420,16 @@ namespace drawinglayer PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, - const basegfx::BColor& rBColor, const attribute::FillGradientAttribute& rFillGradient) - : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor), + : BufferedDecompositionPrimitive2D(), + maPolyPolygon(rPolyPolygon), maFillGradient(rFillGradient) { } bool PolyPolygonGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(PolyPolygonColorPrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolyPolygonGradientPrimitive2D& rCompare = (PolyPolygonGradientPrimitive2D&)rPrimitive; @@ -451,11 +451,11 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolyPolygonHatchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolyPolygonHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // create SubSequence with FillHatchPrimitive2D const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); - FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBColor(), getFillHatch()); + FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch()); const Primitive2DReference xSubRef(pNewHatch); const Primitive2DSequence aSubSequence(&xSubRef, 1L); @@ -467,20 +467,23 @@ namespace drawinglayer PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, - const basegfx::BColor& rBColor, + const basegfx::BColor& rBackgroundColor, const attribute::FillHatchAttribute& rFillHatch) - : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor), + : BufferedDecompositionPrimitive2D(), + maPolyPolygon(rPolyPolygon), + maBackgroundColor(rBackgroundColor), maFillHatch(rFillHatch) { } bool PolyPolygonHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(PolyPolygonColorPrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolyPolygonHatchPrimitive2D& rCompare = (PolyPolygonHatchPrimitive2D&)rPrimitive; - return (getFillHatch() == rCompare.getFillHatch()); + return (getBackgroundColor() == rCompare.getBackgroundColor() + && getFillHatch() == rCompare.getFillHatch()); } return false; @@ -498,7 +501,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence PolyPolygonBitmapPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence PolyPolygonBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // create SubSequence with FillBitmapPrimitive2D const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); @@ -519,16 +522,16 @@ namespace drawinglayer PolyPolygonBitmapPrimitive2D::PolyPolygonBitmapPrimitive2D( const basegfx::B2DPolyPolygon& rPolyPolygon, - const basegfx::BColor& rBColor, const attribute::FillBitmapAttribute& rFillBitmap) - : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor), + : BufferedDecompositionPrimitive2D(), + maPolyPolygon(rPolyPolygon), maFillBitmap(rFillBitmap) { } bool PolyPolygonBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(PolyPolygonColorPrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const PolyPolygonBitmapPrimitive2D& rCompare = (PolyPolygonBitmapPrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx b/drawinglayer/source/primitive2d/primitivetools2d.cxx index d288a697d729..2b25590bf1f4 100644 --- a/drawinglayer/source/primitive2d/primitivetools2d.cxx +++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx @@ -53,20 +53,20 @@ namespace drawinglayer // get the current DiscreteUnit const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength()); - if(getLocalDecomposition().hasElements() && !basegfx::fTools::equal(fDiscreteUnit, getDiscreteUnit())) + if(getBuffered2DDecomposition().hasElements() && !basegfx::fTools::equal(fDiscreteUnit, getDiscreteUnit())) { // conditions of last local decomposition have changed, delete - const_cast< DiscreteMetricDependentPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< DiscreteMetricDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember new valid DiscreteUnit const_cast< DiscreteMetricDependentPrimitive2D* >(this)->mfDiscreteUnit = fDiscreteUnit; } // call base implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -84,20 +84,92 @@ namespace drawinglayer // get the current Viewport const basegfx::B2DRange& rViewport = rViewInformation.getViewport(); - if(getLocalDecomposition().hasElements() && !rViewport.equal(getViewport())) + if(getBuffered2DDecomposition().hasElements() && !rViewport.equal(getViewport())) { // conditions of last local decomposition have changed, delete - const_cast< ViewportDependentPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< ViewportDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember new valid DiscreteUnit const_cast< ViewportDependentPrimitive2D* >(this)->maViewport = rViewport; } // call base implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); + } + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence ViewTransformationDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const + { + ::osl::MutexGuard aGuard( m_aMutex ); + + // get the current ViewTransformation + const basegfx::B2DHomMatrix& rViewTransformation = rViewInformation.getViewTransformation(); + + if(getBuffered2DDecomposition().hasElements() && rViewTransformation != getViewTransformation()) + { + // conditions of last local decomposition have changed, delete + const_cast< ViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); + } + + if(!getBuffered2DDecomposition().hasElements()) + { + // remember new valid ViewTransformation + const_cast< ViewTransformationDependentPrimitive2D* >(this)->maViewTransformation = rViewTransformation; + } + + // call base implementation + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); + } + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence ObjectAndViewTransformationDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const + { + ::osl::MutexGuard aGuard( m_aMutex ); + + // get the current ViewTransfromation + const basegfx::B2DHomMatrix& rViewTransformation = rViewInformation.getViewTransformation(); + + if(getBuffered2DDecomposition().hasElements() && rViewTransformation != getViewTransformation()) + { + // conditions of last local decomposition have changed, delete + const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); + } + + // get the current ObjectTransformation + const basegfx::B2DHomMatrix& rObjectTransformation = rViewInformation.getObjectTransformation(); + + if(getBuffered2DDecomposition().hasElements() && rObjectTransformation != getObjectTransformation()) + { + // conditions of last local decomposition have changed, delete + const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); + } + + if(!getBuffered2DDecomposition().hasElements()) + { + // remember new valid ViewTransformation, and ObjectTransformation + const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->maViewTransformation = rViewTransformation; + const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->maObjectTransformation = rObjectTransformation; + } + + // call base implementation + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index ad36a40ea996..6b346d5abdc0 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -147,7 +147,7 @@ namespace drawinglayer } } - Primitive2DSequence ScenePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence ScenePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence aRetval; @@ -356,7 +356,7 @@ namespace drawinglayer const attribute::SdrLightingAttribute& rSdrLightingAttribute, const basegfx::B2DHomMatrix& rObjectTransformation, const geometry::ViewInformation3D& rViewInformation3D) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), mxChildren3D(rxChildren3D), maSdrSceneAttribute(rSdrSceneAttribute), maSdrLightingAttribute(rSdrLightingAttribute), @@ -373,7 +373,7 @@ namespace drawinglayer bool ScenePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const ScenePrimitive2D& rCompare = (ScenePrimitive2D&)rPrimitive; @@ -424,7 +424,7 @@ namespace drawinglayer bool bNeedNewDecomposition(false); bool bDiscreteSizesAreCalculated(false); - if(getLocalDecomposition().hasElements()) + if(getBuffered2DDecomposition().hasElements()) { basegfx::B2DRange aVisibleDiscreteRange; calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange); @@ -452,10 +452,10 @@ namespace drawinglayer if(bNeedNewDecomposition) { // conditions of last local decomposition have changed, delete - const_cast< ScenePrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< ScenePrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { if(!bDiscreteSizesAreCalculated) { @@ -471,7 +471,7 @@ namespace drawinglayer } // use parent implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index 5681f7f98d7e..b6ce7dc3248d 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -55,25 +55,6 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence ShadowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const - { - Primitive2DSequence aRetval; - - if(getChildren().hasElements()) - { - // create a modifiedColorPrimitive containing the shadow color and the content - const basegfx::BColorModifier aBColorModifier(getShadowColor()); - const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(getChildren(), aBColorModifier)); - const Primitive2DSequence aSequenceB(&xRefA, 1L); - - // build transformed primitiveVector with shadow offset and add to target - const Primitive2DReference xRefB(new TransformPrimitive2D(getShadowTransform(), aSequenceB)); - aRetval = Primitive2DSequence(&xRefB, 1L); - } - - return aRetval; - } - ShadowPrimitive2D::ShadowPrimitive2D( const basegfx::B2DHomMatrix& rShadowTransform, const basegfx::BColor& rShadowColor, @@ -86,7 +67,7 @@ namespace drawinglayer bool ShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(GroupPrimitive2D::operator==(rPrimitive)) + if(BasePrimitive2D::operator==(rPrimitive)) { const ShadowPrimitive2D& rCompare = static_cast< const ShadowPrimitive2D& >(rPrimitive); @@ -104,6 +85,25 @@ namespace drawinglayer return aRetval; } + Primitive2DSequence ShadowPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence aRetval; + + if(getChildren().hasElements()) + { + // create a modifiedColorPrimitive containing the shadow color and the content + const basegfx::BColorModifier aBColorModifier(getShadowColor()); + const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(getChildren(), aBColorModifier)); + const Primitive2DSequence aSequenceB(&xRefA, 1L); + + // build transformed primitiveVector with shadow offset and add to target + const Primitive2DReference xRefB(new TransformPrimitive2D(getShadowTransform(), aSequenceB)); + aRetval = Primitive2DSequence(&xRefB, 1L); + } + + return aRetval; + } + // provide unique ID ImplPrimitrive2DIDBlock(ShadowPrimitive2D, PRIMITIVE2D_ID_SHADOWPRIMITIVE2D) diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx index d337950c6c6b..f9d245f76a34 100644 --- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx @@ -48,6 +48,8 @@ #include <drawinglayer/primitive2d/shadowprimitive2d.hxx> #include <com/sun/star/i18n/XBreakIterator.hpp> #include <drawinglayer/primitive2d/transformprimitive2d.hxx> +#include <drawinglayer/primitive2d/textlineprimitive2d.hxx> +#include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -55,226 +57,14 @@ namespace drawinglayer { namespace primitive2d { - void TextDecoratedPortionPrimitive2D::impCreateTextLine( - std::vector< Primitive2DReference >& rTarget, - basegfx::DecomposedB2DHomMatrixContainer& rDecTrans, - const basegfx::B2DHomMatrix &rUnscaledTransform, - FontUnderline eLineStyle, - double fLineOffset, - double fLineHeight, - double fLineWidth, - const basegfx::BColor& rLineColor) const - { - bool bDoubleLine(false); - bool bWaveLine(false); - bool bBoldLine(false); - const int* pDotDashArray(0); - basegfx::B2DLineJoin eLineJoin(basegfx::B2DLINEJOIN_NONE); - - static const int aDottedArray[] = { 1, 1, 0}; // DOTTED LINE - static const int aDotDashArray[] = { 1, 1, 4, 1, 0}; // DASHDOT - static const int aDashDotDotArray[] = { 1, 1, 1, 1, 4, 1, 0}; // DASHDOTDOT - static const int aDashedArray[] = { 5, 2, 0}; // DASHED LINE - static const int aLongDashArray[] = { 7, 2, 0}; // LONGDASH - - switch(eLineStyle) - { - default: // case FONT_UNDERLINE_SINGLE: - { - break; - } - case FONT_UNDERLINE_DOUBLE: - { - bDoubleLine = true; - break; - } - case FONT_UNDERLINE_DOTTED: - { - pDotDashArray = aDottedArray; - break; - } - case FONT_UNDERLINE_DASH: - { - pDotDashArray = aDashedArray; - break; - } - case FONT_UNDERLINE_LONGDASH: - { - pDotDashArray = aLongDashArray; - break; - } - case FONT_UNDERLINE_DASHDOT: - { - pDotDashArray = aDotDashArray; - break; - } - case FONT_UNDERLINE_DASHDOTDOT: - { - pDotDashArray = aDashDotDotArray; - break; - } - case FONT_UNDERLINE_SMALLWAVE: - { - bWaveLine = true; - break; - } - case FONT_UNDERLINE_WAVE: - { - bWaveLine = true; - break; - } - case FONT_UNDERLINE_DOUBLEWAVE: - { - bDoubleLine = true; - bWaveLine = true; - break; - } - case FONT_UNDERLINE_BOLD: - { - bBoldLine = true; - break; - } - case FONT_UNDERLINE_BOLDDOTTED: - { - bBoldLine = true; - pDotDashArray = aDottedArray; - break; - } - case FONT_UNDERLINE_BOLDDASH: - { - bBoldLine = true; - pDotDashArray = aDashedArray; - break; - } - case FONT_UNDERLINE_BOLDLONGDASH: - { - bBoldLine = true; - pDotDashArray = aLongDashArray; - break; - } - case FONT_UNDERLINE_BOLDDASHDOT: - { - bBoldLine = true; - pDotDashArray = aDotDashArray; - break; - } - case FONT_UNDERLINE_BOLDDASHDOTDOT: - { - bBoldLine = true; - pDotDashArray = aDashDotDotArray; - break; - } - case FONT_UNDERLINE_BOLDWAVE: - { - bWaveLine = true; - bBoldLine = true; - break; - } - } - - if(bBoldLine) - { - fLineHeight *= 2.0; - } - - if(bDoubleLine) - { - fLineOffset -= 0.50 * fLineHeight; - fLineHeight *= 0.64; - } - - if(bWaveLine) - { - eLineJoin = basegfx::B2DLINEJOIN_ROUND; - fLineHeight *= 0.25; - } - - // prepare Line and Stroke Attributes - const attribute::LineAttribute aLineAttribute(rLineColor, fLineHeight, eLineJoin); - attribute::StrokeAttribute aStrokeAttribute; - - if(pDotDashArray) - { - ::std::vector< double > aDoubleArray; - - for(const int* p = pDotDashArray; *p; ++p) - { - aDoubleArray.push_back((double)(*p) * fLineHeight); - } - - aStrokeAttribute = attribute::StrokeAttribute(aDoubleArray); - } - - // create base polygon and new primitive - basegfx::B2DPolygon aLine; - Primitive2DReference aNewPrimitive; - - aLine.append(basegfx::B2DPoint(0.0, fLineOffset)); - aLine.append(basegfx::B2DPoint(fLineWidth, fLineOffset)); - aLine.transform(rUnscaledTransform); - - if(bWaveLine) - { - double fWaveWidth(10.6 * fLineHeight); - - if(FONT_UNDERLINE_SMALLWAVE == eLineStyle) - { - fWaveWidth *= 0.7; - } - else if(FONT_UNDERLINE_WAVE == eLineStyle) - { - // extra multiply to get the same WaveWidth as with the bold version - fWaveWidth *= 2.0; - } - - aNewPrimitive = Primitive2DReference(new PolygonWavePrimitive2D(aLine, aLineAttribute, aStrokeAttribute, fWaveWidth, fWaveWidth * 0.5)); - } - else - { - aNewPrimitive = Primitive2DReference(new PolygonStrokePrimitive2D(aLine, aLineAttribute, aStrokeAttribute)); - } - - // add primitive - rTarget.push_back(aNewPrimitive); - - if(bDoubleLine) - { - // double line, create 2nd primitive with offset using TransformPrimitive based on - // already created NewPrimitive - double fLineDist(2.3 * fLineHeight); - - if(bWaveLine) - { - fLineDist = 6.3 * fLineHeight; - } - - basegfx::B2DHomMatrix aTransform; - - // move base point of text to 0.0 and de-rotate - aTransform.translate(-rDecTrans.getTranslate().getX(), -rDecTrans.getTranslate().getY()); - aTransform.rotate(-rDecTrans.getRotate()); - - // translate in Y by offset - aTransform.translate(0.0, fLineDist); - - // move back and rotate - aTransform.rotate(rDecTrans.getRotate()); - aTransform.translate(rDecTrans.getTranslate().getX(), rDecTrans.getTranslate().getY()); - - // add transform primitive - const Primitive2DSequence aContent(&aNewPrimitive, 1); - rTarget.push_back(Primitive2DReference(new TransformPrimitive2D(aTransform, aContent))); - } - } - void TextDecoratedPortionPrimitive2D::impCreateGeometryContent( std::vector< Primitive2DReference >& rTarget, - basegfx::DecomposedB2DHomMatrixContainer& rDecTrans, + basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans, const String& rText, xub_StrLen aTextPosition, xub_StrLen aTextLength, const ::std::vector< double >& rDXArray, - const FontAttributes& rFontAttributes) const + const attribute::FontAttribute& rFontAttribute) const { // create the SimpleTextPrimitive needed in any case rTarget.push_back(Primitive2DReference( @@ -284,30 +74,24 @@ namespace drawinglayer aTextPosition, aTextLength, rDXArray, - rFontAttributes, + rFontAttribute, getLocale(), getFontColor()))); // see if something else needs to be done - const bool bOverlineUsed(FONT_UNDERLINE_NONE != getFontOverline()); - const bool bUnderlineUsed(FONT_UNDERLINE_NONE != getFontUnderline()); - const bool bStrikeoutUsed(FONT_STRIKEOUT_NONE != getFontStrikeout()); + const bool bOverlineUsed(TEXT_LINE_NONE != getFontOverline()); + const bool bUnderlineUsed(TEXT_LINE_NONE != getFontUnderline()); + const bool bStrikeoutUsed(TEXT_STRIKEOUT_NONE != getTextStrikeout()); if(bUnderlineUsed || bStrikeoutUsed || bOverlineUsed) { // common preparations - basegfx::B2DHomMatrix aUnscaledTransform; TextLayouterDevice aTextLayouter; - // unscaled is needed since scale contains already the font size - aUnscaledTransform.shearX(rDecTrans.getShearX()); - aUnscaledTransform.rotate(rDecTrans.getRotate()); - aUnscaledTransform.translate(rDecTrans.getTranslate().getX(), rDecTrans.getTranslate().getY()); - // TextLayouterDevice is needed to get metrics for text decorations like // underline/strikeout/emphasis marks from it. For setup, the font size is needed - aTextLayouter.setFontAttributes( - getFontAttributes(), + aTextLayouter.setFontAttribute( + getFontAttribute(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY(), getLocale()); @@ -335,115 +119,57 @@ namespace drawinglayer if(bOverlineUsed) { // create primitive geometry for overline - impCreateTextLine(rTarget, rDecTrans, aUnscaledTransform, getFontOverline(), aTextLayouter.getOverlineOffset(), - aTextLayouter.getOverlineHeight(), fTextWidth, getOverlineColor()); + rTarget.push_back(Primitive2DReference( + new TextLinePrimitive2D( + rDecTrans.getB2DHomMatrix(), + fTextWidth, + aTextLayouter.getOverlineOffset(), + aTextLayouter.getOverlineHeight(), + getFontOverline(), + getOverlineColor()))); } if(bUnderlineUsed) { // create primitive geometry for underline - impCreateTextLine(rTarget, rDecTrans, aUnscaledTransform, getFontUnderline(), aTextLayouter.getUnderlineOffset(), - aTextLayouter.getUnderlineHeight(), fTextWidth, getTextlineColor()); + rTarget.push_back(Primitive2DReference( + new TextLinePrimitive2D( + rDecTrans.getB2DHomMatrix(), + fTextWidth, + aTextLayouter.getUnderlineOffset(), + aTextLayouter.getUnderlineHeight(), + getFontUnderline(), + getTextlineColor()))); } if(bStrikeoutUsed) { // create primitive geometry for strikeout - if(FONT_STRIKEOUT_SLASH == getFontStrikeout() || FONT_STRIKEOUT_X == getFontStrikeout()) + if(TEXT_STRIKEOUT_SLASH == getTextStrikeout() || TEXT_STRIKEOUT_X == getTextStrikeout()) { // strikeout with character - const sal_Unicode aStrikeoutChar(FONT_STRIKEOUT_SLASH == getFontStrikeout() ? '/' : 'X'); - const String aSingleCharString(aStrikeoutChar); - const double fStrikeCharWidth(aTextLayouter.getTextWidth(aSingleCharString, 0, 1)); - const double fStrikeCharCount(fabs(fTextWidth/fStrikeCharWidth)); - const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.5)); - std::vector<double> aDXArray(nStrikeCharCount); - String aStrikeoutString; - - for(sal_uInt32 a(0); a < nStrikeCharCount; a++) - { - aStrikeoutString += aSingleCharString; - aDXArray[a] = (a + 1) * fStrikeCharWidth; - } + const sal_Unicode aStrikeoutChar(TEXT_STRIKEOUT_SLASH == getTextStrikeout() ? '/' : 'X'); rTarget.push_back(Primitive2DReference( - new TextSimplePortionPrimitive2D( + new TextCharacterStrikeoutPrimitive2D( rDecTrans.getB2DHomMatrix(), - aStrikeoutString, - 0, - aStrikeoutString.Len(), - aDXArray, - rFontAttributes, - getLocale(), - getFontColor()))); + fTextWidth, + getFontColor(), + aStrikeoutChar, + getFontAttribute(), + getLocale()))); } else { // strikeout with geometry - double fStrikeoutHeight(aTextLayouter.getUnderlineHeight()); - double fStrikeoutOffset(aTextLayouter.getStrikeoutOffset()); - bool bDoubleLine(false); - - // set line attribute - switch(getFontStrikeout()) - { - default : // case primitive2d::FONT_STRIKEOUT_SINGLE: - { - break; - } - case primitive2d::FONT_STRIKEOUT_DOUBLE: - { - bDoubleLine = true; - break; - } - case primitive2d::FONT_STRIKEOUT_BOLD: - { - fStrikeoutHeight *= 2.0; - break; - } - } - - if(bDoubleLine) - { - fStrikeoutOffset -= 0.50 * fStrikeoutHeight; - fStrikeoutHeight *= 0.64; - } - - // create base polygon and new primitive - basegfx::B2DPolygon aStrikeoutLine; - - aStrikeoutLine.append(basegfx::B2DPoint(0.0, -fStrikeoutOffset)); - aStrikeoutLine.append(basegfx::B2DPoint(fTextWidth, -fStrikeoutOffset)); - aStrikeoutLine.transform(aUnscaledTransform); - - const attribute::LineAttribute aLineAttribute(getFontColor(), fStrikeoutHeight, basegfx::B2DLINEJOIN_NONE); - Primitive2DReference aNewPrimitive(new PolygonStrokePrimitive2D(aStrikeoutLine, aLineAttribute)); - - // add primitive - rTarget.push_back(aNewPrimitive); - - if(bDoubleLine) - { - // double line, create 2nd primitive with offset using TransformPrimitive based on - // already created NewPrimitive - const double fLineDist(2.0 * fStrikeoutHeight); - basegfx::B2DHomMatrix aTransform; - - // move base point of text to 0.0 and de-rotate - aTransform.translate(-rDecTrans.getTranslate().getX(), -rDecTrans.getTranslate().getY()); - aTransform.rotate(-rDecTrans.getRotate()); - - // translate in Y by offset - aTransform.translate(0.0, -fLineDist); - - // move back and rotate - aTransform.rotate(rDecTrans.getRotate()); - aTransform.translate(rDecTrans.getTranslate().getX(), rDecTrans.getTranslate().getY()); - - // add transform primitive - const Primitive2DSequence aContent(&aNewPrimitive, 1); - rTarget.push_back(Primitive2DReference(new TransformPrimitive2D(aTransform, aContent))); - } + rTarget.push_back(Primitive2DReference( + new TextGeometryStrikeoutPrimitive2D( + rDecTrans.getB2DHomMatrix(), + fTextWidth, + getFontColor(), + aTextLayouter.getUnderlineHeight(), + aTextLayouter.getStrikeoutOffset(), + getTextStrikeout()))); } } } @@ -480,7 +206,7 @@ namespace drawinglayer void TextDecoratedPortionPrimitive2D::impSplitSingleWords( std::vector< Primitive2DReference >& rTarget, - basegfx::DecomposedB2DHomMatrixContainer& rDecTrans) const + basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans) const { // break iterator support // made static so it only needs to be fetched once, even with many single @@ -510,21 +236,21 @@ namespace drawinglayer impCorrectTextBoundary(aNextWordBoundary); // prepare new font attributes WITHOUT outline - const FontAttributes aNewFontAttributes( - getFontAttributes().getFamilyName(), - getFontAttributes().getStyleName(), - getFontAttributes().getWeight(), - getFontAttributes().getSymbol(), - getFontAttributes().getVertical(), - getFontAttributes().getItalic(), + const attribute::FontAttribute aNewFontAttribute( + getFontAttribute().getFamilyName(), + getFontAttribute().getStyleName(), + getFontAttribute().getWeight(), + getFontAttribute().getSymbol(), + getFontAttribute().getVertical(), + getFontAttribute().getItalic(), false, // no outline anymore, handled locally - getFontAttributes().getRTL(), - getFontAttributes().getBiDiStrong()); + getFontAttribute().getRTL(), + getFontAttribute().getBiDiStrong()); if(aNextWordBoundary.startPos == getTextPosition() && aNextWordBoundary.endPos == getTextLength()) { // it IS only a single word, handle as one word - impCreateGeometryContent(rTarget, rDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttributes); + impCreateGeometryContent(rTarget, rDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttribute); } else { @@ -535,8 +261,8 @@ namespace drawinglayer if(bNoDXArray) { // ..but only completely when no DXArray - aTextLayouter.setFontAttributes( - getFontAttributes(), + aTextLayouter.setFontAttribute( + getFontAttribute(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY(), getLocale()); @@ -612,10 +338,10 @@ namespace drawinglayer // create geometry content for the single word. Do not forget // to use the new transformation - basegfx::DecomposedB2DHomMatrixContainer aDecTrans(aNewTransform); + basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose aDecTrans(aNewTransform); impCreateGeometryContent(rTarget, aDecTrans, getText(), nNewTextStart, - nNewTextEnd - nNewTextStart, aNewDXArray, aNewFontAttributes); + nNewTextEnd - nNewTextStart, aNewDXArray, aNewFontAttribute); if(aNextWordBoundary.endPos >= getTextPosition() + getTextLength()) { @@ -646,10 +372,10 @@ namespace drawinglayer } } - Primitive2DSequence TextDecoratedPortionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence TextDecoratedPortionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { std::vector< Primitive2DReference > aNewPrimitives; - basegfx::DecomposedB2DHomMatrixContainer aDecTrans(getTextTransform()); + basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose aDecTrans(getTextTransform()); Primitive2DSequence aRetval; // create basic geometry such as SimpleTextPrimitive, Overline, Underline, @@ -662,19 +388,19 @@ namespace drawinglayer else { // prepare new font attributes WITHOUT outline - const FontAttributes aNewFontAttributes( - getFontAttributes().getFamilyName(), - getFontAttributes().getStyleName(), - getFontAttributes().getWeight(), - getFontAttributes().getSymbol(), - getFontAttributes().getVertical(), - getFontAttributes().getItalic(), + const attribute::FontAttribute aNewFontAttribute( + getFontAttribute().getFamilyName(), + getFontAttribute().getStyleName(), + getFontAttribute().getWeight(), + getFontAttribute().getSymbol(), + getFontAttribute().getVertical(), + getFontAttribute().getItalic(), false, // no outline anymore, handled locally - getFontAttributes().getRTL(), - getFontAttributes().getBiDiStrong()); + getFontAttribute().getRTL(), + getFontAttribute().getBiDiStrong()); // handle as one word - impCreateGeometryContent(aNewPrimitives, aDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttributes); + impCreateGeometryContent(aNewPrimitives, aDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttribute); } // convert to Primitive2DSequence @@ -690,15 +416,15 @@ namespace drawinglayer } } - // Handle Shadow, Outline and FontRelief + // Handle Shadow, Outline and TextRelief if(aRetval.hasElements()) { - // outline AND shadow depend on NO FontRelief (see dialog) - const bool bHasFontRelief(FONT_RELIEF_NONE != getFontRelief()); - const bool bHasShadow(!bHasFontRelief && getShadow()); - const bool bHasOutline(!bHasFontRelief && getFontAttributes().getOutline()); + // outline AND shadow depend on NO TextRelief (see dialog) + const bool bHasTextRelief(TEXT_RELIEF_NONE != getTextRelief()); + const bool bHasShadow(!bHasTextRelief && getShadow()); + const bool bHasOutline(!bHasTextRelief && getFontAttribute().getOutline()); - if(bHasShadow || bHasFontRelief || bHasOutline) + if(bHasShadow || bHasTextRelief || bHasOutline) { Primitive2DReference aShadow; @@ -713,8 +439,8 @@ namespace drawinglayer static basegfx::BColor aShadowColor(0.3, 0.3, 0.3); // preapare shadow transform matrix - basegfx::B2DHomMatrix aShadowTransform; - aShadowTransform.translate(fTextShadowOffset, fTextShadowOffset); + const basegfx::B2DHomMatrix aShadowTransform(basegfx::tools::createTranslateB2DHomMatrix( + fTextShadowOffset, fTextShadowOffset)); // create shadow primitive aShadow = Primitive2DReference(new ShadowPrimitive2D( @@ -723,7 +449,7 @@ namespace drawinglayer aRetval)); } - if(bHasFontRelief) + if(bHasTextRelief) { // create emboss using an own helper primitive since this will // be view-dependent @@ -733,7 +459,7 @@ namespace drawinglayer if(bDefaultTextColor) { - if(FONT_RELIEF_ENGRAVED == getFontRelief()) + if(TEXT_RELIEF_ENGRAVED == getTextRelief()) { aTextEffectStyle2D = TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED_DEFAULT; } @@ -744,7 +470,7 @@ namespace drawinglayer } else { - if(FONT_RELIEF_ENGRAVED == getFontRelief()) + if(TEXT_RELIEF_ENGRAVED == getTextRelief()) { aTextEffectStyle2D = TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED; } @@ -795,31 +521,31 @@ namespace drawinglayer xub_StrLen aTextPosition, xub_StrLen aTextLength, const ::std::vector< double >& rDXArray, - const FontAttributes& rFontAttributes, + const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale, const basegfx::BColor& rFontColor, // local parameters const basegfx::BColor& rOverlineColor, const basegfx::BColor& rTextlineColor, - FontUnderline eFontOverline, - FontUnderline eFontUnderline, + TextLine eFontOverline, + TextLine eFontUnderline, bool bUnderlineAbove, - FontStrikeout eFontStrikeout, + TextStrikeout eTextStrikeout, bool bWordLineMode, - FontEmphasisMark eFontEmphasisMark, + TextEmphasisMark eTextEmphasisMark, bool bEmphasisMarkAbove, bool bEmphasisMarkBelow, - FontRelief eFontRelief, + TextRelief eTextRelief, bool bShadow) - : TextSimplePortionPrimitive2D(rNewTransform, rText, aTextPosition, aTextLength, rDXArray, rFontAttributes, rLocale, rFontColor), + : TextSimplePortionPrimitive2D(rNewTransform, rText, aTextPosition, aTextLength, rDXArray, rFontAttribute, rLocale, rFontColor), maOverlineColor(rOverlineColor), maTextlineColor(rTextlineColor), meFontOverline(eFontOverline), meFontUnderline(eFontUnderline), - meFontStrikeout(eFontStrikeout), - meFontEmphasisMark(eFontEmphasisMark), - meFontRelief(eFontRelief), + meTextStrikeout(eTextStrikeout), + meTextEmphasisMark(eTextEmphasisMark), + meTextRelief(eTextRelief), mbUnderlineAbove(bUnderlineAbove), mbWordLineMode(bWordLineMode), mbEmphasisMarkAbove(bEmphasisMarkAbove), @@ -838,9 +564,9 @@ namespace drawinglayer && getTextlineColor() == rCompare.getTextlineColor() && getFontOverline() == rCompare.getFontOverline() && getFontUnderline() == rCompare.getFontUnderline() - && getFontStrikeout() == rCompare.getFontStrikeout() - && getFontEmphasisMark() == rCompare.getFontEmphasisMark() - && getFontRelief() == rCompare.getFontRelief() + && getTextStrikeout() == rCompare.getTextStrikeout() + && getTextEmphasisMark() == rCompare.getTextEmphasisMark() + && getTextRelief() == rCompare.getTextRelief() && getUnderlineAbove() == rCompare.getUnderlineAbove() && getWordLineMode() == rCompare.getWordLineMode() && getEmphasisMarkAbove() == rCompare.getEmphasisMarkAbove() @@ -857,19 +583,19 @@ namespace drawinglayer basegfx::B2DRange TextDecoratedPortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const { const bool bDecoratedIsNeeded( - FONT_UNDERLINE_NONE != getFontOverline() - || FONT_UNDERLINE_NONE != getFontUnderline() - || FONT_STRIKEOUT_NONE != getFontStrikeout() - || FONT_EMPHASISMARK_NONE != getFontEmphasisMark() - || FONT_RELIEF_NONE != getFontRelief() + TEXT_LINE_NONE != getFontOverline() + || TEXT_LINE_NONE != getFontUnderline() + || TEXT_STRIKEOUT_NONE != getTextStrikeout() + || TEXT_EMPHASISMARK_NONE != getTextEmphasisMark() + || TEXT_RELIEF_NONE != getTextRelief() || getShadow()); if(bDecoratedIsNeeded) { - // decoration is used, fallback to BasePrimitive2D::getB2DRange which uses + // decoration is used, fallback to BufferedDecompositionPrimitive2D::getB2DRange which uses // the own local decomposition for computation and thus creates all necessary // geometric objects - return BasePrimitive2D::getB2DRange(rViewInformation); + return BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation); } else { diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx index c1963f4ba2a4..5e98a9d6d34b 100644 --- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx @@ -41,6 +41,7 @@ #include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx> #include <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -50,7 +51,7 @@ namespace drawinglayer { static double fDiscreteSize(1.1); - Primitive2DSequence TextEffectPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence TextEffectPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence aRetval; @@ -68,13 +69,12 @@ namespace drawinglayer case TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED_DEFAULT: { // prepare transform of sub-group back to (0,0) and align to X-Axis - basegfx::B2DHomMatrix aBackTransform; - aBackTransform.translate(-getRotationCenter().getX(), -getRotationCenter().getY()); + basegfx::B2DHomMatrix aBackTransform(basegfx::tools::createTranslateB2DHomMatrix( + -getRotationCenter().getX(), -getRotationCenter().getY())); aBackTransform.rotate(-getDirection()); // prepare transform of sub-group back to it's position and rotation - basegfx::B2DHomMatrix aForwardTransform; - aForwardTransform.rotate(getDirection()); + basegfx::B2DHomMatrix aForwardTransform(basegfx::tools::createRotateB2DHomMatrix(getDirection())); aForwardTransform.translate(getRotationCenter().getX(), getRotationCenter().getY()); // create transformation for one discrete unit @@ -104,22 +104,22 @@ namespace drawinglayer { // emboss/engrave in black, original forced to white const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.0)); - const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToGray)); + const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray)); aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1))); // add original, too const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0)); - aRetval[1] = Primitive2DReference(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToWhite)); + aRetval[1] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite)); } else { // emboss/engrave in gray, keep original's color const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.75)); // 192 - const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToGray)); + const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray)); aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1))); // add original, too - aRetval[1] = Primitive2DReference(new GroupPrimitive2D(getChildren())); + aRetval[1] = Primitive2DReference(new GroupPrimitive2D(getTextContent())); } break; @@ -132,39 +132,39 @@ namespace drawinglayer aTransform.set(0, 2, aDistance.getX()); aTransform.set(1, 2, 0.0); - aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); aTransform.set(0, 2, aDiagonalDistance.getX()); aTransform.set(1, 2, aDiagonalDistance.getY()); - aRetval[1] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[1] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); aTransform.set(0, 2, 0.0); aTransform.set(1, 2, aDistance.getY()); - aRetval[2] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[2] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); aTransform.set(0, 2, -aDiagonalDistance.getX()); aTransform.set(1, 2, aDiagonalDistance.getY()); - aRetval[3] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[3] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); aTransform.set(0, 2, -aDistance.getX()); aTransform.set(1, 2, 0.0); - aRetval[4] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[4] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); aTransform.set(0, 2, -aDiagonalDistance.getX()); aTransform.set(1, 2, -aDiagonalDistance.getY()); - aRetval[5] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[5] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); aTransform.set(0, 2, 0.0); aTransform.set(1, 2, -aDistance.getY()); - aRetval[6] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[6] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); aTransform.set(0, 2, aDiagonalDistance.getX()); aTransform.set(1, 2, -aDiagonalDistance.getY()); - aRetval[7] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren())); + aRetval[7] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent())); // at last, place original over it, but force to white const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0, 1.0, 1.0)); - aRetval[8] = Primitive2DReference(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToWhite)); + aRetval[8] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite)); break; } @@ -174,11 +174,12 @@ namespace drawinglayer } TextEffectPrimitive2D::TextEffectPrimitive2D( - const Primitive2DSequence& rChildren, + const Primitive2DSequence& rTextContent, const basegfx::B2DPoint& rRotationCenter, double fDirection, TextEffectStyle2D eTextEffectStyle2D) - : GroupPrimitive2D(rChildren), + : BufferedDecompositionPrimitive2D(), + maTextContent(rTextContent), maRotationCenter(rRotationCenter), mfDirection(fDirection), meTextEffectStyle2D(eTextEffectStyle2D) @@ -187,11 +188,12 @@ namespace drawinglayer bool TextEffectPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(GroupPrimitive2D::operator==(rPrimitive)) + if(BasePrimitive2D::operator==(rPrimitive)) { const TextEffectPrimitive2D& rCompare = (TextEffectPrimitive2D&)rPrimitive; - return (getRotationCenter() == rCompare.getRotationCenter() + return (getTextContent() == rCompare.getTextContent() + && getRotationCenter() == rCompare.getRotationCenter() && getDirection() == rCompare.getDirection() && getTextEffectStyle2D() == rCompare.getTextEffectStyle2D()); } @@ -206,7 +208,7 @@ namespace drawinglayer // then will ask 9 times at nearly the same content. This may even be refined here using the // TextEffectStyle information, e.g. for TEXTEFFECTSTYLE2D_RELIEF the grow needs only to // be in two directions - basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation)); + basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getTextContent(), rViewInformation)); aRetval.grow(fDiscreteSize); return aRetval; @@ -216,23 +218,23 @@ namespace drawinglayer { ::osl::MutexGuard aGuard( m_aMutex ); - if(getLocalDecomposition().hasElements()) + if(getBuffered2DDecomposition().hasElements()) { if(maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation()) { // conditions of last local decomposition have changed, delete - const_cast< TextEffectPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< TextEffectPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { // remember ViewRange and ViewTransformation const_cast< TextEffectPrimitive2D* >(this)->maLastObjectToViewTransformation = rViewInformation.getObjectToViewTransformation(); } // use parent implementation - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx b/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx new file mode 100644 index 000000000000..8b24668cb056 --- /dev/null +++ b/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: textprimitive2d.cxx,v $ + * + * $Revision: 1.22 $ + * + * 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. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle) + { + switch(eLineStyle) + { + case UNDERLINE_SINGLE: return TEXT_LINE_SINGLE; + case UNDERLINE_DOUBLE: return TEXT_LINE_DOUBLE; + case UNDERLINE_DOTTED: return TEXT_LINE_DOTTED; + case UNDERLINE_DASH: return TEXT_LINE_DASH; + case UNDERLINE_LONGDASH: return TEXT_LINE_LONGDASH; + case UNDERLINE_DASHDOT: return TEXT_LINE_DASHDOT; + case UNDERLINE_DASHDOTDOT: return TEXT_LINE_DASHDOTDOT; + case UNDERLINE_SMALLWAVE: return TEXT_LINE_SMALLWAVE; + case UNDERLINE_WAVE: return TEXT_LINE_WAVE; + case UNDERLINE_DOUBLEWAVE: return TEXT_LINE_DOUBLEWAVE; + case UNDERLINE_BOLD: return TEXT_LINE_BOLD; + case UNDERLINE_BOLDDOTTED: return TEXT_LINE_BOLDDOTTED; + case UNDERLINE_BOLDDASH: return TEXT_LINE_BOLDDASH; + case UNDERLINE_BOLDLONGDASH: return TEXT_LINE_BOLDLONGDASH; + case UNDERLINE_BOLDDASHDOT: return TEXT_LINE_BOLDDASHDOT; + case UNDERLINE_BOLDDASHDOTDOT: return TEXT_LINE_BOLDDASHDOTDOT; + case UNDERLINE_BOLDWAVE: return TEXT_LINE_BOLDWAVE; + // FontUnderline_FORCE_EQUAL_SIZE, UNDERLINE_DONTKNOW, UNDERLINE_NONE + default: return TEXT_LINE_NONE; + } + } + + FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle) + { + switch(eLineStyle) + { + default: /*TEXT_LINE_NONE*/ return UNDERLINE_NONE; + case TEXT_LINE_SINGLE: return UNDERLINE_SINGLE; + case TEXT_LINE_DOUBLE: return UNDERLINE_DOUBLE; + case TEXT_LINE_DOTTED: return UNDERLINE_DOTTED; + case TEXT_LINE_DASH: return UNDERLINE_DASH; + case TEXT_LINE_LONGDASH: return UNDERLINE_LONGDASH; + case TEXT_LINE_DASHDOT: return UNDERLINE_DASHDOT; + case TEXT_LINE_DASHDOTDOT: return UNDERLINE_DASHDOTDOT; + case TEXT_LINE_SMALLWAVE: return UNDERLINE_SMALLWAVE; + case TEXT_LINE_WAVE: return UNDERLINE_WAVE; + case TEXT_LINE_DOUBLEWAVE: return UNDERLINE_DOUBLEWAVE; + case TEXT_LINE_BOLD: return UNDERLINE_BOLD; + case TEXT_LINE_BOLDDOTTED: return UNDERLINE_BOLDDOTTED; + case TEXT_LINE_BOLDDASH: return UNDERLINE_BOLDDASH; + case TEXT_LINE_BOLDLONGDASH: return UNDERLINE_LONGDASH; + case TEXT_LINE_BOLDDASHDOT: return UNDERLINE_BOLDDASHDOT; + case TEXT_LINE_BOLDDASHDOTDOT:return UNDERLINE_BOLDDASHDOT; + case TEXT_LINE_BOLDWAVE: return UNDERLINE_BOLDWAVE; + } + } + + TextStrikeout mapFontStrikeoutToTextStrikeout(FontStrikeout eFontStrikeout) + { + switch(eFontStrikeout) + { + case STRIKEOUT_SINGLE: return TEXT_STRIKEOUT_SINGLE; + case STRIKEOUT_DOUBLE: return TEXT_STRIKEOUT_DOUBLE; + case STRIKEOUT_BOLD: return TEXT_STRIKEOUT_BOLD; + case STRIKEOUT_SLASH: return TEXT_STRIKEOUT_SLASH; + case STRIKEOUT_X: return TEXT_STRIKEOUT_X; + // FontStrikeout_FORCE_EQUAL_SIZE, STRIKEOUT_NONE, STRIKEOUT_DONTKNOW + default: return TEXT_STRIKEOUT_NONE; + } + } + + FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eTextStrikeout) + { + switch(eTextStrikeout) + { + default: /*case primitive2d::TEXT_STRIKEOUT_NONE*/ return STRIKEOUT_NONE; + case TEXT_STRIKEOUT_SINGLE: return STRIKEOUT_SINGLE; + case TEXT_STRIKEOUT_DOUBLE: return STRIKEOUT_DOUBLE; + case TEXT_STRIKEOUT_BOLD: return STRIKEOUT_BOLD; + case TEXT_STRIKEOUT_SLASH: return STRIKEOUT_SLASH; + case TEXT_STRIKEOUT_X: return STRIKEOUT_X; + } + } + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index e321783c8406..2950427d6b57 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -167,14 +167,14 @@ namespace drawinglayer mrDevice.SetFont( rFont ); } - void TextLayouterDevice::setFontAttributes( - const FontAttributes& rFontAttributes, + void TextLayouterDevice::setFontAttribute( + const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY, const ::com::sun::star::lang::Locale& rLocale) { - setFont(getVclFontFromFontAttributes( - rFontAttributes, + setFont(getVclFontFromFontAttribute( + rFontAttribute, fFontScaleX, fFontScaleY, 0.0, @@ -297,6 +297,28 @@ namespace drawinglayer return basegfx::B2DRange(); } + + double TextLayouterDevice::getFontAscent() const + { + const ::FontMetric& rMetric = mrDevice.GetFontMetric(); + return rMetric.GetAscent(); + } + + double TextLayouterDevice::getFontDescent() const + { + const ::FontMetric& rMetric = mrDevice.GetFontMetric(); + return rMetric.GetDescent(); + } + + void TextLayouterDevice::addTextRectActions( + const Rectangle& rRectangle, + const String& rText, + sal_uInt16 nStyle, + GDIMetaFile& rGDIMetaFile) + { + mrDevice.AddTextRectActions( + rRectangle, rText, nStyle, rGDIMetaFile); + } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -307,8 +329,8 @@ namespace drawinglayer { namespace primitive2d { - Font getVclFontFromFontAttributes( - const FontAttributes& rFontAttributes, + Font getVclFontFromFontAttribute( + const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY, double fFontRotation, @@ -324,8 +346,8 @@ namespace drawinglayer // is wanted, that width needs to be adapted using FontMetric again to get a // width of the unscaled font Font aRetval( - rFontAttributes.getFamilyName(), - rFontAttributes.getStyleName(), + rFontAttribute.getFamilyName(), + rFontAttribute.getStyleName(), Size(0, nHeight)); #else // for non-WIN32 systems things are easier since these accept a Font creation @@ -334,17 +356,17 @@ namespace drawinglayer // Font would be recorded in a MetaFile (The MetaFile FontAction WILL record a // set FontWidth; import that in a WIN32 system, and trouble is there) Font aRetval( - rFontAttributes.getFamilyName(), - rFontAttributes.getStyleName(), + rFontAttribute.getFamilyName(), + rFontAttribute.getStyleName(), Size(bFontIsScaled ? nWidth : 0, nHeight)); #endif - // define various other FontAttributes + // define various other FontAttribute aRetval.SetAlign(ALIGN_BASELINE); - aRetval.SetCharSet(rFontAttributes.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE); - aRetval.SetVertical(rFontAttributes.getVertical() ? TRUE : FALSE); - aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.getWeight())); - aRetval.SetItalic(rFontAttributes.getItalic() ? ITALIC_NORMAL : ITALIC_NONE); - aRetval.SetOutline(rFontAttributes.getOutline()); + aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE); + aRetval.SetVertical(rFontAttribute.getVertical() ? TRUE : FALSE); + aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight())); + aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE); + aRetval.SetOutline(rFontAttribute.getOutline()); aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale)); #ifdef WIN32 @@ -371,13 +393,13 @@ namespace drawinglayer return aRetval; } - FontAttributes getFontAttributesFromVclFont( + attribute::FontAttribute getFontAttributeFromVclFont( basegfx::B2DVector& o_rSize, const Font& rFont, bool bRTL, bool bBiDiStrong) { - const FontAttributes aRetval( + const attribute::FontAttribute aRetval( rFont.GetName(), rFont.GetStyleName(), static_cast<sal_uInt16>(rFont.GetWeight()), diff --git a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx new file mode 100644 index 000000000000..45b2809be2ce --- /dev/null +++ b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx @@ -0,0 +1,317 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: textdecoratedprimitive2d.cxx,v $ + * + * $Revision: 1.12 $ + * + * 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. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive2d/textlineprimitive2d.hxx> +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <drawinglayer/attribute/strokeattribute.hxx> +#include <drawinglayer/attribute/lineattribute.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <drawinglayer/primitive2d/transformprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence TextLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence xRetval; + + if(TEXT_LINE_NONE != getTextLine()) + { + bool bDoubleLine(false); + bool bWaveLine(false); + bool bBoldLine(false); + const int* pDotDashArray(0); + basegfx::B2DLineJoin eLineJoin(basegfx::B2DLINEJOIN_NONE); + double fOffset(getOffset()); + double fHeight(getHeight()); + + static const int aDottedArray[] = { 1, 1, 0}; // DOTTED LINE + static const int aDotDashArray[] = { 1, 1, 4, 1, 0}; // DASHDOT + static const int aDashDotDotArray[] = { 1, 1, 1, 1, 4, 1, 0}; // DASHDOTDOT + static const int aDashedArray[] = { 5, 2, 0}; // DASHED LINE + static const int aLongDashArray[] = { 7, 2, 0}; // LONGDASH + + // get decomposition + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX); + + switch(getTextLine()) + { + default: // case TEXT_LINE_SINGLE: + { + break; + } + case TEXT_LINE_DOUBLE: + { + bDoubleLine = true; + break; + } + case TEXT_LINE_DOTTED: + { + pDotDashArray = aDottedArray; + break; + } + case TEXT_LINE_DASH: + { + pDotDashArray = aDashedArray; + break; + } + case TEXT_LINE_LONGDASH: + { + pDotDashArray = aLongDashArray; + break; + } + case TEXT_LINE_DASHDOT: + { + pDotDashArray = aDotDashArray; + break; + } + case TEXT_LINE_DASHDOTDOT: + { + pDotDashArray = aDashDotDotArray; + break; + } + case TEXT_LINE_SMALLWAVE: + { + bWaveLine = true; + break; + } + case TEXT_LINE_WAVE: + { + bWaveLine = true; + break; + } + case TEXT_LINE_DOUBLEWAVE: + { + bDoubleLine = true; + bWaveLine = true; + break; + } + case TEXT_LINE_BOLD: + { + bBoldLine = true; + break; + } + case TEXT_LINE_BOLDDOTTED: + { + bBoldLine = true; + pDotDashArray = aDottedArray; + break; + } + case TEXT_LINE_BOLDDASH: + { + bBoldLine = true; + pDotDashArray = aDashedArray; + break; + } + case TEXT_LINE_BOLDLONGDASH: + { + bBoldLine = true; + pDotDashArray = aLongDashArray; + break; + } + case TEXT_LINE_BOLDDASHDOT: + { + bBoldLine = true; + pDotDashArray = aDotDashArray; + break; + } + case TEXT_LINE_BOLDDASHDOTDOT: + { + bBoldLine = true; + pDotDashArray = aDashDotDotArray; + break; + } + case TEXT_LINE_BOLDWAVE: + { + bWaveLine = true; + bBoldLine = true; + break; + } + } + + if(bBoldLine) + { + fHeight *= 2.0; + } + + if(bDoubleLine) + { + fOffset -= 0.50 * fHeight; + fHeight *= 0.64; + } + + if(bWaveLine) + { + eLineJoin = basegfx::B2DLINEJOIN_ROUND; + fHeight *= 0.25; + } + + // prepare Line and Stroke Attributes + const attribute::LineAttribute aLineAttribute(getLineColor(), fHeight, eLineJoin); + attribute::StrokeAttribute aStrokeAttribute; + + if(pDotDashArray) + { + ::std::vector< double > aDoubleArray; + + for(const int* p = pDotDashArray; *p; ++p) + { + aDoubleArray.push_back((double)(*p) * fHeight); + } + + aStrokeAttribute = attribute::StrokeAttribute(aDoubleArray); + } + + // create base polygon and new primitive + basegfx::B2DPolygon aLine; + Primitive2DReference aNewPrimitive; + + aLine.append(basegfx::B2DPoint(0.0, fOffset)); + aLine.append(basegfx::B2DPoint(getWidth(), fOffset)); + + const basegfx::B2DHomMatrix aUnscaledTransform( + basegfx::tools::createShearXRotateTranslateB2DHomMatrix( + fShearX, fRotate, aTranslate)); + + aLine.transform(aUnscaledTransform); + + if(bWaveLine) + { + double fWaveWidth(10.6 * fHeight); + + if(TEXT_LINE_SMALLWAVE == getTextLine()) + { + fWaveWidth *= 0.7; + } + else if(TEXT_LINE_WAVE == getTextLine()) + { + // extra multiply to get the same WaveWidth as with the bold version + fWaveWidth *= 2.0; + } + + aNewPrimitive = Primitive2DReference(new PolygonWavePrimitive2D(aLine, aLineAttribute, aStrokeAttribute, fWaveWidth, fWaveWidth * 0.5)); + } + else + { + aNewPrimitive = Primitive2DReference(new PolygonStrokePrimitive2D(aLine, aLineAttribute, aStrokeAttribute)); + } + + // add primitive + appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, aNewPrimitive); + + if(bDoubleLine) + { + // double line, create 2nd primitive with offset using TransformPrimitive based on + // already created NewPrimitive + double fLineDist(2.3 * fHeight); + + if(bWaveLine) + { + fLineDist = 6.3 * fHeight; + } + + // move base point of text to 0.0 and de-rotate + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aTranslate.getX(), -aTranslate.getY())); + aTransform.rotate(-fRotate); + + // translate in Y by offset + aTransform.translate(0.0, fLineDist); + + // move back and rotate + aTransform.rotate(fRotate); + aTransform.translate(aTranslate.getX(), aTranslate.getY()); + + // add transform primitive + const Primitive2DSequence aContent(&aNewPrimitive, 1); + appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, + Primitive2DReference(new TransformPrimitive2D(aTransform, aContent))); + } + } + + return xRetval; + } + + TextLinePrimitive2D::TextLinePrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + double fOffset, + double fHeight, + TextLine eTextLine, + const basegfx::BColor& rLineColor) + : BufferedDecompositionPrimitive2D(), + maObjectTransformation(rObjectTransformation), + mfWidth(fWidth), + mfOffset(fOffset), + mfHeight(fHeight), + meTextLine(eTextLine), + maLineColor(rLineColor) + { + } + + bool TextLinePrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) + { + const TextLinePrimitive2D& rCompare = (TextLinePrimitive2D&)rPrimitive; + + return (getObjectTransformation() == rCompare.getObjectTransformation() + && getWidth() == rCompare.getWidth() + && getOffset() == rCompare.getOffset() + && getHeight() == rCompare.getHeight() + && getTextLine() == rCompare.getTextLine() + && getLineColor() == rCompare.getLineColor()); + } + + return false; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(TextLinePrimitive2D, PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index f8e413da0e8c..61a0c6d15897 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -42,6 +42,7 @@ #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> #include <drawinglayer/primitive2d/texteffectprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -49,27 +50,6 @@ using namespace com::sun::star; ////////////////////////////////////////////////////////////////////////////// -namespace drawinglayer -{ - namespace primitive2d - { - bool FontAttributes::operator==(const FontAttributes& rCompare) const - { - return (getFamilyName() == rCompare.getFamilyName() - && getStyleName() == rCompare.getStyleName() - && getWeight() == rCompare.getWeight() - && getSymbol() == rCompare.getSymbol() - && getVertical() == rCompare.getVertical() - && getItalic() == rCompare.getItalic() - && getOutline() == rCompare.getOutline() - && getRTL() == rCompare.getRTL() - && getBiDiStrong() == rCompare.getBiDiStrong()); - } - } // end of namespace primitive2d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - namespace { // adapts fontScale for usage with TextLayouter. Input is rScale which is the extracted @@ -155,8 +135,8 @@ namespace drawinglayer // prepare textlayoutdevice TextLayouterDevice aTextLayouter; - aTextLayouter.setFontAttributes( - getFontAttributes(), + aTextLayouter.setFontAttribute( + getFontAttribute(), aFontScale.getX(), aFontScale.getY(), getLocale()); @@ -199,17 +179,14 @@ namespace drawinglayer if(nCount) { // prepare object transformation for polygons - rTransformation.identity(); - rTransformation.scale(aScale.getX(), aScale.getY()); - rTransformation.shearX(fShearX); - rTransformation.rotate(fRotate); - rTransformation.translate(aTranslate.getX(), aTranslate.getY()); + rTransformation = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale, fShearX, fRotate, aTranslate); } } } } - Primitive2DSequence TextSimplePortionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence TextSimplePortionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence aRetval; @@ -238,7 +215,7 @@ namespace drawinglayer aRetval[a] = new PolyPolygonColorPrimitive2D(rPolyPolygon, getFontColor()); } - if(getFontAttributes().getOutline()) + if(getFontAttribute().getOutline()) { // decompose polygon transformation to single values basegfx::B2DVector aScale, aTranslate; @@ -266,16 +243,16 @@ namespace drawinglayer xub_StrLen aTextPosition, xub_StrLen aTextLength, const ::std::vector< double >& rDXArray, - const FontAttributes& rFontAttributes, + const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale, const basegfx::BColor& rFontColor) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTextTransform(rNewTransform), maText(rText), maTextPosition(aTextPosition), maTextLength(aTextLength), maDXArray(rDXArray), - maFontAttributes(rFontAttributes), + maFontAttribute(rFontAttribute), maLocale(rLocale), maFontColor(rFontColor), maB2DRange() @@ -287,7 +264,7 @@ namespace drawinglayer #endif } - bool impLocalesAreEqual(const ::com::sun::star::lang::Locale& rA, const ::com::sun::star::lang::Locale& rB) + bool LocalesAreEqual(const ::com::sun::star::lang::Locale& rA, const ::com::sun::star::lang::Locale& rB) { return (rA.Language == rB.Language && rA.Country == rB.Country @@ -296,7 +273,7 @@ namespace drawinglayer bool TextSimplePortionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const TextSimplePortionPrimitive2D& rCompare = (TextSimplePortionPrimitive2D&)rPrimitive; @@ -305,8 +282,8 @@ namespace drawinglayer && getTextPosition() == rCompare.getTextPosition() && getTextLength() == rCompare.getTextLength() && getDXArray() == rCompare.getDXArray() - && getFontAttributes() == rCompare.getFontAttributes() - && impLocalesAreEqual(getLocale(), rCompare.getLocale()) + && getFontAttribute() == rCompare.getFontAttribute() + && LocalesAreEqual(getLocale(), rCompare.getLocale()) && getFontColor() == rCompare.getFontColor()); } @@ -332,8 +309,8 @@ namespace drawinglayer // prepare textlayoutdevice TextLayouterDevice aTextLayouter; - aTextLayouter.setFontAttributes( - getFontAttributes(), + aTextLayouter.setFontAttribute( + getFontAttribute(), aFontScale.getX(), aFontScale.getY(), getLocale()); @@ -345,12 +322,8 @@ namespace drawinglayer if(!aNewRange.isEmpty()) { // prepare object transformation for range - basegfx::B2DHomMatrix aRangeTransformation; - - aRangeTransformation.scale(aScale.getX(), aScale.getY()); - aRangeTransformation.shearX(fShearX); - aRangeTransformation.rotate(fRotate); - aRangeTransformation.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aRangeTransformation(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale, fShearX, fRotate, aTranslate)); // apply range transformation to it aNewRange.transform(aRangeTransformation); diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx new file mode 100644 index 000000000000..936c690d8af5 --- /dev/null +++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx @@ -0,0 +1,294 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: textdecoratedprimitive2d.cxx,v $ + * + * $Revision: 1.12 $ + * + * 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. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx> +#include <drawinglayer/primitive2d/textlayoutdevice.hxx> +#include <drawinglayer/primitive2d/textprimitive2d.hxx> +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <drawinglayer/attribute/lineattribute.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <drawinglayer/primitive2d/transformprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + BaseTextStrikeoutPrimitive2D::BaseTextStrikeoutPrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + const basegfx::BColor& rFontColor) + : BufferedDecompositionPrimitive2D(), + maObjectTransformation(rObjectTransformation), + mfWidth(fWidth), + maFontColor(rFontColor) + { + } + + bool BaseTextStrikeoutPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) + { + const BaseTextStrikeoutPrimitive2D& rCompare = (BaseTextStrikeoutPrimitive2D&)rPrimitive; + + return (getObjectTransformation() == rCompare.getObjectTransformation() + && getWidth() == rCompare.getWidth() + && getFontColor() == rCompare.getFontColor()); + } + + return false; + } + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence TextCharacterStrikeoutPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + // strikeout with character + const String aSingleCharString(getStrikeoutChar()); + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + + // get decomposition + getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX); + + // prepare TextLayouter + TextLayouterDevice aTextLayouter; + + aTextLayouter.setFontAttribute( + getFontAttribute(), + aScale.getX(), + aScale.getY(), + getLocale()); + + const double fStrikeCharWidth(aTextLayouter.getTextWidth(aSingleCharString, 0, 1)); + const double fStrikeCharCount(fabs(getWidth()/fStrikeCharWidth)); + const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.5)); + std::vector<double> aDXArray(nStrikeCharCount); + String aStrikeoutString; + + for(sal_uInt32 a(0); a < nStrikeCharCount; a++) + { + aStrikeoutString += aSingleCharString; + aDXArray[a] = (a + 1) * fStrikeCharWidth; + } + + Primitive2DReference xReference( + new TextSimplePortionPrimitive2D( + getObjectTransformation(), + aStrikeoutString, + 0, + aStrikeoutString.Len(), + aDXArray, + getFontAttribute(), + getLocale(), + getFontColor())); + + return Primitive2DSequence(&xReference, 1); + } + + TextCharacterStrikeoutPrimitive2D::TextCharacterStrikeoutPrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + const basegfx::BColor& rFontColor, + sal_Unicode aStrikeoutChar, + const attribute::FontAttribute& rFontAttribute, + const ::com::sun::star::lang::Locale& rLocale) + : BaseTextStrikeoutPrimitive2D(rObjectTransformation, fWidth, rFontColor), + maStrikeoutChar(aStrikeoutChar), + maFontAttribute(rFontAttribute), + maLocale(rLocale) + { + } + + bool TextCharacterStrikeoutPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(BaseTextStrikeoutPrimitive2D::operator==(rPrimitive)) + { + const TextCharacterStrikeoutPrimitive2D& rCompare = (TextCharacterStrikeoutPrimitive2D&)rPrimitive; + + return (getStrikeoutChar() == rCompare.getStrikeoutChar() + && getFontAttribute() == rCompare.getFontAttribute() + && LocalesAreEqual(getLocale(), rCompare.getLocale())); + } + + return false; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(TextCharacterStrikeoutPrimitive2D, PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence TextGeometryStrikeoutPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + OSL_ENSURE(TEXT_STRIKEOUT_SLASH != getTextStrikeout() && TEXT_STRIKEOUT_X != getTextStrikeout(), + "Wrong TEXT_STRIKEOUT type; a TextCharacterStrikeoutPrimitive2D should be used (!)"); + + // strikeout with geometry + double fStrikeoutHeight(getHeight()); + double fStrikeoutOffset(getOffset()); + bool bDoubleLine(false); + + // get decomposition + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX); + + // set line attribute + switch(getTextStrikeout()) + { + default : // case primitive2d::TEXT_STRIKEOUT_SINGLE: + { + break; + } + case primitive2d::TEXT_STRIKEOUT_DOUBLE: + { + bDoubleLine = true; + break; + } + case primitive2d::TEXT_STRIKEOUT_BOLD: + { + fStrikeoutHeight *= 2.0; + break; + } + } + + if(bDoubleLine) + { + fStrikeoutOffset -= 0.50 * fStrikeoutHeight; + fStrikeoutHeight *= 0.64; + } + + // create base polygon and new primitive + basegfx::B2DPolygon aStrikeoutLine; + + aStrikeoutLine.append(basegfx::B2DPoint(0.0, -fStrikeoutOffset)); + aStrikeoutLine.append(basegfx::B2DPoint(getWidth(), -fStrikeoutOffset)); + + const basegfx::B2DHomMatrix aUnscaledTransform( + basegfx::tools::createShearXRotateTranslateB2DHomMatrix( + fShearX, fRotate, aTranslate)); + + aStrikeoutLine.transform(aUnscaledTransform); + + // add primitive + const attribute::LineAttribute aLineAttribute(getFontColor(), fStrikeoutHeight, basegfx::B2DLINEJOIN_NONE); + Primitive2DSequence xRetval(1); + xRetval[0] = Primitive2DReference(new PolygonStrokePrimitive2D(aStrikeoutLine, aLineAttribute)); + + if(bDoubleLine) + { + // double line, create 2nd primitive with offset using TransformPrimitive based on + // already created NewPrimitive + const double fLineDist(2.0 * fStrikeoutHeight); + + // move base point of text to 0.0 and de-rotate + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aTranslate.getX(), -aTranslate.getY())); + aTransform.rotate(-fRotate); + + // translate in Y by offset + aTransform.translate(0.0, -fLineDist); + + // move back and rotate + aTransform.rotate(fRotate); + aTransform.translate(aTranslate.getX(), aTranslate.getY()); + + // add transform primitive + appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, + Primitive2DReference( + new TransformPrimitive2D( + aTransform, + xRetval))); + } + + return xRetval; + } + + TextGeometryStrikeoutPrimitive2D::TextGeometryStrikeoutPrimitive2D( + const basegfx::B2DHomMatrix& rObjectTransformation, + double fWidth, + const basegfx::BColor& rFontColor, + double fHeight, + double fOffset, + TextStrikeout eTextStrikeout) + : BaseTextStrikeoutPrimitive2D(rObjectTransformation, fWidth, rFontColor), + mfHeight(fHeight), + mfOffset(fOffset), + meTextStrikeout(eTextStrikeout) + { + } + + bool TextGeometryStrikeoutPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(BaseTextStrikeoutPrimitive2D::operator==(rPrimitive)) + { + const TextGeometryStrikeoutPrimitive2D& rCompare = (TextGeometryStrikeoutPrimitive2D&)rPrimitive; + + return (getHeight() == rCompare.getHeight() + && getOffset() == rCompare.getOffset() + && getTextStrikeout() == rCompare.getTextStrikeout()); + } + + return false; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(TextGeometryStrikeoutPrimitive2D, PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx index 49039e1a6e5c..a66ac0f3a539 100644 --- a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx @@ -55,7 +55,27 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence UnifiedAlphaPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + UnifiedAlphaPrimitive2D::UnifiedAlphaPrimitive2D( + const Primitive2DSequence& rChildren, + double fAlpha) + : GroupPrimitive2D(rChildren), + mfAlpha(fAlpha) + { + } + + bool UnifiedAlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(GroupPrimitive2D::operator==(rPrimitive)) + { + const UnifiedAlphaPrimitive2D& rCompare = (UnifiedAlphaPrimitive2D&)rPrimitive; + + return (getAlpha() == rCompare.getAlpha()); + } + + return false; + } + + Primitive2DSequence UnifiedAlphaPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { if(0.0 == getAlpha()) { @@ -99,26 +119,6 @@ namespace drawinglayer } } - UnifiedAlphaPrimitive2D::UnifiedAlphaPrimitive2D( - const Primitive2DSequence& rChildren, - double fAlpha) - : GroupPrimitive2D(rChildren), - mfAlpha(fAlpha) - { - } - - bool UnifiedAlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const - { - if(GroupPrimitive2D::operator==(rPrimitive)) - { - const UnifiedAlphaPrimitive2D& rCompare = (UnifiedAlphaPrimitive2D&)rPrimitive; - - return (getAlpha() == rCompare.getAlpha()); - } - - return false; - } - // provide unique ID ImplPrimitrive2DIDBlock(UnifiedAlphaPrimitive2D, PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D) diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx new file mode 100644 index 000000000000..621b0b25ad98 --- /dev/null +++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx @@ -0,0 +1,276 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: bitmapprimitive2d.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. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive2d/wallpaperprimitive2d.hxx> +#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <drawinglayer/primitive2d/maskprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence WallpaperBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence aRetval; + + if(!getLocalObjectRange().isEmpty() && !getBitmapEx().IsEmpty()) + { + // get bitmap PIXEL size + const Size& rPixelSize = getBitmapEx().GetSizePixel(); + + if(rPixelSize.Width() > 0 && rPixelSize.Height() > 0) + { + if(WALLPAPER_SCALE == getWallpaperStyle()) + { + // shortcut for scale; use simple BitmapPrimitive2D + basegfx::B2DHomMatrix aObjectTransform; + + aObjectTransform.set(0, 0, getLocalObjectRange().getWidth()); + aObjectTransform.set(1, 1, getLocalObjectRange().getHeight()); + aObjectTransform.set(0, 2, getLocalObjectRange().getMinX()); + aObjectTransform.set(1, 2, getLocalObjectRange().getMinY()); + + Primitive2DReference xReference( + new BitmapPrimitive2D( + getBitmapEx(), + aObjectTransform)); + + aRetval = Primitive2DSequence(&xReference, 1); + } + else + { + // transform to logic size + basegfx::B2DHomMatrix aInverseViewTransformation(getViewTransformation()); + aInverseViewTransformation.invert(); + basegfx::B2DVector aLogicSize(rPixelSize.Width(), rPixelSize.Height()); + aLogicSize = aInverseViewTransformation * aLogicSize; + + // apply laout + basegfx::B2DPoint aTargetTopLeft(getLocalObjectRange().getMinimum()); + bool bUseTargetTopLeft(true); + bool bNeedsClipping(false); + + switch(getWallpaperStyle()) + { + default: //case WALLPAPER_TILE :, also WALLPAPER_NULL and WALLPAPER_APPLICATIONGRADIENT + { + bUseTargetTopLeft = false; + break; + } + case WALLPAPER_SCALE : + { + // handled by shortcut above + break; + } + case WALLPAPER_TOPLEFT : + { + // nothing to do + break; + } + case WALLPAPER_TOP : + { + const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter()); + aTargetTopLeft.setX(aCenter.getX() - (aLogicSize.getX() * 0.5)); + break; + } + case WALLPAPER_TOPRIGHT : + { + aTargetTopLeft.setX(getLocalObjectRange().getMaxX() - aLogicSize.getX()); + break; + } + case WALLPAPER_LEFT : + { + const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter()); + aTargetTopLeft.setY(aCenter.getY() - (aLogicSize.getY() * 0.5)); + break; + } + case WALLPAPER_CENTER : + { + const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter()); + aTargetTopLeft = aCenter - (aLogicSize * 0.5); + break; + } + case WALLPAPER_RIGHT : + { + const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter()); + aTargetTopLeft.setX(getLocalObjectRange().getMaxX() - aLogicSize.getX()); + aTargetTopLeft.setY(aCenter.getY() - (aLogicSize.getY() * 0.5)); + break; + } + case WALLPAPER_BOTTOMLEFT : + { + aTargetTopLeft.setY(getLocalObjectRange().getMaxY() - aLogicSize.getY()); + break; + } + case WALLPAPER_BOTTOM : + { + const basegfx::B2DPoint aCenter(getLocalObjectRange().getCenter()); + aTargetTopLeft.setX(aCenter.getX() - (aLogicSize.getX() * 0.5)); + aTargetTopLeft.setY(getLocalObjectRange().getMaxY() - aLogicSize.getY()); + break; + } + case WALLPAPER_BOTTOMRIGHT : + { + aTargetTopLeft = getLocalObjectRange().getMaximum() - aLogicSize; + break; + } + } + + if(bUseTargetTopLeft) + { + // fill target range + const basegfx::B2DRange aTargetRange(aTargetTopLeft, aTargetTopLeft + aLogicSize); + + // create aligned, single BitmapPrimitive2D + basegfx::B2DHomMatrix aObjectTransform; + + aObjectTransform.set(0, 0, aTargetRange.getWidth()); + aObjectTransform.set(1, 1, aTargetRange.getHeight()); + aObjectTransform.set(0, 2, aTargetRange.getMinX()); + aObjectTransform.set(1, 2, aTargetRange.getMinY()); + + Primitive2DReference xReference( + new BitmapPrimitive2D( + getBitmapEx(), + aObjectTransform)); + aRetval = Primitive2DSequence(&xReference, 1); + + // clip when not completely inside object range + bNeedsClipping = !getLocalObjectRange().isInside(aTargetRange); + } + else + { + // WALLPAPER_TILE, WALLPAPER_NULL, WALLPAPER_APPLICATIONGRADIENT + // convert to relative positions + const basegfx::B2DVector aRelativeSize( + aLogicSize.getX() / (getLocalObjectRange().getWidth() ? getLocalObjectRange().getWidth() : 1.0), + aLogicSize.getY() / (getLocalObjectRange().getHeight() ? getLocalObjectRange().getHeight() : 1.0)); + basegfx::B2DPoint aRelativeTopLeft(0.0, 0.0); + + if(WALLPAPER_TILE != getWallpaperStyle()) + { + aRelativeTopLeft.setX(0.5 - aRelativeSize.getX()); + aRelativeTopLeft.setY(0.5 - aRelativeSize.getY()); + } + + // prepare FillBitmapAttribute + const attribute::FillBitmapAttribute aFillBitmapAttribute( + getBitmapEx(), + aRelativeTopLeft, + aRelativeSize, + true); + + // create ObjectTransform + basegfx::B2DHomMatrix aObjectTransform; + + aObjectTransform.set(0, 0, getLocalObjectRange().getWidth()); + aObjectTransform.set(1, 1, getLocalObjectRange().getHeight()); + aObjectTransform.set(0, 2, getLocalObjectRange().getMinX()); + aObjectTransform.set(1, 2, getLocalObjectRange().getMinY()); + + // create FillBitmapPrimitive + const drawinglayer::primitive2d::Primitive2DReference xFillBitmap( + new drawinglayer::primitive2d::FillBitmapPrimitive2D( + aObjectTransform, + aFillBitmapAttribute)); + aRetval = Primitive2DSequence(&xFillBitmap, 1); + + // always embed tiled fill to clipping + bNeedsClipping = true; + } + + if(bNeedsClipping) + { + // embed to clipping; this is necessary for tiled fills + const basegfx::B2DPolyPolygon aPolyPolygon(basegfx::tools::createPolygonFromRect(getLocalObjectRange())); + const drawinglayer::primitive2d::Primitive2DReference xClippedFill( + new drawinglayer::primitive2d::MaskPrimitive2D( + aPolyPolygon, + aRetval)); + aRetval = Primitive2DSequence(&xClippedFill, 1); + } + } + } + } + + return aRetval; + } + + WallpaperBitmapPrimitive2D::WallpaperBitmapPrimitive2D( + const basegfx::B2DRange& rObjectRange, + const BitmapEx& rBitmapEx, + WallpaperStyle eWallpaperStyle) + : ViewTransformationDependentPrimitive2D(), + maObjectRange(rObjectRange), + maBitmapEx(rBitmapEx), + meWallpaperStyle(eWallpaperStyle) + { + } + + bool WallpaperBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(ViewTransformationDependentPrimitive2D::operator==(rPrimitive)) + { + const WallpaperBitmapPrimitive2D& rCompare = (WallpaperBitmapPrimitive2D&)rPrimitive; + + return (getLocalObjectRange() == rCompare.getLocalObjectRange() + && getBitmapEx() == rCompare.getBitmapEx() + && getWallpaperStyle() == rCompare.getWallpaperStyle()); + } + + return false; + } + + basegfx::B2DRange WallpaperBitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + return getLocalObjectRange(); + } + + // provide unique ID + ImplPrimitrive2DIDBlock(WallpaperBitmapPrimitive2D, PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D) + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx index 93a51d5379b3..4d50cb78da06 100644 --- a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx @@ -48,7 +48,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence WrongSpellPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence WrongSpellPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // ATM this decompose is view-independent, what the original VCL-Display is not. To mimic // the old behaviour here if wanted it is necessary to add get2DDecomposition and implement @@ -97,7 +97,7 @@ namespace drawinglayer double fStart, double fStop, const basegfx::BColor& rColor) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransformation(rTransformation), mfStart(fStart), mfStop(fStop), @@ -107,7 +107,7 @@ namespace drawinglayer bool WrongSpellPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const WrongSpellPrimitive2D& rCompare = (WrongSpellPrimitive2D&)rPrimitive; diff --git a/drawinglayer/source/primitive3d/baseprimitive3d.cxx b/drawinglayer/source/primitive3d/baseprimitive3d.cxx index 032ae068003b..c30545e4f7c3 100644 --- a/drawinglayer/source/primitive3d/baseprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/baseprimitive3d.cxx @@ -50,20 +50,18 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence BasePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + BasePrimitive3D::BasePrimitive3D() + : BasePrimitive3DImplBase(m_aMutex) { - return Primitive3DSequence(); } - BasePrimitive3D::BasePrimitive3D() - : BasePrimitive3DImplBase(m_aMutex), - maLocalDecomposition() + BasePrimitive3D::~BasePrimitive3D() { } bool BasePrimitive3D::operator==( const BasePrimitive3D& rPrimitive ) const { - return (getPrimitiveID() == rPrimitive.getPrimitiveID()); + return (getPrimitive3DID() == rPrimitive.getPrimitive3DID()); } basegfx::B3DRange BasePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const @@ -71,17 +69,9 @@ namespace drawinglayer return getB3DRangeFromPrimitive3DSequence(get3DDecomposition(rViewInformation), rViewInformation); } - Primitive3DSequence BasePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const + Primitive3DSequence BasePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { - ::osl::MutexGuard aGuard( m_aMutex ); - - if(!getLocalDecomposition().hasElements()) - { - const Primitive3DSequence aNewSequence(createLocalDecomposition(rViewInformation)); - const_cast< BasePrimitive3D* >(this)->setLocalDecomposition(aNewSequence); - } - - return getLocalDecomposition(); + return Primitive3DSequence(); } Primitive3DSequence SAL_CALL BasePrimitive3D::getDecomposition( const uno::Sequence< beans::PropertyValue >& rViewParameters ) throw ( uno::RuntimeException ) @@ -99,6 +89,38 @@ namespace drawinglayer } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive3d + { + Primitive3DSequence BufferedDecompositionPrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + { + return Primitive3DSequence(); + } + + BufferedDecompositionPrimitive3D::BufferedDecompositionPrimitive3D() + : BasePrimitive3D(), + maBuffered3DDecomposition() + { + } + + Primitive3DSequence BufferedDecompositionPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const + { + ::osl::MutexGuard aGuard( m_aMutex ); + + if(!getBuffered3DDecomposition().hasElements()) + { + const Primitive3DSequence aNewSequence(create3DDecomposition(rViewInformation)); + const_cast< BufferedDecompositionPrimitive3D* >(this)->setBuffered3DDecomposition(aNewSequence); + } + + return getBuffered3DDecomposition(); + } + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// // tooling namespace drawinglayer diff --git a/drawinglayer/source/primitive3d/groupprimitive3d.cxx b/drawinglayer/source/primitive3d/groupprimitive3d.cxx index b8ed86ee952a..17736a276b38 100644 --- a/drawinglayer/source/primitive3d/groupprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/groupprimitive3d.cxx @@ -49,12 +49,6 @@ namespace drawinglayer { namespace primitive3d { - /// default: just return children, so all renderers not supporting group will use it's content - Primitive3DSequence GroupPrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const - { - return getChildren(); - } - GroupPrimitive3D::GroupPrimitive3D( const Primitive3DSequence& rChildren ) : BasePrimitive3D(), maChildren(rChildren) @@ -77,6 +71,12 @@ namespace drawinglayer return false; } + /// default: just return children, so all renderers not supporting group will use it's content + Primitive3DSequence GroupPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + { + return getChildren(); + } + // provide unique ID ImplPrimitrive3DIDBlock(GroupPrimitive3D, PRIMITIVE3D_ID_GROUPPRIMITIVE3D) diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx index dd49f99b751c..381b70d4f6cc 100644 --- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx @@ -59,7 +59,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence HatchTexturePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + Primitive3DSequence HatchTexturePrimitive3D::impCreate3DDecomposition() const { Primitive3DSequence aRetval; @@ -81,9 +81,9 @@ namespace drawinglayer if(pBasePrimitive) { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch + // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch // not all content is needed, remove transparencies and ModifiedColorPrimitives - switch(pBasePrimitive->getPrimitiveID()) + switch(pBasePrimitive->getPrimitive3DID()) { case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D : { @@ -287,7 +287,8 @@ namespace drawinglayer bool bModulate, bool bFilter) : TexturePrimitive3D(rChildren, rTextureSize, bModulate, bFilter), - maHatch(rHatch) + maHatch(rHatch), + maBuffered3DDecomposition() { } @@ -303,6 +304,19 @@ namespace drawinglayer return false; } + Primitive3DSequence HatchTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + { + ::osl::MutexGuard aGuard( m_aMutex ); + + if(!getBuffered3DDecomposition().hasElements()) + { + const Primitive3DSequence aNewSequence(impCreate3DDecomposition()); + const_cast< HatchTexturePrimitive3D* >(this)->setBuffered3DDecomposition(aNewSequence); + } + + return getBuffered3DDecomposition(); + } + // provide unique ID ImplPrimitrive3DIDBlock(HatchTexturePrimitive3D, PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D) diff --git a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx b/drawinglayer/source/primitive3d/hittestprimitive3d.cxx index 50616ab1548b..65aede8142aa 100644 --- a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/hittestprimitive3d.cxx @@ -49,12 +49,6 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence HitTestPrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const - { - // return empty sequence - return Primitive3DSequence(); - } - HitTestPrimitive3D::HitTestPrimitive3D( const Primitive3DSequence& rChildren) : GroupPrimitive3D(rChildren) @@ -66,6 +60,12 @@ namespace drawinglayer return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation); } + Primitive3DSequence HitTestPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + { + // return empty sequence + return Primitive3DSequence(); + } + // provide unique ID ImplPrimitrive3DIDBlock(HitTestPrimitive3D, PRIMITIVE3D_ID_HITTESTPRIMITIVE3D) diff --git a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx index b89499091dd0..ee38b8782cff 100644 --- a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx @@ -92,7 +92,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence PolygonStrokePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + Primitive3DSequence PolygonStrokePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { Primitive3DSequence aRetval; @@ -145,7 +145,7 @@ namespace drawinglayer const basegfx::B3DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute, const attribute::StrokeAttribute& rStrokeAttribute) - : BasePrimitive3D(), + : BufferedDecompositionPrimitive3D(), maPolygon(rPolygon), maLineAttribute(rLineAttribute), maStrokeAttribute(rStrokeAttribute) @@ -155,7 +155,7 @@ namespace drawinglayer PolygonStrokePrimitive3D::PolygonStrokePrimitive3D( const basegfx::B3DPolygon& rPolygon, const attribute::LineAttribute& rLineAttribute) - : BasePrimitive3D(), + : BufferedDecompositionPrimitive3D(), maPolygon(rPolygon), maLineAttribute(rLineAttribute), maStrokeAttribute() @@ -164,7 +164,7 @@ namespace drawinglayer bool PolygonStrokePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const { - if(BasePrimitive3D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive3D::operator==(rPrimitive)) { const PolygonStrokePrimitive3D& rCompare = (PolygonStrokePrimitive3D&)rPrimitive; diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx index 09c4acdcaed5..de28e3ad74e5 100644 --- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx @@ -417,7 +417,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence PolygonTubePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + Primitive3DSequence PolygonTubePrimitive3D::impCreate3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { const sal_uInt32 nPointCount(getB3DPolygon().count()); std::vector< BasePrimitive3D* > aResultVector; @@ -541,6 +541,7 @@ namespace drawinglayer double fDegreeStepWidth, double fMiterMinimumAngle) : PolygonHairlinePrimitive3D(rPolygon, rBColor), + maLast3DDecomposition(), mfRadius(fRadius), mfDegreeStepWidth(fDegreeStepWidth), mfMiterMinimumAngle(fMiterMinimumAngle), @@ -563,6 +564,19 @@ namespace drawinglayer return false; } + Primitive3DSequence PolygonTubePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const + { + ::osl::MutexGuard aGuard( m_aMutex ); + + if(!getLast3DDecomposition().hasElements()) + { + const Primitive3DSequence aNewSequence(impCreate3DDecomposition(rViewInformation)); + const_cast< PolygonTubePrimitive3D* >(this)->setLast3DDecomposition(aNewSequence); + } + + return getLast3DDecomposition(); + } + // provide unique ID ImplPrimitrive3DIDBlock(PolygonTubePrimitive3D, PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D) diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx index 341d2907a53d..739914562071 100644 --- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx @@ -56,7 +56,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence SdrCubePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + Primitive3DSequence SdrCubePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); Primitive3DSequence aRetval; diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx index e9ef154c95f3..3554e9266ec1 100644 --- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx @@ -57,7 +57,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence SdrExtrudePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const + Primitive3DSequence SdrExtrudePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const { Primitive3DSequence aRetval; @@ -510,14 +510,14 @@ namespace drawinglayer if(getSdr3DObjectAttribute().getReducedLineGeometry()) { if(!mpLastRLGViewInformation || - (getLocalDecomposition().hasElements() + (getBuffered3DDecomposition().hasElements() && *mpLastRLGViewInformation != rViewInformation)) { // conditions of last local decomposition with reduced lines have changed. Remember // new one and clear current decompositiopn ::osl::Mutex m_mutex; SdrExtrudePrimitive3D* pThat = const_cast< SdrExtrudePrimitive3D* >(this); - pThat->setLocalDecomposition(Primitive3DSequence()); + pThat->setBuffered3DDecomposition(Primitive3DSequence()); delete pThat->mpLastRLGViewInformation; pThat->mpLastRLGViewInformation = new geometry::ViewInformation3D(rViewInformation); } diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx index 33008e762c0a..5e6c34e644de 100644 --- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx @@ -57,7 +57,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence SdrLathePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const + Primitive3DSequence SdrLathePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const { Primitive3DSequence aRetval; @@ -369,14 +369,14 @@ namespace drawinglayer if(getSdr3DObjectAttribute().getReducedLineGeometry()) { if(!mpLastRLGViewInformation || - (getLocalDecomposition().hasElements() + (getBuffered3DDecomposition().hasElements() && *mpLastRLGViewInformation != rViewInformation)) { // conditions of last local decomposition with reduced lines have changed. Remember // new one and clear current decompositiopn ::osl::Mutex m_mutex; SdrLathePrimitive3D* pThat = const_cast< SdrLathePrimitive3D* >(this); - pThat->setLocalDecomposition(Primitive3DSequence()); + pThat->setBuffered3DDecomposition(Primitive3DSequence()); delete pThat->mpLastRLGViewInformation; pThat->mpLastRLGViewInformation = new geometry::ViewInformation3D(rViewInformation); } diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx index a0813d3202a8..69049fb7b24d 100644 --- a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx @@ -53,7 +53,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence SdrPolyPolygonPrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + Primitive3DSequence SdrPolyPolygonPrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { Primitive3DSequence aRetval; diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx index dc93d0c0f339..f8489b6418ff 100644 --- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx @@ -103,7 +103,7 @@ namespace drawinglayer const basegfx::B2DVector& rTextureSize, const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute) - : BasePrimitive3D(), + : BufferedDecompositionPrimitive3D(), maTransform(rTransform), maTextureSize(rTextureSize), maSdrLFSAttribute(rSdrLFSAttribute), @@ -113,7 +113,7 @@ namespace drawinglayer bool SdrPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const { - if(BasePrimitive3D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive3D::operator==(rPrimitive)) { const SdrPrimitive3D& rCompare = static_cast< const SdrPrimitive3D& >(rPrimitive); diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx index e7149c611dd9..663ae6ad0d37 100644 --- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx @@ -56,7 +56,7 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence SdrSpherePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + Primitive3DSequence SdrSpherePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { Primitive3DSequence aRetval; const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx index 3393346d0b2d..deeed95a71fd 100644 --- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx @@ -81,7 +81,27 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence UnifiedAlphaTexturePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + UnifiedAlphaTexturePrimitive3D::UnifiedAlphaTexturePrimitive3D( + double fTransparence, + const Primitive3DSequence& rChildren) + : TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false), + mfTransparence(fTransparence) + { + } + + bool UnifiedAlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const + { + if(TexturePrimitive3D::operator==(rPrimitive)) + { + const UnifiedAlphaTexturePrimitive3D& rCompare = (UnifiedAlphaTexturePrimitive3D&)rPrimitive; + + return (getTransparence() == rCompare.getTransparence()); + } + + return false; + } + + Primitive3DSequence UnifiedAlphaTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { if(0.0 == getTransparence()) { @@ -103,26 +123,6 @@ namespace drawinglayer } } - UnifiedAlphaTexturePrimitive3D::UnifiedAlphaTexturePrimitive3D( - double fTransparence, - const Primitive3DSequence& rChildren) - : TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false), - mfTransparence(fTransparence) - { - } - - bool UnifiedAlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const - { - if(TexturePrimitive3D::operator==(rPrimitive)) - { - const UnifiedAlphaTexturePrimitive3D& rCompare = (UnifiedAlphaTexturePrimitive3D&)rPrimitive; - - return (getTransparence() == rCompare.getTransparence()); - } - - return false; - } - // provide unique ID ImplPrimitrive3DIDBlock(UnifiedAlphaTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D) @@ -135,11 +135,6 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence GradientTexturePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const - { - return getChildren(); - } - GradientTexturePrimitive3D::GradientTexturePrimitive3D( const attribute::FillGradientAttribute& rGradient, const Primitive3DSequence& rChildren, @@ -175,18 +170,13 @@ namespace drawinglayer { namespace primitive3d { - Primitive3DSequence BitmapTexturePrimitive3D::createLocalDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const - { - return getChildren(); - } - BitmapTexturePrimitive3D::BitmapTexturePrimitive3D( - const attribute::FillBitmapAttribute& rBitmap, + const attribute::FillBitmapAttribute& rFillBitmapAttribute, const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, bool bFilter) : TexturePrimitive3D(rChildren, rTextureSize, bModulate, bFilter), - maBitmap(rBitmap) + maFillBitmapAttribute(rFillBitmapAttribute) { } @@ -196,7 +186,7 @@ namespace drawinglayer { const BitmapTexturePrimitive3D& rCompare = (BitmapTexturePrimitive3D&)rPrimitive; - return (getBitmap() == rCompare.getBitmap()); + return (getFillBitmapAttribute() == rCompare.getFillBitmapAttribute()); } return false; diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx index 43e40183bc6e..8eb713258b25 100644 --- a/drawinglayer/source/processor2d/canvasprocessor.cxx +++ b/drawinglayer/source/processor2d/canvasprocessor.cxx @@ -76,6 +76,7 @@ #include <helperchartrenderer.hxx> #include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx> #include <helperwrongspellrenderer.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -675,7 +676,7 @@ using namespace com::sun::star; // directdraw of text simple portion void canvasProcessor::impRender_STXP(const textSimplePortionPrimitive& rTextCandidate) { - const fontAttributes& rFontAttrs( rTextCandidate.getFontAttributes() ); + const fontAttributes& rFontAttrs( rTextCandidate.getFontAttribute() ); rendering::FontRequest aFontRequest; aFontRequest.FontDescription.FamilyName = rFontAttrs.maFamilyName; @@ -1341,10 +1342,9 @@ namespace drawinglayer // prepare discrete offset for XBitmap, do not forget that the buffer bitmap // may be truncated to discrete visible pixels - basegfx::B2DHomMatrix aDiscreteOffset; - aDiscreteOffset.translate( + const basegfx::B2DHomMatrix aDiscreteOffset(basegfx::tools::createTranslateB2DHomMatrix( aDiscreteRange.getMinX() > 0.0 ? -aDiscreteRange.getMinX() : 0.0, - aDiscreteRange.getMinY() > 0.0 ? -aDiscreteRange.getMinY() : 0.0); + aDiscreteRange.getMinY() > 0.0 ? -aDiscreteRange.getMinY() : 0.0)); // create new local ViewInformation2D with new transformation const geometry::ViewInformation2D aViewInformation2D( @@ -1517,16 +1517,16 @@ namespace drawinglayer } else { - const primitive2d::FontAttributes& rFontAttrs(rTextCandidate.getFontAttributes()); + const attribute::FontAttribute& rFontAttr(rTextCandidate.getFontAttribute()); rendering::FontRequest aFontRequest; - aFontRequest.FontDescription.FamilyName = rFontAttrs.getFamilyName(); - aFontRequest.FontDescription.StyleName = rFontAttrs.getStyleName(); - aFontRequest.FontDescription.IsSymbolFont = rFontAttrs.getSymbol() ? util::TriState_YES : util::TriState_NO; - aFontRequest.FontDescription.IsVertical = rFontAttrs.getVertical() ? util::TriState_YES : util::TriState_NO; + aFontRequest.FontDescription.FamilyName = rFontAttr.getFamilyName(); + aFontRequest.FontDescription.StyleName = rFontAttr.getStyleName(); + aFontRequest.FontDescription.IsSymbolFont = rFontAttr.getSymbol() ? util::TriState_YES : util::TriState_NO; + aFontRequest.FontDescription.IsVertical = rFontAttr.getVertical() ? util::TriState_YES : util::TriState_NO; // TODO(F2): improve vclenum->panose conversion - aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttrs.getWeight()); - aFontRequest.FontDescription.FontDescription.Letterform = rFontAttrs.getItalic() ? 9 : 0; + aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttr.getWeight()); + aFontRequest.FontDescription.FontDescription.Letterform = rFontAttr.getItalic() ? 9 : 0; // init CellSize to 1.0, else a default font height will be used aFontRequest.CellSize = 1.0; @@ -1600,16 +1600,14 @@ namespace drawinglayer // adapt object's transformation to the correct scale basegfx::B2DVector aScale, aTranslate; double fRotate, fShearX; - basegfx::B2DHomMatrix aNewMatrix; const Size aSizePixel(aModifiedBitmapEx.GetSizePixel()); if(0 != aSizePixel.Width() && 0 != aSizePixel.Height()) { rBitmapCandidate.getTransform().decompose(aScale, aTranslate, fRotate, fShearX); - aNewMatrix.scale(aScale.getX() / aSizePixel.Width(), aScale.getY() / aSizePixel.Height()); - aNewMatrix.shearX(fShearX); - aNewMatrix.rotate(fRotate); - aNewMatrix.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aNewMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale.getX() / aSizePixel.Width(), aScale.getY() / aSizePixel.Height(), + fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation() * aNewMatrix); @@ -1658,10 +1656,9 @@ namespace drawinglayer // prepare discrete offset for XBitmap, do not forget that the buffer bitmap // may be truncated to discrete visible pixels - basegfx::B2DHomMatrix aDiscreteOffset; - aDiscreteOffset.translate( + const basegfx::B2DHomMatrix aDiscreteOffset(basegfx::tools::createTranslateB2DHomMatrix( aDiscreteRange.getMinX() > 0.0 ? -aDiscreteRange.getMinX() : 0.0, - aDiscreteRange.getMinY() > 0.0 ? -aDiscreteRange.getMinY() : 0.0); + aDiscreteRange.getMinY() > 0.0 ? -aDiscreteRange.getMinY() : 0.0)); // create new local ViewInformation2D with new transformation const geometry::ViewInformation2D aViewInformation2D( @@ -1798,7 +1795,7 @@ namespace drawinglayer if(rFillBitmapAttribute.getTiling()) { // apply possible color modification to Bitmap - const BitmapEx aChangedBitmapEx(impModifyBitmapEx(maBColorModifierStack, BitmapEx(rFillBitmapAttribute.getBitmap()))); + const BitmapEx aChangedBitmapEx(impModifyBitmapEx(maBColorModifierStack, rFillBitmapAttribute.getBitmapEx())); if(aChangedBitmapEx.IsEmpty()) { @@ -1821,13 +1818,9 @@ namespace drawinglayer { // create texture matrix from texture to object (where object is unit square here), // so use values directly - basegfx::B2DHomMatrix aTextureMatrix; - aTextureMatrix.scale( - rFillBitmapAttribute.getSize().getX(), - rFillBitmapAttribute.getSize().getY()); - aTextureMatrix.translate( - rFillBitmapAttribute.getTopLeft().getX(), - rFillBitmapAttribute.getTopLeft().getY()); + const basegfx::B2DHomMatrix aTextureMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix( + rFillBitmapAttribute.getSize().getX(), rFillBitmapAttribute.getSize().getY(), + rFillBitmapAttribute.getTopLeft().getX(), rFillBitmapAttribute.getTopLeft().getY())); // create and fill texture rendering::Texture aTexture; @@ -1883,7 +1876,7 @@ namespace drawinglayer const primitive2d::Primitive2DReference xReference(rChildren[0]); const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); - if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitiveID()) + if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) { // direct draw of PolyPolygon with color and transparence const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); @@ -1922,7 +1915,7 @@ namespace drawinglayer void canvasProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D : { diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx index 1f629cb25c9c..3225651a6754 100644 --- a/drawinglayer/source/processor2d/contourextractor2d.cxx +++ b/drawinglayer/source/processor2d/contourextractor2d.cxx @@ -70,7 +70,7 @@ namespace drawinglayer void ContourExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D : { diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx index 4ffef7515389..b10e10706520 100644 --- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx +++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx @@ -289,7 +289,7 @@ namespace drawinglayer return; } - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D : { @@ -451,8 +451,9 @@ namespace drawinglayer { if(!getHitTextOnly()) { - const primitive2d::ScenePrimitive2D& rSceneCandidate(static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate)); - check3DHit(rSceneCandidate); + const primitive2d::ScenePrimitive2D& rScenePrimitive2D( + static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate)); + check3DHit(rScenePrimitive2D); } break; diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx index 5f0ab63ee1b3..cc474b7c0736 100644 --- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx +++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx @@ -66,7 +66,7 @@ namespace drawinglayer void LineGeometryExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D : case PRIMITIVE2D_ID_POLYGONSTROKEARROWPRIMITIVE2D : diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx index 9358c7f39c57..ce53d1e86399 100644 --- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx +++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx @@ -51,7 +51,7 @@ namespace drawinglayer { void TextAsPolygonExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D : { diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx index 1488cd4fd054..216139653692 100644 --- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx +++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx @@ -43,6 +43,7 @@ #include <basegfx/range/b2drange.hxx> #include <vcl/outdev.hxx> #include <vclhelperbitmaptransform.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// // support for different kinds of bitmap rendering using vcl @@ -84,10 +85,9 @@ namespace drawinglayer else { // if rotated, create the unrotated output rectangle for the GraphicManager paint - basegfx::B2DHomMatrix aSimpleObjectMatrix; - - aSimpleObjectMatrix.scale(fabs(aScale.getX()), fabs(aScale.getY())); - aSimpleObjectMatrix.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aSimpleObjectMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix( + fabs(aScale.getX()), fabs(aScale.getY()), + aTranslate.getX(), aTranslate.getY())); aOutlineRange.transform(aSimpleObjectMatrix); } @@ -190,11 +190,11 @@ namespace drawinglayer } // build transform from pixel in aDestination to pixel in rBitmapEx - basegfx::B2DHomMatrix aTransform; - // from relative in aCroppedRectPixel to relative in aDestRectPixel // No need to take bNeedToReduce into account, TopLeft is unchanged - aTransform.translate(aCroppedRectPixel.Left() - aDestRectPixel.Left(), aCroppedRectPixel.Top() - aDestRectPixel.Top()); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + aCroppedRectPixel.Left() - aDestRectPixel.Left(), + aCroppedRectPixel.Top() - aDestRectPixel.Top())); // from relative in aDestRectPixel to absolute Logic. Here it // is essential to adapt to reduce factor (if used) @@ -207,8 +207,10 @@ namespace drawinglayer fAdaptedDRPHeight *= fReduceFactor; } - aTransform.scale(aDestRectLogic.getWidth() / fAdaptedDRPWidth, aDestRectLogic.getHeight() / fAdaptedDRPHeight); - aTransform.translate(aDestRectLogic.Left(), aDestRectLogic.Top()); + aTransform = basegfx::tools::createScaleTranslateB2DHomMatrix( + aDestRectLogic.getWidth() / fAdaptedDRPWidth, aDestRectLogic.getHeight() / fAdaptedDRPHeight, + aDestRectLogic.Left(), aDestRectLogic.Top()) + * aTransform; // from absolute in Logic to unified object coordinates (0.0 .. 1.0 in x and y) basegfx::B2DHomMatrix aInvBitmapTransform(rTransform); diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index d1190c2d9179..a99115a095c4 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -74,6 +74,7 @@ #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx> #include <helperchartrenderer.hxx> #include <drawinglayer/primitive2d/hittestprimitive2d.hxx> +#include <drawinglayer/primitive2d/epsprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// // for PDFExtOutDevData Graphic support @@ -592,7 +593,7 @@ namespace drawinglayer void VclMetafileProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D : { @@ -1008,26 +1009,12 @@ namespace drawinglayer SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(rStrokePrimitive.getB2DPolygon(), 0, &rStrokePrimitive.getLineAttribute(), &rStrokePrimitive.getStrokeAttribute(), 0, 0); - // Adapt OutDev's DrawMode if special ones were used - const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode()); - adaptLineToFillDrawMode(); - - impStartSvtGraphicStroke(pSvtGraphicStroke); - - // #i101491# - // Change default of fat line generation for MetaFiles: Create MetaPolyLineAction - // instead of decomposing all geometries when the polygon has more than given amount of - // points; else the decomposition will get too expensive quiclky. OTOH - // the decomposition provides the better quality e.g. taking edge roundings - // into account which will NOT be taken into account with LineInfo-based actions - const sal_uInt32 nSubPolygonCount(rStrokePrimitive.getB2DPolygon().count()); - bool bDone(0 == nSubPolygonCount); - - if(!bDone && nSubPolygonCount > 1000) + if(true) { - // create MetaPolyLineActions, but without LINE_DASH + impStartSvtGraphicStroke(pSvtGraphicStroke); const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute(); + // create MetaPolyLineActions, but without LINE_DASH if(basegfx::fTools::more(rLine.getWidth(), 0.0)) { const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute(); @@ -1047,10 +1034,9 @@ namespace drawinglayer const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLine.getColor())); mpOutputDevice->SetLineColor(Color(aHairlineColor)); mpOutputDevice->SetFillColor(); - aHairLinePolyPolygon.transform(maCurrentTransformation); - - const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth())); + LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth())); + aLineInfo.SetLineJoin(rLine.getLineJoin()); for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++) { @@ -1063,22 +1049,88 @@ namespace drawinglayer mpMetaFile->AddAction(new MetaPolyLineAction(aToolsPolygon, aLineInfo)); } } - - bDone = true; } - } + else + { + process(rCandidate.get2DDecomposition(getViewInformation2D())); + } - if(!bDone) - { - // use decomposition (creates line geometry as filled polygon - // geometry) - process(rCandidate.get2DDecomposition(getViewInformation2D())); + impEndSvtGraphicStroke(pSvtGraphicStroke); } + else + { + // Adapt OutDev's DrawMode if special ones were used + const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode()); + adaptLineToFillDrawMode(); + + impStartSvtGraphicStroke(pSvtGraphicStroke); + + // #i101491# + // Change default of fat line generation for MetaFiles: Create MetaPolyLineAction + // instead of decomposing all geometries when the polygon has more than given amount of + // points; else the decomposition will get too expensive quiclky. OTOH + // the decomposition provides the better quality e.g. taking edge roundings + // into account which will NOT be taken into account with LineInfo-based actions + const sal_uInt32 nSubPolygonCount(rStrokePrimitive.getB2DPolygon().count()); + bool bDone(0 == nSubPolygonCount); + + if(!bDone && nSubPolygonCount > 1000) + { + // create MetaPolyLineActions, but without LINE_DASH + const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute(); - impEndSvtGraphicStroke(pSvtGraphicStroke); + if(basegfx::fTools::more(rLine.getWidth(), 0.0)) + { + const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute(); + basegfx::B2DPolyPolygon aHairLinePolyPolygon; - // restore DrawMode - mpOutputDevice->SetDrawMode(nOriginalDrawMode); + if(0.0 == rStroke.getFullDotDashLen()) + { + aHairLinePolyPolygon.append(rStrokePrimitive.getB2DPolygon()); + } + else + { + basegfx::tools::applyLineDashing( + rStrokePrimitive.getB2DPolygon(), rStroke.getDotDashArray(), + &aHairLinePolyPolygon, 0, rStroke.getFullDotDashLen()); + } + + const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLine.getColor())); + mpOutputDevice->SetLineColor(Color(aHairlineColor)); + mpOutputDevice->SetFillColor(); + + aHairLinePolyPolygon.transform(maCurrentTransformation); + + const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth())); + + for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++) + { + const basegfx::B2DPolygon aCandidate(aHairLinePolyPolygon.getB2DPolygon(a)); + + if(aCandidate.count() > 1) + { + const Polygon aToolsPolygon(aCandidate); + + mpMetaFile->AddAction(new MetaPolyLineAction(aToolsPolygon, aLineInfo)); + } + } + + bDone = true; + } + } + + if(!bDone) + { + // use decomposition (creates line geometry as filled polygon + // geometry) + process(rCandidate.get2DDecomposition(getViewInformation2D())); + } + + impEndSvtGraphicStroke(pSvtGraphicStroke); + + // restore DrawMode + mpOutputDevice->SetDrawMode(nOriginalDrawMode); + } break; } @@ -1124,8 +1176,8 @@ namespace drawinglayer const basegfx::B2DPoint aFillBitmapTopLeft(rFillBitmapAttribute.getTopLeft() * aOutlineSize); // the scaling needs scale from pixel to logic coordinate system - const Bitmap& rBitmap = rFillBitmapAttribute.getBitmap(); - Size aBmpSizePixel(rBitmap.GetSizePixel()); + const BitmapEx& rBitmapEx = rFillBitmapAttribute.getBitmapEx(); + Size aBmpSizePixel(rBitmapEx.GetSizePixel()); if(!aBmpSizePixel.Width()) { @@ -1149,7 +1201,7 @@ namespace drawinglayer aTransform.matrix[5] = aFillBitmapTopLeft.getY(); // setup fill graphic like in impgrfll - Graphic aFillGraphic = Graphic(rBitmap); + Graphic aFillGraphic = Graphic(rBitmapEx); aFillGraphic.SetPrefMapMode(MapMode(MAP_PIXEL)); aFillGraphic.SetPrefSize(aBmpSizePixel); @@ -1456,7 +1508,7 @@ namespace drawinglayer // PolyPolygonGradientPrimitive2D, PolyPolygonHatchPrimitive2D and // PolyPolygonBitmapPrimitive2D are derived from PolyPolygonColorPrimitive2D. // Check also for correct ID to exclude derived implementations - if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitiveID()) + if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) { // single transparent PolyPolygon identified, use directly const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); @@ -1567,7 +1619,7 @@ namespace drawinglayer } // Check also for correct ID to exclude derived implementations - if(pFiGradient && PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D == pFiGradient->getPrimitiveID()) + if(pFiGradient && PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D == pFiGradient->getPrimitive2DID()) { // various content, create content-metafile GDIMetaFile aContentMetafile; @@ -1754,6 +1806,11 @@ namespace drawinglayer break; } + case PRIMITIVE2D_ID_EPSPRIMITIVE2D : + { + RenderEpsPrimitive2D(static_cast< const primitive2d::EpsPrimitive2D& >(rCandidate)); + break; + } default : { // process recursively diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index ef351002a1ea..5a74b0471b7f 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -67,6 +67,8 @@ #include <drawinglayer/primitive2d/invertprimitive2d.hxx> #include <cstdio> #include <drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <drawinglayer/primitive2d/epsprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -111,7 +113,7 @@ namespace drawinglayer void VclPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D : { @@ -204,18 +206,8 @@ namespace drawinglayer } case PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D : { - if(getOptionsDrawinglayer().IsAntiAliasing()) - { - // For AA, direct render has to be avoided since it uses XOR maskings which will not - // work with AA. Instead, the decompose which uses MaskPrimitive2D with fillings is - // used - process(rCandidate.get2DDecomposition(getViewInformation2D())); - } - else - { - // direct draw of gradient - RenderPolyPolygonGradientPrimitive2D(static_cast< const primitive2d::PolyPolygonGradientPrimitive2D& >(rCandidate)); - } + // direct draw of gradient + RenderPolyPolygonGradientPrimitive2D(static_cast< const primitive2d::PolyPolygonGradientPrimitive2D& >(rCandidate)); break; } case PRIMITIVE2D_ID_POLYPOLYGONBITMAPPRIMITIVE2D : @@ -241,8 +233,17 @@ namespace drawinglayer mpOutputDevice->SetAntialiasing(nOldAntiAliase | ANTIALIASING_PIXELSNAPHAIRLINE); } - // direct draw of MetaFile - RenderMetafilePrimitive2D(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate)); + static bool bTestMetaFilePrimitiveDecomposition(true); + if(bTestMetaFilePrimitiveDecomposition) + { + // use new Metafile decomposition + process(rCandidate.get2DDecomposition(getViewInformation2D())); + } + else + { + // direct draw of MetaFile + RenderMetafilePrimitive2D(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate)); + } if(bForceLineSnap) { @@ -280,7 +281,7 @@ namespace drawinglayer const primitive2d::Primitive2DReference xReference(rContent[0]); const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); - if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitiveID()) + if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) { // single transparent PolyPolygon identified, use directly const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); @@ -528,7 +529,6 @@ namespace drawinglayer // restore AA setting mpOutputDevice->SetAntialiasing(nOriginalAA); - break; } case PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D : @@ -545,23 +545,23 @@ namespace drawinglayer case PRIMITIVE2D_ID_INVERTPRIMITIVE2D : { // invert primitive (currently only used for HighContrast fallback for selection in SW and SC). - // Set OutDev to XOR + // Set OutDev to XOR and switch AA off (XOR does not work with AA) mpOutputDevice->Push(); mpOutputDevice->SetRasterOp( ROP_XOR ); - - // force paint color to white by using ColorModifierStack - const basegfx::BColor aColWhite(1.0, 1.0, 1.0); - const basegfx::BColorModifier aColorModifier(aColWhite, 0.0, basegfx::BCOLORMODIFYMODE_REPLACE); - maBColorModifierStack.push(aColorModifier); + const sal_uInt16 nAntiAliasing(mpOutputDevice->GetAntialiasing()); + mpOutputDevice->SetAntialiasing(nAntiAliasing & ~ANTIALIASING_ENABLE_B2DDRAW); // process content recursively process(rCandidate.get2DDecomposition(getViewInformation2D())); - // restore ColorModifierStack - maBColorModifierStack.pop(); - // restore OutDev mpOutputDevice->Pop(); + mpOutputDevice->SetAntialiasing(nAntiAliasing); + break; + } + case PRIMITIVE2D_ID_EPSPRIMITIVE2D : + { + RenderEpsPrimitive2D(static_cast< const primitive2d::EpsPrimitive2D& >(rCandidate)); break; } default : diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 3412b5db5598..bd9439ef9339 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -63,6 +63,8 @@ #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx> #include <tools/diagnose_ex.h> #include <vcl/metric.hxx> +#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> +#include <drawinglayer/primitive2d/epsprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// // control support @@ -99,34 +101,6 @@ namespace drawinglayer using ::com::sun::star::awt::XWindow; using ::com::sun::star::awt::PosSize::POSSIZE; - static FontUnderline mapTextLineStyle(primitive2d::FontUnderline eLineStyle) - { - switch(eLineStyle) - { - default: - DBG_WARNING1( "DrawingLayer: Unknown text line style attribute (%d)!", eLineStyle ); - // fall through - case primitive2d::FONT_UNDERLINE_NONE: return UNDERLINE_NONE; - case primitive2d::FONT_UNDERLINE_SINGLE: return UNDERLINE_SINGLE; - case primitive2d::FONT_UNDERLINE_DOUBLE: return UNDERLINE_DOUBLE; - case primitive2d::FONT_UNDERLINE_DOTTED: return UNDERLINE_DOTTED; - case primitive2d::FONT_UNDERLINE_DASH: return UNDERLINE_DASH; - case primitive2d::FONT_UNDERLINE_LONGDASH: return UNDERLINE_LONGDASH; - case primitive2d::FONT_UNDERLINE_DASHDOT: return UNDERLINE_DASHDOT; - case primitive2d::FONT_UNDERLINE_DASHDOTDOT: return UNDERLINE_DASHDOTDOT; - case primitive2d::FONT_UNDERLINE_SMALLWAVE: return UNDERLINE_SMALLWAVE; - case primitive2d::FONT_UNDERLINE_WAVE: return UNDERLINE_WAVE; - case primitive2d::FONT_UNDERLINE_DOUBLEWAVE: return UNDERLINE_DOUBLEWAVE; - case primitive2d::FONT_UNDERLINE_BOLD: return UNDERLINE_BOLD; - case primitive2d::FONT_UNDERLINE_BOLDDOTTED: return UNDERLINE_BOLDDOTTED; - case primitive2d::FONT_UNDERLINE_BOLDDASH: return UNDERLINE_BOLDDASH; - case primitive2d::FONT_UNDERLINE_BOLDLONGDASH: return UNDERLINE_LONGDASH; - case primitive2d::FONT_UNDERLINE_BOLDDASHDOT: return UNDERLINE_BOLDDASHDOT; - case primitive2d::FONT_UNDERLINE_BOLDDASHDOTDOT:return UNDERLINE_BOLDDASHDOT; - case primitive2d::FONT_UNDERLINE_BOLDWAVE: return UNDERLINE_BOLDWAVE; - } - } - ////////////////////////////////////////////////////////////////////////////// // rendering support @@ -157,8 +131,8 @@ namespace drawinglayer if(basegfx::fTools::more(aFontScaling.getX(), 0.0) && basegfx::fTools::more(aFontScaling.getY(), 0.0)) { // Get the VCL font (use FontHeight as FontWidth) - Font aFont(primitive2d::getVclFontFromFontAttributes( - rTextCandidate.getFontAttributes(), + Font aFont(primitive2d::getVclFontFromFontAttribute( + rTextCandidate.getFontAttribute(), aFontScaling.getX(), aFontScaling.getY(), fRotate, @@ -176,7 +150,7 @@ namespace drawinglayer mpOutputDevice->SetTextLineColor( Color(aTextlineColor) ); // set Overline attribute - FontUnderline eFontOverline = mapTextLineStyle( pTCPP->getFontOverline() ); + const FontUnderline eFontOverline(primitive2d::mapTextLineToFontUnderline( pTCPP->getFontOverline() )); if( eFontOverline != UNDERLINE_NONE ) { aFont.SetOverline( eFontOverline ); @@ -187,7 +161,7 @@ namespace drawinglayer } // set Underline attribute - FontUnderline eFontUnderline = mapTextLineStyle( pTCPP->getFontUnderline() ); + const FontUnderline eFontUnderline(primitive2d::mapTextLineToFontUnderline( pTCPP->getFontUnderline() )); if( eFontUnderline != UNDERLINE_NONE ) { aFont.SetUnderline( eFontUnderline ); @@ -198,35 +172,23 @@ namespace drawinglayer } // set Strikeout attribute - FontStrikeout eFontStrikeout = STRIKEOUT_NONE; - switch( pTCPP->getFontStrikeout() ) - { - default: - DBG_WARNING1( "DrawingLayer: Unknown strikeout attribute (%d)!", pTCPP->getFontStrikeout() ); - // fall through - case primitive2d::FONT_STRIKEOUT_NONE: eFontStrikeout = STRIKEOUT_NONE; break; - case primitive2d::FONT_STRIKEOUT_SINGLE: eFontStrikeout = STRIKEOUT_SINGLE; break; - case primitive2d::FONT_STRIKEOUT_DOUBLE: eFontStrikeout = STRIKEOUT_DOUBLE; break; - case primitive2d::FONT_STRIKEOUT_BOLD: eFontStrikeout = STRIKEOUT_BOLD; break; - case primitive2d::FONT_STRIKEOUT_SLASH: eFontStrikeout = STRIKEOUT_SLASH; break; - case primitive2d::FONT_STRIKEOUT_X: eFontStrikeout = STRIKEOUT_X; break; - } + const FontStrikeout eFontStrikeout(primitive2d::mapTextStrikeoutToFontStrikeout(pTCPP->getTextStrikeout())); if( eFontStrikeout != STRIKEOUT_NONE ) aFont.SetStrikeout( eFontStrikeout ); // set EmphasisMark attribute FontEmphasisMark eFontEmphasisMark = EMPHASISMARK_NONE; - switch( pTCPP->getFontEmphasisMark() ) + switch( pTCPP->getTextEmphasisMark() ) { default: - DBG_WARNING1( "DrawingLayer: Unknown EmphasisMark style (%d)!", pTCPP->getFontEmphasisMark() ); + DBG_WARNING1( "DrawingLayer: Unknown EmphasisMark style (%d)!", pTCPP->getTextEmphasisMark() ); // fall through - case primitive2d::FONT_EMPHASISMARK_NONE: eFontEmphasisMark = EMPHASISMARK_NONE; break; - case primitive2d::FONT_EMPHASISMARK_DOT: eFontEmphasisMark = EMPHASISMARK_DOT; break; - case primitive2d::FONT_EMPHASISMARK_CIRCLE: eFontEmphasisMark = EMPHASISMARK_CIRCLE; break; - case primitive2d::FONT_EMPHASISMARK_DISC: eFontEmphasisMark = EMPHASISMARK_DISC; break; - case primitive2d::FONT_EMPHASISMARK_ACCENT: eFontEmphasisMark = EMPHASISMARK_ACCENT; break; + case primitive2d::TEXT_EMPHASISMARK_NONE: eFontEmphasisMark = EMPHASISMARK_NONE; break; + case primitive2d::TEXT_EMPHASISMARK_DOT: eFontEmphasisMark = EMPHASISMARK_DOT; break; + case primitive2d::TEXT_EMPHASISMARK_CIRCLE: eFontEmphasisMark = EMPHASISMARK_CIRCLE; break; + case primitive2d::TEXT_EMPHASISMARK_DISC: eFontEmphasisMark = EMPHASISMARK_DISC; break; + case primitive2d::TEXT_EMPHASISMARK_ACCENT: eFontEmphasisMark = EMPHASISMARK_ACCENT; break; } if( eFontEmphasisMark != EMPHASISMARK_NONE ) @@ -242,14 +204,14 @@ namespace drawinglayer // set Relief attribute FontRelief eFontRelief = RELIEF_NONE; - switch( pTCPP->getFontRelief() ) + switch( pTCPP->getTextRelief() ) { default: - DBG_WARNING1( "DrawingLayer: Unknown Relief style (%d)!", pTCPP->getFontRelief() ); + DBG_WARNING1( "DrawingLayer: Unknown Relief style (%d)!", pTCPP->getTextRelief() ); // fall through - case primitive2d::FONT_RELIEF_NONE: eFontRelief = RELIEF_NONE; break; - case primitive2d::FONT_RELIEF_EMBOSSED: eFontRelief = RELIEF_EMBOSSED; break; - case primitive2d::FONT_RELIEF_ENGRAVED: eFontRelief = RELIEF_ENGRAVED; break; + case primitive2d::TEXT_RELIEF_NONE: eFontRelief = RELIEF_NONE; break; + case primitive2d::TEXT_RELIEF_EMBOSSED: eFontRelief = RELIEF_EMBOSSED; break; + case primitive2d::TEXT_RELIEF_ENGRAVED: eFontRelief = RELIEF_ENGRAVED; break; } if( eFontRelief != RELIEF_NONE ) @@ -282,7 +244,7 @@ namespace drawinglayer const Point aStartPoint(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())); const sal_uInt32 nOldLayoutMode(mpOutputDevice->GetLayoutMode()); - if(rTextCandidate.getFontAttributes().getRTL()) + if(rTextCandidate.getFontAttribute().getRTL()) { sal_uInt32 nRTLLayoutMode(nOldLayoutMode & ~(TEXT_LAYOUT_COMPLEX_DISABLED|TEXT_LAYOUT_BIDI_STRONG)); nRTLLayoutMode |= TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_TEXTORIGIN_LEFT; @@ -310,7 +272,7 @@ namespace drawinglayer rTextCandidate.getTextLength()); } - if(rTextCandidate.getFontAttributes().getRTL()) + if(rTextCandidate.getFontAttribute().getRTL()) { mpOutputDevice->SetLayoutMode(nOldLayoutMode); } @@ -428,7 +390,7 @@ namespace drawinglayer { // no shear or rotate, draw direct in pixel coordinates bPrimitiveAccepted = true; - BitmapEx aBitmapEx(rFillBitmapAttribute.getBitmap()); + BitmapEx aBitmapEx(rFillBitmapAttribute.getBitmapEx()); bool bPainted(false); if(maBColorModifierStack.count()) @@ -547,21 +509,32 @@ namespace drawinglayer basegfx::BColor aStartColor(maBColorModifierStack.getModifiedColor(rGradient.getStartColor())); basegfx::BColor aEndColor(maBColorModifierStack.getModifiedColor(rGradient.getEndColor())); basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon()); - aLocalPolyPolygon.transform(maCurrentTransformation); - if(aStartColor == aEndColor) - { - // no gradient at all, draw as polygon - mpOutputDevice->SetLineColor(); - mpOutputDevice->SetFillColor(Color(aStartColor)); - mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon); - } - else + if(aLocalPolyPolygon.count()) { - impDrawGradientToOutDev( - *mpOutputDevice, aLocalPolyPolygon, rGradient.getStyle(), rGradient.getSteps(), - aStartColor, aEndColor, rGradient.getBorder(), - -rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false); + aLocalPolyPolygon.transform(maCurrentTransformation); + + if(aStartColor == aEndColor) + { + // no gradient at all, draw as polygon in AA and non-AA case + mpOutputDevice->SetLineColor(); + mpOutputDevice->SetFillColor(Color(aStartColor)); + mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon); + } + else if(getOptionsDrawinglayer().IsAntiAliasing()) + { + // For AA, direct render has to be avoided since it uses XOR maskings which will not + // work with AA. Instead, the decompose which uses MaskPrimitive2D with fillings is + // used + process(rPolygonCandidate.get2DDecomposition(getViewInformation2D())); + } + else + { + impDrawGradientToOutDev( + *mpOutputDevice, aLocalPolyPolygon, rGradient.getStyle(), rGradient.getSteps(), + aStartColor, aEndColor, rGradient.getBorder(), + -rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false); + } } } @@ -574,9 +547,9 @@ namespace drawinglayer if(rPolyPolygon.count()) { const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPolygonCandidate.getFillBitmap(); - const Bitmap& rBitmap = rFillBitmapAttribute.getBitmap(); + const BitmapEx& rBitmapEx = rFillBitmapAttribute.getBitmapEx(); - if(rBitmap.IsEmpty()) + if(rBitmapEx.IsEmpty()) { // empty bitmap, done bDone = true; @@ -668,7 +641,9 @@ namespace drawinglayer aLocalPolyPolygon.transform(maCurrentTransformation); mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon); - if(mnPolygonStrokePrimitive2D && getOptionsDrawinglayer().IsAntiAliasing()) + if(mnPolygonStrokePrimitive2D + && getOptionsDrawinglayer().IsAntiAliasing() + && (mpOutputDevice->GetAntialiasing() & ANTIALIASING_ENABLE_B2DDRAW)) { // when AA is on and this filled polygons are the result of stroked line geometry, // draw the geometry once extra as lines to avoid AA 'gaps' between partial polygons @@ -1256,6 +1231,43 @@ namespace drawinglayer } } + void VclProcessor2D::RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D) + { + // The new decomposition of Metafiles made it necessary to add an Eps + // primitive to handle embedded Eps data. On some devices, this can be + // painted directly (mac, printer). + // To be able to handle the replacement correctly, i need to handle it myself + // since DrawEPS will not be able e.g. to rotate the replacement. To be able + // to do that, i added a boolean return to OutputDevice::DrawEPS(..) + // to know when EPS was handled directly already. + basegfx::B2DRange aRange(0.0, 0.0, 1.0, 1.0); + aRange.transform(maCurrentTransformation * rEpsPrimitive2D.getEpsTransform()); + + if(!aRange.isEmpty()) + { + const Rectangle aRectangle( + (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()), + (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY())); + + if(!aRectangle.IsEmpty()) + { + // try to paint EPS directly without fallback visualisation + const bool bEPSPaintedDirectly(mpOutputDevice->DrawEPS( + aRectangle.TopLeft(), + aRectangle.GetSize(), + rEpsPrimitive2D.getGfxLink(), + 0)); + + if(!bEPSPaintedDirectly) + { + // use the decomposition which will correctly handle the + // fallback visualisation using full transformation (e.g. rotation) + process(rEpsPrimitive2D.get2DDecomposition(getViewInformation2D())); + } + } + } + } + void VclProcessor2D::adaptLineToFillDrawMode() const { const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode()); diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx index 99f5801c60e3..42e2e1565803 100644 --- a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx +++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx @@ -73,8 +73,8 @@ namespace drawinglayer return; } - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rCandidate.getPrimitiveID()) + // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch + switch(rCandidate.getPrimitive3DID()) { case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D : { diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index d9194ca4b5eb..1be93d83b9a9 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -234,19 +234,19 @@ namespace drawinglayer texture::GeoTexSvx* pOldTex = mpGeoTexSvx; // create texture - const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPrimitive.getBitmap(); + const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPrimitive.getFillBitmapAttribute(); if(rFillBitmapAttribute.getTiling()) { mpGeoTexSvx = new texture::GeoTexSvxBitmapTiled( - rFillBitmapAttribute.getBitmap(), + rFillBitmapAttribute.getBitmapEx().GetBitmap(), rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(), rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()); } else { mpGeoTexSvx = new texture::GeoTexSvxBitmap( - rFillBitmapAttribute.getBitmap(), + rFillBitmapAttribute.getBitmapEx().GetBitmap(), rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(), rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()); } @@ -468,8 +468,8 @@ namespace drawinglayer void DefaultProcessor3D::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive) { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rBasePrimitive.getPrimitiveID()) + // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch + switch(rBasePrimitive.getPrimitive3DID()) { case PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D : { diff --git a/drawinglayer/source/processor3d/geometry2dextractor.cxx b/drawinglayer/source/processor3d/geometry2dextractor.cxx index 8c19a4a2e3b8..c2e1c73b5181 100644 --- a/drawinglayer/source/processor3d/geometry2dextractor.cxx +++ b/drawinglayer/source/processor3d/geometry2dextractor.cxx @@ -62,8 +62,8 @@ namespace drawinglayer // virtual render method when the primitive implementation is BasePrimitive3D-based. void Geometry2DExtractingProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate) { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rCandidate.getPrimitiveID()) + // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch + switch(rCandidate.getPrimitive3DID()) { case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D : { diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx index 66d3c073854f..5e6678fc3a8e 100644 --- a/drawinglayer/source/processor3d/shadow3dextractor.cxx +++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx @@ -63,8 +63,8 @@ namespace drawinglayer // virtual render method when the primitive implementation is BasePrimitive3D-based. void Shadow3DExtractingProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate) { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rCandidate.getPrimitiveID()) + // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch + switch(rCandidate.getPrimitive3DID()) { case PRIMITIVE3D_ID_SHADOWPRIMITIVE3D : { diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index b5a59e10a119..48c1bee86575 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -486,8 +486,8 @@ namespace drawinglayer // the processing method for a single, known primitive void ZBufferProcessor3D::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive) { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rBasePrimitive.getPrimitiveID()) + // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch + switch(rBasePrimitive.getPrimitive3DID()) { case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D : { diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx index 4f784c71897f..1cc6730da33c 100644 --- a/drawinglayer/source/texture/texture.cxx +++ b/drawinglayer/source/texture/texture.cxx @@ -39,6 +39,7 @@ #include <drawinglayer/texture/texture.hxx> #include <basegfx/numeric/ftools.hxx> #include <basegfx/tools/gradienttools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -596,9 +597,8 @@ namespace drawinglayer basegfx::B2DPoint aCenter(0.5, 0.5); aCenter *= maTextureTransform; - maTextureTransform.translate(-aCenter.getX(), -aCenter.getY()); - maTextureTransform.rotate(fAngle); - maTextureTransform.translate(aCenter.getX(), aCenter.getY()); + maTextureTransform = basegfx::tools::createRotateAroundPoint(aCenter, fAngle) + * maTextureTransform; } // add object translate diff --git a/extensions/source/plugin/unx/makefile.mk b/extensions/source/plugin/unx/makefile.mk index 902348f0cb7d..5280272af543 100644 --- a/extensions/source/plugin/unx/makefile.mk +++ b/extensions/source/plugin/unx/makefile.mk @@ -77,7 +77,7 @@ APP1STDLIBS=\ $(VOSLIB) \ $(SALLIB) .IF "$(OS)"=="SOLARIS" || "$(OS)"=="SCO" || "$(OS)"=="HPUX" -APP1STDLIBS+=-lXm -lXt -lXext -lX11 -ldl +APP1STDLIBS+=-lXm -lXt $(X11LINK_DYNAMIC) -ldl .ELSE .IF "$(DISABLE_XAW)" != "TRUE" APP1STDLIBS+=-lXaw @@ -85,7 +85,7 @@ APP1STDLIBS+=-lXaw .IF "$(OS)"=="FREEBSD" || "$(OS)"=="NETBSD" APP1STDLIBS+= -lXt -lXext -lX11 .ELSE -APP1STDLIBS+= -lXt -lXext -lX11 -ldl +APP1STDLIBS+= -lXt $(X11LINK_DYNAMIC) -ldl .ENDIF .ENDIF diff --git a/external/gcc3_specific/makefile.mk b/external/gcc3_specific/makefile.mk index fa409df5a707..4ad02335c8ea 100644 --- a/external/gcc3_specific/makefile.mk +++ b/external/gcc3_specific/makefile.mk @@ -43,7 +43,6 @@ $(MINGWGXXDLL) : .IF "$(SYSTEM_STDLIBS)" != "YES" && "$(COMID)"=="gcc3" .IF "$(OS)"!="MACOSX" -.IF "$(OS)"!="IRIX" .IF "$(OS)"!="FREEBSD" .EXPORT : CC @@ -59,7 +58,6 @@ $(LB)$/libgcc_s.so.1 : .ENDIF .ENDIF -.ENDIF .ENDIF diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx index 0ec6e6d3cb4a..968c7b513ea5 100644 --- a/filter/source/flash/swfwriter.cxx +++ b/filter/source/flash/swfwriter.cxx @@ -33,6 +33,7 @@ #include "swfwriter.hxx" #include <vcl/virdev.hxx> #include <vcl/gdimtf.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> using namespace ::swf; using namespace ::std; @@ -248,8 +249,10 @@ void Writer::placeShape( sal_uInt16 nID, sal_uInt16 nDepth, sal_Int32 x, sal_Int mpTag->addUI16( nDepth ); // depth mpTag->addUI16( nID ); // character Id - ::basegfx::B2DHomMatrix aMatrix; // #i73264# - aMatrix.translate( _Int16(static_cast<long>(map100thmm(x)*mnDocXScale)), _Int16(static_cast<long>(map100thmm(y)*mnDocYScale))); + // #i73264# + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + _Int16(static_cast<long>(map100thmm(x)*mnDocXScale)), + _Int16(static_cast<long>(map100thmm(y)*mnDocYScale)))); mpTag->addMatrix( aMatrix ); // transformation matrix if( pName ) @@ -280,8 +283,10 @@ void Writer::moveShape( sal_uInt16 nDepth, sal_Int32 x, sal_Int32 y ) mpTag->addBits( aBits ); mpTag->addUI16( nDepth ); // depth - ::basegfx::B2DHomMatrix aMatrix; // #i73264# - aMatrix.translate( _Int16(static_cast<long>(map100thmm(x)*mnDocXScale)), _Int16(static_cast<long>(map100thmm(y)*mnDocYScale))); + // #i73264# + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + _Int16(static_cast<long>(map100thmm(x)*mnDocXScale)), + _Int16(static_cast<long>(map100thmm(y)*mnDocYScale)))); mpTag->addMatrix( aMatrix ); // transformation matrix endTag(); diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx index d91410c36b98..e8c75b8095b6 100644 --- a/filter/source/flash/swfwriter.hxx +++ b/filter/source/flash/swfwriter.hxx @@ -63,6 +63,8 @@ class PolyPolygon; class Gradient; class SvtGraphicFill; class SvtGraphicStroke; +class LineInfo; +namespace basegfx { class B2DPolygon; } inline sal_uInt16 _uInt16( sal_Int32 nValue ) { @@ -363,6 +365,7 @@ private: void Impl_writeBmp( sal_uInt16 nBitmapId, sal_uInt32 width, sal_uInt32 height, sal_uInt8 *pCompressed, sal_uInt32 compressed_size ); void Impl_writeImage( const BitmapEx& rBmpEx, const Point& rPt, const Size& rSz, const Point& rSrcPt, const Size& rSrcSz, const Rectangle& rClipRect, bool bMap ); void Impl_writeJPEG(sal_uInt16 nBitmapId, const sal_uInt8* pJpgData, sal_uInt32 nJpgDataLength, sal_uInt8 *pCompressed, sal_uInt32 compressed_size ); + void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void Impl_writeActions( const GDIMetaFile& rMtf ); void Impl_writePolygon( const Polygon& rPoly, sal_Bool bFilled ); void Impl_writePolygon( const Polygon& rPoly, sal_Bool bFilled, const Color& rFillColor, const Color& rLineColor ); diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 6718cc4be8be..ffe26c35699b 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -33,7 +33,6 @@ #include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> - #include <comphelper/processfactory.hxx> #include "swfwriter.hxx" #include <vcl/metaact.hxx> @@ -41,8 +40,7 @@ #include <vcl/bmpacc.hxx> #include <vcl/virdev.hxx> #include <vcl/metric.hxx> - - +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svtools/filter.hxx> #include <vcl/graphictools.hxx> @@ -53,7 +51,10 @@ #include <external/zlib/zlib.h> #endif #endif + #include <vcl/salbtype.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> using namespace ::swf; using namespace ::std; @@ -640,9 +641,6 @@ void Writer::Impl_writeText( const Point& rPos, const String& rText, const sal_I // CL: This is still a hack until we figure out how to calculate a correct bound rect // for rotatet text Rectangle textBounds( 0, 0, static_cast<long>(mnDocWidth*mnDocXScale), static_cast<long>(mnDocHeight*mnDocYScale) ); - - ::basegfx::B2DHomMatrix m; // #i73264# - double scale = 1.0; // scale width if we have a stretched text @@ -660,7 +658,7 @@ void Writer::Impl_writeText( const Point& rPos, const String& rText, const sal_I scale = (double)n1 / (double)n2; } - m.rotate( static_cast<double>(nOrientation) * F_PI1800 ); + basegfx::B2DHomMatrix m(basegfx::tools::createRotateB2DHomMatrix(static_cast<double>(nOrientation) * F_PI1800)); m.translate( double(aPt.X() / scale), double(aPt.Y()) ); m.scale( scale, scale ); @@ -1240,6 +1238,12 @@ bool Writer::Impl_writeStroke( SvtGraphicStroke& rStroke ) Rectangle aNewRect( aPolyPolygon.GetBoundRect() ); + // as log as not LINESTYLE2 and DefineShape4 is used (which + // added support for LineJoin), only round LineJoins are + // supported. Fallback to META_POLYLINE_ACTION and META_LINE_ACTION + if(SvtGraphicStroke::joinRound != rStroke.getJoinType()) + return false; + PolyPolygon aStartArrow; rStroke.getStartArrow( aStartArrow ); if( 0 != aStartArrow.Count() ) @@ -1395,6 +1399,46 @@ bool Writer::Impl_writePageField( Rectangle& rTextBounds ) // ----------------------------------------------------------------------------- +void Writer::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon) +{ + if(rLinePolygon.count()) + { + basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon); + basegfx::B2DPolyPolygon aFillPolyPolygon; + + rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon); + + if(aLinePolyPolygon.count()) + { + for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) + { + const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); + Impl_writePolygon(Polygon(aCandidate), sal_False ); + } + } + + if(aFillPolyPolygon.count()) + { + const Color aOldLineColor(mpVDev->GetLineColor()); + const Color aOldFillColor(mpVDev->GetFillColor()); + + mpVDev->SetLineColor(); + mpVDev->SetFillColor(aOldLineColor); + + for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++) + { + const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a)); + Impl_writePolyPolygon(PolyPolygon(Polygon(aPolygon)), sal_True ); + } + + mpVDev->SetLineColor(aOldLineColor); + mpVDev->SetFillColor(aOldFillColor); + } + } +} + +// ----------------------------------------------------------------------------- + void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) { Rectangle clipRect; @@ -1426,7 +1470,18 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) { const MetaLineAction* pA = (const MetaLineAction*) pAction; - Impl_writeLine( pA->GetStartPoint(), pA->GetEndPoint() ); + if(pA->GetLineInfo().IsDefault()) + { + Impl_writeLine( pA->GetStartPoint(), pA->GetEndPoint() ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + basegfx::B2DPolygon aPolygon; + aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y())); + aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y())); + Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon); + } } break; @@ -1501,7 +1556,17 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) const Polygon& rPoly = pA->GetPolygon(); if( rPoly.GetSize() ) - Impl_writePolygon( rPoly, sal_False ); + { + if(pA->GetLineInfo().IsDefault()) + { + Impl_writePolygon( rPoly, sal_False ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon()); + } + } } break; diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index bbc5746cf2cd..891439668c91 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -32,6 +32,7 @@ #include "precompiled_filter.hxx" #include "swfwriter.hxx" #include <vcl/virdev.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <math.h> @@ -608,10 +609,7 @@ struct GradRecord void FillStyle::Impl_addGradient( Tag* pTag ) const { vector< struct GradRecord > aGradientRecords; - - ::basegfx::B2DHomMatrix m; // #i73264# - - m.rotate( (maGradient.GetAngle() - 900) * F_PI1800 ); + basegfx::B2DHomMatrix m(basegfx::tools::createRotateB2DHomMatrix((maGradient.GetAngle() - 900) * F_PI1800)); switch( maGradient.GetStyle() ) { diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 714ed9df7dc4..ab746ff725e8 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -1365,7 +1365,6 @@ sal_Bool PDFExport::ImplWriteActions( PDFWriter& rWriter, PDFExtOutDevData* pPDF PolyPolygon aEndArrow; double fTransparency( aStroke.getTransparency() ); double fStrokeWidth( aStroke.getStrokeWidth() ); - SvtGraphicStroke::JoinType eJT( aStroke.getJoinType() ); SvtGraphicStroke::DashArray aDashArray; aStroke.getStartArrow( aStartArrow ); @@ -1375,8 +1374,6 @@ sal_Bool PDFExport::ImplWriteActions( PDFWriter& rWriter, PDFExtOutDevData* pPDF bSkipSequence = sal_True; if ( aStartArrow.Count() || aEndArrow.Count() ) bSkipSequence = sal_False; - if ( (sal_uInt32)eJT > 2 ) - bSkipSequence = sal_False; if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) ) bSkipSequence = sal_False; if ( bSkipSequence ) @@ -1404,7 +1401,40 @@ sal_Bool PDFExport::ImplWriteActions( PDFWriter& rWriter, PDFExtOutDevData* pPDF break; } aInfo.m_aDashArray = aDashArray; - rWriter.DrawPolyLine( aPath, aInfo ); + + if(SvtGraphicStroke::joinNone == aStroke.getJoinType() + && fStrokeWidth > 0.0) + { + // emulate no edge rounding by handling single edges + const sal_uInt16 nPoints(aPath.GetSize()); + const bool bCurve(aPath.HasFlags()); + + for(sal_uInt16 a(0); a + 1 < nPoints; a++) + { + if(bCurve + && POLY_NORMAL != aPath.GetFlags(a + 1) + && a + 2 < nPoints + && POLY_NORMAL != aPath.GetFlags(a + 2) + && a + 3 < nPoints) + { + const Polygon aSnippet(4, + aPath.GetConstPointAry() + a, + aPath.GetConstFlagAry() + a); + rWriter.DrawPolyLine( aSnippet, aInfo ); + a += 2; + } + else + { + const Polygon aSnippet(2, + aPath.GetConstPointAry() + a); + rWriter.DrawPolyLine( aSnippet, aInfo ); + } + } + } + else + { + rWriter.DrawPolyLine( aPath, aInfo ); + } } } else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) ) diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index b66118c53473..fca8f8d48a3d 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -330,7 +330,7 @@ NMSP_RTL::OUString SVGAttributeWriter::GetFontStyle( const Font& rFont ) // ----------------------------------------------------------------------------- -NMSP_RTL::OUString SVGAttributeWriter::GetPaintStyle( const Color& rLineColor, const Color& rFillColor ) +NMSP_RTL::OUString SVGAttributeWriter::GetPaintStyle( const Color& rLineColor, const Color& rFillColor, const LineInfo* pLineInfo ) { FastString aStyle; @@ -357,6 +357,68 @@ NMSP_RTL::OUString SVGAttributeWriter::GetPaintStyle( const Color& rLineColor, c aStyle += B2UCONST( "stroke-opacity:" ); aStyle += NMSP_RTL::OUString::valueOf( ( 255 - (double) rLineColor.GetTransparency() ) / 255.0 ); } + + if(pLineInfo) + { + // more infos for line needed + if(pLineInfo->GetWidth() > 1) + { + aStyle += B2UCONST( ";" ); + aStyle += B2UCONST( "stroke-width:" ); + aStyle += NMSP_RTL::OUString::valueOf(pLineInfo->GetWidth()); + } + + if(LINE_DASH == pLineInfo->GetStyle()) + { + aStyle += B2UCONST( ";" ); + aStyle += B2UCONST( "stroke-dasharray:" ); + const long nDashLen(pLineInfo->GetDashLen()); + const long nDotLen(pLineInfo->GetDotLen()); + const long nDistance(pLineInfo->GetDistance()); + bool bIsFirst(true); + + for(sal_uInt16 a(0); a < pLineInfo->GetDashCount(); a++) + { + if(bIsFirst) + aStyle += B2UCONST(" "), bIsFirst = false; + else + aStyle += B2UCONST(","); + aStyle += NMSP_RTL::OUString::valueOf(nDashLen); + aStyle += B2UCONST(","); + aStyle += NMSP_RTL::OUString::valueOf(nDistance); + } + + for(sal_uInt16 b(0); b < pLineInfo->GetDotCount(); b++) + { + if(bIsFirst) + aStyle += B2UCONST(" "), bIsFirst = false; + else + aStyle += B2UCONST(","); + aStyle += NMSP_RTL::OUString::valueOf(nDotLen); + aStyle += B2UCONST(","); + aStyle += NMSP_RTL::OUString::valueOf(nDistance); + } + } + + if(basegfx::B2DLINEJOIN_MITER != pLineInfo->GetLineJoin()) + { + aStyle += B2UCONST( ";" ); + aStyle += B2UCONST( "stroke-linejoin:" ); + + switch(pLineInfo->GetLineJoin()) + { + default: // B2DLINEJOIN_NONE, B2DLINEJOIN_MIDDLE, B2DLINEJOIN_MITER + aStyle += B2UCONST( "miter" ); + break; + case basegfx::B2DLINEJOIN_ROUND: + aStyle += B2UCONST( "round" ); + break; + case basegfx::B2DLINEJOIN_BEVEL: + aStyle += B2UCONST( "bevel" ); + break; + } + } + } } // fill color @@ -403,12 +465,12 @@ void SVGAttributeWriter::SetFontAttr( const Font& rFont ) // ----------------------------------------------------------------------------- -void SVGAttributeWriter::SetPaintAttr( const Color& rLineColor, const Color& rFillColor ) +void SVGAttributeWriter::SetPaintAttr( const Color& rLineColor, const Color& rFillColor, const LineInfo* pLineInfo ) { if( !mpElemPaint || ( rLineColor != maCurLineColor ) || ( rFillColor != maCurFillColor ) ) { delete mpElemPaint; - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, GetPaintStyle( maCurLineColor = rLineColor, maCurFillColor = rFillColor ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, GetPaintStyle( maCurLineColor = rLineColor, maCurFillColor = rFillColor, pLineInfo ) ); mpElemPaint = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, TRUE, TRUE ); } } @@ -460,6 +522,48 @@ Size SVGActionWriter::ImplMap( const Size& rSz ) const // ----------------------------------------------------------------------------- +LineInfo SVGActionWriter::ImplMap( const LineInfo& rLineInfo ) const +{ + LineInfo aInfo(rLineInfo); + long aTemp(0); + + if(aInfo.GetStyle() == LINE_DASH) + { + if(aInfo.GetDotCount() && aInfo.GetDotLen()) + { + aTemp = aInfo.GetDotLen(); + mpVDev->LogicToLogic(&aTemp, 1, &mpVDev->GetMapMode(), &maTargetMapMode); + aInfo.SetDotLen(Max(aTemp, 1L)); + } + else + aInfo.SetDotCount(0); + + if(aInfo.GetDashCount() && aInfo.GetDashLen()) + { + aTemp = aInfo.GetDashLen(); + mpVDev->LogicToLogic(&aTemp, 1, &mpVDev->GetMapMode(), &maTargetMapMode); + aInfo.SetDashLen(Max(aTemp, 1L)); + } + else + aInfo.SetDashCount(0); + + aTemp = aInfo.GetDistance(); + mpVDev->LogicToLogic(&aTemp, 1, &mpVDev->GetMapMode(), &maTargetMapMode); + aInfo.SetDistance(aTemp); + + if((!aInfo.GetDashCount() && !aInfo.GetDotCount()) || !aInfo.GetDistance()) + aInfo.SetStyle(LINE_SOLID); + } + + aTemp = aInfo.GetWidth(); + mpVDev->LogicToLogic(&aTemp, 1, &mpVDev->GetMapMode(), &maTargetMapMode); + aInfo.SetWidth(aTemp); + + return aInfo; +} + +// ----------------------------------------------------------------------------- + NMSP_RTL::OUString SVGActionWriter::GetValueString( sal_Int32 nVal ) { return ::rtl::OUString::valueOf( nVal ); @@ -1017,7 +1121,16 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, { const MetaLineAction* pA = (const MetaLineAction*) pAction; - mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetLineColor() ); + if(pA->GetLineInfo().IsDefault()) + { + mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetLineColor() ); + } + else + { + const LineInfo aMappedLineInfo(ImplMap(pA->GetLineInfo())); + mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetLineColor(), &aMappedLineInfo ); + } + ImplWriteLine( pA->GetStartPoint(), pA->GetEndPoint(), NULL, pStyle ); } } @@ -1113,8 +1226,51 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( rPoly.GetSize() ) { - mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() ); - ImplWritePolyPolygon( rPoly, sal_True, pStyle ); + bool bNoLineJoin(false); + + if(pA->GetLineInfo().IsDefault()) + { + mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() ); + } + else + { + const LineInfo aMappedLineInfo(ImplMap(pA->GetLineInfo())); + bNoLineJoin = basegfx::B2DLINEJOIN_NONE == aMappedLineInfo.GetLineJoin(); + mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor(), &aMappedLineInfo ); + } + + if(bNoLineJoin) + { + // emulate B2DLINEJOIN_NONE by creating single edges + const sal_uInt16 nPoints(rPoly.GetSize()); + const bool bCurve(rPoly.HasFlags()); + + for(sal_uInt16 a(0); a + 1 < nPoints; a++) + { + if(bCurve + && POLY_NORMAL != rPoly.GetFlags(a + 1) + && a + 2 < nPoints + && POLY_NORMAL != rPoly.GetFlags(a + 2) + && a + 3 < nPoints) + { + const Polygon aSnippet(4, + rPoly.GetConstPointAry() + a, + rPoly.GetConstFlagAry() + a); + ImplWritePolyPolygon( aSnippet, sal_True, pStyle ); + a += 2; + } + else + { + const Polygon aSnippet(2, + rPoly.GetConstPointAry() + a); + ImplWritePolyPolygon( aSnippet, sal_True, pStyle ); + } + } + } + else + { + ImplWritePolyPolygon( rPoly, sal_True, pStyle ); + } } } } diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index 2a1e5a9ee514..658fc19b0322 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -156,10 +156,10 @@ public: virtual ~SVGAttributeWriter(); ::rtl::OUString GetFontStyle( const Font& rFont ); - ::rtl::OUString GetPaintStyle( const Color& rLineColor, const Color& rFillColor ); + ::rtl::OUString GetPaintStyle( const Color& rLineColor, const Color& rFillColor, const LineInfo* pLineInfo ); void SetFontAttr( const Font& rFont ); - void SetPaintAttr( const Color& rLineColor, const Color& rFillColor ); + void SetPaintAttr( const Color& rLineColor, const Color& rFillColor, const LineInfo* pLineInfo = 0); }; // ------------------- @@ -192,6 +192,7 @@ private: long ImplMap( sal_Int32 nVal ) const; Point ImplMap( const Point& rPt ) const; Size ImplMap( const Size& rSz ) const; + LineInfo ImplMap( const LineInfo& rLineInfo ) const; inline Rectangle ImplMap( const Rectangle& rRect ) const { return Rectangle( ImplMap( rRect.TopLeft() ), ImplMap( rRect.GetSize() ) ); } void ImplWriteLine( const Point& rPt1, const Point& rPt2, const Color* pLineColor = NULL, const ::rtl::OUString* pStyle = NULL ); diff --git a/goodies/inc/grfmgr.hxx b/goodies/inc/grfmgr.hxx index b44c27ea65e3..1ef351ae6d32 100644 --- a/goodies/inc/grfmgr.hxx +++ b/goodies/inc/grfmgr.hxx @@ -353,7 +353,7 @@ public: void ReleaseFromCache(); const Graphic& GetGraphic() const; - void SetGraphic( const Graphic& rGraphic ); + void SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj = 0); void SetGraphic( const Graphic& rGraphic, const String& rLink ); /** Get graphic transformed according to given attributes diff --git a/goodies/source/filter.vcl/epict/epict.cxx b/goodies/source/filter.vcl/epict/epict.cxx index 3e4dca455d05..cd9e33edd5d9 100644 --- a/goodies/source/filter.vcl/epict/epict.cxx +++ b/goodies/source/filter.vcl/epict/epict.cxx @@ -55,6 +55,9 @@ #include "dlgepct.hrc" #include "dlgepct.hxx" +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> + //============================== PictWriter =================================== struct PictWriterAttrStackMember { @@ -77,7 +80,6 @@ struct PictPattern { sal_uInt32 nLo, nHi; }; - class PictWriter { private: @@ -178,6 +180,7 @@ private: void WriteTextArray(Point & rPoint, const String& rString, const sal_Int32 * pDXAry); + void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void WriteOpcodes(const GDIMetaFile & rMTF); void WriteHeader(const GDIMetaFile & rMTF); @@ -1371,6 +1374,65 @@ void PictWriter::WriteTextArray(Point & rPoint, const String& rString, const sal } } +void PictWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon) +{ + if(rLinePolygon.count()) + { + basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon); + basegfx::B2DPolyPolygon aFillPolyPolygon; + + rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon); + + if(aLinePolyPolygon.count()) + { + aLinePolyPolygon = aLinePolyPolygon.getDefaultAdaptiveSubdivision(); + const sal_uInt32 nPolyCount(aLinePolyPolygon.count()); + SetAttrForFrame(); + + for(sal_uInt32 a(0); a < nPolyCount; a++) + { + const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); + const sal_uInt32 nPointCount(aCandidate.count()); + + if(nPointCount) + { + const sal_uInt32 nEdgeCount(aCandidate.isClosed() ? nPointCount + 1 : nPointCount); + const basegfx::B2DPoint aCurr(aCandidate.getB2DPoint(0)); + Point nCurr(basegfx::fround(aCurr.getX()), basegfx::fround(aCurr.getY())); + + for(sal_uInt32 b(0); b < nEdgeCount; b++) + { + const sal_uInt32 nNextIndex((b + 1) % nPointCount); + const basegfx::B2DPoint aNext(aCandidate.getB2DPoint(nNextIndex)); + const Point nNext(basegfx::fround(aNext.getX()), basegfx::fround(aNext.getY())); + + WriteOpcode_Line(nCurr, nNext); + nCurr = nNext; + } + } + } + } + + if(aFillPolyPolygon.count()) + { + const Color aOldLineColor(aLineColor); + const Color aOldFillColor(aFillColor); + + aLineColor = Color( COL_TRANSPARENT ); + aFillColor = aOldLineColor; + SetAttrForPaint(); + + for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++) + { + const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a).getDefaultAdaptiveSubdivision()); + WriteOpcode_Poly(PDM_PAINT, aPolygon); + } + + aLineColor = aOldLineColor; + aFillColor = aOldFillColor; + } + } +} void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) { @@ -1417,8 +1479,19 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) if( aLineColor != Color( COL_TRANSPARENT ) ) { - SetAttrForFrame(); - WriteOpcode_Line( pA->GetStartPoint(),pA->GetEndPoint() ); + if(pA->GetLineInfo().IsDefault()) + { + SetAttrForFrame(); + WriteOpcode_Line( pA->GetStartPoint(),pA->GetEndPoint() ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + basegfx::B2DPolygon aPolygon; + aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y())); + aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y())); + HandleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon); + } } break; } @@ -1571,24 +1644,35 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) { const Polygon& rPoly = pA->GetPolygon(); - Polygon aSimplePoly; - if ( rPoly.HasFlags() ) - rPoly.AdaptiveSubdivide( aSimplePoly ); - else - aSimplePoly = rPoly; - - const USHORT nSize = aSimplePoly.GetSize(); - Point aLast; - - if ( nSize ) + if( rPoly.GetSize() ) { - SetAttrForFrame(); - aLast = aSimplePoly[0]; + if(pA->GetLineInfo().IsDefault()) + { + Polygon aSimplePoly; + if ( rPoly.HasFlags() ) + rPoly.AdaptiveSubdivide( aSimplePoly ); + else + aSimplePoly = rPoly; - for ( USHORT i = 1; i < nSize; i++ ) + const USHORT nSize = aSimplePoly.GetSize(); + Point aLast; + + if ( nSize ) + { + SetAttrForFrame(); + aLast = aSimplePoly[0]; + + for ( USHORT i = 1; i < nSize; i++ ) + { + WriteOpcode_Line( aLast, aSimplePoly[i] ); + aLast = aSimplePoly[i]; + } + } + } + else { - WriteOpcode_Line( aLast, aSimplePoly[i] ); - aLast = aSimplePoly[i]; + // LineInfo used; handle Dash/Dot and fat lines + HandleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon()); } } } diff --git a/goodies/source/filter.vcl/epict/makefile.mk b/goodies/source/filter.vcl/epict/makefile.mk index 4aa4bab80ffc..9f25a562488a 100644 --- a/goodies/source/filter.vcl/epict/makefile.mk +++ b/goodies/source/filter.vcl/epict/makefile.mk @@ -61,7 +61,7 @@ RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs .IF "$(L10N_framework)"=="" SHL1TARGET= ept$(DLLPOSTFIX) SHL1IMPLIB= epict -SHL1STDLIBS= $(TOOLSLIB) $(VCLLIB) $(SVTOOLLIB) $(CPPULIB) $(SALLIB) +SHL1STDLIBS= $(TOOLSLIB) $(VCLLIB) $(SVTOOLLIB) $(CPPULIB) $(SALLIB) $(BASEGFXLIB) SHL1LIBS= $(SLB)$/epict.lib diff --git a/goodies/source/filter.vcl/eps/eps.cxx b/goodies/source/filter.vcl/eps/eps.cxx index dc8e407b178e..83b5a94f97f2 100644 --- a/goodies/source/filter.vcl/eps/eps.cxx +++ b/goodies/source/filter.vcl/eps/eps.cxx @@ -388,7 +388,7 @@ BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter bTextFillColor = TRUE; aTextFillColor = Color( COL_BLACK ); fLineWidth = 1; - fMiterLimit = 10; + fMiterLimit = 15; // use same limit as most graphic systems and basegfx eLineCap = SvtGraphicStroke::capButt; eJoinType = SvtGraphicStroke::joinMiter; aBackgroundColor = Color( COL_WHITE ); @@ -701,7 +701,40 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) Polygon aPoly( ( (const MetaPolyLineAction*) pMA )->GetPolygon() ); const LineInfo& rLineInfo = ( ( const MetaPolyLineAction*)pMA )->GetLineInfo(); ImplWriteLineInfo( rLineInfo ); - ImplPolyLine( aPoly ); + + if(basegfx::B2DLINEJOIN_NONE == rLineInfo.GetLineJoin() + && rLineInfo.GetWidth() > 1) + { + // emulate B2DLINEJOIN_NONE by creating single edges + const sal_uInt16 nPoints(aPoly.GetSize()); + const bool bCurve(aPoly.HasFlags()); + + for(sal_uInt16 a(0); a + 1 < nPoints; a++) + { + if(bCurve + && POLY_NORMAL != aPoly.GetFlags(a + 1) + && a + 2 < nPoints + && POLY_NORMAL != aPoly.GetFlags(a + 2) + && a + 3 < nPoints) + { + const Polygon aSnippet(4, + aPoly.GetConstPointAry() + a, + aPoly.GetConstFlagAry() + a); + ImplPolyLine(aSnippet); + a += 2; + } + else + { + const Polygon aSnippet(2, + aPoly.GetConstPointAry() + a); + ImplPolyLine(aSnippet); + } + } + } + else + { + ImplPolyLine( aPoly ); + } } break; @@ -2343,8 +2376,28 @@ void PSWriter::ImplWriteLineInfo( const LineInfo& rLineInfo ) SvtGraphicStroke::DashArray l_aDashArray; if ( rLineInfo.GetStyle() == LINE_DASH ) l_aDashArray.push_back( 2 ); - double fLWidth = ( ( rLineInfo.GetWidth() + 1 ) + ( rLineInfo.GetWidth() + 1 ) ) * 0.5; - ImplWriteLineInfo( fLWidth, 10.0, SvtGraphicStroke::capButt, SvtGraphicStroke::joinMiter, l_aDashArray ); + const double fLWidth(( ( rLineInfo.GetWidth() + 1 ) + ( rLineInfo.GetWidth() + 1 ) ) * 0.5); + SvtGraphicStroke::JoinType aJoinType(SvtGraphicStroke::joinMiter); + + switch(rLineInfo.GetLineJoin()) + { + default: // B2DLINEJOIN_NONE, B2DLINEJOIN_MIDDLE + // do NOT use SvtGraphicStroke::joinNone here + // since it will be written as numerical value directly + // and is NOT a valid EPS value + break; + case basegfx::B2DLINEJOIN_MITER: + aJoinType = SvtGraphicStroke::joinMiter; + break; + case basegfx::B2DLINEJOIN_BEVEL: + aJoinType = SvtGraphicStroke::joinBevel; + break; + case basegfx::B2DLINEJOIN_ROUND: + aJoinType = SvtGraphicStroke::joinRound; + break; + } + + ImplWriteLineInfo( fLWidth, fMiterLimit, SvtGraphicStroke::capButt, aJoinType, l_aDashArray ); } //--------------------------------------------------------------------------------- diff --git a/goodies/source/filter.vcl/ios2met/ios2met.cxx b/goodies/source/filter.vcl/ios2met/ios2met.cxx index 0fbf24f56029..8c3c19e22379 100644 --- a/goodies/source/filter.vcl/ios2met/ios2met.cxx +++ b/goodies/source/filter.vcl/ios2met/ios2met.cxx @@ -846,7 +846,7 @@ void OS2METReader::ReadRelLine(BOOL bGivenPos, USHORT nOrderLen) if (nPolySize==0) return; Polygon aPolygon(nPolySize); for (i=0; i<nPolySize; i++) { -#if (defined SOLARIS && defined PPC) || defined IRIX +#if defined SOLARIS && defined PPC UINT8 nunsignedbyte; *pOS2MET >> nunsignedbyte; aP0.X()+=(INT8)nunsignedbyte; *pOS2MET >> nunsignedbyte; aP0.Y()+=(INT8)nunsignedbyte; diff --git a/goodies/source/graphic/grfmgr.cxx b/goodies/source/graphic/grfmgr.cxx index 39c1e53e7184..7f5970383075 100644 --- a/goodies/source/graphic/grfmgr.cxx +++ b/goodies/source/graphic/grfmgr.cxx @@ -845,7 +845,7 @@ const Graphic& GraphicObject::GetGraphic() const // ----------------------------------------------------------------------------- -void GraphicObject::SetGraphic( const Graphic& rGraphic ) +void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj ) { mpMgr->ImplUnregisterObj( *this ); @@ -858,7 +858,7 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic ) delete mpLink, mpLink = NULL; delete mpSimpleCache, mpSimpleCache = NULL; - mpMgr->ImplRegisterObj( *this, maGraphic ); + mpMgr->ImplRegisterObj( *this, maGraphic, 0, pCopyObj); if( mpSwapOutTimer ) mpSwapOutTimer->Start(); diff --git a/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf b/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf index f4da77d0d8b9..20f2a60dd195 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf +++ b/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf @@ -1,3 +1,4 @@ [OOO_LAUNCH_1] en-US = "The Installation Wizard cannot be run properly because you are logged in as a user without sufficient administrator rights for this system." - +[OOO_LAUNCH_2] +en-US = "Please use the file setup.exe to start the installation." diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt index 35d78694a664..c53ccda8d736 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt +++ b/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt @@ -2,3 +2,4 @@ Condition Description s255 l255 WINDOWSENCODINGTEMPLATE LaunchCondition Condition Privileged OOO_LAUNCH_1 +SETUP_USED=1 Or Installed OOO_LAUNCH_2 diff --git a/instsetoo_native/res/DS_Store b/instsetoo_native/res/DS_Store Binary files differindex d730660fb13f..3b7c9f7794b9 100644 --- a/instsetoo_native/res/DS_Store +++ b/instsetoo_native/res/DS_Store diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index 76c70ed8a435..e6ba698fae7f 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -4,24 +4,24 @@ Globals { variables { - OOOBASEVERSION 3.2 - OOOPACKAGEVERSION 3.2.0 - UREPACKAGEVERSION 1.6.0 + OOOBASEVERSION 3.3 + OOOPACKAGEVERSION 3.3.0 + UREPACKAGEVERSION 1.7.0 URELAYERVERSION 1 BASISROOTNAME OpenOffice.org UNIXBASISROOTNAME openoffice.org - SERVICETAG_PRODUCTNAME OpenOffice.org 3.2 - SERVICETAG_PRODUCTVERSION 3.2 - SERVICETAG_PARENTNAME OpenOffice.org 3.2 + SERVICETAG_PRODUCTNAME OpenOffice.org 3.3 + SERVICETAG_PRODUCTVERSION 3.3 + SERVICETAG_PARENTNAME OpenOffice.org 3.3 SERVICETAG_SOURCE {buildsource}{minor}(Build:{buildid}) - SERVICETAG_URN urn:uuid:cd39f1d0-f2fc-11dd-8c47-080020a9ed93 + SERVICETAG_URN urn:uuid:0187debd-e458-11de-82d6-080020a9ed93 HIDELICENSEDIALOG 1 PACKAGEPREFIX BASISPACKAGEPREFIX ooobasis UREPACKAGEPREFIX openoffice.org SOLSUREPACKAGEPREFIX openofficeorg USE_FILEVERSION 1 - LIBRARYVERSION 9.2.0 + LIBRARYVERSION 9.3.0 POOLPRODUCT 1 REGISTRATION_HOST https://registration2.services.openoffice.org/RegistrationWeb REGISTRATIONURL http://survey.services.openoffice.org/user/index.php @@ -35,7 +35,7 @@ Globals CREATE_MSP_INSTALLSET 0 UPDATE_DATABASE_LISTNAME finals_instsetoo.txt PACKAGEMAP package_names.txt,package_names_ext.txt - WINDOWSPATCHLEVEL 4 + WINDOWSPATCHLEVEL 6 } } } @@ -47,7 +47,7 @@ OpenOffice variables { PRODUCTNAME OpenOffice.org - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION @@ -55,10 +55,10 @@ OpenOffice POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3 USERDIRPRODUCTVERSION 3 - ABOUTBOXPRODUCTVERSION 3.2.0 - BASEPRODUCTVERSION 3.2 + ABOUTBOXPRODUCTVERSION 3.3.0 + BASEPRODUCTVERSION 3.3 PCPFILENAME openoffice.pcp - UPDATEURL http://update34.services.openoffice.org/ProductUpdateService/check.Update + UPDATEURL http://update36.services.openoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.services.openoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,userland.txt REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt @@ -67,7 +67,7 @@ OpenOffice FILEFORMATNAME OpenOffice.org FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} LICENSENAME LGPL SERVICESPROJEKT 1 @@ -83,7 +83,7 @@ OpenOffice STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.2.0 + LIBRARYVERSION 9.3.0 PATCHCODEFILE ooo_patchcodes.txt DOWNLOADBANNER ooobanner.bmp DOWNLOADBITMAP ooobitmap.bmp @@ -111,7 +111,7 @@ OpenOffice_wJRE variables { PRODUCTNAME OpenOffice.org - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION @@ -119,9 +119,9 @@ OpenOffice_wJRE POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3 USERDIRPRODUCTVERSION 3 - ABOUTBOXPRODUCTVERSION 3.2.0 - BASEPRODUCTVERSION 3.2 - UPDATEURL http://update34.services.openoffice.org/ProductUpdateService/check.Update + ABOUTBOXPRODUCTVERSION 3.3.0 + BASEPRODUCTVERSION 3.3 + UPDATEURL http://update36.services.openoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.services.openoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt @@ -130,7 +130,7 @@ OpenOffice_wJRE FILEFORMATNAME OpenOffice.org FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} LICENSENAME LGPL SERVICESPROJEKT 1 @@ -146,7 +146,7 @@ OpenOffice_wJRE STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.2.0 + LIBRARYVERSION 9.3.0 PATCHCODEFILE ooo_patchcodes.txt JAVAPRODUCT 1 DOWNLOADBANNER ooobanner.bmp @@ -174,7 +174,7 @@ OpenOffice_Dev variables { PRODUCTNAME OOo-dev - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION @@ -184,22 +184,22 @@ OpenOffice_Dev POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3 USERDIRPRODUCTVERSION 3 - ABOUTBOXPRODUCTVERSION 3.2.0 - BASEPRODUCTVERSION 3.2 + ABOUTBOXPRODUCTVERSION 3.3.0 + BASEPRODUCTVERSION 3.3 DEVELOPMENTPRODUCT 1 BASISPACKAGEPREFIX ooobasis-dev UREPACKAGEPREFIX ooodev SOLSUREPACKAGEPREFIX ooodev REGISTRYLAYERNAME LayerDev - SERVICETAG_URN urn:uuid:156a7974-f2fd-11dd-8c47-080020a9ed93 - UPDATEURL http://update34.services.openoffice.org/ProductUpdateService/check.Update + SERVICETAG_URN urn:uuid:1680b00d-e45c-11de-82d6-080020a9ed93 + UPDATEURL http://update36.services.openoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.services.openoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt EVAL FILEFORMATNAME OpenOffice.org FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} LICENSENAME LGPL SERVICESPROJEKT 1 @@ -216,7 +216,7 @@ OpenOffice_Dev CHANGETARGETDIR 1 USE_FILEVERSION 1 JAVAPRODUCT 1 - LIBRARYVERSION 9.2.0 + LIBRARYVERSION 9.3.0 PATCHCODEFILE ooodev_patchcodes.txt CODEFILENAME codes_ooodev.txt DOWNLOADBANNER ooobanner.bmp @@ -247,8 +247,8 @@ URE variables { PRODUCTNAME URE - PRODUCTVERSION 1.6 - PACKAGEVERSION 1.6 + PRODUCTVERSION 1.7 + PACKAGEVERSION 1.7 PACKAGEREVISION 1 PRODUCTEXTENSION LONG_PRODUCTEXTENSION @@ -288,14 +288,14 @@ OpenOffice_SDK variables { PRODUCTNAME OpenOffice.org - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION POSTVERSIONEXTENSION SDK POSTVERSIONEXTENSIONUNIX sdk BRANDPACKAGEVERSION 3 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} PACK_INSTALLED 1 POOLPRODUCT 0 @@ -331,7 +331,7 @@ OpenOffice_Dev_SDK variables { PRODUCTNAME OOo-dev - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION @@ -340,7 +340,7 @@ OpenOffice_Dev_SDK POSTVERSIONEXTENSION SDK POSTVERSIONEXTENSIONUNIX sdk BRANDPACKAGEVERSION 3 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} BASISPACKAGEPREFIX ooobasis-dev UREPACKAGEPREFIX ooodev @@ -379,7 +379,7 @@ BrOffice variables { PRODUCTNAME BrOffice.org - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION @@ -387,12 +387,12 @@ BrOffice POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3 USERDIRPRODUCTVERSION 3 - ABOUTBOXPRODUCTVERSION 3.2.0 + ABOUTBOXPRODUCTVERSION 3.3.0 PROGRESSBARCOLOR PROGRESSSIZE PROGRESSPOSITION PROGRESSFRAMECOLOR - UPDATEURL http://update34.services.openoffice.org/ProductUpdateService/check.Update + UPDATEURL http://update36.services.openoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.services.openoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,userland.txt REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt @@ -401,7 +401,7 @@ BrOffice FILEFORMATNAME OpenOffice.org FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} LICENSENAME LGPL SERVICESPROJEKT 1 @@ -417,7 +417,7 @@ BrOffice STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.2.0 + LIBRARYVERSION 9.3.0 CODEFILENAME codes_broo.txt PATCHCODEFILE bro_patchcodes.txt DOWNLOADBANNER brobanner.bmp @@ -446,7 +446,7 @@ BrOffice_wJRE variables { PRODUCTNAME BrOffice.org - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION @@ -454,12 +454,12 @@ BrOffice_wJRE POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3 USERDIRPRODUCTVERSION 3 - ABOUTBOXPRODUCTVERSION 3.2.0 + ABOUTBOXPRODUCTVERSION 3.3.0 PROGRESSBARCOLOR PROGRESSSIZE PROGRESSPOSITION PROGRESSFRAMECOLOR - UPDATEURL http://update34.services.openoffice.org/ProductUpdateService/check.Update + UPDATEURL http://update36.services.openoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.services.openoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt @@ -468,7 +468,7 @@ BrOffice_wJRE FILEFORMATNAME OpenOffice.org FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} LICENSENAME LGPL SERVICESPROJEKT 1 @@ -484,7 +484,7 @@ BrOffice_wJRE STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.2.0 + LIBRARYVERSION 9.3.0 CODEFILENAME codes_broo.txt PATCHCODEFILE bro_patchcodes.txt JAVAPRODUCT 1 @@ -513,7 +513,7 @@ BrOffice_Dev variables { PRODUCTNAME BrOo-dev - PRODUCTVERSION 3.2 + PRODUCTVERSION 3.3 PRODUCTEXTENSION LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION @@ -523,7 +523,7 @@ BrOffice_Dev POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3 USERDIRPRODUCTVERSION 3 - ABOUTBOXPRODUCTVERSION 3.2.0 + ABOUTBOXPRODUCTVERSION 3.3.0 DEVELOPMENTPRODUCT 1 PROGRESSBARCOLOR PROGRESSSIZE @@ -533,15 +533,15 @@ BrOffice_Dev UREPACKAGEPREFIX ooodev SOLSUREPACKAGEPREFIX ooodev REGISTRYLAYERNAME LayerDevBroffice - SERVICETAG_URN urn:uuid:156a7974-f2fd-11dd-8c47-080020a9ed93 - UPDATEURL http://update34.services.openoffice.org/ProductUpdateService/check.Update + SERVICETAG_URN urn:uuid:1680b00d-e45c-11de-82d6-080020a9ed93 + UPDATEURL http://update36.services.openoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.services.openoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt EVAL FILEFORMATNAME OpenOffice.org FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 - PACKAGEVERSION 3.2.0 + PACKAGEVERSION 3.3.0 PACKAGEREVISION {milestone} LICENSENAME LGPL SERVICESPROJEKT 1 @@ -558,7 +558,7 @@ BrOffice_Dev CHANGETARGETDIR 1 USE_FILEVERSION 1 JAVAPRODUCT 1 - LIBRARYVERSION 9.2.0 + LIBRARYVERSION 9.3.0 PATCHCODEFILE brodev_patchcodes.txt CODEFILENAME codes_broodev.txt DOWNLOADBANNER brobanner.bmp diff --git a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java index 36404f28d57e..aa9a21a26b22 100644 --- a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java +++ b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java @@ -37,7 +37,6 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; /** * The java_environment is the environment where objects and @@ -159,70 +158,64 @@ public final class java_environment implements IEnvironment { } private static final class Registry { - public Object register(Object object, String oid, Type type) { - synchronized (map) { - cleanUp(); - Level1Entry l1 = getLevel1Entry(oid); - if (l1 != null) { - Level2Entry l2 = l1.get(type); - if (l2 != null) { - Object o = l2.get(); - if (o != null) { - l2.acquire(); - return o; - } + public synchronized Object register( + Object object, String oid, Type type) + { + cleanUp(); + Level1Entry l1 = level1map.get(oid); + if (l1 != null) { + Level2Entry l2 = l1.level2map.get(type); + if (l2 != null) { + Object o = l2.get(); + if (o != null) { + l2.acquire(); + return o; } } - // TODO If a holder references an unreachable object, but still - // has a positive count, it is replaced with a new holder - // (referencing a reachable object, and with a count of 1). Any - // later calls to revoke that should decrement the count of the - // previous holder would now decrement the count of the new - // holder, removing it prematurely. This is a design flaw that - // will be fixed when IEnvironment.revokeInterface is changed to - // no longer use counting. (And this problem is harmless, as - // currently a holder either references a strongly held object - // and uses register/revoke to control it, or references a - // weakly held proxy and never revokes it.) - if (l1 == null) { - l1 = new Level1Entry(); - map.put(oid, l1); - } - l1.add(new Level2Entry(oid, type, object, queue)); } + // TODO If a holder references an unreachable object, but still has + // a positive count, it is replaced with a new holder (referencing a + // reachable object, and with a count of 1). Any later calls to + // revoke that should decrement the count of the previous holder + // would now decrement the count of the new holder, removing it + // prematurely. This is a design flaw that will be fixed when + // IEnvironment.revokeInterface is changed to no longer use + // counting. (And this problem is harmless, as currently a holder + // either references a strongly held object and uses register/revoke + // to control it, or references a weakly held proxy and never + // revokes it.) + if (l1 == null) { + l1 = new Level1Entry(); + level1map.put(oid, l1); + } + l1.level2map.put(type, new Level2Entry(oid, type, object, queue)); return object; } - public boolean revoke(String oid, Type type) { - synchronized (map) { - Level1Entry l1 = getLevel1Entry(oid); - Level2Entry l2 = null; - if (l1 != null) { - l2 = l1.get(type); - if (l2 != null && l2.release()) { - removeLevel2Entry(oid, l1, l2); - } + public synchronized boolean revoke(String oid, Type type) { + Level1Entry l1 = level1map.get(oid); + Level2Entry l2 = null; + if (l1 != null) { + l2 = l1.level2map.get(type); + if (l2 != null && l2.release()) { + removeLevel2Entry(l1, oid, type); } - cleanUp(); - return l2 != null; } + cleanUp(); + return l2 != null; } - public Object get(String oid, Type type) { - synchronized (map) { - Level1Entry l1 = getLevel1Entry(oid); - return l1 == null ? null : l1.find(type); - } + public synchronized Object get(String oid, Type type) { + Level1Entry l1 = level1map.get(oid); + return l1 == null ? null : l1.find(type); } - public void clear() { - synchronized (map) { - map.clear(); - cleanUp(); - } + public synchronized void clear() { + level1map.clear(); + cleanUp(); } - // must only be called while synchronized on map: + // must only be called while synchronized on this Registry: private void cleanUp() { for (;;) { Level2Entry l2 = (Level2Entry) queue.poll(); @@ -235,55 +228,38 @@ public final class java_environment implements IEnvironment { // created since now e1.get() == null), and only then e1 is // enqueued. To not erroneously remove the new e2 in that case, // check whether the map still contains e1: - String oid = l2.getOid(); - Level1Entry l1 = getLevel1Entry(oid); - if (l1 != null && l1.get(l2.getType()) == l2) { - removeLevel2Entry(oid, l1, l2); + Level1Entry l1 = level1map.get(l2.oid); + if (l1 != null && l1.level2map.get(l2.type) == l2) { + removeLevel2Entry(l1, l2.oid, l2.type); } } } - // must only be called while synchronized on map: - private Level1Entry getLevel1Entry(String oid) { - return (Level1Entry) map.get(oid); - } - - // must only be called while synchronized on map: - private void removeLevel2Entry(String oid, Level1Entry l1, - Level2Entry l2) { - if (l1.remove(l2)) { - map.remove(oid); + // must only be called while synchronized on this Registry: + private void removeLevel2Entry(Level1Entry l1, String oid, Type type) { + l1.level2map.remove(type); + if (l1.level2map.isEmpty()) { + level1map.remove(oid); } } private static final class Level1Entry { - // must only be called while synchronized on map: - public Level2Entry get(Type type) { - for (Iterator i = list.iterator(); i.hasNext();) { - Level2Entry l2 = (Level2Entry) i.next(); - if (l2.getType().equals(type)) { - return l2; - } - } - return null; - } - - // must only be called while synchronized on map: + // must only be called while synchronized on enclosing Registry: public Object find(Type type) { // First, look for an exactly matching entry; then, look for an // arbitrary entry for a subtype of the request type: - for (Iterator i = list.iterator(); i.hasNext();) { - Level2Entry l2 = (Level2Entry) i.next(); - if (l2.getType().equals(type)) { - Object o = l2.get(); - if (o != null) { - return o; - } + Level2Entry l2 = level2map.get(type); + if (l2 != null) { + Object o = l2.get(); + if (o != null) { + return o; } } - for (Iterator i = list.iterator(); i.hasNext();) { - Level2Entry l2 = (Level2Entry) i.next(); - if (type.isSupertypeOf(l2.getType())) { + for (Iterator<Level2Entry> i = level2map.values().iterator(); + i.hasNext();) + { + l2 = i.next(); + if (type.isSupertypeOf(l2.type)) { Object o = l2.get(); if (o != null) { return o; @@ -293,53 +269,37 @@ public final class java_environment implements IEnvironment { return null; } - // must only be called while synchronized on map: - public void add(Level2Entry l2) { - list.add(l2); - } - - // must only be called while synchronized on map: - public boolean remove(Level2Entry l2) { - list.remove(l2); - return list.isEmpty(); - } - - private final LinkedList list = new LinkedList(); // of Level2Entry + public final HashMap<Type, Level2Entry> level2map = + new HashMap<Type, Level2Entry>(); } - private static final class Level2Entry extends WeakReference { - public Level2Entry(String oid, Type type, Object object, - ReferenceQueue queue) { + private static final class Level2Entry extends WeakReference<Object> { + public Level2Entry( + String oid, Type type, Object object, ReferenceQueue queue) + { super(object, queue); this.oid = oid; this.type = type; } - public String getOid() { - return oid; - } - - public Type getType() { - return type; - } - - // must only be called while synchronized on map: + // must only be called while synchronized on enclosing Registry: public void acquire() { ++count; } - // must only be called while synchronized on map: + // must only be called while synchronized on enclosing Registry: public boolean release() { return --count == 0; } - private final String oid; - private final Type type; + public final String oid; + public final Type type; + private int count = 1; } - private final HashMap map = new HashMap(); - // from OID (String) to Level1Entry + private final HashMap<String, Level1Entry> level1map = + new HashMap<String, Level1Entry>(); private final ReferenceQueue queue = new ReferenceQueue(); } diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk b/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk index 29aa95854d33..55fb0e2d3c0d 100755 --- a/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk +++ b/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk @@ -34,9 +34,7 @@ PRJ=..$/..$/.. PRJNAME=javaldx TARGET=javaldx TARGETTYPE=CUI -.IF "$(OS)"!="IRIX" NO_DEFAULT_STL=TRUE -.ENDIF LIBTARGET=NO ENABLE_EXCEPTIONS=true diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx index 56972ea0e66f..e7f55eb91595 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx @@ -54,13 +54,6 @@ public: } test; #endif -SunVersion::SunVersion(): m_nUpdateSpecial(0), - m_preRelease(Rel_NONE), - m_bValid(false) -{ - memset(m_arVersionParts, 0, sizeof(m_arVersionParts)); -} - SunVersion::SunVersion(const rtl::OUString &usVer): m_nUpdateSpecial(0), m_preRelease(Rel_NONE), usVersion(usVer) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx index f6114672b17c..51b4ecf10221 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx @@ -92,7 +92,6 @@ protected: PreRelease m_preRelease; public: - SunVersion(); SunVersion(const char * szVer); SunVersion(const rtl::OUString& usVer); ~SunVersion(); diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index a823d551af88..674dd2103236 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -300,13 +300,14 @@ class AsynchReader: public Thread public: AsynchReader(oslFileHandle & rHandle); - +#if OSL_DEBUG_LEVEL >= 2 /** only call this function after this thread has finished. That is, call join on this instance and then call getData. */ OString getData(); +#endif }; AsynchReader::AsynchReader(oslFileHandle & rHandle): @@ -314,11 +315,13 @@ AsynchReader::AsynchReader(oslFileHandle & rHandle): { } +#if OSL_DEBUG_LEVEL >= 2 OString AsynchReader::getData() { OSL_ASSERT(isRunning() == sal_False ); return OString(m_arData.get(), m_nDataSize); } +#endif void AsynchReader::run() { diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index 8f43530c5a3a..7ebd9a7b66f3 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -65,6 +65,7 @@ #include "dictmgr.hxx" #include <stdio.h> +#include <string.h> #include <list> #include <set> @@ -544,10 +545,10 @@ Reference< XPossibleHyphens > SAL_CALL char *lcword; int k; - PropertyHelper_Hyphen & rHelper = GetPropHelper();
- rHelper.SetTmpPropVals(aProperties);
- sal_Int16 minTrail = rHelper.GetMinTrailing();
- sal_Int16 minLead = rHelper.GetMinLeading();
+ PropertyHelper_Hyphen & rHelper = GetPropHelper(); + rHelper.SetTmpPropVals(aProperties); + sal_Int16 minTrail = rHelper.GetMinTrailing(); + sal_Int16 minLead = rHelper.GetMinLeading(); HyphenDict *dict = NULL; rtl_TextEncoding aEnc = 0; @@ -621,9 +622,9 @@ Reference< XPossibleHyphens > SAL_CALL wordlen = encWord.getLength(); lcword = new char[wordlen+1]; hyphens = new char[wordlen+5]; - char ** rep = NULL; // replacements of discretionary hyphenation
- int * pos = NULL; // array of [hyphenation point] minus [deletion position]
- int * cut = NULL; // length of deletions in original word
+ char ** rep = NULL; // replacements of discretionary hyphenation + int * pos = NULL; // array of [hyphenation point] minus [deletion position] + int * cut = NULL; // length of deletions in original word // copy converted word into simple char buffer strcpy(lcword,encWord.getStr()); @@ -634,21 +635,21 @@ Reference< XPossibleHyphens > SAL_CALL n++; // fprintf(stderr,"hyphenate... %s\n",lcword); fflush(stderr); if (n > 0) { - if (hnj_hyphen_hyphenate3(dict, lcword, n, hyphens, NULL, &rep, &pos, &cut,
- minLead, minTrail, Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead - Max(dict->lhmin, 2))),
- Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - Max(dict->rhmin, 2)))))
+ if (hnj_hyphen_hyphenate3(dict, lcword, n, hyphens, NULL, &rep, &pos, &cut, + minLead, minTrail, Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead - Max(dict->lhmin, 2))), + Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - Max(dict->rhmin, 2))))) { delete[] hyphens; delete[] lcword; -
- if (rep) {
- for(int j = 0; j < n; j++) {
- if (rep[j]) free(rep[j]);
- }
- free(rep);
- }
- if (pos) free(pos);
- if (cut) free(cut);
+ + if (rep) { + for(int j = 0; j < n; j++) { + if (rep[j]) free(rep[j]); + } + free(rep); + } + if (pos) free(pos); + if (cut) free(cut); return NULL; } @@ -662,7 +663,7 @@ Reference< XPossibleHyphens > SAL_CALL INT16 i; for ( i = 0; i < encWord.getLength(); i++) - if (hyphens[i]&1 && (!rep || !rep[i]))
+ if (hyphens[i]&1 && (!rep || !rep[i])) nHyphCount++; Sequence< INT16 > aHyphPos(nHyphCount); @@ -671,14 +672,14 @@ Reference< XPossibleHyphens > SAL_CALL OUString hyphenatedWord; nHyphCount = 0; - for (i = 0; i < nWord.getLength(); i++) {
+ for (i = 0; i < nWord.getLength(); i++) { hyphenatedWordBuffer.append(aWord[i]); - // hyphenation position (not alternative)
- if (hyphens[i]&1 && (!rep || !rep[i])) {
- pPos[nHyphCount] = i;
- hyphenatedWordBuffer.append(sal_Unicode('='));
- nHyphCount++;
- }
+ // hyphenation position (not alternative) + if (hyphens[i]&1 && (!rep || !rep[i])) { + pPos[nHyphCount] = i; + hyphenatedWordBuffer.append(sal_Unicode('=')); + nHyphCount++; + } } hyphenatedWord = hyphenatedWordBuffer.makeStringAndClear(); @@ -690,15 +691,15 @@ Reference< XPossibleHyphens > SAL_CALL delete[] hyphens; delete[] lcword; -
- if (rep) {
- for(int j = 0; j < n; j++) {
- if (rep[j]) free(rep[j]);
- }
- free(rep);
- }
- if (pos) free(pos);
- if (cut) free(cut);
+ + if (rep) { + for(int j = 0; j < n; j++) { + if (rep[j]) free(rep[j]); + } + free(rep); + } + if (pos) free(pos); + if (cut) free(cut); return xRes; } diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index 2e00035628bc..5e9b0c8fa592 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -57,11 +57,14 @@ #include <set> #include <vector> +#include <string.h> #include <lingutil.hxx> #include <dictmgr.hxx> + + using ::com::sun::star::lang::Locale; using namespace ::com::sun::star; diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 1a92db58a4dc..bcb09c5ac16d 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -60,7 +60,7 @@ #include <list> #include <set> - +#include <string.h> using namespace utl; using namespace osl; diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index c526d2b07444..a92c5926c8b4 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -54,6 +54,7 @@ #include <list> #include <set> +#include <string.h> // values asigned to capitalization types #define CAPTYPE_UNKNOWN 0 diff --git a/lpsolve/prj/build.lst b/lpsolve/prj/build.lst index e6965a1e25e7..68b61bf75674 100644 --- a/lpsolve/prj/build.lst +++ b/lpsolve/prj/build.lst @@ -1,3 +1,3 @@ -lps lpsolve : NULL +lps lpsolve : solenv NULL lps lpsolve usr1 - all lps_mkout NULL lps lpsolve nmake - all lps_lpsolve NULL diff --git a/moz/extractfiles.mk b/moz/extractfiles.mk index c98bf8574e73..81e04ab80ad6 100644 --- a/moz/extractfiles.mk +++ b/moz/extractfiles.mk @@ -67,7 +67,7 @@ NSS_MODULE_RUNTIME_LIST:= \ plds4 \ smime3 \ softokn3 \ - sqlite3 \ + sqlite/sqlite3 \ ssl3 BIN_RUNTIMELIST= \ @@ -307,8 +307,8 @@ $(MISC)$/build$/so_moz_runtime_files: $(OUT)$/bin$/mozruntime.zip echo >& $(NULLDEV) .IF "$(ENABLE_NSS_MODULE)" == "YES" # We add the libraries from the separate nss module - $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARLIBDIR)$/$(DLLPRE)$(file)$(DLLPOST) \ - $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \ + $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARLIBDIR)$/$(file:d:d)/$(DLLPRE)$(file:f)$(DLLPOST) \ + $(RUNTIME_DIR)$/$(DLLPRE)$(file:f)$(DLLPOST) &&) \ echo >& $(NULLDEV) .ENDIF .ELSE # .IF "$(GUI)" == "UNX" diff --git a/moz/zipped/makefile.mk b/moz/zipped/makefile.mk index b4f85f93e748..c8497d36acf9 100644 --- a/moz/zipped/makefile.mk +++ b/moz/zipped/makefile.mk @@ -175,6 +175,8 @@ FREEBL=freebl3 .ENDIF # "$(OS)" == "SOLARIS" +#On Linux/Unix sqlite is delivered to $(SOLARLIBDIR)/sqlite/libsqlite3.so +#See readme.txt in module nss NSS_MODULE_RUNTIME_LIST:= \ $(FREEBL) \ nspr4 \ @@ -186,7 +188,7 @@ NSS_MODULE_RUNTIME_LIST:= \ plds4 \ smime3 \ softokn3 \ - sqlite3 \ + sqlite/sqlite3 \ ssl3 @@ -200,13 +202,13 @@ $(MISC)$/unpacked_$(TARGET)_inc $(BIN)$/mozruntime.zip echo >& $(NULLDEV) $(foreach,lib,$(LIBLIST) rm -f $(LB)$/$(lib) &&) \ echo >& $(NULLDEV) - $(foreach,lib,$(BIN_RUNTIMELIST) zip -d $(BIN)$/mozruntime.zip $(DLLPRE)$(lib)$(DLLPOST) &&) \ + $(foreach,lib,$(BIN_RUNTIMELIST) zip -d $(BIN)$/mozruntime.zip $(DLLPRE)$(lib:f)$(DLLPOST) &&) \ echo >& $(NULLDEV) .IF "$(GUI)"=="WNT" - $(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip $(SOLARBINDIR)$/$(DLLPRE)$(lib)$(DLLPOST) &&) \ + +$(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip $(SOLARBINDIR)$/$(DLLPRE)$(lib:f)$(DLLPOST) &&) \ echo >& $(NULLDEV) .ELSE - $(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip $(SOLARLIBDIR)$/$(DLLPRE)$(lib)$(DLLPOST) &&) \ + +$(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip $(SOLARLIBDIR)$/$(lib:d)$(DLLPRE)$(lib:f)$(DLLPOST) &&) \ echo >& $(NULLDEV) .ENDIF $(TOUCH) $@ diff --git a/nss/makefile.mk b/nss/makefile.mk index 2122a168904d..94d6e60c5817 100644 --- a/nss/makefile.mk +++ b/nss/makefile.mk @@ -49,6 +49,10 @@ TARFILE_NAME=nss_3_12_5 TARFILE_ROOTDIR=mozilla PATCH_FILES=nss.patch +.IF "$(OS)"=="MACOSX" +PATCH_FILES+=nss_macosx.patch +.ENDIF # "$(OS)"=="MACOSX" + .IF "$(debug)" != "" .ELSE BUILD_OPT=1 @@ -64,13 +68,21 @@ USE_64:=1 .ENDIF # "$(CPU)"=="X" .ENDIF # "$(OS)$(COM)"=="LINUXGCC" +.IF "$(OS)$(COM)"=="FREEBSDGCC" +.IF "$(CPU)"=="X" +# force 64-bit buildmode +USE_64:=1 +.EXPORT : USE_64 +.ENDIF # "$(CPU)"=="X" +.ENDIF # "$(OS)$(COM)"=="LINUXGCC" .IF "$(OS)"=="MACOSX" .IF "$(EXTRA_CFLAGS)"!="" CPP:=gcc -E $(EXTRA_CFLAGS) CXX:=g++ $(EXTRA_CFLAGS) CC:=gcc $(EXTRA_CFLAGS) -.EXPORT : CPP +MACOS_SDK_DIR*=$(MACDEVSDK) +.EXPORT : CPP MACOS_SDK_DIR .ENDIF # "$(EXTRA_CFLAGS)"!="" .ENDIF # "$(OS)"=="MACOSX" diff --git a/nss/nss.patch b/nss/nss.patch index 9605e0d64b1e..a6ce16071919 100644 --- a/nss/nss.patch +++ b/nss/nss.patch @@ -169,3 +169,24 @@ endif endif endif +--- misc/mozilla/security/nss/cmd/shlibsign/Makefile Fri Aug 7 21:06:37 2009 ++++ misc/build/mozilla/security/nss/cmd/shlibsign/Makefile Fri Nov 27 13:07:52 2009 +@@ -78,10 +78,15 @@ + + # sign any and all shared libraries that contain the word freebl + +-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX) +-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX)) ++# Signing causes loading of some system library which in turn loads ++# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper ++# version. Therefore signing fails. ++# We cannot build with the system sqlite3, because it is too old (SDK ++# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib. ++#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX) ++#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX)) + ifndef NSS_DISABLE_DBM +-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX) ++#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX) + endif + CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk) + diff --git a/nss/nss_macosx.patch b/nss/nss_macosx.patch new file mode 100644 index 000000000000..d6ce6ff4f8d0 --- /dev/null +++ b/nss/nss_macosx.patch @@ -0,0 +1,12 @@ +--- misc/mozilla/security/nss/Makefile 2008-12-03 00:24:39.000000000 +0100 ++++ misc/build/mozilla/security/nss/Makefile 2009-11-27 13:36:22.662753328 +0100 +@@ -104,6 +104,9 @@ + ifeq ($(OS_TARGET),WIN95) + NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95 + endif ++ifdef MACOS_SDK_DIR ++NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR) ++endif + ifdef USE_DEBUG_RTL + NSPR_CONFIGURE_OPTS += --enable-debug-rtl + endif diff --git a/nss/prj/d.lst b/nss/prj/d.lst index 891eb7739b1c..f1090ca8d91e 100755 --- a/nss/prj/d.lst +++ b/nss/prj/d.lst @@ -1,10 +1,31 @@ mkdir: %_DEST%\inc%_EXT%\mozilla\nspr mkdir: %_DEST%\inc%_EXT%\mozilla\nspr\obsolete mkdir: %_DEST%\inc%_EXT%\mozilla\nss +mkdir: %_DEST%\lib%_EXT%\sqlite ..\%__SRC%\inc\include\* %_DEST%\inc%_EXT%\mozilla\nspr ..\%__SRC%\inc\include\obsolete\protypes.h %_DEST%\inc%_EXT%\mozilla\nspr\obsolete\protypes.h ..\%__SRC%\inc\nss\*.h %_DEST%\inc%_EXT%\mozilla\nss -..\%__SRC%\lib\* %_DEST%\lib%_EXT% + +..\%__SRC%\lib\libfreebl3.* %_DEST%\lib%_EXT%\libfreebl.* +..\%__SRC%\lib\libfreebl_32fpu_3.* %_DEST%\lib%_EXT%\libfreebl_32fpu_3.* +..\%__SRC%\lib\libfreebl_32int64_3.* %_DEST%\lib%_EXT%\libfreebl_32int64_3.* +..\%__SRC%\lib\libfreebl_32int_3.* %_DEST%\lib%_EXT%\libfreebl_32int_3.* +..\%__SRC%\lib\libfreebl_64int_3.* %_DEST%\lib%_EXT%\libfreebl_64int_3.* +..\%__SRC%\lib\libfreebl_64fpu_3.* %_DEST%\lib%_EXT%\libfreebl_64fpu_3.* +..\%__SRC%\lib\libnspr4.* %_DEST%\lib%_EXT%\libnspr4.* +..\%__SRC%\lib\libnss3.* %_DEST%\lib%_EXT%\libnss3.* +..\%__SRC%\lib\libnssckbi.* %_DEST%\lib%_EXT%\libnssckbi.* +..\%__SRC%\lib\libnssdbm3.* %_DEST%\lib%_EXT%\libnssdbm3.* +..\%__SRC%\lib\libnssutil3.* %_DEST%\lib%_EXT%\libnssutil3.* +..\%__SRC%\lib\libplc4.* %_DEST%\lib%_EXT%\libplc4.* +..\%__SRC%\lib\libplds4.* %_DEST%\lib%_EXT%\libplds4.* +..\%__SRC%\lib\libsmime3.* %_DEST%\lib%_EXT%\libsmime3.* +..\%__SRC%\lib\libsoftokn3.* %_DEST%\lib%_EXT%\libsoftokn3.* +..\%__SRC%\lib\libssl3.* %_DEST%\lib%_EXT%\libssl3.* + +..\%__SRC%\lib\libsqlite3.* %_DEST%\lib%_EXT%\sqlite\libsqlite3.* +..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT% + ..\%__SRC%\bin\* %_DEST%\bin%_EXT% diff --git a/nss/readme.txt b/nss/readme.txt index de23a264c179..df65908204c4 100755 --- a/nss/readme.txt +++ b/nss/readme.txt @@ -1,56 +1,75 @@ -Relation between nss, moz, moz_prebuilt
----------------------------------------
-nss containes the security libraries which are also part of moz. However nss is
-meant to be more current, that is it to be updated more often. This should be
-easier than doing this with moz.
-
-If nss is build depends on an environment variable (ENABLE_NSS_MODULE=YES) which
-is per default set to YES. In this case nss is build before moz. The nss
-libraries/lib files/headers built in moz are then not delivered. Otherwise they
-would overwrite those from nss. That is, the nss libraries build in moz are
-removed from mozruntime.zip (build in moz/solver/bin), they are removed from the
-lib directory (for example moz/unxlngi6.pro/lib), and the nss and nspr headers
-are also removed (inc/nss and inc/nspr). The nss libraries from the nss module
-are then added to mozruntime.zip.
-
-This also applies for moz_prebuilt. Therefore moz and moz_prebuilt must be build
-again after changes have been made to the libraries in the nss module.
-
-Also when moz was updated to use a newer version of mozilla, then one must make
-sure that new files which also belong to nss are not delivered and are removed
-from mozruntime.zip.
-
-Fips 140 and signed libraries
--------------------------------
-Fips 140 mode is not supported. That is, the *.chk files containing the
-checksums for the cryptographic module are not delivered into solver and will
-not be part of the OOo installation sets.
-
-The *chk files do not match the libraries because we change the rpatch.
-
-libfreebl3
-----------
-Porting to other platforms may require to deliver other variants of
-libfreebl*. The library name varies according to the platform. Changes need to
-be made to
-ooo/moz/extractfiles.mk
-ooo/moz/zipped/makefile.mk
-sun/moz_prebuilt/zipped/makefile.mk
-
-
-See also
-http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html
-
-
-Windows builds of nss
----------------------
-To build mozilla on windows you'll need the mozilla build tools
-
-Build requirements containing the link to the build tools:
-https://developer.mozilla.org/en/Windows_Build_Prerequisites#ss2.2
-
-The direct link:
-
-http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe
-
-
+Relation between nss, moz, moz_prebuilt +--------------------------------------- +nss containes the security libraries which are also part of moz. However nss is +meant to be more current, that is it to be updated more often. This should be +easier than doing this with moz. + +If nss is build depends on an environment variable (ENABLE_NSS_MODULE=YES) which +is per default set to YES. In this case nss is build before moz. The nss +libraries/lib files/headers built in moz are then not delivered. Otherwise they +would overwrite those from nss. That is, the nss libraries build in moz are +removed from mozruntime.zip (build in moz/solver/bin), they are removed from the +lib directory (for example moz/unxlngi6.pro/lib), and the nss and nspr headers +are also removed (inc/nss and inc/nspr). The nss libraries from the nss module +are then added to mozruntime.zip. + +This also applies for moz_prebuilt. Therefore moz and moz_prebuilt must be build +again after changes have been made to the libraries in the nss module. + +Also when moz was updated to use a newer version of mozilla, then one must make +sure that new files which also belong to nss are not delivered and are removed +from mozruntime.zip. + +Fips 140 and signed libraries +------------------------------- +Fips 140 mode is not supported. That is, the *.chk files containing the +checksums for the cryptographic module are not delivered into solver and will +not be part of the OOo installation sets. + +Signing has been turned off because +- we change the rpath (install names) after signing which breaks the signatures +(Mac) +- sqlite conflicts with the system sqlite when signing which breaks the build + + +libfreebl3 +---------- +Porting to other platforms may require to deliver other variants of +libfreebl*. The library name varies according to the platform. Changes need to +be made to +ooo/moz/extractfiles.mk +ooo/moz/zipped/makefile.mk +sun/moz_prebuilt/zipped/makefile.mk + +See also +http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html + + +Windows builds of nss +--------------------- +To build mozilla on windows you'll need the mozilla build tools + +Build requirements containing the link to the build tools: +https://developer.mozilla.org/en/Windows_Build_Prerequisites#ss2.2 + +The direct link: + +http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe + +libsqlite3 +---------- +The problem described here was found on Mac with OS 10.6 +NSS cannot use the system sqlite on Mac because the base line is still MacOS +10.4. That system sqlite is incompatible with the softokn3 in nss which requires +a later version of sqlite. +When we used a more current Mac SDK then we could set +NSS_USE_SYSTEM_SQLITE=1 +to build using the system sqlite. + +We cannot deliver sqlite in the lib directory of the solver. This directory is +used by tools of the build environment. Using the sqlite from NSS breaks the +tools if they use system libraries which are linked with the system +sqlite. Therefore we deliver it into lib/sqlite on unix systems. + +See also issue +http://qa.openoffice.org/issues/show_bug.cgi?id=106132 diff --git a/odk/pack/gendocu/makefile.mk b/odk/pack/gendocu/makefile.mk index 5b070ca043f6..1970acebda7a 100644 --- a/odk/pack/gendocu/makefile.mk +++ b/odk/pack/gendocu/makefile.mk @@ -52,7 +52,6 @@ JAVA_PACKAGES=\ com.sun.star.comp.helper \ com.sun.star.lib.uno.helper \ com.sun.star.lib.unoloader \ - com.sun.star.tools.uno \ com.sun.star.uno \ $(JAVA_SRC_DIR)$/com$/sun$/star$/lib$/util$/UrlToFileMapper.java # com.sun.star.beans \ diff --git a/odk/source/unowinreg/win/makefile.mk b/odk/source/unowinreg/win/makefile.mk index 7c826ddb265c..2990c3b8d092 100644 --- a/odk/source/unowinreg/win/makefile.mk +++ b/odk/source/unowinreg/win/makefile.mk @@ -55,8 +55,6 @@ JAVA_INCLUDES+= -I$(JAVA_HOME)/include/bsd JAVA_INCLUDES+= -I$(JAVA_HOME)/include/linux .ELIF "$(OS)" == "NETBSD" JAVA_INCLUDES+= -I$(JAVA_HOME)/include/netbsd -.ELIF "$(OS)" == "IRIX" -JAVA_INCLUDES+= -I$(JAVA_HOME)/include/solaris .ENDIF .ENDIF diff --git a/odk/util/makefile.pmk b/odk/util/makefile.pmk index 57604f81b05c..33ff68c90ab1 100644 --- a/odk/util/makefile.pmk +++ b/odk/util/makefile.pmk @@ -162,12 +162,6 @@ DESTPLATFROM=netbsd ########### DESTPLATFROM=freebsd -.ELIF "$(OS)"=="IRIX" -########### -# IRIX -########### -DESTPLATFROM=irix - .ELIF "$(OS)"=="MACOSX" ########### # MACOSX diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index f6dafac4cb6a..9934caa0c066 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -880,8 +880,8 @@ sal_Int32 ZipFile::recover() if ( aEntry.nExtraLen < 0 ) aEntry.nExtraLen = 0x7FFF; // End of quick fix - - sal_Int32 nBlockLength = aEntry.nSize + aEntry.nPathLen + aEntry.nExtraLen + 30 + nDescrLength; + sal_Int32 nDataSize = ( aEntry.nMethod == DEFLATED ) ? aEntry.nCompressedSize : aEntry.nSize; + sal_Int32 nBlockLength = nDataSize + aEntry.nPathLen + aEntry.nExtraLen + 30 + nDescrLength; if ( aEntry.nPathLen <= ZIP_MAXNAMELEN && aEntry.nExtraLen < ZIP_MAXEXTRA && ( nGenPos + nPos + nBlockLength ) <= nLength ) { diff --git a/python/Python-2.6.1.patch b/python/Python-2.6.1.patch index 781889d84e3f..661334cae3bb 100644 --- a/python/Python-2.6.1.patch +++ b/python/Python-2.6.1.patch @@ -56,13 +56,13 @@ +# {A1A295E5-463C-437F-81CA-1F32367685DA} = {A1A295E5-463C-437F-81CA-1F32367685DA} +# EndProjectSection +#EndProject -+#Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}" -+# ProjectSection(ProjectDependencies) = postProject -+# {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} -+# {86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480} -+# {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} -+# EndProjectSection -+#EndProject ++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}" ++ ProjectSection(ProjectDependencies) = postProject ++ {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} ++ {86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480} ++ {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} ++ EndProjectSection ++EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} diff --git a/python/Python-ssl.patch b/python/Python-ssl.patch new file mode 100644 index 000000000000..642586f31584 --- /dev/null +++ b/python/Python-ssl.patch @@ -0,0 +1,210 @@ +--- misc/Python-2.6.1/PCbuild/build_ssl.py 2009-11-02 08:24:35.140625000 +0000 ++++ misc/build/Python-2.6.1/PCbuild/build_ssl.py 2009-11-02 08:25:11.750000000 +0000 +@@ -255,4 +255,4 @@ + sys.exit(rc) + + if __name__=='__main__': +- main() ++ sys.exit(0) +--- misc/Python-2.6.1/PCbuild/_ssl.vcproj 2009-11-02 08:24:35.140625000 +0000 ++++ misc/build/Python-2.6.1/PCbuild/_ssl.vcproj 2009-11-02 08:24:35.140625000 +0000 +@@ -43,7 +43,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc32" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -57,7 +57,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + /> + <Tool + Name="VCALinkTool" +@@ -106,7 +106,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc64" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -120,7 +120,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + /> + <Tool + Name="VCALinkTool" +@@ -169,7 +169,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc32" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -183,7 +183,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + /> + <Tool + Name="VCALinkTool" +@@ -233,7 +233,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc64" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -247,7 +247,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + /> + <Tool + Name="VCALinkTool" +@@ -296,7 +296,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc32" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -310,7 +310,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + /> + <Tool + Name="VCALinkTool" +@@ -360,7 +360,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc64" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -374,7 +374,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + TargetMachine="17" + /> + <Tool +@@ -424,7 +424,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc32" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -438,7 +438,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + /> + <Tool + Name="VCALinkTool" +@@ -488,7 +488,7 @@ + /> + <Tool + Name="VCCLCompilerTool" +- AdditionalIncludeDirectories="$(opensslDir)\inc64" ++ AdditionalIncludeDirectories="$(SOLARVERSION)\$(INPATH)\inc$(UPDMINOREXT)\external" + /> + <Tool + Name="VCManagedResourceCompilerTool" +@@ -502,7 +502,7 @@ + /> + <Tool + Name="VCLinkerTool" +- AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib" ++ AdditionalDependencies="ws2_32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib" + TargetMachine="17" + /> + <Tool +--- misc/Python-2.6.1/setup.py 2009-11-02 10:12:43.000000000 +0000 ++++ misc/build/Python-2.6.1/setup.py 2009-11-02 10:18:19.000000000 +0000 +@@ -612,7 +612,15 @@ + exts.append( Extension('_socket', ['socketmodule.c'], + depends = ['socketmodule.h']) ) + # Detect SSL support for the socket module (via _ssl) ++ UPDMINOR = os.environ.get('UPDMINOREXT') ++ ooosslinc = os.environ.get('SOLARVERSION') + '/' + \ ++ os.environ.get('INPATH') + '/' + \ ++ 'inc' ++ if UPDMINOR != None: ++ ooosslinc = ooosslinc + UPDMINOR ++ ooosslinc = ooosslinc + '/external/' + search_for_ssl_incs_in = [ ++ ooosslinc, + '/usr/local/ssl/include', + '/usr/contrib/ssl/include/' + ] +@@ -624,8 +632,15 @@ + ['/usr/kerberos/include']) + if krb5_h: + ssl_incs += krb5_h ++ ooossllib = os.environ.get('SOLARVER') + '/' + \ ++ os.environ.get('INPATH') + '/' + \ ++ 'lib' ++ if UPDMINOR != None: ++ ooosslinc = ooosslinc + UPDMINOR ++ ooosslinc = ooosslinc + '/' + ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, +- ['/usr/local/ssl/lib', ++ [ooossllib, ++ '/usr/local/ssl/lib', + '/usr/contrib/ssl/lib/' + ] ) + +--- misc/Python-2.6.1/Modules/Setup.dist 2009-12-17 15:16:50.000000000 +0000 ++++ misc/build/Python-2.6.1/Modules/Setup.dist 2009-12-17 15:17:49.000000000 +0000 +@@ -248,14 +248,14 @@ + # Message-Digest Algorithm, described in RFC 1321. The necessary files + # md5.c and md5.h are included here. + +-#_md5 md5module.c md5.c ++_md5 md5module.c md5.c + + + # The _sha module implements the SHA checksum algorithms. + # (NIST's Secure Hash Algorithms.) +-#_sha shamodule.c +-#_sha256 sha256module.c +-#_sha512 sha512module.c ++_sha shamodule.c ++_sha256 sha256module.c ++_sha512 sha512module.c + + + # SGI IRIX specific modules -- off by default. diff --git a/python/makefile.mk b/python/makefile.mk index 663a5604603d..06e3ffe87a79 100644 --- a/python/makefile.mk +++ b/python/makefile.mk @@ -50,7 +50,9 @@ all: TARFILE_NAME=Python-$(PYVERSION) -PATCH_FILES=Python-$(PYVERSION).patch +PATCH_FILES=\ + Python-$(PYVERSION).patch \ + Python-ssl.patch CONFIGURE_DIR= @@ -80,11 +82,7 @@ CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure --prefix=$(MYCWD)/python-in .IF "$(OS)$(CPU)" == "SOLARISI" CONFIGURE_ACTION += --disable-ipv6 .ENDIF -.IF "$(OS)" == "IRIX" -BUILD_ACTION=$(ENV_BUILD) gmake -j$(EXTMAXPROCESS) ; gmake install -.ELSE BUILD_ACTION=$(ENV_BUILD) $(GNUMAKE) -j$(EXTMAXPROCESS) ; $(GNUMAKE) install ; chmod -R ug+w $(MYCWD)/python-inst -.ENDIF .ELSE # ---------------------------------- # WINDOWS diff --git a/python/prj/build.lst b/python/prj/build.lst index e7421332a750..f5ea98adcd4e 100644 --- a/python/prj/build.lst +++ b/python/prj/build.lst @@ -1,3 +1,3 @@ -py python : SO:so_prereq solenv NULL +py python : SO:so_prereq solenv OPENSSL:openssl NULL py python nmake - w,vc7 py_mkout NULL py python nmake - u py_mkout NULL diff --git a/python/prj/d.lst b/python/prj/d.lst index 3ea7a063902c..def1bb84a414 100644 --- a/python/prj/d.lst +++ b/python/prj/d.lst @@ -94,6 +94,7 @@ symlink: %_DEST%\lib%_EXT%\libpython2.6.so.1.0 %_DEST%\lib%_EXT%\libpython2.6.so ..\%__SRC%\misc\build\Python-2.6.1\PCbuild\python26.dll %_DEST%\bin%_EXT%\python26.dll ..\%__SRC%\misc\build\Python-2.6.1\PCbuild\python26.lib %_DEST%\lib%_EXT%\python26.lib ..\%__SRC%\misc\build\Python-2.6.1\PCbuild\_socket.pyd %_DEST%\lib%_EXT%\python\_socket.pyd +..\%__SRC%\misc\build\Python-2.6.1\PCbuild\_ssl.pyd %_DEST%\lib%_EXT%\python\_ssl.pyd ..\%__SRC%\misc\build\Python-2.6.1\PCbuild\select.pyd %_DEST%\lib%_EXT%\python\select.pyd ..\%__SRC%\misc\build\Python-2.6.1\PCbuild\unicodedata.pyd %_DEST%\lib%_EXT%\python\unicodedata.pyd ..\%__SRC%\misc\build\Python-2.6.1\PCbuild\winsound.pyd %_DEST%\lib%_EXT%\python\winsound.pyd diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index 3c2c95e541d1..8c34637fa304 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -317,7 +317,7 @@ int yylex() /****************** yyerror **********************************************/ #ifdef RS6000 extern "C" void yyerror( char* pMessage ) -#elif defined HP9000 || defined SCO || defined IRIX || defined SOLARIS +#elif defined HP9000 || defined SCO || defined SOLARIS extern "C" void yyerror( const char* pMessage ) #else void yyerror( char* pMessage ) diff --git a/rsc/source/parser/rsclex.hxx b/rsc/source/parser/rsclex.hxx index 89feed4dd132..63afd0b208c7 100644 --- a/rsc/source/parser/rsclex.hxx +++ b/rsc/source/parser/rsclex.hxx @@ -107,7 +107,7 @@ class ObjectStack { extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion extern "C" void yyerror( char * ); extern "C" int yylex( void ); -#elif defined( HP9000 ) || defined( SCO ) || defined ( IRIX ) || defined ( SOLARIS ) +#elif defined( HP9000 ) || defined( SCO ) || defined ( SOLARIS ) extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion extern "C" void yyerror( const char * ); extern "C" int yylex( void ); diff --git a/rsc/source/rsc/makefile.mk b/rsc/source/rsc/makefile.mk index 40e2d77740a3..89abd22207d9 100644 --- a/rsc/source/rsc/makefile.mk +++ b/rsc/source/rsc/makefile.mk @@ -40,10 +40,6 @@ ENABLE_EXCEPTIONS=true .INCLUDE : settings.mk -.IF "$(OS)"=="IRIX" -NOOPTFILES= $(OBJ)$/rsc.obj -.ENDIF - OBJFILES= $(OBJ)$/rsc.obj .INCLUDE : target.mk diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h index b0d2922839be..09529a48840f 100644 --- a/sal/inc/osl/endian.h +++ b/sal/inc/osl/endian.h @@ -118,20 +118,6 @@ extern "C" { # include <machine/param.h> #endif -#ifdef IRIX -# include <sys/endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# undef _BIG_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == BIG_ENDIAN -# undef _LITTLE_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# undef _LITTLE_ENDIAN -# undef _BIG_ENDIAN -# endif -#endif - #ifdef _WIN16 # define _LITTLE_ENDIAN #endif @@ -166,8 +152,7 @@ extern "C" { #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(SCO) && \ !defined(AIX) && !defined(HPUX) && \ - !defined(SOLARIS) && !defined(IRIX) && \ - !defined(MACOSX) && !defined(FREEBSD) + !defined(SOLARIS) && !defined(MACOSX) && !defined(FREEBSD) # error "Target platform not specified !" #endif diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx index 0df24e07587a..b770120c167e 100644 --- a/sal/inc/osl/thread.hxx +++ b/sal/inc/osl/thread.hxx @@ -117,7 +117,7 @@ public: osl_joinWithThread(m_hThread); } - sal_Bool SAL_CALL isRunning() + sal_Bool SAL_CALL isRunning() const { return osl_isThreadRunning(m_hThread); } @@ -128,7 +128,7 @@ public: osl_setThreadPriority(m_hThread, Priority); } - oslThreadPriority SAL_CALL getPriority() + oslThreadPriority SAL_CALL getPriority() const { return m_hThread ? osl_getThreadPriority(m_hThread) : osl_Thread_PriorityUnknown; } diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx index 5760340cc6a4..4891b7565647 100644 --- a/sal/inc/rtl/math.hxx +++ b/sal/inc/rtl/math.hxx @@ -357,17 +357,28 @@ inline bool isSignBitSet(double d) */ inline void setInf(double * pd, bool bNegative) { - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.msw - = bNegative ? 0xFFF00000 : 0x7FF00000; - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.lsw = 0; + union + { + double sd; + sal_math_Double md; + }; + md.w32_parts.msw = bNegative ? 0xFFF00000 : 0x7FF00000; + md.w32_parts.lsw = 0; + *pd = sd; } /** Set a QNAN. */ inline void setNan(double * pd) { - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.msw = 0x7FFFFFFF; - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.lsw = 0xFFFFFFFF; + union + { + double sd; + sal_math_Double md; + }; + md.w32_parts.msw = 0x7FFFFFFF; + md.w32_parts.lsw = 0xFFFFFFFF; + *pd = sd; } /** If a value is a valid argument for sin(), cos(), tan(). diff --git a/sal/inc/rtl/uuid.h b/sal/inc/rtl/uuid.h index 6451ac7738d6..76911dd841fb 100644 --- a/sal/inc/rtl/uuid.h +++ b/sal/inc/rtl/uuid.h @@ -201,8 +201,6 @@ void SAL_CALL rtl_createNamedUuid( #define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 10 #elif MACOSX #define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 100000 -#elif IRIX -#define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 10 #else #error "System time resolution must be calculated!" #endif diff --git a/sal/inc/sal/alloca.h b/sal/inc/sal/alloca.h index 703027277f18..912e58eff06e 100644 --- a/sal/inc/sal/alloca.h +++ b/sal/inc/sal/alloca.h @@ -31,7 +31,7 @@ #ifndef INCLUDED_SAL_ALLOCA_H #define INCLUDED_SAL_ALLOCA_H -#if defined (SOLARIS) || defined (LINUX) || defined (IRIX) || defined(__EMX__) +#if defined (SOLARIS) || defined (LINUX) || defined(__EMX__) #ifndef INCLUDED_ALLOCA_H #include <alloca.h> diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h index f16165fe72cb..c9d31a437758 100644 --- a/sal/inc/sal/config.h +++ b/sal/inc/sal/config.h @@ -102,7 +102,7 @@ extern "C" { #define SAL_SYSCONFIGFILE( name ) name ".ini" #endif -#if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(SCO) || defined(IRIX) +#if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(SCO) #define SAL_UNX #define SAL_DLLEXTENSION ".so" #define SAL_DLLPREFIX "lib" diff --git a/sal/osl/os2/file.cxx b/sal/osl/os2/file.cxx index e89ce6450bee..f3c1ad015de0 100644 --- a/sal/osl/os2/file.cxx +++ b/sal/osl/os2/file.cxx @@ -2343,7 +2343,7 @@ oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle) # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) ((__OSL_MSDOS_SUPER_MAGIC != (a).f_type)) #endif /* LINUX */ -#if defined(SOLARIS) || defined(IRIX) +#if defined(SOLARIS) # define __OSL_STATFS_STRUCT struct statvfs # define __OSL_STATFS(dir, sfs) statvfs((dir), (sfs)) # define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_frsize)) @@ -2355,7 +2355,7 @@ oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle) of the target platforms fix it!!!! */ # define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a) (1) # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (1) -#endif /* SOLARIS || IRIX*/ +#endif /* SOLARIS */ # define __OSL_STATFS_INIT(a) (memset(&(a), 0, sizeof(__OSL_STATFS_STRUCT))) diff --git a/sal/osl/os2/nlsupport.c b/sal/osl/os2/nlsupport.c index 0efccaa787e6..b05332bab0ea 100644 --- a/sal/osl/os2/nlsupport.c +++ b/sal/osl/os2/nlsupport.c @@ -411,9 +411,6 @@ void _imp_getProcessLocale( rtl_Locale ** ppLocale ) int _imp_setProcessLocale( rtl_Locale * pLocale ) { -#ifdef IRIX - char env_buf[80]; -#endif char locale_buf[64]; /* convert rtl_Locale to locale string */ @@ -421,11 +418,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) { /* only change env vars that exist already */ if( getenv( "LC_ALL" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_ALL=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) setenv( "LC_ALL", locale_buf, 1); #else setenv( "LC_ALL", locale_buf ); @@ -433,11 +426,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LC_CTYPE" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_CTYPE=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LC_CTYPE", locale_buf ); @@ -445,11 +434,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LANG" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LANG=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LANG", locale_buf ); diff --git a/sal/osl/os2/socket.c b/sal/osl/os2/socket.c index de70e5b8885a..1c6603b55932 100644 --- a/sal/osl/os2/socket.c +++ b/sal/osl/os2/socket.c @@ -48,7 +48,7 @@ #undef HAVE_POLL_H #endif -#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) +#if defined(LINUX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) #include <sys/poll.h> #define HAVE_POLL_H #endif /* HAVE_POLL_H */ diff --git a/sal/osl/os2/system.h b/sal/osl/os2/system.h index 565dfe3ea9c6..ef7626e9c036 100644 --- a/sal/osl/os2/system.h +++ b/sal/osl/os2/system.h @@ -306,36 +306,6 @@ extern unsigned int nanosleep(unsigned int); # define PTHREAD_SIGACTION cma_sigaction #endif -#ifdef IRIX -# define AF_IPX -1 -# include <pthread.h> -# include <semaphore.h> -# include <sched.h> -# include <sys/socket.h> -# include <sys/un.h> -# include <sys/stropts.h> -# include <netinet/tcp.h> -# include <procfs/procfs.h> -# include <sys/endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# undef _BIG_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == BIG_ENDIAN -# undef _LITTLE_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# undef _LITTLE_ENDIAN -# undef _BIG_ENDIAN -# endif -# define SA_FAMILY_DECL \ - union { struct { short sa_family2; } sa_generic; } sa_union -# define PTR_SIZE_T(s) ((int *)&(s)) -# define NO_PTHREAD_PRIORITY -# include <dlfcn.h> -# define IOCHANNEL_TRANSFER_BSD -extern char *strdup(const char *); -#endif - #ifdef SOLARIS # include <shadow.h> # include <sys/procfs.h> @@ -389,7 +359,7 @@ char *macxp_tempnam( const char *tmpdir, const char *prefix ); #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) && !defined(SCO) && \ !defined(AIX) && !defined(HPUX) && \ - !defined(SOLARIS) && !defined(IRIX) && !defined(MAC) && \ + !defined(SOLARIS) && !defined(MAC) && \ !defined(MACOSX) # error "Target plattform not specified !" #endif diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c index 437d31157049..886da0c3bee5 100755 --- a/sal/osl/unx/backtrace.c +++ b/sal/osl/unx/backtrace.c @@ -207,54 +207,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd ) } #endif /* defined FREEBSD */ -#if defined(IRIX) -#include <stdio.h> -#include <rld_interface.h> -#include <exception.h> -#include <sys/signal.h> -#include <unistd.h> - -/* Need extra libs -lexc -ldwarf -lelf */ - -int backtrace( void **buffer, int max_frames ) -{ - struct sigcontext context; - int i = 0; - - memset(&context, 0, sizeof(struct sigcontext)); - - exc_setjmp(&context); - while(context.sc_pc != 1 && i < max_frames) { - exc_unwind(&context, 0); - if(context.sc_pc != 1) { - *(buffer++) = (void *)context.sc_pc; - i++; - } - } - return(i); -} - -void backtrace_symbols_fd( void **buffer, int size, int fd ) -{ - FILE *fp = fdopen( fd, "w" ); - struct sigcontext context; - char *name; - - if ( fp ) { - while(context.sc_pc!=1) { - if(context.sc_pc != 1) { - exc_unwind_name(&context, 0, &name); - fprintf(fp, " 0x%012lx %.100s\n", context.sc_pc, name ? name : "<unknown function>"); - free(name); - } - } - - fflush( fp ); - fclose( fp ); - } -} -#endif /* defined IRIX */ - #ifdef LINUX #ifndef _GNU_SOURCE diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx index a3b7109123b7..4489368a4c9b 100644 --- a/sal/osl/unx/file_volume.cxx +++ b/sal/osl/unx/file_volume.cxx @@ -76,16 +76,6 @@ static const sal_Char* MOUNTTAB="/etc/mtab"; * This information is stored only in the kernel. */ /* static const sal_Char* MOUNTTAB="/etc/mtab"; */ -#elif defined(IRIX) - -#include <mntent.h> -#include <sys/mount.h> -#include <sys/statvfs.h> -#define HAVE_STATFS_H -#include <sys/quota.h> -//#include <ctype.h> -static const sal_Char* MOUNTTAB="/etc/mtab"; - #elif defined(MACOSX) #include <ufs/ufs/quota.h> @@ -140,12 +130,6 @@ static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice); static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem); #endif /* LINUX */ - -#if defined(IRIX) -static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice); -static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem); -#endif /* IRIX */ - #ifdef DEBUG_OSL_FILE static void osl_printFloppyHandle(oslVolumeDeviceHandleImpl* hFloppy); #endif /* DEBUG_OSL_FILE */ @@ -220,7 +204,7 @@ oslFileError osl_getVolumeInformation( rtl_uString* ustrDirectoryURL, oslVolumeI # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) ((__OSL_MSDOS_SUPER_MAGIC != (a).f_type)) #endif /* LINUX */ -#if defined(SOLARIS) || defined(IRIX) +#if defined(SOLARIS) # define __OSL_STATFS_STRUCT struct statvfs # define __OSL_STATFS(dir, sfs) statvfs((dir), (sfs)) # define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_frsize)) @@ -232,7 +216,7 @@ oslFileError osl_getVolumeInformation( rtl_uString* ustrDirectoryURL, oslVolumeI of the target platforms fix it!!!! */ # define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a) (1) # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (1) -#endif /* SOLARIS || IRIX*/ +#endif /* SOLARIS */ # define __OSL_STATFS_INIT(a) (memset(&(a), 0, sizeof(__OSL_STATFS_STRUCT))) @@ -1093,411 +1077,6 @@ osl_isFloppyMounted (oslVolumeDeviceHandleImpl* pDevice) } #endif /* LINUX */ -/****************************************************************************** - * - * IRIX FLOPPY FUNCTIONS - * - *****************************************************************************/ - -#if defined(IRIX) -static oslVolumeDeviceHandle osl_isFloppyDrive(const sal_Char* pszPath) -{ - oslVolumeDeviceHandleImpl* pItem = osl_newVolumeDeviceHandleImpl (); - sal_Bool bRet = sal_False; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_isFloppyDrive\n"); -#endif - - bRet=osl_getFloppyMountEntry(pszPath,pItem); - - if ( bRet == sal_False ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyDrive [not a floppy]\n"); -#endif - rtl_freeMemory(pItem); - return 0; - } - - -#ifdef DEBUG_OSL_FILE - osl_printFloppyHandle(pItem); -#endif -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyDrive [ok]\n"); -#endif - - return (oslVolumeDeviceHandle) pItem; -} - - -static oslFileError osl_mountFloppy(oslVolumeDeviceHandle hFloppy) -{ - sal_Bool bRet = sal_False; - oslVolumeDeviceHandleImpl* pItem=0; - int nRet; - sal_Char pszCmd[PATH_MAX]; - sal_Char* pszMountProg = "mount"; - sal_Char* pszSuDo = 0; - sal_Char* pszTmp = 0; - - pszCmd[0] = '\0'; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_mountFloppy\n"); -#endif - - pItem = (oslVolumeDeviceHandleImpl*) hFloppy; - - if ( pItem == 0 ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_mountFloppy [pItem == 0]\n"); -#endif - - return osl_File_E_INVAL; - } - - if ( pItem->ident[0] != 'O' || pItem->ident[1] != 'V' || pItem->ident[2] != 'D' || pItem->ident[3] != 'H' ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_mountFloppy [invalid handle]\n"); -#endif - return osl_File_E_INVAL; - } - - bRet = osl_isFloppyMounted(pItem); - if ( bRet == sal_True ) - { -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"detected mounted floppy at '%s'\n",pItem->pszMountPoint); -#endif - return osl_File_E_BUSY; - } - - /* mfe: we can't use the mount(2) system call!!! */ - /* even if we are root */ - /* since mtab is not updated!!! */ - /* but we need it to be updated */ - /* some "magic" must be done */ - -/* nRet = mount(pItem->pszDevice,pItem->pszMountPoint,0,0,0); */ -/* if ( nRet != 0 ) */ -/* { */ -/* nRet=errno; */ -/* #ifdef DEBUG_OSL_FILE */ -/* perror("mount"); */ -/* #endif */ -/* } */ - - pszTmp = getenv("SAL_MOUNT_MOUNTPROG"); - if ( pszTmp != 0 ) - { - pszMountProg=pszTmp; - } - - pszTmp=getenv("SAL_MOUNT_SU_DO"); - if ( pszTmp != 0 ) - { - pszSuDo=pszTmp; - } - - if ( pszSuDo != 0 ) - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s %s %s",pszSuDo,pszMountProg,pItem->pszDevice,pItem->pszMountPoint); - } - else - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s",pszMountProg,pItem->pszMountPoint); - } - - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"executing '%s'\n",pszCmd); -#endif - - nRet = system(pszCmd); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"call returned '%i'\n",nRet); - fprintf(stderr,"exit status is '%i'\n", WEXITSTATUS(nRet)); -#endif - - - switch ( WEXITSTATUS(nRet) ) - { - case 0: - nRet=0; - break; - - case 2: - nRet=EPERM; - break; - - case 4: - nRet=ENOENT; - break; - - case 8: - nRet=EINTR; - break; - - case 16: - nRet=EPERM; - break; - - case 32: - nRet=EBUSY; - break; - - case 64: - nRet=EAGAIN; - break; - - default: - nRet=EBUSY; - break; - } - - return ((0 == nRet) ? oslTranslateFileError(OSL_FET_SUCCESS, nRet) : oslTranslateFileError(OSL_FET_ERROR, nRet)); -} - -static oslFileError osl_unmountFloppy(oslVolumeDeviceHandle hFloppy) -{ - oslVolumeDeviceHandleImpl* pItem=0; - int nRet=0; - sal_Char pszCmd[PATH_MAX]; - sal_Char* pszTmp = 0; - sal_Char* pszSuDo = 0; - sal_Char* pszUmountProg = "umount"; - - pszCmd[0] = '\0'; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_unmountFloppy\n"); -#endif - - pItem = (oslVolumeDeviceHandleImpl*) hFloppy; - - if ( pItem == 0 ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_unmountFloppy [pItem==0]\n"); -#endif - return osl_File_E_INVAL; - } - - if ( pItem->ident[0] != 'O' || pItem->ident[1] != 'V' || pItem->ident[2] != 'D' || pItem->ident[3] != 'H' ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_unmountFloppy [invalid handle]\n"); -#endif - return osl_File_E_INVAL; - } - - /* mfe: we can't use the umount(2) system call!!! */ - /* even if we are root */ - /* since mtab is not updated!!! */ - /* but we need it to be updated */ - /* some "magic" must be done */ - -/* nRet=umount(pItem->pszDevice); */ -/* if ( nRet != 0 ) */ -/* { */ -/* nRet = errno; */ - -/* #ifdef DEBUG_OSL_FILE */ -/* perror("mount"); */ -/* #endif */ -/* } */ - - - pszTmp = getenv("SAL_MOUNT_UMOUNTPROG"); - if ( pszTmp != 0 ) - { - pszUmountProg=pszTmp; - } - - pszTmp = getenv("SAL_MOUNT_SU_DO"); - if ( pszTmp != 0 ) - { - pszSuDo=pszTmp; - } - - if ( pszSuDo != 0 ) - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s %s",pszSuDo,pszUmountProg,pItem->pszMountPoint); - } - else - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s",pszUmountProg,pItem->pszMountPoint); - } - - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"executing '%s'\n",pszCmd); -#endif - - nRet = system(pszCmd); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"call returned '%i'\n",nRet); - fprintf(stderr,"exit status is '%i'\n", WEXITSTATUS(nRet)); -#endif - - switch ( WEXITSTATUS(nRet) ) - { - case 0: - nRet=0; - break; - - default: - nRet=EBUSY; - break; - } - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_unmountFloppy [ok]\n"); -#endif - - return ((0 == nRet) ? oslTranslateFileError(OSL_FET_SUCCESS, nRet) : oslTranslateFileError(OSL_FET_ERROR, nRet)); - -/* return osl_File_E_None;*/ -} - -static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem) -{ - struct mntent* pMountEnt=0; - sal_Char buffer[PATH_MAX]; - FILE* mntfile=0; - int nRet=0; - - buffer[0] = '\0'; - - mntfile = setmntent(MOUNTTAB,"r"); - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_getFloppyMountEntry\n"); -#endif - - memset(buffer, 0, sizeof(buffer)); - strncpy(buffer, pszPath, sizeof(buffer) - 1); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"Checking mount of %s\n",buffer); -#endif - - - if ( mntfile == 0 ) - { - nRet=errno; -#ifdef DEBUG_OSL_FILE - perror("mounttab"); -#endif -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_getFloppyMountEntry [mntfile]\n"); -#endif - return sal_False; - } - - pMountEnt=getmntent(mntfile); - while ( pMountEnt != 0 ) - { -#ifdef DEBUG_OSL_FILE -/* fprintf(stderr,"mnt_fsname : %s\n",pMountEnt->mnt_fsname); */ -/* fprintf(stderr,"mnt_dir : %s\n",pMountEnt->mnt_dir); */ -/* fprintf(stderr,"mnt_type : %s\n",pMountEnt->mnt_type);*/ -#endif - if ( strcmp(pMountEnt->mnt_dir,buffer) == 0 && - strncmp(pMountEnt->mnt_fsname,"/dev/fd",strlen("/dev/fd")) == 0 ) - { - - memset(pItem->pszMountPoint, 0, sizeof(pItem->pszMountPoint)); - strncpy(pItem->pszMountPoint, pMountEnt->mnt_dir, sizeof(pItem->pszMountPoint) - 1); - - memset(pItem->pszFilePath, 0, sizeof(pItem->pszFilePath)); - strncpy(pItem->pszFilePath, pMountEnt->mnt_dir, sizeof(pItem->pszFilePath) - 1); - - memset(pItem->pszDevice, 0, sizeof(pItem->pszDevice)); - strncpy(pItem->pszDevice, pMountEnt->mnt_fsname, sizeof(pItem->pszDevice) - 1); - - fclose(mntfile); -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"Mount Point found '%s'\n",pItem->pszMountPoint); -#endif -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_getFloppyMountEntry [found]\n"); -#endif - return sal_True; - } -#ifdef DEBUG_OSL_FILE -/* fprintf(stderr,"=================\n");*/ -#endif - pMountEnt=getmntent(mntfile); - } - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_getFloppyMountEntry [not found]\n"); -#endif - - fclose(mntfile); - return sal_False; -} - -static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice) -{ - sal_Char buffer[PATH_MAX]; - oslVolumeDeviceHandleImpl* pItem=0; - sal_Bool bRet=0; - - buffer[0] = '\0'; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_isFloppyMounted\n"); -#endif - - pItem = osl_newVolumeDeviceHandleImpl (); - if ( pItem == 0 ) - return osl_File_E_NOMEM; - - memset(buffer, 0, sizeof(buffer)); - strncpy(buffer, pDevice->pszMountPoint, sizeof(buffer) - 1); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"Checking mount of %s\n",buffer); -#endif - - bRet = osl_getFloppyMountEntry(buffer,pItem); - - if ( bRet == sal_False ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyMounted [not mounted]\n"); -#endif - return sal_False; - } - - if (strcmp(pItem->pszMountPoint, pDevice->pszMountPoint) == 0 && - strcmp(pItem->pszDevice,pDevice->pszDevice) == 0) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyMounted [is mounted]\n"); -#endif - rtl_freeMemory(pItem); - return sal_True; - } - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyMounted [may be EBUSY]\n"); -#endif - - rtl_freeMemory(pItem); - return sal_False; -} -#endif /* IRIX */ - - /* NetBSD floppy functions have to be added here. Until we have done that, * we use the MACOSX definitions for nonexistent floppy. * */ diff --git a/sal/osl/unx/module.c b/sal/osl/unx/module.c index d486aad00e01..ffb0ebb61e7b 100644 --- a/sal/osl/unx/module.c +++ b/sal/osl/unx/module.c @@ -35,32 +35,6 @@ #include <osl/process.h> #include <osl/file.h> -#ifdef IRIX -#ifndef _RLD_INTERFACE_DLFCN_H_DLADDR -#define _RLD_INTERFACE_DLFCN_H_DLADDR -typedef struct DL_INFO { - const char * dli_fname; - void * dli_fbase; - const char * dli_sname; - void * dli_saddr; - int dli_version; - int dli_reserved1; - long dli_reserved[4]; -} Dl_info; -#endif -#include <rld_interface.h> -#define _RLD_DLADDR 14 -int dladdr(void *address, Dl_info *dl); - -int dladdr(void *address, Dl_info *dl) -{ - void *v; - v = _rld_new_interface(_RLD_DLADDR,address,dl); - - return (int)v; -} -#endif - #include "system.h" #if OSL_DEBUG_LEVEL > 1 diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c index e5390089e6d7..5f3741be883e 100644 --- a/sal/osl/unx/nlsupport.c +++ b/sal/osl/unx/nlsupport.c @@ -33,7 +33,7 @@ #include <osl/process.h> #include <rtl/memory.h> -#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) +#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) #include <pthread.h> #ifndef MACOSX #include <locale.h> @@ -42,7 +42,7 @@ #include <osl/module.h> #include <osl/thread.h> #endif /* !MACOSX */ -#endif /* LINUX || SOLARIS || IRIX || NETBSD || MACOSX */ +#endif /* LINUX || SOLARIS || NETBSD || MACOSX */ #include <string.h> @@ -229,13 +229,12 @@ static rtl_Locale * _parse_locale( const char * locale ) return NULL; } -#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) +#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || defined(FREEBSD) /* * This implementation of osl_getTextEncodingFromLocale maps * from nl_langinfo(CODESET) to rtl_textencoding defines. - * nl_langinfo() is supported only on Linux and Solaris. - * nl_langinfo() is supported only on Linux, Solaris and IRIX, + * nl_langinfo() is supported only on Linux, Solaris, * >= NetBSD 1.6 and >= FreeBSD 4.4 * * This routine is SLOW because of the setlocale call, so @@ -299,24 +298,6 @@ const _pair _nl_language_list[] = { /* XXX MS-874 is an extension to tis620, so this is not * really equivalent */ -#elif defined(IRIX) - -const _pair _nl_language_list[] = { - { "big5", RTL_TEXTENCODING_BIG5 }, /* China - Traditional Chinese */ - { "eucCN", RTL_TEXTENCODING_EUC_CN }, /* China */ - { "eucgbk", RTL_TEXTENCODING_DONTKNOW }, /* China - Simplified Chinese */ - { "eucJP", RTL_TEXTENCODING_EUC_JP }, /* Japan */ - { "eucKR", RTL_TEXTENCODING_EUC_KR }, /* Korea */ - { "eucTW", RTL_TEXTENCODING_EUC_TW }, /* Taiwan - Traditional Chinese */ - { "gbk", RTL_TEXTENCODING_GBK }, /* China - Simplified Chinese */ - { "ISO8859-1", RTL_TEXTENCODING_ISO_8859_1 }, /* Western */ - { "ISO8859-2", RTL_TEXTENCODING_ISO_8859_2 }, /* Central European */ - { "ISO8859-5", RTL_TEXTENCODING_ISO_8859_5 }, /* Cyrillic */ - { "ISO8859-7", RTL_TEXTENCODING_ISO_8859_7 }, /* Greek */ - { "ISO8859-9", RTL_TEXTENCODING_ISO_8859_9 }, /* Turkish */ - { "ISO8859-15", RTL_TEXTENCODING_ISO_8859_15 }, /* Western Updated (w/Euro sign) */ - { "sjis", RTL_TEXTENCODING_SHIFT_JIS } /* Japan */ -}; #elif defined(LINUX) || defined(NETBSD) @@ -552,7 +533,7 @@ const _pair _nl_language_list[] = { { "UTF-8", RTL_TEXTENCODING_UTF8 } /* ISO-10646/UTF-8 */ }; -#endif /* ifdef SOLARIS IRIX LINUX FREEBSD NETBSD */ +#endif /* ifdef SOLARIS LINUX FREEBSD NETBSD */ static pthread_mutex_t aLocalMutex = PTHREAD_MUTEX_INITIALIZER; @@ -927,9 +908,6 @@ void _imp_getProcessLocale( rtl_Locale ** ppLocale ) int _imp_setProcessLocale( rtl_Locale * pLocale ) { -#ifdef IRIX - char env_buf[80]; -#endif char locale_buf[64]; /* convert rtl_Locale to locale string */ @@ -937,11 +915,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) { /* only change env vars that exist already */ if( getenv( "LC_ALL" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_ALL=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) setenv( "LC_ALL", locale_buf, 1); #else setenv( "LC_ALL", locale_buf ); @@ -949,11 +923,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LC_CTYPE" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_CTYPE=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LC_CTYPE", locale_buf ); @@ -961,11 +931,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LANG" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LANG=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LANG", locale_buf ); diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index a1f47cdf76a5..e3f78ff2f2b4 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -49,7 +49,7 @@ #endif #include "system.h" -#if defined(SOLARIS) || defined(IRIX) +#if defined(SOLARIS) # include <sys/procfs.h> #endif #include <osl/diagnose.h> @@ -269,7 +269,7 @@ static sal_Bool sendFdPipe(int PipeFD, int SocketFD) cmptr->cmsg_level = SOL_SOCKET; cmptr->cmsg_type = SCM_RIGHTS; cmptr->cmsg_len = CONTROLLEN; - *(int*)CMSG_DATA(cmptr) = SocketFD; + memcpy(CMSG_DATA(cmptr), &SocketFD, sizeof(int)); #endif @@ -360,7 +360,7 @@ static oslSocket receiveFdPipe(int PipeFD) ( msghdr.msg_controllen == CONTROLLEN ) ) { OSL_TRACE("receiveFdPipe : received '%i' bytes\n",nRead); - newfd = *(int*)CMSG_DATA(cmptr); + memcpy(&newfd, CMSG_DATA(cmptr), sizeof(int)); } #endif else @@ -431,10 +431,8 @@ oslSocket osl_receiveResourcePipe(oslPipe pPipe) static void ChildStatusProc(void *pData) { - int i; -/* int first = 0;*/ - pid_t pid; -/* int status;*/ + pid_t pid = -1; + int status = 0; int channel[2]; ProcessData data; ProcessData *pdata; @@ -447,25 +445,31 @@ static void ChildStatusProc(void *pData) in our child process */ memcpy(&data, pData, sizeof(data)); - socketpair(AF_UNIX, SOCK_STREAM, 0, channel); + if (socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == -1) + status = errno; fcntl(channel[0], F_SETFD, FD_CLOEXEC); fcntl(channel[1], F_SETFD, FD_CLOEXEC); /* Create redirected IO pipes */ + if ( status == 0 && data.m_pInputWrite ) + if (pipe( stdInput ) == -1) + status = errno; - if ( data.m_pInputWrite ) - pipe( stdInput ); - - if ( data.m_pOutputRead ) - pipe( stdOutput ); + if ( status == 0 && data.m_pOutputRead ) + if (pipe( stdOutput ) == -1) + status = errno; - if ( data.m_pErrorRead ) - pipe( stdError ); + if ( status == 0 && data.m_pErrorRead ) + if (pipe( stdError ) == -1) + status = errno; - if ((pid = fork()) == 0) + if ( (status == 0) && ((pid = fork()) == 0) ) { /* Child */ + int chstatus = 0; + sal_Int32 nWrote; + if (channel[0] != -1) close(channel[0]); if ((data.m_uid != (uid_t)-1) && ((data.m_uid != getuid()) || (data.m_gid != getgid()))) @@ -481,20 +485,15 @@ static void ChildStatusProc(void *pData) #endif } - if ((data.m_uid == (uid_t)-1) || ((data.m_uid == getuid()) && (data.m_gid == getgid()))) + if (data.m_pszDir) + chstatus = chdir(data.m_pszDir); + if (chstatus == 0 && ((data.m_uid == (uid_t)-1) || ((data.m_uid == getuid()) && (data.m_gid == getgid())))) { - if (data.m_pszDir) - chdir(data.m_pszDir); - + int i; for (i = 0; data.m_pszEnv[i] != NULL; i++) putenv(data.m_pszEnv[i]); -#if defined(LINUX) && !defined(NPTL) - /* mfe: linux likes to have just one thread when the exec family is called */ - /* this np function has this purpose ... */ - pthread_kill_other_threads_np(); -#endif OSL_TRACE("ChildStatusProc : starting '%s'",data.m_pszArgs[0]); /* Connect std IO to pipe ends */ @@ -537,7 +536,9 @@ static void ChildStatusProc(void *pData) OSL_TRACE("ChildStatusProc : starting '%s' failed",data.m_pszArgs[0]); /* if we reach here, something went wrong */ - write(channel[1], &errno, sizeof(errno)); + nWrote = write(channel[1], &errno, sizeof(errno)); + if (nWrote != sizeof(errno)) + OSL_TRACE("sendFdPipe : sending failed (%s)",strerror(errno)); if (channel[1] != -1) close(channel[1]); @@ -545,8 +546,7 @@ static void ChildStatusProc(void *pData) } else { /* Parent */ - int status; - + int i = -1; if (channel[1] != -1) close(channel[1]); /* Close unused pipe ends */ @@ -554,15 +554,17 @@ static void ChildStatusProc(void *pData) if (stdOutput[1] != -1) close( stdOutput[1] ); if (stdError[1] != -1) close( stdError[1] ); - while (((i = read(channel[0], &status, sizeof(status))) < 0)) + if (pid > 0) { - if (errno != EINTR) - break; + while (((i = read(channel[0], &status, sizeof(status))) < 0)) + { + if (errno != EINTR) + break; + } } if (channel[0] != -1) close(channel[0]); - if ((pid > 0) && (i == 0)) { pid_t child_pid; @@ -1368,48 +1370,6 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F return (pInfo->Fields == Fields) ? osl_Process_E_None : osl_Process_E_Unknown; } -#elif defined(IRIX) - - int fd; - sal_Char name[PATH_MAX + 1]; - - snprintf(name, sizeof(name), "/proc/%u", pid); - - if ((fd = open(name, O_RDONLY)) >= 0) - { - prstatus_t prstatus; - prpsinfo_t prpsinfo; - - if (ioctl(fd, PIOCSTATUS, &prstatus) >= 0 && - ioctl(fd, PIOCPSINFO, &prpsinfo) >= 0) - { - if (Fields & osl_Process_CPUTIMES) - { - pInfo->UserTime.Seconds = prstatus.pr_utime.tv_sec; - pInfo->UserTime.Nanosec = prstatus.pr_utime.tv_nsec; - pInfo->SystemTime.Seconds = prstatus.pr_stime.tv_sec; - pInfo->SystemTime.Nanosec = prstatus.pr_stime.tv_nsec; - - pInfo->Fields |= osl_Process_CPUTIMES; - } - - if (Fields & osl_Process_HEAPUSAGE) - { - int pagesize = getpagesize(); - - pInfo->HeapUsage = prpsinfo.pr_size*pagesize; - - pInfo->Fields |= osl_Process_HEAPUSAGE; - } - - close(fd); - - return (pInfo->Fields == Fields) ? osl_Process_E_None : osl_Process_E_Unknown; - } - else - close(fd); - } - #elif defined(LINUX) if ( (Fields & osl_Process_CPUTIMES) || (Fields & osl_Process_HEAPUSAGE) ) diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c index a01d292e23b6..a0ea4c59ffdd 100644 --- a/sal/osl/unx/profile.c +++ b/sal/osl/unx/profile.c @@ -263,12 +263,9 @@ static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, o pProfile->m_Stamp = OslProfile_getFileStamp(pFile); bRet=loadProfile(pFile, pProfile); + bRet &= realpath(pszProfileName, pProfile->m_FileName) != NULL; OSL_ASSERT(bRet); - /* #109261# using osl profiles is deprecated */ - /* OSL_VERIFY(NULL != realpath(pszProfileName, pProfile->m_FileName)); */ - realpath(pszProfileName, pProfile->m_FileName); - if (pProfile->m_pFile == NULL) closeFileImpl(pFile,pProfile->m_Flags); @@ -1338,6 +1335,7 @@ static osl_TStamp closeFileImpl(osl_TFile* pFile, oslProfileOption Flags) static sal_Bool OslProfile_rewindFile(osl_TFile* pFile, sal_Bool bTruncate) { + sal_Bool bRet = sal_True; #ifdef TRACE_OSL_PROFILE OSL_TRACE("In osl_OslProfile_rewindFile\n"); #endif @@ -1349,14 +1347,14 @@ static sal_Bool OslProfile_rewindFile(osl_TFile* pFile, sal_Bool bTruncate) #ifdef DEBUG_OSL_PROFILE OSL_TRACE("rewinding\n"); #endif - lseek(pFile->m_Handle, SEEK_SET, 0L); + bRet = (lseek(pFile->m_Handle, SEEK_SET, 0L) == 0L); if (bTruncate) { #ifdef DEBUG_OSL_PROFILE OSL_TRACE("truncating\n"); #endif - ftruncate(pFile->m_Handle, 0L); + bRet &= (ftruncate(pFile->m_Handle, 0L) == 0); } } @@ -1364,7 +1362,7 @@ static sal_Bool OslProfile_rewindFile(osl_TFile* pFile, sal_Bool bTruncate) #ifdef TRACE_OSL_PROFILE OSL_TRACE("Out osl_OslProfile_rewindFile [ok]\n"); #endif - return (sal_True); + return bRet; } diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c index 310dd57592f5..362f3b0f2644 100644 --- a/sal/osl/unx/socket.c +++ b/sal/osl/unx/socket.c @@ -48,7 +48,7 @@ #undef HAVE_POLL_H #endif -#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) +#if defined(LINUX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) #include <sys/poll.h> #define HAVE_POLL_H #endif /* HAVE_POLL_H */ @@ -1869,10 +1869,13 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) if ( pSocket->m_bIsAccepting == sal_True ) { int nConnFD; - struct sockaddr aSockAddr; - socklen_t nSockLen = sizeof(aSockAddr); + union { + struct sockaddr aSockAddr; + struct sockaddr_in aSockAddrIn; + } s; + socklen_t nSockLen = sizeof(s.aSockAddr); - nRet = getsockname(nFD, &aSockAddr, &nSockLen); + nRet = getsockname(nFD, &s.aSockAddr, &nSockLen); #if OSL_DEBUG_LEVEL > 1 if ( nRet < 0 ) { @@ -1880,13 +1883,11 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) } #endif /* OSL_DEBUG_LEVEL */ - if ( aSockAddr.sa_family == AF_INET ) + if ( s.aSockAddr.sa_family == AF_INET ) { - struct sockaddr_in* pSockAddrIn = (struct sockaddr_in*) &aSockAddr; - - if ( pSockAddrIn->sin_addr.s_addr == htonl(INADDR_ANY) ) + if ( s.aSockAddrIn.sin_addr.s_addr == htonl(INADDR_ANY) ) { - pSockAddrIn->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + s.aSockAddrIn.sin_addr.s_addr = htonl(INADDR_LOOPBACK); } nConnFD = socket(AF_INET, SOCK_STREAM, 0); @@ -1897,7 +1898,7 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) } #endif /* OSL_DEBUG_LEVEL */ - nRet = connect(nConnFD, &aSockAddr, sizeof(aSockAddr)); + nRet = connect(nConnFD, &s.aSockAddr, sizeof(s.aSockAddr)); #if OSL_DEBUG_LEVEL > 1 if ( nRet < 0 ) { diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h index c2e01126fb58..91f3b9fb7ae0 100644 --- a/sal/osl/unx/system.h +++ b/sal/osl/unx/system.h @@ -270,34 +270,6 @@ extern unsigned int nanosleep(unsigned int); # define PTHREAD_SIGACTION cma_sigaction #endif -#ifdef IRIX -# define AF_IPX -1 -# include <pthread.h> -# include <semaphore.h> -# include <sched.h> -# include <sys/socket.h> -# include <sys/un.h> -# include <sys/stropts.h> -# include <netinet/tcp.h> -# include <sys/endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# undef _BIG_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == BIG_ENDIAN -# undef _LITTLE_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# undef _LITTLE_ENDIAN -# undef _BIG_ENDIAN -# endif -# define SA_FAMILY_DECL \ - union { struct { short sa_family2; } sa_generic; } sa_union -# define NO_PTHREAD_PRIORITY -# include <dlfcn.h> -# define IOCHANNEL_TRANSFER_BSD -extern char *strdup(const char *); -#endif - #ifdef SOLARIS # include <shadow.h> # include <sys/un.h> @@ -364,8 +336,7 @@ int macxp_resolveAlias(char *path, int buflen); #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) && !defined(SCO) && \ !defined(AIX) && !defined(HPUX) && \ - !defined(SOLARIS) && !defined(IRIX) && \ - !defined(MACOSX) + !defined(SOLARIS) && !defined(MACOSX) # error "Target platform not specified!" #endif diff --git a/sal/rtl/source/alloc.c b/sal/rtl/source/alloc.c index 98a4c061e42b..123406717275 100644 --- a/sal/rtl/source/alloc.c +++ b/sal/rtl/source/alloc.c @@ -78,7 +78,7 @@ static sal_Size __rtl_memory_vmpagesize (void) /* xBSD */ return (sal_Size)(getpagesize()); } -#elif defined(IRIX) || defined(LINUX) || defined(SOLARIS) +#elif defined(LINUX) || defined(SOLARIS) static sal_Size __rtl_memory_vmpagesize (void) { /* POSIX */ @@ -90,7 +90,7 @@ static sal_Size __rtl_memory_vmpagesize (void) /* other */ return (sal_Size)(0x2000); } -#endif /* FREEBSD || NETBSD || MACOSX || IRIX || LINUX || SOLARIS */ +#endif /* FREEBSD || NETBSD || MACOSX || LINUX || SOLARIS */ #ifndef PROT_HEAP #define PROT_HEAP (PROT_READ | PROT_WRITE | PROT_EXEC) diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 23dab839d558..769251a6c4ec 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -820,8 +820,8 @@ void SAL_CALL rtl_bootstrap_set ( rtl_uString * pValue ) SAL_THROW_EXTERN_C() { - OUString const & name = *reinterpret_cast< OUString const * >( &pName ); - OUString const & value = *reinterpret_cast< OUString const * >( &pValue ); + const OUString name( pName ); + const OUString value( pValue ); osl::MutexGuard guard( osl::Mutex::getGlobalMutex() ); diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx index 2f0b723d236a..ba274844952e 100644 --- a/sal/rtl/source/macro.hxx +++ b/sal/rtl/source/macro.hxx @@ -49,8 +49,6 @@ #define THIS_OS "NetBSD" #elif defined FREEBSD #define THIS_OS "FreeBSD" -#elif defined IRIX -#define THIS_OS "Irix" #endif #if ! defined THIS_OS @@ -76,8 +74,6 @@ this is inserted for the case that the preprocessor ignores error #else # define THIS_ARCH "SPARC" #endif -#elif defined IRIX -# define THIS_ARCH "MIPS" #elif defined MIPS # ifdef OSL_BIGENDIAN # define THIS_ARCH "MIPS_EB" diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index a255ca21b13a..012046c9e5c8 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -879,8 +879,13 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, rtl::math::setNan( &fVal ); if (bSign) { - reinterpret_cast< sal_math_Double * >(&fVal)->w32_parts.msw - |= 0x80000000; // create negative NaN + union { + double sd; + sal_math_Double md; + } m; + m.sd = fVal; + m.md.w32_parts.msw |= 0x80000000; // create negative NaN + fVal = m.sd; bSign = false; // don't negate again } // Eat any further digits: diff --git a/sal/util/makefile.mk b/sal/util/makefile.mk index bc8026aa860f..a43f09e2e0e0 100644 --- a/sal/util/makefile.mk +++ b/sal/util/makefile.mk @@ -127,9 +127,6 @@ SHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl SHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract .ENDIF # C50 .ENDIF # SOLARIS -.IF "$(OS)"=="IRIX" -SHL1STDLIBS= -lexc -.ENDIF .ENDIF # UNX .IF "$(GUI)"=="OS2" diff --git a/salhelper/source/simplereferenceobject.cxx b/salhelper/source/simplereferenceobject.cxx index 2d80f246d171..36036feb5986 100755 --- a/salhelper/source/simplereferenceobject.cxx +++ b/salhelper/source/simplereferenceobject.cxx @@ -69,7 +69,7 @@ void SimpleReferenceObject::operator delete(void * pPtr) SAL_THROW(()) void SimpleReferenceObject::operator delete(void * pPtr, std::nothrow_t const &) SAL_THROW(()) { -#if defined WNT || (defined IRIX && !defined GCC) +#if defined WNT ::operator delete(pPtr); // WNT lacks a global nothrow operator delete... #else // WNT ::operator delete(pPtr, std::nothrow); diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index d7d3708c3295..4caaa1cb3267 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -679,6 +679,14 @@ ScFormulaCell::HasRefListExpressibleAsOneReference(ScRange& rRange) const Union of these references must form one range and their intersection must be empty set. */ + + // Detect the simple case of exactly one reference in advance without all + // overhead. + // #i107741# Doing so actually makes outlines using SUBTOTAL(x;reference) + // work again, where the function does not have only references. + if (HasOneReference( rRange)) + return true; + pCode->Reset(); // Get first reference, if any ScToken* const pFirstReference( diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 648573bbb21c..c4c51fb3f02a 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -50,10 +50,6 @@ #include "tabvwsh.hxx" #include "fillinfo.hxx" - -#ifdef IRIX -#include <basic/sbx.hxx> -#endif #include <svx/fmview.hxx> // STATIC DATA ----------------------------------------------------------- diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk index 11a5150d2784..3c51d15634de 100644 --- a/sc/util/makefile.mk +++ b/sc/util/makefile.mk @@ -41,10 +41,6 @@ USE_DEFFILE=TRUE .INCLUDE : settings.mk -.IF "$(OS)"=="IRIX" -LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=30 -.ENDIF - # --- Resourcen ---------------------------------------------------- RESLIB1LIST=\ diff --git a/scp2/source/base/file_base.scp b/scp2/source/base/file_base.scp index fa6c1cfcd661..0f34c3ad358d 100644 --- a/scp2/source/base/file_base.scp +++ b/scp2/source/base/file_base.scp @@ -57,7 +57,7 @@ STD_RES_FILE( gid_File_Res_Abp, abp) STD_UNO_LIB_FILE( gid_File_Lib_Dbp, dbp) STD_RES_FILE( gid_File_Res_Dbp, dbp) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Dbu, dbu ) +STD_UNO_LIB_FILE( gid_File_Lib_Dbu, dbu ) STD_RES_FILE( gid_File_Res_Dbu, dbu) STD_UNO_LIB_FILE( gid_File_Lib_Adabasui, adabasui ) @@ -67,7 +67,7 @@ STD_RES_FILE( gid_File_Res_Cnr, cnr) STD_RES_FILE( gid_File_Res_Sdbcl, sdbcl) STD_RES_FILE( gid_File_Res_Sdberr, sdberr) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Rpt, rpt ) +STD_UNO_LIB_FILE( gid_File_Lib_Rpt, rpt ) STD_RES_FILE( gid_File_Res_Rpt, rpt) STD_UNO_LIB_FILE( gid_File_Lib_Rptui, rptui ) diff --git a/scp2/source/calc/file_calc.scp b/scp2/source/calc/file_calc.scp index 89096b80f87c..3917d5f3e92f 100644 --- a/scp2/source/calc/file_calc.scp +++ b/scp2/source/calc/file_calc.scp @@ -51,9 +51,9 @@ STD_UNO_LIB_FILE( gid_File_Lib_Calc, calc) STD_UNO_LIB_FILE( gid_File_Lib_Date, date) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sc, sc) +STD_UNO_LIB_FILE( gid_File_Lib_Sc, sc) -STD_LIB_FILE_PATCH( gid_File_Lib_Scui, scui) +STD_LIB_FILE( gid_File_Lib_Scui, scui) STD_LIB_FILE( gid_File_Lib_Scfilt, scfilt) diff --git a/scp2/source/calc/registryitem_calc.scp b/scp2/source/calc/registryitem_calc.scp index c720c0a85d0f..4a30287e6fce 100644 --- a/scp2/source/calc/registryitem_calc.scp +++ b/scp2/source/calc/registryitem_calc.scp @@ -85,7 +85,7 @@ RegistryItem gid_Regitem_Clsid__7b342dc4_139a_4a46_8a93_Db0827ccee9c__Inprochand ModuleID = gid_Module_Prg_Calc_Bin; Subkey = "CLSID\{7B342DC4-139A-4a46-8A93-DB0827CCEE9C}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__7b342dc4_139a_4a46_8a93_Db0827ccee9c__Insertable @@ -204,7 +204,7 @@ RegistryItem gid_Regitem_Clsid__7fa8ae11_B3e3_4d88_Aabf_255526cd1ce8__Inprochand ModuleID = gid_Module_Prg_Calc_Bin; Subkey = "CLSID\{7FA8AE11-B3E3-4D88-AABF-255526CD1CE8}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__7fa8ae11_B3e3_4d88_Aabf_255526cd1ce8__Insertable diff --git a/scp2/source/canvas/canvascommons.scp b/scp2/source/canvas/canvascommons.scp index 839cf429793c..67e374e6d584 100644 --- a/scp2/source/canvas/canvascommons.scp +++ b/scp2/source/canvas/canvascommons.scp @@ -43,7 +43,7 @@ File gid_File_Oo_Office_Canvas_Xcu Name = "/registry/data/org/openoffice/Office/Canvas.xcu"; End -STD_LIB_FILE_PATCH(gid_File_Lib_CppCanvas, cppcanvas) +STD_LIB_FILE(gid_File_Lib_CppCanvas, cppcanvas) STD_LIB_FILE(gid_File_Lib_CanvasTools, canvastools) #ifdef ENABLE_AGG diff --git a/scp2/source/draw/registryitem_draw.scp b/scp2/source/draw/registryitem_draw.scp index 13b32fd71d0d..b06ca6430fe4 100644 --- a/scp2/source/draw/registryitem_draw.scp +++ b/scp2/source/draw/registryitem_draw.scp @@ -85,7 +85,7 @@ RegistryItem gid_Regitem_Clsid__41662fc2_0d57_4aff_Ab27_Ad2e12e7c273__Inprochand ModuleID = gid_Module_Prg_Draw_Bin; Subkey = "CLSID\{41662FC2-0D57-4aff-AB27-AD2E12E7C273}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__41662fc2_0d57_4aff_Ab27_Ad2e12e7c273__Insertable @@ -204,7 +204,7 @@ RegistryItem gid_Regitem_Clsid__448bb771_Cfe2_47c4_Bcdf_1fbf378e202c__Inprochand ModuleID = gid_Module_Prg_Draw_Bin; Subkey = "CLSID\{448BB771-CFE2-47C4-BCDF-1FBF378E202C}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__448bb771_Cfe2_47c4_Bcdf_1fbf378e202c__Insertable diff --git a/scp2/source/impress/registryitem_impress.scp b/scp2/source/impress/registryitem_impress.scp index 2e7d7f471cfe..cb23b879fc37 100644 --- a/scp2/source/impress/registryitem_impress.scp +++ b/scp2/source/impress/registryitem_impress.scp @@ -85,7 +85,7 @@ RegistryItem gid_Regitem_Clsid__E5a0b632_Dfba_4549_9346_E414da06e6f8__Inprochand ModuleID = gid_Module_Prg_Impress_Bin; Subkey = "CLSID\{E5A0B632-DFBA-4549-9346-E414DA06E6F8}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__E5a0b632_Dfba_4549_9346_E414da06e6f8__Insertable @@ -204,7 +204,7 @@ RegistryItem gid_Regitem_Clsid__Ee5d1ea4_D445_4289_B2fc_55fc93693917__Inprochand ModuleID = gid_Module_Prg_Impress_Bin; Subkey = "CLSID\{EE5D1EA4-D445-4289-B2FC-55FC93693917}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__Ee5d1ea4_D445_4289_B2fc_55fc93693917__Insertable diff --git a/scp2/source/layout/layout.scp b/scp2/source/layout/layout.scp index 64629d480a20..0bb9d19ec2ab 100644 --- a/scp2/source/layout/layout.scp +++ b/scp2/source/layout/layout.scp @@ -38,28 +38,28 @@ End File gid_File_Zip_Toolkit_Layout Dir = gid_Dir_Share_Layout; USER_FILE_BODY; - Styles = (ARCHIVE, PATCH); + Styles = (ARCHIVE); Name = "toolkit-layout.zip"; End File gid_File_Zip_Sc_Layout Dir = gid_Dir_Share_Layout; USER_FILE_BODY; - Styles = (ARCHIVE, PATCH); + Styles = (ARCHIVE); Name = "sc-layout.zip"; End File gid_File_Zip_Svx_Layout Dir = gid_Dir_Share_Layout; USER_FILE_BODY; - Styles = (ARCHIVE, PATCH); + Styles = (ARCHIVE); Name = "svx-layout.zip"; End File gid_File_Zip_Sw_Layout Dir = gid_Dir_Share_Layout; USER_FILE_BODY; - Styles = (ARCHIVE, PATCH); + Styles = (ARCHIVE); Name = "sw-layout.zip"; End diff --git a/scp2/source/math/file_math.scp b/scp2/source/math/file_math.scp index 43436a75f82d..5bd506f7432b 100644 --- a/scp2/source/math/file_math.scp +++ b/scp2/source/math/file_math.scp @@ -40,7 +40,7 @@ End #endif -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sm , sm) +STD_UNO_LIB_FILE( gid_File_Lib_Sm , sm) STD_UNO_LIB_FILE( gid_File_Lib_Smd , smd) diff --git a/scp2/source/math/registryitem_math.scp b/scp2/source/math/registryitem_math.scp index 84c246f60b3c..cc50981da023 100644 --- a/scp2/source/math/registryitem_math.scp +++ b/scp2/source/math/registryitem_math.scp @@ -84,7 +84,7 @@ RegistryItem gid_Regitem_Clsid__D0484de6_Aaee_468a_991f_8d4b0737b57a__Inprochand ModuleID = gid_Module_Prg_Math_Bin; Subkey = "CLSID\{D0484DE6-AAEE-468a-991F-8D4B0737B57A}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__D0484de6_Aaee_468a_991f_8d4b0737b57a__Insertable @@ -203,7 +203,7 @@ RegistryItem gid_Regitem_Clsid__D2d59cd1_0a6a_4d36_Ae20_47817077d57c__Inprochand ModuleID = gid_Module_Prg_Math_Bin; Subkey = "CLSID\{D2D59CD1-0A6A-4D36-AE20-47817077D57C}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__D2d59cd1_0a6a_4d36_Ae20_47817077d57c__Insertable diff --git a/scp2/source/onlineupdate/file_onlineupdate.scp b/scp2/source/onlineupdate/file_onlineupdate.scp index b415ea2ad9e7..470b69eb9030 100644 --- a/scp2/source/onlineupdate/file_onlineupdate.scp +++ b/scp2/source/onlineupdate/file_onlineupdate.scp @@ -30,7 +30,7 @@ #include "macros.inc" -SPECIAL_UNO_COMPONENT_LIB_FILE_PATCH( gid_File_Lib_Updchk , updchk.uno ) +SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Updchk , updchk.uno ) File gid_File_Registry_Spool_Oo_Office_Addons_Onlineupdate_Xcu TXT_FILE_BODY; diff --git a/scp2/source/ooo/file_improvement.scp b/scp2/source/ooo/file_improvement.scp index 93110fe693eb..67ec89b15963 100644 --- a/scp2/source/ooo/file_improvement.scp +++ b/scp2/source/ooo/file_improvement.scp @@ -49,5 +49,5 @@ End #endif #if defined(BUILD_SPECIAL) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Oooimprovement , oooimprovement) +STD_UNO_LIB_FILE( gid_File_Lib_Oooimprovement , oooimprovement) #endif diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp index b25f7f8b222c..f9c247bd6157 100644 --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -203,13 +203,13 @@ File gid_File_Lib_Comphelper2 Name = STRING(CONCAT3(comphelp4,COMID,.dll)); #endif Dir = SCP2_OOO_BIN_DIR; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; End STD_UNO_LIB_FILE( gid_File_Lib_Ctl , ctl) -STD_LIB_FILE_PATCH( gid_File_Lib_Cui, cui) +STD_LIB_FILE( gid_File_Lib_Cui, cui) #ifndef SYSTEM_CURL @@ -269,7 +269,7 @@ End #endif #endif -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Dba, dba) +STD_UNO_LIB_FILE( gid_File_Lib_Dba, dba) STD_UNO_LIB_FILE( gid_File_Lib_Sdbt, sdbt) @@ -277,7 +277,7 @@ STD_UNO_LIB_FILE( gid_File_Lib_Dbmm, dbmm) STD_UNO_LIB_FILE( gid_File_Lib_Dbacfg, dbacfg) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Dbase2, dbase ) +STD_UNO_LIB_FILE( gid_File_Lib_Dbase2, dbase ) File gid_File_Oo_Office_Dataaccess_Dbase_Xcu TXT_FILE_BODY; Styles = (PACKED); @@ -301,9 +301,9 @@ File gid_File_Lib_Dbpool #endif End -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Dbt, dbtools ) +STD_UNO_LIB_FILE( gid_File_Lib_Dbt, dbtools ) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Dbaxml, dbaxml ) +STD_UNO_LIB_FILE( gid_File_Lib_Dbaxml, dbaxml ) File gid_File_Lib_Dict_Ja TXT_FILE_BODY; @@ -362,7 +362,7 @@ End File gid_File_Lib_Dlgprov TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; #ifdef UNX @@ -462,7 +462,7 @@ End #endif -STD_LIB_FILE_PATCH(gid_File_Lib_Drawinglayer,drawinglayer) +STD_LIB_FILE(gid_File_Lib_Drawinglayer,drawinglayer) SPECIAL_UNO_LIB_FILE(gid_File_Lib_Embobj,embobj) @@ -472,11 +472,11 @@ SPECIAL_UNO_LIB_FILE(gid_File_Lib_Emboleobj,emboleobj) #if defined(WNT) && !defined(DISABLE_ATL) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Emser, emser ) +STD_UNO_LIB_FILE( gid_File_Lib_Emser, emser ) File gid_File_Lib_Inprocserv TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); Dir = SCP2_OOO_BIN_DIR; Name = "inprocserv.dll"; End @@ -563,7 +563,7 @@ SPECIAL_UNO_LIB_FILE(gid_File_Lib_Fileacc,fileacc) File gid_File_Lib_Filterconfig1 TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); Dir = SCP2_OOO_BIN_DIR; RegistryID = gid_Starregistry_Services_Rdb; Name = SPECIAL_NAME(filterconfig1); @@ -593,7 +593,7 @@ End File gid_File_Lib_Fps TXT_FILE_BODY; - Styles = (PACKED,PATCH,UNO_COMPONENT); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; Name = "fps.dll"; @@ -642,7 +642,7 @@ End #ifdef QUARTZ File gid_File_Lib_Fps_Aqua TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; Name = SPECIAL_COMPONENT_LIB_NAME(fps_aqua.uno); @@ -710,14 +710,14 @@ End #endif -STD_LIB_FILE_PATCH( gid_File_Lib_Fwe , fwe) +STD_LIB_FILE( gid_File_Lib_Fwe , fwe) STD_LIB_FILE( gid_File_Lib_Fwi , fwi) File gid_File_Lib_Fwk Name = LIBNAME(fwk); TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); Dir = SCP2_OOO_BIN_DIR; RegistryID = gid_Starregistry_Services_Rdb; End @@ -738,7 +738,7 @@ End File gid_File_Lib_Go Name = LIBNAME(go); TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); Dir = SCP2_OOO_BIN_DIR; RegistryID = gid_Starregistry_Services_Rdb; End @@ -749,7 +749,7 @@ STD_LIB_FILE( gid_File_Lib_Helplinker, helplinker) File gid_File_Lib_I18npool TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; #ifdef UNX @@ -935,12 +935,12 @@ File gid_File_Lib_Rebasemsi TXT_FILE_BODY; Name = "rebase.dll"; Dir = SCP2_OOO_BIN_DIR; - Styles = (PACKED,PATCH,BINARYTABLE,BINARYTABLE_ONLY,DONTRENAMEINPATCH); + Styles = (PACKED,BINARYTABLE,BINARYTABLE_ONLY,DONTRENAMEINPATCH); End #endif -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Lng, lng) +STD_UNO_LIB_FILE( gid_File_Lib_Lng, lng) File gid_File_Lib_Localedata_En TXT_FILE_BODY; @@ -1018,7 +1018,7 @@ STD_LIB_FILE(gid_File_Lib_Mozabdrv,mozabdrv) File gid_File_Lib_Mozbootstrap TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; #ifdef UNX @@ -1108,7 +1108,7 @@ File gid_File_Lib_Mingw_GccS TXT_FILE_BODY; Dir = gid_Dir_Program; Name = MINGW_GCCDLL; - Styles = (PACKED, PATCH); + Styles = (PACKED); End #endif @@ -1119,7 +1119,7 @@ File gid_File_Lib_Mingw_Stdcpp TXT_FILE_BODY; Dir = gid_Dir_Program; Name = MINGW_GXXDLL; - Styles = (PACKED, PATCH); + Styles = (PACKED); End #endif @@ -1228,7 +1228,7 @@ End STD_LIB_FILE(gid_File_Lib_DeploymentMisc, deploymentmisc) #ifndef WITHOUT_MOZILLA -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Pl , pl) +STD_UNO_LIB_FILE( gid_File_Lib_Pl , pl) #endif STD_UNO_LIB_FILE( gid_File_Lib_Preload, preload) @@ -1239,13 +1239,13 @@ SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Productregistration, productregistr File gid_File_Lib_Desktop_Detector Name = LIBNAME(desktop_detector); TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); Dir = SCP2_OOO_BIN_DIR; End File gid_File_Lib_Vclplug_Gen Name = LIBNAME(vclplug_gen); TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); Dir = SCP2_OOO_BIN_DIR; End #endif @@ -1255,7 +1255,7 @@ End File gid_File_Lib_Vclplug_Gtk Name = LIBNAME(vclplug_gtk); TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); Dir = SCP2_OOO_BIN_DIR; End #endif @@ -1264,7 +1264,7 @@ End File gid_File_Lib_Vclplug_Kde Name = LIBNAME(vclplug_kde); TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); Dir = SCP2_OOO_BIN_DIR; End #endif @@ -1300,7 +1300,7 @@ End #endif #if defined UNX && ! defined QUARTZ -STD_LIB_FILE_PATCH( gid_File_Lib_Vclplug_Svp, vclplug_svp ) +STD_LIB_FILE( gid_File_Lib_Vclplug_Svp, vclplug_svp ) STD_LIB_FILE( gid_File_Lib_BaseBmp, basebmp ) #endif @@ -1351,7 +1351,7 @@ End File gid_File_Lib_Res Name = LIBNAME(res); TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); Dir = SCP2_OOO_BIN_DIR; RegistryID = gid_Starregistry_Services_Rdb; End @@ -1382,9 +1382,9 @@ End STD_LIB_FILE( gid_File_Lib_Sax , sax) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Oox , oox) +STD_UNO_LIB_FILE( gid_File_Lib_Oox , oox) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sb , sb) +STD_UNO_LIB_FILE( gid_File_Lib_Sb , sb) STD_UNO_LIB_FILE( gid_File_Lib_Scn, scn) @@ -1401,15 +1401,15 @@ File gid_File_Lib_Scriptframe #endif RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; - Styles = (PACKED,PATCH,UNO_COMPONENT); + Styles = (PACKED,UNO_COMPONENT); End -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sd , sd) -STD_LIB_FILE_PATCH( gid_File_Lib_Sdui, sdui) +STD_UNO_LIB_FILE( gid_File_Lib_Sd , sd) +STD_LIB_FILE( gid_File_Lib_Sdui, sdui) File gid_File_Lib_Slideshow TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; #ifdef UNX @@ -1438,7 +1438,7 @@ STD_UNO_LIB_FILE( gid_File_Lib_Sf_Prothdlr, protocolhandler ) File gid_File_Lib_Sfx Name = LIBNAME(sfx); TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); Dir = SCP2_OOO_BIN_DIR; RegistryID = gid_Starregistry_Services_Rdb; End @@ -1466,7 +1466,7 @@ End #endif -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sot, sot ) +STD_UNO_LIB_FILE( gid_File_Lib_Sot, sot ) #if defined(UNX) && !defined(QUARTZ) @@ -1481,7 +1481,7 @@ End File gid_File_Lib_Spell TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Name = LIBNAME(spell); Dir = SCP2_OOO_BIN_DIR; @@ -1493,24 +1493,24 @@ SPECIAL_UNO_LIB_FILE(gid_File_Lib_Srtrs1,srtrs1) STD_LIB_FILE( gid_File_Lib_Sts , sts) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Svl, svl ) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Svtools, svt ) +STD_UNO_LIB_FILE( gid_File_Lib_Svl, svl ) +STD_UNO_LIB_FILE( gid_File_Lib_Svtools, svt ) -STD_LIB_FILE_PATCH( gid_File_Lib_Svx_Core, svxcore) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Svx, svx) +STD_LIB_FILE( gid_File_Lib_Svx_Core, svxcore) +STD_UNO_LIB_FILE( gid_File_Lib_Svx, svx) STD_UNO_LIB_FILE( gid_File_Lib_TextConversionDlgs, textconversiondlgs) -STD_LIB_FILE_PATCH( gid_File_Lib_Msfilter, msfilter) +STD_LIB_FILE( gid_File_Lib_Msfilter, msfilter) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sw , sw) -STD_LIB_FILE_PATCH( gid_File_Lib_Swui, swui) +STD_UNO_LIB_FILE( gid_File_Lib_Sw , sw) +STD_LIB_FILE( gid_File_Lib_Swui, swui) -STD_LIB_FILE_PATCH( gid_File_Lib_Msword, msword ) +STD_LIB_FILE( gid_File_Lib_Msword, msword ) #if ! defined UNX File gid_File_Lib_Sysdtrans TXT_FILE_BODY; - Styles = (PACKED,PATCH,UNO_COMPONENT); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Dir = SCP2_OOO_BIN_DIR; Name = "sysdtrans.dll"; @@ -1581,13 +1581,13 @@ File gid_File_Lib_Ucpchelp1 End #ifndef DISABLE_NEON -SPECIAL_UNO_LIB_FILE_PATCH(gid_File_Lib_Ucpdav1,ucpdav1) +SPECIAL_UNO_LIB_FILE(gid_File_Lib_Ucpdav1,ucpdav1) #ifndef SYSTEM_NEON SPECIAL_LIB_FILE(gid_File_Lib_Neon,neon) #endif #endif -SPECIAL_UNO_LIB_FILE_PATCH(gid_File_Lib_Ucpfile1,ucpfile1) +SPECIAL_UNO_LIB_FILE(gid_File_Lib_Ucpfile1,ucpfile1) SPECIAL_UNO_LIB_FILE(gid_File_Lib_Ucpftp1,ucpftp1) @@ -1601,7 +1601,7 @@ SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Ucpexpand1, ucpexpand1.uno) File gid_File_Lib_Lnth TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Name = LIBNAME(lnth); Dir = SCP2_OOO_BIN_DIR; @@ -1609,22 +1609,22 @@ End File gid_File_Lib_Hyph TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; Name = LIBNAME(hyphen); Dir = SCP2_OOO_BIN_DIR; End -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Utl , utl) +STD_UNO_LIB_FILE( gid_File_Lib_Utl , utl) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Uui, uui ) +STD_UNO_LIB_FILE( gid_File_Lib_Uui, uui ) STD_LIB_FILE( gid_File_Lib_BaseGfx, basegfx ) File gid_File_Lib_Vcl Name = LIBNAME(vcl); TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); Dir = SCP2_OOO_BIN_DIR; RegistryID = gid_Starregistry_Services_Rdb; End @@ -1649,7 +1649,7 @@ STD_UNO_LIB_FILE( gid_File_Lib_Xof , xof) File gid_File_Lib_Xo Name = LIBNAME(xo); TXT_FILE_BODY; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); Dir = SCP2_OOO_BIN_DIR; RegistryID = gid_Starregistry_Services_Rdb; End @@ -1712,7 +1712,7 @@ File gid_File_Lib_XSec_Framework Name = "xsec_fw.dll"; #endif Dir = SCP2_OOO_BIN_DIR; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; End @@ -1724,7 +1724,7 @@ File gid_File_Lib_XSec_XmlSec Name = "xsec_xmlsec.dll"; #endif Dir = SCP2_OOO_BIN_DIR; - Styles = (PACKED,UNO_COMPONENT,PATCH); + Styles = (PACKED,UNO_COMPONENT); RegistryID = gid_Starregistry_Services_Rdb; End @@ -1792,9 +1792,9 @@ End STD_UNO_LIB_FILE( gid_File_Lib_Guesslang, guesslang ) -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Updchkui , updchk ) +STD_UNO_LIB_FILE( gid_File_Lib_Updchkui , updchk ) -SPECIAL_UNO_COMPONENT_LIB_FILE_PATCH( gid_File_Lib_Updatefeed , updatefeed.uno ) +SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Updatefeed , updatefeed.uno ) #ifdef WNT File gid_File_Lib_Onlinecheck @@ -1842,7 +1842,7 @@ File gid_File_Lib_Unopkgapp Styles = (PACKED); End -STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Oooimprovecore , oooimprovecore) +STD_UNO_LIB_FILE( gid_File_Lib_Oooimprovecore , oooimprovecore) #if defined WNT && !defined _gcc3 && !defined SYSTEM_MOZILLA && !defined WITHOUT_MOZILLA && \ !(defined M1400 && defined PROF_EDITION && !defined _STLP_DEBUG) diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp index c22fabf74d57..5e571e0b2e03 100644 --- a/scp2/source/ooo/file_ooo.scp +++ b/scp2/source/ooo/file_ooo.scp @@ -163,7 +163,7 @@ End File gid_File_Profile_Gengal BIN_FILE_BODY; Dir = gid_Dir_Program; - Styles = (PACKED, PATCH); + Styles = (PACKED); Name = PROFILENAME(gengal); End @@ -173,7 +173,7 @@ File gid_File_Bin_Pluginapp BIN_FILE_BODY; Dir = gid_Dir_Program; Name = "pluginapp.bin"; - Styles = (PACKED,PATCH); + Styles = (PACKED); End #endif @@ -348,7 +348,7 @@ End STD_FILTER_FILE( gid_File_Filter_Eme, eme) -STD_FILTER_FILE_PATCH( gid_File_Filter_Sdfilt, sdfilt) +STD_FILTER_FILE( gid_File_Filter_Sdfilt, sdfilt) STD_FILTER_FILE( gid_File_Filter_Icg, icg) @@ -515,7 +515,7 @@ File gid_File_Jar_Unoil TXT_FILE_BODY; Name = "unoil.jar"; Dir = gid_Dir_Classes; - Styles = (PACKED,DONT_OVERWRITE,PATCH); + Styles = (PACKED,DONT_OVERWRITE); End #endif @@ -1656,7 +1656,7 @@ End File gid_File_Oo_Office_Ui_Genericcommands_Xcu TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui; Name = "/registry/data/org/openoffice/Office/UI/GenericCommands.xcu"; End @@ -1719,7 +1719,7 @@ End File gid_File_Oo_Office_Linguistic_Xcs TXT_FILE_BODY; - Styles = (PACKED,PATCH); + Styles = (PACKED); Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office; Name = "/registry/schema/org/openoffice/Office/Linguistic.xcs"; End @@ -2115,7 +2115,7 @@ End File gid_File_Rdb_Offapi TXT_FILE_BODY; Dir = gid_Dir_Program; - Styles = (PACKED,PATCH); + Styles = (PACKED); Name = "offapi.rdb"; End @@ -2713,7 +2713,7 @@ File gid_Starregistry_Services_Rdb TXT_FILE_BODY; Name = "services.rdb"; Dir = gid_Dir_Program; - Styles = (PACKED, STARREGISTRY, PATCH); + Styles = (PACKED, STARREGISTRY); #if defined WNT NativeServicesURLPrefix = "vnd.sun.star.expand:$BRAND_BASE_DIR/program/"; #else @@ -2882,7 +2882,7 @@ File gid_File_Images_Zip TXT_FILE_BODY; Dir = gid_Dir_Share_Config; Name = "images.zip"; - Styles = (PACKED,PATCH); + Styles = (PACKED); End File gid_File_ImagesCrystal_Zip diff --git a/scp2/source/ooo/file_resource_ooo.scp b/scp2/source/ooo/file_resource_ooo.scp index c0371115788f..010a3ec5efd6 100644 --- a/scp2/source/ooo/file_resource_ooo.scp +++ b/scp2/source/ooo/file_resource_ooo.scp @@ -87,7 +87,7 @@ STD_RES_FILE( gid_File_Res_San, san ) STD_RES_FILE( gid_File_Res_Sd, sd ) -STD_RES_FILE_PATCH( gid_File_Res_Sfx, sfx ) +STD_RES_FILE( gid_File_Res_Sfx, sfx ) #if defined(UNX) && !defined(QUARTZ) @@ -101,7 +101,7 @@ STD_RES_FILE( gid_File_Res_Sb, sb ) STD_RES_FILE( gid_File_Res_Svs, svs ) STD_RES_FILE( gid_File_Res_Svt, svt ) -STD_RES_FILE_ONLY_PATCH( gid_File_Res_Svp, svp ) +STD_RES_FILE_ONLY( gid_File_Res_Svp, svp ) STD_RES_FILE( gid_File_Res_Svx, svx ) STD_RES_FILE( gid_File_Res_TextConversionDlgs, textconversiondlgs ) @@ -115,7 +115,7 @@ STD_RES_FILE( gid_File_Res_Acc, acc ) STD_RES_FILE( gid_File_Res_Tpl, tpl ) -STD_RES_FILE_PATCH( gid_File_Res_Uui, uui ) +STD_RES_FILE( gid_File_Res_Uui, uui ) STD_RES_FILE( gid_File_Res_Vcl, vcl ) diff --git a/scp2/source/ooo/makefile.mk b/scp2/source/ooo/makefile.mk index 345f28a8762c..aa8c3178c9fd 100644 --- a/scp2/source/ooo/makefile.mk +++ b/scp2/source/ooo/makefile.mk @@ -301,7 +301,6 @@ PARFILES += \ folder_ooo.par \ folderitem_ooo.par \ registryitem_ooo.par \ - mergemodules_ooo.par \ vc_redist.par \ windowscustomaction_ooo.par .ENDIF diff --git a/scp2/source/ooo/profile_ooo.scp b/scp2/source/ooo/profile_ooo.scp index 97211fe6a5ac..34c3a5ce8957 100644 --- a/scp2/source/ooo/profile_ooo.scp +++ b/scp2/source/ooo/profile_ooo.scp @@ -56,7 +56,7 @@ Profile gid_Profile_Version_Ini_Basis ModuleID = gid_Module_Root; Name = PROFILENAME(version); Dir = gid_Dir_Program; - Styles = (PATCH); + Styles = (); End Profile gid_Profile_Fundamentalbasis_Ini diff --git a/scp2/source/ooo/registryitem_ooo.scp b/scp2/source/ooo/registryitem_ooo.scp index d06c4bd3864c..6544de17f993 100644 --- a/scp2/source/ooo/registryitem_ooo.scp +++ b/scp2/source/ooo/registryitem_ooo.scp @@ -266,7 +266,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Produc ModuleID = gid_Module_Root; Name = "INSTALLLOCATION"; Value = "[INSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgradecode_Install @@ -275,7 +275,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgrad ModuleID = gid_Module_Root; Name = "INSTALLLOCATION"; Value = "[INSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Install @@ -284,7 +284,7 @@ RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Install ModuleID = gid_Module_Root; Name = "INSTALLLOCATION"; Value = "[INSTALLLOCATION]"; - Styles = (ALWAYS_REQUIRED,PATCH); + Styles = (ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Productcode_Officeinstall @@ -293,7 +293,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Produc ModuleID = gid_Module_Root; Name = "OFFICEINSTALLLOCATION"; Value = "[OFFICEINSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH,UPGRADEKEY); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,UPGRADEKEY); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Productcode_Productversion @@ -302,7 +302,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Produc ModuleID = gid_Module_Root; Name = "ProductVersion"; Value = "[ProductVersion]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgradecode_Officeinstall @@ -311,7 +311,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgrad ModuleID = gid_Module_Root; Name = "OFFICEINSTALLLOCATION"; Value = "[OFFICEINSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgradecode_Productversion @@ -320,7 +320,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgrad ModuleID = gid_Module_Root; Name = "ProductVersion"; Value = "[ProductVersion]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Officeinstall @@ -329,7 +329,7 @@ RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Officeinstall ModuleID = gid_Module_Root; Name = "OFFICEINSTALLLOCATION"; Value = "[OFFICEINSTALLLOCATION]"; - Styles = (ALWAYS_REQUIRED,PATCH); + Styles = (ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Productcode_Basisinstall @@ -338,7 +338,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Produc ModuleID = gid_Module_Root; Name = "BASISINSTALLLOCATION"; Value = "[BASISINSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgradecode_Basisinstall @@ -347,7 +347,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgrad ModuleID = gid_Module_Root; Name = "BASISINSTALLLOCATION"; Value = "[BASISINSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Basisinstall @@ -356,7 +356,7 @@ RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Basisinstall ModuleID = gid_Module_Root; Name = "BASISINSTALLLOCATION"; Value = "[BASISINSTALLLOCATION]"; - Styles = (ALWAYS_REQUIRED,LAYER_REGISTRY,USE_OOOBASEVERSION,PATCH); + Styles = (ALWAYS_REQUIRED,LAYER_REGISTRY,USE_OOOBASEVERSION); End RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Layer_Basisinstall @@ -365,7 +365,7 @@ RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Layer_Basisinstal ModuleID = gid_Module_Root; Name = "BASISINSTALLLOCATION"; Value = "[BASISINSTALLLOCATION]"; - Styles = (ALWAYS_REQUIRED,PATCH); + Styles = (ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Productcode_Ureinstall @@ -374,7 +374,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Produc ModuleID = gid_Module_Root; Name = "UREINSTALLLOCATION"; Value = "[UREINSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgradecode_Ureinstall @@ -383,7 +383,7 @@ RegistryItem gid_Regitem_Software_Manufacturer_Productname_Productversion_Upgrad ModuleID = gid_Module_Root; Name = "UREINSTALLLOCATION"; Value = "[UREINSTALLLOCATION]"; - Styles = (LANGUAGEPACK,ALWAYS_REQUIRED,PATCH); + Styles = (LANGUAGEPACK,ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Ureinstall @@ -392,7 +392,7 @@ RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Ureinstall ModuleID = gid_Module_Root; Name = "UREINSTALLLOCATION"; Value = "[UREINSTALLLOCATION]"; - Styles = (ALWAYS_REQUIRED,LAYER_REGISTRY,USE_URELAYERVERSION,PATCH); + Styles = (ALWAYS_REQUIRED,LAYER_REGISTRY,USE_URELAYERVERSION); End RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Layer_Ureinstall @@ -401,7 +401,7 @@ RegistryItem gid_Regitem_Software_OpenOfficeorg_Ooobaseversion_Layer_Ureinstall ModuleID = gid_Module_Root; Name = "UREINSTALLLOCATION"; Value = "[UREINSTALLLOCATION]"; - Styles = (ALWAYS_REQUIRED,PATCH); + Styles = (ALWAYS_REQUIRED); End RegistryItem gid_Regitem_Sog diff --git a/scp2/source/ooo/ure.scp b/scp2/source/ooo/ure.scp index 1c260e2d2508..41f2b73adbe8 100755 --- a/scp2/source/ooo/ure.scp +++ b/scp2/source/ooo/ure.scp @@ -134,7 +134,7 @@ File gid_File_Exe_Javaldx BIN_FILE_BODY; Dir = gid_Dir_Ure_Bin; Name = EXENAME(javaldx); - Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID, PATCH); + Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID); // CompID = "291B5981-3E41-40E2-9C3F-115A7DF1C6A1"; End #endif @@ -269,7 +269,7 @@ File gid_File_Dl_Sal TXT_FILE_BODY; Dir = SCP2_URE_DL_DIR; Name = SCP2_URE_DL_UNO_VER("sal", "3"); - Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID,PATCH); + Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID); // CompID = "B1EF3AB6-611E-4027-958A-736583EB82E6"; End @@ -336,7 +336,7 @@ File gid_File_Dl_Sunjavaplugin TXT_FILE_BODY; Dir = SCP2_URE_DL_DIR; Name = SCP2_URE_DL_BARE("sunjavaplugin"); - Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID, PATCH); + Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID); // CompID = "0AC6C688-876C-40C5-B24E-9257003FDC3E"; End #endif @@ -839,7 +839,7 @@ File gid_File_Dl_Libxml2 #else Name = SCP2_URE_DL_VER("xml2", "2"); #endif - Styles = (PACKED, PATCH, VERSION_INDEPENDENT_COMP_ID); + Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID); // CompID = "BE6FAD97-F84C-43E3-8392-6FE2CDA04D8E"; End #endif @@ -1208,7 +1208,7 @@ Profile gid_Profile_Version_Ini_Ure ModuleID = gid_Module_Root_Ure_Hidden; Name = PROFILENAME(version); Dir = gid_Dir_Ure_Bin; - Styles = (PATCH); + Styles = (); End ProfileItem gid_Ure_Profileitem_Version_Buildid diff --git a/scp2/source/ooo/vc_redist.scp b/scp2/source/ooo/vc_redist.scp index cefdd69ce034..b7e6e81dc331 100644 --- a/scp2/source/ooo/vc_redist.scp +++ b/scp2/source/ooo/vc_redist.scp @@ -30,25 +30,29 @@ #include "macros.inc" #if defined(WITH_VC_REDIST) -WindowsCustomAction gid_Customaction_InstallRuntime - Name = "InstallRuntime"; - Typ = "98"; - Source = "SystemFolder"; - Target = "[SourceDir]redist\vcredist_x86.exe /qb"; - Inbinarytable = 0; - Styles = (NO_FILE); - Assignment1 = ("InstallUISequence", "VersionNT >= 600 and VersionNT < 700 And OLDPRODUCTSSAMEMAJOR And Not REMOVE=\"ALL\" And Not PATCH", "ExecuteAction"); -End -WindowsCustomAction gid_Customaction_InstallRuntime_X64 - Name = "InstallRuntimeX64"; - Typ = "98"; - Source = "SystemFolder"; - Target = "[SourceDir]redist\vcredist_x64.exe /qb"; - Inbinarytable = 0; - Styles = (NO_FILE); - Assignment1 = ("InstallUISequence", "Not REMOVE=\"ALL\" And Not PATCH And VersionNT64", "ExecuteAction"); -End +// WindowsCustomAction gid_Customaction_InstallRuntime +// Name = "InstallRuntime"; +// Typ = "98"; +// Source = "SystemFolder"; +// Target = "[SourceDir]redist\vcredist_x86.exe /qb"; +// Inbinarytable = 0; +// Styles = (NO_FILE); +// Assignment1 = ("InstallUISequence", "Not REMOVE=\"ALL\" And Not PATCH", "ExecuteAction"); +// // Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\" And Not PATCH", "FileCost"); +// End + +// WindowsCustomAction gid_Customaction_InstallRuntime_X64 +// Name = "InstallRuntimeX64"; +// Typ = "98"; +// Source = "SystemFolder"; +// Target = "[SourceDir]redist\vcredist_x64.exe /qb"; +// Inbinarytable = 0; +// Styles = (NO_FILE); +// Assignment1 = ("InstallUISequence", "Not REMOVE=\"ALL\" And Not PATCH And VersionNT64", "ExecuteAction"); +// // Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\" And Not PATCH And VersionNT64", "FileCost"); +// End + ScpAction scp_Copy_vcredist_x86 #if defined(BUILD_SPECIAL) @@ -65,4 +69,5 @@ ScpAction scp_Copy_vcredist_x64 Name = "vcredist_x64.exe"; Subdir = "redist"; End + #endif diff --git a/scp2/source/ooo/windowscustomaction_ooo.scp b/scp2/source/ooo/windowscustomaction_ooo.scp index b4ddac39799b..ceb0b156cd7b 100755 --- a/scp2/source/ooo/windowscustomaction_ooo.scp +++ b/scp2/source/ooo/windowscustomaction_ooo.scp @@ -394,7 +394,7 @@ WindowsCustomAction gid_Customaction_Patch_Isofficerunning Target = "IsOfficeRunning"; Inbinarytable = 1; Assignment1 = ("ControlEvent", "ReadyToInstall", "InstallNow", "DoAction", "IsOfficeRunning", "1", "1"); - Assignment2 = ("InstallExecuteSequence", "", "RunningOffice"); + Assignment2 = ("InstallExecuteSequence", "VersionNT < 600", "RunningOffice"); End WindowsCustomAction gid_Customaction_Full_Isofficerunning @@ -403,7 +403,7 @@ WindowsCustomAction gid_Customaction_Full_Isofficerunning Source = "shlxtmsi.dll"; Target = "IsOfficeRunning"; Inbinarytable = 1; - Assignment1 = ("InstallExecuteSequence", "", "RunningOffice"); + Assignment1 = ("InstallExecuteSequence", "VersionNT < 600 Or Not PATCH", "RunningOffice"); End WindowsCustomAction gid_Customaction_Langpack_Isofficerunning @@ -412,7 +412,7 @@ WindowsCustomAction gid_Customaction_Langpack_Isofficerunning Source = "lngpckinsthlp.dll"; Target = "IsOfficeRunning"; Inbinarytable = 1; - Assignment1 = ("InstallExecuteSequence", "PATCH", "RunningOffice"); + Assignment1 = ("InstallExecuteSequence", "PATCH And VersionNT < 600", "RunningOffice"); End WindowsCustomAction gid_Customaction_CheckPatchList diff --git a/scp2/source/writer/registryitem_writer.scp b/scp2/source/writer/registryitem_writer.scp index 33616500ac29..819ba6128663 100644 --- a/scp2/source/writer/registryitem_writer.scp +++ b/scp2/source/writer/registryitem_writer.scp @@ -85,7 +85,7 @@ RegistryItem gid_Regitem_Clsid__30a2652a_Ddf7_45e7_Aca6_3eab26fc8a4e__Inprochand ModuleID = gid_Module_Prg_Wrt_Bin; Subkey = "CLSID\{30A2652A-DDF7-45e7-ACA6-3EAB26FC8A4E}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__30a2652a_Ddf7_45e7_Aca6_3eab26fc8a4e__Insertable @@ -204,7 +204,7 @@ RegistryItem gid_Regitem_Clsid__F616b81f_7bb8_4f22_B8a5_47428d59f8ad__Inprochand ModuleID = gid_Module_Prg_Wrt_Bin; Subkey = "CLSID\{F616B81F-7BB8-4F22-B8A5-47428D59F8AD}\InprocHandler32"; Value = "<progpath>\program\inprocserv.dll"; - Styles = (PATCH); + Styles = (); End RegistryItem gid_Regitem_Clsid__F616b81f_7bb8_4f22_B8a5_47428d59f8ad__Insertable diff --git a/scp2/util/makefile.mk b/scp2/util/makefile.mk index 9ba398eff7b9..bafca83860cb 100644 --- a/scp2/util/makefile.mk +++ b/scp2/util/makefile.mk @@ -129,7 +129,6 @@ SCP1FILES += \ folder_ooo.par \ folderitem_ooo.par \ windowscustomaction_ooo.par \ - mergemodules_ooo.par \ vc_redist.par \ registryitem_writer.par \ folderitem_writer.par \ @@ -283,7 +282,6 @@ SCP2FILES += \ folder_ooo.par \ folderitem_ooo.par \ windowscustomaction_ooo.par \ - mergemodules_ooo.par \ vc_redist.par \ registryitem_writer.par \ folderitem_writer.par \ diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py index 75d2db533708..c8f7b6765261 100644 --- a/scripting/source/pyprov/mailmerge.py +++ b/scripting/source/pyprov/mailmerge.py @@ -85,8 +85,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService): self.server.starttls() self.server.ehlo() - user = xAuthenticator.getUserName() - password = xAuthenticator.getPassword() + user = xAuthenticator.getUserName().encode('ascii') + password = xAuthenticator.getPassword().encode('ascii') if user != '': if dbg: print >> sys.stderr, 'Logging in, username of', user @@ -234,8 +234,8 @@ class PyMailIMAPService(unohelper.Base, XMailService): self.server = imaplib.IMAP4(server, port) print >> sys.stderr, "AFTER" - user = xAuthenticator.getUserName() - password = xAuthenticator.getPassword() + user = xAuthenticator.getUserName().encode('ascii') + password = xAuthenticator.getPassword().encode('ascii') if user != '': if dbg: print >> sys.stderr, 'Logging in, username of', user @@ -302,8 +302,8 @@ class PyMailPOP3Service(unohelper.Base, XMailService): self.server = poplib.POP3(server, port) print >> sys.stderr, "AFTER" - user = xAuthenticator.getUserName() - password = xAuthenticator.getPassword() + user = xAuthenticator.getUserName().encode('ascii') + password = xAuthenticator.getPassword().encode('ascii') if dbg: print >> sys.stderr, 'Logging in, username of', user self.server.user(user) diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 23a04bf9d5ee..040bc7c0a78c 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -69,6 +69,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2drange.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <algorithm> @@ -1715,21 +1716,16 @@ void CustomAnimationEffect::updateSdrPathObjFromPath( SdrPathObj& rPathObj ) SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); if( pObj ) { - ::basegfx::B2DHomMatrix aTransform; - SdrPage* pPage = pObj->GetPage(); if( pPage ) { const Size aPageSize( pPage->GetSize() ); - aTransform.scale( (double)aPageSize.Width(), (double)aPageSize.Height() ); - xPolyPoly.transform( aTransform ); - aTransform.identity(); + xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix((double)aPageSize.Width(), (double)aPageSize.Height())); } const Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); const Point aCenter( aBoundRect.Center() ); - aTransform.translate( aCenter.X(), aCenter.Y() ); - xPolyPoly.transform( aTransform ); + xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(aCenter.X(), aCenter.Y())); } } @@ -1748,17 +1744,14 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj const Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); const Point aCenter( aBoundRect.Center() ); - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( -aCenter.X(), -aCenter.Y() ); - xPolyPoly.transform( aTransform ); + xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y())); SdrPage* pPage = pObj->GetPage(); if( pPage ) { - aTransform.identity(); const Size aPageSize( pPage->GetSize() ); - aTransform.scale( 1.0 / (double)aPageSize.Width(), 1.0 / (double)aPageSize.Height() ); - xPolyPoly.transform( aTransform ); + xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix( + 1.0 / (double)aPageSize.Width(), 1.0 / (double)aPageSize.Height())); } } diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 69d1d0203936..389af0473f85 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -302,8 +302,9 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rec case PRESOBJ_HANDOUT: { //Erste Standardseite am SdrPageObj vermerken - SdrPage* pFirstPage = ( (SdDrawDocument*) pModel )->GetSdPage(0, PK_STANDARD); - pSdrObj = new SdrPageObj( pFirstPage ); + // #i105146# We want no content to be displayed for PK_HANDOUT, + // so just never set a page as content + pSdrObj = new SdrPageObj(0); pSdrObj->SetResizeProtect(TRUE); } break; @@ -745,28 +746,17 @@ void SdPage::CreateTitleAndLayout(BOOL bInit, BOOL bCreate ) CalculateHandoutAreas( *static_cast< SdDrawDocument* >(GetModel() ), pMasterPage->GetAutoLayout(), false, aAreas ); const bool bSkip = pMasterPage->GetAutoLayout() == AUTOLAYOUT_HANDOUT3; - - sal_uInt16 nPage = 0; std::vector< Rectangle >::iterator iter( aAreas.begin() ); + while( iter != aAreas.end() ) { SdrPageObj* pPageObj = static_cast<SdrPageObj*>(pMasterPage->CreatePresObj(PRESOBJ_HANDOUT, FALSE, (*iter++), TRUE) ); - - const sal_uInt16 nDestinationPageNum(2 * nPage + 1); - - if(nDestinationPageNum < pModel->GetPageCount()) - { - pPageObj->SetReferencedPage(pModel->GetPage(nDestinationPageNum)); - } - else - { - pPageObj->SetReferencedPage(0L); - } + // #i105146# We want no content to be displayed for PK_HANDOUT, + // so just never set a page as content + pPageObj->SetReferencedPage(0L); if( bSkip && iter != aAreas.end() ) iter++; - - nPage++; } } diff --git a/sd/source/helper/simplereferencecomponent.cxx b/sd/source/helper/simplereferencecomponent.cxx index 25776e3c420d..2f8bf68dbdf9 100644 --- a/sd/source/helper/simplereferencecomponent.cxx +++ b/sd/source/helper/simplereferencecomponent.cxx @@ -135,7 +135,7 @@ void SimpleReferenceComponent::operator delete(void * pPtr, ) SAL_THROW(()) { -#if defined WNT || (defined IRIX && !defined GCC) +#if defined WNT ::operator delete(pPtr); // WNT lacks a global nothrow operator delete... #else // WNT ::operator delete(pPtr, rNothrow); diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 887c6014f29c..4fc0ec0dc80e 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -36,6 +36,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> @@ -196,9 +197,8 @@ bool PathDragResize::EndSdrDrag(bool /*bCopy*/) SdrPathObj* pPathObj = mxTag->getPathObj(); if( pPathObj ) { - basegfx::B2DHomMatrix aTrans; const Point aRef( DragStat().Ref1() ); - aTrans.translate(-aRef.X(), -aRef.Y()); + basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-aRef.X(), -aRef.Y())); aTrans.scale(double(aXFact), double(aYFact)); aTrans.translate(aRef.X(), aRef.Y()); basegfx::B2DPolyPolygon aDragPoly(pPathObj->GetPathPoly()); @@ -966,8 +966,8 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList ) ::com::sun::star::awt::Point aPos( mxOrigin->getPosition() ); if( (aPos.X != maOriginPos.X) || (aPos.Y != maOriginPos.Y) ) { - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( aPos.X - maOriginPos.X, aPos.Y - maOriginPos.Y ); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + aPos.X - maOriginPos.X, aPos.Y - maOriginPos.Y)); mxPolyPoly.transform( aTransform ); mpPathObj->SetPathPoly( mxPolyPoly ); maOriginPos = aPos; diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index fac03893a880..63dc54edefa5 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -52,9 +52,6 @@ #include <svl/ctloptions.hxx> #include <svl/itempool.hxx> -#ifdef IRIX -#include <basic/sbx.hxx> -#endif #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> #include "drawview.hxx" diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 83851db28cae..db1dc120e478 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -42,13 +42,13 @@ #include <svx/svdogrp.hxx> #include <svx/eeitem.hxx> - #include "View.hxx" #include "ViewShell.hxx" #include "Window.hxx" #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "strings.hrc" #include "sdresid.hxx" @@ -264,9 +264,8 @@ void FuMorph::ImpEqualizePolyPointCount(::basegfx::B2DPolygon& rSmall, const ::b const ::basegfx::B2DPoint aSrcPos(aSrcSize.getCenter()); const ::basegfx::B2DRange aDstSize(::basegfx::tools::getRange(rSmall)); const ::basegfx::B2DPoint aDstPos(aDstSize.getCenter()); - ::basegfx::B2DHomMatrix aTrans; - aTrans.translate(-aSrcPos.getX(), -aSrcPos.getY()); + basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-aSrcPos.getX(), -aSrcPos.getY())); aTrans.scale(aDstSize.getWidth() / aSrcSize.getWidth(), aDstSize.getHeight() / aSrcSize.getHeight()); aTrans.translate(aDstPos.getX(), aDstPos.getY()); @@ -499,16 +498,15 @@ sal_Bool FuMorph::ImpMorphPolygons( for(sal_uInt16 i(0); i < nSteps; i++) { fValue += fFactor; - ::basegfx::B2DPolyPolygon* pNewPolyPoly3D = ImpCreateMorphedPolygon(rPolyPoly1, rPolyPoly2, fValue); + ::basegfx::B2DPolyPolygon* pNewPolyPoly2D = ImpCreateMorphedPolygon(rPolyPoly1, rPolyPoly2, fValue); - const ::basegfx::B2DRange aNewPolySize(::basegfx::tools::getRange(*pNewPolyPoly3D)); + const ::basegfx::B2DRange aNewPolySize(::basegfx::tools::getRange(*pNewPolyPoly2D)); const ::basegfx::B2DPoint aNewS(aNewPolySize.getCenter()); const ::basegfx::B2DPoint aRealS(aStartCenter + (aDelta * fValue)); - ::basegfx::B2DHomMatrix aTrans; const ::basegfx::B2DPoint aDiff(aRealS - aNewS); - aTrans.translate(aDiff.getX(), aDiff.getY()); - pNewPolyPoly3D->transform(aTrans); - rPolyPolyList3D.Insert(pNewPolyPoly3D, LIST_APPEND); + + pNewPolyPoly2D->transform(basegfx::tools::createTranslateB2DHomMatrix(aDiff)); + rPolyPolyList3D.Insert(pNewPolyPoly2D, LIST_APPEND); } } return TRUE; diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index f4de77f03394..69190f68a0aa 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -38,6 +38,8 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> + #include <cppcanvas/vclfactory.hxx> #include <cppcanvas/basegfxfactory.hxx> @@ -384,16 +386,12 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation( ) throw (Ru Point aOutputOffset( ( aWindowSize.Width() - aOutputSize.Width() ) >> 1, ( aWindowSize.Height() - aOutputSize.Height() ) >> 1 ); - ::basegfx::B2DHomMatrix aMatrix; - maPresentationArea = Rectangle( aOutputOffset, aOutputSize ); mrOutputWindow.SetPresentationArea( maPresentationArea ); - // scale presentation into available window rect (minus 10%) - aMatrix.scale( aOutputSize.Width(), aOutputSize.Height() ); - - // center in the window - aMatrix.translate( aOutputOffset.X(), aOutputOffset.Y() ); + // scale presentation into available window rect (minus 10%); center in the window + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix( + aOutputSize.Width(), aOutputSize.Height(), aOutputOffset.X(), aOutputOffset.Y())); geometry::AffineMatrix2D aRes; diff --git a/sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx b/sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx index 1d99584bec4b..93798e095871 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx @@ -89,6 +89,7 @@ protected: OverlayManager. This registration is done on demand. */ void EnsureRegistration (void); + void RemoveRegistration(); }; @@ -147,6 +148,7 @@ class SelectionRectangleOverlay { public: SelectionRectangleOverlay (ViewOverlay& rViewOverlay); + virtual ~SelectionRectangleOverlay(); void Start (const Point& rAnchor); void Update (const Point& rSecondCorner); @@ -176,6 +178,7 @@ class InsertionIndicatorOverlay { public: InsertionIndicatorOverlay (ViewOverlay& rViewOverlay); + virtual ~InsertionIndicatorOverlay(); /** Given a position in model coordinates this method calculates the insertion marker both as an index in the document and as a rectangle diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx index 3e0d61064bdf..8c3fd4532c4f 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx @@ -256,7 +256,7 @@ namespace sd { namespace slidesorter { namespace view { // class for all derived SdPageObjectPrimitives. The SdPageObjectBasePrimitive itself // is pure virtual -class SdPageObjectBasePrimitive : public drawinglayer::primitive2d::BasePrimitive2D +class SdPageObjectBasePrimitive : public drawinglayer::primitive2d::BufferedDecompositionPrimitive2D { private: // the inner range of the SdPageObject visualisation @@ -275,7 +275,7 @@ public: }; SdPageObjectBasePrimitive::SdPageObjectBasePrimitive(const basegfx::B2DRange& rRange) -: drawinglayer::primitive2d::BasePrimitive2D(), +: drawinglayer::primitive2d::BufferedDecompositionPrimitive2D(), maRange(rRange) { } @@ -286,7 +286,7 @@ SdPageObjectBasePrimitive::~SdPageObjectBasePrimitive() bool SdPageObjectBasePrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive2D& rPrimitive ) const { - if(drawinglayer::primitive2d::BasePrimitive2D::operator==(rPrimitive)) + if(drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdPageObjectBasePrimitive& rCompare = static_cast< const SdPageObjectBasePrimitive& >(rPrimitive); return (getPageObjectRange() == rCompare.getPageObjectRange()); @@ -306,7 +306,7 @@ private: protected: // method which is to be used to implement the local decomposition of a 2D primitive. - virtual Primitive2DSequence createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: // constructor and destructor @@ -325,7 +325,7 @@ public: DeclPrimitrive2DIDBlock() }; -Primitive2DSequence SdPageObjectPageBitmapPrimitive::createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const +Primitive2DSequence SdPageObjectPageBitmapPrimitive::create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const { // add bitmap primitive // to avoid scaling, use the Bitmap pixel size as primitive size @@ -385,7 +385,7 @@ private: protected: // method which is to be used to implement the local decomposition of a 2D primitive. - virtual Primitive2DSequence createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: // constructor and destructor @@ -399,7 +399,7 @@ public: const sal_Int32 SdPageObjectSelectPrimitive::mnSelectionIndicatorOffset(1); const sal_Int32 SdPageObjectSelectPrimitive::mnSelectionIndicatorThickness(3); -Primitive2DSequence SdPageObjectSelectPrimitive::createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const +Primitive2DSequence SdPageObjectSelectPrimitive::create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence xRetval(2); @@ -470,7 +470,7 @@ class SdPageObjectBorderPrimitive : public SdPageObjectBasePrimitive { protected: // method which is to be used to implement the local decomposition of a 2D primitive. - virtual Primitive2DSequence createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: // constructor and destructor @@ -481,7 +481,7 @@ public: DeclPrimitrive2DIDBlock() }; -Primitive2DSequence SdPageObjectBorderPrimitive::createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const +Primitive2DSequence SdPageObjectBorderPrimitive::create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const { // since old Width/Height calculations always added a single pixel value, // it is necessary to create a inner range which is one display unit less @@ -524,7 +524,7 @@ private: protected: // method which is to be used to implement the local decomposition of a 2D primitive. - virtual Primitive2DSequence createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: // constructor and destructor @@ -537,7 +537,7 @@ public: const sal_Int32 SdPageObjectFocusPrimitive::mnFocusIndicatorOffset(2); -Primitive2DSequence SdPageObjectFocusPrimitive::createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const +Primitive2DSequence SdPageObjectFocusPrimitive::create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence xRetval(2); @@ -633,7 +633,7 @@ private: protected: // method which is to be used to implement the local decomposition of a 2D primitive. - virtual Primitive2DSequence createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: // constructor and destructor @@ -683,6 +683,7 @@ const BitmapEx& SdPageObjectFadeNameNumberPrimitive::getFadeEffectIconBitmap() c return *mpFadeEffectIconBitmap; } + const sal_Int32 SdPageObjectFadeNameNumberPrimitive::mnCommentsIndicatorOffset(9); BitmapEx* SdPageObjectFadeNameNumberPrimitive::mpCommentsIconBitmap = 0; @@ -701,7 +702,7 @@ const BitmapEx& SdPageObjectFadeNameNumberPrimitive::getCommentsIconBitmap() con return *mpCommentsIconBitmap; } -Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const +Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::create2DDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const { const xub_StrLen nTextLength(getPageName().Len()); const sal_uInt32 nCount( @@ -727,8 +728,8 @@ Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecompositio // get font attributes basegfx::B2DVector aTextSizeAttribute; - const drawinglayer::primitive2d::FontAttributes aFontAttributes( - drawinglayer::primitive2d::getFontAttributesFromVclFont( + const drawinglayer::attribute::FontAttribute aFontAttribute( + drawinglayer::primitive2d::getFontAttributeFromVclFont( aTextSizeAttribute, getPageNameFont(), false, @@ -834,7 +835,7 @@ Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecompositio 0, aPageName.Len(), aDXArray, - aFontAttributes, + aFontAttribute, aLocale, aFontColor)); } @@ -875,7 +876,7 @@ Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecompositio 0, nNumberLen, aDXArray, - aFontAttributes, + aFontAttribute, aLocale, aFontColor)); @@ -1190,12 +1191,16 @@ void PageObjectViewObjectContact::ActionChanged (void) // Even when we are called from destructor we still have to invalide // the preview bitmap in the cache. const SdrPage* pPage = GetPage(); - SdDrawDocument* pDocument = dynamic_cast<SdDrawDocument*>(pPage->GetModel()); - if (mpCache!=NULL && pPage!=NULL && pDocument!=NULL) + + if(pPage) { - cache::PageCacheManager::Instance()->InvalidatePreviewBitmap( - pDocument->getUnoModel(), - GetPage()); + SdDrawDocument* pDocument = dynamic_cast<SdDrawDocument*>(pPage->GetModel()); + if (mpCache!=NULL && pPage!=NULL && pDocument!=NULL) + { + cache::PageCacheManager::Instance()->InvalidatePreviewBitmap( + pDocument->getUnoModel(), + pPage); + } } // call parent @@ -1211,7 +1216,7 @@ void PageObjectViewObjectContact::ActionChanged (void) // Very simple primitive which just remembers the discrete data and applies // it at decomposition time. -class MouseOverEffectPrimitive : public drawinglayer::primitive2d::BasePrimitive2D +class MouseOverEffectPrimitive : public drawinglayer::primitive2d::BufferedDecompositionPrimitive2D { private: basegfx::B2DRange maLogicRange; @@ -1220,7 +1225,7 @@ private: basegfx::BColor maRGBColor; protected: - virtual drawinglayer::primitive2d::Primitive2DSequence createLocalDecomposition( + virtual drawinglayer::primitive2d::Primitive2DSequence create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: @@ -1229,7 +1234,7 @@ public: sal_uInt32 nDiscreteOffset, sal_uInt32 nDiscreteWidth, const basegfx::BColor& rRGBColor) - : drawinglayer::primitive2d::BasePrimitive2D(), + : drawinglayer::primitive2d::BufferedDecompositionPrimitive2D(), maLogicRange(rLogicRange), mnDiscreteOffset(nDiscreteOffset), mnDiscreteWidth(nDiscreteWidth), @@ -1247,7 +1252,7 @@ public: DeclPrimitrive2DIDBlock() }; -drawinglayer::primitive2d::Primitive2DSequence MouseOverEffectPrimitive::createLocalDecomposition( +drawinglayer::primitive2d::Primitive2DSequence MouseOverEffectPrimitive::create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& rViewInformation) const { // get logic sizes in object coordinate system @@ -1277,7 +1282,7 @@ drawinglayer::primitive2d::Primitive2DSequence MouseOverEffectPrimitive::createL bool MouseOverEffectPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive2D& rPrimitive ) const { - if(drawinglayer::primitive2d::BasePrimitive2D::operator==(rPrimitive)) + if(drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const MouseOverEffectPrimitive& rCompare = static_cast< const MouseOverEffectPrimitive& >(rPrimitive); diff --git a/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx b/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx index 5e338480e236..0cad1985ce35 100644 --- a/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx @@ -55,6 +55,8 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> + #include <svx/sdr/overlay/overlaymanager.hxx> #include <svx/svdpagv.hxx> #include <svx/sdrpagewindow.hxx> @@ -165,9 +167,7 @@ OverlayBase::OverlayBase (ViewOverlay& rViewOverlay) OverlayBase::~OverlayBase (void) { - OverlayManager* pOverlayManager = getOverlayManager(); - if (pOverlayManager != NULL) - pOverlayManager->remove(*this); + OSL_ENSURE(!getOverlayManager(), "Please call RemoveRegistration() in the derived class; it's too late to call it in the base class since virtual methods will be missing when called in the destructor."); } @@ -186,6 +186,16 @@ void OverlayBase::EnsureRegistration (void) +void OverlayBase::RemoveRegistration() +{ + OverlayManager* pOverlayManager = getOverlayManager(); + if (pOverlayManager != NULL) + pOverlayManager->remove(*this); +} + + + + //===== SubstitutionOverlay ================================================= SubstitutionOverlay::SubstitutionOverlay (ViewOverlay& rViewOverlay) @@ -200,6 +210,7 @@ SubstitutionOverlay::SubstitutionOverlay (ViewOverlay& rViewOverlay) SubstitutionOverlay::~SubstitutionOverlay (void) { + RemoveRegistration(); } @@ -245,8 +256,7 @@ void SubstitutionOverlay::Clear (void) void SubstitutionOverlay::Move (const Point& rOffset) { - basegfx::B2DHomMatrix aTranslation; - aTranslation.translate(rOffset.X(), rOffset.Y()); + const basegfx::B2DHomMatrix aTranslation(basegfx::tools::createTranslateB2DHomMatrix(rOffset.X(), rOffset.Y())); maShapes.transform(aTranslation); maPosition += rOffset; @@ -316,6 +326,13 @@ SelectionRectangleOverlay::SelectionRectangleOverlay (ViewOverlay& rViewOverlay) +SelectionRectangleOverlay::~SelectionRectangleOverlay() +{ + RemoveRegistration(); +} + + + Rectangle SelectionRectangleOverlay::GetSelectionRectangle (void) { @@ -391,6 +408,14 @@ InsertionIndicatorOverlay::InsertionIndicatorOverlay (ViewOverlay& rViewOverlay) +InsertionIndicatorOverlay::~InsertionIndicatorOverlay() +{ + RemoveRegistration(); +} + + + + void InsertionIndicatorOverlay::SetPositionAndSize (const Rectangle& aNewBoundingBox) { EnsureRegistration(); @@ -509,6 +534,7 @@ MouseOverIndicatorOverlay::MouseOverIndicatorOverlay (ViewOverlay& rViewOverlay) MouseOverIndicatorOverlay::~MouseOverIndicatorOverlay (void) { + RemoveRegistration(); } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 187a62f0dcfe..685bb4a48144 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -322,6 +322,7 @@ const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKind ) { MAP_CHAR_LEN(UNO_NAME_PAGE_TOP), WID_PAGE_TOP, &::getCppuType((const sal_Int32*)0), 0, 0}, { MAP_CHAR_LEN(UNO_NAME_PAGE_HEIGHT), WID_PAGE_HEIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, { MAP_CHAR_LEN(UNO_NAME_PAGE_ORIENTATION), WID_PAGE_ORIENT, &::getCppuType((const view::PaperOrientation*)0),0, 0}, + { MAP_CHAR_LEN(UNO_NAME_PAGE_NUMBER), WID_PAGE_NUMBER, &::getCppuType((const sal_Int16*)0), beans::PropertyAttribute::READONLY, 0}, { MAP_CHAR_LEN(UNO_NAME_PAGE_WIDTH), WID_PAGE_WIDTH, &::getCppuType((const sal_Int32*)0), 0, 0}, { MAP_CHAR_LEN(UNO_NAME_PAGE_LAYOUT), WID_PAGE_LAYOUT, &::getCppuType((const sal_Int16*)0), 0, 0}, { MAP_CHAR_LEN(sUNO_Prop_UserDefinedAttributes),WID_PAGE_USERATTRIBS, &::getCppuType((const Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, @@ -1001,7 +1002,21 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) aAny <<= (sal_Int16)( GetPage()->GetAutoLayout() ); break; case WID_PAGE_NUMBER: - aAny <<= (sal_Int16)((sal_uInt16)((GetPage()->GetPageNum()-1)>>1) + 1); + { + const sal_uInt16 nPageNumber(GetPage()->GetPageNum()); + + if(nPageNumber > 0) + { + // for all other pages calculate the number + aAny <<= (sal_Int16)((sal_uInt16)((nPageNumber-1)>>1) + 1); + } + else + { + // for pages with number 0 (Handout Master, Handout page) + // return 0 + aAny <<= (sal_Int16)0; + } + } break; case WID_PAGE_DURATION: aAny <<= (sal_Int32)(GetPage()->GetTime()); diff --git a/sd/source/ui/view/PrintManager.cxx b/sd/source/ui/view/PrintManager.cxx index 3963c4cb5273..6d24fdf98e79 100644 --- a/sd/source/ui/view/PrintManager.cxx +++ b/sd/source/ui/view/PrintManager.cxx @@ -34,6 +34,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "PrintManager.hxx" @@ -1779,10 +1780,10 @@ void PrintManager::InitHandoutTemplate( PrintInfo& /*rInfo*/, USHORT nSlidesPerH aPoly.insert(0, basegfx::B2DPoint( aRect.Left(), aRect.Top() ) ); aPoly.insert(1, basegfx::B2DPoint( aRect.Right(), aRect.Top() ) ); - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( 0.0, static_cast< double >( aRect.GetHeight() / 7 ) ); - + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + 0.0, static_cast< double >( aRect.GetHeight() / 7 ))); basegfx::B2DPolyPolygon aPathPoly; + for( sal_uInt16 nLine = 0; nLine < 7; nLine++ ) { aPoly.transform( aMatrix ); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 2077a852f960..3d7ec543943b 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -1196,25 +1196,15 @@ BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage) { // set pages for all available handout presentation objects sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList(); - - sal_uInt16 nPgNum = 0; SdrObject* pObj = 0; + while( (pObj = rShapeList.getNextShape(pObj)) != 0 ) { if( pMaster->GetPresObjKind(pObj) == PRESOBJ_HANDOUT ) { - const sal_uInt16 nDestinationPageNum(2 * nPgNum + 1); - - if(nDestinationPageNum < GetDoc()->GetPageCount()) - { - static_cast<SdrPageObj*>(pObj)->SetReferencedPage(GetDoc()->GetPage(nDestinationPageNum)); - } - else - { - static_cast<SdrPageObj*>(pObj)->SetReferencedPage(0L); - } - - nPgNum++; + // #i105146# We want no content to be displayed for PK_HANDOUT, + // so just never set a page as content + static_cast<SdrPageObj*>(pObj)->SetReferencedPage(0); } } } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 020f2a1ffec5..d38704bd124c 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -99,6 +99,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> #include <svx/unoapi.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <numeric> @@ -447,20 +448,19 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP aVclFont.SetHeight( 500 ); - const drawinglayer::primitive2d::FontAttributes aFontAttributes( - drawinglayer::primitive2d::getFontAttributesFromVclFont( + const drawinglayer::attribute::FontAttribute aFontAttribute( + drawinglayer::primitive2d::getFontAttributeFromVclFont( aTextSizeAttribute, aVclFont, false, false)); // fill text matrix - basegfx::B2DHomMatrix aTextMatrix; - - aTextMatrix.scale(aTextSizeAttribute.getX(), aTextSizeAttribute.getY()); - aTextMatrix.shearX(fShearX); - aTextMatrix.rotate(fRotate); - aTextMatrix.translate(fPosX, fPosY); + const basegfx::B2DHomMatrix aTextMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aTextSizeAttribute.getX(), aTextSizeAttribute.getY(), + fShearX, + fRotate, + fPosX, fPosY)); // create DXTextArray (can be empty one) const ::std::vector< double > aDXArray; @@ -476,7 +476,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP 0, nTextLength, aDXArray, - aFontAttributes, + aFontAttribute, aLocale, aFontColor)); drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xRef); diff --git a/sdext/prj/build.lst b/sdext/prj/build.lst index 9d99c119ad83..8ced1e83edad 100644 --- a/sdext/prj/build.lst +++ b/sdext/prj/build.lst @@ -6,7 +6,8 @@ dx sdext\source\minimizer\registry\data\org\openoffice\Office\extension nmake - dx sdext\source\minimizer\registry\data\org\openoffice\Office\UI nmake - all sdext_minimizer_rdooou NULL dx sdext\source\minimizer\registry\data\org\openoffice\Office nmake - all sdext_minimizer_rdooo NULL dx sdext\source\presenter\registry\data\org\openoffice\Office\extension nmake - all sdext_presenter_xcu NULL -dx sdext\source\presenter nmake - all sdext_presenter sdext_inc sdext_presenter_xcu NULL +dx sdext\source\presenter\help\en-US\com.sun.PresenterScreen nmake - all sdext_presenter_help NULL +dx sdext\source\presenter nmake - all sdext_presenter sdext_inc sdext_presenter_xcu sdext_presenter_help NULL dx sdext\inc nmake - all sdext_inc NULL dx sdext\source\pdfimport\xpdfwrapper nmake - all dx_xpdfwrap NULL dx sdext\source\pdfimport\xpdftest nmake - all dx_parsetest dx_xpdfwrap NULL diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx index 2a025430b722..997ede16f454 100644 --- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx +++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx @@ -51,6 +51,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2drectangle.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <com/sun/star/rendering/XVolatileBitmap.hpp> #include <com/sun/star/geometry/RealSize2D.hpp> @@ -502,8 +503,7 @@ GraphicsContext& PDFIProcessor::getTransformGlyphContext( CharGlyph& rGlyph ) FontAttributes aFontAttrs = m_aIdToFont[ rGlyph.getGC().FontId ]; // add transformation to GC - basegfx::B2DHomMatrix aFontTransform; - aFontTransform.translate( -rRect.X1, -rRect.Y1 ); + basegfx::B2DHomMatrix aFontTransform(basegfx::tools::createTranslateB2DHomMatrix(-rRect.X1, -rRect.Y1)); aFontTransform *= aFontMatrix; aFontTransform.translate( rRect.X1, rRect.Y1 ); diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-linux_x86/presenter.xhp b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-linux_x86/presenter.xhp deleted file mode 100755 index ba804733ac7d..000000000000 --- a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-linux_x86/presenter.xhp +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<helpdocument version="1.0">
-
-<!--
-***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: soffice2xmlhelp.xsl,v $
- * $Revision: 1.12 $
- *
- * 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.
- *
- ************************************************************************
- -->
-
-
-<meta>
- <topic id="textpresenterxml" indexer="include" status="PUBLISH">
- <title xml-lang="en-US" id="tit" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</title>
- <filename>/com.sun.PresenterScreen-linux_x86/presenter.xhp</filename>
- </topic>
- </meta>
- <body>
-<bookmark xml-lang="en-US" branch="hid/com.sun.PresenterScreen" id="bm_id3138439" localize="false"/>
-<bookmark xml-lang="en-US" branch="index" id="bm_id0921200912285678"><bookmark_value>Presenter Console shortcuts</bookmark_value>
-</bookmark>
-<paragraph xml-lang="en-US" id="hd_id0921201912165661" role="heading" level="1" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</paragraph>
- <paragraph xml-lang="en-US" id="par_id0921201912165656" role="paragraph" l10n="NEW">When running a slide show using the Sun Presenter Console, you can use the following keys:</paragraph>
- <table id="tbl_id0921200901051232">
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104028" role="tablehead" l10n="NEW">Action</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104093" role="tablehead" l10n="NEW">Key or Keys</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110418" role="tablecontent" l10n="NEW">Next slide, or next effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104120" role="tablecontent" l10n="NEW">Left click, right arrow, down arrow, spacebar, page down, enter, return, 'N'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104165" role="tablecontent" l10n="NEW">Previous slide, or previous effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104115" role="tablecontent" l10n="NEW">Right click, left arrow, up arrow, page up, backspace, 'P'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104164" role="tablecontent" l10n="NEW">First slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104148" role="tablecontent" l10n="NEW">Home</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104221" role="tablecontent" l10n="NEW">Last slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104277" role="tablecontent" l10n="NEW">End</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104279" role="tablecontent" l10n="NEW">Previous slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110423" role="tablecontent" l10n="NEW">Alt+Page Up</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110427" role="tablecontent" l10n="NEW">Next slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104261" role="tablecontent" l10n="NEW">Alt+Page Down</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104383" role="tablecontent" l10n="NEW">Black/Unblack the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110431" role="tablecontent" l10n="NEW">'B', '.'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104311" role="tablecontent" l10n="NEW">White/Unwhite the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104359" role="tablecontent" l10n="NEW">'W', ','</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104336" role="tablecontent" l10n="NEW">End slide show</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104419" role="tablecontent" l10n="NEW">Esc, '-'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104460" role="tablecontent" l10n="NEW">Go to slide number</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110440" role="tablecontent" l10n="NEW">Number followed by Enter</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104427" role="tablecontent" l10n="NEW">Grow/Shrink size of notes font</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104442" role="tablecontent" l10n="NEW">'G', 'S'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104473" role="tablecontent" l10n="NEW">Scroll notes up/down</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110459" role="tablecontent" l10n="NEW">'A', 'Z'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110456" role="tablecontent" l10n="NEW">Move caret in notes view backward/forward</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110457" role="tablecontent" l10n="NEW">'H', 'L'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104566" role="tablecontent" l10n="NEW">Show the Presenter Console</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104544" role="tablecontent" l10n="NEW">Ctrl-'1'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104535" role="tablecontent" l10n="NEW">Show the Presentation Notes</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104680" role="tablecontent" l10n="NEW">Ctrl-'2'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104634" role="tablecontent" l10n="NEW">Show the Slides Overview</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104632" role="tablecontent" l10n="NEW">Ctrl-'3'</paragraph>
- </tablecell>
- </tablerow>
- </table>
-
- </body>
-</helpdocument>
diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-linux_x86_64/presenter.xhp b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-linux_x86_64/presenter.xhp deleted file mode 100644 index 2ad489b265d4..000000000000 --- a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-linux_x86_64/presenter.xhp +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<helpdocument version="1.0"> - -<!-- -*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: soffice2xmlhelp.xsl,v $ - * $Revision: 1.12 $ - * - * 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. - * - ************************************************************************ - --> - - -<meta> - <topic id="textpresenterxml" indexer="include" status="PUBLISH"> - <title xml-lang="en-US" id="tit" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</title> - <filename>/com.sun.PresenterScreen-linux_x86_64/presenter.xhp</filename> - </topic> - </meta> - <body> -<bookmark xml-lang="en-US" branch="hid/com.sun.PresenterScreen" id="bm_id3138439" localize="false"/> -<bookmark xml-lang="en-US" branch="index" id="bm_id0921200912285678"><bookmark_value>Presenter Console shortcuts</bookmark_value> -</bookmark> -<paragraph xml-lang="en-US" id="hd_id0921201912165661" role="heading" level="1" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</paragraph> - <paragraph xml-lang="en-US" id="par_id0921201912165656" role="paragraph" l10n="NEW">When running a slide show using the Sun Presenter Console, you can use the following keys:</paragraph> - <table id="tbl_id0921200901051232"> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104028" role="tablehead" l10n="NEW">Action</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104093" role="tablehead" l10n="NEW">Key or Keys</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110418" role="tablecontent" l10n="NEW">Next slide, or next effect</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104120" role="tablecontent" l10n="NEW">Left click, right arrow, down arrow, spacebar, page down, enter, return, 'N'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104165" role="tablecontent" l10n="NEW">Previous slide, or previous effect</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104115" role="tablecontent" l10n="NEW">Right click, left arrow, up arrow, page up, backspace, 'P'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104164" role="tablecontent" l10n="NEW">First slide</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104148" role="tablecontent" l10n="NEW">Home</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104221" role="tablecontent" l10n="NEW">Last slide</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104277" role="tablecontent" l10n="NEW">End</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104279" role="tablecontent" l10n="NEW">Previous slide without effects</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110423" role="tablecontent" l10n="NEW">Alt+Page Up</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110427" role="tablecontent" l10n="NEW">Next slide without effects</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104261" role="tablecontent" l10n="NEW">Alt+Page Down</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104383" role="tablecontent" l10n="NEW">Black/Unblack the screen</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110431" role="tablecontent" l10n="NEW">'B', '.'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104311" role="tablecontent" l10n="NEW">White/Unwhite the screen</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104359" role="tablecontent" l10n="NEW">'W', ','</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104336" role="tablecontent" l10n="NEW">End slide show</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104419" role="tablecontent" l10n="NEW">Esc, '-'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104460" role="tablecontent" l10n="NEW">Go to slide number</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110440" role="tablecontent" l10n="NEW">Number followed by Enter</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104427" role="tablecontent" l10n="NEW">Grow/Shrink size of notes font</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104442" role="tablecontent" l10n="NEW">'G', 'S'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104473" role="tablecontent" l10n="NEW">Scroll notes up/down</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110459" role="tablecontent" l10n="NEW">'A', 'Z'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110456" role="tablecontent" l10n="NEW">Move caret in notes view backward/forward</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id092120090110457" role="tablecontent" l10n="NEW">'H', 'L'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104566" role="tablecontent" l10n="NEW">Show the Presenter Console</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104544" role="tablecontent" l10n="NEW">Ctrl-'1'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104535" role="tablecontent" l10n="NEW">Show the Presentation Notes</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104680" role="tablecontent" l10n="NEW">Ctrl-'2'</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104634" role="tablecontent" l10n="NEW">Show the Slides Overview</paragraph> - </tablecell> - <tablecell> - <paragraph xml-lang="en-US" id="par_id0921200901104632" role="tablecontent" l10n="NEW">Ctrl-'3'</paragraph> - </tablecell> - </tablerow> - </table> - - </body> -</helpdocument> diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-macosx_x86/presenter.xhp b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-macosx_x86/presenter.xhp deleted file mode 100755 index 551fa61b5849..000000000000 --- a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-macosx_x86/presenter.xhp +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<helpdocument version="1.0">
-
-<!--
-***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: soffice2xmlhelp.xsl,v $
- * $Revision: 1.12 $
- *
- * 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.
- *
- ************************************************************************
- -->
-
-
-<meta>
- <topic id="textpresenterxml" indexer="include" status="PUBLISH">
- <title xml-lang="en-US" id="tit" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</title>
- <filename>/com.sun.PresenterScreen-macosx_x86/presenter.xhp</filename>
- </topic>
- </meta>
- <body>
-<bookmark xml-lang="en-US" branch="hid/com.sun.PresenterScreen" id="bm_id3138439" localize="false"/>
-<bookmark xml-lang="en-US" branch="index" id="bm_id0921200912285678"><bookmark_value>Presenter Console shortcuts</bookmark_value>
-</bookmark>
-<paragraph xml-lang="en-US" id="hd_id0921201912165661" role="heading" level="1" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</paragraph>
- <paragraph xml-lang="en-US" id="par_id0921201912165656" role="paragraph" l10n="NEW">When running a slide show using the Sun Presenter Console, you can use the following keys:</paragraph>
- <table id="tbl_id0921200901051232">
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104028" role="tablehead" l10n="NEW">Action</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104093" role="tablehead" l10n="NEW">Key or Keys</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110418" role="tablecontent" l10n="NEW">Next slide, or next effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104120" role="tablecontent" l10n="NEW">Left click, right arrow, down arrow, spacebar, page down, enter, return, 'N'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104165" role="tablecontent" l10n="NEW">Previous slide, or previous effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104115" role="tablecontent" l10n="NEW">Right click, left arrow, up arrow, page up, backspace, 'P'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104164" role="tablecontent" l10n="NEW">First slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104148" role="tablecontent" l10n="NEW">Home</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104221" role="tablecontent" l10n="NEW">Last slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104277" role="tablecontent" l10n="NEW">End</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104279" role="tablecontent" l10n="NEW">Previous slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110423" role="tablecontent" l10n="NEW">Alt+Page Up</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110427" role="tablecontent" l10n="NEW">Next slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104261" role="tablecontent" l10n="NEW">Alt+Page Down</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104383" role="tablecontent" l10n="NEW">Black/Unblack the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110431" role="tablecontent" l10n="NEW">'B', '.'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104311" role="tablecontent" l10n="NEW">White/Unwhite the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104359" role="tablecontent" l10n="NEW">'W', ','</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104336" role="tablecontent" l10n="NEW">End slide show</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104419" role="tablecontent" l10n="NEW">Esc, '-'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104460" role="tablecontent" l10n="NEW">Go to slide number</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110440" role="tablecontent" l10n="NEW">Number followed by Enter</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104427" role="tablecontent" l10n="NEW">Grow/Shrink size of notes font</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104442" role="tablecontent" l10n="NEW">'G', 'S'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104473" role="tablecontent" l10n="NEW">Scroll notes up/down</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110459" role="tablecontent" l10n="NEW">'A', 'Z'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110456" role="tablecontent" l10n="NEW">Move caret in notes view backward/forward</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110457" role="tablecontent" l10n="NEW">'H', 'L'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104566" role="tablecontent" l10n="NEW">Show the Presenter Console</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104544" role="tablecontent" l10n="NEW">Ctrl-'1'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104535" role="tablecontent" l10n="NEW">Show the Presentation Notes</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104680" role="tablecontent" l10n="NEW">Ctrl-'2'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104634" role="tablecontent" l10n="NEW">Show the Slides Overview</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104632" role="tablecontent" l10n="NEW">Ctrl-'3'</paragraph>
- </tablecell>
- </tablerow>
- </table>
-
- </body>
-</helpdocument>
diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-solaris_sparc/presenter.xhp b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-solaris_sparc/presenter.xhp deleted file mode 100755 index a6e2b55d2e7d..000000000000 --- a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-solaris_sparc/presenter.xhp +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<helpdocument version="1.0">
-
-<!--
-***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: soffice2xmlhelp.xsl,v $
- * $Revision: 1.12 $
- *
- * 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.
- *
- ************************************************************************
- -->
-
-
-<meta>
- <topic id="textpresenterxml" indexer="include" status="PUBLISH">
- <title xml-lang="en-US" id="tit" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</title>
- <filename>/com.sun.PresenterScreen-solaris_sparc/presenter.xhp</filename>
- </topic>
- </meta>
- <body>
-<bookmark xml-lang="en-US" branch="hid/com.sun.PresenterScreen" id="bm_id3138439" localize="false"/>
-<bookmark xml-lang="en-US" branch="index" id="bm_id0921200912285678"><bookmark_value>Presenter Console shortcuts</bookmark_value>
-</bookmark>
-<paragraph xml-lang="en-US" id="hd_id0921201912165661" role="heading" level="1" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</paragraph>
- <paragraph xml-lang="en-US" id="par_id0921201912165656" role="paragraph" l10n="NEW">When running a slide show using the Sun Presenter Console, you can use the following keys:</paragraph>
- <table id="tbl_id0921200901051232">
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104028" role="tablehead" l10n="NEW">Action</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104093" role="tablehead" l10n="NEW">Key or Keys</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110418" role="tablecontent" l10n="NEW">Next slide, or next effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104120" role="tablecontent" l10n="NEW">Left click, right arrow, down arrow, spacebar, page down, enter, return, 'N'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104165" role="tablecontent" l10n="NEW">Previous slide, or previous effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104115" role="tablecontent" l10n="NEW">Right click, left arrow, up arrow, page up, backspace, 'P'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104164" role="tablecontent" l10n="NEW">First slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104148" role="tablecontent" l10n="NEW">Home</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104221" role="tablecontent" l10n="NEW">Last slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104277" role="tablecontent" l10n="NEW">End</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104279" role="tablecontent" l10n="NEW">Previous slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110423" role="tablecontent" l10n="NEW">Alt+Page Up</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110427" role="tablecontent" l10n="NEW">Next slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104261" role="tablecontent" l10n="NEW">Alt+Page Down</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104383" role="tablecontent" l10n="NEW">Black/Unblack the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110431" role="tablecontent" l10n="NEW">'B', '.'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104311" role="tablecontent" l10n="NEW">White/Unwhite the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104359" role="tablecontent" l10n="NEW">'W', ','</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104336" role="tablecontent" l10n="NEW">End slide show</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104419" role="tablecontent" l10n="NEW">Esc, '-'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104460" role="tablecontent" l10n="NEW">Go to slide number</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110440" role="tablecontent" l10n="NEW">Number followed by Enter</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104427" role="tablecontent" l10n="NEW">Grow/Shrink size of notes font</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104442" role="tablecontent" l10n="NEW">'G', 'S'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104473" role="tablecontent" l10n="NEW">Scroll notes up/down</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110459" role="tablecontent" l10n="NEW">'A', 'Z'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110456" role="tablecontent" l10n="NEW">Move caret in notes view backward/forward</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110457" role="tablecontent" l10n="NEW">'H', 'L'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104566" role="tablecontent" l10n="NEW">Show the Presenter Console</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104544" role="tablecontent" l10n="NEW">Ctrl-'1'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104535" role="tablecontent" l10n="NEW">Show the Presentation Notes</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104680" role="tablecontent" l10n="NEW">Ctrl-'2'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104634" role="tablecontent" l10n="NEW">Show the Slides Overview</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104632" role="tablecontent" l10n="NEW">Ctrl-'3'</paragraph>
- </tablecell>
- </tablerow>
- </table>
-
- </body>
-</helpdocument>
diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-windows_x86/presenter.xhp b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-windows_x86/presenter.xhp deleted file mode 100755 index fabd7a3fa35c..000000000000 --- a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-windows_x86/presenter.xhp +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<helpdocument version="1.0">
-
-<!--
-***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: soffice2xmlhelp.xsl,v $
- * $Revision: 1.12 $
- *
- * 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.
- *
- ************************************************************************
- -->
-
-
-<meta>
- <topic id="textpresenterxml" indexer="include" status="PUBLISH">
- <title xml-lang="en-US" id="tit" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</title>
- <filename>/com.sun.PresenterScreen-windows_x86/presenter.xhp</filename>
- </topic>
- </meta>
- <body>
-<bookmark xml-lang="en-US" branch="hid/com.sun.PresenterScreen" id="bm_id3138439" localize="false"/>
-<bookmark xml-lang="en-US" branch="index" id="bm_id0921200912285678"><bookmark_value>Presenter Console shortcuts</bookmark_value>
-</bookmark>
-<paragraph xml-lang="en-US" id="hd_id0921201912165661" role="heading" level="1" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</paragraph>
- <paragraph xml-lang="en-US" id="par_id0921201912165656" role="paragraph" l10n="NEW">When running a slide show using the Sun Presenter Console, you can use the following keys:</paragraph>
- <table id="tbl_id0921200901051232">
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104028" role="tablehead" l10n="NEW">Action</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104093" role="tablehead" l10n="NEW">Key or Keys</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110418" role="tablecontent" l10n="NEW">Next slide, or next effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104120" role="tablecontent" l10n="NEW">Left click, right arrow, down arrow, spacebar, page down, enter, return, 'N'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104165" role="tablecontent" l10n="NEW">Previous slide, or previous effect</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104115" role="tablecontent" l10n="NEW">Right click, left arrow, up arrow, page up, backspace, 'P'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104164" role="tablecontent" l10n="NEW">First slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104148" role="tablecontent" l10n="NEW">Home</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104221" role="tablecontent" l10n="NEW">Last slide</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104277" role="tablecontent" l10n="NEW">End</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104279" role="tablecontent" l10n="NEW">Previous slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110423" role="tablecontent" l10n="NEW">Alt+Page Up</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110427" role="tablecontent" l10n="NEW">Next slide without effects</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104261" role="tablecontent" l10n="NEW">Alt+Page Down</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104383" role="tablecontent" l10n="NEW">Black/Unblack the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110431" role="tablecontent" l10n="NEW">'B', '.'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104311" role="tablecontent" l10n="NEW">White/Unwhite the screen</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104359" role="tablecontent" l10n="NEW">'W', ','</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104336" role="tablecontent" l10n="NEW">End slide show</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104419" role="tablecontent" l10n="NEW">Esc, '-'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104460" role="tablecontent" l10n="NEW">Go to slide number</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110440" role="tablecontent" l10n="NEW">Number followed by Enter</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104427" role="tablecontent" l10n="NEW">Grow/Shrink size of notes font</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104442" role="tablecontent" l10n="NEW">'G', 'S'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104473" role="tablecontent" l10n="NEW">Scroll notes up/down</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110459" role="tablecontent" l10n="NEW">'A', 'Z'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110456" role="tablecontent" l10n="NEW">Move caret in notes view backward/forward</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id092120090110457" role="tablecontent" l10n="NEW">'H', 'L'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104566" role="tablecontent" l10n="NEW">Show the Presenter Console</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104544" role="tablecontent" l10n="NEW">Ctrl-'1'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104535" role="tablecontent" l10n="NEW">Show the Presentation Notes</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104680" role="tablecontent" l10n="NEW">Ctrl-'2'</paragraph>
- </tablecell>
- </tablerow>
- <tablerow>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104634" role="tablecontent" l10n="NEW">Show the Slides Overview</paragraph>
- </tablecell>
- <tablecell>
- <paragraph xml-lang="en-US" id="par_id0921200901104632" role="tablecontent" l10n="NEW">Ctrl-'3'</paragraph>
- </tablecell>
- </tablerow>
- </table>
-
- </body>
-</helpdocument>
diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/makefile.mk b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/makefile.mk new file mode 100644 index 000000000000..854644169f17 --- /dev/null +++ b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/makefile.mk @@ -0,0 +1,55 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.10 $ +# +# 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=sdext +TARGET=PresenterScreenHelp +EXTNAME=PresenterScreen + +PACKAGE = com.sun.PresenterScreen + +# --- Settings ---------------------------------- + +.INCLUDE : settings.mk + +.IF "$(ENABLE_PRESENTER_SCREEN)" == "NO" +do_nothing: + @echo "Presenter Screen build disabled." +.ELSE + +XHPFILES= \ + presenter.xhp + + +.INCLUDE : target.mk +.INCLUDE : tg_help.mk + +.ENDIF diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-solaris_x86/presenter.xhp b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/presenter.xhp index 5bbf174953e5..8ef828812dd6 100644..100755 --- a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen-solaris_x86/presenter.xhp +++ b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/presenter.xhp @@ -37,7 +37,7 @@ <meta> <topic id="textpresenterxml" indexer="include" status="PUBLISH"> <title xml-lang="en-US" id="tit" l10n="NEW">Sun Presenter Console Keyboard Shortcuts</title> - <filename>/com.sun.PresenterScreen-solaris_x86/presenter.xhp</filename> + <filename>/com.sun.PresenterScreen-PLATFORMID/presenter.xhp</filename> </topic> </meta> <body> diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk index 2144809b32df..a4b08861004d 100644 --- a/sdext/source/presenter/makefile.mk +++ b/sdext/source/presenter/makefile.mk @@ -247,7 +247,8 @@ PLATFORMID:=$(RTL_OS:l)_$(RTL_ARCH:l) COMPONENT_HELP= \ $(ZIP1DIR)$/help/component.txt \ - $(ZIP1DIR)$/help$/en-US$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp + $(foreach,l,$(alllangiso) $(ZIP1DIR)$/help$/$l$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp) +# $(ZIP1DIR)$/help$/en-US$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp # no localization yet - see #i107498# # $(foreach,l,$(alllangiso) $(ZIP1DIR)$/help$/$l$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp) @@ -282,14 +283,10 @@ $(ZIP1DIR)$/help$/component.txt : help$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ -$(ZIP1DIR)$/help$/%$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp : help$/%$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp - @echo copying $@ to $< - $(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -#$(COMPONENT_FILES) : $$(@:f) -# -$(MKDIRHIER) $(@:d) -# $(COPY) $< $@ +$(ZIP1DIR)$/help$/%$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp : $(COMMONMISC)/%/com.sun.PresenterScreen/presenter.xhp + @echo creating $@ + @@-$(MKDIRHIER) $(@:d) + $(TYPE) $< | sed "s/PLATFORMID/$(PLATFORMID)/" > $@ $(COMPONENT_BITMAPS) : bitmaps$/$$(@:f) @-$(MKDIRHIER) $(@:d) diff --git a/set_soenv.in b/set_soenv.in index e1655da4a928..4d3e41383a38 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -90,7 +90,7 @@ my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAVA_HOME, $JDK, $JAVAFLAGS, $SHELL, $COMMON_BUILD_TOOLS, $WIN_GREP, $WIN_FIND, $WIN_LS, $WIN_GNUCOPY, $WIN_TOUCH, $STLPORT4, $MOZILLA_VERSION, $MOZILLA_TOOLKIT, $PREBUILD_MOZAB, $MOZILLABUILD, $PROEXT, - $SYSTEM_PYTHON, $PYTHONPATH, $SYSTEM_MOZILLA, $EPM_FLAGS); + $SYSTEM_PYTHON, $SYSTEM_MOZILLA, $EPM_FLAGS); # #------------------------------------------- # IId. Declaring the aliases. @@ -591,33 +591,6 @@ elsif ( $platform =~ m/osf1/ ) $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."client"; $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."native_threads"; } -elsif ( $platform =~ m/irix/ ) -{ print "Setting Irix specific values... "; - $outfile = "IrixMipsEnv.Set"; - $BIG_SVX = "TRUE"; - if ($CC =~ "gcc" ) { - $COM = "GCC"; - $OUTPATH = "unxirgm"; - $CVER = "C300"; - } - else { - $COM = "C730"; - $CVER = "C730"; - $OUTPATH = "unxirxm3"; - } - $COMPATH = '@COMPATH@'; - $CPU = "M"; - $CPUNAME = "MIPS"; - $GUI = "UNX"; - $GUIBASE = "unx"; - $GVER = "VCL"; - $INPATH = $OUTPATH.$PROEXT; - $OS = "IRIX"; - $PATH_SEPERATOR = $ps; - $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."mips"; - $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."mips".$ds."client"; - $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."mips".$ds."native_threads"; -} elsif ( $platform =~ m/cygwin/ ) { $COMPATH = PathFormat('@COMPATH@'); @@ -1032,7 +1005,7 @@ if ($platform =~ m/solaris/) $L.$USR_DT.$LIB. $L.$USR_OPENWIN.$LIB; } -elsif ($platform =~ m/linux|netbsd|osf1|irix|freebsd|aix/) +elsif ($platform =~ m/linux|netbsd|osf1|freebsd|aix/) { $SOLAREXTRALIB = $L.$par_dir.$LIB64; } @@ -1098,7 +1071,7 @@ if ($platform =~ m/cygwin|os2/) } # The general environment path. -if ($platform =~ m/linux|netbsd|odf1|irix|freebsd|aix|solaris/) +if ($platform =~ m/linux|netbsd|odf1|freebsd|aix|solaris/) { $PATH = $cur_dir. # $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN. $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN. @@ -1330,7 +1303,7 @@ if ($platform =~ m/solaris/) $L_STLPORT_LIB. $L.$XLIB; } -elsif ($platform =~ m/linux|netbasd|osf1|irix|aix|freebsd/) +elsif ($platform =~ m/linux|netbasd|osf1|aix|freebsd/) { $SOLARLIB = $L.$par_dir.$LIB. $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. @@ -1373,7 +1346,7 @@ $SOLARINC = $I.$cur_dir. $I.'$SOLARENV'.$INC. $I.'$SRC_ROOT'.$ds."res"; -if ($platform =~ m/solaris|linux|osf1|freebsd|netbsd|irix/) +if ($platform =~ m/solaris|linux|osf1|freebsd|netbsd/) { $SOLARINC .= $STLPORT_stlport; if ($platform =~ m/linux|freebsd|netbsd/) @@ -1418,9 +1391,6 @@ if ($platform =~ m/linux/) elsif ($platform =~ m/netbsd/) { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."netbsd"; } - elsif ($platform =~ m/irix/) - { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."irix"; - } #java threads include path @@ -1490,14 +1460,6 @@ else { AddWarning( "set_soenv", "$platform not configured for system dependant include dir" ); } -if ($SYSTEM_PYTHON eq "NO") { - $PYTHONPATH = '.'.$wps.$SOLARVER.$ds.$INPATH.$ds.'lib'.$wps.$SOLARVER.$ds.$INPATH.$ds.'lib'.$ds.'python'.$wps.$SOLARVER.$ds.$INPATH.$ds.'lib'.$ds.'python'.$ds.'lib-dynload'.$wps.$SOLARVER.$ds.$INPATH.$ds.'lib'.$ds.'pyuno'.$wps.$SOLARVER.$ds.$INPATH.$ds.'bin'.$ds.'pyuno'; - if ($GUIBASE eq "WIN") { - # PYTHONPATH need to use '\' directory seperators; - $PYTHONPATH = WinPath( $PYTHONPATH, ";" ); - } -} - # print "done\n"; @@ -1821,11 +1783,9 @@ ToFile( "WITHOUT_PPDS", "@WITHOUT_PPDS@", "e" ); ToFile( "WITH_BINFILTER", "@WITH_BINFILTER@", "e" ); ToFile( "BUILD_TYPE", "@BUILD_TYPE@", "e" ); ToFile( "VERBOSE", "@VERBOSE@", "e" ); -ToFile( "WITH_FONTOOO", "@WITH_FONTOOO@", "e" ); ToFile( "ENABLE_EVOAB2", "@ENABLE_EVOAB2@", "e" ); ToFile( "GOBJECT_CFLAGS", "@GOBJECT_CFLAGS@", "e" ); ToFile( "GOBJECT_LIBS", "@GOBJECT_LIBS@", "e" ); -ToFile( "SYSTEM_MSPACK", "@SYSTEM_MSPACK@", "e" ); if ( '@ENABLE_RPATH@' eq "no" ) { ToFile( "LINKFLAGSRUNPATH",'', "e" ); } @@ -1973,9 +1933,6 @@ ToFile( "MKOUT", $perlpre."mkout.pl", "e" ); ToFile( "ZIPDEP", $perlpre."zipdep.pl", "e" ); ToFile( "USE_SHELL", '@USE_SHELL@', "e" ); -if ($SYSTEM_PYTHON eq "NO") { - ToFile( "PYTHONPATH", $PYTHONPATH, "e" ); -} # # Writing the aliases to file. diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index ebb16d0ef008..f737a6392f13 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -1164,6 +1164,7 @@ sub get_sis_time_string my $day = (localtime())[3]; my $month = (localtime())[4]; my $year = 1900 + (localtime())[5]; + $month++; if ( $second < 10 ) { $second = "0" . $second; } if ( $minute < 10 ) { $minute = "0" . $minute; } diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index d8e2f05c0332..1496f426d3c6 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -39,7 +39,7 @@ #include <stdio.h> -#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(OS2) +#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || defined(FREEBSD) || defined(OS2) #include <rtl/ustrbuf.hxx> #include <locale.h> @@ -256,7 +256,7 @@ LocaleBackend* LocaleBackend::createInstance( rtl::OUString LocaleBackend::getLocale(void) { -#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(OS2) +#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || defined(FREEBSD) || defined(OS2) return ImplGetLocale(LC_CTYPE); #elif defined (MACOSX) return ImplGetLocale("AppleLocale"); @@ -269,7 +269,7 @@ rtl::OUString LocaleBackend::getLocale(void) rtl::OUString LocaleBackend::getUILocale(void) { -#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(OS2) +#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || defined(FREEBSD) || defined(OS2) return ImplGetLocale(LC_MESSAGES); #elif defined(MACOSX) return ImplGetLocale("AppleLanguages"); diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.cxx b/slideshow/source/engine/shapes/viewbackgroundshape.cxx index 8e6db547cb85..5826f752cbec 100644 --- a/slideshow/source/engine/shapes/viewbackgroundshape.cxx +++ b/slideshow/source/engine/shapes/viewbackgroundshape.cxx @@ -48,6 +48,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/numeric/ftools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <com/sun/star/rendering/XCanvas.hpp> @@ -120,10 +121,9 @@ namespace slideshow aLinearTransform.set( 1, 2, 0.0 ); pBitmapCanvas->setTransformation( aLinearTransform ); - ::basegfx::B2DHomMatrix aShapeTransform; - - aShapeTransform.scale( maBounds.getWidth(), maBounds.getHeight() ); - aShapeTransform.translate( maBounds.getMinX(), maBounds.getMinY() ); + const basegfx::B2DHomMatrix aShapeTransform(basegfx::tools::createScaleTranslateB2DHomMatrix( + maBounds.getWidth(), maBounds.getHeight(), + maBounds.getMinX(), maBounds.getMinY())); ::cppcanvas::RendererSharedPtr pRenderer( ::cppcanvas::VCLFactory::getInstance().createRenderer( diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index fb2246309343..4e9c255c86ea 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -51,6 +51,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/numeric/ftools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <canvas/verbosetrace.hxx> #include <canvas/canvastools.hxx> @@ -713,9 +714,8 @@ namespace slideshow aBitmapTransform.invert(); - ::basegfx::B2DHomMatrix aTranslation; - aTranslation.translate( aTmpRect.getMinX(), - aTmpRect.getMinY() ); + const basegfx::B2DHomMatrix aTranslation(basegfx::tools::createTranslateB2DHomMatrix( + aTmpRect.getMinX(), aTmpRect.getMinY())); aBitmapTransform = aBitmapTransform * aTranslation; pBitmap->setTransformation( aBitmapTransform ); diff --git a/slideshow/source/engine/slidebitmap.cxx b/slideshow/source/engine/slidebitmap.cxx index 9cc6f042cdb2..c06cc0786865 100644 --- a/slideshow/source/engine/slidebitmap.cxx +++ b/slideshow/source/engine/slidebitmap.cxx @@ -42,6 +42,7 @@ #include <cppuhelper/exc_hlp.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <canvas/canvastools.hxx> #include <basegfx/tools/canvastools.hxx> @@ -78,9 +79,7 @@ namespace slideshow rendering::RenderState aRenderState; ::canvas::tools::initRenderState( aRenderState ); - ::basegfx::B2DHomMatrix aTranslation; - aTranslation.translate( maOutputPos.getX(), - maOutputPos.getY() ); + const basegfx::B2DHomMatrix aTranslation(basegfx::tools::createTranslateB2DHomMatrix(maOutputPos)); ::canvas::tools::setRenderStateTransform( aRenderState, aTranslation ); try diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx index b2c179647db3..136e70743916 100644 --- a/slideshow/source/engine/tools.cxx +++ b/slideshow/source/engine/tools.cxx @@ -51,6 +51,7 @@ #include <basegfx/vector/b2ivector.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <cppcanvas/basegfxfactory.hxx> @@ -524,10 +525,9 @@ namespace slideshow { if( !pAttr ) { - ::basegfx::B2DHomMatrix aTransform; - - aTransform.scale( rShapeBounds.getWidth(), rShapeBounds.getHeight() ); - aTransform.translate( rShapeBounds.getMinX(), rShapeBounds.getMinY() ); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix( + rShapeBounds.getWidth(), rShapeBounds.getHeight(), + rShapeBounds.getMinX(), rShapeBounds.getMinY())); return aTransform; } diff --git a/slideshow/source/engine/transitions/barndoorwipe.cxx b/slideshow/source/engine/transitions/barndoorwipe.cxx index fb9388ff9ee8..be226c2c560d 100644 --- a/slideshow/source/engine/transitions/barndoorwipe.cxx +++ b/slideshow/source/engine/transitions/barndoorwipe.cxx @@ -34,6 +34,7 @@ #include <canvas/debug.hxx> #include <basegfx/numeric/ftools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "barndoorwipe.hxx" @@ -45,8 +46,7 @@ namespace internal { if (m_doubled) t /= 2.0; - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( -0.5, -0.5 ); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5)); aTransform.scale( ::basegfx::pruneScaleValue(t), 1.0 ); aTransform.translate( 0.5, 0.5 ); ::basegfx::B2DPolygon poly( m_unitRect ); @@ -54,8 +54,7 @@ namespace internal { ::basegfx::B2DPolyPolygon res(poly); if (m_doubled) { - aTransform.identity(); - aTransform.translate( -0.5, -0.5 ); + aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5); aTransform.rotate( M_PI_2 ); aTransform.translate( 0.5, 0.5 ); poly.transform( aTransform ); diff --git a/slideshow/source/engine/transitions/clippingfunctor.cxx b/slideshow/source/engine/transitions/clippingfunctor.cxx index 97bb7fbd688f..58a50815b3ce 100644 --- a/slideshow/source/engine/transitions/clippingfunctor.cxx +++ b/slideshow/source/engine/transitions/clippingfunctor.cxx @@ -40,6 +40,7 @@ #include <basegfx/polygon/b2dpolygonclipper.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygoncutter.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> namespace slideshow { @@ -134,20 +135,19 @@ namespace slideshow break; case TransitionInfo::REVERSEMETHOD_ROTATE_180: - maStaticTransformation.translate( -0.5, -0.5 ); - maStaticTransformation.rotate( M_PI ); - maStaticTransformation.translate( 0.5, 0.5 ); + maStaticTransformation = basegfx::tools::createRotateAroundPoint(0.5, 0.5, M_PI) + * maStaticTransformation; break; case TransitionInfo::REVERSEMETHOD_FLIP_X: - maStaticTransformation.scale( -1.0, 1.0 ); - maStaticTransformation.translate( 1.0, 0.0 ); + maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(-1.0, 1.0, 1.0, 0.0) + * maStaticTransformation; mbFlip = true; break; case TransitionInfo::REVERSEMETHOD_FLIP_Y: - maStaticTransformation.scale( 1.0, -1.0 ); - maStaticTransformation.translate( 0.0, 1.0 ); + maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(1.0, -1.0, 0.0, 1.0) + * maStaticTransformation; mbFlip = true; break; } diff --git a/slideshow/source/engine/transitions/clockwipe.cxx b/slideshow/source/engine/transitions/clockwipe.cxx index 16088f1954d0..5beef1efcbd9 100644 --- a/slideshow/source/engine/transitions/clockwipe.cxx +++ b/slideshow/source/engine/transitions/clockwipe.cxx @@ -35,6 +35,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "clockwipe.hxx" @@ -66,9 +67,7 @@ namespace internal { ::basegfx::B2DPolyPolygon ClockWipe::operator () ( double t ) { - ::basegfx::B2DHomMatrix aTransform; - aTransform.scale( 0.5, 0.5 ); - aTransform.translate( 0.5, 0.5 ); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5)); ::basegfx::B2DPolygon poly( calcCenteredClock(t) ); poly.transform( aTransform ); return ::basegfx::B2DPolyPolygon(poly); diff --git a/slideshow/source/engine/transitions/combtransition.cxx b/slideshow/source/engine/transitions/combtransition.cxx index a222592b7d8d..93238162cadb 100644 --- a/slideshow/source/engine/transitions/combtransition.cxx +++ b/slideshow/source/engine/transitions/combtransition.cxx @@ -35,6 +35,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <cppcanvas/spritecanvas.hxx> @@ -70,11 +71,7 @@ basegfx::B2DPolyPolygon createClipPolygon( // rotate polygons, such that the strips are parallel to // the given direction vector const ::basegfx::B2DVector aUpVec(0.0, 1.0); - ::basegfx::B2DHomMatrix aMatrix; - - aMatrix.translate( -0.5, -0.5 ); - aMatrix.rotate( aUpVec.angle( rDirection ) ); - aMatrix.translate( 0.5, 0.5 ); + basegfx::B2DHomMatrix aMatrix(basegfx::tools::createRotateAroundPoint(0.5, 0.5, aUpVec.angle( rDirection ))); // blow up clip polygon to slide size aMatrix.scale( rSlideSize.getX(), @@ -129,7 +126,6 @@ void CombTransition::renderComb( double t, // change transformation on cloned canvas to be in // device pixel cppcanvas::CanvasSharedPtr pCanvas( pCanvas_->clone() ); - basegfx::B2DHomMatrix transform; basegfx::B2DPoint p; // TODO(Q2): Use basegfx bitmaps here @@ -156,17 +152,14 @@ void CombTransition::renderComb( double t, pLeavingBitmap->clip( aClipPolygon1 ); // don't modify bitmap object (no move!): p = basegfx::B2DPoint( pageOrigin + (t * aPushDirection) ); - transform.translate( p.getX(), p.getY() ); - pCanvas->setTransformation( transform ); + pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY())); pLeavingBitmap->draw( pCanvas ); // render even strips: pLeavingBitmap->clip( aClipPolygon2 ); // don't modify bitmap object (no move!): - transform.identity(); p = basegfx::B2DPoint( pageOrigin - (t * aPushDirection) ); - transform.translate( p.getX(), p.getY() ); - pCanvas->setTransformation( transform ); + pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY())); pLeavingBitmap->draw( pCanvas ); } @@ -176,19 +169,15 @@ void CombTransition::renderComb( double t, // render odd strips: pEnteringBitmap->clip( aClipPolygon1 ); // don't modify bitmap object (no move!): - transform.identity(); p = basegfx::B2DPoint( pageOrigin + ((t - 1.0) * aPushDirection) ); - transform.translate( p.getX(), p.getY() ); - pCanvas->setTransformation( transform ); + pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY())); pEnteringBitmap->draw( pCanvas ); // render even strips: pEnteringBitmap->clip( aClipPolygon2 ); // don't modify bitmap object (no move!): - transform.identity(); p = basegfx::B2DPoint( pageOrigin + ((1.0 - t) * aPushDirection) ); - transform.translate( p.getX(), p.getY() ); - pCanvas->setTransformation( transform ); + pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY())); pEnteringBitmap->draw( pCanvas ); } diff --git a/slideshow/source/engine/transitions/fanwipe.cxx b/slideshow/source/engine/transitions/fanwipe.cxx index 286d2a6b57de..220aa108c3f6 100644 --- a/slideshow/source/engine/transitions/fanwipe.cxx +++ b/slideshow/source/engine/transitions/fanwipe.cxx @@ -33,6 +33,7 @@ #include <canvas/debug.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "transitiontools.hxx" #include "clockwipe.hxx" #include "fanwipe.hxx" @@ -50,26 +51,21 @@ namespace internal { res.append( poly ); // flip on y-axis: - ::basegfx::B2DHomMatrix aTransform; - aTransform.scale( -1.0, 1.0 ); - poly.transform( aTransform ); + poly.transform(basegfx::tools::createScaleB2DHomMatrix(-1.0, 1.0)); poly.flip(); res.append( poly ); - aTransform.identity(); - if (m_center) { - aTransform.scale( 0.5, 0.5 ); - aTransform.translate( 0.5, 0.5 ); - res.transform( aTransform ); + if (m_center) + { + res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5)); if (! m_single) res.append( flipOnXAxis(res) ); } - else { + else + { OSL_ASSERT( ! m_fanIn ); - aTransform.scale( 0.5, 1.0 ); - aTransform.translate( 0.5, 1.0 ); - res.transform( aTransform ); + res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 1.0, 0.5, 1.0)); } return res; } diff --git a/slideshow/source/engine/transitions/figurewipe.cxx b/slideshow/source/engine/transitions/figurewipe.cxx index d4f4a2d2fe52..9c0576905877 100644 --- a/slideshow/source/engine/transitions/figurewipe.cxx +++ b/slideshow/source/engine/transitions/figurewipe.cxx @@ -35,6 +35,7 @@ #include <basegfx/numeric/ftools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "transitiontools.hxx" #include "figurewipe.hxx" @@ -45,10 +46,7 @@ namespace internal { ::basegfx::B2DPolyPolygon FigureWipe::operator () ( double t ) { ::basegfx::B2DPolyPolygon res(m_figure); - ::basegfx::B2DHomMatrix aTransform; - aTransform.scale( t, t ); - aTransform.translate( 0.5, 0.5 ); - res.transform( aTransform ); + res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(t, t, 0.5, 0.5)); return res; } diff --git a/slideshow/source/engine/transitions/fourboxwipe.cxx b/slideshow/source/engine/transitions/fourboxwipe.cxx index 61793eaa5a6b..96895cf44b10 100644 --- a/slideshow/source/engine/transitions/fourboxwipe.cxx +++ b/slideshow/source/engine/transitions/fourboxwipe.cxx @@ -35,6 +35,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "fourboxwipe.hxx" @@ -45,13 +46,15 @@ namespace internal { { ::basegfx::B2DHomMatrix aTransform; const double d = ::basegfx::pruneScaleValue( t / 2.0 ); - if (m_cornersOut) { - aTransform.translate( -0.5, -0.5 ); - aTransform.scale( d, d ); - aTransform.translate( -0.25, -0.25 ); - } else { - aTransform.scale( d, d ); - aTransform.translate( -0.5, -0.5 ); + if (m_cornersOut) + { + aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5); + aTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(d, d, -0.25, -0.25) + * aTransform; + } + else + { + aTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(d, d, -0.5, -0.5); } // top left: @@ -76,8 +79,7 @@ namespace internal { square4.flip(); // flip direction res.append( square4 ); - aTransform.identity(); - aTransform.translate( 0.5, 0.5 ); + aTransform = basegfx::tools::createTranslateB2DHomMatrix(0.5, 0.5); res.transform( aTransform ); return res; } diff --git a/slideshow/source/engine/transitions/iriswipe.cxx b/slideshow/source/engine/transitions/iriswipe.cxx index 757108ada909..e58a8363e3f8 100644 --- a/slideshow/source/engine/transitions/iriswipe.cxx +++ b/slideshow/source/engine/transitions/iriswipe.cxx @@ -33,6 +33,7 @@ #include <canvas/debug.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "iriswipe.hxx" @@ -41,11 +42,10 @@ namespace internal { ::basegfx::B2DPolyPolygon IrisWipe::operator () ( double t ) { - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( -0.5, -0.5 ); const double d = ::basegfx::pruneScaleValue(t); - aTransform.scale( d, d ); - aTransform.translate( 0.5, 0.5 ); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5)); + aTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(d, d, 0.5, 0.5) * aTransform; + ::basegfx::B2DPolyPolygon res( m_unitRect ); res.transform( aTransform ); return res; diff --git a/slideshow/source/engine/transitions/pinwheelwipe.cxx b/slideshow/source/engine/transitions/pinwheelwipe.cxx index 7e0ec35dff21..d959abb72a4d 100644 --- a/slideshow/source/engine/transitions/pinwheelwipe.cxx +++ b/slideshow/source/engine/transitions/pinwheelwipe.cxx @@ -34,6 +34,7 @@ #include <canvas/debug.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "clockwipe.hxx" #include "pinwheelwipe.hxx" @@ -43,23 +44,17 @@ namespace internal { ::basegfx::B2DPolyPolygon PinWheelWipe::operator () ( double t ) { - ::basegfx::B2DHomMatrix aTransform; ::basegfx::B2DPolygon poly( ClockWipe::calcCenteredClock( t / m_blades, 2.0 /* max edge when rotating */ ) ); ::basegfx::B2DPolyPolygon res; for ( sal_Int32 i = m_blades; i--; ) { - aTransform.identity(); - aTransform.rotate( (i * 2.0 * M_PI) / m_blades ); ::basegfx::B2DPolygon p(poly); - p.transform( aTransform ); + p.transform(basegfx::tools::createRotateB2DHomMatrix((i * 2.0 * M_PI) / m_blades)); res.append( p ); } - aTransform.identity(); - aTransform.scale( 0.5, 0.5 ); - aTransform.translate( 0.5, 0.5 ); - res.transform( aTransform ); + res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5)); return res; } diff --git a/slideshow/source/engine/transitions/randomwipe.cxx b/slideshow/source/engine/transitions/randomwipe.cxx index 94d73d613845..875ec1b3daa0 100644 --- a/slideshow/source/engine/transitions/randomwipe.cxx +++ b/slideshow/source/engine/transitions/randomwipe.cxx @@ -34,6 +34,7 @@ #include <canvas/debug.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "randomwipe.hxx" #include "tools.hxx" @@ -85,11 +86,9 @@ RandomWipe::RandomWipe( sal_Int32 nElements, bool randomBars ) ::basegfx::B2DPolyPolygon res; for ( sal_Int32 pos = static_cast<sal_Int32>(t * m_nElements); pos--; ) { - ::basegfx::B2DHomMatrix aTransform; ::basegfx::B2DPoint const & point = m_positions[ pos ]; - aTransform.translate( point.getX(), point.getY() ); ::basegfx::B2DPolygon poly( m_rect ); - poly.transform( aTransform ); + poly.transform(basegfx::tools::createTranslateB2DHomMatrix(point.getX(), point.getY())); res.append( poly ); } return res; diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx index c8b5cc4a4970..d855b7114ec6 100644 --- a/slideshow/source/engine/transitions/slidechangebase.cxx +++ b/slideshow/source/engine/transitions/slidechangebase.cxx @@ -37,6 +37,7 @@ #include <basegfx/numeric/ftools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <cppcanvas/basegfxfactory.hxx> #include "slidechangebase.hxx" @@ -179,9 +180,10 @@ void SlideChangeBase::renderBitmap( viewTransform * basegfx::B2DPoint() ); const cppcanvas::CanvasSharedPtr pDevicePixelCanvas( pCanvas->clone() ); - basegfx::B2DHomMatrix transform; + // render at output position, don't modify bitmap object (no move!): - transform.translate( pageOrigin.getX(), pageOrigin.getY() ); + const basegfx::B2DHomMatrix transform(basegfx::tools::createTranslateB2DHomMatrix( + pageOrigin.getX(), pageOrigin.getY())); pDevicePixelCanvas->setTransformation( transform ); pSlideBitmap->draw( pDevicePixelCanvas ); diff --git a/slideshow/source/engine/transitions/snakewipe.cxx b/slideshow/source/engine/transitions/snakewipe.cxx index 496eaa559a6a..a8050a1b0e9a 100644 --- a/slideshow/source/engine/transitions/snakewipe.cxx +++ b/slideshow/source/engine/transitions/snakewipe.cxx @@ -35,6 +35,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "snakewipe.hxx" #include "transitiontools.hxx" @@ -121,16 +122,20 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis ) poly.append( ::basegfx::B2DPoint( len + a, 0.0 ) ); poly.setClosed(true); ::basegfx::B2DHomMatrix aTransform; - if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1) { + + if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1) + { // odd line - aTransform.rotate( M_PI_2 + M_PI_4 ); - aTransform.translate( edge + m_elementEdge, 0.0 ); + aTransform = basegfx::tools::createRotateB2DHomMatrix(M_PI_2 + M_PI_4); + aTransform.translate(edge + m_elementEdge, 0.0); } - else { - aTransform.translate( -a, 0.0 ); + else + { + aTransform = basegfx::tools::createTranslateB2DHomMatrix(-a, 0.0); aTransform.rotate( -M_PI_4 ); aTransform.translate( 0.0, edge ); } + poly.transform( aTransform ); res.append(poly); } @@ -161,14 +166,17 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis ) poly.append( ::basegfx::B2DPoint( len + a, 0.0 ) ); poly.setClosed(true); ::basegfx::B2DHomMatrix aTransform; - if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1) { + + if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1) + { // odd line - aTransform.translate( 0.0, -height ); + aTransform = basegfx::tools::createTranslateB2DHomMatrix(0.0, -height); aTransform.rotate( M_PI_2 + M_PI_4 ); aTransform.translate( 1.0, edge ); } - else { - aTransform.rotate( -M_PI_4 ); + else + { + aTransform = basegfx::tools::createRotateB2DHomMatrix(-M_PI_4); aTransform.translate( edge, 1.0 ); } poly.transform( aTransform ); @@ -205,17 +213,16 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis ) ::basegfx::B2DPolyPolygon half( calcHalfDiagonalSnake( t, false /* out */ ) ); // flip on x axis and rotate 90 degrees: - ::basegfx::B2DHomMatrix aTransform; - aTransform.scale( 1.0, -1.0 ); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleB2DHomMatrix(1.0, -1.0)); aTransform.translate( -0.5, 0.5 ); aTransform.rotate( M_PI_2 ); aTransform.translate( 0.5, 0.5 ); half.transform( aTransform ); half.flip(); res.append( half ); + // rotate 180 degrees: - aTransform.identity(); - aTransform.translate( -0.5, -0.5 ); + aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5); aTransform.rotate( M_PI ); aTransform.translate( 0.5, 0.5 ); half.transform( aTransform ); @@ -225,8 +232,7 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis ) { ::basegfx::B2DPolyPolygon half( calcSnake( t / 2.0 ) ); // rotate 90 degrees: - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( -0.5, -0.5 ); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5)); aTransform.rotate( M_PI_2 ); aTransform.translate( 0.5, 0.5 ); half.transform( aTransform ); diff --git a/slideshow/source/engine/transitions/spiralwipe.cxx b/slideshow/source/engine/transitions/spiralwipe.cxx index f02c360a2628..5b8463ad9eea 100644 --- a/slideshow/source/engine/transitions/spiralwipe.cxx +++ b/slideshow/source/engine/transitions/spiralwipe.cxx @@ -38,6 +38,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> namespace slideshow { @@ -57,8 +58,7 @@ SpiralWipe::SpiralWipe( sal_Int32 nElements, bool flipOnYAxis ) const double e = (sqrt(area) / 2.0); const sal_Int32 edge = (static_cast<sal_Int32>(e) * 2); - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( -0.5, -0.5 ); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5)); const double edge_ = ::basegfx::pruneScaleValue( static_cast<double>(edge) / m_sqrtElements ); aTransform.scale( edge_, edge_ ); @@ -75,8 +75,7 @@ SpiralWipe::SpiralWipe( sal_Int32 nElements, bool flipOnYAxis ) const sal_Int32 alen = (len > edge1 ? edge1 : len); len -= alen; poly = createUnitRect(); - aTransform.identity(); - aTransform.scale( + aTransform = basegfx::tools::createScaleB2DHomMatrix( ::basegfx::pruneScaleValue( static_cast<double>(alen) / m_sqrtElements ), ::basegfx::pruneScaleValue( 1.0 / m_sqrtElements ) ); aTransform.translate( diff --git a/slideshow/source/engine/transitions/sweepwipe.cxx b/slideshow/source/engine/transitions/sweepwipe.cxx index 17a3d8933797..ae6bd8a21f82 100644 --- a/slideshow/source/engine/transitions/sweepwipe.cxx +++ b/slideshow/source/engine/transitions/sweepwipe.cxx @@ -34,6 +34,7 @@ #include <canvas/debug.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "clockwipe.hxx" #include "sweepwipe.hxx" #include "transitiontools.hxx" @@ -52,22 +53,26 @@ namespace internal { ::basegfx::B2DPolygon poly( ClockWipe::calcCenteredClock( 0.25 + t ) ); ::basegfx::B2DHomMatrix aTransform; - if (m_center) { - aTransform.translate( 0.5, 0.0 ); + + if (m_center) + { + aTransform = basegfx::tools::createTranslateB2DHomMatrix(0.5, 0.0); poly.transform( aTransform ); } ::basegfx::B2DPolyPolygon res(poly); - if (! m_single) { - aTransform.identity(); - if (m_oppositeVertical) { - aTransform.scale( 1.0, -1.0 ); + if (! m_single) + { + if (m_oppositeVertical) + { + aTransform = basegfx::tools::createScaleB2DHomMatrix(1.0, -1.0); aTransform.translate( 0.0, 1.0 ); poly.transform( aTransform ); poly.flip(); } - else { - aTransform.translate( -0.5, -0.5 ); + else + { + aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5); aTransform.rotate( M_PI ); aTransform.translate( 0.5, 0.5 ); poly.transform( aTransform ); diff --git a/slideshow/source/engine/transitions/transitiontools.cxx b/slideshow/source/engine/transitions/transitiontools.cxx index 6197e24514e0..c09bd12ef43d 100644 --- a/slideshow/source/engine/transitions/transitiontools.cxx +++ b/slideshow/source/engine/transitions/transitiontools.cxx @@ -36,6 +36,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> namespace slideshow { @@ -53,10 +54,7 @@ namespace internal { ::basegfx::B2DPolyPolygon const & polypoly ) { ::basegfx::B2DPolyPolygon res(polypoly); - ::basegfx::B2DHomMatrix aTransform; - aTransform.scale( -1.0, 1.0 ); - aTransform.translate( 1.0, 0.0 ); - res.transform( aTransform ); + res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(-1.0, 1.0, 1.0, 0.0)); res.flip(); return res; } @@ -65,10 +63,7 @@ namespace internal { ::basegfx::B2DPolyPolygon const & polypoly ) { ::basegfx::B2DPolyPolygon res(polypoly); - ::basegfx::B2DHomMatrix aTransform; - aTransform.scale( 1.0, -1.0 ); - aTransform.translate( 0.0, 1.0 ); - res.transform( aTransform ); + res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(1.0, -1.0, 0.0, 1.0)); res.flip(); return res; } diff --git a/slideshow/source/engine/transitions/waterfallwipe.cxx b/slideshow/source/engine/transitions/waterfallwipe.cxx index 7a86edff5c67..c81cf2c68433 100644 --- a/slideshow/source/engine/transitions/waterfallwipe.cxx +++ b/slideshow/source/engine/transitions/waterfallwipe.cxx @@ -35,6 +35,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "waterfallwipe.hxx" #include "transitiontools.hxx" @@ -67,9 +68,7 @@ WaterfallWipe::WaterfallWipe( sal_Int32 nElements, bool flipOnYAxis ) ::basegfx::B2DPolyPolygon WaterfallWipe::operator () ( double t ) { ::basegfx::B2DPolygon poly( m_waterfall ); - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( 0.0, ::basegfx::pruneScaleValue( 2.0 * t ) ); - poly.transform( aTransform ); + poly.transform(basegfx::tools::createTranslateB2DHomMatrix(0.0, ::basegfx::pruneScaleValue(2.0 * t))); poly.setB2DPoint( 0, ::basegfx::B2DPoint( 0.0, -1.0 ) ); poly.setB2DPoint( poly.count()-1, ::basegfx::B2DPoint( 1.0, -1.0 ) ); diff --git a/slideshow/source/engine/transitions/zigzagwipe.cxx b/slideshow/source/engine/transitions/zigzagwipe.cxx index edc16099f843..8fa22c15c052 100644 --- a/slideshow/source/engine/transitions/zigzagwipe.cxx +++ b/slideshow/source/engine/transitions/zigzagwipe.cxx @@ -35,6 +35,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "transitiontools.hxx" #include "zigzagwipe.hxx" @@ -58,10 +59,8 @@ ZigZagWipe::ZigZagWipe( sal_Int32 nZigs ) : m_zigEdge( 1.0 / nZigs ) ::basegfx::B2DPolyPolygon ZigZagWipe::operator () ( double t ) { - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( (1.0 + m_zigEdge) * t, 0.0 ); ::basegfx::B2DPolyPolygon res(m_stdZigZag); - res.transform( aTransform ); + res.transform(basegfx::tools::createTranslateB2DHomMatrix((1.0 + m_zigEdge) * t, 0.0)); return res; } @@ -70,8 +69,8 @@ ZigZagWipe::ZigZagWipe( sal_Int32 nZigs ) : m_zigEdge( 1.0 / nZigs ) ::basegfx::B2DPolyPolygon res( createUnitRect() ); ::basegfx::B2DPolygon poly( m_stdZigZag ); poly.flip(); - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( (1.0 + m_zigEdge) * (1.0 - t) / 2.0, 0.0 ); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + (1.0 + m_zigEdge) * (1.0 - t) / 2.0, 0.0)); poly.transform( aTransform ); res.append( poly ); aTransform.scale( -1.0, 1.0 ); diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx index da7b4bfe3d3a..f860644dd5ac 100644 --- a/slideshow/test/demoshow.cxx +++ b/slideshow/test/demoshow.cxx @@ -100,12 +100,9 @@ public: void resize( const ::Size& rNewSize ) { maSize = rNewSize; - maTransform.identity(); - const sal_Int32 nSize( std::min( rNewSize.Width(), - rNewSize.Height() ) - 10 ); - maTransform.scale( nSize, nSize ); - maTransform.translate( (rNewSize.Width() - nSize) / 2, - (rNewSize.Height() - nSize) / 2 ); + const sal_Int32 nSize( std::min( rNewSize.Width(), rNewSize.Height() ) - 10); + maTransform = basegfx::tools::createScaleTranslateB2DHomMatrix( + nSize, nSize, (rNewSize.Width() - nSize) / 2, (rNewSize.Height() - nSize) / 2); lang::EventObject aEvent( *this ); maTransformationListeners.notifyEach( &util::XModifyListener::modified, diff --git a/solenv/bin/checkdll.sh b/solenv/bin/checkdll.sh index 0400f461666e..e64b8fd2aa4c 100755 --- a/solenv/bin/checkdll.sh +++ b/solenv/bin/checkdll.sh @@ -60,16 +60,6 @@ if [ -x $checkdll ]; then *) DYLD_LIBRARY_PATH=$libpath;; esac export DYLD_LIBRARY_PATH;; - IRIX) case "${LD_LIBRARYN32_PATH+X}" in - X) LD_LIBRARYN32_PATH=$libpath:$LD_LIBRARYN32_PATH;; - *) LD_LIBRARYN32_PATH=$libpath;; - esac - export LD_LIBRARYN32_PATH;; - IRIX64) case "${LD_LIBRARYN32_PATH+X}" in - X) LD_LIBRARYN32_PATH=$libpath:$LD_LIBRARYN32_PATH;; - *) LD_LIBRARYN32_PATH=$libpath;; - esac - export LD_LIBRARYN32_PATH;; *) case "${LD_LIBRARY_PATH+X}" in X) LD_LIBRARY_PATH=$libpath:$LD_LIBRARY_PATH;; *) LD_LIBRARY_PATH=$libpath;; diff --git a/solenv/bin/modules/osarch.pm b/solenv/bin/modules/osarch.pm index 8c3a87e4ddc5..205e4c933193 100755 --- a/solenv/bin/modules/osarch.pm +++ b/solenv/bin/modules/osarch.pm @@ -27,8 +27,7 @@ chop( $m_str, $s_str ); # "SCO_SV", "scouw21", "Darwin", "macosxp", "Mac OS", "macosxp", - "SINIX-N", "sinix", - "IRIX", "irix" + "SINIX-N", "sinix" ); %osDefTable = ("SunOS", "-DSYSV -DSOLARIS", @@ -42,8 +41,7 @@ chop( $m_str, $s_str ); # "SCO_SV", "-DSYSV -DSCO -DSCO_UW21", "Darwin", "-DBSD -DMACOSX", "Mac OS", "-DBSD -DMACOSX", - "SINIX-N", "-DSYSV -DSINIX", - "IRIX", "-DSYSV -DIRIX" + "SINIX-N", "-DSYSV -DSINIX" ); %osDosTable = ("SunOS", "sol", @@ -56,8 +54,7 @@ chop( $m_str, $s_str ); "SCO_SV", "sco", "Darwin", "macx", "Mac OS", "macx", - "SINIX-N", "sni", - "IRIX", "irx" + "SINIX-N", "sni" ); %archTable = ("sun4c", "sparc", diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini index be1fc69fa487..c3b6f91c9dd7 100755 --- a/solenv/config/sdev300.ini +++ b/solenv/config/sdev300.ini @@ -885,7 +885,6 @@ unxlngx6 DEVROOT %SOLAR_ENV_ROOT% PERL %SOLAR_ENV_ROOT%/bt_linux_libc2.32/%WORK_STAMP%/bin/perl PKGFORMAT rpm - PTHREAD_CFLAGS -DNPTL SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP% SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv @@ -2185,7 +2184,6 @@ unxubti8 PAM_LINK NO PERL /usr/bin/perl PKGFORMAT deb - PTHREAD_CFLAGS -DNPTL SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv SOLARROOT %SOLAR_ENV_ROOT% SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP% diff --git a/solenv/inc/_tg_shl.mk b/solenv/inc/_tg_shl.mk index a862ec39897f..19f6e30ad175 100644 --- a/solenv/inc/_tg_shl.mk +++ b/solenv/inc/_tg_shl.mk @@ -100,9 +100,7 @@ $(USE_SHL1VERSIONMAP) .PHONY: .ENDIF # "$(SHL1VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL1VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL1VERSIONMAP) -.ENDIF $(USE_SHL1VERSIONMAP): \ $(SHL1OBJS)\ @@ -139,9 +137,7 @@ $(USE_SHL1VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL1VERSIONMAP)"!="" USE_SHL1VERSIONMAP=$(MISC)/$(SHL1VERSIONMAP:b)_$(SHL1TARGET)$(SHL1VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL1VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL1VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL1VERSIONMAP): $(SHL1OBJS) $(SHL1LIBS) @@ -189,11 +185,7 @@ $(USE_SHL1VERSIONMAP): $(SHL1VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL1SONAME=$(SONAME_SWITCH)$(SHL1TARGETN:f) -.ELSE SHL1SONAME=\"$(SONAME_SWITCH)$(SHL1TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -654,9 +646,7 @@ $(USE_SHL2VERSIONMAP) .PHONY: .ENDIF # "$(SHL2VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL2VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL2VERSIONMAP) -.ENDIF $(USE_SHL2VERSIONMAP): \ $(SHL2OBJS)\ @@ -693,9 +683,7 @@ $(USE_SHL2VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL2VERSIONMAP)"!="" USE_SHL2VERSIONMAP=$(MISC)/$(SHL2VERSIONMAP:b)_$(SHL2TARGET)$(SHL2VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL2VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL2VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL2VERSIONMAP): $(SHL2OBJS) $(SHL2LIBS) @@ -743,11 +731,7 @@ $(USE_SHL2VERSIONMAP): $(SHL2VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL2SONAME=$(SONAME_SWITCH)$(SHL2TARGETN:f) -.ELSE SHL2SONAME=\"$(SONAME_SWITCH)$(SHL2TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -1208,9 +1192,7 @@ $(USE_SHL3VERSIONMAP) .PHONY: .ENDIF # "$(SHL3VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL3VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL3VERSIONMAP) -.ENDIF $(USE_SHL3VERSIONMAP): \ $(SHL3OBJS)\ @@ -1247,9 +1229,7 @@ $(USE_SHL3VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL3VERSIONMAP)"!="" USE_SHL3VERSIONMAP=$(MISC)/$(SHL3VERSIONMAP:b)_$(SHL3TARGET)$(SHL3VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL3VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL3VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL3VERSIONMAP): $(SHL3OBJS) $(SHL3LIBS) @@ -1297,11 +1277,7 @@ $(USE_SHL3VERSIONMAP): $(SHL3VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL3SONAME=$(SONAME_SWITCH)$(SHL3TARGETN:f) -.ELSE SHL3SONAME=\"$(SONAME_SWITCH)$(SHL3TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -1762,9 +1738,7 @@ $(USE_SHL4VERSIONMAP) .PHONY: .ENDIF # "$(SHL4VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL4VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL4VERSIONMAP) -.ENDIF $(USE_SHL4VERSIONMAP): \ $(SHL4OBJS)\ @@ -1801,9 +1775,7 @@ $(USE_SHL4VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL4VERSIONMAP)"!="" USE_SHL4VERSIONMAP=$(MISC)/$(SHL4VERSIONMAP:b)_$(SHL4TARGET)$(SHL4VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL4VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL4VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL4VERSIONMAP): $(SHL4OBJS) $(SHL4LIBS) @@ -1851,11 +1823,7 @@ $(USE_SHL4VERSIONMAP): $(SHL4VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL4SONAME=$(SONAME_SWITCH)$(SHL4TARGETN:f) -.ELSE SHL4SONAME=\"$(SONAME_SWITCH)$(SHL4TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -2316,9 +2284,7 @@ $(USE_SHL5VERSIONMAP) .PHONY: .ENDIF # "$(SHL5VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL5VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL5VERSIONMAP) -.ENDIF $(USE_SHL5VERSIONMAP): \ $(SHL5OBJS)\ @@ -2355,9 +2321,7 @@ $(USE_SHL5VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL5VERSIONMAP)"!="" USE_SHL5VERSIONMAP=$(MISC)/$(SHL5VERSIONMAP:b)_$(SHL5TARGET)$(SHL5VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL5VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL5VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL5VERSIONMAP): $(SHL5OBJS) $(SHL5LIBS) @@ -2405,11 +2369,7 @@ $(USE_SHL5VERSIONMAP): $(SHL5VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL5SONAME=$(SONAME_SWITCH)$(SHL5TARGETN:f) -.ELSE SHL5SONAME=\"$(SONAME_SWITCH)$(SHL5TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -2870,9 +2830,7 @@ $(USE_SHL6VERSIONMAP) .PHONY: .ENDIF # "$(SHL6VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL6VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL6VERSIONMAP) -.ENDIF $(USE_SHL6VERSIONMAP): \ $(SHL6OBJS)\ @@ -2909,9 +2867,7 @@ $(USE_SHL6VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL6VERSIONMAP)"!="" USE_SHL6VERSIONMAP=$(MISC)/$(SHL6VERSIONMAP:b)_$(SHL6TARGET)$(SHL6VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL6VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL6VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL6VERSIONMAP): $(SHL6OBJS) $(SHL6LIBS) @@ -2959,11 +2915,7 @@ $(USE_SHL6VERSIONMAP): $(SHL6VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL6SONAME=$(SONAME_SWITCH)$(SHL6TARGETN:f) -.ELSE SHL6SONAME=\"$(SONAME_SWITCH)$(SHL6TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -3424,9 +3376,7 @@ $(USE_SHL7VERSIONMAP) .PHONY: .ENDIF # "$(SHL7VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL7VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL7VERSIONMAP) -.ENDIF $(USE_SHL7VERSIONMAP): \ $(SHL7OBJS)\ @@ -3463,9 +3413,7 @@ $(USE_SHL7VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL7VERSIONMAP)"!="" USE_SHL7VERSIONMAP=$(MISC)/$(SHL7VERSIONMAP:b)_$(SHL7TARGET)$(SHL7VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL7VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL7VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL7VERSIONMAP): $(SHL7OBJS) $(SHL7LIBS) @@ -3513,11 +3461,7 @@ $(USE_SHL7VERSIONMAP): $(SHL7VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL7SONAME=$(SONAME_SWITCH)$(SHL7TARGETN:f) -.ELSE SHL7SONAME=\"$(SONAME_SWITCH)$(SHL7TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -3978,9 +3922,7 @@ $(USE_SHL8VERSIONMAP) .PHONY: .ENDIF # "$(SHL8VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL8VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL8VERSIONMAP) -.ENDIF $(USE_SHL8VERSIONMAP): \ $(SHL8OBJS)\ @@ -4017,9 +3959,7 @@ $(USE_SHL8VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL8VERSIONMAP)"!="" USE_SHL8VERSIONMAP=$(MISC)/$(SHL8VERSIONMAP:b)_$(SHL8TARGET)$(SHL8VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL8VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL8VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL8VERSIONMAP): $(SHL8OBJS) $(SHL8LIBS) @@ -4067,11 +4007,7 @@ $(USE_SHL8VERSIONMAP): $(SHL8VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL8SONAME=$(SONAME_SWITCH)$(SHL8TARGETN:f) -.ELSE SHL8SONAME=\"$(SONAME_SWITCH)$(SHL8TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -4532,9 +4468,7 @@ $(USE_SHL9VERSIONMAP) .PHONY: .ENDIF # "$(SHL9VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL9VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL9VERSIONMAP) -.ENDIF $(USE_SHL9VERSIONMAP): \ $(SHL9OBJS)\ @@ -4571,9 +4505,7 @@ $(USE_SHL9VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL9VERSIONMAP)"!="" USE_SHL9VERSIONMAP=$(MISC)/$(SHL9VERSIONMAP:b)_$(SHL9TARGET)$(SHL9VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL9VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL9VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL9VERSIONMAP): $(SHL9OBJS) $(SHL9LIBS) @@ -4621,11 +4553,7 @@ $(USE_SHL9VERSIONMAP): $(SHL9VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL9SONAME=$(SONAME_SWITCH)$(SHL9TARGETN:f) -.ELSE SHL9SONAME=\"$(SONAME_SWITCH)$(SHL9TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" @@ -5086,9 +5014,7 @@ $(USE_SHL10VERSIONMAP) .PHONY: .ENDIF # "$(SHL10VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL10VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL10VERSIONMAP) -.ENDIF $(USE_SHL10VERSIONMAP): \ $(SHL10OBJS)\ @@ -5125,9 +5051,7 @@ $(USE_SHL10VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL10VERSIONMAP)"!="" USE_SHL10VERSIONMAP=$(MISC)/$(SHL10VERSIONMAP:b)_$(SHL10TARGET)$(SHL10VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL10VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL10VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL10VERSIONMAP): $(SHL10OBJS) $(SHL10LIBS) @@ -5175,11 +5099,7 @@ $(USE_SHL10VERSIONMAP): $(SHL10VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL10SONAME=$(SONAME_SWITCH)$(SHL10TARGETN:f) -.ELSE SHL10SONAME=\"$(SONAME_SWITCH)$(SHL10TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index b27b78230620..74248a6e8cd7 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,5 +1,5 @@ RSCVERSION=300 -RSCREVISION=300m68(Build:9474) -BUILD=9474 -LAST_MINOR=m68 +RSCREVISION=300m69(Build:9475) +BUILD=9475 +LAST_MINOR=m69 SOURCEVERSION=DEV300 diff --git a/solenv/inc/tg_help.mk b/solenv/inc/tg_help.mk new file mode 100755 index 000000000000..a8a33051f0fc --- /dev/null +++ b/solenv/inc/tg_help.mk @@ -0,0 +1,86 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.pmk,v $ +# +# $Revision: 1.25 $ +# +# 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. +# +#************************************************************************* + +# to make it usable with special lang selection of +# helpcontent2 + +aux_alllangiso*:=$(alllangiso) + +SHELL_PACKAGE:=$(subst,/,$/ $(PACKAGE)) +HLANGXHPFILES:=$(foreach,i,$(XHPFILES) $(foreach,j,$(aux_alllangiso) $(COMMONMISC)$/$j$/$(SHELL_PACKAGE)$/$(i:f))) + +ALLTAR : $(COMMONMISC)$/$(TARGET).done $(COMMONMISC)$/xhp_changed.flag optix + +$(HLANGXHPFILES) : $$(@:d)thisdir.created + +$(COMMONMISC)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp + @$(TOUCH) $@ +# internal dependencies not sufficient to trigger merge? +# @$(NULL) + + +$(COMMONMISC)$/$(TARGET).done : $(HLANGXHPFILES) +.IF "$(WITH_LANG)"!="" + $(AUGMENT_LIBRARY_PATH) $(HELPEX) -QQ -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(COMMONMISC) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@ +.ELSE # "$(WITH_LANG)"!="" + cp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES)))) $(COMMONMISC)$/en-US$/$(SHELL_PACKAGE) && $(TOUCH) $@ +.ENDIF # "$(WITH_LANG)"!="" +.IF "$(OS)"=="SOLARIS" + @$(ECHONL) " " +.ELSE # "$(OS)"=="SOLARIS" + @$(ECHONL) +.ENDIF # "$(OS)"=="SOLARIS" + +$(COMMONMISC)$/xhp_changed.flag : $(HLANGXHPFILES) + @$(TOUCH) $@ + +# urks - dmake mixes up operators and strings :-( +.IF "$(HLANGXHPFILES:s/defined/xxx/)"!="" + +.IF "$(HELPTRANSPHONY)"!="" +$(COMMONMISC)$/$(TARGET).done .PHONY : +.ELSE # "$(HELPTRANSPHONY)"!="" + +$(COMMONMISC)$/$(TARGET).done : makefile.mk +.IF "$(WITH_LANG)"!="" +$(COMMONMISC)$/$(TARGET).done : $(LOCALIZESDF) +.ENDIF # "$(WITH_LANG)"!="" +.ENDIF # "$(HELPTRANSPHONY)"!="" +.ENDIF # "$(HLANGXHPFILES)"!="" + +optix: $(COMMONMISC)$/$(TARGET).done + @echo done + +%.created : + @@-$(MKDIRHIER) $(@:d) + @$(TOUCH) $@ + + diff --git a/solenv/inc/tg_shl.mk b/solenv/inc/tg_shl.mk index 496e95926981..8cb6653f334e 100644 --- a/solenv/inc/tg_shl.mk +++ b/solenv/inc/tg_shl.mk @@ -133,9 +133,7 @@ $(USE_SHL$(TNR)VERSIONMAP) .PHONY: .ENDIF # "$(SHL$(TNR)VERSIONMAP)"!="" -.IF "$(OS)"!="IRIX" SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP) -.ENDIF $(USE_SHL$(TNR)VERSIONMAP): \ $(SHL$(TNR)OBJS)\ @@ -172,9 +170,7 @@ $(USE_SHL$(TNR)VERSIONMAP) : #and now for the plain non-generic way... .IF "$(SHL$(TNR)VERSIONMAP)"!="" USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)VERSIONMAP:b)_$(SHL$(TNR)TARGET)$(SHL$(TNR)VERSIONMAP:e) -.IF "$(OS)"!="IRIX" SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP) -.ENDIF .IF "$(OS)"=="MACOSX" $(USE_SHL$(TNR)VERSIONMAP): $(SHL$(TNR)OBJS) $(SHL$(TNR)LIBS) @@ -222,11 +218,7 @@ $(USE_SHL$(TNR)VERSIONMAP): $(SHL$(TNR)VERSIONMAP) .IF "$(UNIXVERSIONNAMES)"!="" .IF "$(OS)"!="MACOSX" .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="IRIX" -SHL$(TNR)SONAME=$(SONAME_SWITCH)$(SHL$(TNR)TARGETN:f) -.ELSE SHL$(TNR)SONAME=\"$(SONAME_SWITCH)$(SHL$(TNR)TARGETN:f)\" -.ENDIF .ENDIF # "$(GUI)"!="UNX" .ENDIF # "$(OS)"!="MACOSX" .ENDIF # "$(UNIXVERSIONNAMES)"!="" diff --git a/solenv/inc/unx.mk b/solenv/inc/unx.mk index bb5a4864484d..36e5cd70447f 100644 --- a/solenv/inc/unx.mk +++ b/solenv/inc/unx.mk @@ -151,18 +151,6 @@ .INCLUDE : unxfbsd.mk .ENDIF -.IF "$(COM)$(OS)$(CPU)" == "C730IRIXM" -.INCLUDE : unxirxm3.mk -.ENDIF - -.IF "$(COM)$(OS)$(CPU)" == "GCCIRIXM" -.INCLUDE : unxirgm.mk -.ENDIF - -.IF "$(COM)$(OS)$(CPU)" == "C710IRIXM" -.INCLUDE : unxirxm.mk -.ENDIF - .IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" .INCLUDE : unxmacxp.mk .ENDIF diff --git a/solenv/inc/unxirgm.mk b/solenv/inc/unxirgm.mk deleted file mode 100644 index b3abfb76d2c3..000000000000 --- a/solenv/inc/unxirgm.mk +++ /dev/null @@ -1,163 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: unxirgm.mk,v $ -# -# $Revision: 1.15 $ -# -# 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. -# -#************************************************************************* - - -# Makefile for IRIX/mips using GNU compilers 2.95.2 for n32 ABI -ASM= -AFLAGS= - -SOLAR_JAVA=TRUE -JAVADEF=-DSOLAR_JAVA -#JAVAFLAGSDEBUG=-g - -.IF "$(debug)"=="" -JAVA_RUNTIME=-ljava -.ELSE -JAVA_RUNTIME=-ljava_g -.ENDIF - -# architecture dependent flags for the C and C++ compiler that can be changed by -# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build -ARCH_FLAGS*= - -CC= gcc -CXX= g++ -CFLAGS=-c -CDEFS+= -D_PTHREADS -DSTLPORT_VERSION=0x450 -D_USE_NAMESPACE=1 -DNEW_SOLAR -CFLAGSCC=$(ARCH_FLAGS) -CFLAGSCXX=$(ARCH_FLAGS) -PICSWITCH:=-fpic - -# Compiler flags for compiling static object in multi threaded environment with graphical user interface -CFLAGSOBJGUIMT= -# Compiler flags for compiling static object in multi threaded environment with character user interface -CFLAGSOBJCUIMT= -# Compiler flags for compiling shared object in multi threaded environment with graphical user interface -CFLAGSSLOGUIMT=$(PICSWITCH) -# Compiler flags for compiling shared object in multi threaded environment with character user interface -CFLAGSSLOCUIMT=$(PICSWITCH) -# Compiler flags for profiling -CFLAGSPROF= -# Compiler flags for debugging -CFLAGSDEBUG=-g -CFLAGSDBGUTIL= -# Compiler flags for enabling optimizations -CFLAGSOPT=-O2 -# Compiler flags for disabling optimizations -CFLAGSNOOPT=-O0 -# Compiler flags for describing the output path -CFLAGSOUTOBJ=-o - -CFLAGSWARNCC=-w -CFLAGSWALLCC=-Wall -CFLAGSWERRCC=-Werror - -# exception flags -CFLAGSEXCEPTIONS=-fexceptions -CFLAGS_NO_EXCEPTIONS=-fno-exceptions - -STATIC= -Wl,-Bstatic -DYNAMIC= -Wl,-Bdynamic - -# -# To use the map files, you need to have a gcc_specs file which contains: -# *linker: -# /path/to/bin/ld.sh -# where ld.sh is a wrapper script that does some conversion of the -# map files on the fly. -# -LINK= g++ -LINKFLAGS= -L/usr/lib32 -Wl,-no_unresolved -LINKVERSIONMAPFLAG= -Wl,-exports_file - -LINKFLAGSAPPGUI= $(THREADLIB) -LINKFLAGSAPPCUI= $(THREADLIB) -LINKFLAGSSHLGUI= $(THREADLIB) -LINKFLAGSSHLCUI= $(THREADLIB) - -LINKFLAGSAPPGUI+= -Wl,-multigot -LINKFLAGSAPPCUI+= -Wl,-multigot -LINKFLAGSSHLGUI+= -shared -LINKFLAGSSHLCUI+= -shared - -LINKFLAGSTACK= -LINKFLAGSPROF= -LINKFLAGSDEBUG= -g -LINKFLAGSOPT= - -LINKFLAGSSHLGUI += -Wl,-Bsymbolic -LINKFLAGSSHLCUI += -Wl,-Bsymbolic - -APPLINKSTATIC=-Bstatic -APPLINKSHARED=-Bsymbolic - -SONAME_SWITCH = -Wl,-soname -Wl, - -# Sequence of libraries DOES matter! -STDOBJGUI= -STDSLOGUI= -STDOBJCUI= -STDSLOCUI= -STDLIBGUIMT= $(THREADLIB) $(DYNAMIC) -lX11 -lm -lgcc -lc -STDLIBCUIMT= $(THREADLIB) $(DYNAMIC) -lgcc -lc -lm -STDSHLGUIMT= -L/usr/lib32 $(THREADLIB) $(DYNAMIC) -lX11 -lm -lgcc -lc -STDSHLCUIMT= -L/usr/lib32 $(THREADLIB) $(DYNAMIC) -lm -lgcc -lc -THREADLIB= -lpthread - -.IF "$(STLPORT_VER)" >= "500" -LIBSTLPORT=$(DYNAMIC) -lstlport -LIBSTLPORTST= -lstlport -.ELSE -LIBSTLPORT=$(DYNAMIC) -lstlport_gcc -LIBSTLPORTST= -lstlport_gcc -.ENDIF - -LIBMGR= ar -LIBFLAGS= -r - -IMPLIB= -IMPLIBFLAGS= - -MAPSYM= -MAPSYMFLAGS= - -RC= irc -RCFLAGS= -fo$@ $(RCFILES) -RCLINK= -RCLINKFLAGS= -RCSETVERSION= - -DLLPOSTFIX= im -DLLPRE= lib -DLLPOST= .so - - -LDUMP=c++filt diff --git a/solenv/inc/unxirxm.mk b/solenv/inc/unxirxm.mk deleted file mode 100644 index 80aae3d5b382..000000000000 --- a/solenv/inc/unxirxm.mk +++ /dev/null @@ -1,162 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: unxirxm.mk,v $ -# -# $Revision: 1.10 $ -# -# 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. -# -#************************************************************************* - -# mak-file for IRIX/mips -ASM= -AFLAGS= - -# architecture dependent flags for the C and C++ compiler that can be changed by -# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build -ARCH_FLAGS*= - -# -# Zu den Compilerflags: -# -# -ptused : instantisiert Templates, wenn sie benutzt werden. -# Der Schalter wurde neu eingefuegt, weil sich eine -# statische Memberfunktion nicht instantisieren liess. -# (ts&sdo/10.06.98) -# -CC= cc -KPIC -c -n32 -CXX= CC -KPIC -c -n32 -ptused -OPT:Olimit=20523 -CDEFS+=-D_PTHREADS -CDEFS+= -D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE -# 1009 ...nested comment is not allowed... -# 1021 ...type qualifiers are meaningless in this declaration... -# 1107 ...signed bit field of length 1... -# 1110 ...statement not reached... -# 1155 ...unrecognized #pragma... -# 1171 ...expression has no effect... -# 1183 ...comparison of unsigned integer with zero... -# 1185 ...enumerated type mixed with another type... -# 1188 ...type qualifier is meaningless on cast type... -# 1233 ...explicit type is missing ("int" assumed)... -# 1234 ...access control not specified... -# 1257 ...NULL reference is not allowed... -# 1440 ...initial value of reference to non-const must be an lvalue... -# 1516 ...pointless comparison of unsigned integer with a negative constant -# 1681 ...virtual function override intended... -# 1682 ...is only partially overridden in class... -CFLAGSCC= -Xcpluscomm -woff 1009,1021,1107,1110,1155,1171,1183,1185,1188,1233,1234,1257,1440,1516,1681,1682 $(ARCH_FLAGS) -CFLAGSCXX= -woff 1009,1021,1107,1110,1155,1171,1183,1185,1188,1233,1234,1257,1440,1516,1681,1682 $(ARCH_FLAGS) -CFLAGSOBJGUIMT= -CFLAGSOBJCUIMT= -CFLAGSSLOGUIMT= -CFLAGSSLOCUIMT= -CFLAGSPROF= -CFLAGSDEBUG= -g -CFLAGSDBGUTIL= -CFLAGSOPT= -O -CFLAGSNOOPT= -CFLAGSOUTOBJ= -o - -STATIC= -B static -DYNAMIC= -B dynamic - -# -# Zu den Linkflags: -# -# -update_registry <file> : fuer das Linken mehrerer shared Libraries -# erforderlich. -# **FUER LOKALE STAENDE FEHLT Z.ZT. EIN GULTIGER -# MECHANISMUS** -# -LINK= CC -LINKFLAGS= -LINKFLAGSAPPGUI=-n32 -multigot -LINKFLAGSSHLGUI=-B symbolic -soname $(DLLPRE)$(SHL$(TNR)TARGET)$(DLLPOSTFIX)$(DLLPOST) $(DYNAMIC) -shared -n32 -multigot -update_registry $(SOLARLIBDIR)/so_locations -LINKFLAGSAPPCUI=-n32 -multigot -LINKFLAGSSHLCUI=-B symbolic -soname $(DLLPRE)$(SHL$(TNR)TARGET)$(DLLPOSTFIX)$(DLLPOST) $(DYNAMIC) -shared -n32 -multigot -update_registry $(SOLARLIBDIR)/so_locations -LINKFLAGSTACK= -LINKFLAGSPROF= -LINKFLAGSDEBUG= -LINKFLAGSOPT= -APPLINKSTATIC=-Bstatic -APPLINKSHARED=-Bsymbolic - -# Reihenfolge der Libraries NICHT egal! -STDOBJGUI= -STDSLOGUI= -STDOBJCUI= -STDSLOCUI= -# STDLIBGUIMT= $(THREADLIB) $(DYNAMIC) -lX11 -lc -lm -STDLIBGUIMT= $(THREADLIB) $(DYNAMIC) -lX11 -lc -lm -STDLIBCUIMT= $(THREADLIB) $(DYNAMIC) -lc -lm -# STDSHLGUIMT= -L/usr/lib32 $(THREADLIB) $(DYNAMIC) -lX11 -lc -lm -STDSHLGUIMT= -L/usr/lib32 $(THREADLIB) $(DYNAMIC) -lX11 -lc -lm -STDSHLCUIMT= -L/usr/lib32 $(THREADLIB) $(DYNAMIC) -lc -lm -THREADLIB= -lpthread - -LIBMGR= ar -LIBFLAGS= -r -# LIBEXT= .so - -IMPLIB= -IMPLIBFLAGS= - -MAPSYM= -MAPSYMFLAGS= - -RC= irc -RCFLAGS= -fo$@ $(RCFILES) -RCLINK= -RCLINKFLAGS= -RCSETVERSION= - -DLLPOSTFIX= im -.IF "$(WORK_STAMP)"=="MIX364" -DLLPOSTFIX= -.ENDIF -DLLPRE= lib -DLLPOST= .so - - -LDUMP= - - -# -------------------------- -# AUS DEM ALTEN ENVIRONMENT: -# -------------------------- -# -# Linken einer statischen Library: -# ar -r ... -# -# Linken einer shared Library: -# CC -B symbolic -soname <...> -B dynamic -shared -n32 -multigot -# -update_registry <...> ... -# -# Linken einer Applikation mit statischen Librarys: -# CC -B static ... -# -# Linken einer Applikation mit stared Librarys: -# CC -n32 -multigot ... -# - diff --git a/solenv/inc/unxirxm3.mk b/solenv/inc/unxirxm3.mk deleted file mode 100644 index 8d24d2c54032..000000000000 --- a/solenv/inc/unxirxm3.mk +++ /dev/null @@ -1,162 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: unxirxm3.mk,v $ -# -# $Revision: 1.12 $ -# -# 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. -# -#************************************************************************* - - -# Makefile for IRIX/mips -ASM= -AFLAGS= - -SOLAR_JAVA*=TRUE -JAVADEF=-DSOLAR_JAVA -#JAVAFLAGSDEBUG=-g - -.IF "$(debug)"=="" -JAVA_RUNTIME=-ljava -.ELSE -JAVA_RUNTIME=-ljava_g -.ENDIF - -# architecture dependent flags for the C and C++ compiler that can be changed by -# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build -ARCH_FLAGS*= - -CC= cc -CXX= CC -CFLAGS= -c -CDEFS+= -DSTLPORT_VERSION=0x450 -D_USE_NAMESPACE=1 -DNEW_SOLAR -CFLAGSCC=$(ARCH_FLAGS) -CFLAGSCXX= -LANG:ansi-for-init-scope=OFF -LANG:std=ON -LANG:libc_in_namespace_std=ON $(ARCH_FLAGS) - -# Compiler flags for compiling static object in multi threaded environment with graphical user interface -CFLAGSOBJGUIMT= -# Compiler flags for compiling static object in multi threaded environment with character user interface -CFLAGSOBJCUIMT= -# Compiler flags for compiling shared object in multi threaded environment with graphical user interface -CFLAGSSLOGUIMT=-KPIC -# Compiler flags for compiling shared object in multi threaded environment with character user interface -CFLAGSSLOCUIMT=-KPIC -# Compiler flags for profiling -CFLAGSPROF= -# Compiler flags for debugging -CFLAGSDEBUG=-g -CFLAGSDBGUTIL= -# Compiler flags for enabling optimizations -CFLAGSOPT=-O2 -# Compiler flags for disabling optimizations -CFLAGSNOOPT=-O0 -# Compiler flags for describing the output path -CFLAGSOUTOBJ=-o - -CFLAGSWARNCC=-w -CFLAGSWALLCC=-fullwarn -CFLAGSWERRCC= - -# exception flags -CFLAGSEXCEPTIONS=-LANG:exceptions=ON -CFLAGS_NO_EXCEPTIONS=-LANG:exceptions=OFF -#CFLAGS_NO_EXCEPTIONS= - -STATIC= -Wl,-Bstatic -DYNAMIC= -Wl,-Bdynamic - -# -# To use the map files, you need to have a gcc_specs file which contains: -# *linker: -# /path/to/bin/ld.sh -# where ld.sh is a wrapper script that does some conversion of the -# map files on the fly. -# -LINK= CC -LINKFLAGS= -L/usr/lib32 -Wl,-no_unresolved -LINKVERSIONMAPFLAG= -Wl,-exports_file - -LINKFLAGSAPPGUI= $(THREADLIB) -LINKFLAGSAPPCUI= $(THREADLIB) -LINKFLAGSSHLGUI= $(THREADLIB) -LINKFLAGSSHLCUI= $(THREADLIB) - -LINKFLAGSAPPGUI+= -Wl,-multigot -LINKFLAGSAPPCUI+= -Wl,-multigot -LINKFLAGSSHLGUI+= -shared -LINKFLAGSSHLCUI+= -shared - -LINKFLAGSTACK= -LINKFLAGSPROF= -LINKFLAGSDEBUG= -g -LINKFLAGSOPT= - -LINKFLAGSSHLGUI += -Wl,-Bsymbolic -LINKFLAGSSHLCUI += -Wl,-Bsymbolic - -APPLINKSTATIC=-Bstatic -APPLINKSHARED=-Bsymbolic - -SONAME_SWITCH = -Wl,-soname -Wl, - -# Sequence of libraries DOES matter! -STDOBJGUI= -STDSLOGUI= -STDOBJCUI= -STDSLOCUI= -STDLIBGUIMT= $(THREADLIB) $(DYNAMIC) -lX11 -lm -lc -STDLIBCUIMT= $(THREADLIB) $(DYNAMIC) -lc -lm -STDSHLGUIMT= -L/usr/lib32 $(THREADLIB) $(DYNAMIC) -lX11 -lm -lc -STDSHLCUIMT= -L/usr/lib32 $(THREADLIB) $(DYNAMIC) -lm -lc -THREADLIB= -lpthread - -#LIBSTLPORT=$(DYNAMIC) -lstlport_mipspro -LIBSTLPORT=$(DYNAMIC) -LIBSTLPORTST= -#LIBSTLPORTST= -lstlport_mipspro - -LIBMGR= ar -LIBFLAGS= -r - -IMPLIB= -IMPLIBFLAGS= - -MAPSYM= -MAPSYMFLAGS= - -RC= irc -RCFLAGS= -fo$@ $(RCFILES) -RCLINK= -RCLINKFLAGS= -RCSETVERSION= - -DLLPOSTFIX= im -DLLPRE= lib -DLLPOST= .so - - -LDUMP=c++filt - - diff --git a/solenv/inc/unxlng.mk b/solenv/inc/unxlng.mk index a79d3e47c6cf..b6c8f798a5f9 100644 --- a/solenv/inc/unxlng.mk +++ b/solenv/inc/unxlng.mk @@ -47,7 +47,7 @@ JAVAFLAGSDEBUG=-g #LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter" # _PTHREADS is needed for the stl -CDEFS+=$(PTHREAD_CFLAGS) -DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER) +CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER) # enable visibility define in "sal/types.h" .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" @@ -208,12 +208,14 @@ LINKFLAGS += -Wl,-zdynsort .ENDIF # libraries for linking applications -STDLIBGUIMT+=-Wl,--as-needed -lX11 -ldl -lpthread -lm -Wl,--no-as-needed +STDLIBGUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed STDLIBCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed # libraries for linking shared libraries -STDSHLGUIMT+=-Wl,--as-needed -lX11 -lXext -ldl -lpthread -lm -Wl,--no-as-needed +STDSHLGUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed STDSHLCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed +X11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed + LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive .IF "$(USE_STLP_DEBUG)" != "" diff --git a/solenv/inc/unxmacxi.mk b/solenv/inc/unxmacxi.mk index 6d27121366e5..09d5d424b690 100644 --- a/solenv/inc/unxmacxi.mk +++ b/solenv/inc/unxmacxi.mk @@ -55,7 +55,6 @@ CFLAGSENABLESYMBOLS=-g .IF "$(SNOW_LEOPARD_10_4)"!="" JAVACOMPILER+=-target 1.5 -DYLD_INSERT_LIBRARIES=/usr/lib/libsqlite3.dylib .EXPORT: DYLD_INSERT_LIBRARIES .ENDIF # "$(SNOW_LEOPARD_10_4)"!="" diff --git a/solenv/inc/unxsoli4.mk b/solenv/inc/unxsoli4.mk index afcea59a9971..c4c777376561 100644 --- a/solenv/inc/unxsoli4.mk +++ b/solenv/inc/unxsoli4.mk @@ -199,7 +199,7 @@ STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc # libdl.so - no really an GUI library but required in this context STDLIBGUIMT+=-ldl STDSHLGUIMT+=-ldl -X11LINK_DYNAMIC = -lX11 +X11LINK_DYNAMIC = -lXext -lX11 # @@@ interposer needed for -Bdirect @@@ # LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract diff --git a/solenv/inc/unxsols4.mk b/solenv/inc/unxsols4.mk index a28b097e13b4..67bafa3a1c14 100644 --- a/solenv/inc/unxsols4.mk +++ b/solenv/inc/unxsols4.mk @@ -205,7 +205,7 @@ STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc # libdl.so - no really an GUI library but required in this context STDLIBGUIMT+=-ldl STDSHLGUIMT+=-ldl -X11LINK_DYNAMIC = -lX11 +X11LINK_DYNAMIC = -lXext -lX11 # @@@ interposer needed for -Bdirect @@@ # LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract diff --git a/stlport/makefile.mk b/stlport/makefile.mk index ab4dfa244e72..bff4f60fd719 100644 --- a/stlport/makefile.mk +++ b/stlport/makefile.mk @@ -169,14 +169,6 @@ OUT2INC= \ stlport$/SC5$/*.SUNWCCh .ENDIF -.IF "$(OS)"=="IRIX" -TARFILE_NAME=STLport-4.5 -PATCH_FILES=STLport-4.5.patch -BUILD_ACTION=gmake -BUILD_FLAGS=-f gcc-3.0.mak -BUILD_FLAGS+= -j$(MAXPROCESS) -.ENDIF - OUTDIR2INC= \ stlport diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index d2479cd5364f..555b7ad5fe84 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -1034,7 +1034,7 @@ public:\ #define C40_PTR_REPLACE( c, p) Replace( (c const *) p ) #define C40_GETPOS( c, r) GetPos( (c const *)r ) #else -#if defined WTC || defined IRIX || defined ICC || defined HPUX || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) +#if defined WTC || defined ICC || defined HPUX || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) #define C40_INSERT( c, p, n ) Insert( (c const *&) p, n ) #define C40_PUSH( c, p) Push( (c const *&) p ) #define C40_PTR_INSERT( c, p ) Insert( (c const *&) p ) diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx index df56afc4a250..e011dde1a0e8 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.cxx +++ b/svtools/source/filter.vcl/wmf/emfwr.cxx @@ -33,6 +33,9 @@ #include "emfwr.hxx" #include <vcl/salbtype.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> +#include <vcl/lineinfo.hxx> // ----------- // - Defines - @@ -829,6 +832,46 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons // ----------------------------------------------------------------------------- +void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon) +{ + if(rLinePolygon.count()) + { + basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon); + basegfx::B2DPolyPolygon aFillPolyPolygon; + + rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon); + + if(aLinePolyPolygon.count()) + { + for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) + { + const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); + ImplWritePolygonRecord( Polygon(aCandidate), FALSE ); + } + } + + if(aFillPolyPolygon.count()) + { + const Color aOldLineColor(maVDev.GetLineColor()); + const Color aOldFillColor(maVDev.GetFillColor()); + + maVDev.SetLineColor(); + maVDev.SetFillColor(aOldLineColor); + + for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++) + { + const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a)); + ImplWritePolyPolygonRecord(PolyPolygon(Polygon(aPolygon))); + } + + maVDev.SetLineColor(aOldLineColor); + maVDev.SetFillColor(aOldFillColor); + } + } +} + +// ----------------------------------------------------------------------------- + void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { for( ULONG j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ ) @@ -871,20 +914,31 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { const MetaLineAction* pA = (const MetaLineAction*) pAction; - ImplCheckLineAttr(); + if(pA->GetLineInfo().IsDefault()) + { + ImplCheckLineAttr(); - ImplBeginRecord( WIN_EMR_MOVETOEX ); - ImplWritePoint( pA->GetStartPoint() ); - ImplEndRecord(); + ImplBeginRecord( WIN_EMR_MOVETOEX ); + ImplWritePoint( pA->GetStartPoint() ); + ImplEndRecord(); - ImplBeginRecord( WIN_EMR_LINETO ); - ImplWritePoint( pA->GetEndPoint() ); - ImplEndRecord(); + ImplBeginRecord( WIN_EMR_LINETO ); + ImplWritePoint( pA->GetEndPoint() ); + ImplEndRecord(); - ImplBeginRecord( WIN_EMR_SETPIXELV ); - ImplWritePoint( pA->GetEndPoint() ); - ImplWriteColor( maVDev.GetLineColor() ); - ImplEndRecord(); + ImplBeginRecord( WIN_EMR_SETPIXELV ); + ImplWritePoint( pA->GetEndPoint() ); + ImplWriteColor( maVDev.GetLineColor() ); + ImplEndRecord(); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + basegfx::B2DPolygon aPolygon; + aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y())); + aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y())); + Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon); + } } } break; @@ -983,7 +1037,23 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_POLYLINE_ACTION ): { if( maVDev.IsLineColor() ) - ImplWritePolygonRecord( ( (const MetaPolyLineAction*) pAction )->GetPolygon(), FALSE ); + { + const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction; + const Polygon& rPoly = pA->GetPolygon(); + + if( rPoly.GetSize() ) + { + if(pA->GetLineInfo().IsDefault()) + { + ImplWritePolygonRecord( rPoly, FALSE ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon()); + } + } + } } break; diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx index 150aa1692ade..2d3c8801ba49 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.hxx +++ b/svtools/source/filter.vcl/wmf/emfwr.hxx @@ -42,6 +42,9 @@ // - EMFWriter - // ------------- +class LineInfo; +namespace basegfx { class B2DPolygon; } + class EMFWriter { private: @@ -86,6 +89,7 @@ private: void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP ); void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth ); + void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void ImplWrite( const GDIMetaFile& rMtf ); public: diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx index d25d4e94f97a..30d4ff06c0d2 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.cxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx @@ -42,8 +42,9 @@ #include <i18nutil/unicode.hxx> //unicode::getUnicodeScriptType #endif - #include <vcl/metric.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> //====================== MS-Windows-defines =============================== @@ -1136,6 +1137,49 @@ void WMFWriter::SetAllAttr() } +void WMFWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon) +{ + if(rLinePolygon.count()) + { + basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon); + basegfx::B2DPolyPolygon aFillPolyPolygon; + + rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon); + + if(aLinePolyPolygon.count()) + { + aSrcLineInfo = rInfo; + SetLineAndFillAttr(); + + for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) + { + const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); + WMFRecord_PolyLine(Polygon(aCandidate)); + } + } + + if(aFillPolyPolygon.count()) + { + const Color aOldLineColor(aSrcLineColor); + const Color aOldFillColor(aSrcFillColor); + + aSrcLineColor = Color( COL_TRANSPARENT ); + aSrcFillColor = aOldLineColor; + SetLineAndFillAttr(); + + for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++) + { + const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a)); + WMFRecord_Polygon(Polygon(aPolygon)); + } + + aSrcLineColor = aOldLineColor; + aSrcFillColor = aOldFillColor; + SetLineAndFillAttr(); + } + } +} + void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { ULONG nA, nACount; @@ -1176,10 +1220,21 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_LINE_ACTION: { const MetaLineAction* pA = (const MetaLineAction *) pMA; - aSrcLineInfo = pA->GetLineInfo(); - SetLineAndFillAttr(); - WMFRecord_MoveTo( pA->GetStartPoint() ); - WMFRecord_LineTo( pA->GetEndPoint() ); + if(pA->GetLineInfo().IsDefault()) + { + aSrcLineInfo = pA->GetLineInfo(); + SetLineAndFillAttr(); + WMFRecord_MoveTo( pA->GetStartPoint() ); + WMFRecord_LineTo( pA->GetEndPoint() ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + basegfx::B2DPolygon aPolygon; + aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y())); + aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y())); + HandleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon); + } } break; @@ -1241,9 +1296,22 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_POLYLINE_ACTION: { const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pMA; - aSrcLineInfo = pA->GetLineInfo(); - SetLineAndFillAttr(); - WMFRecord_PolyLine( pA->GetPolygon() ); + const Polygon& rPoly = pA->GetPolygon(); + + if( rPoly.GetSize() ) + { + if(pA->GetLineInfo().IsDefault()) + { + aSrcLineInfo = pA->GetLineInfo(); + SetLineAndFillAttr(); + WMFRecord_PolyLine( rPoly ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + HandleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon()); + } + } } break; diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx index 48986a280404..03ca14e7633f 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.hxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx @@ -65,6 +65,9 @@ struct WMFWriterAttrStackMember // ------------- class StarSymbolToMSMultiFont; +class LineInfo; +namespace basegfx { class B2DPolygon; } + class WMFWriter { private: @@ -202,6 +205,7 @@ private: void SetLineAndFillAttr(); void SetAllAttr(); + void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void WriteRecords(const GDIMetaFile & rMTF); void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable); diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk index 51ea7a9fef31..22be04f95d3f 100644 --- a/svtools/util/makefile.mk +++ b/svtools/util/makefile.mk @@ -112,6 +112,7 @@ SHL1STDLIBS+= \ $(VCLLIB) \ $(SVLLIB) \ $(SOTLIB) \ + $(BASEGFXLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(I18NISOLANGLIB) \ diff --git a/svx/inc/svx/sdr/contact/objectcontact.hxx b/svx/inc/svx/sdr/contact/objectcontact.hxx index 3990c48695a3..c0388f152643 100644 --- a/svx/inc/svx/sdr/contact/objectcontact.hxx +++ b/svx/inc/svx/sdr/contact/objectcontact.hxx @@ -90,8 +90,7 @@ namespace sdr sdr::event::TimerEventHandler* mpEventHandler; // The redirector. If set it is used to pipe all supported calls - // to the redirector. When one is set at the ViewContact too, the one at - // the ViewContact will win. + // to the redirector ViewObjectContactRedirector* mpViewObjectContactRedirector; // the Primitive2DParameters containing view information diff --git a/svx/inc/svx/sdr/overlay/overlaytools.hxx b/svx/inc/svx/sdr/overlay/overlaytools.hxx index d9a1b34dd8f6..830f3dc12586 100644 --- a/svx/inc/svx/sdr/overlay/overlaytools.hxx +++ b/svx/inc/svx/sdr/overlay/overlaytools.hxx @@ -58,7 +58,7 @@ namespace drawinglayer sal_uInt16 mnCenterY; protected: - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: OverlayBitmapExPrimitive( @@ -99,7 +99,7 @@ namespace drawinglayer double mfDiscreteDashLength; protected: - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: OverlayCrosshairPrimitive( @@ -148,7 +148,7 @@ namespace drawinglayer double mfRotation; protected: - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: OverlayHatchRectanglePrimitive( @@ -206,7 +206,7 @@ namespace drawinglayer double mfDiscreteDashLength; protected: - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: OverlayHelplineStripedPrimitive( @@ -251,7 +251,7 @@ namespace drawinglayer double mfDiscreteDashLength; protected: - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: OverlayRollingRectanglePrimitive( diff --git a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx index 01bb7794e9f3..177c42bfff17 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx @@ -46,7 +46,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrCaptionPrimitive2D : public BasePrimitive2D + class SdrCaptionPrimitive2D : public BufferedDecompositionPrimitive2D { private: ::basegfx::B2DHomMatrix maTransform; @@ -57,7 +57,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrCaptionPrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx index ba7cc7fed9c8..5523480f1f51 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx @@ -45,7 +45,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrConnectorPrimitive2D : public BasePrimitive2D + class SdrConnectorPrimitive2D : public BufferedDecompositionPrimitive2D { private: attribute::SdrLineShadowTextAttribute maSdrLSTAttribute; @@ -53,7 +53,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrConnectorPrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx index 8f7f0eb23cb3..72035eb99569 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx @@ -45,7 +45,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrCustomShapePrimitive2D : public BasePrimitive2D + class SdrCustomShapePrimitive2D : public BufferedDecompositionPrimitive2D { private: attribute::SdrShadowTextAttribute maSdrSTAttribute; @@ -57,16 +57,16 @@ namespace drawinglayer // that the text needs to be block formatted unsigned mbWordWrap : 1; - // #SJ# Allow text clipping against TextBox in special cases (used for SC) - unsigned mbForceTextClipToTextRange : 1; - // defines that the object contains/is a 3D AutoShape. Needed for // making exceptions with shadow generation unsigned mb3DShape : 1; + // #SJ# Allow text clipping against TextBox in special cases (used for SC)
+ unsigned mbForceTextClipToTextRange : 1;
+ protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrCustomShapePrimitive2D( @@ -74,16 +74,16 @@ namespace drawinglayer const Primitive2DSequence& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, - bool bForceTextClipToTextRange, - bool b3DShape); + bool b3DShape, + bool bForceTextClipToTextRange); // data access const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; } const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; } const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; } bool getWordWrap() const { return mbWordWrap; } + bool get3DShape() const { return mb3DShape; } bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; } - bool get3DShape() const { return mb3DShape; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx index 1ef6d0864a3a..1d11c27ede71 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx @@ -45,7 +45,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrEllipsePrimitive2D : public BasePrimitive2D + class SdrEllipsePrimitive2D : public BufferedDecompositionPrimitive2D { private: ::basegfx::B2DHomMatrix maTransform; @@ -53,7 +53,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrEllipsePrimitive2D( @@ -91,7 +91,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrEllipseSegmentPrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx index df2114437015..787c230d7b3d 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrGrafPrimitive2D : public BasePrimitive2D + class SdrGrafPrimitive2D : public BufferedDecompositionPrimitive2D { private: ::basegfx::B2DHomMatrix maTransform; @@ -57,7 +57,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrGrafPrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx index a7084993b5f2..3e998f23fd2b 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx @@ -59,7 +59,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrMeasurePrimitive2D : public BasePrimitive2D + class SdrMeasurePrimitive2D : public BufferedDecompositionPrimitive2D { private: attribute::SdrLineShadowTextAttribute maSdrLSTAttribute; @@ -89,7 +89,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrMeasurePrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx index 7c7081720034..2deaf474e12e 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx @@ -32,7 +32,7 @@ #ifndef INCLUDED_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX #define INCLUDED_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX -#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/attribute/sdrattribute.hxx> #include <svx/sdr/attribute/sdrallattribute.hxx> @@ -46,29 +46,30 @@ namespace drawinglayer { namespace primitive2d { - class SdrOle2Primitive2D : public GroupPrimitive2D + class SdrOle2Primitive2D : public BasePrimitive2D { private: - ::basegfx::B2DHomMatrix maTransform; + Primitive2DSequence maOLEContent; + basegfx::B2DHomMatrix maTransform; attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; - protected: - // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; - public: SdrOle2Primitive2D( - const Primitive2DSequence& rChildren, - const ::basegfx::B2DHomMatrix& rTransform, + const Primitive2DSequence& rOLEContent, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute); // data access - const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const Primitive2DSequence& getOLEContent() const { return maOLEContent; } + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + // local decomposition. + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + // provide unique ID DeclPrimitrive2DIDBlock() }; diff --git a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx index 9ee4f3f69417..ff04a6a5e79b 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrOleContentPrimitive2D : public BasePrimitive2D + class SdrOleContentPrimitive2D : public BufferedDecompositionPrimitive2D { private: SdrObjectWeakRef mpSdrOle2Obj; @@ -63,7 +63,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrOleContentPrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx index 97b12b72d4a5..d6de666d901f 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx @@ -46,7 +46,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrPathPrimitive2D : public BasePrimitive2D + class SdrPathPrimitive2D : public BufferedDecompositionPrimitive2D { private: basegfx::B2DHomMatrix maTransform; @@ -55,7 +55,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrPathPrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx index 23bbc2676f22..816956b188fe 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx @@ -46,7 +46,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrRectanglePrimitive2D : public BasePrimitive2D + class SdrRectanglePrimitive2D : public BufferedDecompositionPrimitive2D { private: basegfx::B2DHomMatrix maTransform; @@ -60,7 +60,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrRectanglePrimitive2D( diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx index 059849531566..ec35ff75f36d 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -52,7 +52,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrTextPrimitive2D : public BasePrimitive2D + class SdrTextPrimitive2D : public BufferedDecompositionPrimitive2D { private: // The text model data; this sould later just be the OutlinerParaObject or @@ -131,7 +131,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrContourTextPrimitive2D( @@ -173,7 +173,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrPathTextPrimitive2D( @@ -223,7 +223,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrBlockTextPrimitive2D( @@ -277,7 +277,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrStretchTextPrimitive2D( diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx index 6f2753c4e896..3523308b6e8f 100644 --- a/svx/inc/svx/svdpage.hxx +++ b/svx/inc/svx/svdpage.hxx @@ -563,6 +563,9 @@ public: const sdr::contact::DisplayInfo& rDisplayInfo, bool bEdit ); + /** Check if page is the HandoutMasterPage (in SVX, no PK_HANDOUT available) */ + bool isHandoutMasterPage() const; + ////////////////////////////////////////////////////////////////////////////// // sdr::Comment interface private: diff --git a/svx/source/engine3d/helperminimaldepth3d.cxx b/svx/source/engine3d/helperminimaldepth3d.cxx index 85ba97f1a826..35ebb4dec0f6 100644 --- a/svx/source/engine3d/helperminimaldepth3d.cxx +++ b/svx/source/engine3d/helperminimaldepth3d.cxx @@ -70,8 +70,8 @@ namespace drawinglayer void MinimalDephInViewExtractor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate) { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rCandidate.getPrimitiveID()) + // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch + switch(rCandidate.getPrimitive3DID()) { case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D : { diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 06d4cf5bbe95..3f89d202b6ba 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -77,6 +77,7 @@ #include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx> #include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx> #include <drawinglayer/primitive2d/transformprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue() @@ -185,9 +186,8 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr // buld transfoprmation: translate and rotate so that given edge is // on x axis, them mirror in y and translate back const basegfx::B2DVector aEdge(aMirrorAxisB.X() - aMirrorAxisA.X(), aMirrorAxisB.Y() - aMirrorAxisA.Y()); - basegfx::B2DHomMatrix aMatrixTransform; - - aMatrixTransform.translate(-aMirrorAxisA.X(), -aMirrorAxisA.Y()); + basegfx::B2DHomMatrix aMatrixTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aMirrorAxisA.X(), -aMirrorAxisA.Y())); aMatrixTransform.rotate(-atan2(aEdge.getY(), aEdge.getX())); aMatrixTransform.scale(1.0, -1.0); aMatrixTransform.rotate(atan2(aEdge.getY(), aEdge.getX())); @@ -932,9 +932,8 @@ void E3dView::ConvertMarkedObjTo3D(BOOL bExtrude, basegfx::B2DPoint aPnt1, baseg if(fRot3D != 0.0) { - aLatheMat.translate(-aPnt2.getX(), -aPnt2.getY()); - aLatheMat.rotate(-fRot3D); - aLatheMat.translate(aPnt2.getX(), aPnt2.getY()); + aLatheMat = basegfx::tools::createRotateAroundPoint(aPnt2, -fRot3D) + * aLatheMat; } } diff --git a/svx/source/gengal/gengal.sh b/svx/source/gengal/gengal.sh index 0e9613da4df8..d6a9e3cbec94 100644 --- a/svx/source/gengal/gengal.sh +++ b/svx/source/gengal/gengal.sh @@ -80,11 +80,6 @@ case $sd_platform in export SHLIB_PATH ;; - IRIX*) - LD_LIBRARYN32_PATH=${sd_prog}${LD_LIBRARYN32_PATH+:${LD_LIBRARYN32_PATH}} - export LD_LIBRARYN32_PATH - ;; - *) LD_LIBRARY_PATH=${sd_prog}${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}} export LD_LIBRARY_PATH diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 6c9d9a4c4c24..fcac5f68056e 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -52,18 +52,16 @@ #include "svdstr.hrc" #include <svdglob.hxx> #include <vcl/svapp.hxx> - #include <basegfx/polygon/b2dpolygontools.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/maskprimitive2d.hxx> - #include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx> #include <svx/eeitem.hxx> #include <svx/colritem.hxx> -//#include <svx/xtable.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -148,11 +146,9 @@ namespace sdr { // create the EmptyPresObj fallback visualisation. The fallback graphic // is already provided in rGraphicObject in this case, use it - aSmallerMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight()); - aSmallerMatrix.translate(fOffsetX, fOffsetY); - aSmallerMatrix.shearX(fShearX); - aSmallerMatrix.rotate(fRotate); - aSmallerMatrix.translate(aTranslate.getX(), aTranslate.getY()); + aSmallerMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aPrefSize.getWidth(), aPrefSize.getHeight(), fOffsetX, fOffsetY); + aSmallerMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate) + * aSmallerMatrix; const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false); const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0); @@ -241,12 +237,8 @@ namespace sdr && basegfx::fTools::lessOrEqual(fWidth, aScale.getX()) && basegfx::fTools::lessOrEqual(fHeight, aScale.getY())) { - basegfx::B2DHomMatrix aBitmapMatrix; - - aBitmapMatrix.scale(fWidth, fHeight); - aBitmapMatrix.shearX(fShearX); - aBitmapMatrix.rotate(fRotate); - aBitmapMatrix.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aBitmapMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + fWidth, fHeight, fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, drawinglayer::primitive2d::Primitive2DReference( @@ -293,12 +285,8 @@ namespace sdr if(pSdrText && pOPO) { // directly use the remaining space as TextRangeTransform - basegfx::B2DHomMatrix aTextRangeTransform; - - aTextRangeTransform.scale(aScale.getX(), aScale.getY()); - aTextRangeTransform.shearX(fShearX); - aTextRangeTransform.rotate(fRotate); - aTextRangeTransform.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aTextRangeTransform(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale, fShearX, fRotate, aTranslate)); // directly create temp SdrBlockTextPrimitive2D drawinglayer::primitive2d::SdrBlockTextPrimitive2D aBlockTextPrimitive( @@ -380,7 +368,6 @@ namespace sdr // which will use the primitive data we just create in the near future const Rectangle& rRectangle = GetGrafObject().GetGeoRect(); const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); - basegfx::B2DHomMatrix aObjectMatrix; // look for mirroring const GeoStat& rGeoStat(GetGrafObject().GetGeoStat()); @@ -411,10 +398,10 @@ namespace sdr // fill object matrix const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0); const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0); - aObjectMatrix.scale(aObjectRange.getWidth(), aObjectRange.getHeight()); - aObjectMatrix.shearX(fShearX); - aObjectMatrix.rotate(fRotate); - aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); + const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), + fShearX, fRotate, + aObjectRange.getMinX(), aObjectRange.getMinY())); // get the current, unchenged graphic obect from SdrGrafObj const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false); diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index c5c682222fde..337681e4d391 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -37,6 +37,7 @@ #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <svx/sdr/attribute/sdrallattribute.hxx> #include <svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// // includes for special text box shadow (SC) @@ -83,30 +84,13 @@ namespace sdr const Rectangle& rRectangle = rCaptionObj.GetGeoRect(); const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); const GeoStat& rGeoStat(rCaptionObj.GetGeoStat()); - ::basegfx::B2DHomMatrix aObjectMatrix; // fill object matrix - if(!::basegfx::fTools::equalZero(aObjectRange.getWidth())) - { - aObjectMatrix.set(0, 0, aObjectRange.getWidth()); - } - - if(!::basegfx::fTools::equalZero(aObjectRange.getHeight())) - { - aObjectMatrix.set(1, 1, aObjectRange.getHeight()); - } - - if(rGeoStat.nShearWink) - { - aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); - } - - if(rGeoStat.nDrehWink) - { - aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); - } - - aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); + basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), + rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0, + rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0, + aObjectRange.getMinX(), aObjectRange.getMinY())); // calculate corner radius double fCornerRadiusX; @@ -164,7 +148,7 @@ namespace sdr const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue()); aObjectMatrix.translate(nXDist, nYDist); - // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::createLocalDecomposition) + // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition) basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY)); // create the specialized shadow primitive diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index c57c153e9e40..047685dc14f2 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -39,6 +39,7 @@ #include <svx/sdr/primitive2d/sdrellipseprimitive2d.hxx> #include <svl/itemset.hxx> #include <svx/sxciaitm.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -73,30 +74,13 @@ namespace sdr const Rectangle& rRectangle = GetCircObj().GetGeoRect(); const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); const GeoStat& rGeoStat(GetCircObj().GetGeoStat()); - ::basegfx::B2DHomMatrix aObjectMatrix; // fill object matrix - if(!::basegfx::fTools::equalZero(aObjectRange.getWidth())) - { - aObjectMatrix.set(0, 0, aObjectRange.getWidth()); - } - - if(!::basegfx::fTools::equalZero(aObjectRange.getHeight())) - { - aObjectMatrix.set(1, 1, aObjectRange.getHeight()); - } - - if(rGeoStat.nShearWink) - { - aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); - } - - if(rGeoStat.nDrehWink) - { - aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); - } - - aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); + const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), + rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0, + rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0, + aObjectRange.getMinX(), aObjectRange.getMinY())); // create primitive data const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier()); diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 9d19e752396c..352b9198e97b 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -39,6 +39,7 @@ #include <svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/obj3d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -223,13 +224,14 @@ namespace sdr } // create primitive - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCustomShapePrimitive2D( - *pAttribute, - xGroup, - aTextBoxMatrix, - bWordWrap, - false, // #SJ# New parameter to force to clipped BlockText for SC - b3DShape)); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrCustomShapePrimitive2D( + *pAttribute, + xGroup, + aTextBoxMatrix, + bWordWrap, + b3DShape, + false)); // #SJ# New parameter to force to clipped BlockText for SC xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index a054e881b7c3..7672577138d0 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -46,6 +46,7 @@ #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <vcl/svapp.hxx> #include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -88,12 +89,9 @@ namespace sdr const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat()); const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0); const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0); - basegfx::B2DHomMatrix aObjectMatrix; - - aObjectMatrix.scale(aObjectRange.getWidth(), aObjectRange.getHeight()); - aObjectMatrix.shearX(fShearX); - aObjectMatrix.rotate(fRotate); - aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); + const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate, + aObjectRange.getMinX(), aObjectRange.getMinY())); // Prepare attribute settings, will be used soon anyways const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet(); diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index 0f818ff40f7a..3c8449bae7f6 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -38,6 +38,7 @@ #include <svx/sdr/attribute/sdrallattribute.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <svx/sdr/primitive2d/sdrpathprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -98,9 +99,11 @@ namespace sdr aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon); // #i102548# fill objectMatrix with rotation and offset (no shear for lines) - aObjectMatrix.scale(aLine.getLength(), 1.0); - aObjectMatrix.rotate(atan2(aLine.getY(), aLine.getX())); - aObjectMatrix.translate(aStart.getX(), aStart.getY()); + aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aLine.getLength(), 1.0, + 0.0, + atan2(aLine.getY(), aLine.getX()), + aStart.getX(), aStart.getY()); } else { @@ -110,22 +113,14 @@ namespace sdr const GeoStat& rGeoStat(GetPathObj().GetGeoStat()); const double fWidth(aObjectRange.getWidth()); const double fHeight(aObjectRange.getHeight()); - - aObjectMatrix.scale( - basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth, - basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight); - - if(rGeoStat.nShearWink) - { - aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); - } - - if(rGeoStat.nDrehWink) - { - aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); - } - - aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); + const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth); + const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight); + + aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + fScaleX, fScaleY, + rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0, + rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0, + aObjectRange.getMinX(), aObjectRange.getMinY()); // ceate unit polygon from object's absolute path basegfx::B2DHomMatrix aInverse(aObjectMatrix); diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index 0eab2c882ce5..94b26b5d020e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -39,6 +39,7 @@ #include <svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx> #include <svl/itemset.hxx> #include <svx/sdr/primitive2d/sdrprimitivetools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/svdmodel.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -74,30 +75,13 @@ namespace sdr const Rectangle& rRectangle = GetRectObj().GetGeoRect(); const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); const GeoStat& rGeoStat(GetRectObj().GetGeoStat()); - ::basegfx::B2DHomMatrix aObjectMatrix; // fill object matrix - if(!::basegfx::fTools::equalZero(aObjectRange.getWidth())) - { - aObjectMatrix.set(0, 0, aObjectRange.getWidth()); - } - - if(!::basegfx::fTools::equalZero(aObjectRange.getHeight())) - { - aObjectMatrix.set(1, 1, aObjectRange.getHeight()); - } - - if(rGeoStat.nShearWink) - { - aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); - } - - if(rGeoStat.nDrehWink) - { - aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); - } - - aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY()); + basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), + rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0, + rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0, + aObjectRange.getMinX(), aObjectRange.getMinY())); // calculate corner radius sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue()); diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index af222889a253..f265af141ef1 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -112,7 +112,7 @@ namespace void AnimatedExtractingProcessor2D::processBasePrimitive2D(const drawinglayer::primitive2d::BasePrimitive2D& rCandidate) { // known implementation, access directly - switch(rCandidate.getPrimitiveID()) + switch(rCandidate.getPrimitive2DID()) { // add and accept animated primitives directly, no need to decompose case PRIMITIVE2D_ID_ANIMATEDSWITCHPRIMITIVE2D : diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index 34fddf088c98..bd208b5cf54f 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -44,6 +44,7 @@ #include <svx/svdpage.hxx> #include <unoapi.hxx> #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx> +#include <drawinglayer/primitive2d/hittestprimitive2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -153,7 +154,7 @@ namespace sdr // would be possible, but would require the internal transformation // which maps between the page visualisation object and the page // content, including the aspect ratios (for details see in - // PagePreviewPrimitive2D::createLocalDecomposition) + // PagePreviewPrimitive2D::create2DDecomposition) basegfx::B2DRange(), GetXDrawPageForSdrPage(const_cast< SdrPage* >(pStartPage)), @@ -234,6 +235,9 @@ namespace sdr aPageObjectTransform.set(1, 2, aPageObjectBound.getMinY()); } + // #i102637# add gray frame also when printing and page exists (handout pages) + const bool bCreateGrayFrame(!GetObjectContact().isOutputToPrinter() || pPage); + // get displayed page's content. This is the uscaled page content if(mpExtractor && pPage) { @@ -289,10 +293,28 @@ namespace sdr xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xPagePreview, 1); } } + else if(bCreateGrayFrame) + { + // #i105146# no content, but frame display. To make hitting the page preview objects + // on the handout page more simple, add a HitTest fill primitive + const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0); + basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange)); + aOutline.transform(aPageObjectTransform); + + const drawinglayer::primitive2d::Primitive2DReference xHitFill( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aOutline), + basegfx::BColor(0.0, 0.0, 0.0))); + + const drawinglayer::primitive2d::Primitive2DReference xHit( + new drawinglayer::primitive2d::HitTestPrimitive2D( + drawinglayer::primitive2d::Primitive2DSequence(&xHitFill, 1))); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xHit, 1); + } // add a gray outline frame, except not when printing - // #i102637# add frame also when printing and page exists (handout pages) - if(!GetObjectContact().isOutputToPrinter() || pPage) + if(bCreateGrayFrame) { const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor); basegfx::B2DPolygon aOwnOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index ec876ec036ac..0442c95f60d5 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -880,14 +880,19 @@ namespace sdr { namespace contact { //==================================================================== //= LazyControlCreationPrimitive2D //==================================================================== - class LazyControlCreationPrimitive2D : public ::drawinglayer::primitive2d::BasePrimitive2D + class LazyControlCreationPrimitive2D : public ::drawinglayer::primitive2d::BufferedDecompositionPrimitive2D { private: - typedef ::drawinglayer::primitive2d::BasePrimitive2D BasePrimitive2D; + typedef ::drawinglayer::primitive2d::BufferedDecompositionPrimitive2D BufferedDecompositionPrimitive2D; protected: virtual ::drawinglayer::primitive2d::Primitive2DSequence - createLocalDecomposition( + get2DDecomposition( + const ::drawinglayer::geometry::ViewInformation2D& rViewInformation + ) const; + + virtual ::drawinglayer::primitive2d::Primitive2DSequence + create2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& rViewInformation ) const; @@ -1583,7 +1588,7 @@ namespace sdr { namespace contact { //-------------------------------------------------------------------- bool LazyControlCreationPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if ( !BasePrimitive2D::operator==( rPrimitive ) ) + if ( !BufferedDecompositionPrimitive2D::operator==( rPrimitive ) ) return false; const LazyControlCreationPrimitive2D* pRHS = dynamic_cast< const LazyControlCreationPrimitive2D* >( &rPrimitive ); @@ -1629,7 +1634,20 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- - ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::createLocalDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const + ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::get2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const + { + #if OSL_DEBUG_LEVEL > 1 + ::basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX ); + #endif + if ( m_pVOCImpl->hasControl() ) + impl_positionAndZoomControl( _rViewInformation ); + return BufferedDecompositionPrimitive2D::get2DDecomposition( _rViewInformation ); + } + + //-------------------------------------------------------------------- + ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::create2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const { #if OSL_DEBUG_LEVEL > 1 ::basegfx::B2DVector aScale, aTranslate; diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx index 2411ca3c31b4..b788de195903 100644 --- a/svx/source/sdr/overlay/overlayselection.cxx +++ b/svx/source/sdr/overlay/overlayselection.cxx @@ -113,9 +113,16 @@ namespace sdr if(nCount) { // create range primitives - const basegfx::BColor aRGBColor(getBaseColor().getBColor()); + const bool bInvert(OVERLAY_INVERT == maLastOverlayType); + basegfx::BColor aRGBColor(getBaseColor().getBColor()); aRetval.realloc(nCount); + if(bInvert) + { + // force color to white for invert to get a full invert + aRGBColor = basegfx::BColor(1.0, 1.0, 1.0); + } + for(sal_uInt32 a(0);a < nCount; a++) { const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(maRanges[a])); @@ -125,7 +132,7 @@ namespace sdr aRGBColor)); } - if(OVERLAY_INVERT == maLastOverlayType) + if(bInvert) { // embed all in invert primitive const drawinglayer::primitive2d::Primitive2DReference aInvert( diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx index 664c487c7e43..22b273a2a0e4 100644 --- a/svx/source/sdr/overlay/overlaytools.cxx +++ b/svx/source/sdr/overlay/overlaytools.cxx @@ -40,6 +40,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -59,7 +60,7 @@ namespace drawinglayer mnCenterY(nCenterY) {} - Primitive2DSequence OverlayBitmapExPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence OverlayBitmapExPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence aRetval; const Size aBitmapSize(getBitmapEx().GetSizePixel()); @@ -129,7 +130,7 @@ namespace drawinglayer mfDiscreteDashLength(fDiscreteDashLength) {} - Primitive2DSequence OverlayCrosshairPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence OverlayCrosshairPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // use the prepared Viewport information accessible using getViewport() Primitive2DSequence aRetval; @@ -208,7 +209,7 @@ namespace drawinglayer mfRotation(fRotation) {} - Primitive2DSequence OverlayHatchRectanglePrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence OverlayHatchRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence aRetval; @@ -230,11 +231,8 @@ namespace drawinglayer if(!basegfx::fTools::equalZero(getRotation())) { - basegfx::B2DHomMatrix aTransform; - - aTransform.translate(-getObjectRange().getMinX(), -getObjectRange().getMinY()); - aTransform.rotate(getRotation()); - aTransform.translate(getObjectRange().getMinX(), getObjectRange().getMinY()); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createRotateAroundPoint( + getObjectRange().getMinX(), getObjectRange().getMinY(), getRotation())); aHatchPolyPolygon.transform(aTransform); } @@ -301,7 +299,7 @@ namespace drawinglayer mfDiscreteDashLength(fDiscreteDashLength) {} - Primitive2DSequence OverlayHelplineStripedPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const + Primitive2DSequence OverlayHelplineStripedPrimitive::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { // use the prepared Viewport information accessible using getViewport() Primitive2DSequence aRetval; @@ -417,7 +415,7 @@ namespace drawinglayer mfDiscreteDashLength(fDiscreteDashLength) {} - Primitive2DSequence OverlayRollingRectanglePrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence OverlayRollingRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // use the prepared Viewport information accessible using getViewport() Primitive2DSequence aRetval; diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx index 73d5689350c2..e4967f767299 100644 --- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrCaptionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrCaptionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; Primitive2DSequence aHitTestContent; @@ -142,7 +142,7 @@ namespace drawinglayer const basegfx::B2DPolygon& rTail, double fCornerRadiusX, double fCornerRadiusY) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute), maTail(rTail), @@ -160,7 +160,7 @@ namespace drawinglayer bool SdrCaptionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrCaptionPrimitive2D& rCompare = (SdrCaptionPrimitive2D&)rPrimitive; diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx index a04021ae21ad..0c39f7a6480f 100644 --- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrConnectorPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrConnectorPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; @@ -87,7 +87,7 @@ namespace drawinglayer SdrConnectorPrimitive2D::SdrConnectorPrimitive2D( const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute, const ::basegfx::B2DPolygon& rUnitPolygon) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maSdrLSTAttribute(rSdrLSTAttribute), maUnitPolygon(rUnitPolygon) { @@ -95,7 +95,7 @@ namespace drawinglayer bool SdrConnectorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrConnectorPrimitive2D& rCompare = (SdrConnectorPrimitive2D&)rPrimitive; diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx index af3e6aacb410..5b686bb5abae 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrCustomShapePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrCustomShapePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval(getSubPrimitives()); @@ -92,21 +92,21 @@ namespace drawinglayer const Primitive2DSequence& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, - bool bForceTextClipToTextRange, - bool b3DShape) - : BasePrimitive2D(), + bool b3DShape, + bool bForceTextClipToTextRange) + : BufferedDecompositionPrimitive2D(), maSdrSTAttribute(rSdrSTAttribute), maSubPrimitives(rSubPrimitives), maTextBox(rTextBox), mbWordWrap(bWordWrap), - mbForceTextClipToTextRange(bForceTextClipToTextRange), - mb3DShape(b3DShape) + mb3DShape(b3DShape), + mbForceTextClipToTextRange(bForceTextClipToTextRange) { } bool SdrCustomShapePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrCustomShapePrimitive2D& rCompare = (SdrCustomShapePrimitive2D&)rPrimitive; @@ -114,8 +114,8 @@ namespace drawinglayer && getSubPrimitives() == rCompare.getSubPrimitives() && getTextBox() == rCompare.getTextBox() && getWordWrap() == rCompare.getWordWrap() - && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange() - && get3DShape() == rCompare.get3DShape()); + && get3DShape() == rCompare.get3DShape() + && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange()); } return false; diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index cd426edfdd05..8474b72be2e4 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -75,11 +75,11 @@ namespace drawinglayer // prepare fully scaled polygon basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); aScaledPolyPolygon.transform(rObjectTransform); - BasePrimitive2D* pNewFillPrimitive = 0L; + BasePrimitive2D* pNewFillPrimitive = 0; if(rFill.isGradient()) { - pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getColor(), *rFill.getGradient()); + pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, *rFill.getGradient()); } else if(rFill.isHatch()) { @@ -88,7 +88,7 @@ namespace drawinglayer else if(rFill.isBitmap()) { const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon)); - pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getBitmap()->getFillBitmapAttribute(aRange)); + pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap()->getFillBitmapAttribute(aRange)); } else { @@ -192,19 +192,17 @@ namespace drawinglayer // scale outline to object's size to allow growing with value relative to that size // and also to keep aspect ratio - basegfx::B2DHomMatrix aScaleTransform; - aScaleTransform.set(0, 0, fabs(aScale.getX())); - aScaleTransform.set(1, 1, fabs(aScale.getY())); basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon); - aScaledUnitPolyPolygon.transform(aScaleTransform); + aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix( + fabs(aScale.getX()), fabs(aScale.getY()))); // grow the polygon. To shrink, use negative value (half width) aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5)); // scale back to unit polygon - aScaleTransform.set(0, 0, 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0); - aScaleTransform.set(1, 1, 0.0 != aScale.getY() ? 1.0 / aScale.getY() : 1.0); - aScaledUnitPolyPolygon.transform(aScaleTransform); + aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix( + 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0, + 0.0 != aScale.getY() ? 1.0 / aScale.getY() : 1.0)); // create with unit polygon pNew = new SdrContourTextPrimitive2D( @@ -265,17 +263,16 @@ namespace drawinglayer aTextAnchorRange.expand(aBottomRight); // now create a transformation from this basic range (aTextAnchorRange) - aAnchorTransform.identity(); - aAnchorTransform.scale(aTextAnchorRange.getWidth(), aTextAnchorRange.getHeight()); - aAnchorTransform.translate(aTextAnchorRange.getMinX(), aTextAnchorRange.getMinY()); + aAnchorTransform = basegfx::tools::createScaleTranslateB2DHomMatrix( + aTextAnchorRange.getWidth(), aTextAnchorRange.getHeight(), + aTextAnchorRange.getMinX(), aTextAnchorRange.getMinY()); // apply mirroring aAnchorTransform.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); // apply object's other transforms - aAnchorTransform.shearX(fShearX); - aAnchorTransform.rotate(fRotate); - aAnchorTransform.translate(aTranslate.getX(), aTranslate.getY()); + aAnchorTransform = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate) + * aAnchorTransform; if(rText.isFitToSize()) { @@ -342,10 +339,8 @@ namespace drawinglayer aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX); // build transform from scaled only to full AnchorTransform and inverse - basegfx::B2DHomMatrix aSRT; - aSRT.shearX(fShearX); - aSRT.rotate(fRotate); - aSRT.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aSRT(basegfx::tools::createShearXRotateTranslateB2DHomMatrix( + fShearX, fRotate, aTranslate)); basegfx::B2DHomMatrix aISRT(aSRT); aISRT.invert(); diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx index 4f7e2c768669..1327d2a422fa 100644 --- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx @@ -39,6 +39,7 @@ #include <drawinglayer/primitive2d/hittestprimitive2d.hxx> #include <basegfx/color/bcolor.hxx> #include <drawinglayer/attribute/sdrattribute.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -50,7 +51,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrEllipsePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrEllipsePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; @@ -61,11 +62,7 @@ namespace drawinglayer ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitCircle(1)); // scale and move UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1) - ::basegfx::B2DHomMatrix aUnitCorrectionMatrix; - aUnitCorrectionMatrix.set(0, 0, 0.5); - aUnitCorrectionMatrix.set(1, 1, 0.5); - aUnitCorrectionMatrix.set(0, 2, 0.5); - aUnitCorrectionMatrix.set(1, 2, 0.5); + const basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5)); // apply to the geometry aUnitOutline.transform(aUnitCorrectionMatrix); @@ -109,7 +106,7 @@ namespace drawinglayer SdrEllipsePrimitive2D::SdrEllipsePrimitive2D( const ::basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute) { @@ -117,7 +114,7 @@ namespace drawinglayer bool SdrEllipsePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrEllipsePrimitive2D& rCompare = (SdrEllipsePrimitive2D&)rPrimitive; @@ -140,13 +137,12 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrEllipseSegmentPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrEllipseSegmentPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; // create unit outline polygon ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle)); - ::basegfx::B2DHomMatrix aUnitCorrectionMatrix; if(mbCloseSegment) { @@ -161,7 +157,7 @@ namespace drawinglayer } // move and scale UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1) - aUnitCorrectionMatrix.translate(1.0, 1.0); + basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createTranslateB2DHomMatrix(1.0, 1.0)); aUnitCorrectionMatrix.scale(0.5, 0.5); // apply to the geometry diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index 63d050a775af..befff1b0c539 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -44,7 +44,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrGrafPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrGrafPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; @@ -121,7 +121,7 @@ namespace drawinglayer const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, const GraphicObject& rGraphicObject, const GraphicAttr& rGraphicAttr) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute), maGraphicObject(rGraphicObject), @@ -133,7 +133,7 @@ namespace drawinglayer bool SdrGrafPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrGrafPrimitive2D& rCompare = (SdrGrafPrimitive2D&)rPrimitive; diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index cb2452e8ba1f..e22e9eb61c5b 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -40,6 +40,7 @@ #include <drawinglayer/primitive2d/groupprimitive2d.hxx> #include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx> #include <drawinglayer/primitive2d/hittestprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -85,7 +86,7 @@ namespace drawinglayer return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, &aLineStartEnd); } - Primitive2DSequence SdrMeasurePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const + Primitive2DSequence SdrMeasurePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; SdrBlockTextPrimitive2D* pBlockText = 0L; @@ -97,10 +98,8 @@ namespace drawinglayer const double fAngle(atan2(aLine.getY(), aLine.getX())); bool bAutoUpsideDown(false); const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText(); - - basegfx::B2DHomMatrix aObjectMatrix; - aObjectMatrix.rotate(fAngle); - aObjectMatrix.translate(getStart().getX(), getStart().getY()); + const basegfx::B2DHomMatrix aObjectMatrix( + basegfx::tools::createShearXRotateTranslateB2DHomMatrix(0.0, fAngle, getStart())); if(pTextAttribute) { @@ -430,7 +429,7 @@ namespace drawinglayer // apply to existing text primitive SdrTextPrimitive2D* pNewBlockText = pBlockText->createTransformedClone(aChange); - OSL_ENSURE(pNewBlockText, "SdrMeasurePrimitive2D::createLocalDecomposition: Could not create transformed clone of text primitive (!)"); + OSL_ENSURE(pNewBlockText, "SdrMeasurePrimitive2D::create2DDecomposition: Could not create transformed clone of text primitive (!)"); delete pBlockText; // add to local primitives @@ -460,7 +459,7 @@ namespace drawinglayer bool bBelow, bool bTextRotation, bool bTextAutoAngle) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maSdrLSTAttribute(rSdrLSTAttribute), maStart(rStart), maEnd(rEnd), @@ -479,7 +478,7 @@ namespace drawinglayer bool SdrMeasurePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrMeasurePrimitive2D& rCompare = (SdrMeasurePrimitive2D&)rPrimitive; diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index 7c44311d3c5a..bf2df22fb2e6 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -46,9 +46,37 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrOle2Primitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + SdrOle2Primitive2D::SdrOle2Primitive2D( + const Primitive2DSequence& rOLEContent, + const basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute) + : BasePrimitive2D(), + maOLEContent(rOLEContent), + maTransform(rTransform), + maSdrLFSTAttribute(rSdrLFSTAttribute) + { + } + + bool SdrOle2Primitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(BasePrimitive2D::operator==(rPrimitive)) + { + const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive; + + if(getOLEContent() == rCompare.getOLEContent() + && getTransform() == rCompare.getTransform() + && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()) + { + return true; + } + } + + return false; + } + + Primitive2DSequence SdrOle2Primitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { - // to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::createLocalDecomposition + // to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::create2DDecomposition // should happen. For the moment we only need the OLE itself // Added complete primitive preparation using getSdrLFSTAttribute() now. To not do stuff which is not needed now, it // may be supressed by using a static bool. The paint version only supported text. @@ -104,7 +132,7 @@ namespace drawinglayer } // add graphic content - appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, getChildren()); + appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, getOLEContent()); // add text, no need to supress to stay compatible since text was // always supported by the old paints, too @@ -122,32 +150,6 @@ namespace drawinglayer return aRetval; } - SdrOle2Primitive2D::SdrOle2Primitive2D( - const Primitive2DSequence& rChildren, - const ::basegfx::B2DHomMatrix& rTransform, - const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute) - : GroupPrimitive2D(rChildren), - maTransform(rTransform), - maSdrLFSTAttribute(rSdrLFSTAttribute) - { - } - - bool SdrOle2Primitive2D::operator==(const BasePrimitive2D& rPrimitive) const - { - if(GroupPrimitive2D::operator==(rPrimitive)) - { - const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive; - - if(getTransform() == rCompare.getTransform() - && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()) - { - return true; - } - } - - return false; - } - // provide unique ID ImplPrimitrive2DIDBlock(SdrOle2Primitive2D, PRIMITIVE2D_ID_SDROLE2PRIMITIVE2D) diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index e682c0e04b55..d46ab7b4b14d 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -39,6 +39,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -46,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrOleContentPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrOleContentPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; const SdrOle2Obj* pSource = (mpSdrOle2Obj.is() ? static_cast< SdrOle2Obj* >(mpSdrOle2Obj.get()) : 0); @@ -105,13 +106,10 @@ namespace drawinglayer if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0)) { // if content fits into frame, create it - basegfx::B2DHomMatrix aInnerObjectMatrix; - - aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight()); - aInnerObjectMatrix.translate(fOffsetX, fOffsetY); - aInnerObjectMatrix.shearX(fShearX); - aInnerObjectMatrix.rotate(fRotate); - aInnerObjectMatrix.translate(aTranslate.getX(), aTranslate.getY()); + basegfx::B2DHomMatrix aInnerObjectMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix( + aPrefSize.getWidth(), aPrefSize.getHeight(), fOffsetX, fOffsetY)); + aInnerObjectMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate) + * aInnerObjectMatrix; const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive( new drawinglayer::primitive2d::GraphicPrimitive2D( @@ -159,7 +157,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rObjectTransform, sal_uInt32 nGraphicVersion, bool bHighContrast) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), mpSdrOle2Obj(const_cast< SdrOle2Obj* >(&rSdrOle2Obj)), maObjectTransform(rObjectTransform), mnGraphicVersion(nGraphicVersion), @@ -169,7 +167,7 @@ namespace drawinglayer bool SdrOleContentPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrOleContentPrimitive2D& rCompare = (SdrOleContentPrimitive2D&)rPrimitive; const bool bBothNot(!mpSdrOle2Obj.is() && !rCompare.mpSdrOle2Obj.is()); diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx index 96da706fb66a..39f3efc617f5 100644 --- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrPathPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrPathPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; @@ -105,7 +105,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, const basegfx::B2DPolyPolygon& rUnitPolyPolygon) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute), maUnitPolyPolygon(rUnitPolyPolygon) @@ -114,7 +114,7 @@ namespace drawinglayer bool SdrPathPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrPathPrimitive2D& rCompare = (SdrPathPrimitive2D&)rPrimitive; diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx index 097cd5edd445..93ed597cb0a3 100644 --- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrRectanglePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrRectanglePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; Primitive2DSequence aHitTestContent; @@ -128,7 +128,7 @@ namespace drawinglayer double fCornerRadiusX, double fCornerRadiusY, bool bForceFillForHitTest) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute), mfCornerRadiusX(fCornerRadiusX), @@ -139,7 +139,7 @@ namespace drawinglayer bool SdrRectanglePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrRectanglePrimitive2D& rCompare = (SdrRectanglePrimitive2D&)rPrimitive; diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 47e85894f37e..6b1ad6e27755 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -109,7 +109,7 @@ namespace drawinglayer SdrTextPrimitive2D::SdrTextPrimitive2D( const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), mrSdrText(const_cast< SdrText* >(pSdrText)), maOutlinerParaObject(rOutlinerParaObject), mxLastVisualizingPage(), @@ -132,7 +132,7 @@ namespace drawinglayer bool SdrTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrTextPrimitive2D& rCompare = (SdrTextPrimitive2D&)rPrimitive; @@ -157,7 +157,7 @@ namespace drawinglayer sal_Int16 nCurrentlyValidPageNumber(0); sal_Int16 nCurrentlyValidPageCount(0); - if(getLocalDecomposition().hasElements()) + if(getBuffered2DDecomposition().hasElements()) { bool bDoDelete(false); @@ -211,11 +211,11 @@ namespace drawinglayer if(bDoDelete) { - const_cast< SdrTextPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence()); + const_cast< SdrTextPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence()); } } - if(!getLocalDecomposition().hasElements()) + if(!getBuffered2DDecomposition().hasElements()) { if(!bCurrentlyVisualizingPageIsSet && mbContainsPageField) { @@ -245,7 +245,7 @@ namespace drawinglayer } // call parent - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -256,7 +256,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrContourTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const + Primitive2DSequence SdrContourTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation); @@ -309,7 +309,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrPathTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const + Primitive2DSequence SdrPathTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation); @@ -365,7 +365,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrBlockTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const + Primitive2DSequence SdrBlockTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation); @@ -442,7 +442,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const + Primitive2DSequence SdrStretchTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation); diff --git a/svx/source/svdraw/gradtrns.cxx b/svx/source/svdraw/gradtrns.cxx index 0e62aa9ed75f..5f607cd20bb6 100644 --- a/svx/source/svdraw/gradtrns.cxx +++ b/svx/source/svdraw/gradtrns.cxx @@ -35,6 +35,7 @@ #include <svx/svdobj.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <vcl/salbtype.hxx> // FRound ////////////////////////////////////////////////////////////////////////////// @@ -81,11 +82,7 @@ void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, cons if(rG.aGradient.GetAngle()) { const double fAngle = (double)rG.aGradient.GetAngle() * (F_PI180 / 10.0); - basegfx::B2DHomMatrix aTransformation; - - aTransformation.translate(-aCenter.getX(), -aCenter.getY()); - aTransformation.rotate(-fAngle); - aTransformation.translate(aCenter.getX(), aCenter.getY()); + const basegfx::B2DHomMatrix aTransformation(basegfx::tools::createRotateAroundPoint(aCenter, -fAngle)); aStartPos *= aTransformation; aEndPos *= aTransformation; @@ -108,11 +105,7 @@ void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, cons if(rG.aGradient.GetAngle()) { const double fAngle = (double)rG.aGradient.GetAngle() * (F_PI180 / 10.0); - basegfx::B2DHomMatrix aTransformation; - - aTransformation.translate(-aCenter.getX(), -aCenter.getY()); - aTransformation.rotate(-fAngle); - aTransformation.translate(aCenter.getX(), aCenter.getY()); + const basegfx::B2DHomMatrix aTransformation(basegfx::tools::createRotateAroundPoint(aCenter, -fAngle)); aStartPos *= aTransformation; aEndPos *= aTransformation; @@ -136,11 +129,7 @@ void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, cons if(rG.aGradient.GetAngle()) { const double fAngle = (double)rG.aGradient.GetAngle() * (F_PI180 / 10.0); - basegfx::B2DHomMatrix aTransformation; - - aTransformation.translate(-aEndPos.getX(), -aEndPos.getY()); - aTransformation.rotate(-fAngle); - aTransformation.translate(aEndPos.getX(), aEndPos.getY()); + const basegfx::B2DHomMatrix aTransformation(basegfx::tools::createRotateAroundPoint(aEndPos, -fAngle)); aStartPos *= aTransformation; aEndPos *= aTransformation; @@ -175,11 +164,7 @@ void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, cons if(rG.aGradient.GetAngle()) { const double fAngle = (double)rG.aGradient.GetAngle() * (F_PI180 / 10.0); - basegfx::B2DHomMatrix aTransformation; - - aTransformation.translate(-aEndPos.getX(), -aEndPos.getY()); - aTransformation.rotate(-fAngle); - aTransformation.translate(aEndPos.getX(), aEndPos.getY()); + const basegfx::B2DHomMatrix aTransformation(basegfx::tools::createRotateAroundPoint(aEndPos, -fAngle)); aStartPos *= aTransformation; aEndPos *= aTransformation; diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index a8d588e73fe5..826e87520ce3 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -84,6 +84,7 @@ #include <svx/svdovirt.hxx> #include <svx/svdouno.hxx> #include <svx/sdr/primitive2d/sdrprimitivetools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -608,9 +609,8 @@ void SdrDragMethod::applyCurrentTransformationToSdrObject(SdrObject& rTarget) const double fScaleY(fabs(aScale.getY()) / (basegfx::fTools::equalZero(aPolyRange.getHeight()) ? 1.0 : aPolyRange.getHeight())); // prepare transform matrix for polygon - basegfx::B2DHomMatrix aPolyTransform; - - aPolyTransform.translate(-aPolyRange.getMinX(), -aPolyRange.getMinY()); + basegfx::B2DHomMatrix aPolyTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aPolyRange.getMinX(), -aPolyRange.getMinY())); aPolyTransform.scale(fScaleX, fScaleY); // normally the poly should be moved back, but the translation is in the object @@ -1449,11 +1449,7 @@ bool SdrDragMove::BeginSdrDrag() basegfx::B2DHomMatrix SdrDragMove::getCurrentTransformation() { - basegfx::B2DHomMatrix aRetval; - - aRetval.translate(DragStat().GetDX(), DragStat().GetDY()); - - return aRetval; + return basegfx::tools::createTranslateB2DHomMatrix(DragStat().GetDX(), DragStat().GetDY()); } void SdrDragMove::ImpCheckSnap(const Point& rPt) @@ -1778,9 +1774,8 @@ bool SdrDragResize::BeginSdrDrag() basegfx::B2DHomMatrix SdrDragResize::getCurrentTransformation() { - basegfx::B2DHomMatrix aRetval; - - aRetval.translate(-DragStat().Ref1().X(), -DragStat().Ref1().Y()); + basegfx::B2DHomMatrix aRetval(basegfx::tools::createTranslateB2DHomMatrix( + -DragStat().Ref1().X(), -DragStat().Ref1().Y())); aRetval.scale(aXFact, aYFact); aRetval.translate(DragStat().Ref1().X(), DragStat().Ref1().Y()); @@ -2064,13 +2059,9 @@ bool SdrDragRotate::BeginSdrDrag() basegfx::B2DHomMatrix SdrDragRotate::getCurrentTransformation() { - basegfx::B2DHomMatrix aRetval; - - aRetval.translate(-DragStat().GetRef1().X(), -DragStat().GetRef1().Y()); - aRetval.rotate(-atan2(nSin, nCos)); - aRetval.translate(DragStat().GetRef1().X(), DragStat().GetRef1().Y()); - - return aRetval; + return basegfx::tools::createRotateAroundPoint( + DragStat().GetRef1().X(), DragStat().GetRef1().Y(), + -atan2(nSin, nCos)); } void SdrDragRotate::MoveSdrDrag(const Point& rPnt_) @@ -2220,9 +2211,8 @@ bool SdrDragShear::BeginSdrDrag() basegfx::B2DHomMatrix SdrDragShear::getCurrentTransformation() { - basegfx::B2DHomMatrix aRetval; - - aRetval.translate(-DragStat().GetRef1().X(), -DragStat().GetRef1().Y()); + basegfx::B2DHomMatrix aRetval(basegfx::tools::createTranslateB2DHomMatrix( + -DragStat().GetRef1().X(), -DragStat().GetRef1().Y())); if (bResize) { @@ -2520,7 +2510,7 @@ basegfx::B2DHomMatrix SdrDragMirror::getCurrentTransformation() const double fDeltaY(DragStat().GetRef2().Y() - DragStat().GetRef1().Y()); const double fRotation(atan2(fDeltaY, fDeltaX)); - aRetval.translate(-DragStat().GetRef1().X(), -DragStat().GetRef1().Y()); + aRetval = basegfx::tools::createTranslateB2DHomMatrix(-DragStat().GetRef1().X(), -DragStat().GetRef1().Y()); aRetval.rotate(-fRotation); aRetval.scale(1.0, -1.0); aRetval.rotate(fRotation); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 6682e421c180..ecfff66bf8c2 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -46,7 +46,6 @@ #include <svx/xlnclit.hxx> #include <svx/xlnwtit.hxx> #include <svx/xflclit.hxx> - #include <svx/xgrad.hxx> #include <svx/xflgrit.hxx> #include <fontitem.hxx> @@ -55,9 +54,7 @@ #include <svx/cntritem.hxx> #include <svx/colritem.hxx> #include <vcl/metric.hxx> - #include <svx/charscaleitem.hxx> - #include <svx/xflhtit.hxx> #include <svx/svdattr.hxx> #include <svx/svdmodel.hxx> @@ -73,9 +70,10 @@ #include <svl/itemset.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <vcl/salbtype.hxx> // FRound - -// #i73407# #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <svx/xlinjoit.hxx> +#include <svx/xlndsit.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -84,6 +82,8 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(SdrModel& rModel): pLineAttr(NULL),pFillAttr(NULL),pTextAttr(NULL), pPage(NULL),pModel(NULL),nLayer(0), nLineWidth(0), + maLineJoin(basegfx::B2DLINEJOIN_NONE), + maDash(XDASH_RECT, 0, 0, 0, 0, 0), bFntDirty(TRUE), bLastObjWasPolyWithoutLine(FALSE),bNoLine(FALSE),bNoFill(FALSE),bLastObjWasLine(FALSE) { @@ -277,6 +277,9 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, FASTBOOL bForceText { if ( nLineWidth ) pLineAttr->Put( XLineWidthItem( nLineWidth ) ); + else + pLineAttr->Put( XLineWidthItem( 0 ) ); + aOldLineColor = aVD.GetLineColor(); if( aVD.IsLineColor() ) { @@ -285,6 +288,34 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, FASTBOOL bForceText } else pLineAttr->Put(XLineStyleItem(XLINE_NONE)); + + switch(maLineJoin) + { + default : // basegfx::B2DLINEJOIN_NONE + pLineAttr->Put(XLineJointItem(XLINEJOINT_NONE)); + break; + case basegfx::B2DLINEJOIN_MIDDLE: + pLineAttr->Put(XLineJointItem(XLINEJOINT_MIDDLE)); + break; + case basegfx::B2DLINEJOIN_BEVEL: + pLineAttr->Put(XLineJointItem(XLINEJOINT_BEVEL)); + break; + case basegfx::B2DLINEJOIN_MITER: + pLineAttr->Put(XLineJointItem(XLINEJOINT_MITER)); + break; + case basegfx::B2DLINEJOIN_ROUND: + pLineAttr->Put(XLineJointItem(XLINEJOINT_ROUND)); + break; + } + + if(((maDash.GetDots() && maDash.GetDotLen()) || (maDash.GetDashes() && maDash.GetDashLen())) && maDash.GetDistance()) + { + pLineAttr->Put(XLineDashItem(String(), maDash)); + } + else + { + pLineAttr->Put(XLineDashItem(String(), XDash(XDASH_RECT))); + } } else bNoLine = TRUE; @@ -385,12 +416,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction& rAct) if(!aStart.equal(aEnd)) { basegfx::B2DPolygon aLine; - basegfx::B2DHomMatrix aTransform; + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); aLine.append(aStart); aLine.append(aEnd); - aTransform.scale(fScaleX, fScaleY); - aTransform.translate(aOfs.X(), aOfs.Y()); aLine.transform(aTransform); const LineInfo& rLineInfo = rAct.GetLineInfo(); @@ -402,12 +431,19 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction& rAct) bCreateLineObject = false; } - nLineWidth = nNewLineWidth; - if(bCreateLineObject) { SdrPathObj* pPath = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aLine)); + nLineWidth = nNewLineWidth; + maLineJoin = rLineInfo.GetLineJoin(); + maDash = XDash(XDASH_RECT, + rLineInfo.GetDotCount(), rLineInfo.GetDotLen(), + rLineInfo.GetDashCount(), rLineInfo.GetDashLen(), + rLineInfo.GetDistance()); SetAttributes(pPath); + nLineWidth = 0; + maLineJoin = basegfx::B2DLINEJOIN_NONE; + maDash = XDash(); InsertObj(pPath, false); } } @@ -581,10 +617,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction& rAct ) if(aSource.count()) { - basegfx::B2DHomMatrix aTransform; - - aTransform.scale(fScaleX, fScaleY); - aTransform.translate(aOfs.X(), aOfs.Y()); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); aSource.transform(aTransform); } @@ -601,12 +634,21 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction& rAct ) bCreateLineObject = false; } - nLineWidth = nNewLineWidth; - if(bCreateLineObject) { - SdrPathObj* pPath = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aSource)); + SdrPathObj* pPath = new SdrPathObj( + aSource.isClosed() ? OBJ_POLY : OBJ_PLIN, + basegfx::B2DPolyPolygon(aSource)); + nLineWidth = nNewLineWidth; + maLineJoin = rLineInfo.GetLineJoin(); + maDash = XDash(XDASH_RECT, + rLineInfo.GetDotCount(), rLineInfo.GetDotLen(), + rLineInfo.GetDashCount(), rLineInfo.GetDashLen(), + rLineInfo.GetDistance()); SetAttributes(pPath); + nLineWidth = 0; + maLineJoin = basegfx::B2DLINEJOIN_NONE; + maDash = XDash(); InsertObj(pPath, false); } } @@ -618,10 +660,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolygonAction& rAct ) if(aSource.count()) { - basegfx::B2DHomMatrix aTransform; - - aTransform.scale(fScaleX, fScaleY); - aTransform.translate(aOfs.X(), aOfs.Y()); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); aSource.transform(aTransform); if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource))) @@ -643,10 +682,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaPolyPolygonAction& rAct) if(aSource.count()) { - basegfx::B2DHomMatrix aTransform; - - aTransform.scale(fScaleX, fScaleY); - aTransform.translate(aOfs.X(), aOfs.Y()); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); aSource.transform(aTransform); if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) @@ -791,9 +827,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct ) if(aSource.count()) { - basegfx::B2DHomMatrix aTransform; - aTransform.scale(fScaleX, fScaleY); - aTransform.translate(aOfs.X(), aOfs.Y()); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, aOfs.X(), aOfs.Y())); aSource.transform(aTransform); if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) @@ -886,12 +920,6 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM if(aSource.count()) { - basegfx::B2DHomMatrix aTransform; - - aTransform.scale(fScaleX, fScaleY); - aTransform.translate(aOfs.X(), aOfs.Y()); - aSource.transform(aTransform); - if(!bLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource)) { const Gradient& rGrad = pAct->GetGradient(); @@ -912,7 +940,20 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM aXGradient.SetEndIntens(rGrad.GetEndIntensity()); aXGradient.SetSteps(rGrad.GetSteps()); - SetAttributes(pPath); + if(aVD.IsLineColor()) + { + // switch line off; when there was one there will be a + // META_POLYLINE_ACTION following creating another object + const Color aLineColor(aVD.GetLineColor()); + aVD.SetLineColor(); + SetAttributes(pPath); + aVD.SetLineColor(aLineColor); + } + else + { + SetAttributes(pPath); + } + aGradAttr.Put(XFillStyleItem(XFILL_GRADIENT)); aGradAttr.Put(XFillGradientItem(&pModel->GetItemPool(), aXGradient)); pPath->SetMergedItemSet(aGradAttr); diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx index b4d583e6c506..84f2b30b6a15 100644 --- a/svx/source/svdraw/svdfmtf.hxx +++ b/svx/source/svdraw/svdfmtf.hxx @@ -86,6 +86,8 @@ protected: SdrLayerID nLayer; Color aOldLineColor; sal_Int32 nLineWidth; + basegfx::B2DLineJoin maLineJoin; + XDash maDash; sal_Bool bMov; sal_Bool bSize; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 4c4c39f7225b..85ca4c4ff09a 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -94,6 +94,7 @@ #include <svx/svdview.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> // #104018# replace macros above with type-safe methods inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); } @@ -3444,31 +3445,11 @@ sal_Bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, ba } // build matrix - rMatrix.identity(); - - if(!basegfx::fTools::equal(aScale.getX(), 1.0) || !basegfx::fTools::equal(aScale.getY(), 1.0)) - { - rMatrix.scale(aScale.getX(), aScale.getY()); - } - - if(!basegfx::fTools::equalZero(fShearX)) - { - rMatrix.shearX(tan(fShearX)); - } - - if(!basegfx::fTools::equalZero(fRotate)) - { - // #i78696# - // fRotate is from the old GeoStat struct and thus mathematically wrong orientated. For - // the linear combination of matrices it needed to be fixed in the API, so it needs to - // be mirrored here - rMatrix.rotate(-fRotate); - } - - if(!aTranslate.equalZero()) - { - rMatrix.translate(aTranslate.getX(), aTranslate.getY()); - } + rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale, + basegfx::fTools::equalZero(fShearX) ? 0.0 : tan(fShearX), + basegfx::fTools::equalZero(fRotate) ? 0.0 : -fRotate, + aTranslate); return sal_False; } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 013eaed311c6..fb26d7b5fc9c 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -68,9 +68,6 @@ #include <svx/svdattrx.hxx> // NotPersistItems #include <svx/svdoashp.hxx> #include <svx/svdomedia.hxx> - -//////////////////////////////////////////////////////////////////////////////////////////////////// - #include <svx/xlnwtit.hxx> #include <svx/xlnstwit.hxx> #include <svx/xlnedwit.hxx> @@ -107,8 +104,6 @@ #include <vcl/graphictools.hxx> #include <svtools/colorcfg.hxx> #include <svx/sdr/properties/emptyproperties.hxx> - -// #110094# #include <svx/sdr/contact/viewcontactofsdrobj.hxx> #include <svx/sdr/contact/viewcontactofgraphic.hxx> #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx> @@ -120,7 +115,6 @@ #include <basegfx/range/b2drange.hxx> #include <svx/unoshape.hxx> #include <vcl/virdev.hxx> - #include <basegfx/polygon/b2dpolypolygoncutter.hxx> #include <drawinglayer/processor2d/contourextractor2d.hxx> #include <drawinglayer/processor2d/linegeometryextractor2d.hxx> @@ -128,10 +122,8 @@ #include "svx/svdotable.hxx" #include "svx/shapepropertynotifier.hxx" #include <svx/sdrhittesthelper.hxx> - -// --> OD 2009-07-10 #i73249# #include <svx/svdundo.hxx> -// <-- +#include <basegfx/matrix/b2dhommatrixtools.hxx> using namespace ::com::sun::star; @@ -3056,17 +3048,7 @@ sal_Bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B } // build matrix - rMatrix.identity(); - - if(1.0 != aScale.getX() || 1.0 != aScale.getY()) - { - rMatrix.scale(aScale.getX(), aScale.getY()); - } - - if(0.0 != aTranslate.getX() || 0.0 != aTranslate.getY()) - { - rMatrix.translate(aTranslate.getX(), aTranslate.getY()); - } + rMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aScale, aTranslate); return sal_False; } diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 0be63fefa61f..f3968586fd87 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -61,6 +61,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -225,24 +226,17 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c if(OBJ_CIRC == eCicrleKind) { - // create full circle. Do not use createPolygonFromEllipse, but the single - // calls to appendUnitCircleQuadrant() to get the start point to the bottom of the - // circle to keep compatible to old geometry creation - basegfx::tools::appendUnitCircleQuadrant(aCircPolygon, 1); - basegfx::tools::appendUnitCircleQuadrant(aCircPolygon, 2); - basegfx::tools::appendUnitCircleQuadrant(aCircPolygon, 3); - basegfx::tools::appendUnitCircleQuadrant(aCircPolygon, 0); - aCircPolygon.setClosed(true); - - // remove double points between segments created by segmented creation - aCircPolygon.removeDoublePoints(); - - // needs own scaling and translation from unit circle to target size - basegfx::B2DHomMatrix aMatrix; - const basegfx::B2DPoint aCenter(aRange.getCenter()); + // create full circle. Do not use createPolygonFromEllipse; it's necessary + // to get the start point to the bottom of the circle to keep compatible to + // old geometry creation + aCircPolygon = basegfx::tools::createPolygonFromUnitCircle(1); - aMatrix.scale(aRange.getWidth() / 2.0, aRange.getHeight() / 2.0); - aMatrix.translate(aCenter.getX(), aCenter.getY()); + // needs own scaling and translation from unit circle to target size (same as + // would be in createPolygonFromEllipse) + const basegfx::B2DPoint aCenter(aRange.getCenter()); + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix( + aRange.getWidth() / 2.0, aRange.getHeight() / 2.0, + aCenter.getX(), aCenter.getY())); aCircPolygon.transform(aMatrix); } else @@ -252,7 +246,9 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c const double fEnd(((36000 - nStart) % 36000) * F_PI18000); // create circle segment. This is not closed by default - aCircPolygon = basegfx::tools::createPolygonFromEllipseSegment(aRange.getCenter(), aRange.getWidth() / 2.0, aRange.getHeight() / 2.0, fStart, fEnd); + aCircPolygon = basegfx::tools::createPolygonFromEllipseSegment( + aRange.getCenter(), aRange.getWidth() / 2.0, aRange.getHeight() / 2.0, + fStart, fEnd); // check closing states const bool bCloseSegment(OBJ_CARC != eCicrleKind); @@ -277,26 +273,16 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c // #i76950# if(aGeo.nShearWink || aGeo.nDrehWink) { - const basegfx::B2DPoint aTopLeft(aRange.getMinimum()); - basegfx::B2DHomMatrix aMatrix; - // translate top left to (0,0) - aMatrix.translate(-aTopLeft.getX(), -aTopLeft.getY()); - - // shear (if needed) - if(aGeo.nShearWink) - { - aMatrix.shearX(tan((36000 - aGeo.nShearWink) * F_PI18000)); - } - - // rotate (if needed) - if(aGeo.nDrehWink) - { - aMatrix.rotate((36000 - aGeo.nDrehWink) * F_PI18000); - } - - // back to top left - aMatrix.translate(aTopLeft.getX(), aTopLeft.getY()); + const basegfx::B2DPoint aTopLeft(aRange.getMinimum()); + basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + -aTopLeft.getX(), -aTopLeft.getY())); + + // shear, rotate and back to top left (if needed) + aMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix( + aGeo.nShearWink ? tan((36000 - aGeo.nShearWink) * F_PI18000) : 0.0, + aGeo.nDrehWink ? (36000 - aGeo.nDrehWink) * F_PI18000 : 0.0, + aTopLeft) * aMatrix; // apply transformation aCircPolygon.transform(aMatrix); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 84e571736328..28d192f3956d 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -682,7 +682,7 @@ void SdrGrafObj::operator=( const SdrObject& rObj ) const SdrGrafObj& rGraf = (SdrGrafObj&) rObj; - pGraphic->SetGraphic( rGraf.GetGraphic() ); + pGraphic->SetGraphic( rGraf.GetGraphic(), &rGraf.GetGraphicObject() ); aCropRect = rGraf.aCropRect; aFileName = rGraf.aFileName; aFilterName = rGraf.aFilterName; diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 411058a766c6..bc86a689987a 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -71,6 +71,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1456,17 +1457,7 @@ sal_Bool SdrMeasureObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf } // build return value matrix - rMatrix.identity(); - - if(!basegfx::fTools::equal(aScale.getX(), 1.0) || !basegfx::fTools::equal(aScale.getY(), 1.0)) - { - rMatrix.scale(aScale.getX(), aScale.getY()); - } - - if(!aTranslate.equalZero()) - { - rMatrix.translate(aTranslate.getX(), aTranslate.getY()); - } + rMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aScale, aTranslate); return sal_True; } diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index f44efe3c5dfa..dfad9824a8fd 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -56,7 +56,6 @@ #include <svx/xlnclit.hxx> #include <svx/xflclit.hxx> #include <svx/svdogrp.hxx> - #include <svx/polypolygoneditor.hxx> #include <svx/xlntrit.hxx> #include <vcl/salbtype.hxx> // FRound @@ -77,10 +76,9 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); } #include <basegfx/range/b2drange.hxx> #include <basegfx/curve/b2dcubicbezier.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> - -// #i89784# #include <svx/sdr/attribute/sdrtextattribute.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> using namespace sdr; @@ -2359,9 +2357,7 @@ Pointer SdrPathObj::GetCreatePointer() const void SdrPathObj::NbcMove(const Size& rSiz) { - basegfx::B2DHomMatrix aTrans; - aTrans.translate(rSiz.Width(), rSiz.Height()); - maPathPolygon.transform(aTrans); + maPathPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(rSiz.Width(), rSiz.Height())); // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints) SdrTextObj::NbcMove(rSiz); @@ -2369,10 +2365,9 @@ void SdrPathObj::NbcMove(const Size& rSiz) void SdrPathObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) { - basegfx::B2DHomMatrix aTrans; - aTrans.translate(-rRef.X(), -rRef.Y()); - aTrans.scale(double(xFact), double(yFact)); - aTrans.translate(rRef.X(), rRef.Y()); + basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-rRef.X(), -rRef.Y())); + aTrans = basegfx::tools::createScaleTranslateB2DHomMatrix( + double(xFact), double(yFact), rRef.X(), rRef.Y()) * aTrans; maPathPolygon.transform(aTrans); // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints) @@ -2381,10 +2376,8 @@ void SdrPathObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract void SdrPathObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs) { - basegfx::B2DHomMatrix aTrans; - aTrans.translate(-rRef.X(), -rRef.Y()); - aTrans.rotate(-nWink * nPi180); // Thank JOE, the angles are defined mirrored to the mathematical meanings - aTrans.translate(rRef.X(), rRef.Y()); + // Thank JOE, the angles are defined mirrored to the mathematical meanings + const basegfx::B2DHomMatrix aTrans(basegfx::tools::createRotateAroundPoint(rRef.X(), rRef.Y(), -nWink * nPi180)); maPathPolygon.transform(aTrans); // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints) @@ -2393,8 +2386,7 @@ void SdrPathObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs) void SdrPathObj::NbcShear(const Point& rRefPnt, long nAngle, double fTan, FASTBOOL bVShear) { - basegfx::B2DHomMatrix aTrans; - aTrans.translate(-rRefPnt.X(), -rRefPnt.Y()); + basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-rRefPnt.X(), -rRefPnt.Y())); if(bVShear) { @@ -2415,11 +2407,10 @@ void SdrPathObj::NbcShear(const Point& rRefPnt, long nAngle, double fTan, FASTBO void SdrPathObj::NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2) { - basegfx::B2DHomMatrix aTrans; const double fDiffX(rRefPnt2.X() - rRefPnt1.X()); const double fDiffY(rRefPnt2.Y() - rRefPnt1.Y()); const double fRot(atan2(fDiffY, fDiffX)); - aTrans.translate(-rRefPnt1.X(), -rRefPnt1.Y()); + basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-rRefPnt1.X(), -rRefPnt1.Y())); aTrans.rotate(-fRot); aTrans.scale(1.0, -1.0); aTrans.rotate(fRot); @@ -3003,31 +2994,11 @@ sal_Bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx:: } // build return value matrix - rMatrix.identity(); - - if(!basegfx::fTools::equal(aScale.getX(), 1.0) || !basegfx::fTools::equal(aScale.getY(), 1.0)) - { - rMatrix.scale(aScale.getX(), aScale.getY()); - } - - if(!basegfx::fTools::equalZero(fShearX)) - { - rMatrix.shearX(tan(fShearX)); - } - - if(!basegfx::fTools::equalZero(fRotate)) - { - // #i78696# - // fRotate is from the old GeoStat and thus mathematically wrong orientated. For - // the linear combination of matrices it needed to be fixed in the API, so it needs to - // be mirrored here - rMatrix.rotate(-fRotate); - } - - if(!aTranslate.equalZero()) - { - rMatrix.translate(aTranslate.getX(), aTranslate.getY()); - } + rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale, + basegfx::fTools::equalZero(fShearX) ? 0.0 : tan(fShearX), + basegfx::fTools::equalZero(fRotate) ? 0.0 : -fRotate, + aTranslate); return sal_True; } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 7ae49a7a795a..d728e1f7edbc 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -63,17 +63,14 @@ #include <svx/editeng.hxx> #include <svl/itemiter.hxx> #include <svx/sdr/properties/textproperties.hxx> - -// #110496# #include <vcl/metaact.hxx> - -// #111111# #include <svx/sdr/contact/viewcontactoftextobj.hxx> #include <basegfx/tuple/b2dtuple.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> #include <vcl/virdev.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -737,9 +734,9 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAncho { basegfx::B2DPolyPolygon aXorPolyPolygon(TakeXorPoly()); basegfx::B2DPolyPolygon* pContourPolyPolygon = 0L; - basegfx::B2DHomMatrix aMatrix; + basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + -rAnchorRect.Left(), -rAnchorRect.Top())); - aMatrix.translate(-rAnchorRect.Left(), -rAnchorRect.Top()); if(aGeo.nDrehWink) { // Unrotate! @@ -1735,31 +1732,11 @@ sal_Bool SdrTextObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx:: } // build matrix - rMatrix.identity(); - - if(!basegfx::fTools::equal(aScale.getX(), 1.0) || !basegfx::fTools::equal(aScale.getY(), 1.0)) - { - rMatrix.scale(aScale.getX(), aScale.getY()); - } - - if(!basegfx::fTools::equalZero(fShearX)) - { - rMatrix.shearX(tan(fShearX)); - } - - if(!basegfx::fTools::equalZero(fRotate)) - { - // #i78696# - // fRotate is from the old GeoStat and thus mathematically wrong orientated. For - // the linear combination of matrices it needed to be fixed in the API, so it needs to - // be mirrored here - rMatrix.rotate(-fRotate); - } - - if(!aTranslate.equalZero()) - { - rMatrix.translate(aTranslate.getX(), aTranslate.getY()); - } + rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aScale, + basegfx::fTools::equalZero(fShearX) ? 0.0 : tan(fShearX), + basegfx::fTools::equalZero(fRotate) ? 0.0 : -fRotate, + aTranslate); return sal_False; } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 072c40c8a1f3..5ffd47f82279 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -60,6 +60,7 @@ #include <unoapi.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> #include <svx/outlobj.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> ////////////////////////////////////////////////////////////////////////////// // helpers @@ -79,32 +80,6 @@ namespace return aRetval; } - static drawinglayer::primitive2d::FontUnderline mapTextLineStyle(FontUnderline eLineStyle) - { - switch(eLineStyle) - { - case UNDERLINE_SINGLE: return drawinglayer::primitive2d::FONT_UNDERLINE_SINGLE; - case UNDERLINE_DOUBLE: return drawinglayer::primitive2d::FONT_UNDERLINE_DOUBLE; - case UNDERLINE_DOTTED: return drawinglayer::primitive2d::FONT_UNDERLINE_DOTTED; - case UNDERLINE_DASH: return drawinglayer::primitive2d::FONT_UNDERLINE_DASH; - case UNDERLINE_LONGDASH: return drawinglayer::primitive2d::FONT_UNDERLINE_LONGDASH; - case UNDERLINE_DASHDOT: return drawinglayer::primitive2d::FONT_UNDERLINE_DASHDOT; - case UNDERLINE_DASHDOTDOT: return drawinglayer::primitive2d::FONT_UNDERLINE_DASHDOTDOT; - case UNDERLINE_SMALLWAVE: return drawinglayer::primitive2d::FONT_UNDERLINE_SMALLWAVE; - case UNDERLINE_WAVE: return drawinglayer::primitive2d::FONT_UNDERLINE_WAVE; - case UNDERLINE_DOUBLEWAVE: return drawinglayer::primitive2d::FONT_UNDERLINE_DOUBLEWAVE; - case UNDERLINE_BOLD: return drawinglayer::primitive2d::FONT_UNDERLINE_BOLD; - case UNDERLINE_BOLDDOTTED: return drawinglayer::primitive2d::FONT_UNDERLINE_BOLDDOTTED; - case UNDERLINE_BOLDDASH: return drawinglayer::primitive2d::FONT_UNDERLINE_BOLDDASH; - case UNDERLINE_BOLDLONGDASH: return drawinglayer::primitive2d::FONT_UNDERLINE_BOLDLONGDASH; - case UNDERLINE_BOLDDASHDOT: return drawinglayer::primitive2d::FONT_UNDERLINE_BOLDDASHDOT; - case UNDERLINE_BOLDDASHDOTDOT: return drawinglayer::primitive2d::FONT_UNDERLINE_BOLDDASHDOTDOT; - case UNDERLINE_BOLDWAVE: return drawinglayer::primitive2d::FONT_UNDERLINE_BOLDWAVE; - // FontUnderline_FORCE_EQUAL_SIZE, UNDERLINE_DONTKNOW, UNDERLINE_NONE - default: return drawinglayer::primitive2d::FONT_UNDERLINE_NONE; - } - } - class impTextBreakupHandler { private: @@ -216,8 +191,8 @@ namespace if(rInfo.mrText.Len() && rInfo.mnTextLen) { basegfx::B2DVector aFontScaling; - drawinglayer::primitive2d::FontAttributes aFontAttributes( - drawinglayer::primitive2d::getFontAttributesFromVclFont( + drawinglayer::attribute::FontAttribute aFontAttribute( + drawinglayer::primitive2d::getFontAttributeFromVclFont( aFontScaling, rInfo.mrFont, rInfo.IsRTL(), @@ -295,6 +270,11 @@ namespace const Color aFontColor(rInfo.mrFont.GetColor()); const basegfx::BColor aBFontColor(aFontColor.getBColor()); + // prepare wordLineMode (for underline and strikeout) + // NOT for bullet texts. It is set (this may be an error by itself), but needs to be suppressed to hinder e.g. '1)' + // to be splitted which would not look like the original + const bool bWordLineMode(rInfo.mrFont.IsWordLineMode() && !rInfo.mbEndOfBullet); + // prepare new primitive drawinglayer::primitive2d::BasePrimitive2D* pNewPrimitive = 0; const bool bDecoratedIsNeeded( @@ -303,7 +283,8 @@ namespace || STRIKEOUT_NONE != rInfo.mrFont.GetStrikeout() || EMPHASISMARK_NONE != (rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_STYLE) || RELIEF_NONE != rInfo.mrFont.GetRelief() - || rInfo.mrFont.IsShadow()); + || rInfo.mrFont.IsShadow() + || bWordLineMode); if(bDecoratedIsNeeded) { @@ -315,51 +296,40 @@ namespace const basegfx::BColor aBOverlineColor((0xffffffff == aOverlineColor.GetColor()) ? aBFontColor : aOverlineColor.getBColor()); // prepare overline and underline data - const drawinglayer::primitive2d::FontUnderline eFontOverline(mapTextLineStyle(rInfo.mrFont.GetOverline())); - const drawinglayer::primitive2d::FontUnderline eFontUnderline(mapTextLineStyle(rInfo.mrFont.GetUnderline())); + const drawinglayer::primitive2d::TextLine eFontOverline( + drawinglayer::primitive2d::mapFontUnderlineToTextLine(rInfo.mrFont.GetOverline())); + const drawinglayer::primitive2d::TextLine eFontUnderline( + drawinglayer::primitive2d::mapFontUnderlineToTextLine(rInfo.mrFont.GetUnderline())); // check UndelineAbove - const bool bUnderlineAbove(drawinglayer::primitive2d::FONT_UNDERLINE_NONE != eFontUnderline && impIsUnderlineAbove(rInfo.mrFont)); + const bool bUnderlineAbove( + drawinglayer::primitive2d::TEXT_LINE_NONE != eFontUnderline && impIsUnderlineAbove(rInfo.mrFont)); // prepare strikeout data - drawinglayer::primitive2d::FontStrikeout eFontStrikeout(drawinglayer::primitive2d::FONT_STRIKEOUT_NONE); - - switch(rInfo.mrFont.GetStrikeout()) - { - case STRIKEOUT_SINGLE: eFontStrikeout = drawinglayer::primitive2d::FONT_STRIKEOUT_SINGLE; break; - case STRIKEOUT_DOUBLE: eFontStrikeout = drawinglayer::primitive2d::FONT_STRIKEOUT_DOUBLE; break; - case STRIKEOUT_BOLD: eFontStrikeout = drawinglayer::primitive2d::FONT_STRIKEOUT_BOLD; break; - case STRIKEOUT_SLASH: eFontStrikeout = drawinglayer::primitive2d::FONT_STRIKEOUT_SLASH; break; - case STRIKEOUT_X: eFontStrikeout = drawinglayer::primitive2d::FONT_STRIKEOUT_X; break; - default : break; // FontStrikeout_FORCE_EQUAL_SIZE, STRIKEOUT_NONE, STRIKEOUT_DONTKNOW - } - - // prepare wordLineMode (for underline and strikeout) - // NOT for bullet texts. It is set (this may be an error by itself), but needs to be suppressed to hinder e.g. '1)' - // to be splitted which would not look like the original - const bool bWordLineMode(rInfo.mrFont.IsWordLineMode() && !rInfo.mbEndOfBullet); + const drawinglayer::primitive2d::TextStrikeout eTextStrikeout( + drawinglayer::primitive2d::mapFontStrikeoutToTextStrikeout(rInfo.mrFont.GetStrikeout())); // prepare emphasis mark data - drawinglayer::primitive2d::FontEmphasisMark eFontEmphasisMark(drawinglayer::primitive2d::FONT_EMPHASISMARK_NONE); + drawinglayer::primitive2d::TextEmphasisMark eTextEmphasisMark(drawinglayer::primitive2d::TEXT_EMPHASISMARK_NONE); switch(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_STYLE) { - case EMPHASISMARK_DOT : eFontEmphasisMark = drawinglayer::primitive2d::FONT_EMPHASISMARK_DOT; break; - case EMPHASISMARK_CIRCLE : eFontEmphasisMark = drawinglayer::primitive2d::FONT_EMPHASISMARK_CIRCLE; break; - case EMPHASISMARK_DISC : eFontEmphasisMark = drawinglayer::primitive2d::FONT_EMPHASISMARK_DISC; break; - case EMPHASISMARK_ACCENT : eFontEmphasisMark = drawinglayer::primitive2d::FONT_EMPHASISMARK_ACCENT; break; + case EMPHASISMARK_DOT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DOT; break; + case EMPHASISMARK_CIRCLE : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_CIRCLE; break; + case EMPHASISMARK_DISC : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DISC; break; + case EMPHASISMARK_ACCENT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_ACCENT; break; } const bool bEmphasisMarkAbove(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_POS_ABOVE); const bool bEmphasisMarkBelow(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_POS_BELOW); // prepare font relief data - drawinglayer::primitive2d::FontRelief eFontRelief(drawinglayer::primitive2d::FONT_RELIEF_NONE); + drawinglayer::primitive2d::TextRelief eTextRelief(drawinglayer::primitive2d::TEXT_RELIEF_NONE); switch(rInfo.mrFont.GetRelief()) { - case RELIEF_EMBOSSED : eFontRelief = drawinglayer::primitive2d::FONT_RELIEF_EMBOSSED; break; - case RELIEF_ENGRAVED : eFontRelief = drawinglayer::primitive2d::FONT_RELIEF_ENGRAVED; break; + case RELIEF_EMBOSSED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_EMBOSSED; break; + case RELIEF_ENGRAVED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_ENGRAVED; break; default : break; // RELIEF_NONE, FontRelief_FORCE_EQUAL_SIZE } @@ -375,7 +345,7 @@ namespace rInfo.mnTextStart, rInfo.mnTextLen, aDXArray, - aFontAttributes, + aFontAttribute, rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(), aBFontColor, @@ -385,12 +355,12 @@ namespace eFontOverline, eFontUnderline, bUnderlineAbove, - eFontStrikeout, + eTextStrikeout, bWordLineMode, - eFontEmphasisMark, + eTextEmphasisMark, bEmphasisMarkAbove, bEmphasisMarkBelow, - eFontRelief, + eTextRelief, bShadow); } else @@ -402,7 +372,7 @@ namespace rInfo.mnTextStart, rInfo.mnTextLen, aDXArray, - aFontAttributes, + aFontAttribute, rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(), aBFontColor); } @@ -723,9 +693,7 @@ void SdrTextObj::impDecomposeContourTextPrimitive( // prepare contour polygon, force to non-mirrored for layouting basegfx::B2DPolyPolygon aPolyPolygon(rSdrContourTextPrimitive.getUnitPolyPolygon()); - basegfx::B2DHomMatrix aTransform; - aTransform.scale(fabs(aScale.getX()), fabs(aScale.getY())); - aPolyPolygon.transform(aTransform); + aPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(fabs(aScale.getX()), fabs(aScale.getY()))); // prepare outliner SdrOutliner& rOutliner = ImpGetDrawOutliner(); @@ -740,19 +708,17 @@ void SdrTextObj::impDecomposeContourTextPrimitive( // prepare matrices to apply to newly created primitives basegfx::B2DHomMatrix aNewTransformA; - basegfx::B2DHomMatrix aNewTransformB; // mirroring. We are now in the polygon sizes. When mirroring in X and Y, // move the null point which was top left to bottom right. const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0)); const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0)); - aNewTransformB.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); // in-between the translations of the single primitives will take place. Afterwards, // the object's transformations need to be applied - aNewTransformB.shearX(fShearX); - aNewTransformB.rotate(fRotate); - aNewTransformB.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aNewTransformB(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0, + fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); // now break up text primitives. impTextBreakupHandler aConverter(rOutliner); @@ -938,27 +904,23 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( // prepare matrices to apply to newly created primitives. aNewTransformA // will get coordinates in aOutlinerScale size and positive in X, Y. - basegfx::B2DHomMatrix aNewTransformA; - basegfx::B2DHomMatrix aNewTransformB; - - // translate relative to given primitive to get same rotation and shear + // Translate relative to given primitive to get same rotation and shear // as the master shape we are working on. For vertical, use the top-right // corner const double fStartInX(bVerticalWritintg ? aAdjustTranslate.getX() + aOutlinerScale.getX() : aAdjustTranslate.getX()); const basegfx::B2DTuple aAdjOffset(fStartInX, aAdjustTranslate.getY()); - aNewTransformA.translate(aAdjOffset.getX(), aAdjOffset.getY()); + basegfx::B2DHomMatrix aNewTransformA(basegfx::tools::createTranslateB2DHomMatrix(aAdjOffset.getX(), aAdjOffset.getY())); // mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y, // move the null point which was top left to bottom right. const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0)); const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0)); - aNewTransformB.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); // in-between the translations of the single primitives will take place. Afterwards, // the object's transformations need to be applied - aNewTransformB.shearX(fShearX); - aNewTransformB.rotate(fRotate); - aNewTransformB.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aNewTransformB(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0, + fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); // #SJ# create ClipRange (if needed)
basegfx::B2DRange aClipRange;
@@ -1018,7 +980,6 @@ void SdrTextObj::impDecomposeStretchTextPrimitive( // prepare matrices to apply to newly created primitives basegfx::B2DHomMatrix aNewTransformA; - basegfx::B2DHomMatrix aNewTransformB; // #i101957# Check for vertical text. If used, aNewTransformA // needs to translate the text initially around object width to orient @@ -1040,13 +1001,12 @@ void SdrTextObj::impDecomposeStretchTextPrimitive( // move the null point which was top left to bottom right. const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0)); const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0)); - aNewTransformB.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); // in-between the translations of the single primitives will take place. Afterwards, // the object's transformations need to be applied - aNewTransformB.shearX(fShearX); - aNewTransformB.rotate(fRotate); - aNewTransformB.translate(aTranslate.getX(), aTranslate.getY()); + const basegfx::B2DHomMatrix aNewTransformB(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0, + fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); // now break up text primitives. impTextBreakupHandler aConverter(rOutliner); diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 058d0c1a4513..6522feb7a2b8 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -366,8 +366,8 @@ namespace { const impPathTextPortion* pCandidate = rTextPortions[a]; basegfx::B2DVector aFontScaling; - const drawinglayer::primitive2d::FontAttributes aCandidateFontAttributes( - drawinglayer::primitive2d::getFontAttributesFromVclFont( + const drawinglayer::attribute::FontAttribute aCandidateFontAttribute( + drawinglayer::primitive2d::getFontAttributeFromVclFont( aFontScaling, pCandidate->getFont(), pCandidate->isRTL(), @@ -520,7 +520,7 @@ namespace nPortionIndex, nNextGlyphLen, aNewDXArray, - aCandidateFontAttributes, + aCandidateFontAttribute, pCandidate->getLocale(), aRGBShadowColor); @@ -545,7 +545,7 @@ namespace nPortionIndex, nNextGlyphLen, aNewDXArray, - aCandidateFontAttributes, + aCandidateFontAttribute, pCandidate->getLocale(), aRGBColor); diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 18840cde18e0..523eb6b4b2c3 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -40,6 +40,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <svx/svdograf.hxx> #include <svx/svddrgv.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -216,9 +217,7 @@ basegfx::B2DPolyPolygon SdrVirtObj::TakeXorPoly() const if(aAnchor.X() || aAnchor.Y()) { - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate(aAnchor.X(), aAnchor.Y()); - aPolyPolygon.transform(aMatrix); + aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(aAnchor.X(), aAnchor.Y())); } return aPolyPolygon; diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 55e0347e6522..a8cbfbb24c3d 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1831,6 +1831,12 @@ GDIMetaFile SdrPage::GetMetaFile(const SetOfByte& /*rVisibleLayers*/, FASTBOOL / return GDIMetaFile(); } +bool SdrPage::isHandoutMasterPage() const +{ + return mbMaster && GetModel() && GetModel()->GetMasterPageCount() + && GetModel()->GetMasterPage(0) == this; +} + ////////////////////////////////////////////////////////////////////////////// // sdr::Comment interface diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index e53f41251ff2..e4e515ed1613 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -64,7 +64,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrCellPrimitive2D : public BasePrimitive2D + class SdrCellPrimitive2D : public BufferedDecompositionPrimitive2D { private: basegfx::B2DHomMatrix maTransform; @@ -72,13 +72,13 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrCellPrimitive2D( const basegfx::B2DHomMatrix& rTransform, const attribute::SdrFillTextAttribute& rSdrFTAttribute) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maSdrFTAttribute(rSdrFTAttribute) { @@ -95,7 +95,7 @@ namespace drawinglayer DeclPrimitrive2DIDBlock() }; - Primitive2DSequence SdrCellPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrCellPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; @@ -132,7 +132,7 @@ namespace drawinglayer bool SdrCellPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrCellPrimitive2D& rCompare = (SdrCellPrimitive2D&)rPrimitive; @@ -155,7 +155,7 @@ namespace drawinglayer { namespace primitive2d { - class SdrBorderlinePrimitive2D : public BasePrimitive2D + class SdrBorderlinePrimitive2D : public BufferedDecompositionPrimitive2D { private: basegfx::B2DHomMatrix maTransform; @@ -173,7 +173,7 @@ namespace drawinglayer protected: // local decomposition. - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; public: SdrBorderlinePrimitive2D( @@ -187,7 +187,7 @@ namespace drawinglayer bool bRightIsOutside, bool bTopIsOutside, bool bInTwips) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), maTransform(rTransform), maLeftLine(rLeftLine), maBottomLine(rBottomLine), @@ -282,7 +282,7 @@ namespace drawinglayer return (double)nValue; } - Primitive2DSequence SdrBorderlinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const + Primitive2DSequence SdrBorderlinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence xRetval(4); sal_uInt32 nInsert(0); @@ -462,7 +462,7 @@ namespace drawinglayer bool SdrBorderlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SdrBorderlinePrimitive2D& rCompare = (SdrBorderlinePrimitive2D&)rPrimitive; diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index d09ba5d439dc..be445143fbd5 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -98,6 +98,7 @@ #include "unomaster.hxx" #include <svx/outlobj.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <vector> @@ -2516,10 +2517,7 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper if( mpModel->IsWriter() ) { Point aPoint( mpObj->GetAnchorPos() ); - - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( aPoint.X(), aPoint.Y() ); - aNewPolyPolygon.transform( aMatrix ); + aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(aPoint.X(), aPoint.Y())); } pEdgeObj->SetEdgeTrackPath( aNewPolyPolygon ); return true; @@ -2952,10 +2950,7 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper if( mpModel->IsWriter() ) { Point aPoint( mpObj->GetAnchorPos() ); - - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( -aPoint.X(), -aPoint.Y() ); - aPolyPoly.transform( aMatrix ); + aPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aPoint.X(), -aPoint.Y())); } drawing::PolyPolygonBezierCoords aRetval; SvxConvertB2DPolyPolygonToPolyPolygonBezier( aPolyPoly, aRetval); diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk index 1dffe3a953c8..070aecc308b6 100644 --- a/svx/util/makefile.mk +++ b/svx/util/makefile.mk @@ -42,10 +42,6 @@ USE_DEFFILE=TRUE .INCLUDE : settings.mk -.IF "$(OS)"=="IRIX" -LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=30 -.ENDIF - RSCLOCINC+=-I$(PRJ)$/source$/svdraw # --- Svx - DLL ---------- diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index aa20281038da..5d9b90a2f9e0 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -44,7 +44,6 @@ #include <svx/svdviter.hxx> #include <svx/svdview.hxx> #include <svx/shapepropertynotifier.hxx> -// AW, OD 2004-04-30 #i28501# #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <fmtornt.hxx> @@ -69,31 +68,17 @@ #include <txtfrm.hxx> #include <editsh.hxx> #include <docary.hxx> - -// OD 2004-02-11 #110582#-2 #include <flyfrms.hxx> - -// OD 18.06.2003 #108784# -#include <algorithm> -// OD 2004-05-24 #i28701# #include <sortedobjs.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> - -// AW: For VCOfDrawVirtObj and stuff -#ifndef _SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/sdr/contact/viewcontactofvirtobj.hxx> -#endif - -#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX #include <drawinglayer/primitive2d/transformprimitive2d.hxx> -#endif - -#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX #include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> -#endif - #include <com/sun/star/text/WritingMode2.hpp> +#include <algorithm> + using namespace ::com::sun::star; @@ -2605,9 +2590,7 @@ void SwDrawVirtObj::RecalcBoundRect() basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const { basegfx::B2DPolyPolygon aRetval(rRefObj.TakeXorPoly()); - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate(GetOffset().X(), GetOffset().Y()); - aRetval.transform(aMatrix); + aRetval.transform(basegfx::tools::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y())); return aRetval; } @@ -2615,9 +2598,7 @@ basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const basegfx::B2DPolyPolygon SwDrawVirtObj::TakeContour() const { basegfx::B2DPolyPolygon aRetval(rRefObj.TakeContour()); - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate(GetOffset().X(), GetOffset().Y()); - aRetval.transform(aMatrix); + aRetval.transform(basegfx::tools::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y())); return aRetval; } diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 15ca46ca2456..cda428f124eb 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -196,7 +196,7 @@ namespace drawinglayer { namespace primitive2d { - class SwVirtFlyDrawObjPrimitive : public BasePrimitive2D + class SwVirtFlyDrawObjPrimitive : public BufferedDecompositionPrimitive2D { private: const SwVirtFlyDrawObj& mrSwVirtFlyDrawObj; @@ -204,13 +204,13 @@ namespace drawinglayer protected: // method which is to be used to implement the local decomposition of a 2D primitive - virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: SwVirtFlyDrawObjPrimitive( const SwVirtFlyDrawObj& rSwVirtFlyDrawObj, const basegfx::B2DRange &rOuterRange) - : BasePrimitive2D(), + : BufferedDecompositionPrimitive2D(), mrSwVirtFlyDrawObj(rSwVirtFlyDrawObj), maOuterRange(rOuterRange) { @@ -239,7 +239,7 @@ namespace drawinglayer { namespace primitive2d { - Primitive2DSequence SwVirtFlyDrawObjPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence SwVirtFlyDrawObjPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { Primitive2DSequence aRetval; @@ -269,7 +269,7 @@ namespace drawinglayer bool SwVirtFlyDrawObjPrimitive::operator==(const BasePrimitive2D& rPrimitive) const { - if(BasePrimitive2D::operator==(rPrimitive)) + if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { const SwVirtFlyDrawObjPrimitive& rCompare = (SwVirtFlyDrawObjPrimitive&)rPrimitive; @@ -295,7 +295,7 @@ namespace drawinglayer getSwVirtFlyDrawObj().wrap_DoPaintObject(); // call parent - return BasePrimitive2D::get2DDecomposition(rViewInformation); + return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation); } // provide unique ID diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index f8256a7ada0b..4f1b2c1770e3 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -75,19 +75,12 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <basegfx/numeric/ftools.hxx> -// OD 2004-05-05 #i28701# +#include <algorithm> #include <fmtwrapinfluenceonobjpos.hxx> -// --> OD 2004-11-10 #i35007# #include <com/sun/star/text/TextContentAnchorType.hpp> -// <-- -// --> OD 2005-03-10 #i44334#, #i44681# -// --> OD 2007-01-03 #i73079# - use correct matrix type #include <basegfx/matrix/b2dhommatrix.hxx> -// <-- -// --> OD 2009-01-16 #i59051 +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <com/sun/star/drawing/PointSequence.hpp> -// <-- - #include <vcl/svapp.hxx> #include <slist> #include <iterator> @@ -2860,8 +2853,8 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) // apply translation difference to PolyPolygonBezier. if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 ) { - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( aTranslateDiff.X, aTranslateDiff.Y ); + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + aTranslateDiff.X, aTranslateDiff.Y)); const sal_Int32 nOuterSequenceCount(aConvertedPath.Coordinates.getLength()); drawing::PointSequence* pInnerSequence = aConvertedPath.Coordinates.getArray(); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 7ae4b209f49f..ee1055b276c9 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -270,8 +270,8 @@ void SwXText::insertString(const uno::Reference< text::XTextRange >& xTextRange, sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); } - if(pRange && pRange->GetDoc() == GetDoc() || - pCursor && pCursor->GetDoc() == GetDoc()) + if( (pRange && pRange->GetDoc() == GetDoc()) || + (pCursor && pCursor->GetDoc() == GetDoc()) ) { const SwStartNode* pOwnStartNode = GetStartNode(); if(pCursor) diff --git a/sw/source/ui/chrdlg/ccoll.cxx b/sw/source/ui/chrdlg/ccoll.cxx index 25276c2cc4bc..e0e4826a93d4 100644 --- a/sw/source/ui/chrdlg/ccoll.cxx +++ b/sw/source/ui/chrdlg/ccoll.cxx @@ -209,11 +209,7 @@ int SwCondCollItem::operator==( const SfxPoolItem& rItem) const const String& SwCondCollItem::GetStyle(USHORT nPos) const { -#ifndef IRIX return nPos < COND_COMMAND_COUNT ? sStyles[nPos] : aEmptyStr; -#else - return nPos < COND_COMMAND_COUNT ? (String)sStyles[nPos] : aEmptyStr; -#endif } /**************************************************************************** @@ -224,11 +220,7 @@ const String& SwCondCollItem::GetStyle(USHORT nPos) const void SwCondCollItem::SetStyle(const String* pStyle, USHORT nPos) { if( nPos < COND_COMMAND_COUNT ) -#ifndef IRIX sStyles[nPos] = pStyle ? *pStyle : aEmptyStr; -#else - sStyles[nPos] = pStyle ? (String)*pStyle : aEmptyStr; -#endif } diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index 3079cc855c50..77ded3905220 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -1953,7 +1953,7 @@ private: ShadowState maShadowState; protected: - virtual drawinglayer::primitive2d::Primitive2DSequence createLocalDecomposition( + virtual drawinglayer::primitive2d::Primitive2DSequence create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: @@ -1977,7 +1977,7 @@ public: DeclPrimitrive2DIDBlock() }; -drawinglayer::primitive2d::Primitive2DSequence SwPostItShadowPrimitive::createLocalDecomposition( +drawinglayer::primitive2d::Primitive2DSequence SwPostItShadowPrimitive::create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/) const { // get logic sizes in object coordinate system @@ -2140,7 +2140,7 @@ private: bool mbLineSolid : 1; protected: - virtual drawinglayer::primitive2d::Primitive2DSequence createLocalDecomposition( + virtual drawinglayer::primitive2d::Primitive2DSequence create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& rViewInformation) const; public: @@ -2179,7 +2179,7 @@ public: DeclPrimitrive2DIDBlock() }; -drawinglayer::primitive2d::Primitive2DSequence SwPostItAnkorPrimitive::createLocalDecomposition( +drawinglayer::primitive2d::Primitive2DSequence SwPostItAnkorPrimitive::create2DDecomposition( const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/) const { drawinglayer::primitive2d::Primitive2DSequence aRetval; diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 92467fe455d0..26a1253c5486 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -717,6 +717,7 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, if(!bApi) + { if(bNotFoundMessage) { InfoBox( 0, SW_RES(MSG_NOT_FOUND)).Execute(); @@ -728,6 +729,7 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, pTextView->SetSelection( TextSelection( aPaM, aPaM ) ); StartSearchAndReplace( rSearchItem, FALSE, FALSE, TRUE ); } + } } return nFound; } diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk index fc1ff731b4c4..08afadc10698 100644 --- a/sw/util/makefile.mk +++ b/sw/util/makefile.mk @@ -43,10 +43,6 @@ USE_DEFFILE=TRUE # --- Allgemein ----------------------------------------------------------- -.IF "$(OS)"=="IRIX" -LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=40 -.ENDIF - sw_res_files= \ $(SRS)$/app.srs \ $(SRS)$/dialog.srs \ diff --git a/sysui/desktop/debian/makefile.mk b/sysui/desktop/debian/makefile.mk index 1e0761198c14..cb4369763070 100644 --- a/sysui/desktop/debian/makefile.mk +++ b/sysui/desktop/debian/makefile.mk @@ -49,7 +49,7 @@ TARGET=debian .IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)" -DEBFILES=$(foreach,i,{$(PRODUCTLIST)} $(PKGDIR)$/$i3.2-$(TARGET)-menus_$(PKGVERSION.$i)-$(PKGREV)_all.deb) +DEBFILES=$(foreach,i,{$(PRODUCTLIST)} $(PKGDIR)$/$i3.3-$(TARGET)-menus_$(PKGVERSION.$i)-$(PKGREV)_all.deb) .ENDIF @@ -64,22 +64,22 @@ ALLTAR : $(DEBFILES) %/DEBIAN/control : $$(@:f) @$(MKDIRHIER) $(@:d) $*$/etc $*$/usr/share/applnk/Office $*$/usr/lib/menu - ln -sf /opt/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//)) $*$/etc$/ - /bin/sh -c -x "cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/3.2//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh" - @cat openoffice.org-debian-menus | sed -e 's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.2//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/3.2//))/' -e 's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/' -e 's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/3.2//))/' > $*$/usr/lib/menu/$(*:f:s/_/ /:1:s/3.2//) - echo "Package: $(*:f:s/_/ /:1:s/3.2//)" > $@ - cat $(@:f) | tr -d "\015" | sed "s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.2//))/" >> $@ - echo "Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/3.2//))-$(PKGREV)" >> $@ + ln -sf /opt/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//)) $*$/etc$/ + /bin/sh -c -x "cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/3.3//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh" + @cat openoffice.org-debian-menus | sed -e 's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.3//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/3.3//))/' -e 's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/' -e 's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/3.3//))/' > $*$/usr/lib/menu/$(*:f:s/_/ /:1:s/3.3//) + echo "Package: $(*:f:s/_/ /:1:s/3.3//)" > $@ + cat $(@:f) | tr -d "\015" | sed "s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.3//))/" >> $@ + echo "Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/3.3//))-$(PKGREV)" >> $@ @du -k -s $* | awk -F ' ' '{ printf "Installed-Size: %s\n", $$1 ; }' >> $@ %/DEBIAN/postinst : $$(@:f) - @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/g" > $@ + @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/g" > $@ %/DEBIAN/postrm : $$(@:f) - @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/g" > $@ + @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/g" > $@ %/DEBIAN/prerm : $$(@:f) - @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/g" > $@ + @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/g" > $@ # --- packaging --------------------------------------------------- diff --git a/sysui/desktop/productversion.mk b/sysui/desktop/productversion.mk index 7d2467d32e7e..4bb67bc50b35 100644 --- a/sysui/desktop/productversion.mk +++ b/sysui/desktop/productversion.mk @@ -50,7 +50,7 @@ PKGDIR=$(BIN) PRODUCTLIST = openoffice.org broffice.org # default values to minimize maintainance effort -PRODUCTVERSION = 3.2 +PRODUCTVERSION = 3.3 PRODUCTVERSIONSHORT = 3 PKGVERSION = $(PRODUCTVERSION) # gnome-vfs treats everything behind the last '.' as an icon extension, diff --git a/sysui/desktop/slackware/makefile.mk b/sysui/desktop/slackware/makefile.mk index ae08a3772838..8d8fc071d250 100644 --- a/sysui/desktop/slackware/makefile.mk +++ b/sysui/desktop/slackware/makefile.mk @@ -44,7 +44,7 @@ TARGET=slackware # --- Files -------------------------------------------------------- -MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.2-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz +MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.3-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz .IF "$(USE_SHELL)"=="bash" ECHOPARAM=-e @@ -67,26 +67,26 @@ $(MISC)/$(TARGET)/usr/share/applications/ : # FIXME: removal of *-extension.* only to create identical packages to OOF680 %/usr/share/applications : @$(MKDIRHIER) $@ - /bin/sh -c "cd $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.2//); DESTDIR=$(shell @cd $*; pwd) GNOMEDIR="" ICON_PREFIX=$(ICONPREFIX.$(*:b:s/-/ /:1:s/3.2//)) KDEMAINDIR=/opt/kde .$/create_tree.sh" + /bin/sh -c "cd $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//); DESTDIR=$(shell @cd $*; pwd) GNOMEDIR="" ICON_PREFIX=$(ICONPREFIX.$(*:b:s/-/ /:1:s/3.3//)) KDEMAINDIR=/opt/kde .$/create_tree.sh" $(RM) $*$/opt$/kde$/share$/icons$/*$/*$/*$/*-extension.png $(RM) $*$/opt$/kde$/share$/mimelnk$/application$/*-extension.desktop $(RM) $*$/usr$/share$/applications$/*.desktop $(RM) $*$/usr$/bin$/soffice %$/install$/doinst.sh : update-script - @echo "( cd etc ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//)) )" > $@ - @echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//)) )" >> $@ + @echo "( cd etc ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//)) )" > $@ + @echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//)) )" >> $@ @echo "( cd usr/bin ; rm -rf soffice )" >> $@ - @echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//))/program/soffice soffice )" >> $@ - @echo $(ECHOPARAM) $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.2//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//))-$i )") >> $@ + @echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/program/soffice soffice )" >> $@ + @echo $(ECHOPARAM) $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )") >> $@ @cat $< >> $@ %$/install$/slack-desc : slack-desc @$(MKDIRHIER) $(@:d) - @sed -e "s/PKGNAME/$(*:b:s/-/ /:1:s/3.2//)-$(TARGET)-menus/g" -e "s/PKGVERSION/$(PKGVERSION.$(*:b:s/-/ /:1:s/3.2//))/g" \ - -e "s/LONGPRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.2//)) $(PRODUCTVERSION.$(*:b:s/-/ /:1:s/3.2//))/g" \ - -e "s/PRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.2//))/g" \ - -e "s/UNIXFILENAME/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.2//))/g" $< > $@ + @sed -e "s/PKGNAME/$(*:b:s/-/ /:1:s/3.3//)-$(TARGET)-menus/g" -e "s/PKGVERSION/$(PKGVERSION.$(*:b:s/-/ /:1:s/3.3//))/g" \ + -e "s/LONGPRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.3//)) $(PRODUCTVERSION.$(*:b:s/-/ /:1:s/3.3//))/g" \ + -e "s/PRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.3//))/g" \ + -e "s/UNIXFILENAME/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/g" $< > $@ # needed to satisfy the slackware package tools - they need # the entries like this diff --git a/testautomation/global/system/includes/sysinfo.inc b/testautomation/global/system/includes/sysinfo.inc index eb5e91c9a459..761c8d397924 100755 --- a/testautomation/global/system/includes/sysinfo.inc +++ b/testautomation/global/system/includes/sysinfo.inc @@ -67,7 +67,6 @@ Global Const SYS_OSX = 12 Global Const SYS_PPC = 13 Global Const SYS_SCO = 14 Global Const SYS_AIX = 15 -Global Const SYS_IRI = 16 Global Const SYS_HP = 17 Global Const SYS_FBSD = 18 Global Const SYS_NBSD = 19 @@ -97,7 +96,6 @@ sub PlatFormInit '///+<TR><TD>Linux PPC</TD><TD>ppc</TD><TD>unx</TD></TR> '///+<TR><TD>SCO UNIX</TD><TD>sco</TD><TD>unx</TD></TR> '///+<TR><TD>AIX</TD><TD>aix</TD><TD>unx</TD></TR> -'///+<TR><TD>Irix</TD><TD>iri</TD><TD>unx</TD></TR> '///+<TR><TD>HP UNIX</TD><TD>hp</TD><TD>unx</TD></TR> '///+<TR><TD>FreeBSD</TD><TD>fbsd</TD><TD>unx</TD></TR> '///+<TR><TD>NetBSD</TD><TD>nbsd</TD><TD>unx</TD></TR> @@ -120,7 +118,6 @@ sub PlatFormInit PlatformName(SYS_PPC) = "Linux PPC" : PlatformExt(SYS_PPC) = "ppc" PlatFormName(SYS_SCO) = "SCO Unix" : PlatFormExt(SYS_SCO) = "sco" PlatFormName(SYS_AIX) = "AIX" : PlatFormExt(SYS_AIX) = "aix" - PlatFormName(SYS_IRI) = "IRIX" : PlatFormExt(SYS_IRI) = "iri" PlatFormName(SYS_HP) = "HP UNIX" : PlatFormExt(SYS_Hp) = "hp" PlatFormName(SYS_FBSD) = "FreeBSD" : PlatFormExt(SYS_FBSD) = "fbsd" PlatFormName(SYS_NBSD) = "NetBSD" : PlatFormExt(SYS_NBSD) = "nbsd" @@ -143,7 +140,6 @@ sub PlatFormInit PlatFormGroup(SYS_PPC) = "unx" PlatFormGroup(SYS_SCO) = "unx" PlatFormGroup(SYS_AIX) = "unx" - PlatFormGroup(SYS_IRI) = "unx" PlatFormGroup(SYS_HP) = "unx" PlatFormGroup(SYS_FBSD) = "unx" PlatFormGroup(SYS_NBSD) = "unx" @@ -221,7 +217,6 @@ sub GetToolPlatform '///+<TR><TD>Linux PPC</TD><TD>13</TD></TR> '///+<TR><TD>SCO UNIX</TD><TD>02</TD></TR> '///+<TR><TD>AIX</TD><TD>04</TD></TR> -'///+<TR><TD>Irix</TD><TD>06</TD></TR> '///+<TR><TD>HP UNIX</TD><TD>07</TD></TR> '///+<TR><TD>FreeBSD</TD><TD>08</TD></TR> '///+<TR><TD>NetBSD</TD><TD>14</TD></TR> @@ -254,7 +249,7 @@ sub GetToolPlatform qaErrorLog("The GUI-entry in '" + gTesttoolIni + "' is missing!"+Chr(13)+"Please insert the correct number for your operating system! In Section [GUI Platform], entry Current= "+Chr(13)+"Win95....: 100"+Chr(13)+"Win98....: 395"+Chr(13)+"WinNT....: 351 or 400"+Chr(13)+"WinSE....: 410"+Chr(13)+"WinME....: 490"+Chr(13)+"Win2000..: 500"+Chr(13)+"WinXP....: 501") else iGuiVersion = 01 - QAErrorLog("The GUI value in '" + gTesttoolIni + "' is missing!"+Chr(13)+"Please insert the correct number for your operating system! In Section [GUI Platform], entry Current= "+Chr(13)+"Solaris SPARC.: 01"+Chr(13)+"SCO UNIX......: 02"+Chr(13)+"Linux.........: 03"+Chr(13)+"AIX...........: 04"+Chr(13)+"Solaris x86...: 05"+Chr(13)+"Irix..........: 06"+Chr(13)+"HP-UX.........: 07"+Chr(13)+"FreeBSD........: 08"+Chr(13)+"Mac OS X......: 12"+Chr(13)+"Linux PPC.....: 13"+Chr(13)+"NetBSD.....: 14"+Chr(13)+"Linux 64 bit.....: 15"+Chr(13)+"Linux SPARC.....: 16") + QAErrorLog("The GUI value in '" + gTesttoolIni + "' is missing!"+Chr(13)+"Please insert the correct number for your operating system! In Section [GUI Platform], entry Current= "+Chr(13)+"Solaris SPARC.: 01"+Chr(13)+"SCO UNIX......: 02"+Chr(13)+"Linux.........: 03"+Chr(13)+"AIX...........: 04"+Chr(13)+"Solaris x86...: 05"+Chr(13)+"HP-UX.........: 07"+Chr(13)+"FreeBSD........: 08"+Chr(13)+"Mac OS X......: 12"+Chr(13)+"Linux PPC.....: 13"+Chr(13)+"NetBSD.....: 14"+Chr(13)+"Linux 64 bit.....: 15"+Chr(13)+"Linux SPARC.....: 16") end if end if '///Get the variable <b>gSamePC</b> @@ -302,7 +297,6 @@ sub GetToolPlatform case 03 : gSystemnummer = SYS_LIN case 04 : gSystemnummer = SYS_AIX case 05 : gSystemnummer = SYS_X86 - case 06 : gSystemnummer = SYS_IRI case 07 : gSystemnummer = SYS_HP case 08 : gSystemnummer = SYS_FBSD case 12 : gSystemnummer = SYS_OSX @@ -345,7 +339,6 @@ sub GetOfficePlatform '///+<TR><TD>Linux PPC</TD><TD>PPC</TD></TR> '///+<TR><TD>SCO UNIX</TD><TD>SCO</TD></TR> '///+<TR><TD>AIX</TD><TD>AIX</TD></TR> -'///+<TR><TD>Irix</TD><TD>IRI</TD></TR> '///+<TR><TD>HP UNIX</TD><TD>HP</TD></TR> '///+<TR><TD>FreeBSD</TD><TD>FBSD</TD></TR> '///+<TR><TD>NetBSD</TD><TD>NBSD</TD></TR> @@ -374,7 +367,6 @@ sub GetOfficePlatform case "PPC" : GUI = 13 case "SCO" : GUI = 14 case "AIX" : GUI = 15 - case "IRI" : GUI = 16 case "HP" : GUI = 17 case "FBSD" : GUI = 18 case "NBSD" : GUI = 19 diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java index 3a3c60b8146d..57582203fe2d 100644 --- a/testtools/com/sun/star/comp/bridge/TestComponent.java +++ b/testtools/com/sun/star/comp/bridge/TestComponent.java @@ -495,6 +495,10 @@ public class TestComponent { return i_Struct; } + public int testPPCAlignment( long l1, long l2, int i1, long l3, int i2 ) throws com.sun.star.uno.RuntimeException { + return i2; + } + // Attributes public boolean getBool() throws com.sun.star.uno.RuntimeException { return _bool; diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 45edf5f53392..cf286c30d16f 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -535,24 +535,28 @@ static sal_Bool performTest( bRet = check( equals( aData, aRet ) && equals( aData, aRet2 ) , "struct comparison test") && bRet; { - SmallStruct aIn(1, 2); - SmallStruct aOut = xLBT->echoSmallStruct(aIn); - bRet = check( memcmp(&aIn, &aOut, sizeof(SmallStruct)) == 0, "small struct test" ) && bRet; + SmallStruct aIn(1, 2); + SmallStruct aOut = xLBT->echoSmallStruct(aIn); + bRet = check( memcmp(&aIn, &aOut, sizeof(SmallStruct)) == 0, "small struct test" ) && bRet; } { - MediumStruct aIn(1, 2, 3, 4); - MediumStruct aOut = xLBT->echoMediumStruct(aIn); - bRet = check( memcmp(&aIn, &aOut, sizeof(MediumStruct)) == 0, "medium struct test" ) && bRet; + MediumStruct aIn(1, 2, 3, 4); + MediumStruct aOut = xLBT->echoMediumStruct(aIn); + bRet = check( memcmp(&aIn, &aOut, sizeof(MediumStruct)) == 0, "medium struct test" ) && bRet; } { - BigStruct aIn(1, 2, 3, 4, 5, 6, 7, 8); - BigStruct aOut = xLBT->echoBigStruct(aIn); - bRet = check( memcmp(&aIn, &aOut, sizeof(BigStruct)) == 0, "big struct test" ) && bRet; + BigStruct aIn(1, 2, 3, 4, 5, 6, 7, 8); + BigStruct aOut = xLBT->echoBigStruct(aIn); + bRet = check( memcmp(&aIn, &aOut, sizeof(BigStruct)) == 0, "big struct test" ) && bRet; } { - AllFloats aIn(1.1f, 2.2f, 3.3f, 4.4f); - AllFloats aOut = xLBT->echoAllFloats(aIn); - bRet = check( memcmp(&aIn, &aOut, sizeof(AllFloats)) == 0, "all floats struct test" ) && bRet; + AllFloats aIn(1.1f, 2.2f, 3.3f, 4.4f); + AllFloats aOut = xLBT->echoAllFloats(aIn); + bRet = check( memcmp(&aIn, &aOut, sizeof(AllFloats)) == 0, "all floats struct test" ) && bRet; + } + { + sal_Int32 i2 = xLBT->testPPCAlignment( 0, 0, 0, 0, 0xbeaf ); + bRet = check( i2 == 0xbeaf, "ppc-style alignment test" ) && bRet; } // Test extended attributes that raise exceptions: diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs index 2f1c9dde78f6..0801eb95274f 100644 --- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs +++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs @@ -247,6 +247,11 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2 return arg; } + public int testPPCAlignment( long l1, long l2, int i1, long l3, int i2 ) + { + return i2; + } + // Attributes public bool Bool { diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index 9a8a6508a069..f05bb8e1db2f 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -225,6 +225,8 @@ public: { return rStruct; } virtual AllFloats SAL_CALL echoAllFloats(const AllFloats& rStruct) throw(com::sun::star::uno::RuntimeException) { return rStruct; } + virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) throw(com::sun::star::uno::RuntimeException) + { return i2; } virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException) { return _aData.Bool; } diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl index 206956755ee1..be54e4e9d07e 100644 --- a/testtools/source/bridgetest/idl/bridgetest.idl +++ b/testtools/source/bridgetest/idl/bridgetest.idl @@ -269,6 +269,11 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface */ AllFloats echoAllFloats( [in] AllFloats aStruct ); + /** + * register return test 4 (i107182) + */ + long testPPCAlignment( [in] hyper l1, [in] hyper l2, [in] long i1, [in] hyper l3, [in] long i2 ); + [attribute] boolean Bool; [attribute] byte Byte; [attribute] char Char; diff --git a/tools/inc/tools/inetdef.hxx b/tools/inc/tools/inetdef.hxx index 38cd8935e06b..d9861f64961d 100644 --- a/tools/inc/tools/inetdef.hxx +++ b/tools/inc/tools/inetdef.hxx @@ -61,8 +61,6 @@ #define TOOLS_INETDEF_OS "FreeBSD/amd64" #elif defined SINIX #define TOOLS_INETDEF_OS "SINIX" -#elif defined IRIX -#define TOOLS_INETDEF_OS "IRIX" #else // AIX, HPUX, SOLARIS, ... #define TOOLS_INETDEF_OS "Unix" #endif // AIX, HPUX, SOLARIS, ... diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h index cd069886d8b6..195a6fd3ce87 100644 --- a/tools/inc/tools/solar.h +++ b/tools/inc/tools/solar.h @@ -393,8 +393,6 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); } #define __DLLEXTENSION "fi.so" #elif defined FREEBSD && defined X86_64 #define __DLLEXTENSION "fx.so" -#elif defined IRIX - #define __DLLEXTENSION "im.so" #elif defined MACOSX && defined POWERPC #define __DLLEXTENSION "mxp.dylib" #elif defined MACOSX && defined X86 diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx index 76910683df13..4a2e3c6ad76a 100644 --- a/tools/source/fsys/unx.cxx +++ b/tools/source/fsys/unx.cxx @@ -36,7 +36,7 @@ #include <stdlib.h> #include <unistd.h> #include <utime.h> -#if defined HPUX || defined LINUX || defined IRIX +#if defined HPUX || defined LINUX #include <mntent.h> #define mnttab mntent #elif defined SCO diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 7f1eb94b646d..509d2ab4969d 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1615,7 +1615,16 @@ void Polygon::Clip( const Rectangle& rRect, BOOL bPolygon ) Rectangle Polygon::GetBoundRect() const { DBG_CHKTHIS( Polygon, NULL ); - DBG_ASSERT( !mpImplPolygon->mpFlagAry, "GetBoundRect could fail with beziers!" ); + // Removing the assert. Bezier curves have the attribute that each single + // curve segment defined by four points can not exit the four-point polygon + // defined by that points. This allows to say that the curve segment can also + // never leave the Range of it's defining points. + // The result is that Polygon::GetBoundRect() may not create the minimal + // BoundRect of the Polygon (to get that, use basegfx::B2DPolygon classes), + // but will always create a valid BoundRect, at least as long as this method + // 'blindly' travels over all points, including control points. + // + // DBG_ASSERT( !mpImplPolygon->mpFlagAry, "GetBoundRect could fail with beziers!" ); USHORT nCount = mpImplPolygon->mnPoints; if( ! nCount ) diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index 5d1ba2d6927c..25126f619540 100644 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -329,8 +329,8 @@ extern "C" int NeonSession_NeonAuth( void * inUserData, #ifdef NE_FEATURE_SSPI bCanUseSystemCreds = (attempt == 0) && // avoid endless loops ne_has_support( NE_FEATURE_SSPI ) && // Windows-only feature. - ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 ) || - ( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 ); + ( ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 ) || + ( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 ) ); #endif // #i97003# (tkr): Ask XMasterPasswordHandling if we should store the diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 1c9bdda3fbdb..263a5b6e6803 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -54,6 +54,7 @@ #include "basegfx/polygon/b2dpolygon.hxx" #include "basegfx/polygon/b2dpolygontools.hxx" #include "basegfx/matrix/b2dhommatrix.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> using namespace vcl; @@ -1768,9 +1769,7 @@ BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& r GgoClosePathProc( &aGgoData ); if( mfFontScale != 1.0 ) { - basegfx::B2DHomMatrix aScale; - aScale.scale( +mfFontScale, +mfFontScale ); - rPolyPoly.transform( aScale ); + rPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(+mfFontScale, +mfFontScale)); } return true; } diff --git a/vcl/inc/vcl/cvtsvm.hxx b/vcl/inc/vcl/cvtsvm.hxx index 8a17015d99cf..c6f4f2c9a126 100644 --- a/vcl/inc/vcl/cvtsvm.hxx +++ b/vcl/inc/vcl/cvtsvm.hxx @@ -85,6 +85,10 @@ #define GDI_COMMENT_COMMENT 1031 #define GDI_UNICODE_COMMENT 1032 +#define GDI_LINEJOIN_ACTION 1033 +#define GDI_EXTENDEDPOLYGON_ACTION 1034 +#define GDI_LINEDASHDOT_ACTION 1035 + // ---------------- // - SVMConverter - // ---------------- diff --git a/vcl/inc/vcl/lineinfo.hxx b/vcl/inc/vcl/lineinfo.hxx index 60fdc3a3a0b0..33758046c41e 100644 --- a/vcl/inc/vcl/lineinfo.hxx +++ b/vcl/inc/vcl/lineinfo.hxx @@ -32,26 +32,29 @@ #define _SV_LINEINFO_HXX #include <vcl/dllapi.h> - #include <tools/gen.hxx> #include <vcl/vclenum.hxx> +#include <basegfx/vector/b2enums.hxx> // ---------------- // - ImplLineInfo - // ---------------- class SvStream; +namespace basegfx { class B2DPolyPolygon; } struct ImplLineInfo { - ULONG mnRefCount; - LineStyle meStyle; - long mnWidth; - USHORT mnDashCount; - long mnDashLen; - USHORT mnDotCount; - long mnDotLen; - long mnDistance; + ULONG mnRefCount; + LineStyle meStyle; + long mnWidth; + USHORT mnDashCount; + long mnDashLen; + USHORT mnDotCount; + long mnDotLen; + long mnDistance; + + basegfx::B2DLineJoin meLineJoin; ImplLineInfo(); ImplLineInfo( const ImplLineInfo& rImplLineInfo ); @@ -107,10 +110,26 @@ public: void SetDistance( long nDistance ); long GetDistance() const { return mpImplLineInfo->mnDistance; } + void SetLineJoin(basegfx::B2DLineJoin eLineJoin); + basegfx::B2DLineJoin GetLineJoin() const { return mpImplLineInfo->meLineJoin; } + BOOL IsDefault() const { return( !mpImplLineInfo->mnWidth && ( LINE_SOLID == mpImplLineInfo->meStyle ) ); } friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, LineInfo& rLineInfo ); friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const LineInfo& rLineInfo ); + + // helper to check if line width or DashDot is used + bool isDashDotOrFatLineUsed() const; + + // helper to get decomposed polygon data with the LineInfo applied. The source + // hairline polygon is given in io_rLinePolyPolygon. Both given polygons may + // contain results; e.g. when no fat line but DasDot is defined, the resut will + // be in io_rLinePolyPolygon while o_rFillPolyPolygon will be empty. When fat line + // is defined, it will be vice-versa. If none is defined, io_rLinePolyPolygon will + // not be changed (but o_rFillPolyPolygon will be freed) + void applyToB2DPolyPolygon( + basegfx::B2DPolyPolygon& io_rLinePolyPolygon, + basegfx::B2DPolyPolygon& o_rFillPolyPolygon) const; }; #endif // _SV_LINEINFO_HXX diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index 1e1f784f0f49..4a5b92444c21 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -562,6 +562,9 @@ public: // Helper who tries to use SalGDI's DrawPolyLine direct and returns it's bool. Contains no AA check. SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect(const basegfx::B2DPolygon& rB2DPolygon, double fLineWidth, basegfx::B2DLineJoin eLineJoin); + // Helper for line geometry paint with support for graphic expansion (pattern and fat_to_area) + void impPaintLineGeometryWithEvtlExpand(const LineInfo& rInfo, basegfx::B2DPolyPolygon aLinePolyPolygon); + protected: OutputDevice(); @@ -1088,7 +1091,12 @@ public: */ BOOL HasAlpha(); - void DrawEPS( const Point& rPt, const Size& rSz, + /** Added return value to see if EPS could be painted directly. + Theoreticaly, handing over a matrix would be needed to handle + painting rotated EPS files (e.g. contained mín Metafiles). This + would then need to be supported for Mac and PS printers, but + that's too much for now, wrote #i107046# for this */ + bool DrawEPS( const Point& rPt, const Size& rSz, const GfxLink& rGfxLink, GDIMetaFile* pSubst = NULL ); /// request XCanvas render interface for this OutputDevice diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx index 573fa7336fb0..b25feee266e4 100644 --- a/vcl/os2/source/gdi/salgdi3.cxx +++ b/vcl/os2/source/gdi/salgdi3.cxx @@ -1361,10 +1361,8 @@ BOOL Os2SalGraphics::GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& rB // rescaling needed for the PolyPolygon conversion if( rB2DPolyPoly.count() ) { - ::basegfx::B2DHomMatrix aMatrix; - aMatrix.scale( 1.0/256, 1.0/256 ); - aMatrix.scale( mfFontScale, mfFontScale ); - rB2DPolyPoly.transform( aMatrix ); + const double fFactor((1.0/256) * mfFontScale); + rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor)); } return bRet; diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 4ecb89ec5a8e..8c4b6f1a2cb2 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -88,23 +88,6 @@ void ImplReadPoly( SvStream& rIStm, Polygon& rPoly ) // ------------------------------------------------------------------------ -void ImplWritePoly( SvStream& rOStm, const Polygon& rPoly ) -{ - // #i102224# Here the evtl. curved nature of Polygon was - // ignored (for all those Years). Adapted to at least write - // a polygon representing the curve as good as possible - Polygon aSimplePoly; - rPoly.AdaptiveSubdivide(aSimplePoly); - INT32 nSize = aSimplePoly.GetSize(); - - rOStm << nSize; - - for( INT32 i = 0; i < nSize; i++ ) - rOStm << aSimplePoly[ (USHORT) i ]; -} - -// ------------------------------------------------------------------------ - void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly ) { Polygon aPoly; @@ -139,10 +122,9 @@ void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly ) // #i102224# Here the evtl. curved nature of Polygon was // ignored (for all those Years). Adapted to at least write // a polygon representing the curve as good as possible - const Polygon& rPoly = rPolyPoly[ n ]; - Polygon aSimplePoly; - rPoly.AdaptiveSubdivide(aSimplePoly); - const USHORT nSize = aSimplePoly.GetSize(); + Polygon aSimplePoly; + rPolyPoly[n].AdaptiveSubdivide(aSimplePoly); + const USHORT nSize(aSimplePoly.GetSize()); rOStm << (INT32) nSize; @@ -388,6 +370,128 @@ void ImplSkipActions( SvStream& rIStm, ULONG nSkipCount ) } } +// ------------------------------------------------------------------------ + +bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPolyPolygon, bool bOnlyWhenCurve) +{ + const sal_uInt16 nPolygonCount(rPolyPolygon.Count()); + + if(nPolygonCount) + { + sal_uInt32 nAllPolygonCount(0); + sal_uInt32 nAllPointCount(0); + sal_uInt32 nAllFlagCount(0); + sal_uInt16 a(0); + + for(a = 0; a < nPolygonCount; a++) + { + const Polygon& rCandidate = rPolyPolygon.GetObject(a); + const sal_uInt16 nPointCount(rCandidate.GetSize()); + + if(nPointCount) + { + nAllPolygonCount++; + nAllPointCount += nPointCount; + + if(rCandidate.HasFlags()) + { + nAllFlagCount += nPointCount; + } + } + } + + if((bOnlyWhenCurve && nAllFlagCount) || (!bOnlyWhenCurve && nAllPointCount)) + { + rOStm << (INT16) GDI_EXTENDEDPOLYGON_ACTION; + + const sal_Int32 nActionSize( + 4 + // Action size + 2 + // PolygonCount + (nAllPolygonCount * 2) + // Points per polygon + (nAllPointCount << 3) + // Points themselves + nAllPolygonCount + // Bool if (when poly has points) it has flags, too + nAllFlagCount); // Flags themselves + + rOStm << nActionSize; + rOStm << (sal_uInt16)nAllPolygonCount; + + for(a = 0; a < nPolygonCount; a++) + { + const Polygon& rCandidate = rPolyPolygon.GetObject(a); + const sal_uInt16 nPointCount(rCandidate.GetSize()); + + if(nPointCount) + { + rOStm << nPointCount; + + for(sal_uInt16 b(0); b < nPointCount; b++) + { + rOStm << rCandidate[b]; + } + + if(rCandidate.HasFlags()) + { + rOStm << (BYTE)true; + + for(sal_uInt16 c(0); c < nPointCount; c++) + { + rOStm << (BYTE)rCandidate.GetFlags(c); + } + } + else + { + rOStm << (BYTE)false; + } + } + } + + return true; + } + } + + return false; +} + +// ------------------------------------------------------------------------ + +void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, PolyPolygon& rPolyPoly) +{ + rPolyPoly.Clear(); + sal_uInt16 nPolygonCount(0); + rIStm >> nPolygonCount; + + for(sal_uInt16 a(0); a < nPolygonCount; a++) + { + sal_uInt16 nPointCount(0); + rIStm >> nPointCount; + Polygon aCandidate(nPointCount); + + if(nPointCount) + { + for(sal_uInt16 b(0); b < nPointCount; b++) + { + rIStm >> aCandidate[b]; + } + + BYTE bHasFlags(false); + rIStm >> bHasFlags; + + if(bHasFlags) + { + BYTE aPolyFlags(0); + + for(sal_uInt16 c(0); c < nPointCount; c++) + { + rIStm >> aPolyFlags; + aCandidate.SetFlags(c, (PolyFlags)aPolyFlags); + } + } + } + + rPolyPoly.Insert(aCandidate); + } +} + // ---------------- // - SVMConverter - // ---------------- @@ -460,6 +564,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rMtf.SetPrefSize( aPrefSz ); rMtf.SetPrefMapMode( aMapMode ); + sal_uInt32 nLastPolygonAction(0); for( INT32 i = 0L; i < nActions; i++ ) { @@ -493,6 +598,99 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) } break; + case (GDI_LINEJOIN_ACTION) : + { + INT16 nLineJoin(0); + rIStm >> nLineJoin; + aLineInfo.SetLineJoin((basegfx::B2DLineJoin)nLineJoin); + } + break; + + case (GDI_LINEDASHDOT_ACTION) : + { + INT16 a(0); + INT32 b(0); + + rIStm >> a; aLineInfo.SetDashCount(a); + rIStm >> b; aLineInfo.SetDashLen(b); + rIStm >> a; aLineInfo.SetDotCount(a); + rIStm >> b; aLineInfo.SetDotLen(b); + rIStm >> b; aLineInfo.SetDistance(b); + + if(((aLineInfo.GetDashCount() && aLineInfo.GetDashLen()) + || (aLineInfo.GetDotCount() && aLineInfo.GetDotLen())) + && aLineInfo.GetDistance()) + { + aLineInfo.SetStyle(LINE_DASH); + } + } + break; + + case (GDI_EXTENDEDPOLYGON_ACTION) : + { + // read the PolyPolygon in every case + PolyPolygon aInputPolyPolygon; + ImplReadExtendedPolyPolygonAction(rIStm, aInputPolyPolygon); + + // now check if it can be set somewhere + if(nLastPolygonAction < rMtf.GetActionCount()) + { + MetaPolyLineAction* pPolyLineAction = dynamic_cast< MetaPolyLineAction* >(rMtf.GetAction(nLastPolygonAction)); + + if(pPolyLineAction) + { + // replace MetaPolyLineAction when we have a single polygon. Do not rely on the + // same point count; the originally written GDI_POLYLINE_ACTION may have been + // Subdivided for better quality for older usages + if(1 == aInputPolyPolygon.Count()) + { + rMtf.ReplaceAction( + new MetaPolyLineAction( + aInputPolyPolygon.GetObject(0), + pPolyLineAction->GetLineInfo()), + nLastPolygonAction); + pPolyLineAction->Delete(); + } + } + else + { + MetaPolyPolygonAction* pPolyPolygonAction = dynamic_cast< MetaPolyPolygonAction* >(rMtf.GetAction(nLastPolygonAction)); + + if(pPolyPolygonAction) + { + // replace MetaPolyPolygonAction when we have a curved polygon. Do rely on the + // same sub-polygon count + if(pPolyPolygonAction->GetPolyPolygon().Count() == aInputPolyPolygon.Count()) + { + rMtf.ReplaceAction( + new MetaPolyPolygonAction( + aInputPolyPolygon), + nLastPolygonAction); + pPolyPolygonAction->Delete(); + } + } + else + { + MetaPolygonAction* pPolygonAction = dynamic_cast< MetaPolygonAction* >(rMtf.GetAction(nLastPolygonAction)); + + if(pPolygonAction) + { + // replace MetaPolygonAction + if(1 == aInputPolyPolygon.Count()) + { + rMtf.ReplaceAction( + new MetaPolygonAction( + aInputPolyPolygon.GetObject(0)), + nLastPolygonAction); + pPolygonAction->Delete(); + } + } + } + } + } + } + break; + case( GDI_RECT_ACTION ): { ImplReadRect( rIStm, aRect ); @@ -583,6 +781,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_POLYLINE_ACTION ): { ImplReadPoly( rIStm, aActionPoly ); + nLastPolygonAction = rMtf.GetActionCount(); if( bFatLine ) rMtf.AddAction( new MetaPolyLineAction( aActionPoly, aLineInfo ) ); @@ -604,7 +803,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rMtf.AddAction( new MetaPolyLineAction( aActionPoly, aLineInfo ) ); } else + { + nLastPolygonAction = rMtf.GetActionCount(); rMtf.AddAction( new MetaPolygonAction( aActionPoly ) ); + } } break; @@ -625,7 +827,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rMtf.AddAction( new MetaPolyLineAction( aPolyPoly[ nPoly ], aLineInfo ) ); } else + { + nLastPolygonAction = rMtf.GetActionCount(); rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) ); + } } break; @@ -1257,12 +1462,32 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { MetaLineAction* pAct = (MetaLineAction*) pAction; const LineInfo& rInfo = pAct->GetLineInfo(); - const BOOL bFatLine = ( !rInfo.IsDefault() && ( LINE_NONE != rInfo.GetStyle() ) ); + const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle())); + const bool bLineJoin(bFatLine && basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin()); + const bool bLineDashDot(LINE_DASH == rInfo.GetStyle()); if( bFatLine ) { ImplWritePushAction( rOStm ); ImplWriteLineColor( rOStm, rLineCol, 1, rInfo.GetWidth() ); + + if(bLineJoin) + { + rOStm << (INT16) GDI_LINEJOIN_ACTION; + rOStm << (INT32) 6; + rOStm << (INT16) rInfo.GetLineJoin(); + } + + if(bLineDashDot) + { + rOStm << (INT16) GDI_LINEDASHDOT_ACTION; + rOStm << (INT32) 4 + 16; + rOStm << (INT16)rInfo.GetDashCount(); + rOStm << (INT32)rInfo.GetDashLen(); + rOStm << (INT16)rInfo.GetDotCount(); + rOStm << (INT32)rInfo.GetDotLen(); + rOStm << (INT32)rInfo.GetDistance(); + } } rOStm << (INT16) GDI_LINE_ACTION; @@ -1275,6 +1500,16 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { ImplWritePopAction( rOStm ); nCount += 3; + + if(bLineJoin) + { + nCount += 1; + } + + if(bLineDashDot) + { + nCount += 1; + } } } break; @@ -1355,30 +1590,47 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, for( USHORT n = 0; n < nPoints; n++ ) rOStm << aChordPoly[ n ]; - nCount++; } break; case( META_POLYLINE_ACTION ): { + // #i102224# MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction; - const Polygon& rPoly = pAct->GetPolygon(); - // #i102224# Here the evtl. curved nature of Polygon was // ignored (for all those Years). Adapted to at least write // a polygon representing the curve as good as possible - Polygon aSimplePoly; - rPoly.AdaptiveSubdivide(aSimplePoly); - - const LineInfo& rInfo = pAct->GetLineInfo(); - const USHORT nPoints = aSimplePoly.GetSize(); - const BOOL bFatLine = ( !rInfo.IsDefault() && ( LINE_NONE != rInfo.GetStyle() ) ); + Polygon aSimplePoly; + pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly); + const LineInfo& rInfo = pAct->GetLineInfo(); + const USHORT nPoints(aSimplePoly.GetSize()); + const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle())); + const bool bLineJoin(bFatLine && basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin()); + const bool bLineDashDot(LINE_DASH == rInfo.GetStyle()); if( bFatLine ) { ImplWritePushAction( rOStm ); ImplWriteLineColor( rOStm, rLineCol, 1, rInfo.GetWidth() ); + + if(bLineJoin) + { + rOStm << (INT16) GDI_LINEJOIN_ACTION; + rOStm << (INT32) 6; + rOStm << (INT16) rInfo.GetLineJoin(); + } + } + + if(bLineDashDot) + { + rOStm << (INT16) GDI_LINEDASHDOT_ACTION; + rOStm << (INT32) 4 + 16; + rOStm << (INT16)rInfo.GetDashCount(); + rOStm << (INT32)rInfo.GetDashLen(); + rOStm << (INT16)rInfo.GetDotCount(); + rOStm << (INT32)rInfo.GetDotLen(); + rOStm << (INT32)rInfo.GetDistance(); } rOStm << (INT16) GDI_POLYLINE_ACTION; @@ -1386,30 +1638,45 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, rOStm << (INT32) nPoints; for( USHORT n = 0; n < nPoints; n++ ) + { rOStm << aSimplePoly[ n ]; + } nCount++; + const PolyPolygon aPolyPolygon(pAct->GetPolygon()); + if(ImplWriteExtendedPolyPolygonAction(rOStm, aPolyPolygon, true)) + { + nCount++; + } + if( bFatLine ) { ImplWritePopAction( rOStm ); nCount += 3; + + if(bLineJoin) + { + nCount += 1; + } + } + + if(bLineDashDot) + { + nCount += 1; } } break; case( META_POLYGON_ACTION ): { - MetaPolygonAction* pAct = (MetaPolygonAction*) pAction; - const Polygon& rPoly = pAct->GetPolygon(); - + MetaPolygonAction* pAct = (MetaPolygonAction*)pAction; // #i102224# Here the evtl. curved nature of Polygon was // ignored (for all those Years). Adapted to at least write // a polygon representing the curve as good as possible - Polygon aSimplePoly; - rPoly.AdaptiveSubdivide(aSimplePoly); - - const USHORT nPoints = aSimplePoly.GetSize(); + Polygon aSimplePoly; + pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly); + const USHORT nPoints(aSimplePoly.GetSize()); rOStm << (INT16) GDI_POLYGON_ACTION; rOStm << (INT32) ( 8 + ( nPoints << 3 ) ); @@ -1419,6 +1686,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, rOStm << aSimplePoly[ n ]; nCount++; + + const PolyPolygon aPolyPolygon(pAct->GetPolygon()); + if(ImplWriteExtendedPolyPolygonAction(rOStm, aPolyPolygon, true)) + { + nCount++; + } } break; @@ -1427,6 +1700,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction; ImplWritePolyPolyAction( rOStm, pAct->GetPolyPolygon() ); nCount++; + + if(ImplWriteExtendedPolyPolygonAction(rOStm, pAct->GetPolyPolygon(), true)) + { + nCount++; + } } break; diff --git a/vcl/source/gdi/implncvt.cxx b/vcl/source/gdi/implncvt.cxx deleted file mode 100644 index e59fde15b5be..000000000000 --- a/vcl/source/gdi/implncvt.cxx +++ /dev/null @@ -1,577 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: implncvt.cxx,v $ - * $Revision: 1.10.136.1 $ - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include <vcl/salbtype.hxx> -#ifndef _SV_IMPLNCVT_HXX -#include "implncvt.hxx" -#endif - -// ----------- -// - Defines - -// ----------- - -#define CURVE_LEFT 1 -#define CURVE_RIGHT 2 -#define CURVE_STRAIGHTON 3 - -// ----------------- -// - ImplFloatPoint -// ----------------- - -struct ImplFloatPoint -{ - double fX; - double fY; - - inline ImplFloatPoint() {} - inline ImplFloatPoint( const Point& rPoint ) { fX = rPoint.X(); fY = rPoint.Y(); } - inline ImplFloatPoint( double _fX, double _fY ) { fX = _fX; fY = _fY; } - inline ImplFloatPoint( const ImplFloatPoint& rPoint ) { fX = rPoint.fX; fY = rPoint.fY; } - inline ~ImplFloatPoint() {} - - void operator+=( const ImplFloatPoint& rPoint ) { fX += rPoint.fX; fY += rPoint.fY; } - void operator-=( const ImplFloatPoint& rPoint ) { fX -= rPoint.fX; fY -= rPoint.fY; } - void operator*=( const double& rD ) { fX *= rD; fY *= rD; } - BOOL operator==( const ImplFloatPoint& rPoint ) const { return ( ( rPoint.fX == fX ) && ( rPoint.fY == fY ) ); } - void operator=( const Point& rPoint ) { fX = rPoint.X(); fY = rPoint.Y(); } - - ImplFloatPoint GetOVec( const ImplFloatPoint& rPoint ) const; - ImplFloatPoint GetNVec( const ImplFloatPoint& rPoint ) const; -}; - -// ----------------------------------------------------------------------------- - -ImplFloatPoint ImplFloatPoint::GetOVec( const ImplFloatPoint& rPoint ) const -{ - double fxt = rPoint.fX - fX; - double fyt = rPoint.fY - fY; - double fL; - - if( fyt != 0.0 ) - { - fyt = -fxt / fyt; - fL = sqrt( 1 + fyt * fyt ); - - return ImplFloatPoint( 1.0 / fL, fyt / fL ); - } - else - return ImplFloatPoint( fyt, ( fxt > 0.0 ) ? 1.0 : -1.0 ); -}; - -// ----------------------------------------------------------------------------- - -ImplFloatPoint ImplFloatPoint::GetNVec( const ImplFloatPoint& rPoint ) const -{ - const double fxt = rPoint.fX - fX; - const double fyt = rPoint.fY - fY; - const double fL = hypot( fxt, fyt ); - - return ImplFloatPoint( fxt / fL, fyt / fL ); -}; - -// -------------------- -// - ImplLineConverter -// -------------------- - -ImplLineConverter::ImplLineConverter( const Polygon& rPolygon, const LineInfo& rLineInfo, const Point* pRefPoint ) : - mbRefPoint ( FALSE ), - mfWidthHalf ( rLineInfo.GetWidth() >> 1 ), - maLineInfo ( rLineInfo ), - mpFloat0 ( new ImplFloatPoint[ 6 ] ), - mpFloat1 ( new ImplFloatPoint[ 6 ] ), - mnLines ( 0 ), - mpFloatPoint ( NULL ) -{ - UINT16 nIndex, nPolySize = rPolygon.GetSize(); - if ( nPolySize ) - { - if( rPolygon.GetFlags( 0 ) == POLY_NORMAL ) - { - mpFloatPoint = new ImplFloatPoint[ nPolySize ]; - mpFloatPoint[ 0 ] = rPolygon[ 0 ]; - - nIndex = 0; - - while( ++nIndex < nPolySize ) // doppelte Punkte eliminieren und ein FloatPointArray anlegen - { - if( rPolygon.GetFlags( nIndex ) == POLY_NORMAL ) - { - double nxt = mpFloatPoint[ mnLines ].fX; - double nyt = mpFloatPoint[ mnLines ].fY; - - if ( ( nxt == rPolygon[ nIndex ].X() ) && ( nyt == rPolygon[ nIndex ].Y() ) ) - continue; - - mpFloatPoint[ ++mnLines ] = rPolygon[ nIndex ]; - } - else - { - DBG_ERROR( "Bezier points not supported!" ); - } - } - mbClosed = ( mpFloatPoint[ 0 ] == mpFloatPoint[ mnLines ] ) ; - - if ( ( mnLines == 1 ) && ( maLineInfo.GetStyle() == LINE_DASH ) ) - { - BOOL bX = mpFloatPoint[ 0 ].fY == mpFloatPoint[ 1 ].fY; - BOOL bY = mpFloatPoint[ 0 ].fX == mpFloatPoint[ 1 ].fX; - mbRefPoint = pRefPoint && ( bX || bY ); - if ( mbRefPoint ) - { - if ( !maLineInfo.GetDashCount() ) - { - maLineInfo.SetDashCount( maLineInfo.GetDotCount() ); - maLineInfo.SetDashLen( maLineInfo.GetDotLen() ); - maLineInfo.SetDotCount( 0 ); - } - INT32 nDistance = maLineInfo.GetDistance(); - INT32 nDashLen = maLineInfo.GetDashCount() * ( maLineInfo.GetDashLen() + nDistance ); - INT32 nDotLen = maLineInfo.GetDotCount() * ( maLineInfo.GetDotLen() + nDistance ); - if ( bX ) - { - if ( mpFloatPoint[ 1 ].fX > mpFloatPoint[ 0 ].fX ) - { - ImplFloatPoint aFloat = mpFloatPoint[ 0 ]; - mpFloatPoint[ 0 ] = mpFloatPoint[ 1 ]; - mpFloatPoint[ 1 ] = aFloat; - } - mnRefDistance = (INT32)mpFloatPoint[ mnLines ].fX - pRefPoint->X(); - } - else - { - if ( mpFloatPoint[ 1 ].fY > mpFloatPoint[ 0 ].fY ) - { - ImplFloatPoint aFloat = mpFloatPoint[ 0 ]; - mpFloatPoint[ 0 ] = mpFloatPoint[ 1 ]; - mpFloatPoint[ 1 ] = aFloat; - } - mnRefDistance = (INT32)mpFloatPoint[ mnLines ].fY - pRefPoint->Y(); - } - -// mnRefDistance = ( (INT32)mpFloatPoint[ mnLines ].fX - pRefPoint->X() ) + -// ( (INT32)mpFloatPoint[ mnLines ].fY - pRefPoint->Y() ); - - mnRefDistance = mnRefDistance % ( nDashLen + nDotLen ); - if ( mnRefDistance < 0 ) - mnRefDistance = ( nDashLen + nDotLen ) + mnRefDistance; - } - } - } - } -}; - -//------------------------------------------------------------------------ - -ImplLineConverter::~ImplLineConverter() -{ - delete[] mpFloat0; - delete[] mpFloat1; - delete[] mpFloatPoint; -}; - -//------------------------------------------------------------------------ - -const Polygon* ImplLineConverter::ImplGetFirst() -{ - mnFloat1Points = 0; - mnLinesAvailable = mnLines; - - if ( mnLines ) - { - if ( maLineInfo.GetStyle() == LINE_DASH ) - { - mnDashCount = maLineInfo.GetDashCount(); - mnDotCount = maLineInfo.GetDotCount(); - mfDashDotLenght = mnDashCount ? maLineInfo.GetDashLen() : maLineInfo.GetDotLen(); - - if ( mbRefPoint ) - { - INT32 nDistance = maLineInfo.GetDistance(); - INT32 nDashLen = maLineInfo.GetDashLen() + nDistance; - INT32 nDashesLen = maLineInfo.GetDashCount() * nDashLen; - INT32 nDotLen = maLineInfo.GetDotLen() + nDistance; - - if ( mnRefDistance >= nDashesLen ) - { - // get dotcount - if ( nDotLen ) - { - INT32 nLen = ( mnRefDistance - nDashesLen ) % nDotLen; - if ( nLen >= maLineInfo.GetDotLen() ) - { - mnDotCount -= 1 + ( mnRefDistance - nDashesLen ) / nDotLen; - if ( mnDotCount ) - mnDashCount = 0; - else - mnDotCount = maLineInfo.GetDotCount(); - mfDashDotLenght = 0.0; - mfDistanceLenght = ( maLineInfo.GetDotLen() + nDistance ) - nLen; - } - else - { - mnDashCount = 0; - mfDashDotLenght = maLineInfo.GetDotLen() - nLen; - mnDotCount -= ( mnRefDistance - nDashesLen ) / nDotLen; - } - } - } - else - { - if ( nDashLen ) - { - // get dashcount - INT32 nLen = mnRefDistance % nDashLen; - if ( nLen >= maLineInfo.GetDashLen() ) - { - mfDashDotLenght = 0.0; - mfDistanceLenght = ( maLineInfo.GetDashLen() + nDistance ) - nLen; - mnDashCount -= 1 + ( mnRefDistance / nDashLen ); - } - else - { - mfDashDotLenght = maLineInfo.GetDashLen() - nLen; - mnDashCount -= ( mnRefDistance / nDashLen ); - } - } - } - if ( ! ( mnDashCount | mnDotCount ) ) - { - mnDashCount = maLineInfo.GetDashCount(); - mnDotCount = maLineInfo.GetDotCount(); - } - if ( ( mfDashDotLenght == 0.0 ) && ( mfDistanceLenght == 0.0 ) ) - mfDistanceLenght = maLineInfo.GetDistance(); - } - } - } - return ImplGetNext(); -}; - -//------------------------------------------------------------------------ - -const Polygon* ImplLineConverter::ImplGetNext() -{ - while( mnFloat1Points || mnLinesAvailable ) - { - if ( maLineInfo.GetWidth() > 1 ) - { - if ( !mnFloat1Points ) - { - ImplFloatPoint aPointA( mpFloatPoint[ mnLinesAvailable-- ] ); - ImplFloatPoint aPointB( mpFloatPoint[ mnLinesAvailable ] ); - ImplFloatPoint aOVecAB( aPointA.GetOVec( aPointB ) ); - ImplFloatPoint aN1Vec( aPointA.GetNVec( aPointB ) ); - aN1Vec *= mfWidthHalf; - - if ( !mbClosed && ( ( mnLinesAvailable + 1 ) == mnLines ) ) - aPointA -= aN1Vec; - - aOVecAB *= mfWidthHalf; - mpFloat0[ 0 ] = aPointA; - mpFloat0[ 0 ] -= aOVecAB; - mpFloat0[ 3 ] = aPointA; - mpFloat0[ 3 ] += aOVecAB; - mpFloat0[ 1 ] = aPointB; - mpFloat0[ 1 ] -= aOVecAB; - mpFloat0[ 2 ] = aPointB; - mpFloat0[ 2 ] += aOVecAB; - - double f1D = ( aN1Vec.fX == 0 ) ? 1 : ( aN1Vec.fY / aN1Vec.fX ); - double f2D = -f1D; - - mnFloat0Points = 4; - - int nDirection; - - BOOL bContinues = ( mnLinesAvailable || mbClosed ); - if ( bContinues ) - { - ImplFloatPoint aPointC; - - if ( mnLinesAvailable ) - aPointC = mpFloatPoint[ mnLinesAvailable - 1 ]; - else - aPointC = mpFloatPoint[ mnLines - 1 ]; - - ImplFloatPoint aOVecBC( aPointB.GetOVec( aPointC ) ); - aOVecBC *= mfWidthHalf; - ImplFloatPoint aPointR0( aPointB ); - aPointR0 -= aOVecBC; - ImplFloatPoint aPointR1( aPointB ); - aPointR1 += aOVecBC; - ImplFloatPoint aN2Vec( aPointB.GetNVec( aPointC ) ); - aN2Vec *= mfWidthHalf; - - f2D = ( fabs( aN2Vec.fX ) < 0.00000001 ) ? 1 : ( aN2Vec.fY / aN2Vec.fX ); - if ( fabs( f1D - f2D ) < 0.00000001 ) - nDirection = CURVE_STRAIGHTON; - else - { - if ( ( aN1Vec.fX * aN2Vec.fY - aN1Vec.fY * aN2Vec.fX ) > 0 ) - nDirection = CURVE_LEFT; - else - nDirection = CURVE_RIGHT; - } - if ( nDirection != CURVE_STRAIGHTON ) - { - double fWidth; - ImplFloatPoint aDestPoint; - if ( hypot( aPointR0.fX - aPointA.fX, aPointR0.fY - aPointA.fY ) > hypot( aPointR1.fX - aPointA.fX, aPointR1.fY - aPointA.fY ) ) - aDestPoint = aPointR0; - else - aDestPoint = aPointR1; - - UINT16 nFirst = 0; - if ( aN1Vec.fY > 0 ) - { - if ( nDirection != CURVE_RIGHT ) - nFirst++; - } - else - { - if ( nDirection == CURVE_RIGHT ) - nFirst++; - } - fWidth = hypot( mpFloat0[ 1 + nFirst ].fX - aDestPoint.fX, mpFloat0[ 1 + nFirst ].fY - aDestPoint.fY ); - fWidth = sqrt( fWidth * fWidth / 2 ); - if ( fWidth > mfWidthHalf ) - { - // Spitzer Winkel : - mnFloat0Points = 6; - mpFloat0[ (4 + nFirst) ^ 1 ] = aDestPoint; - aDestPoint -= aN2Vec; - mpFloat0[ 4 + nFirst ] = aDestPoint; - mpFloat0[ 1 + nFirst ] += aN1Vec; - } - else - { - // Stumpferwinkel : Schnittpunkt wird berechnet - mnFloat0Points = 5; - ImplFloatPoint aSourcePoint; - double fX = 0; - double fY; - double fBDest = 0; - double fBSource = 0; - aSourcePoint = mpFloat0[ 1 + nFirst ]; - - int nValid = 0; - - if ( fabs( aN2Vec.fX ) < 0.00000001 ) - { - fX = aDestPoint.fX; - nValid = 1; - } - else - fBDest = aDestPoint.fY - ( aN2Vec.fY / aN2Vec.fX * aDestPoint.fX ); - - if ( fabs( aN1Vec.fX ) < 0.000000001 ) - { - fX = aSourcePoint.fX; - nValid = 2; - } - else - fBSource = aSourcePoint.fY - ( aN1Vec.fY / aN1Vec.fX * aSourcePoint.fX ); - - if ( !nValid ) - fX = ( fBSource - fBDest ) / ( aN2Vec.fY / aN2Vec.fX - aN1Vec.fY / aN1Vec.fX ); - if ( nValid < 2 ) - fY = aN1Vec.fY / aN1Vec.fX * fX + fBSource; - else - fY = aN2Vec.fY / aN2Vec.fX * fX + fBDest; - - mpFloat0[ 1 + nFirst ].fX = fX; - mpFloat0[ 1 + nFirst ].fY = fY; - mpFloat0[ 4 ] = aDestPoint; - } - } - else if ( ( aN1Vec.fX - aN2Vec.fX + aN1Vec.fY - aN2Vec.fY ) != 0 ) // besitzt zweiter Richtungsvektor die gleiche Steigung aber andere - bContinues = FALSE; // Richtung, dann wird hinten noch eine halbe Linienbreite angehaengt - } - if ( !bContinues ) - { - mpFloat0[ 1 ] += aN1Vec; - mpFloat0[ 2 ] += aN1Vec; - } - } - else - { - mnFloat0Points = mnFloat1Points; - ImplFloatPoint* pTemp = mpFloat1; - mpFloat1 = mpFloat0; - mpFloat0 = pTemp; - } - if ( maLineInfo.GetStyle() == LINE_DASH ) - { - double fLenghtDone = 0; - double fLenght = ( mfDashDotLenght > 0.0 ) ? mfDashDotLenght : mfDistanceLenght; - - double fDistance; - - fDistance = hypot( mpFloat0[ 0 ].fX - mpFloat0[ 1 ].fX, mpFloat0[ 0 ].fY - mpFloat0[ 1 ].fY ); - if ( mnFloat0Points == 5 ) - { - double fDist = hypot( mpFloat0[ 2 ].fX - mpFloat0[ 3 ].fX, mpFloat0[ 2 ].fY - mpFloat0[ 3 ].fY ); - if ( fDist < fDistance ) - fDistance = fDist; - } - - if ( fDistance > fLenght ) - { - fLenghtDone = fLenght; - - ImplFloatPoint aNVec( mpFloat0[ 0 ].GetNVec( mpFloat0[ 1 ] ) ); - aNVec *= fLenght; - mnFloat1Points = mnFloat0Points; - ImplFloatPoint* pTemp = mpFloat1; - mpFloat1 = mpFloat0; - mpFloat0 = pTemp; - mnFloat0Points = 4; - mpFloat0[ 0 ] = mpFloat0[ 1 ] = mpFloat1[ 0 ]; - mpFloat0[ 1 ] += aNVec; - mpFloat0[ 2 ] = mpFloat0[ 3 ] = mpFloat1[ 3 ]; - mpFloat0[ 2 ] += aNVec; - - mpFloat1[ 0 ] = mpFloat0[ 1 ]; - mpFloat1[ 3 ] = mpFloat0[ 2 ]; - } - else - { - mnFloat1Points = 0; - fLenghtDone = fDistance; - } - - if ( mfDashDotLenght > 0.0 ) - { // Ein Dash oder Dot wurde erzeugt - mfDashDotLenght -= fLenghtDone; - if ( mfDashDotLenght == 0.0 ) - { // Komplett erzeugt - if ( mnDashCount ) - mnDashCount--; - else - mnDotCount--; - - if ( ! ( mnDashCount | mnDotCount ) ) - { - mnDashCount = maLineInfo.GetDashCount(); - mnDotCount = maLineInfo.GetDotCount(); - } - mfDistanceLenght = maLineInfo.GetDistance(); - } - } - else - { // Das erzeugte Polygon muessen wir ignorieren - mfDistanceLenght -= fLenghtDone; - if ( mfDistanceLenght == 0.0 ) - mfDashDotLenght = ( mnDashCount ) ? maLineInfo.GetDashLen() : maLineInfo.GetDotLen(); - continue; - } - } - maPolygon.SetSize( (UINT16)mnFloat0Points ); - UINT16 i = 0; - maPolygon[ i++ ] = Point( FRound( mpFloat0[ 0 ].fX ), FRound( mpFloat0[ 0 ].fY ) ); - maPolygon[ i++ ] = Point( FRound( mpFloat0[ 1 ].fX ), FRound( mpFloat0[ 1 ].fY ) ); - if ( mnFloat0Points > 4 ) - maPolygon[ i++ ] = Point( FRound( mpFloat0[ 4 ].fX ), FRound( mpFloat0[ 4 ].fY ) ); - if ( mnFloat0Points > 5 ) - maPolygon[ i++ ] = Point( FRound( mpFloat0[ 5 ].fX ), FRound( mpFloat0[ 5 ].fY ) ); - maPolygon[ i++ ] = Point( FRound( mpFloat0[ 2 ].fX ), FRound( mpFloat0[ 2 ].fY ) ); - maPolygon[ i ] = Point( FRound( mpFloat0[ 3 ].fX ), FRound( mpFloat0[ 3 ].fY ) ); - - } - else - { - if ( !mnFloat1Points ) - { - mpFloat0[ 0 ] = mpFloatPoint[ mnLinesAvailable-- ]; - mpFloat0[ 1 ] = mpFloatPoint[ mnLinesAvailable ]; - } - else - { - mpFloat0[ 0 ] = mpFloat1[ 0 ]; - mpFloat0[ 1 ] = mpFloat1[ 1 ]; - } - if ( maLineInfo.GetStyle() == LINE_DASH ) - { - double fLenghtDone = 0; - double fLenght = ( mfDashDotLenght > 0.0 ) ? mfDashDotLenght : mfDistanceLenght; - double fDistance; - fDistance = hypot( mpFloat0[ 0 ].fX - mpFloat0[ 1 ].fX, mpFloat0[ 0 ].fY - mpFloat0[ 1 ].fY ); - if ( fDistance > fLenght ) - { - fLenghtDone = fLenght; - ImplFloatPoint aNVec( mpFloat0[ 0 ].GetNVec( mpFloat0[ 1 ] ) ); - aNVec *= fLenght; - mpFloat1[ 1 ] = mpFloat0[ 1 ]; - mpFloat0[ 1 ] = mpFloat0[ 0 ]; - mpFloat0[ 1 ] += aNVec; - mpFloat1[ 0 ] = mpFloat0[ 1 ]; - mnFloat1Points = 2; - } - else - { - mnFloat1Points = 0; - fLenghtDone = fDistance; - } - if ( mfDashDotLenght > 0.0 ) - { // Ein Dash oder Dot wurde erzeugt - mfDashDotLenght -= fLenghtDone; - if ( mfDashDotLenght == 0.0 ) - { // Komplett erzeugt - if ( mnDashCount ) - mnDashCount--; - else - mnDotCount--; - - if ( ! ( mnDashCount | mnDotCount ) ) - { - mnDashCount = maLineInfo.GetDashCount(); - mnDotCount = maLineInfo.GetDotCount(); - } - mfDistanceLenght = maLineInfo.GetDistance(); - } - } - else - { // Das erzeugte Polygon muessen wir ignorieren - mfDistanceLenght -= fLenghtDone; - if ( mfDistanceLenght == 0.0 ) - mfDashDotLenght = ( mnDashCount ) ? maLineInfo.GetDashLen() : maLineInfo.GetDotLen(); - continue; - } - } - maPolygon.SetSize( 2 ); - maPolygon[ 0 ] = Point( (long)mpFloat0[ 0 ].fX, (long)mpFloat0[ 0 ].fY ); - maPolygon[ 1 ] = Point( (long)mpFloat0[ 1 ].fX, (long)mpFloat0[ 1 ].fY ); - } - return &maPolygon; - } - return NULL; -}; diff --git a/vcl/source/gdi/implncvt.hxx b/vcl/source/gdi/implncvt.hxx deleted file mode 100644 index 2d369d12f253..000000000000 --- a/vcl/source/gdi/implncvt.hxx +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: implncvt.hxx,v $ - * $Revision: 1.5 $ - * - * 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. - * - ************************************************************************/ - -#ifndef _SV_LINECONV_HXX -#define _SV_LINECONV_HXX - -#include <tools/poly.hxx> -#include <vcl/lineinfo.hxx> - -// -------------------- -// - ImplLineConverter -// -------------------- - -struct ImplFloatPoint; - -class ImplLineConverter -{ - BOOL mbClosed; - BOOL mbRefPoint; - INT32 mnRefDistance; - - double mfWidthHalf; - LineInfo maLineInfo; - - double mfDashDotLenght; - double mfDistanceLenght; - - UINT32 mnDashCount; - UINT32 mnDotCount; - - Polygon maPolygon; - UINT32 mnFloat0Points; - ImplFloatPoint* mpFloat0; - UINT32 mnFloat1Points; - ImplFloatPoint* mpFloat1; - - UINT32 mnLinesAvailable; - UINT32 mnLines; - - ImplFloatPoint* mpFloatPoint; - - public: - - ImplLineConverter( const Polygon& rPoly, const LineInfo& rLineInfo, const Point* pRefPoint ); - ~ImplLineConverter(); - - const Polygon* ImplGetFirst(); - const Polygon* ImplGetNext(); -}; - -#endif diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx index 98f16713a145..7aa50811106b 100644 --- a/vcl/source/gdi/lineinfo.cxx +++ b/vcl/source/gdi/lineinfo.cxx @@ -34,6 +34,10 @@ #include <tools/vcompat.hxx> #include <tools/debug.hxx> #include <vcl/lineinfo.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/polygon/b2dlinegeometry.hxx> +#include <numeric> DBG_NAME( LineInfo ) @@ -49,7 +53,8 @@ ImplLineInfo::ImplLineInfo() : mnDashLen ( 0 ), mnDotCount ( 0 ), mnDotLen ( 0 ), - mnDistance ( 0 ) + mnDistance ( 0 ), + meLineJoin ( basegfx::B2DLINEJOIN_ROUND ) { } @@ -63,7 +68,8 @@ ImplLineInfo::ImplLineInfo( const ImplLineInfo& rImplLineInfo ) : mnDashLen ( rImplLineInfo.mnDashLen ), mnDotCount ( rImplLineInfo.mnDotCount ), mnDotLen ( rImplLineInfo.mnDotLen ), - mnDistance ( rImplLineInfo.mnDistance ) + mnDistance ( rImplLineInfo.mnDistance ), + meLineJoin ( rImplLineInfo.meLineJoin ) { } @@ -209,6 +215,19 @@ void LineInfo::SetDistance( long nDistance ) // ----------------------------------------------------------------------- +void LineInfo::SetLineJoin(basegfx::B2DLineJoin eLineJoin) +{ + DBG_CHKTHIS( LineInfo, NULL ); + + if(eLineJoin != mpImplLineInfo->meLineJoin) + { + ImplMakeUnique(); + mpImplLineInfo->meLineJoin = eLineJoin; + } +} + +// ----------------------------------------------------------------------- + SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo ) { VersionCompat aCompat( rIStm, STREAM_READ ); @@ -225,6 +244,12 @@ SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo ) rIStm >> rImplLineInfo.mnDistance; } + if( aCompat.GetVersion() >= 3 ) + { + // version 3 + rIStm >> nTmp16; rImplLineInfo.meLineJoin = (basegfx::B2DLineJoin) nTmp16; + } + return rIStm; } @@ -232,7 +257,7 @@ SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo ) SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 2 ); + VersionCompat aCompat( rOStm, STREAM_WRITE, 3 ); // version 1 rOStm << (UINT16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth; @@ -242,6 +267,9 @@ SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo ) rOStm << rImplLineInfo.mnDotCount << rImplLineInfo.mnDotLen; rOStm << rImplLineInfo.mnDistance; + // since version3 + rOStm << (UINT16) rImplLineInfo.meLineJoin; + return rOStm; } @@ -259,3 +287,78 @@ SvStream& operator<<( SvStream& rOStm, const LineInfo& rLineInfo ) { return( rOStm << *rLineInfo.mpImplLineInfo ); } + +// ----------------------------------------------------------------------- + +bool LineInfo::isDashDotOrFatLineUsed() const +{ + return (LINE_DASH == GetStyle() || GetWidth() > 1); +} + +// ----------------------------------------------------------------------- + +void LineInfo::applyToB2DPolyPolygon( + basegfx::B2DPolyPolygon& io_rLinePolyPolygon, + basegfx::B2DPolyPolygon& o_rFillPolyPolygon) const +{ + o_rFillPolyPolygon.clear(); + + if(io_rLinePolyPolygon.count()) + { + if(LINE_DASH == GetStyle()) + { + ::std::vector< double > fDotDashArray; + const double fDashLen(GetDashLen()); + const double fDotLen(GetDotLen()); + const double fDistance(GetDistance()); + + for(sal_uInt16 a(0); a < GetDashCount(); a++) + { + fDotDashArray.push_back(fDashLen); + fDotDashArray.push_back(fDistance); + } + + for(sal_uInt16 b(0); b < GetDotCount(); b++) + { + fDotDashArray.push_back(fDotLen); + fDotDashArray.push_back(fDistance); + } + + const double fAccumulated(::std::accumulate(fDotDashArray.begin(), fDotDashArray.end(), 0.0)); + + if(fAccumulated > 0.0) + { + basegfx::B2DPolyPolygon aResult; + + for(sal_uInt32 c(0); c < io_rLinePolyPolygon.count(); c++) + { + basegfx::B2DPolyPolygon aLineTraget; + basegfx::tools::applyLineDashing( + io_rLinePolyPolygon.getB2DPolygon(c), + fDotDashArray, + &aLineTraget); + aResult.append(aLineTraget); + } + + io_rLinePolyPolygon = aResult; + } + } + + if(GetWidth() > 1 && io_rLinePolyPolygon.count()) + { + const double fHalfLineWidth((GetWidth() * 0.5) + 0.5); + + for(sal_uInt32 a(0); a < io_rLinePolyPolygon.count(); a++) + { + o_rFillPolyPolygon.append(basegfx::tools::createAreaGeometry( + io_rLinePolyPolygon.getB2DPolygon(a), + fHalfLineWidth, + GetLineJoin())); + } + + io_rLinePolyPolygon.clear(); + } + } +} + +// ----------------------------------------------------------------------- diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk index 421505a3d500..eda537bf629a 100755 --- a/vcl/source/gdi/makefile.mk +++ b/vcl/source/gdi/makefile.mk @@ -57,7 +57,7 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \ $(SLO)$/gfxlink.obj \ $(SLO)$/print.obj \ $(SLO)$/print2.obj \ - $(SLO)$/configsettings.obj \ + $(SLO)$/configsettings.obj \ $(SLO)$/sallayout.obj \ $(SLO)$/image.obj \ $(SLO)$/impimage.obj \ @@ -75,7 +75,8 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \ $(SLO)$/impprn.obj \ $(SLO)$/gdimtf.obj \ $(SLO)$/graphictools.obj \ - $(SLO)$/textlayout.obj + $(SLO)$/textlayout.obj \ + $(SLO)$/lineinfo.obj SLOFILES= $(EXCEPTIONSFILES) \ $(SLO)$/animate.obj \ @@ -100,8 +101,6 @@ SLOFILES= $(EXCEPTIONSFILES) \ $(SLO)$/impbmp.obj \ $(SLO)$/imagerepository.obj \ $(SLO)$/impvect.obj \ - $(SLO)$/implncvt.obj \ - $(SLO)$/lineinfo.obj \ $(SLO)$/mapmod.obj \ $(SLO)$/metaact.obj \ $(SLO)$/octree.obj \ diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 82566b2b4362..1f27ad2afe7d 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -52,14 +52,6 @@ inline void ImplScalePoint( Point& rPt, double fScaleX, double fScaleY ) // ------------------------------------------------------------------------ -inline void ImplScaleSize( Size& rSz, double fScaleX, double fScaleY ) -{ - rSz.Width() = FRound( fScaleX * rSz.Width() ); - rSz.Height() = FRound( fScaleY * rSz.Height() ); -} - -// ------------------------------------------------------------------------ - inline void ImplScaleRect( Rectangle& rRect, double fScaleX, double fScaleY ) { Point aTL( rRect.TopLeft() ); @@ -69,6 +61,7 @@ inline void ImplScaleRect( Rectangle& rRect, double fScaleX, double fScaleY ) ImplScalePoint( aBR, fScaleX, fScaleY ); rRect = Rectangle( aTL, aBR ); + rRect.Justify(); } // ------------------------------------------------------------------------ @@ -85,7 +78,7 @@ inline void ImplScaleLineInfo( LineInfo& rLineInfo, double fScaleX, double fScal { if( !rLineInfo.IsDefault() ) { - const double fScale = ( fScaleX + fScaleY ) * 0.5; + const double fScale = ( fabs(fScaleX) + fabs(fScaleY) ) * 0.5; rLineInfo.SetWidth( FRound( fScale * rLineInfo.GetWidth() ) ); rLineInfo.SetDashLen( FRound( fScale * rLineInfo.GetDashLen() ) ); @@ -598,8 +591,8 @@ void MetaRoundRectAction::Move( long nHorzMove, long nVertMove ) void MetaRoundRectAction::Scale( double fScaleX, double fScaleY ) { ImplScaleRect( maRect, fScaleX, fScaleY ); - mnHorzRound = FRound( mnHorzRound * fScaleX ); - mnVertRound = FRound( mnVertRound * fScaleY ); + mnHorzRound = FRound( mnHorzRound * fabs(fScaleX) ); + mnVertRound = FRound( mnVertRound * fabs(fScaleY) ); } // ------------------------------------------------------------------------ @@ -1396,7 +1389,7 @@ void MetaTextArrayAction::Scale( double fScaleX, double fScaleY ) if ( mpDXAry && mnLen ) { for ( USHORT i = 0, nCount = mnLen; i < nCount; i++ ) - mpDXAry[ i ] = FRound( mpDXAry[ i ] * fScaleX ); + mpDXAry[ i ] = FRound( mpDXAry[ i ] * fabs(fScaleX) ); } } @@ -1524,7 +1517,7 @@ void MetaStretchTextAction::Move( long nHorzMove, long nVertMove ) void MetaStretchTextAction::Scale( double fScaleX, double fScaleY ) { ImplScalePoint( maPt, fScaleX, fScaleY ); - mnWidth = (ULONG)FRound( mnWidth * fScaleX ); + mnWidth = (ULONG)FRound( mnWidth * fabs(fScaleX) ); } // ------------------------------------------------------------------------ @@ -1717,7 +1710,7 @@ void MetaTextLineAction::Move( long nHorzMove, long nVertMove ) void MetaTextLineAction::Scale( double fScaleX, double fScaleY ) { ImplScalePoint( maPos, fScaleX, fScaleY ); - mnWidth = FRound( mnWidth * fScaleX ); + mnWidth = FRound( mnWidth * fabs(fScaleX) ); } // ------------------------------------------------------------------------ @@ -1876,8 +1869,10 @@ void MetaBmpScaleAction::Move( long nHorzMove, long nVertMove ) void MetaBmpScaleAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maPt, fScaleX, fScaleY ); - ImplScaleSize( maSz, fScaleX, fScaleY ); + Rectangle aRectangle(maPt, maSz); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maPt = aRectangle.TopLeft(); + maSz = aRectangle.GetSize(); } // ------------------------------------------------------------------------ @@ -1953,8 +1948,10 @@ void MetaBmpScalePartAction::Move( long nHorzMove, long nVertMove ) void MetaBmpScalePartAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maDstPt, fScaleX, fScaleY ); - ImplScaleSize( maDstSz, fScaleX, fScaleY ); + Rectangle aRectangle(maDstPt, maDstSz); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maDstPt = aRectangle.TopLeft(); + maDstSz = aRectangle.GetSize(); } // ------------------------------------------------------------------------ @@ -2099,8 +2096,10 @@ void MetaBmpExScaleAction::Move( long nHorzMove, long nVertMove ) void MetaBmpExScaleAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maPt, fScaleX, fScaleY ); - ImplScaleSize( maSz, fScaleX, fScaleY ); + Rectangle aRectangle(maPt, maSz); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maPt = aRectangle.TopLeft(); + maSz = aRectangle.GetSize(); } // ------------------------------------------------------------------------ @@ -2176,8 +2175,10 @@ void MetaBmpExScalePartAction::Move( long nHorzMove, long nVertMove ) void MetaBmpExScalePartAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maDstPt, fScaleX, fScaleY ); - ImplScaleSize( maDstSz, fScaleX, fScaleY ); + Rectangle aRectangle(maDstPt, maDstSz); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maDstPt = aRectangle.TopLeft(); + maDstSz = aRectangle.GetSize(); } // ------------------------------------------------------------------------ @@ -2328,8 +2329,10 @@ void MetaMaskScaleAction::Move( long nHorzMove, long nVertMove ) void MetaMaskScaleAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maPt, fScaleX, fScaleY ); - ImplScaleSize( maSz, fScaleX, fScaleY ); + Rectangle aRectangle(maPt, maSz); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maPt = aRectangle.TopLeft(); + maSz = aRectangle.GetSize(); } // ------------------------------------------------------------------------ @@ -2408,8 +2411,10 @@ void MetaMaskScalePartAction::Move( long nHorzMove, long nVertMove ) void MetaMaskScalePartAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maDstPt, fScaleX, fScaleY ); - ImplScaleSize( maDstSz, fScaleX, fScaleY ); + Rectangle aRectangle(maDstPt, maDstSz); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maDstPt = aRectangle.TopLeft(); + maDstSz = aRectangle.GetSize(); } // ------------------------------------------------------------------------ @@ -3498,9 +3503,9 @@ MetaAction* MetaFontAction::Clone() void MetaFontAction::Scale( double fScaleX, double fScaleY ) { - Size aSize( maFont.GetSize() ); - - ImplScaleSize( aSize, fScaleX, fScaleY ); + const Size aSize( + FRound(maFont.GetSize().Width() * fabs(fScaleX)), + FRound(maFont.GetSize().Height() * fabs(fScaleY))); maFont.SetSize( aSize ); } @@ -3791,14 +3796,18 @@ MetaAction* MetaFloatTransparentAction::Clone() void MetaFloatTransparentAction::Move( long nHorzMove, long nVertMove ) { maPoint.Move( nHorzMove, nVertMove ); + maMtf.Move(nHorzMove, nVertMove); } // ------------------------------------------------------------------------ void MetaFloatTransparentAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maPoint, fScaleX, fScaleY ); - ImplScaleSize( maSize, fScaleX, fScaleY ); + Rectangle aRectangle(maPoint, maSize); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maPoint = aRectangle.TopLeft(); + maSize = aRectangle.GetSize(); + maMtf.Scale(fScaleX, fScaleY); } // ------------------------------------------------------------------------ @@ -3872,8 +3881,10 @@ void MetaEPSAction::Move( long nHorzMove, long nVertMove ) void MetaEPSAction::Scale( double fScaleX, double fScaleY ) { - ImplScalePoint( maPoint, fScaleX, fScaleY ); - ImplScaleSize( maSize, fScaleX, fScaleY ); + Rectangle aRectangle(maPoint, maSize); + ImplScaleRect( aRectangle, fScaleX, fScaleY ); + maPoint = aRectangle.TopLeft(); + maSize = aRectangle.GetSize(); } // ------------------------------------------------------------------------ diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index 6298ff51a16a..91ea8419cba9 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -56,7 +56,6 @@ #include <vcl/gdimtf.hxx> #include <vcl/outdata.hxx> #include <vcl/print.hxx> -#include <implncvt.hxx> #include <vcl/outdev.h> #include <vcl/outdev.hxx> #include <vcl/unowrap.hxx> @@ -77,6 +76,8 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <vcl/unohelp.hxx> +#include <numeric> + using namespace ::com::sun::star; DBG_NAME( OutputDevice ) @@ -2330,6 +2331,130 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) // ----------------------------------------------------------------------- +void OutputDevice::impPaintLineGeometryWithEvtlExpand( + const LineInfo& rInfo, + basegfx::B2DPolyPolygon aLinePolyPolygon) +{ + const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) + && mpGraphics->supportsOperation(OutDevSupport_B2DDraw) + && ROP_OVERPAINT == GetRasterOp() + && IsLineColor()); + basegfx::B2DPolyPolygon aFillPolyPolygon; + const bool bDashUsed(LINE_DASH == rInfo.GetStyle()); + const bool bLineWidthUsed(rInfo.GetWidth() > 1); + + if(bDashUsed && aLinePolyPolygon.count()) + { + ::std::vector< double > fDotDashArray; + const double fDashLen(rInfo.GetDashLen()); + const double fDotLen(rInfo.GetDotLen()); + const double fDistance(rInfo.GetDistance()); + + for(sal_uInt16 a(0); a < rInfo.GetDashCount(); a++) + { + fDotDashArray.push_back(fDashLen); + fDotDashArray.push_back(fDistance); + } + + for(sal_uInt16 b(0); b < rInfo.GetDotCount(); b++) + { + fDotDashArray.push_back(fDotLen); + fDotDashArray.push_back(fDistance); + } + + const double fAccumulated(::std::accumulate(fDotDashArray.begin(), fDotDashArray.end(), 0.0)); + + if(fAccumulated > 0.0) + { + basegfx::B2DPolyPolygon aResult; + + for(sal_uInt32 c(0); c < aLinePolyPolygon.count(); c++) + { + basegfx::B2DPolyPolygon aLineTraget; + basegfx::tools::applyLineDashing( + aLinePolyPolygon.getB2DPolygon(c), + fDotDashArray, + &aLineTraget); + aResult.append(aLineTraget); + } + + aLinePolyPolygon = aResult; + } + } + + if(bLineWidthUsed && aLinePolyPolygon.count()) + { + const double fHalfLineWidth((rInfo.GetWidth() * 0.5) + 0.5); + + for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) + { + aFillPolyPolygon.append(basegfx::tools::createAreaGeometry( + aLinePolyPolygon.getB2DPolygon(a), + fHalfLineWidth, + rInfo.GetLineJoin())); + } + + aLinePolyPolygon.clear(); + } + + GDIMetaFile* pOldMetaFile = mpMetaFile; + mpMetaFile = NULL; + + if(aLinePolyPolygon.count()) + { + for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) + { + const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); + bool bDone(false); + + if(bTryAA) + { + bDone = mpGraphics->DrawPolyLine(aCandidate, basegfx::B2DVector(1.0, 1.0), basegfx::B2DLINEJOIN_NONE, this); + } + + if(!bDone) + { + const Polygon aPolygon(aCandidate); + mpGraphics->DrawPolyLine(aPolygon.GetSize(), (const SalPoint*)aPolygon.GetConstPointAry(), this); + } + } + } + + if(aFillPolyPolygon.count()) + { + const Color aOldLineColor( maLineColor ); + const Color aOldFillColor( maFillColor ); + + SetLineColor(); + ImplInitLineColor(); + SetFillColor( aOldLineColor ); + ImplInitFillColor(); + + bool bDone(false); + + if(bTryAA) + { + bDone = mpGraphics->DrawPolyPolygon(aFillPolyPolygon, 0.0, this); + } + + if(!bDone) + { + for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++) + { + const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a)); + mpGraphics->DrawPolygon(aPolygon.GetSize(), (const SalPoint*)aPolygon.GetConstPointAry(), this); + } + } + + SetFillColor( aOldFillColor ); + SetLineColor( aOldLineColor ); + } + + mpMetaFile = pOldMetaFile; +} + +// ----------------------------------------------------------------------- + void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt, const LineInfo& rLineInfo ) { @@ -2357,47 +2482,22 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt, if ( mbOutputClipped ) return; + const Point aStartPt( ImplLogicToDevicePixel( rStartPt ) ); + const Point aEndPt( ImplLogicToDevicePixel( rEndPt ) ); const LineInfo aInfo( ImplLogicToDevicePixel( rLineInfo ) ); + const bool bDashUsed(LINE_DASH == aInfo.GetStyle()); + const bool bLineWidthUsed(aInfo.GetWidth() > 1); - if( ( aInfo.GetWidth() > 1L ) || ( LINE_DASH == aInfo.GetStyle() ) ) + if(bDashUsed || bLineWidthUsed) { - Polygon aPoly( 2 ); aPoly[ 0 ] = rStartPt; aPoly[ 1 ] = rEndPt; - GDIMetaFile* pOldMetaFile = mpMetaFile; - ImplLineConverter aLineCvt( ImplLogicToDevicePixel( aPoly ), aInfo, ( mbRefPoint ) ? &maRefPoint : NULL ); - - mpMetaFile = NULL; + basegfx::B2DPolygon aLinePolygon; + aLinePolygon.append(basegfx::B2DPoint(aStartPt.X(), aStartPt.Y())); + aLinePolygon.append(basegfx::B2DPoint(aEndPt.X(), aEndPt.Y())); - if ( aInfo.GetWidth() > 1 ) - { - const Color aOldLineColor( maLineColor ); - const Color aOldFillColor( maFillColor ); - - SetLineColor(); - ImplInitLineColor(); - SetFillColor( aOldLineColor ); - ImplInitFillColor(); - - for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() ) - mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->GetConstPointAry(), this ); - - SetFillColor( aOldFillColor ); - SetLineColor( aOldLineColor ); - } - else - { - if ( mbInitLineColor ) - ImplInitLineColor(); - - for ( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() ) - mpGraphics->DrawLine( (*pPoly)[ 0 ].X(), (*pPoly)[ 0 ].Y(), (*pPoly)[ 1 ].X(), (*pPoly)[ 1 ].Y(), this ); - } - mpMetaFile = pOldMetaFile; + impPaintLineGeometryWithEvtlExpand(aInfo, basegfx::B2DPolyPolygon(aLinePolygon)); } else { - const Point aStartPt( ImplLogicToDevicePixel( rStartPt ) ); - const Point aEndPt( ImplLogicToDevicePixel( rEndPt ) ); - if ( mbInitLineColor ) ImplInitLineColor(); @@ -2546,7 +2646,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && LINE_SOLID == rLineInfo.GetStyle()) { - DrawPolyLine(rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), basegfx::B2DLINEJOIN_ROUND); + DrawPolyLine(rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin()); return; } @@ -2558,7 +2658,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo) { - USHORT nPoints = rPoly.GetSize(); + USHORT nPoints(rPoly.GetSize()); if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() ) return; @@ -2566,11 +2666,19 @@ void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineI Polygon aPoly = ImplLogicToDevicePixel( rPoly ); // #100127# LineInfo is not curve-safe, subdivide always - if( aPoly.HasFlags() ) - { - aPoly = ImplSubdivideBezier( aPoly ); - nPoints = aPoly.GetSize(); - } + // + // What shall this mean? It's wrong to subdivide here when the + // polygon is a fat line. In that case, the painted geometry + // WILL be much different. + // I also have no idea how this could be related to the given ID + // which reads 'consolidate boost versions' in the task description. + // Removing. + // + //if( aPoly.HasFlags() ) + //{ + // aPoly = ImplSubdivideBezier( aPoly ); + // nPoints = aPoly.GetSize(); + //} // we need a graphics if ( !mpGraphics && !ImplGetGraphics() ) @@ -2582,67 +2690,29 @@ void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineI if ( mbOutputClipped ) return; - const LineInfo aInfo( ImplLogicToDevicePixel( rLineInfo ) ); - const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) - && mpGraphics->supportsOperation(OutDevSupport_B2DDraw) - && ROP_OVERPAINT == GetRasterOp() - && IsLineColor()); - - if( aInfo.GetWidth() > 1L ) - { - const Color aOldLineColor( maLineColor ); - const Color aOldFillColor( maFillColor ); - GDIMetaFile* pOldMetaFile = mpMetaFile; - ImplLineConverter aLineCvt( aPoly, aInfo, ( mbRefPoint ) ? &maRefPoint : NULL ); - - mpMetaFile = NULL; - SetLineColor(); + if ( mbInitLineColor ) ImplInitLineColor(); - SetFillColor( aOldLineColor ); - ImplInitFillColor(); - bool bDone(false); - if(bTryAA) - { - // #i101491# try AAed version - // Use old on-the-fly geometry preparation, combine with AA - bool bSuccess(true); - - for(const Polygon* pPoly = aLineCvt.ImplGetFirst(); bSuccess && pPoly; pPoly = aLineCvt.ImplGetNext()) - { - bSuccess = mpGraphics->DrawPolyPolygon(basegfx::B2DPolyPolygon(pPoly->getB2DPolygon()), 0.0, this); - } - - if(bSuccess) - { - bDone = true; - } - } - - if(!bDone) - { - for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() ) - { - mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->GetConstPointAry(), this ); - } - } + const LineInfo aInfo( ImplLogicToDevicePixel( rLineInfo ) ); + const bool bDashUsed(LINE_DASH == aInfo.GetStyle()); + const bool bLineWidthUsed(aInfo.GetWidth() > 1); - SetLineColor( aOldLineColor ); - SetFillColor( aOldFillColor ); - mpMetaFile = pOldMetaFile; + if(bDashUsed || bLineWidthUsed) + { + impPaintLineGeometryWithEvtlExpand(aInfo, basegfx::B2DPolyPolygon(aPoly.getB2DPolygon())); } else { - if ( mbInitLineColor ) - ImplInitLineColor(); - if ( LINE_DASH == aInfo.GetStyle() ) + // #100127# the subdivision HAS to be done here since only a pointer + // to an array of points is given to the DrawPolyLine method, there is + // NO way to find out there that it's a curve. + if( aPoly.HasFlags() ) { - ImplLineConverter aLineCvt( aPoly, aInfo, ( mbRefPoint ) ? &maRefPoint : NULL ); - for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() ) - mpGraphics->DrawPolyLine( pPoly->GetSize(), (const SalPoint*)pPoly->GetConstPointAry(), this ); + aPoly = ImplSubdivideBezier( aPoly ); + nPoints = aPoly.GetSize(); } - else - mpGraphics->DrawPolyLine( nPoints, (const SalPoint*) aPoly.GetConstPointAry(), this ); + + mpGraphics->DrawPolyLine(nPoints, (const SalPoint*)aPoly.GetConstPointAry(), this); } if( mpAlphaVDev ) @@ -3047,7 +3117,12 @@ void OutputDevice::DrawPolyLine( SetFillColor(aOldLineColor); ImplInitFillColor(); - ImpDrawPolyPolygonWithB2DPolyPolygon(aAreaPolyPolygon); + // draw usig a loop; else the topology will paint a PolyPolygon + for(sal_uInt32 a(0); a < aAreaPolyPolygon.count(); a++) + { + ImpDrawPolyPolygonWithB2DPolyPolygon( + basegfx::B2DPolyPolygon(aAreaPolyPolygon.getB2DPolygon(a))); + } SetLineColor(aOldLineColor); ImplInitLineColor(); @@ -3064,14 +3139,15 @@ void OutputDevice::DrawPolyLine( } } } - - // fallback to old polygon drawing if needed. This will really - // use ImplLineConverter, but still try to AA lines - const Polygon aToolsPolygon( rB2DPolygon ); - LineInfo aLineInfo; - if( fLineWidth != 0.0 ) - aLineInfo.SetWidth( static_cast<long>(fLineWidth+0.5) ); - ImpDrawPolyLineWithLineInfo( aToolsPolygon, aLineInfo ); + else + { + // fallback to old polygon drawing if needed + const Polygon aToolsPolygon( rB2DPolygon ); + LineInfo aLineInfo; + if( fLineWidth != 0.0 ) + aLineInfo.SetWidth( static_cast<long>(fLineWidth+0.5) ); + ImpDrawPolyLineWithLineInfo( aToolsPolygon, aLineInfo ); + } } // ----------------------------------------------------------------------- diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 79986988afd7..2d436ea43659 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -1158,9 +1158,11 @@ void OutputDevice::ImplDraw2ColorFrame( const Rectangle& rRect, // ----------------------------------------------------------------------- -void OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, +bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, const GfxLink& rGfxLink, GDIMetaFile* pSubst ) { + bool bDrawn(true); + if ( mpMetaFile ) { GDIMetaFile aSubst; @@ -1172,20 +1174,20 @@ void OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, } if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() ) - return; + return bDrawn; if( mbOutputClipped ) - return; + return bDrawn; Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) ); + if( !aRect.IsEmpty() ) { // draw the real EPS graphics - bool bDrawn = FALSE; if( rGfxLink.GetData() && rGfxLink.GetDataSize() ) { if( !mpGraphics && !ImplGetGraphics() ) - return; + return bDrawn; if( mbInitClipRegion ) ImplInitClipRegion(); @@ -1208,4 +1210,6 @@ void OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, if( mpAlphaVDev ) mpAlphaVDev->DrawEPS( rPoint, rSize, rGfxLink, pSubst ); + + return bDrawn; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 4146f1764204..c0205f1f325d 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -61,11 +61,9 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/util/URL.hpp> - -#include "implncvt.hxx" - #include "cppuhelper/implbase1.hxx" #include <icc/sRGB-IEC61966-2.1.hxx> +#include <vcl/lineinfo.hxx> using namespace vcl; using namespace rtl; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 66865759db4b..fefbf8cdcb08 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -49,6 +49,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/range/b2drange.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> // ======================================================================= // @@ -1303,9 +1304,7 @@ void Region::Move( long nHorzMove, long nVertMove ) mpImplRegion->mpPolyPoly->Move( nHorzMove, nVertMove ); else if( mpImplRegion->mpB2DPolyPoly ) { - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( nHorzMove, nVertMove ); - mpImplRegion->mpB2DPolyPoly->transform( aTransform ); + mpImplRegion->mpB2DPolyPoly->transform(basegfx::tools::createTranslateB2DHomMatrix(nHorzMove, nVertMove)); } else { @@ -1346,9 +1345,7 @@ void Region::Scale( double fScaleX, double fScaleY ) mpImplRegion->mpPolyPoly->Scale( fScaleX, fScaleY ); else if( mpImplRegion->mpB2DPolyPoly ) { - ::basegfx::B2DHomMatrix aTransform; - aTransform.scale( fScaleX, fScaleY ); - mpImplRegion->mpB2DPolyPoly->transform( aTransform ); + mpImplRegion->mpB2DPolyPoly->transform(basegfx::tools::createScaleB2DHomMatrix(fScaleX, fScaleY)); } else { diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 1e9572887e0b..c1f987377c67 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -52,7 +52,6 @@ #include <vcl/gdimtf.hxx> #include <vcl/outdata.hxx> #include <vcl/print.hxx> -#include <implncvt.hxx> #include <vcl/outdev.h> #include <vcl/outdev.hxx> #include <vcl/unowrap.hxx> diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 1f44b823ce44..c8748c65e2d3 100755 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -44,6 +44,7 @@ #include <vcl/sallayout.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <i18npool/lang.h> #ifndef _TL_DEBUG_HXX @@ -893,10 +894,8 @@ bool SalLayout::GetOutline( SalGraphics& rSalGraphics, { if( aPos.X() || aPos.Y() ) { - ::basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( aPos.X(), aPos.Y() ); - aGlyphOutline.transform( aMatrix ); - } + aGlyphOutline.transform(basegfx::tools::createTranslateB2DHomMatrix(aPos.X(), aPos.Y())); + } // insert outline at correct position rVector.push_back( aGlyphOutline ); diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index 18857b94af8f..b92bea929c51 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -43,6 +43,7 @@ #include "tools/poly.hxx" #include "basegfx/matrix/b2dhommatrix.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "basegfx/polygon/b2dpolypolygon.hxx" #include "osl/file.hxx" @@ -2282,9 +2283,7 @@ bool FreetypeServerFont::GetGlyphOutline( int nGlyphIndex, // convert to basegfx polypolygon // TODO: get rid of the intermediate tools polypolygon rB2DPolyPoly = aToolPolyPolygon.getB2DPolyPolygon(); - ::basegfx::B2DHomMatrix aMatrix; - aMatrix.scale( +1.0/(1<<6), -1.0/(1<<6) ); - rB2DPolyPoly.transform( aMatrix ); + rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix( +1.0/(1<<6), -1.0/(1<<6) )); return true; } diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx index e3e840e40730..17e70c539254 100644 --- a/vcl/source/glyphs/glyphcache.cxx +++ b/vcl/source/glyphs/glyphcache.cxx @@ -79,9 +79,7 @@ GlyphCache::~GlyphCache() // ----------------------------------------------------------------------- -#ifndef IRIX inline -#endif size_t GlyphCache::IFSD_Hash::operator()( const ImplFontSelectData& rFontSelData ) const { // TODO: is it worth to improve this hash function? diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h index cdf45fd30867..c1fee6c68d94 100644 --- a/vcl/unx/inc/salunx.h +++ b/vcl/unx/inc/salunx.h @@ -38,12 +38,6 @@ #include <time.h> #include <sys/time.h> #include <strings.h> -#elif defined IRIX -#ifdef __cplusplus -#include <ctime> -#endif -#include <sys/time.h> -#include <unistd.h> #endif #include <svunx.h> #include <salstd.hxx> diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx index cacffbcfdbb1..bb8f86d93e01 100644 --- a/vcl/unx/source/app/i18n_ic.cxx +++ b/vcl/unx/source/app/i18n_ic.cxx @@ -340,7 +340,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : if ( mnPreeditStyle != XIMPreeditNone ) { -#if defined LINUX || defined FREEBSD || defined NETBSD || defined IRIX +#if defined LINUX || defined FREEBSD || defined NETBSD if ( mpPreeditAttributes != NULL ) #endif mpAttributes = XVaAddToNestedList( mpAttributes, @@ -348,7 +348,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : } if ( mnStatusStyle != XIMStatusNone ) { -#if defined LINUX || defined FREEBSD || defined NETBSD || defined IRIX +#if defined LINUX || defined FREEBSD || defined NETBSD if ( mpStatusAttributes != NULL ) #endif mpAttributes = XVaAddToNestedList( mpAttributes, diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx index ae472d6323f4..0a48c054167f 100644 --- a/vcl/unx/source/app/i18n_im.cxx +++ b/vcl/unx/source/app/i18n_im.cxx @@ -59,7 +59,7 @@ using namespace vcl; #include "i18n_cb.hxx" -#if defined(SOLARIS) || defined(LINUX) || defined(IRIX) +#if defined(SOLARIS) || defined(LINUX) extern "C" char * XSetIMValues(XIM im, ...); #endif diff --git a/vcl/unx/source/app/randrwrapper.cxx b/vcl/unx/source/app/randrwrapper.cxx index 8d01b64d4680..4fbe5db97ab9 100644 --- a/vcl/unx/source/app/randrwrapper.cxx +++ b/vcl/unx/source/app/randrwrapper.cxx @@ -161,7 +161,13 @@ RandRWrapper::RandRWrapper( Display* pDisplay ) : if( ! m_bValid ) { rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libXrandr.so.2" ) ); - m_pRandRLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT ); + // load and resolve dependencies immediately + // rationale: there are older distributions where libXrandr.so.2 is not linked + // with libXext.so, resulting in a missing symbol and terminating the office + // obviously they expected libXext to be linked in global symbolspace (that is + // linked by the application), which is not the case with us (because we want + // to be able to run in headless mode even without an installed X11 library) + m_pRandRLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT | SAL_LOADMODULE_NOW ); initFromModule(); } if( m_bValid ) diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 07955d426b8c..cfd568ac9b6c 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -38,16 +38,13 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> -#if defined(IRIX) -#include <ctime> -#endif #include <sys/time.h> #include <pthread.h> #include <unistd.h> #include <ctype.h> #include <string.h> -#if defined(SOLARIS) || defined(IRIX) +#if defined(SOLARIS) #include <sal/alloca.h> #include <osl/module.h> #endif @@ -898,7 +895,7 @@ void SalDisplay::Init() sscanf( pProperties, "%li", &nProperties_ ); else { -#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || defined IRIX +#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD nProperties_ |= PROPERTY_FEATURE_Maximize; #endif // Server Bugs & Properties diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx index bf8aa202b066..afcecc0d0667 100644 --- a/vcl/unx/source/app/saltimer.cxx +++ b/vcl/unx/source/app/saltimer.cxx @@ -32,9 +32,6 @@ #include "precompiled_vcl.hxx" #include <stdio.h> -#if defined(IRIX) -#include <ctime> -#endif #include <sys/time.h> #include <sys/times.h> #include <time.h> diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index cb554bccea21..5fe2295a8fed 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -50,6 +50,7 @@ #include "basegfx/polygon/b2dpolygonclipper.hxx" #include "basegfx/polygon/b2dlinegeometry.hxx" #include "basegfx/matrix/b2dhommatrix.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "basegfx/polygon/b2dpolypolygoncutter.hxx" #include <vector> @@ -1567,6 +1568,9 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const : // the used basegfx::tools::createAreaGeometry is simply too // expensive with very big polygons; fallback to caller (who // should use ImplLineConverter normally) + // AW: ImplLineConverter had to be removed since it does not even + // know LineJoins, so the fallback will now prepare the line geometry + // the same way. return false; } const XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); @@ -1579,9 +1583,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const : && !basegfx::fTools::equalZero( rLineWidth.getY() ) ) { // prepare for createAreaGeometry() with anisotropic linewidth - basegfx::B2DHomMatrix aAnisoMatrix; - aAnisoMatrix.scale( 1.0, rLineWidth.getX() / rLineWidth.getY() ); - aPolygon.transform( aAnisoMatrix ); + aPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(1.0, rLineWidth.getX() / rLineWidth.getY())); } // special handling for hairlines to improve the drawing performance @@ -1603,9 +1605,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const : && !basegfx::fTools::equalZero( rLineWidth.getX() ) ) { // postprocess createAreaGeometry() for anisotropic linewidth - basegfx::B2DHomMatrix aAnisoMatrix; - aAnisoMatrix.scale( 1.0, rLineWidth.getY() / rLineWidth.getX() ); - aPolygon.transform( aAnisoMatrix ); + aPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(1.0, rLineWidth.getY() / rLineWidth.getX())); } // temporarily adjust brush color to pen color diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index b3e5b4667a6a..53cd662db8e0 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -441,7 +441,7 @@ void PrinterInfoManager::initialize() * porters: please append your platform to the Solaris * case if your platform has SystemV printing per default. */ - #if defined SOLARIS || defined(IRIX) + #if defined SOLARIS aValue = "lp"; #else aValue = "lpr"; diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index d82830a9022f..12fdad65dfb1 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -65,6 +65,7 @@ #include "basegfx/polygon/b2dpolygon.hxx" #include "basegfx/polygon/b2dpolypolygon.hxx" #include "basegfx/matrix/b2dhommatrix.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "sft.hxx" @@ -2480,9 +2481,8 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex, // rescaling needed for the PolyPolygon conversion if( rB2DPolyPoly.count() ) { - ::basegfx::B2DHomMatrix aMatrix; - aMatrix.scale( mfFontScale/256, mfFontScale/256 ); - rB2DPolyPoly.transform( aMatrix ); + const double fFactor(mfFontScale/256); + rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor)); } return bRet; diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx index 5c00c786e22d..29e4ff1d801e 100644 --- a/vcl/win/source/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx @@ -62,9 +62,9 @@ // ----------------------------------------------------------------------- -void impAddB2DPolygonToGDIPlusGraphicsPath(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon) +void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) { - const sal_uInt32 nCount(rPolygon.count()); + sal_uInt32 nCount(rPolygon.count()); if(nCount) { @@ -97,8 +97,58 @@ void impAddB2DPolygonToGDIPlusGraphicsPath(Gdiplus::GraphicsPath& rPath, const b if(a + 1 < nEdgeCount) { - aCurr = aNext; aFCurr = aFNext; + + if(bNoLineJoin) + { + rPath.StartFigure(); + } + } + } + } +} + +void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) +{ + sal_uInt32 nCount(rPolygon.count()); + + if(nCount) + { + const sal_uInt32 nEdgeCount(rPolygon.isClosed() ? nCount : nCount - 1); + const bool bControls(rPolygon.areControlPointsUsed()); + basegfx::B2DPoint aCurr(rPolygon.getB2DPoint(0)); + Gdiplus::Point aICurr(INT(aCurr.getX()), INT(aCurr.getY())); + + for(sal_uInt32 a(0); a < nEdgeCount; a++) + { + const sal_uInt32 nNextIndex((a + 1) % nCount); + const basegfx::B2DPoint aNext(rPolygon.getB2DPoint(nNextIndex)); + const Gdiplus::Point aINext(INT(aNext.getX()), INT(aNext.getY())); + + if(bControls && (rPolygon.isNextControlPointUsed(a) || rPolygon.isPrevControlPointUsed(nNextIndex))) + { + const basegfx::B2DPoint aCa(rPolygon.getNextControlPoint(a)); + const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex)); + + rPath.AddBezier( + aICurr, + Gdiplus::Point(INT(aCa.getX()), INT(aCa.getY())), + Gdiplus::Point(INT(aCb.getX()), INT(aCb.getY())), + aINext); + } + else + { + rPath.AddLine(aICurr, aINext); + } + + if(a + 1 < nEdgeCount) + { + aICurr = aINext; + + if(bNoLineJoin) + { + rPath.StartFigure(); + } } } } @@ -123,7 +173,7 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly aPath.StartFigure(); // #i101491# not needed for first run } - impAddB2DPolygonToGDIPlusGraphicsPath(aPath, rPolyPolygon.getB2DPolygon(a)); + impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolyPolygon.getB2DPolygon(a), false); aPath.CloseFigure(); } @@ -152,11 +202,16 @@ bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon& rPolygon, const bas Gdiplus::Color aTestColor(255, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); Gdiplus::Pen aTestPen(aTestColor, Gdiplus::REAL(rLineWidths.getX())); Gdiplus::GraphicsPath aPath; + bool bNoLineJoin(false); switch(eLineJoin) { default : // basegfx::B2DLINEJOIN_NONE : { + if(basegfx::fTools::more(rLineWidths.getX(), 0.0)) + { + bNoLineJoin = true; + } break; } case basegfx::B2DLINEJOIN_BEVEL : @@ -179,9 +234,16 @@ bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon& rPolygon, const bas } } - impAddB2DPolygonToGDIPlusGraphicsPath(aPath, rPolygon); + if(nCount > 250 && basegfx::fTools::more(rLineWidths.getX(), 1.5)) + { + impAddB2DPolygonToGDIPlusGraphicsPathInteger(aPath, rPolygon, bNoLineJoin); + } + else + { + impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolygon, bNoLineJoin); + } - if(rPolygon.isClosed()) + if(rPolygon.isClosed() && !bNoLineJoin) { // #i101491# needed to create the correct line joins aPath.CloseFigure(); diff --git a/wizards/source/launcher/FontOOo.xba b/wizards/source/launcher/FontOOo.xba deleted file mode 100644 index c05e0c11bb2c..000000000000 --- a/wizards/source/launcher/FontOOo.xba +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> -<script:module xmlns:script="http://openoffice.org/2000/script" script:name="FontOOo" script:language="StarBasic">Option Explicit - -Sub StartFontOOo - -Dim ThePath as string -Dim aService as object -Dim MyFontOOo as string -dim TheDoc as object -dim args(1) as new com.sun.star.beans.PropertyValue - -on error resume next - -' Find path -aService = CreateUnoService("com.sun.star.util.PathSubstitution") -ThePath =ConvertToURL(aService.substituteVariables("$(prog)", true)) -ThePath=ThePath & "/../share/dict/ooo" - -if fileExists(ThePath & "/FontOOo.lst") then -'read FontOOo.lst file - Open ThePath & "/FontOOo.lst" for input as #1 - line input #1, MyFontOOo - close #1 -else -'create default FontOOo.lst file - Open ThePath & "/FontOOo.lst" for output as #1 - MyFontOOo=ThePath & "/FontOOo.sxw" - print #1, MyFontOOo - close #1 -endif - -'security -if Not fileExists(MyFontOOo) then - MyFontOOo= ThePath & "/FontOOo.sxw" -endif -MyFontOOo=ConvertToURL(MyFontOOo) - -'Opens FontOOo main file -args(0).name="InteractionHandler" -args(0).value="" -args(1).name="MacroExecutionMode" -args(1).value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN '4 -TheDoc=StarDesktop.loadComponentFromURL(MyFontOOo,"_blank",0,args()) - -End Sub</script:module> diff --git a/wizards/source/launcher/makefile.mk b/wizards/source/launcher/makefile.mk index d20cc073f39a..6efbcc54792e 100644 --- a/wizards/source/launcher/makefile.mk +++ b/wizards/source/launcher/makefile.mk @@ -42,9 +42,6 @@ TARGET=launcher ZIP1TARGET = $(LAUNCHER_ALL_TARGET) XBAFILES = DicOOo.xba -.IF "$(WITH_FONTOOO)" == "YES" -XBAFILES += FontOOo.xba -.ENDIF ZIP1LIST = *.xdl $(XBAFILES) *.xlb # --- Targets ------------------------------------------------------ diff --git a/wizards/source/launcher/script.xlb b/wizards/source/launcher/script.xlb index 88a6e68b5aad..55310d9fb286 100644 --- a/wizards/source/launcher/script.xlb +++ b/wizards/source/launcher/script.xlb @@ -2,5 +2,4 @@ <!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> <library:library xmlns:library="http://openoffice.org/2000/library" library:name="Launcher" library:readonly="true" library:passwordprotected="false"> <library:element library:name="DicOOo"/> - <library:element library:name="FontOOo"/> </library:library> diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 7817fa7c4c19..af20bfbb23dc 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1568,15 +1568,7 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel { if( !mpOutlineStylesCandidates ) { -#ifdef IRIX - /* GCC 2 bug when member function is called as part of an array - * initialiser - */ - sal_Int8 count = xChapterNumbering->getCount(); - mpOutlineStylesCandidates = new ::std::vector<OUString>[count]; -#else mpOutlineStylesCandidates = new ::std::vector<OUString>[xChapterNumbering->getCount()]; -#endif } mpOutlineStylesCandidates[nOutlineLevel-1].push_back( rStyleName ); } |