-- cgit v1.2.3 From 718ea746515013f539978b3f05b4ef9457af6b48 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 27 Jul 2009 11:27:09 -0400 Subject: #i3687# #i97416#: initial porting of patches from ooo-build. --- .../registry/schema/org/openoffice/Office/Calc.xcs | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index fd7c52ef4d..560ca9518c 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1019,6 +1019,81 @@ NULL + + + Contains the dialogs settings. + + + + Contains setting for Text CSV Import + + + + muthusuba + Merge Delimiter check box status + + + false + + + + kyoshida + If true, quoted field is always imported as text + with no exception. + + + true + + + + muthusuba + List of Separators - as a String + + + ; + + + + muthusuba + Text Separators + + + " + + + + muthusuba + Fixed width + + + false + + + + muthusuba + From Row + + + 1 + + + + muthusuba + Char Set + + + -1 + + + + muthusuba + Fixed Width List of separators + + + + + + Contains settings that affect cell calculation. -- cgit v1.2.3 From 91a7a3158ba4a4b138a9cd8c43bafee1ed23fc02 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 27 Jul 2009 11:43:32 -0400 Subject: #i97416# initial porting of patches from ooo-build, to implement modified csv import option dialog. --- officecfg/registry/schema/org/openoffice/Office/Calc.xcs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 560ca9518c..ff5a13c32f 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1044,6 +1044,22 @@ true + + + kyoshida + If true, Calc tries to detect special number format, such as date and scientific notation. + + + false + + + + kyoshida + Language to use for CSV import. This determines how the numbers are parsed. + + + 0 + muthusuba -- cgit v1.2.3 From 24f2d821b717fd11f6d035accab89f9e95f93be2 Mon Sep 17 00:00:00 2001 From: thb Date: Fri, 16 Oct 2009 00:43:16 +0200 Subject: #i105937# Much improved gradient support for canvas/basegfx/drawinglayer. See http://blog.thebehrens.net/2009/07/28/hackweek-iv-canvas-convwatch/ for more background information --- .../source/primitive2d/fillgradientprimitive2d.cxx | 26 ++--- .../source/primitive2d/fillhatchprimitive2d.cxx | 6 +- .../source/primitive3d/hatchtextureprimitive3d.cxx | 6 +- drawinglayer/source/processor2d/vclprocessor2d.cxx | 2 +- .../source/processor3d/defaultprocessor3d.cxx | 10 +- drawinglayer/source/texture/texture.cxx | 126 ++++----------------- drawinglayer/source/texture/texture3d.cxx | 2 +- 7 files changed, 49 insertions(+), 129 deletions(-) diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx index 61760758c1..31c4c9b19b 100644 --- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx @@ -62,16 +62,6 @@ namespace drawinglayer 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)); - } - // make sure steps is not too high/low const basegfx::BColor aStart(maFillGradient.getStartColor()); const basegfx::BColor aEnd(maFillGradient.getEndColor()); @@ -96,16 +86,18 @@ namespace drawinglayer { case attribute::GRADIENTSTYLE_LINEAR: { - texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle()); + texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getAngle()); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1)); break; } case attribute::GRADIENTSTYLE_AXIAL: { - texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle()); + texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getAngle()); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1)); break; } case attribute::GRADIENTSTYLE_RADIAL: @@ -113,27 +105,31 @@ namespace drawinglayer texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY()); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(0,0), 1, 1); break; } case attribute::GRADIENTSTYLE_ELLIPTICAL: { - texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle()); + texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), maFillGradient.getAngle()); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(0,0), 1, 1); break; } case attribute::GRADIENTSTYLE_SQUARE: { - texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle()); + texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), maFillGradient.getAngle()); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1)); break; } case attribute::GRADIENTSTYLE_RECT: { - texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle()); + texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), maFillGradient.getAngle()); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1)); break; } } diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx index 6749b4bf18..fea4fe01ad 100644 --- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx @@ -59,7 +59,7 @@ namespace drawinglayer { // create hatch const basegfx::BColor aHatchColor(maFillHatch.getColor()); - const double fAngle(-maFillHatch.getAngle()); + const double fAngle(maFillHatch.getAngle()); ::std::vector< basegfx::B2DHomMatrix > aMatrices; // get hatch transformations @@ -68,7 +68,7 @@ namespace drawinglayer case attribute::HATCHSTYLE_TRIPLE: { // rotated 45 degrees - texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI4); + texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle - F_PI4); aHatch.appendTransformations(aMatrices); // fall-through by purpose @@ -76,7 +76,7 @@ namespace drawinglayer case attribute::HATCHSTYLE_DOUBLE: { // rotated 90 degrees - texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI2); + texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle - F_PI2); aHatch.appendTransformations(aMatrices); // fall-through by purpose diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx index 1bb44f9888..fcd7f63e2a 100644 --- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx @@ -155,7 +155,7 @@ namespace drawinglayer // get 2d range of texture coordinates const basegfx::B2DRange aOutlineRange(basegfx::tools::getRange(aTexPolyPolygon)); const basegfx::BColor aHatchColor(getHatch().getColor()); - const double fAngle(-getHatch().getAngle()); + const double fAngle(getHatch().getAngle()); ::std::vector< basegfx::B2DHomMatrix > aMatrices; // get hatch transformations @@ -164,13 +164,13 @@ namespace drawinglayer case attribute::HATCHSTYLE_TRIPLE: { // rotated 45 degrees - texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI4); + texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI4); aHatch.appendTransformations(aMatrices); } case attribute::HATCHSTYLE_DOUBLE: { // rotated 90 degrees - texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI2); + texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI2); aHatch.appendTransformations(aMatrices); } case attribute::HATCHSTYLE_SINGLE: diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 4f803e9366..8c3432a69f 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -561,7 +561,7 @@ namespace drawinglayer impDrawGradientToOutDev( *mpOutputDevice, aLocalPolyPolygon, rGradient.getStyle(), rGradient.getSteps(), aStartColor, aEndColor, rGradient.getBorder(), - -rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false); + rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false); } } diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index 33a2e1639f..10c9273fc5 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -106,12 +106,12 @@ namespace drawinglayer { case attribute::GRADIENTSTYLE_LINEAR: { - pNewTex = new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle()); + pNewTex = new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()); break; } case attribute::GRADIENTSTYLE_AXIAL: { - pNewTex = new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle()); + pNewTex = new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()); break; } case attribute::GRADIENTSTYLE_RADIAL: @@ -121,17 +121,17 @@ namespace drawinglayer } case attribute::GRADIENTSTYLE_ELLIPTICAL: { - pNewTex = new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()); + pNewTex = new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()); break; } case attribute::GRADIENTSTYLE_SQUARE: { - pNewTex = new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()); + pNewTex = new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()); break; } case attribute::GRADIENTSTYLE_RECT: { - pNewTex = new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()); + pNewTex = new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()); break; } } diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx index 964099b691..dc4b785c2b 100644 --- a/drawinglayer/source/texture/texture.cxx +++ b/drawinglayer/source/texture/texture.cxx @@ -165,15 +165,10 @@ namespace drawinglayer { if(maGradientInfo.mnSteps) { - const double fTop(mfBorder); - const double fStripeWidth((1.0 - fTop) / maGradientInfo.mnSteps); - + const double fStripeWidth(1.0 / maGradientInfo.mnSteps); for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) { - const double fOffsetUpper(fStripeWidth * (double)a); - - // create matrix - const basegfx::B2DRange aRect(0.0, fTop + fOffsetUpper, 1.0, 1.0); + const basegfx::B2DRange aRect(0.0, fStripeWidth * a, 1.0, 1.0); impAppendMatrix(rMatrices, aRect); } } @@ -225,17 +220,10 @@ namespace drawinglayer { if(maGradientInfo.mnSteps) { - const double fHalfBorder(mfBorder * 0.5); - double fTop(fHalfBorder); - double fBottom(1.0 - fHalfBorder); - const double fStripeWidth((fBottom - fTop) / ((maGradientInfo.mnSteps * 2L) - 1L)); - - for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) + const double fStripeWidth=1.0 / (maGradientInfo.mnSteps - 1L); + for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a != 0; a--) { - const double fOffset(fStripeWidth * (double)a); - - // create matrix - const basegfx::B2DRange aRect(0.0, fTop + fOffset, 1.0, fBottom - fOffset); + const basegfx::B2DRange aRect(0, 0, 1.0, fStripeWidth * a); impAppendMatrix(rMatrices, aRect); } } @@ -287,34 +275,10 @@ namespace drawinglayer { if(maGradientInfo.mnSteps) { - const double fHalfBorder((1.0 - mfBorder) * 0.5); - double fLeft(0.5 - fHalfBorder); - double fTop(0.5 - fHalfBorder); - double fRight(0.5 + fHalfBorder); - double fBottom(0.5 + fHalfBorder); - double fIncrementX, fIncrementY; - - if(maGradientInfo.mfAspectRatio > 1.0) - { - fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L); - fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio; - } - else - { - fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L); - fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio; - } - + const double fStepSize=1.0 / maGradientInfo.mnSteps; for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) { - // next step - fLeft += fIncrementX; - fRight -= fIncrementX; - fTop += fIncrementY; - fBottom -= fIncrementY; - - // create matrix - const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom); + const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a); impAppendMatrix(rMatrices, aRect); } } @@ -359,34 +323,29 @@ namespace drawinglayer { if(maGradientInfo.mnSteps) { - const double fHalfBorder((1.0 - mfBorder) * 0.5); - double fLeft(0.5 - fHalfBorder); - double fTop(0.5 - fHalfBorder); - double fRight(0.5 + fHalfBorder); - double fBottom(0.5 + fHalfBorder); + double fWidth(1); + double fHeight(1); double fIncrementX, fIncrementY; if(maGradientInfo.mfAspectRatio > 1.0) { - fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L); + fIncrementY = fHeight / maGradientInfo.mnSteps; fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio; } else { - fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L); + fIncrementX = fWidth / maGradientInfo.mnSteps; fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio; } for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) { // next step - fLeft += fIncrementX; - fRight -= fIncrementX; - fTop += fIncrementY; - fBottom -= fIncrementY; + fWidth -= fIncrementX; + fHeight -= fIncrementY; // create matrix - const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom); + const basegfx::B2DRange aRect(0, 0, fWidth, fHeight); impAppendMatrix(rMatrices, aRect); } } @@ -431,42 +390,10 @@ namespace drawinglayer { if(maGradientInfo.mnSteps) { - const double fHalfBorder((1.0 - mfBorder) * 0.5); - double fLeft(0.5 - fHalfBorder); - double fTop(0.5 - fHalfBorder); - double fRight(0.5 + fHalfBorder); - double fBottom(0.5 + fHalfBorder); - double fIncrementX, fIncrementY; - - if(maGradientInfo.mfAspectRatio > 1.0) - { - const double fWidth(fRight - fLeft); - const double fHalfAspectExpansion(((maGradientInfo.mfAspectRatio - 1.0) * 0.5) * fWidth); - fTop -= fHalfAspectExpansion; - fBottom += fHalfAspectExpansion; - fIncrementX = fWidth / (double)(maGradientInfo.mnSteps * 2L); - fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio; - } - else - { - const double fHeight(fBottom - fTop); - const double fHalfAspectExpansion((((1.0 / maGradientInfo.mfAspectRatio) - 1.0) * 0.5) * fHeight); - fLeft -= fHalfAspectExpansion; - fRight += fHalfAspectExpansion; - fIncrementY = fHeight / (double)(maGradientInfo.mnSteps * 2L); - fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio; - } - + const double fStepSize=1.0 / maGradientInfo.mnSteps; for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) { - // next step - fLeft += fIncrementX; - fRight -= fIncrementX; - fTop += fIncrementY; - fBottom -= fIncrementY; - - // create matrix - const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom); + const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a); impAppendMatrix(rMatrices, aRect); } } @@ -511,34 +438,29 @@ namespace drawinglayer { if(maGradientInfo.mnSteps) { - const double fHalfBorder((1.0 - mfBorder) * 0.5); - double fLeft(0.5 - fHalfBorder); - double fTop(0.5 - fHalfBorder); - double fRight(0.5 + fHalfBorder); - double fBottom(0.5 + fHalfBorder); + double fWidth(1); + double fHeight(1); double fIncrementX, fIncrementY; if(maGradientInfo.mfAspectRatio > 1.0) { - fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L); + fIncrementY = fHeight / maGradientInfo.mnSteps; fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio; } else { - fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L); + fIncrementX = fWidth / maGradientInfo.mnSteps; fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio; } for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) { // next step - fLeft += fIncrementX; - fRight -= fIncrementX; - fTop += fIncrementY; - fBottom -= fIncrementY; + fWidth -= fIncrementX; + fHeight -= fIncrementY; // create matrix - const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom); + const basegfx::B2DRange aRect(0, 0, fWidth, fHeight); impAppendMatrix(rMatrices, aRect); } } @@ -574,6 +496,8 @@ namespace drawinglayer double fTargetOffsetX(rTargetRange.getMinX()); double fTargetOffsetY(rTargetRange.getMinY()); + fAngle = -fAngle; + // add object expansion if(0.0 != fAngle) { diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 062d7c67f0..710ae896fd 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -198,7 +198,7 @@ namespace drawinglayer { const attribute::FillHatchAttribute& rHatch(rPrimitive.getHatch()); const basegfx::B2DRange aOutlineRange(0.0, 0.0, rPrimitive.getTextureSize().getX(), rPrimitive.getTextureSize().getY()); - const double fAngleA(-rHatch.getAngle()); + const double fAngleA(rHatch.getAngle()); maColor = rHatch.getColor(); mbFillBackground = rHatch.isFillBackground(); mp0 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA); -- cgit v1.2.3 From 9ffdbe952484194e31780f6d73118bbcaf2ffe11 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 20 Nov 2009 12:18:12 +0100 Subject: [CWS autorecovery] a very early step towards #i65597#: some refactoring, removal of unused code, and consolidation Basically, in the current phase this is just to make it easier to understand the current code. --- sfx2/inc/frmload.hxx | 91 +++--- sfx2/inc/sfx2/frame.hxx | 2 +- sfx2/inc/sfx2/objsh.hxx | 2 +- sfx2/source/doc/objcont.cxx | 69 ++--- sfx2/source/view/frame.cxx | 4 +- sfx2/source/view/frmload.cxx | 645 ++++++++++++++++++++++--------------------- sfx2/source/view/topfrm.cxx | 86 +++--- sfx2/source/view/viewfrm.cxx | 14 +- sfx2/source/view/viewprn.cxx | 4 + 9 files changed, 440 insertions(+), 477 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 22ba209231..73c524e8e7 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -31,71 +31,40 @@ #ifndef _SFX_FRMLOAD_HXX #define _SFX_FRMLOAD_HXX +/** === begin UNO includes === **/ #include -#include -#include #include #include #include -#include +#include +#include +#include +#include +#include +/** === end UNO includes === **/ + +#include +#include #include #include #include - -#include -#include #include #include #include +#include -class SfxObjectFactory; +class SfxFilter; class SfxFilterMatcher; -class LoadEnvironment_Impl; -class SfxMedium; - -namespace com -{ - namespace sun - { - namespace star - { - namespace uno - { - class Any; - } - namespace lang - { - class XMultiServiceFactory; - } - namespace frame - { - class XFrame; - } - namespace beans - { - struct PropertyValue; - } - } - } -} +class SfxFrame; #include -#define REFERENCE ::com::sun::star::uno::Reference -#define SEQUENCE ::com::sun::star::uno::Sequence -#define RUNTIME_EXCEPTION ::com::sun::star::uno::RuntimeException - class SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo > { - REFERENCE < ::com::sun::star::frame::XFrame > xFrame; - REFERENCE < ::com::sun::star::frame::XLoadEventListener > xListener; - String aFilterName; - SfxMedium* pMedium; - - DECL_LINK( LoadDone_Impl, void* ); + ::comphelper::ComponentContext m_aContext; public: - SfxFrameLoader_Impl( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); + SfxFrameLoader_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory ); virtual ~SfxFrameLoader_Impl(); SFX_DECL_XSERVICEINFO @@ -103,8 +72,34 @@ public: //---------------------------------------------------------------------------------- // XSynchronousFrameLoader //---------------------------------------------------------------------------------- - virtual sal_Bool SAL_CALL load( const SEQUENCE< ::com::sun::star::beans::PropertyValue >& lDescriptor, const REFERENCE< ::com::sun::star::frame::XFrame >& xFrame ) throw( RUNTIME_EXCEPTION ); - virtual void SAL_CALL cancel() throw( RUNTIME_EXCEPTION ); + virtual sal_Bool SAL_CALL load( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL cancel() throw( ::com::sun::star::uno::RuntimeException ); + +private: + const SfxFilter* impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& _rServiceName ) const; + ::rtl::OUString impl_askForFilter_nothrow( + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxHandler, + const ::rtl::OUString& _rDocumentURL + ) const; + + const SfxFilter* impl_detectFilterForURL( + const ::rtl::OUString& _rURL, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs, + const SfxFilterMatcher& rMatcher + ) const; + + sal_Bool impl_createNewDocWithSlotParam( + const sal_uInt16 _nSlotID, + SfxFrame* _pFrame + ); + + sal_Bool impl_createNewDoc( + const SfxItemSet& _rSet, + SfxFrame* _pFrame, + const ::rtl::OUString& _rFactoryURL + ); + + void impl_ensureValidFrame_throw( const SfxFrame* _pFrame ); }; #endif diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index c536e7d966..e31df2c7e6 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -224,7 +224,7 @@ public: //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE sal_Bool DoClose_Impl(); - SAL_DLLPRIVATE void SetFrameInterface_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); + SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet ); SAL_DLLPRIVATE const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > GetInterceptor_Impl(); diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index d9996b0d4b..f3c926a23e 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -789,7 +789,7 @@ public: SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* ); SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 ); //REMOVE FASTBOOL SaveWindows_Impl( SvStorage &rStor ) const; - SAL_DLLPRIVATE SfxViewFrame* LoadWindows_Impl( SfxTopFrame *pPrefered = 0 ); + SAL_DLLPRIVATE SfxViewFrame* LoadWindows_Impl( SfxTopFrame& rPrefered ); SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl(); // configuration items diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 8398679302..733cb970d7 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -50,8 +50,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -254,10 +255,10 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig //==================================================================== -SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) +SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame& rPreferedFrame ) { - DBG_ASSERT( pPreferedFrame, "Call without preferred Frame is not supported anymore!" ); - if ( pImp->bLoadingWindows || !pPreferedFrame ) + + if ( pImp->bLoadingWindows ) return NULL; DBG_ASSERT( GetMedium(), "A Medium should exist here!"); @@ -266,9 +267,9 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) // get correct mode SFX_APP(); - SfxViewFrame *pPrefered = pPreferedFrame ? pPreferedFrame->GetCurrentViewFrame() : 0; + SfxViewFrame* pPreferedViewFrame = rPreferedFrame.GetCurrentViewFrame(); SvtSaveOptions aOpt; - BOOL bLoadDocWins = aOpt.IsSaveDocWins() && !pPrefered; + BOOL bLoadDocWins = aOpt.IsSaveDocWins() && !pPreferedViewFrame; // try to get viewdata information for XML format REFERENCE < XVIEWDATASUPPLIER > xViewDataSupplier( GetModel(), ::com::sun::star::uno::UNO_QUERY ); @@ -292,11 +293,10 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) sal_Int32 nView = 0; // get saved information for all views + SfxTopFrame* pCurrentTargetFrame = &rPreferedFrame; while ( TRUE ) { USHORT nViewId = 0; - FASTBOOL bMaximized=FALSE; - String aPosSize; String aUserData; // used in the binary format SEQUENCE < PROPERTYVALUE > aSeq; // used in the XML format @@ -312,18 +312,12 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) ::com::sun::star::uno::Any aAny = xViewData->getByIndex( nView++ ); if ( aAny >>= aSeq ) { - for ( sal_Int32 n=0; n>= aId; - String aTmp( aId ); - aTmp.Erase( 0, 4 ); // format is like in "view3" - nViewId = (USHORT) aTmp.ToInt32(); - break; - } + sViewId = sViewId.copy( 4 ); // format is like in "view3" + nViewId = USHORT( sViewId.toInt32() ); } } @@ -332,26 +326,12 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) if ( !bLoadDocWins && !bActive ) break; - // check for minimized/maximized/size - if ( aPosSize.EqualsAscii( "max" ) ) - bMaximized = TRUE; - else if ( aPosSize.EqualsAscii( "min" ) ) - { - bMaximized = TRUE; - bActive = FALSE; - } - else - bMaximized = FALSE; - - Point aPt; - Size aSz; - pSet->ClearItem( SID_USER_DATA ); SfxViewFrame *pFrame = 0; - if ( pPrefered ) + if ( pPreferedViewFrame ) { // use the frame from the arguments, but don't set a window size - pFrame = pPrefered; + pFrame = pPreferedViewFrame; if ( pFrame->GetViewShell() || !pFrame->GetObjectShell() ) { pSet->ClearItem( SID_VIEW_POS_SIZE ); @@ -363,7 +343,7 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) rBind.ENTERREGISTRATIONS(); // set document into frame - pPreferedFrame->InsertDocument( this ); + pCurrentTargetFrame->InsertDocument( this ); // restart controller updating rBind.LEAVEREGISTRATIONS(); @@ -380,17 +360,16 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) { // open in the background pSet->Put( SfxUInt16Item( SID_VIEW_ZOOM_MODE, 0 ) ); - if ( !bMaximized ) - pSet->Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle( aPt, aSz ) ) ); + pSet->Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle() ) ); } pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - if ( pPreferedFrame ) + if ( pCurrentTargetFrame ) { // Frame "ubergeben, allerdings ist der noch leer - pPreferedFrame->InsertDocument( this ); - pFrame = pPreferedFrame->GetCurrentViewFrame(); + pCurrentTargetFrame->InsertDocument( this ); + pFrame = pCurrentTargetFrame->GetCurrentViewFrame(); } else { @@ -416,25 +395,25 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame ) } // perhaps there are more windows to load - pPreferedFrame = NULL; + pCurrentTargetFrame = NULL; if ( bActive ) pActiveFrame = pFrame; - if( pPrefered || !bLoadDocWins ) + if( pPreferedViewFrame || !bLoadDocWins ) // load only active window break; } if ( pActiveFrame ) { - if ( !pPrefered ) + if ( !pPreferedViewFrame ) // activate frame pActiveFrame->MakeActive_Impl( TRUE ); } pImp->bLoadingWindows = FALSE; - return pPrefered && bLoaded ? pPrefered : pActiveFrame; + return pPreferedViewFrame && bLoaded ? pPreferedViewFrame : pActiveFrame; } //==================================================================== diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index e5d7ca0693..55a226234f 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -683,7 +683,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) { // Beim InsertDocument wird der Descriptor des Frames aktualisiert // und sein ItemSet neu initialisiert. Alle Daten, die f"ur ein sp"ateres - // Restaurieren der ::com::sun::star::sdbcx::View n"otig sind, sind damit festgehalten. + // Restaurieren der View n"otig sind, sind damit festgehalten. // Soll das Dokument ersetzt werden, wird durch GetViewData_Impl (s.o.) // die neueste Information hinzugef"ugt. Alles zusammen wird dann in der // Browse-History gesichert. Beim Aktivieren eines solchen FramePickEntry @@ -1265,7 +1265,7 @@ sal_Bool SfxFrame::HasComponent() const return pImp->xFrame; } -void SfxFrame::SetFrameInterface_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) +void SfxFrame::SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) { pImp->xFrame = rFrame; com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder; diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index cab7101731..14e9833386 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -34,44 +34,27 @@ #include "frmload.hxx" #include + #include -#include #include -#include #include #include -#include -#include -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX -#include -#endif -#include -#include #include -#include -#include -#include -#include #include -#include -#ifndef _TOOLKIT_UNOHLP_HXX #include -#endif #include #include #include #include -#include +#include #include #include -#include -#include -#include -#include +#include #include #include +#include #include #include @@ -95,7 +78,32 @@ namespace css = ::com::sun::star; #include "brokenpackageint.hxx" #include "objshimp.hxx" -SfxFrameLoader_Impl::SfxFrameLoader_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory >& /*xFactory*/ ) +// do not remove the markers below +/** === begin UNO using === **/ +using ::com::sun::star::uno::Reference; +using ::com::sun::star::task::XInteractionHandler; +using ::com::sun::star::frame::XModel; +using ::com::sun::star::lang::XMultiServiceFactory; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::container::XContainerQuery; +using ::com::sun::star::container::XEnumeration; +using ::com::sun::star::uno::makeAny; +using ::com::sun::star::frame::XFrame; +using ::com::sun::star::uno::Exception; +using ::com::sun::star::task::XInteractionRequest; +using ::com::sun::star::uno::UNO_SET_THROW; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::task::XStatusIndicator; +using ::com::sun::star::document::XTypeDetection; +using ::com::sun::star::util::XCloseable; +using ::com::sun::star::frame::XLoadable; +/** === end UNO using === **/ + +SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< css::lang::XMultiServiceFactory >& _rxFactory ) + :m_aContext( _rxFactory ) { } @@ -103,54 +111,46 @@ SfxFrameLoader_Impl::~SfxFrameLoader_Impl() { } -const SfxFilter* impl_detectFilterForURL(const ::rtl::OUString& sURL , - const css::uno::Sequence< css::beans::PropertyValue >& rArgs , - const SfxFilterMatcher& rMatcher) +// -------------------------------------------------------------------------------------------------------------------- +const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUString& sURL, + const Sequence< PropertyValue >& rArgs, const SfxFilterMatcher& rMatcher ) const { - static ::rtl::OUString SERVICENAME_TYPEDETECTION = ::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection"); - ::rtl::OUString sFilter; try { - if (!sURL.getLength()) + if ( !sURL.getLength() ) return 0; - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); - if (!xSMGR.is()) - return 0; + Reference< XTypeDetection > xDetect( + m_aContext.createComponent( "com.sun.star.document.TypeDetection" ), + UNO_QUERY_THROW); + + ::comphelper::NamedValueCollection aNewArgs; + aNewArgs.put( "URL", sURL ); - css::uno::Reference< css::document::XTypeDetection > xDetect( - xSMGR->createInstance(SERVICENAME_TYPEDETECTION), - css::uno::UNO_QUERY_THROW); - - ::comphelper::MediaDescriptor lOrgArgs(rArgs); - css::uno::Reference< css::task::XInteractionHandler > xInteraction = lOrgArgs.getUnpackedValueOrDefault( - ::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER(), - css::uno::Reference< css::task::XInteractionHandler >()); - css::uno::Reference< css::task::XStatusIndicator > xProgress = lOrgArgs.getUnpackedValueOrDefault( - ::comphelper::MediaDescriptor::PROP_STATUSINDICATOR(), - css::uno::Reference< css::task::XStatusIndicator >()); - - ::comphelper::SequenceAsHashMap lNewArgs; - lNewArgs[::comphelper::MediaDescriptor::PROP_URL()] <<= sURL; - if (xInteraction.is()) - lNewArgs[::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteraction; - if (xProgress.is()) - lNewArgs[::comphelper::MediaDescriptor::PROP_STATUSINDICATOR()] <<= xProgress; - - css::uno::Sequence< css::beans::PropertyValue > lDescr = lNewArgs.getAsConstPropertyValueList(); - ::rtl::OUString sType = xDetect->queryTypeByDescriptor(lDescr, sal_True); - if (sType.getLength()) + ::comphelper::NamedValueCollection aOrgArgs( rArgs ); + if ( aOrgArgs.has( "InteractionHandler" ) ) + aNewArgs.put( "InteractionHandler", aOrgArgs.get( "InteractionHandler" ) ); + if ( aOrgArgs.has( "StatusIndicator" ) ) + aNewArgs.put( "StatusIndicator", aOrgArgs.get( "StatusIndicator" ) ); + + ::rtl::OUString sType = xDetect->queryTypeByDescriptor( aNewArgs.getPropertyValues(), sal_True ); + if ( sType.getLength() ) { - const SfxFilter* pFilter = rMatcher.GetFilter4EA(sType); - if (pFilter) + const SfxFilter* pFilter = rMatcher.GetFilter4EA( sType ); + if ( pFilter ) sFilter = pFilter->GetName(); } } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - { sFilter = ::rtl::OUString(); } + catch ( const RuntimeException& ) + { + throw; + } + catch( const css::uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + sFilter = ::rtl::OUString(); + } const SfxFilter* pFilter = 0; if (sFilter.getLength()) @@ -158,37 +158,144 @@ const SfxFilter* impl_detectFilterForURL(const ::rtl::OUString& return pFilter; } -sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::beans::PropertyValue >& rArgs , - const css::uno::Reference< css::frame::XFrame >& rFrame ) +// -------------------------------------------------------------------------------------------------------------------- +const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& _rServiceName ) const +{ + const SfxFilter* pFilter = NULL; + try + { + ::comphelper::NamedValueCollection aQuery; + aQuery.put( "DocumentService", _rServiceName ); + + const Reference< XContainerQuery > xQuery( + m_aContext.createComponent( "com.sun.star.document.FilterFactory" ), + UNO_QUERY_THROW ); + + const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); + const SfxFilterFlags nMust = SFX_FILTER_IMPORT; + const SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED; + + Reference < XEnumeration > xEnum( xQuery->createSubSetEnumerationByProperties( + aQuery.getNamedValues() ), UNO_SET_THROW ); + while ( xEnum->hasMoreElements() ) + { + ::comphelper::NamedValueCollection aType( xEnum->nextElement() ); + ::rtl::OUString sFilterName = aType.getOrDefault( "Name", ::rtl::OUString() ); + if ( !sFilterName.getLength() ) + continue; + + const SfxFilter* pFilter = rMatcher.GetFilter4FilterName( sFilterName ); + if ( !pFilter ) + continue; + + SfxFilterFlags nFlags = pFilter->GetFilterFlags(); + if ( ( ( nFlags & nMust ) == nMust ) + && ( ( nFlags & nDont ) == 0 ) + ) + { + return pFilter; + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return NULL; +} + +// -------------------------------------------------------------------------------------------------------------------- +::rtl::OUString SfxFrameLoader_Impl::impl_askForFilter_nothrow( const Reference< XInteractionHandler >& _rxHandler, + const ::rtl::OUString& _rDocumentURL ) const +{ + ENSURE_OR_THROW( _rxHandler.is(), "invalid interaction handler" ); + + ::rtl::OUString sFilterName; + try + { + ::framework::RequestFilterSelect* pRequest = new ::framework::RequestFilterSelect( _rDocumentURL ); + Reference< XInteractionRequest > xRequest ( pRequest ); + _rxHandler->handle( xRequest ); + if( !pRequest->isAbort() ) + sFilterName = pRequest->getFilter(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + return sFilterName; +} + +// -------------------------------------------------------------------------------------------------------------------- +namespace +{ + sal_Bool lcl_getDispatchResult( const SfxPoolItem* _pResult ) + { + if ( !_pResult ) + return sal_False; + + // default must be set to true, because some return values + // cant be checked, but nonetheless indicate "success"! + sal_Bool bSuccess = sal_True; + + // On the other side some special slots return a boolean state, + // which can be set to FALSE. + SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, _pResult ); + if ( pItem ) + bSuccess = pItem->GetValue(); + + return bSuccess; + } +} + +// -------------------------------------------------------------------------------------------------------------------- +sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const sal_uInt16 _nSlotID, SfxFrame* _pFrame ) +{ + SfxApplication* pApp = SFX_APP(); + + SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, pApp->GetPool() ); + aRequest.AppendItem( SfxFrameItem ( SID_DOCFRAME, _pFrame ) ); + + return lcl_getDispatchResult( pApp->ExecuteSlot( aRequest ) ); +} + +// -------------------------------------------------------------------------------------------------------------------- +sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const SfxItemSet& _rSet, SfxFrame* _pFrame, const ::rtl::OUString& _rFactoryURL ) +{ + SfxApplication* pApp = SFX_APP(); + + SfxRequest aRequest( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, _rSet ); + aRequest.AppendItem( SfxFrameItem( SID_DOCFRAME, _pFrame ) ); + aRequest.AppendItem( SfxStringItem( SID_NEWDOCDIRECT, _rFactoryURL ) ); + + SFX_ITEMSET_ARG( &_rSet, pDocumentTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE ); + if ( pDocumentTitleItem ) + aRequest.AppendItem( *pDocumentTitleItem ); + + return lcl_getDispatchResult( pApp->NewDocDirectExec_ImplOld( aRequest ) ); +} + +// -------------------------------------------------------------------------------------------------------------------- +sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyValue >& rArgs, + const Reference< css::frame::XFrame >& _rTargetFrame ) throw( css::uno::RuntimeException ) { - static ::rtl::OUString PROP_URL = ::rtl::OUString::createFromAscii("URL" ); - static ::rtl::OUString PROP_FILENAME = ::rtl::OUString::createFromAscii("FileName" ); - static ::rtl::OUString PROP_TYPENAME = ::rtl::OUString::createFromAscii("TypeName" ); - static ::rtl::OUString PROP_FILTERNAME = ::rtl::OUString::createFromAscii("FilterName" ); - static ::rtl::OUString PROP_MODEL = ::rtl::OUString::createFromAscii("Model" ); - static ::rtl::OUString PROP_DOCUMENTSERVICE = ::rtl::OUString::createFromAscii("DocumentService" ); - static ::rtl::OUString PROP_READONLY = ::rtl::OUString::createFromAscii("ReadOnly" ); - static ::rtl::OUString PROP_ASTEMPLATE = ::rtl::OUString::createFromAscii("AsTemplate" ); - static ::rtl::OUString PROP_INTERACTIONHANDLER = ::rtl::OUString::createFromAscii("InteractionHandler"); - - sal_Bool bLoadState = sal_False; + ENSURE_OR_THROW( _rTargetFrame.is(), "illegal NULL frame" ); // this methods assumes that the filter is detected before, usually by calling the detect() method below ::vos::OGuard aGuard( Application::GetSolarMutex() ); RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); - if ( !rFrame.is() ) - return sal_False; - - ::comphelper::SequenceAsHashMap lDescriptor(rArgs); - String rURL = lDescriptor.getUnpackedValueOrDefault(PROP_URL , ::rtl::OUString() ); - String aTypeName = lDescriptor.getUnpackedValueOrDefault(PROP_TYPENAME , ::rtl::OUString() ); - aFilterName = lDescriptor.getUnpackedValueOrDefault(PROP_FILTERNAME , ::rtl::OUString() ); - String aServiceName = lDescriptor.getUnpackedValueOrDefault(PROP_DOCUMENTSERVICE , ::rtl::OUString() ); - css::uno::Reference< css::task::XInteractionHandler > xInteraction = lDescriptor.getUnpackedValueOrDefault(PROP_INTERACTIONHANDLER, css::uno::Reference< css::task::XInteractionHandler >()); - css::uno::Reference< css::frame::XModel > xModel = lDescriptor.getUnpackedValueOrDefault(PROP_MODEL , css::uno::Reference< css::frame::XModel >() ); + ::comphelper::NamedValueCollection aDescriptor( rArgs ); + const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() ); + const ::rtl::OUString sTypeName = aDescriptor.getOrDefault( "TypeName", ::rtl::OUString() ); + ::rtl::OUString sFilterName = aDescriptor.getOrDefault( "FilterName", ::rtl::OUString() ); + const ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); + const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); + const Reference< XInteractionHandler > + xInteraction = aDescriptor.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ); const SfxFilter* pFilter = NULL; const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); @@ -201,134 +308,91 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::bean { // get filter by its name directly ... - if( aFilterName.Len() ) - pFilter = rMatcher.GetFilter4FilterName( aFilterName ); + if ( sFilterName.getLength() ) + pFilter = rMatcher.GetFilter4FilterName( sFilterName ); // or search the preferred filter for the detected type ... - if( !pFilter && aTypeName.Len() ) - pFilter = rMatcher.GetFilter4EA(aTypeName); + if ( !pFilter && sTypeName.getLength() ) + pFilter = rMatcher.GetFilter4EA( sTypeName ); // or use given document service for detection too! - if (!pFilter && aServiceName.Len()) - { - ::comphelper::SequenceAsHashMap lQuery; - - if (aServiceName.Len()) - lQuery[::rtl::OUString::createFromAscii("DocumentService")] <<= ::rtl::OUString(aServiceName); - - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > xQuery ( xServiceManager->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.FilterFactory" ) ), ::com::sun::star::uno::UNO_QUERY ); - - SfxFilterFlags nMust = SFX_FILTER_IMPORT; - SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED; - - ::com::sun::star::uno::Reference < com::sun::star::container::XEnumeration > xEnum = xQuery->createSubSetEnumerationByProperties(lQuery.getAsConstNamedValueList()); - while ( xEnum->hasMoreElements() ) - { - ::comphelper::SequenceAsHashMap aType( xEnum->nextElement() ); - aFilterName = aType.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("Name"), ::rtl::OUString()); - if (!aFilterName.Len()) - continue; - pFilter = rMatcher.GetFilter4FilterName(aFilterName); - if (!pFilter) - continue; - SfxFilterFlags nFlags = pFilter->GetFilterFlags(); - if ( - ((nFlags & nMust) == nMust) && - (!(nFlags & nDont )) - ) - { - break; - } - pFilter = 0; //! in case we reach end of enumeration we must have a valid value ... - } - } + if ( !pFilter && sServiceName.getLength() ) + pFilter = impl_getFilterFromServiceName_nothrow( sServiceName ); // or use interaction to ask user for right filter. - if ( !pFilter && xInteraction.is() && rURL.Len() ) + if ( !pFilter && xInteraction.is() && sURL.getLength() ) { - ::framework::RequestFilterSelect* pRequest = new ::framework::RequestFilterSelect( rURL ); - css::uno::Reference< css::task::XInteractionRequest > xRequest ( pRequest ); - xInteraction->handle( xRequest ); - if( !pRequest->isAbort() ) - { - aFilterName = pRequest->getFilter(); - pFilter = rMatcher.GetFilter4FilterName( aFilterName ); - } + ::rtl::OUString sSelectedFilter = impl_askForFilter_nothrow( xInteraction, sURL ); + if ( sSelectedFilter.getLength() ) + pFilter = rMatcher.GetFilter4FilterName( sSelectedFilter ); } if( !pFilter ) return sal_False; - aTypeName = pFilter->GetTypeName(); // use filter names without prefix - aFilterName = pFilter->GetFilterName(); + sFilterName = pFilter->GetFilterName(); // If detected filter indicates using of an own template format - // add property "AsTemplate" to descriptor. But supress this step + // add property "AsTemplate" to descriptor. But suppress this step // if such property already exists. - if( pFilter->IsOwnTemplateFormat()) + if ( pFilter->IsOwnTemplateFormat() && !aDescriptor.has( "AsTemplate" ) ) { - ::comphelper::SequenceAsHashMap::iterator pIt = lDescriptor.find(PROP_ASTEMPLATE); - if (pIt == lDescriptor.end()) - lDescriptor[PROP_ASTEMPLATE] <<= sal_True; + aDescriptor.put( "AsTemplate", sal_Bool( sal_True ) ); } } - xFrame = rFrame; - // Achtung: beim Abraeumen der Objekte kann die SfxApp destruiert werden, vorher noch Deinitialize_Impl rufen SfxApplication* pApp = SFX_APP(); - // Attention! Because lDescriptor is a copy of rArgs - // and was might by changed (e.g. for AsTemplate) - // move all changes there back! + // attention: Don't use rArgs, but instead aDescriptor, which is rArgs plus some + // changes SfxAllItemSet aSet( pApp->GetPool() ); - TransformParameters( SID_OPENDOC, lDescriptor.getAsConstPropertyValueList(), aSet ); + TransformParameters( SID_OPENDOC, aDescriptor.getPropertyValues(), aSet ); SFX_ITEMSET_ARG( &aSet, pRefererItem, SfxStringItem, SID_REFERER, FALSE ); if ( !pRefererItem ) aSet.Put( SfxStringItem( SID_REFERER, String() ) ); - SfxFrame* pFrame=0; - for ( pFrame = SfxFrame::GetFirst(); pFrame; pFrame = SfxFrame::GetNext( *pFrame ) ) + SfxFrame* pTargetFrame = NULL; + for ( pTargetFrame = SfxFrame::GetFirst(); pTargetFrame; pTargetFrame = SfxFrame::GetNext( *pTargetFrame ) ) { - if ( pFrame->GetFrameInterface() == xFrame ) + if ( pTargetFrame->GetFrameInterface() == _rTargetFrame ) break; } BOOL bFrameCreated = FALSE; - if ( !pFrame ) + if ( !pTargetFrame ) { - pFrame = SfxTopFrame::Create( rFrame ); + pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); bFrameCreated = TRUE; } if ( xModel.is() ) { // !TODO: replace by ViewFactory - if ( pFrame->GetFrameInterface()->getController().is() ) + if ( _rTargetFrame->getController().is() ) { // remove old component // if a frame was created already, it can't be an SfxComponent! - pFrame->GetFrameInterface()->setComponent( 0, 0 ); + _rTargetFrame->setComponent( NULL, NULL ); if ( !bFrameCreated ) - pFrame = SfxTopFrame::Create( rFrame ); + pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); } - aSet.Put( SfxFrameItem( SID_DOCFRAME, pFrame ) ); + aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) { if ( xModel == pDoc->GetModel() ) { - pFrame->SetItemSet_Impl( &aSet ); - ::comphelper::SequenceAsHashMap lUpdateDescr( lDescriptor ); - lUpdateDescr.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ) ); - lUpdateDescr.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ); + pTargetFrame->SetItemSet_Impl( &aSet ); - xModel->attachResource( rURL, lUpdateDescr.getAsConstPropertyValueList() ); - return pFrame->InsertDocument( pDoc ); + aDescriptor.remove( "Model" ); + aDescriptor.remove( "URL" ); + + xModel->attachResource( sURL, aDescriptor.getPropertyValues() ); + return pTargetFrame->InsertDocument( pDoc ); } } @@ -337,14 +401,11 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::bean } // check for the URL pattern of our factory URLs - SfxFrameWeak wFrame = pFrame; + SfxFrameWeak wFrame = pTargetFrame; String aPrefix = String::CreateFromAscii( "private:factory/" ); - String aFact( rURL ); + String aFact( sURL ); if ( aPrefix.Len() == aFact.Match( aPrefix ) ) { - if ( !aServiceName.Len() ) - aServiceName = SfxObjectShell::GetServiceNameFromFactory( rURL ); - // it's a factory URL aFact.Erase( 0, aPrefix.Len() ); @@ -360,41 +421,16 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::bean aFact.Erase( nPos, aFact.Len() ); } - WildCard aSearchedFac( aFact.EraseAllChars('4').ToUpperAscii() ); - SFX_ITEMSET_ARG( &aSet, pDocumentTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE ); - INetURLObject aObj( rURL ); - if ( aParam.Len() ) { - sal_uInt16 nSlotId = (sal_uInt16) aParam.ToInt32(); - SfxRequest aReq( nSlotId, SFX_CALLMODE_SYNCHRON, pApp->GetPool() ); - aReq.AppendItem( SfxFrameItem ( SID_DOCFRAME, pFrame ) ); - const SfxPoolItem* pRet = pApp->ExecuteSlot( aReq ); - if ( pRet ) - { - // default must be set to true, because some return values - // cant be checked ... but indicates "success"! - bLoadState = sal_True; - - // On the other side some special slots return a boolean state, - // which can be set to FALSE. - SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, pRet ); - if (pItem) - bLoadState = pItem->GetValue(); - } - else - bLoadState = sal_False; - - if ( !bLoadState && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) + sal_Bool bSuccess = impl_createNewDocWithSlotParam( (sal_uInt16)aParam.ToInt32(), pTargetFrame ); + if ( !bSuccess && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) { - css::uno::Reference< css::frame::XFrame > axFrame; - wFrame->SetFrameInterface_Impl( axFrame ); + wFrame->SetFrameInterface_Impl( NULL ); wFrame->DoClose(); } - xFrame.clear(); - xListener.clear(); - return bLoadState; + return bSuccess; } String sTemplateURL; @@ -407,7 +443,10 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::bean } else { - sTemplateURL = SfxObjectFactory::GetStandardTemplate( aServiceName ); + if ( sServiceName.getLength() ) + sTemplateURL = SfxObjectFactory::GetStandardTemplate( sServiceName ); + else + sTemplateURL = SfxObjectFactory::GetStandardTemplate( SfxObjectShell::GetServiceNameFromFactory( sURL ) ); } BOOL bUseTemplate = (sTemplateURL.Len()>0); @@ -420,7 +459,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::bean if (pTemplateFilter) { pFilter = pTemplateFilter; - aFilterName = pTemplateFilter->GetName(); + sFilterName = pTemplateFilter->GetName(); // standard template set -> load it "AsTemplate" aSet.Put( SfxStringItem ( SID_FILE_NAME, sTemplateURL ) ); aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) ); @@ -437,174 +476,144 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::bean if ( !bUseTemplate ) { // execute "NewDocument" request - /* Attention! - #107913# - Pointers can't be used to check if two objects are equals! - E.g. the memory manager can reuse freed memory ... - and then the holded copy of a pointer will point to another - (and different!) object - may using the same type then before. - In such case we compare one object with itself ... - */ - SfxRequest aReq( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, aSet ); - aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, pFrame ) ); - aReq.AppendItem( SfxStringItem( SID_NEWDOCDIRECT, aFact ) ); - - if ( pDocumentTitleItem ) - aReq.AppendItem( *pDocumentTitleItem ); - - const SfxPoolItem* pRet = pApp->NewDocDirectExec_ImplOld(aReq); - if (pRet) - { - // default must be set to true, because some return values - // cant be checked ... but indicates "success"! - bLoadState = sal_True; - - // On the other side some special slots return a boolean state, - // which can be set to FALSE. - SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, pRet ); - if (pItem) - bLoadState = pItem->GetValue(); - } - else - bLoadState = sal_False; - - if ( !bLoadState && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) + sal_Bool bSuccess = impl_createNewDoc( aSet, pTargetFrame, aFact );; + if ( !bSuccess && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) { - css::uno::Reference< css::frame::XFrame > axFrame; - wFrame->SetFrameInterface_Impl( axFrame ); + wFrame->SetFrameInterface_Impl( NULL ); wFrame->DoClose(); } - - xFrame.clear(); - xListener.clear(); - return bLoadState; + return bSuccess; } } else { // load the desired file - aSet.Put( SfxStringItem ( SID_FILE_NAME, rURL ) ); + aSet.Put( SfxStringItem ( SID_FILE_NAME, sURL ) ); } - aSet.Put( SfxFrameItem( SID_DOCFRAME, pFrame ) ); - aSet.Put( SfxUnoAnyItem( SID_FILLFRAME, css::uno::makeAny(xFrame) ) ); - aSet.Put( SfxStringItem( SID_FILTER_NAME, aFilterName ) ); - - // !TODO: replace by direct construction of model (needs view factory) - DBG_ASSERT( pFilter, "No filter set!" ); + DBG_ASSERT( pFilter, "SfxFrameLoader_Impl::load: could not determine a filter!" ); if ( !pFilter ) return sal_False; + // !TODO: replace by direct construction of model (needs view factory) sal_Bool bDisaster = sal_False; SfxObjectShell* pDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() ); - if ( pDoc ) + if ( !pDoc ) + return sal_False; + + aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); + aSet.Put( SfxUnoAnyItem( SID_FILLFRAME, makeAny( _rTargetFrame ) ) ); + aSet.Put( SfxStringItem( SID_FILTER_NAME, sFilterName ) ); + + sal_Bool bLoadSuccess = sal_False; + try { - css::uno::Reference< css::frame::XLoadable > xLoadable = css::uno::Reference< css::frame::XLoadable >( pDoc->GetModel(), css::uno::UNO_QUERY ); - css::uno::Sequence < css::beans::PropertyValue > aLoadArgs; + Reference< XLoadable > xLoadable( pDoc->GetModel(), UNO_QUERY ); + Sequence< PropertyValue > aLoadArgs; TransformItems( SID_OPENDOC, aSet, aLoadArgs ); - try - { - xLoadable->load( aLoadArgs ); - - SfxMedium* pDocMedium = pDoc->GetMedium(); - BOOL bHidden = FALSE; - SFX_ITEMSET_ARG( pDocMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False); - if ( pHidItem ) - bHidden = pHidItem->GetValue(); - - // !TODO: will be done by Framework! - pDocMedium->SetUpdatePickList( !bHidden ); - - /* - #121119# - We dont know why pFrame can be corrupt here. - But if it was deleted it shouldnt exists inside our global list. - May be we can use the damaged pointer to detect if it was removed from - this global list. - */ - SfxFrame* pTmp=0; - for ( pTmp = SfxFrame::GetFirst(); pTmp; pTmp = SfxFrame::GetNext( *pTmp ) ) - { - if ( pFrame == pTmp ) - break; - } - if ( pTmp == pFrame ) - { - // !TODO: replace by ViewFactory - if ( pFrame->GetFrameInterface()->getController().is() ) - { - // remove old component - // if a frame was created already, it can't be an SfxComponent! - // pFrame->GetFrameInterface()->setComponent( 0, 0 ); - if ( !bFrameCreated ) - pFrame = SfxTopFrame::Create( rFrame ); - } - - wFrame = pFrame; - aSet.Put( SfxFrameItem( SID_DOCFRAME, pFrame ) ); - if( pFrame->InsertDocument( pDoc ) ) - { - pFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); - String aURL = pDoc->GetMedium()->GetName(); - SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) ); - bLoadState = sal_True; - } - else - bDisaster = sal_True; - } - else - { - DBG_ERROR("#121119# You found the reason for a stacktrace! Frame destroyed while loading document."); - bLoadState = sal_False; - } + xLoadable->load( aLoadArgs ); + + SfxMedium* pDocMedium = pDoc->GetMedium(); + BOOL bHidden = FALSE; + SFX_ITEMSET_ARG( pDocMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False); + if ( pHidItem ) + bHidden = pHidItem->GetValue(); + + // !TODO: will be done by Framework! + pDocMedium->SetUpdatePickList( !bHidden ); + + impl_ensureValidFrame_throw( pTargetFrame ); + + // !TODO: replace by ViewFactory + if ( pTargetFrame->GetFrameInterface()->getController().is() ) + { + // remove old component + // if a frame was created already, it can't be an SfxComponent! + //pTargetFrame->GetFrameInterface()->setComponent( 0, 0 ); + if ( !bFrameCreated ) + pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); } - catch ( css::uno::Exception& ) + + wFrame = pTargetFrame; + aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); + pTargetFrame->SetItemSet_Impl( &aSet ); + if ( pTargetFrame->InsertDocument( pDoc ) ) { + pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); + String aURL = pDoc->GetMedium()->GetName(); + SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) ); + bLoadSuccess = sal_True; + } + else bDisaster = sal_True; + } + catch ( css::uno::Exception& ) + { + bDisaster = sal_True; + } + + if ( bDisaster ) + { + if ( wFrame && !wFrame->GetCurrentDocument() ) + { + // document loading was not successful; close SfxFrame (but not XFrame!) + wFrame->SetFrameInterface_Impl( NULL ); + wFrame->DoClose(); } - if ( bDisaster ) + Reference< XCloseable > xCloseable( pDoc->GetModel(), UNO_QUERY ); + if ( xCloseable.is() ) { - if ( wFrame && !wFrame->GetCurrentDocument() ) + try { - // document loading was not successful; close SfxFrame (but not XFrame!) - css::uno::Reference< css::frame::XFrame > axFrame; - wFrame->SetFrameInterface_Impl( axFrame ); - wFrame->DoClose(); - aSet.ClearItem( SID_DOCFRAME ); + xCloseable->close( sal_True ); } - - css::uno::Reference< css::util::XCloseable > xCloseable( xLoadable, css::uno::UNO_QUERY ); - if ( xCloseable.is() ) + catch ( css::uno::Exception& ) { - try { - xCloseable->close( sal_True ); - } catch ( css::uno::Exception& ) - {} + DBG_UNHANDLED_EXCEPTION(); } } } - xFrame.clear(); - xListener.clear(); - return bLoadState; + return bLoadSuccess; +} + +void SfxFrameLoader_Impl::impl_ensureValidFrame_throw( const SfxFrame* _pFrame ) +{ + /* + #121119# + We dont know why pTargetFrame can be corrupt here. + But if it was deleted it shouldnt exists inside our global list. + May be we can use the damaged pointer to detect if it was removed from + this global list. + */ + SfxFrame* pTmp = NULL; + for ( pTmp = SfxFrame::GetFirst(); pTmp; pTmp = SfxFrame::GetNext( *pTmp ) ) + { + if ( _pFrame == pTmp ) + // all fine, frame still alive + return; + } + + DBG_ERROR( "#121119# You found the reason for a stacktrace! Frame destroyed while loading document." ); + throw RuntimeException( ::rtl::OUString(), *this ); } -void SfxFrameLoader_Impl::cancel() throw( RUNTIME_EXCEPTION ) +void SfxFrameLoader_Impl::cancel() throw( RuntimeException ) { } SFX_IMPL_SINGLEFACTORY( SfxFrameLoader_Impl ) /* XServiceInfo */ -UNOOUSTRING SAL_CALL SfxFrameLoader_Impl::getImplementationName() throw( UNORUNTIMEEXCEPTION ) +UNOOUSTRING SAL_CALL SfxFrameLoader_Impl::getImplementationName() throw( RuntimeException ) { return impl_getStaticImplementationName(); } \ /* XServiceInfo */ -sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const UNOOUSTRING& sServiceName ) throw( UNORUNTIMEEXCEPTION ) +sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const UNOOUSTRING& sServiceName ) throw( RuntimeException ) { UNOSEQUENCE< UNOOUSTRING > seqServiceNames = getSupportedServiceNames(); const UNOOUSTRING* pArray = seqServiceNames.getConstArray(); @@ -619,7 +628,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const UNOOUSTRING& sServ } /* XServiceInfo */ -UNOSEQUENCE< UNOOUSTRING > SAL_CALL SfxFrameLoader_Impl::getSupportedServiceNames() throw( UNORUNTIMEEXCEPTION ) +UNOSEQUENCE< UNOOUSTRING > SAL_CALL SfxFrameLoader_Impl::getSupportedServiceNames() throw( RuntimeException ) { return impl_getStaticSupportedServiceNames(); } diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index bf88a5775d..a7c4a91ac6 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -800,34 +800,14 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) pSet = pDoc->GetMedium()->GetItemSet(); SetItemSet_Impl(0); - // Position und Gr"o\se - SFX_ITEMSET_ARG( - pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); - // View-Id - SFX_ITEMSET_ARG( - pSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); - // Zoom - SFX_ITEMSET_ARG( - pSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); - // Hidden - SFX_ITEMSET_ARG( - pSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False); - // ViewDaten - SFX_ITEMSET_ARG( - pSet, pViewDataItem, SfxStringItem, SID_USER_DATA, sal_False ); - // ViewOnly - SFX_ITEMSET_ARG( - pSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False); - // InPlace (Hack) - SFX_ITEMSET_ARG( - pSet, pPluginItem, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); - - // Plugin (external InPlace) - SFX_ITEMSET_ARG( - pSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False); - // Jump (GotoBookmark) - SFX_ITEMSET_ARG( - pSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False); + SFX_ITEMSET_ARG( pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size + SFX_ITEMSET_ARG( pSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID + SFX_ITEMSET_ARG( pSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom + SFX_ITEMSET_ARG( pSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False ); // hidden + SFX_ITEMSET_ARG( pSet, pViewDataItem, SfxStringItem, SID_USER_DATA, sal_False ); // view data + SFX_ITEMSET_ARG( pSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False ); // view only + SFX_ITEMSET_ARG( pSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) + SFX_ITEMSET_ARG( pSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) if ( pEditItem && pEditItem->GetValue() ) SetMenuBarOn_Impl( FALSE ); @@ -838,36 +818,34 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) if( !pImp->bHidden ) pDoc->OwnerLock( sal_True ); - // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation - // aus den Dokument geladen werden, z.B. weil InsertDocument seinerseits - // aus LoadWindows_Impl aufgerufen wurde! - if ( !pJumpItem && !pPluginMode && pDoc && !pAreaItem && !pViewIdItem && !pModeItem && - pDoc->LoadWindows_Impl( this ) ) - { - if ( GetCurrentDocument() != pDoc ) - // something went wrong during insertion - return sal_False; - pDoc->OwnerLock( sal_False ); - return sal_True; - } - if ( pDoc ) { + // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation + // aus den Dokument geladen werden, z.B. weil InsertDocument seinerseits + // aus LoadWindows_Impl aufgerufen wurde! + if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) + { + if ( pDoc->LoadWindows_Impl( *this ) ) + { + if ( GetCurrentDocument() != pDoc ) + // something went wrong during insertion + return sal_False; + pDoc->OwnerLock( sal_False ); + return sal_True; + } + } + UpdateHistory( pDoc ); UpdateDescriptor( pDoc ); } SetFrameType_Impl( GetFrameType() & ~SFXFRAME_FRAMESET ); - sal_Bool bBrowsing = sal_True; SfxViewFrame *pFrame = GetCurrentViewFrame(); if ( pFrame ) { sal_Bool bChildActivated = sal_False; if ( pFrame->GetActiveChildFrame_Impl() && pFrame->GetActiveChildFrame_Impl() == SfxViewFrame::Current() ) { -// ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier > xFrames( GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); -// if ( xFrames.is() ) -// xFrames->setActiveFrame( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > () ); pFrame->SetActiveChildFrame_Impl(0); SfxViewFrame::SetViewFrame( pFrame ); bChildActivated = sal_True; @@ -888,15 +866,14 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) // 1: internal embedded object // 2: external embedded object // 3: OLE server - if ( pPluginItem && pPluginItem->GetValue() != 2 ) + if ( pPluginMode && pPluginMode->GetValue() != 2 ) SetInPlace_Impl( TRUE ); - bBrowsing = sal_False; pFrame = new SfxTopViewFrame( this, pDoc, pViewIdItem ? pViewIdItem->GetValue() : 0 ); if ( !pFrame->GetViewShell() ) return sal_False; - if ( pPluginItem && pPluginItem->GetValue() == 1 ) + if ( pPluginMode && pPluginMode->GetValue() == 1 ) { pFrame->ForceOuterResize_Impl( FALSE ); pFrame->GetBindings().HidePopups(TRUE); @@ -912,9 +889,8 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) } String aMark; - SFX_ITEMSET_ARG( pSet, pMarkItem, SfxStringItem, SID_JUMPMARK, FALSE ); - if ( pMarkItem ) - aMark = pMarkItem->GetValue(); + if ( pJumpItem ) + aMark = pJumpItem->GetValue(); if ( pDoc->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) { @@ -966,7 +942,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) if ( !pImp->bHidden ) { - if ( pDoc->IsHelpDocument() || (pPluginItem && pPluginItem->GetValue() == 2) ) + if ( pDoc->IsHelpDocument() || (pPluginMode && pPluginMode->GetValue() == 2) ) pFrame->GetDispatcher()->HideUI( TRUE ); else pFrame->GetDispatcher()->HideUI( FALSE ); @@ -981,7 +957,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) pFrame->GetDispatcher()->Update_Impl(); pFrame->Show(); GetWindow().Show(); - if ( !IsInPlace() || (pPluginItem && pPluginItem->GetValue() == 3) ) + if ( !IsInPlace() || (pPluginMode && pPluginMode->GetValue() == 3) ) pFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); pDoc->OwnerLock( sal_False ); @@ -993,13 +969,13 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) pFrame->UnlockAdjustPosSizePixel(); // force resize for OLE server to fix layout problems of writer and math // see i53651 - if ( pPluginItem && pPluginItem->GetValue() == 3 ) + if ( pPluginMode && pPluginMode->GetValue() == 3 ) pFrame->Resize(TRUE); } } else { - DBG_ASSERT( !IsInPlace() && !pPluginMode && !pPluginItem, "Special modes not compatible with hidden mode!" ); + DBG_ASSERT( !IsInPlace() && !pPluginMode, "Special modes not compatible with hidden mode!" ); GetWindow().Show(); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 8f406833a5..4df56b3d4e 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1012,7 +1012,7 @@ void SfxViewFrame::ExecHistory_Impl( SfxRequest &rReq ) } else if ( GetViewShell() ) { - // der SW hat eigenes Undo an der ::com::sun::star::sdbcx::View + // der SW hat eigenes Undo an der View const SfxPoolItem *pRet = GetViewShell()->ExecuteSlot( rReq ); if ( pRet ) bOK = ((SfxBoolItem*)pRet)->GetValue(); @@ -1034,7 +1034,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) SfxUndoManager *pShUndoMgr = pSh->GetUndoManager(); if ( !pShUndoMgr ) { - // der SW hat eigenes Undo an der ::com::sun::star::sdbcx::View + // der SW hat eigenes Undo an der View SfxWhichIter aIter( rSet ); SfxViewShell *pViewSh = GetViewShell(); if( !pViewSh ) return; @@ -1133,7 +1133,7 @@ void SfxViewFrame::SetObjectShell_Impl GetDocNumber_Impl(); } - // ::com::sun::star::sdbcx::View erzeugen + // View erzeugen if ( bDefaultView ) SetRestoreView_Impl( sal_False ); @@ -2235,7 +2235,7 @@ SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId ) LockAdjustPosSizePixel(); - // passende ::com::sun::star::sdbcx::View-Factory suchen + // passende View-Factory suchen SfxObjectFactory &rDocFact = GetObjectShell()->GetFactory(); sal_uInt16 nNewNo = nViewId ? USHRT_MAX : 0; for ( sal_uInt16 nNo = 0; @@ -2371,16 +2371,16 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const sal_Bool SfxViewFrame::SwitchToViewShell_Impl ( sal_uInt16 nViewId, /* > 0 - Registrierungs-Id der ::com::sun::star::sdbcx::View, auf die umge- + Registrierungs-Id der View, auf die umge- schaltet werden soll, bzw. die erstmalig erzeugt werden soll. == 0 - Es soll die Default-::com::sun::star::sdbcx::View verwendet werden. */ + Es soll die Default-View verwendet werden. */ sal_Bool bIsIndex /* sal_True 'nViewId' ist keine Registrations-Id sondern - ein ::com::sun::star::sdbcx::Index in die f"ur die in diesem + ein Index in die f"ur die in diesem dargestellte . */ ) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 0f1ae3d110..bac24f88dc 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -440,6 +440,10 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) return; } + int provokeCrash = 0; + int dummy = 1 / provokeCrash; + (void)dummy; + const USHORT nId = rReq.GetSlot(); switch( nId ) { -- cgit v1.2.3 From 03bc1e04ab5e0c8a509dcb09d92f22f7d709a48b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 20 Nov 2009 15:17:30 +0100 Subject: [CWS autorecovery] removed some unused SfxFrame methods --- sfx2/inc/sfx2/frame.hxx | 46 +--- sfx2/inc/sfx2/objsh.hxx | 1 - sfx2/inc/sfx2/topfrm.hxx | 3 +- sfx2/inc/sfx2/viewfrm.hxx | 3 - sfx2/source/appl/app.cxx | 6 - sfx2/source/appl/appopen.cxx | 4 +- sfx2/source/doc/objcont.cxx | 65 +---- sfx2/source/view/frame.cxx | 558 ++---------------------------------------- sfx2/source/view/frmload.cxx | 13 +- sfx2/source/view/impframe.hxx | 2 - sfx2/source/view/topfrm.cxx | 65 ++--- sfx2/source/view/viewfrm.cxx | 35 +-- 12 files changed, 73 insertions(+), 728 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index e31df2c7e6..1fc641dd2e 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -103,7 +103,6 @@ DECLARE_LIST( TargetList, String* ) #define SFXFRAME_PLUGIN 0x0008 #define SFXFRAME_HASTITLE 0x0010 #define SFXFRAME_SERVER 0x0020 // Is es ein Frame, der in einem Container steckt ? -#define SFXFRAME_FRAMESET 0x0040 #define BROWSE_NORMAL 0 #define BROWSE_FORWARD 1 @@ -143,11 +142,6 @@ private: SfxFrame_Impl* pImp; SfxUnoFrame* pUnoImp; - SAL_DLLPRIVATE void UpdateUndoHistory_Impl( - SfxObjectShell *pDocSh, const String* pNew, const String *pTitle = 0 ); - SAL_DLLPRIVATE void UpdateCurrentHistory_Impl( - SfxObjectShell *pDocSh, const String* pNew ); - protected: virtual sal_Bool Close() = 0; virtual ~SfxFrame(); @@ -155,7 +149,6 @@ protected: //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void SetCurrentDocument_Impl( SfxObjectShell* ); SAL_DLLPRIVATE void InsertChildFrame_Impl( SfxFrame*, sal_uInt16 nPos = 0 ); - SAL_DLLPRIVATE void RemoveChildFrame_Impl( sal_uInt16 nPos ); SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* ); SAL_DLLPRIVATE void SetIsTop_Impl( sal_Bool bIsTop = sal_True ); //#endif @@ -170,19 +163,17 @@ public: sal_Bool DoClose(); sal_uInt16 GetChildFrameCount() const; SfxFrame* GetChildFrame( sal_uInt16 nPos ) const; - void SetFrameName( const String& rName ); const String& GetFrameName() const { return aName; } SfxFrame* GetParentFrame() const { return pParentFrame; } - String GetContent() const; static SfxFrame* GetFirst(); static SfxFrame* GetNext( SfxFrame& ); - virtual sal_Bool InsertDocument( SfxObjectShell *pDoc ); + static SfxViewFrame* + InsertDocument( SfxObjectShell& rDoc, SfxFrame*& rpTargetFrame, const USHORT nViewId = 0, const bool bHidden = false ); const SfxPoolItem* LoadDocumentSynchron( SfxItemSet& aSet ); - void DocumentInserted( SfxObjectShell* pDoc ); SfxBroadcaster& GetBroadcaster() const; SfxObjectShell* GetCurrentDocument() const; @@ -190,18 +181,10 @@ public: SfxFrame* GetTopFrame() const; sal_Bool IsParent( SfxFrame* ) const; - SfxFrame* findFrame( const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags); - SfxFrame* SearchFrame( const String&, SfxMedium* pMedium = 0 ); sal_uInt32 GetFrameType() const; void GetTargetList( TargetList& ) const; - void ClearHistory(); SAL_DLLPRIVATE SfxFrame* GetContainingDocFrame_Impl( SfxFrame* pSelf ); sal_Bool IsTop() const; - sal_Bool CloseChildFrames(); - void UpdatePickEntries(); - void UpdatePickEntries( const ::com::sun::star::uno::Any& rValue ); - void UpdateHistory( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::rtl::OUString& rTitle ); - void UpdateHistory(SfxObjectShell*, const String*pNew = 0 ); void UpdateDescriptor( SfxObjectShell *pDoc ); void Resize(); sal_Bool HasComponent() const; @@ -215,50 +198,27 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > GetController() const; - static sal_Bool LoadSfxComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &, - const ::rtl::OUString&, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&, - const SfxObjectFactory* ); - sal_Bool IsInPlace() const; //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE sal_Bool DoClose_Impl(); SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet ); - SAL_DLLPRIVATE const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > - GetInterceptor_Impl(); - SAL_DLLPRIVATE void Clear_Impl(); SAL_DLLPRIVATE sal_uInt16 LoadComponent_Impl( const ::rtl::OUString& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > & rLoader, SfxItemSet* pSet=0, sal_Bool bDontClose=sal_False ); - SAL_DLLPRIVATE void LoadFinished_Impl(); DECL_DLLPRIVATE_STATIC_LINK( SfxFrame, BindingHasNewPart_Impl, void* ); SAL_DLLPRIVATE SfxCancelManager* GetCancelManager() const; SAL_DLLPRIVATE void GetViewData_Impl(); - SAL_DLLPRIVATE sal_Bool CheckContentForLoad_Impl(); - SAL_DLLPRIVATE sal_Bool ExecuteHistoryMenu_Impl( sal_uInt16 nWnich, const Rectangle& rRect, sal_uInt16 nFlags=0 ); SAL_DLLPRIVATE void ActivatePickEntry_Impl( SfxFramePickEntry_Impl*, sal_uInt16 nMode, SfxFrameDescriptor *pD = NULL ); - SAL_DLLPRIVATE void CopyHistory_Impl( SfxFrame *pFrame ) const; - SAL_DLLPRIVATE SfxFrame* SearchChildrenForName_Impl( const String&, sal_Bool bDeep = sal_True ) const; SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 ); - SAL_DLLPRIVATE void Activate_Impl( sal_Bool bBeamerOn ); - SAL_DLLPRIVATE void Deactivate_Impl(); SAL_DLLPRIVATE sal_uInt16 PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing=sal_False ); SAL_DLLPRIVATE sal_Bool DocIsModified_Impl(); SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* ); - SAL_DLLPRIVATE SfxFrame* SearchFrame_Impl( sal_uInt16, sal_Bool bDeep=sal_False ); - SAL_DLLPRIVATE SfxFrame* SearchFrame_Impl( const String&, sal_Bool bDeep=sal_False ); - SAL_DLLPRIVATE void SetFrameId_Impl( sal_uInt16 ); - SAL_DLLPRIVATE sal_uInt16 GetFrameId_Impl() const; - SAL_DLLPRIVATE void SetFrameIdName_Impl( const String& ); SAL_DLLPRIVATE sal_Bool IsClosing_Impl() const; SAL_DLLPRIVATE void SetIsClosing_Impl(); - SAL_DLLPRIVATE sal_Bool BrowseInFrame( int nDelta ); SAL_DLLPRIVATE sal_Bool Browse( sal_Bool bForward, sal_uInt16 nDelta = 1, sal_Bool bNewFrame=sal_False ); - SAL_DLLPRIVATE sal_Bool CanBrowseForward() const; - SAL_DLLPRIVATE sal_Bool CanBrowseBackward() const; // Methoden f"ur den Zugriff auf das aktuelle Set SAL_DLLPRIVATE void SetDescriptor( SfxFrameDescriptor* ); @@ -290,8 +250,6 @@ public: SAL_DLLPRIVATE const SvBorder& GetBorder_Impl() const; SAL_DLLPRIVATE void GrabFocusOnComponent_Impl(); SAL_DLLPRIVATE void ReFill_Impl( const SfxFrameSetDescriptor* pSet ); - SAL_DLLPRIVATE void LockFocus_Impl( sal_Bool bLock ); - SAL_DLLPRIVATE sal_Bool IsFocusLocked_Impl() const; SAL_DLLPRIVATE void CloseDocument_Impl(); SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool ); // sal_Bool IsPlugin_Impl() const; diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index f3c926a23e..45423f1adf 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -788,7 +788,6 @@ public: SAL_DLLPRIVATE sal_uInt16& GetAktViewNo() { return nViewNo; } SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* ); SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 ); -//REMOVE FASTBOOL SaveWindows_Impl( SvStorage &rStor ) const; SAL_DLLPRIVATE SfxViewFrame* LoadWindows_Impl( SfxTopFrame& rPrefered ); SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl(); diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx index c74dbb9fe7..b7aef0e586 100644 --- a/sfx2/inc/sfx2/topfrm.hxx +++ b/sfx2/inc/sfx2/topfrm.hxx @@ -66,17 +66,16 @@ public: virtual Window& GetWindow() const; virtual BOOL Close(); - virtual BOOL InsertDocument( SfxObjectShell *pDoc ); String GetWindowData(); void SetPresentationMode( BOOL bSet ); SystemWindow* GetSystemWindow() const; //#if 0 // _SOLAR__PRIVATE + SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc ); SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock ); SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; - SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell *pDoc, USHORT nViewId=0 ); SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; SAL_DLLPRIVATE void CheckMenuCloser_Impl( MenuBar* pMenubar ); //#endif diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index b551a4942f..805d257ffc 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -165,7 +165,6 @@ public: SfxViewFrame( const SfxViewFrame &, SfxBindings &, SfxFrame *pFrame); - static SfxViewFrame* SearchViewFrame( SfxViewFrame*, const String& ); static void SetViewFrame( SfxViewFrame* ); static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, @@ -247,8 +246,6 @@ public: { return GetFrame()->GetFrameType(); } SfxFrame* GetTopFrame() const { return GetFrame()->GetTopFrame(); } - SfxFrame* SearchFrame( const String& rName, SfxMedium* pMedium = 0) - { return GetFrame()->SearchFrame( rName, pMedium ); } void GetTargetList( TargetList& rList ) const { GetFrame()->GetTargetList( rList ); } void CancelTransfers() diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index d1aa10f5de..bfd31a1ed2 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -495,12 +495,6 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) // BOOL bDocWinActivate = pOldContainerFrame && pNewContainerFrame && // pOldContainerFrame->GetTopViewFrame() == pNewContainerFrame->GetTopViewFrame(); BOOL bTaskActivate = pOldContainerFrame != pNewContainerFrame; - if ( pAppData_Impl->pViewFrame ) - { - if ( bTaskActivate ) - // prepare UI for deacivation - pAppData_Impl->pViewFrame->GetFrame()->Deactivate_Impl(); - } if ( pOldContainerFrame ) { diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 17b7b432eb..adca56638c 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -711,7 +711,9 @@ const SfxPoolItem* SfxApplication::NewDocDirectExec_ImplOld( SfxRequest& rReq ) if ( pFrame->GetCurrentDocument() != xDoc ) { - if ( pFrame->InsertDocument( xDoc ) ) + SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pFrame ); + OSL_ENSURE( pTopFrame, "An SfxFrame which is no SfxTopFrame?!" ); + if ( pTopFrame && pTopFrame->InsertDocument_Impl( *xDoc ) ) rReq.SetReturnValue( SfxFrameItem( 0, pFrame ) ); else xDoc->DoClose(); diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 733cb970d7..1cc519a111 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -192,67 +192,6 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig return pFile; } -//REMOVE FASTBOOL SfxObjectShell::SaveWindows_Impl( SvStorage &rStor ) const -//REMOVE { -//REMOVE SvStorageStreamRef xStream = rStor.OpenStream( DEFINE_CONST_UNICODE( SFX_WINDOWS_STREAM ), -//REMOVE STREAM_TRUNC | STREAM_STD_READWRITE); -//REMOVE if ( !xStream ) -//REMOVE return FALSE; -//REMOVE -//REMOVE xStream->SetBufferSize(1024); -//REMOVE xStream->SetVersion( rStor.GetVersion() ); -//REMOVE -//REMOVE // "uber alle Fenster iterieren (aber aktives Window zuletzt) -//REMOVE SfxViewFrame *pActFrame = SfxViewFrame::Current(); -//REMOVE if ( !pActFrame || pActFrame->GetObjectShell() != this ) -//REMOVE pActFrame = SfxViewFrame::GetFirst(this); -//REMOVE -//REMOVE String aActWinData; -//REMOVE for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame) ); pFrame; -//REMOVE pFrame = SfxViewFrame::GetNext(*pFrame, this, TYPE(SfxTopViewFrame) ) ) -//REMOVE { -//REMOVE // Bei Dokumenten, die Outplace aktiv sind, kann beim Speichern auch schon die View weg sein! -//REMOVE if ( pFrame->GetViewShell() ) -//REMOVE { -//REMOVE SfxTopFrame* pTop = (SfxTopFrame*) pFrame->GetFrame(); -//REMOVE pTop->GetTopWindow_Impl(); -//REMOVE -//REMOVE char cToken = ','; -//REMOVE const BOOL bActWin = pActFrame == pFrame; -//REMOVE String aUserData; -//REMOVE pFrame->GetViewShell()->WriteUserData(aUserData); -//REMOVE -//REMOVE // assemble ini-data -//REMOVE String aWinData; -//REMOVE aWinData += String::CreateFromInt32( pFrame->GetCurViewId() ); -//REMOVE aWinData += cToken; -//REMOVE /* -//REMOVE if ( !pWin || pWin->IsMaximized() ) -//REMOVE aWinData += SFX_WINSIZE_MAX; -//REMOVE else if ( pWin->IsMinimized() ) -//REMOVE aWinData += SFX_WINSIZE_MIN; -//REMOVE else -//REMOVE */ -//REMOVE aWinData += cToken; -//REMOVE aWinData += aUserData; -//REMOVE -//REMOVE // aktives kennzeichnen -//REMOVE aWinData += cToken; -//REMOVE aWinData += bActWin ? '1' : '0'; -//REMOVE -//REMOVE // je nachdem merken oder abspeichern -//REMOVE if ( bActWin ) -//REMOVE aActWinData = aWinData; -//REMOVE else -//REMOVE xStream->WriteByteString( aWinData ); -//REMOVE } -//REMOVE } -//REMOVE -//REMOVE // aktives Window hinterher -//REMOVE xStream->WriteByteString( aActWinData ); -//REMOVE return !xStream->GetError(); -//REMOVE } - //==================================================================== SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame& rPreferedFrame ) @@ -343,7 +282,7 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame& rPreferedFrame ) rBind.ENTERREGISTRATIONS(); // set document into frame - pCurrentTargetFrame->InsertDocument( this ); + pCurrentTargetFrame->InsertDocument_Impl( *this ); // restart controller updating rBind.LEAVEREGISTRATIONS(); @@ -368,7 +307,7 @@ SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame& rPreferedFrame ) if ( pCurrentTargetFrame ) { // Frame "ubergeben, allerdings ist der noch leer - pCurrentTargetFrame->InsertDocument( this ); + pCurrentTargetFrame->InsertDocument_Impl( *this ); pFrame = pCurrentTargetFrame->GetCurrentViewFrame(); } else diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 55a226234f..c0240e223c 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -217,53 +217,6 @@ sal_Bool SfxFrame::DoClose_Impl() return bRet; } -void SfxFrame::Clear_Impl() -{ - CancelTransfers(); - - // Bei FrameSets verhindern, da\s das Closen der Childs zu st"andigen - // ReCalcs im SplitWindow f"uhrt; SetUpdateMode am FrameWindow wirkt - // leider nicht auf dem MAC - Window *pWin = NULL; - SfxViewShell *pViewSh; - if ( pImp->pCurrentViewFrame && - 0 != ( pViewSh = pImp->pCurrentViewFrame->GetViewShell() ) ) - { - pWin = pViewSh->GetWindow(); - if ( pWin ) - pWin->Hide(); - } - - sal_Bool bRet = sal_True; - SfxBindings* pBindings = NULL; - if ( pImp->pCurrentViewFrame ) - { - pBindings = &pImp->pCurrentViewFrame->GetBindings(); - pImp->bClosing = sal_True; - bRet = pImp->pCurrentViewFrame->Close(); - pImp->bClosing = sal_False; - } - - if ( bRet ) - { - // Bei internen Tasks m"ussen Controller und Tools abger"aumt werden - if ( pImp->pWorkWin ) - { - pImp->pWorkWin->DeleteControllers_Impl(); - DELETEZ( pImp->pWorkWin ); - } - - if ( pImp->bOwnsBindings ) - delete pBindings; - } - else - { - if ( pWin ) - pWin->Show(); - } -} - - sal_Bool SfxFrame::DocIsModified_Impl() { if ( pImp->pCurrentViewFrame && pImp->pCurrentViewFrame->GetObjectShell() && @@ -344,61 +297,13 @@ void SfxFrame::InsertChildFrame_Impl( SfxFrame* pFrame, sal_uInt16 nPos ) pFrame->pParentFrame = this; } -void SfxFrame::RemoveChildFrame_Impl( sal_uInt16 nPos ) -{ - DBG_ASSERT( pChildArr, "Unbekannter Frame!"); - pChildArr->Remove( nPos ); -}; - void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame ) { DBG_ASSERT( pChildArr, "Unbekannter Frame!"); sal_uInt16 nPos = pChildArr->GetPos(pFrame); - RemoveChildFrame_Impl( nPos ); + pChildArr->Remove( nPos ); }; -sal_Bool SfxFrame::CloseChildFrames() -{ - sal_Bool bRet = sal_True; - if ( pChildArr ) - { - // Childs closen - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=nCount; n>0; n--) - { - SfxFrame* pFrame = (*pChildArr)[n-1]; - // pFrame removed sich selbst - bRet = pFrame->DoClose(); - if ( !bRet ) - break; - } - } - - return bRet; -} - -SfxFrame* SfxFrame::SearchChildrenForName_Impl( const String& rName, sal_Bool bDeep ) const -{ - if ( pChildArr ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=nCount; n>0; n--) - { - SfxFrame* pFrame = (*pChildArr)[n-1]; - if ( rName.CompareIgnoreCaseToAscii( pFrame->GetFrameName() ) == COMPARE_EQUAL ) - return pFrame; - if( bDeep ) - { - pFrame = pFrame->SearchChildrenForName_Impl( rName ); - if ( pFrame ) - return pFrame; - } - } - } - - return NULL; -} - SfxFrame* SfxFrame::GetTopFrame() const { SfxFrame *pParent = (SfxFrame*) this; @@ -407,95 +312,6 @@ SfxFrame* SfxFrame::GetTopFrame() const return pParent; } -SfxFrame* SfxFrame::SearchFrame( const String& rName, SfxMedium* /*pMedium*/ ) -{ - // Weil Netscape f"uhrende BLANKS "uberliest, m"ussen wir das wohl auch - // Sollte besser auch bei den FrameNames gemacht werden! - String aFrameName( rName ); - aFrameName.EraseLeadingChars(); - - SfxFrame *pFrame = this; - if( !aFrameName.Len() || aFrameName.CompareIgnoreCaseToAscii("_self") == COMPARE_EQUAL ) - { - return pFrame; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_smartself") == COMPARE_EQUAL ) - { - DBG_ERROR("Not supported!"); - return pFrame; - } - else if ( aFrameName.CompareIgnoreCaseToAscii( GetFrameName() ) == COMPARE_EQUAL) - { - // Eigener Name, kein Name oder Selbstbezug - return pFrame; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_parent") == COMPARE_EQUAL ) - { - // Gesucht ist das Parent Frameset - return pParentFrame ? pParentFrame : this; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_blank") == COMPARE_EQUAL ) - { - return NULL; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_top") == COMPARE_EQUAL ) - { - while ( pFrame->GetParentFrame() ) - pFrame = pFrame->GetParentFrame(); - return pFrame; - } - else - { - // Zuerst unterhalb dieses Frames absuchen - pFrame = SearchChildrenForName_Impl( aFrameName ); - } - - if ( !pFrame && GetParentFrame() ) - { - // Noch nichts gefunden, nach oben weitergehen - // Eigentlich m"u\sten Frames, die schon abgesucht wurden, aus - // Performance-Gr"unden markiert werden - SfxFrame *pParent = GetParentFrame(); - do - { - // Ist es der Parent ? - if ( aFrameName.CompareIgnoreCaseToAscii( pParent->GetFrameName() ) == COMPARE_EQUAL ) - return pParent; - - // Weiter nach oben - pParent = pParent->GetParentFrame(); - } - while ( pParent ); - } - - if( !pFrame ) - { - SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - // keinen Frame im MDI-Fenster gefunden. Jetzt die anderen - // Toplevel Frames checken. - SfxFrame *pTop = GetTopFrame(); - for( sal_uInt16 nPos = rArr.Count(); nPos--; ) - { - // Unser Topframe wurde bereits durchsucht - SfxFrame* pCurFrame = rArr[ nPos ]; - if( pCurFrame != pTop ) - { - if( aFrameName.CompareIgnoreCaseToAscii( pCurFrame->GetFrameName() ) == - COMPARE_EQUAL ) - return pCurFrame; - else - { - pFrame = pCurFrame->SearchChildrenForName_Impl( aFrameName ); - if( pFrame ) - return pFrame; - } - } - } - } - - return pFrame; -} - sal_Bool SfxFrame::IsClosing_Impl() const { return pImp->bClosing; @@ -506,19 +322,31 @@ void SfxFrame::SetIsClosing_Impl() pImp->bClosing = TRUE; } -void SfxFrame::DocumentInserted( SfxObjectShell* /*pDoc*/ ) -{ -} - sal_uInt16 SfxFrame::GetChildFrameCount() const { return pChildArr ? pChildArr->Count() : 0; } -sal_Bool SfxFrame::InsertDocument( SfxObjectShell* pDoc ) +SfxViewFrame* SfxFrame::InsertDocument( SfxObjectShell& rDoc, SfxFrame*& rpTargetFrame, const USHORT nViewId, const bool bHidden ) { - DocumentInserted( pDoc ); - return sal_True; + SfxViewFrame* pViewFrame = NULL; + + if ( rpTargetFrame ) + { + SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( rpTargetFrame ); + OSL_ENSURE( pTopFrame, "SfxFrame::InsertDocument: an SfxFrame which is no SfxTopFrame?!" ); + if ( bHidden ) + rDoc.PutItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); + pTopFrame->InsertDocument_Impl( rDoc ); + pViewFrame = rpTargetFrame->GetCurrentViewFrame(); + } + else + { + pViewFrame = SfxViewFrame::CreateViewFrame( rDoc, nViewId, bHidden ); + if( pViewFrame ) + rpTargetFrame = pViewFrame->GetFrame(); + } + return pViewFrame; } void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ ) @@ -592,56 +420,15 @@ void SfxFrame::SetFrameType_Impl( sal_uInt32 n ) pImp->nType = n; } -void SfxFrame::CopyHistory_Impl( SfxFrame* /*pFrame*/ ) const -{ -} - - -void SfxFrame::ClearHistory() -{ -} - -sal_Bool SfxFrame::ExecuteHistoryMenu_Impl( sal_uInt16 /*nWhich*/, const Rectangle& /*rRect*/, sal_uInt16 /*nFlags*/ ) -{ - return sal_True; -} - sal_Bool SfxFrame::Browse( sal_Bool /*bForward*/, sal_uInt16 /*nSteps*/, sal_Bool /*bNewFrame*/ ) { return FALSE; } -void SfxFrame::UpdatePickEntries() -{ -} - -void SfxFrame::UpdatePickEntries( const ::com::sun::star::uno::Any& /*rValue*/ ) -{ -} - -void SfxFrame::UpdateUndoHistory_Impl( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/, const String* /*pTitle*/ ) -{ -} - -void SfxFrame::UpdateCurrentHistory_Impl( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/ ) -{ -} - -void SfxFrame::UpdateHistory( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/ ) -{ -} - -void SfxFrame::UpdateHistory( - const ::rtl::OUString& /*aURL*/, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& /*aArgs*/, - const ::rtl::OUString& /*rTitle*/ ) -{ -} - void SfxFrame::GetViewData_Impl() { // Alle zwischen Laden und Entfernen "anderbaren Daten aktualisieren; die - // festen Daten werden nur einmal ( nach InsertDocument in UpdateDescriptor ) + // festen Daten werden nur einmal ( nach InsertDocument_Impl in UpdateDescriptor ) // geholt, um Zeit zu sparen. SfxViewFrame* pViewFrame = GetCurrentViewFrame(); if( pViewFrame && pViewFrame->GetViewShell() ) @@ -681,7 +468,7 @@ void SfxFrame::GetViewData_Impl() void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) { - // Beim InsertDocument wird der Descriptor des Frames aktualisiert + // Beim InsertDocument_Impl wird der Descriptor des Frames aktualisiert // und sein ItemSet neu initialisiert. Alle Daten, die f"ur ein sp"ateres // Restaurieren der View n"otig sind, sind damit festgehalten. // Soll das Dokument ersetzt werden, wird durch GetViewData_Impl (s.o.) @@ -735,20 +522,6 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) //------------------------------------------------------------------------- -sal_Bool SfxFrame::CanBrowseBackward() const -{ - return FALSE; -} - -//------------------------------------------------------------------------- - -sal_Bool SfxFrame::CanBrowseForward() const -{ - return FALSE; -} - -//------------------------------------------------------------------------- - void SfxFrame::SetDescriptor( SfxFrameDescriptor *pD ) { DBG_ASSERT( pD, "Kein Descriptor!" ); @@ -811,147 +584,11 @@ void SfxFrame::GetTargetList( TargetList& rList ) const //------------------------------------------------------------------------- -void SfxFrame::SetFrameId_Impl( sal_uInt16 nId ) -{ - pImp->nFrameId = nId; - if ( GetCurrentViewFrame() ) - GetCurrentViewFrame()->UpdateTitle(); -} - -sal_uInt16 SfxFrame::GetFrameId_Impl() const -{ - return pImp->nFrameId; -} - -void SfxFrame::SetFrameIdName_Impl( const String& rName ) -{ - pImp->aFrameIdName = rName; -} - -//------------------------------------------------------------------------- - -SfxFrame* SfxFrame::SearchFrame_Impl( sal_uInt16 nId, sal_Bool bDeep ) -{ - if ( pImp->nFrameId == nId ) - return this; - - if ( pChildArr ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=0; npImp->nFrameId == nId ) - return pFrame; - if ( bDeep ) - { - pFrame = pFrame->SearchFrame_Impl( nId, sal_True ); - if ( pFrame ) - return pFrame; - } - } - } - - return NULL; -} - -SfxFrame* SfxFrame::SearchFrame_Impl( const String& rName, sal_Bool bDeep ) -{ - if ( pImp->aFrameIdName == rName ) - return this; - - if ( pChildArr ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=0; npImp->aFrameIdName == rName ) - return pFrame; - if ( bDeep ) - { - pFrame = pFrame->SearchFrame_Impl( rName ); - if ( pFrame ) - return pFrame; - } - } - } - - return NULL; -} - -//------------------------------------------------------------------------- - -//------------------------------------------------------------------------- - -void SfxFrame::Activate_Impl( sal_Bool bBeamerOn ) - -/* [Description] - - Internal Activate-Handler, called from derived classes which supports - Activate-Handling. -*/ - -{ - if ( GetParentFrame() ) - GetParentFrame()->Activate_Impl( bBeamerOn ); -} - SfxBroadcaster& SfxFrame::GetBroadcaster() const { return *pImp; } -//------------------------------------------------------------------------- - -void SfxFrame::Deactivate_Impl() - -/* [Description] - - Internal Deactivate-Handler, called from derived classes which supports - Activate-Handling. -*/ - -{ - if( GetParentFrame() ) - GetParentFrame()->Deactivate_Impl(); -} - -String SfxFrame::GetContent() const -{ - SfxObjectShell *pObj = GetCurrentDocument(); - if ( !pObj || !pObj->GetMedium() ) - return String(); - else - return pObj->GetMedium()->GetName(); -} - -sal_Bool SfxFrame::CheckContentForLoad_Impl() -{ - if ( GetCurrentDocument() ) - { - SfxMedium* pMedium = GetCurrentDocument()->GetMedium(); -#ifdef DEBUG - SfxItemSet* pSet; - pSet = pMedium->GetItemSet(); -#endif - SfxItemSet* pNew = GetDescriptor()->GetArgs(); - - // Falls URLs nicht uebereinstimmen - if ( INetURLObject( GetDescriptor()->GetActualURL() ) != INetURLObject( pMedium->GetOrigURL() ) ) - return sal_True; - - // Falls die Filter nicht uebereinstimmen - SFX_ITEMSET_ARG( pNew, pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False ); - if( pMedium->GetOrigFilter() && pFilterItem && pFilterItem->GetValue() != pMedium->GetOrigFilter()->GetFilterName() ) - return sal_True; - - return sal_False; - } - - return (GetDescriptor()->GetActualURL().GetMainURL( INetURLObject::NO_DECODE ).getLength() != 0); -} - sal_Bool SfxFrame::IsParent( SfxFrame *pFrame ) const { SfxFrame *pParent = pParentFrame; @@ -1083,11 +720,6 @@ sal_Bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*n return sal_True; } -sal_Bool SfxFrame::BrowseInFrame( int /*nDelta*/ ) -{ - return sal_False; -} - SfxFrameIterator::SfxFrameIterator( const SfxFrame& rFrame, sal_Bool bRecur ) : pFrame( &rFrame ) , bRecursive( bRecur ) @@ -1132,116 +764,6 @@ SfxFrame* SfxFrameIterator::NextSibling_Impl( SfxFrame& rPrev ) return pRet; } -void SfxFrame::SetFrameName( const String& rName ) -{ - if ( pImp->pDescr ) - pImp->pDescr->SetName( rName ); - aName = rName; - if ( pImp->pCurrentViewFrame ) - pImp->pCurrentViewFrame->UpdateTitle(); - if ( GetFrameInterface().is() ) - GetFrameInterface()->setName( rName ); -} - -void SfxFrame::LoadFinished_Impl() -{ -} - -SfxFrame* SfxFrame::findFrame(const ::rtl::OUString& aTargetframename, sal_Int32 nSearchFlags) -{ - // Weil Netscape f"uhrende BLANKS "uberliest, m"ussen wir das wohl auch - // Sollte besser auch bei den FrameNames gemacht werden! - String aTargetName( aTargetframename ); - aTargetName.EraseLeadingChars(); - - SfxFrame *pFrame = this; - - if ( !aTargetName.Len() && GetParentFrame() && GetParentFrame()->GetCurrentViewFrame()->GetViewShell()->IsImplementedAsFrameset_Impl() ) - return GetParentFrame(); - - if( !aTargetName.Len() || aTargetName.CompareIgnoreCaseToAscii("_self") == COMPARE_EQUAL ) - return pFrame; - - if ( aTargetName.CompareIgnoreCaseToAscii("_smartself") == COMPARE_EQUAL ) - { - DBG_ERROR("Not supported!"); - return pFrame; - } - - if ( aTargetName.CompareIgnoreCaseToAscii("_parent") == COMPARE_EQUAL ) - { - // Gesucht ist das Parent Frameset - return pFrame->GetParentFrame(); - } - else if ( aTargetName.CompareIgnoreCaseToAscii("_blank") == COMPARE_EQUAL ) - { - return NULL; - - } - else if ( aTargetName.CompareIgnoreCaseToAscii("_top") == COMPARE_EQUAL ) - { - while ( pFrame->GetParentFrame() ) - pFrame = pFrame->GetParentFrame(); - return pFrame; - } - - if ( ( nSearchFlags & FRAME_SEARCH_SELF ) && aTargetName.CompareIgnoreCaseToAscii( GetFrameName() ) == COMPARE_EQUAL ) - { - // Eigener Name - return pFrame; - } - - if ( nSearchFlags & FRAME_SEARCH_CHILDREN ) - { - // Zuerst unterhalb dieses Frames absuchen - pFrame = SearchChildrenForName_Impl( aTargetName ); - } - - if ( ( nSearchFlags & FRAME_SEARCH_CHILDREN ) && !pFrame && GetParentFrame() ) - { - // Noch nichts gefunden, nach oben weitergehen - // Eigentlich m"u\sten Frames, die schon abgesucht wurden, aus - // Performance-Gr"unden markiert werden - SfxFrame *pParent = GetParentFrame(); - do - { - // Ist es der Parent ? - if ( aTargetName.CompareIgnoreCaseToAscii( pParent->GetFrameName() ) == COMPARE_EQUAL ) - return pParent; - - // Weiter nach oben - pParent = pParent->GetParentFrame(); - } - while ( pParent ); - } - - if( !pFrame ) - { - SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - // keinen Frame im MDI-Fenster gefunden. Jetzt die anderen - // Toplevel Frames checken. - SfxFrame *pTop = GetTopFrame(); - for( sal_uInt16 nPos = rArr.Count(); nPos--; ) - { - // Unser Topframe wurde bereits durchsucht - SfxFrame* pCurFrame = rArr[ nPos ]; - if( pCurFrame != pTop ) - { - if( aTargetName.CompareIgnoreCaseToAscii( pCurFrame->GetFrameName() ) == COMPARE_EQUAL ) - return pCurFrame; - else - { - pFrame = pCurFrame->SearchChildrenForName_Impl( aTargetName ); - if( pFrame ) - return pFrame; - } - } - } - } - - return pFrame; -} - sal_Bool SfxFrame::IsTop() const { return GetFrameInterface().is() ? GetFrameInterface()->isTop() : sal_False; @@ -1431,47 +953,11 @@ void SfxFrame::GrabFocusOnComponent_Impl() pWindow->GrabFocus(); } -const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > SfxFrame::GetInterceptor_Impl() -{ -//(mba)/compview: hier fehlt der Zugriff auf den Interceptor !!!!! - return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > (); -} - void SfxFrame::ReleasingComponent_Impl( sal_Bool bSet ) { pImp->bReleasingComponent = bSet; } -sal_Bool SfxFrame::LoadSfxComponent( - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & /*aFrame*/, - const ::rtl::OUString& /*aURL*/, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& /*aArgs*/, - const SfxObjectFactory* /*pFact*/ ) -{ - // get Implementation of xComponents ... - DBG_ERROR( "Should not be called anymore!" ); - return sal_False; -} - -void SfxFrame::LockFocus_Impl( sal_Bool bLock ) -{ - if ( pChildArr && pChildArr->Count() ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=0; npImp->bFocusLocked = bLock; - pFrame->LockFocus_Impl( bLock ); - } - } -} - -sal_Bool SfxFrame::IsFocusLocked_Impl() const -{ - return pImp->bFocusLocked; -} - sal_Bool SfxFrame::IsInPlace() const { return pImp->bInPlace; diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 14e9833386..4c8193c68b 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -386,13 +386,19 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV { if ( xModel == pDoc->GetModel() ) { + SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pTargetFrame ); + OSL_ENSURE( pTopFrame, "SfxFrameLoader_Impl::load: An SfxFrame which is no SfxTopFrame?!" ); + if ( !pTopFrame ) + return sal_False; + pTargetFrame->SetItemSet_Impl( &aSet ); aDescriptor.remove( "Model" ); aDescriptor.remove( "URL" ); xModel->attachResource( sURL, aDescriptor.getPropertyValues() ); - return pTargetFrame->InsertDocument( pDoc ); + + return pTopFrame->InsertDocument_Impl( *pDoc ); } } @@ -538,7 +544,10 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV wFrame = pTargetFrame; aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); pTargetFrame->SetItemSet_Impl( &aSet ); - if ( pTargetFrame->InsertDocument( pDoc ) ) + + SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pTargetFrame ); + OSL_ENSURE( pTopFrame, "SfxFrameLoader_Impl::load: An SfxFrame which is no SfxTopFrame?!" ); + if ( pTopFrame && pTopFrame->InsertDocument_Impl( *pDoc ) ) { pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); String aURL = pDoc->GetMedium()->GetName(); diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index de5995dfb8..c0312a1b54 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -73,7 +73,6 @@ friend class SfxFrame; sal_Bool bInCancelTransfers : 1; sal_Bool bOwnsBindings : 1; sal_Bool bReleasingComponent : 1; - sal_Bool bFocusLocked : 1; sal_Bool bInPlace : 1; SfxCancelManager* pCancelMgr; SfxCancellable* pLoadCancellable; @@ -97,7 +96,6 @@ friend class SfxFrame; bInCancelTransfers( sal_False ), bOwnsBindings( sal_False ), bReleasingComponent( sal_False ), - bFocusLocked( sal_False ), bInPlace( sal_False ), pCancelMgr( 0 ), pLoadCancellable( 0 ), diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index a7c4a91ac6..496cd19564 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -568,7 +568,7 @@ SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, BOOL bHi { if ( nViewId ) pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - pFrame->InsertDocument( pDoc ); + pFrame->InsertDocument_Impl( *pDoc ); if ( pWindow && !bHidden ) pWindow->Show(); } @@ -599,7 +599,7 @@ SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, Window* pWindow, USHORT { if ( nViewId ) pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - pFrame->InsertDocument( pDoc ); + pFrame->InsertDocument_Impl( *pDoc ); } return pFrame; @@ -781,14 +781,10 @@ String SfxTopFrame::GetWindowData() return aWinData; } -sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) +sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) /* [Beschreibung] */ { - // Spezielle Bedingungen testen: nicht im ModalMode! - if ( !SfxFrame::InsertDocument( pDoc ) ) - return sal_False; - SfxObjectShell *pOld = GetCurrentDocument(); // Position und Groesse testen @@ -797,7 +793,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) // an einer Task aufgerufen hat! ) const SfxItemSet* pSet = GetItemSet_Impl(); if ( !pSet ) - pSet = pDoc->GetMedium()->GetItemSet(); + pSet = rDoc.GetMedium()->GetItemSet(); SetItemSet_Impl(0); SFX_ITEMSET_ARG( pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size @@ -816,30 +812,25 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) pImp->bHidden = pHidItem->GetValue(); if( !pImp->bHidden ) - pDoc->OwnerLock( sal_True ); + rDoc.OwnerLock( sal_True ); - if ( pDoc ) + // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation + // aus den Dokument geladen werden, z.B. weil InsertDocument_Impl seinerseits + // aus LoadWindows_Impl aufgerufen wurde! + if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) { - // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation - // aus den Dokument geladen werden, z.B. weil InsertDocument seinerseits - // aus LoadWindows_Impl aufgerufen wurde! - if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) + if ( rDoc.LoadWindows_Impl( *this ) ) { - if ( pDoc->LoadWindows_Impl( *this ) ) - { - if ( GetCurrentDocument() != pDoc ) - // something went wrong during insertion - return sal_False; - pDoc->OwnerLock( sal_False ); - return sal_True; - } + if ( GetCurrentDocument() != &rDoc ) + // something went wrong during insertion + return sal_False; + rDoc.OwnerLock( sal_False ); + return sal_True; } - - UpdateHistory( pDoc ); - UpdateDescriptor( pDoc ); } - SetFrameType_Impl( GetFrameType() & ~SFXFRAME_FRAMESET ); + UpdateDescriptor( &rDoc ); + SfxViewFrame *pFrame = GetCurrentViewFrame(); if ( pFrame ) { @@ -858,8 +849,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) if ( pViewIdItem ) pFrame->SetViewData_Impl( pViewIdItem->GetValue(), String() ); - if ( pDoc ) - pFrame->SetObjectShell_Impl( *pDoc ); + pFrame->SetObjectShell_Impl( rDoc ); } else { @@ -869,7 +859,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) if ( pPluginMode && pPluginMode->GetValue() != 2 ) SetInPlace_Impl( TRUE ); - pFrame = new SfxTopViewFrame( this, pDoc, pViewIdItem ? pViewIdItem->GetValue() : 0 ); + pFrame = new SfxTopViewFrame( this, &rDoc, pViewIdItem ? pViewIdItem->GetValue() : 0 ); if ( !pFrame->GetViewShell() ) return sal_False; @@ -892,7 +882,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) if ( pJumpItem ) aMark = pJumpItem->GetValue(); - if ( pDoc->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) + if ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) { if ( pViewDataItem ) pFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True ); @@ -902,7 +892,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) else { // Daten setzen, die in FinishedLoading ausgewertet werden - MarkData_Impl*& rpMark = pDoc->Get_Impl()->pMarkData; + MarkData_Impl*& rpMark = rDoc.Get_Impl()->pMarkData; if (!rpMark) rpMark = new MarkData_Impl; rpMark->pFrame = GetCurrentViewFrame(); @@ -942,7 +932,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) if ( !pImp->bHidden ) { - if ( pDoc->IsHelpDocument() || (pPluginMode && pPluginMode->GetValue() == 2) ) + if ( rDoc.IsHelpDocument() || (pPluginMode && pPluginMode->GetValue() == 2) ) pFrame->GetDispatcher()->HideUI( TRUE ); else pFrame->GetDispatcher()->HideUI( FALSE ); @@ -959,7 +949,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) GetWindow().Show(); if ( !IsInPlace() || (pPluginMode && pPluginMode->GetValue() == 3) ) pFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); - pDoc->OwnerLock( sal_False ); + rDoc.OwnerLock( sal_False ); // Dont show container window! Its done by framework or directly // by SfxTopFrame::Create() or SfxViewFrame::ExecView_Impl() ... @@ -995,7 +985,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc ) GetCurrentViewFrame()->Resize(TRUE); } - SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), pDoc ) ); + SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); return sal_True; } @@ -1539,11 +1529,8 @@ void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest ) void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet ) { - if ( !GetFrame()->CanBrowseForward() ) - rItemSet.DisableItem( SID_BROWSE_FORWARD ); - - if ( !GetFrame()->CanBrowseBackward() ) - rItemSet.DisableItem( SID_BROWSE_BACKWARD ); + rItemSet.DisableItem( SID_BROWSE_FORWARD ); + rItemSet.DisableItem( SID_BROWSE_BACKWARD ); // Add/SaveToBookmark bei BASIC-IDE, QUERY-EDITOR etc. disablen SfxObjectShell *pDocSh = GetObjectShell(); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 4df56b3d4e..e1dc2de3ac 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -855,8 +855,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) pCurrView->SetRestoreView_Impl( bRestoreView ); //if( pView != this || !xNewObj.Is() ) { - SfxFrame *pFrame = pCurrView->GetFrame(); - pFrame->InsertDocument(xNewObj.Is() ? xNewObj : xOldObj ); + SfxTopFrame* pFrame = dynamic_cast< SfxTopFrame* >( pCurrView->GetFrame() ); + OSL_ENSURE( pFrame, "An SfxFrame which is no SfxTopFrame?!" ); + if ( pFrame ) + pFrame->InsertDocument_Impl( *xNewObj ); } } @@ -1110,8 +1112,6 @@ void SfxViewFrame::SetObjectShell_Impl if ( xObjSh.Is() && xObjSh->IsPreview() ) SetQuietMode_Impl( sal_True ); - GetFrame()->SetFrameType_Impl( GetFrameType() & ~SFXFRAME_FRAMESET ); - // Modulshell einf"ugen SfxModule* pModule = xObjSh->GetModule(); if( pModule ) @@ -1623,7 +1623,6 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) //------------------------------------------------------------------------ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) { - pImp->pFrame->DocumentInserted( pObjSh ); pImp->bInCtor = sal_True; pImp->pParentViewFrame = 0; pImp->bResizeInToOut = sal_True; @@ -1654,7 +1653,6 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) if ( xObjSh.Is() && xObjSh->IsPreview() ) SetQuietMode_Impl( sal_True ); - GetFrame()->SetFrameType_Impl( GetFrameType() & ~SFXFRAME_FRAMESET ); if ( pObjSh ) { pDispatcher->Push( *SFX_APP() ); @@ -2281,27 +2279,6 @@ SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId ) return pViewShell; } -//------------------------------------------------------------------------- -SfxViewFrame* SfxViewFrame::SearchViewFrame( SfxViewFrame *pViewFrame, - const String& rName ) -{ - if ( !pViewFrame ) - pViewFrame = SfxViewFrame::Current(); - if ( !pViewFrame ) - return NULL; - SfxFrame *pFrame = pViewFrame->GetFrame()->SearchFrame( rName ); - if ( !pFrame ) - return NULL; - - // Der Frame ist selbst ein ViewFrame oder enth"alt einen -/* - pViewFrame = PTR_CAST( SfxViewFrame, pFrame ); - if ( !pViewFrame && pFrame->GetChildFrameCount() ) - pViewFrame = PTR_CAST( SfxViewFrame, pFrame->GetChildFrame(0) ); -*/ - return pFrame->GetCurrentViewFrame(); -} - //------------------------------------------------------------------------- void SfxViewFrame::SetQuietMode_Impl( sal_Bool bOn ) @@ -2736,9 +2713,9 @@ void SfxViewFrame::ExecView_Impl { Reference < XFrame > xFrame; pFrameItem->GetValue() >>= xFrame; - SfxFrame* pFrame = SfxTopFrame::Create( xFrame ); + SfxTopFrame* pFrame = SfxTopFrame::Create( xFrame ); pMed->GetItemSet()->ClearItem( SID_HIDDEN ); - pFrame->InsertDocument( GetObjectShell() ); + pFrame->InsertDocument_Impl( *GetObjectShell() ); if ( !bHidden ) xFrame->getContainerWindow()->setVisible( sal_True ); } -- cgit v1.2.3 From b49ecd297060337086257da975798c4297730527 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 20 Nov 2009 15:37:27 +0100 Subject: #i10000# --- sfx2/source/view/frmload.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 4c8193c68b..220cf9cb12 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -134,7 +134,8 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt if ( aOrgArgs.has( "StatusIndicator" ) ) aNewArgs.put( "StatusIndicator", aOrgArgs.get( "StatusIndicator" ) ); - ::rtl::OUString sType = xDetect->queryTypeByDescriptor( aNewArgs.getPropertyValues(), sal_True ); + Sequence< PropertyValue > aQueryArgs( aNewArgs.getPropertyValues() ); + ::rtl::OUString sType = xDetect->queryTypeByDescriptor( aQueryArgs, sal_True ); if ( sType.getLength() ) { const SfxFilter* pFilter = rMatcher.GetFilter4EA( sType ); @@ -161,7 +162,6 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt // -------------------------------------------------------------------------------------------------------------------- const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& _rServiceName ) const { - const SfxFilter* pFilter = NULL; try { ::comphelper::NamedValueCollection aQuery; -- cgit v1.2.3 From 4c41419f31148aebd1e79aaddfedb9bd54efde91 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 22 Nov 2009 22:17:18 +0100 Subject: [CWS autorecovery] removed the unused "Save Window State with Document" option This happened in further preparation for issue #i65597#, where the current phase aims at changing the SFX-Document-Loader to be completely UNO-based, by introducing a UNO-ViewFactory in SFX. --- .../schema/org/openoffice/Office/Common.xcs | 11 -- sfx2/inc/sfx2/objsh.hxx | 2 +- sfx2/inc/sfx2/sfxsids.hrc | 4 +- sfx2/source/appl/appcfg.cxx | 15 -- sfx2/source/doc/objcont.cxx | 187 +++++++-------------- sfx2/source/view/topfrm.cxx | 6 +- sfx2/source/view/viewfrm.cxx | 2 +- 7 files changed, 68 insertions(+), 159 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 246b1bcdb9..bca79f4e30 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2223,17 +2223,6 @@ Dymamic border coloring means that when the mouse is hovered over a control, and true - - - - - - MBA - Specifies whether all currently open windows of a document should be saved. If true the view properties for all open document views of that document are saved. - - - false - diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 45423f1adf..933c904a09 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -788,7 +788,7 @@ public: SAL_DLLPRIVATE sal_uInt16& GetAktViewNo() { return nViewNo; } SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* ); SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 ); - SAL_DLLPRIVATE SfxViewFrame* LoadWindows_Impl( SfxTopFrame& rPrefered ); + SAL_DLLPRIVATE bool LoadView_Impl( SfxTopFrame& rPrefered ); SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl(); // configuration items diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 09a9849d7c..8d8a3ac3a0 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -873,7 +873,7 @@ #define SID_HELP_PI (SID_SFX_START + 962) #define SID_BASIC_ENABLED (SID_SFX_START + 964) #define SID_EXPORT_DIALOG (SID_SFX_START + 965) -#define SID_IMPORT_DIALOG (SID_SFX_START + 966) +#define SID_IMPORT_DIALOG (SID_SFX_START + 966) #define SID_BASICBREAK (SID_SFX_START +1521) @@ -1015,7 +1015,7 @@ #define SID_ATTR_AUTOSAVEMINUTE (SID_OPTIONS_START + 5) #define SID_ATTR_WORKINGSET (SID_OPTIONS_START + 13) #define SID_ATTR_UNDO_COUNT (SID_OPTIONS_START + 16) -#define SID_ATTR_SAVEDOCWINS (SID_OPTIONS_START + 17) + // unused #define SID_ATTR_SAVEDOCVIEW (SID_OPTIONS_START + 18) // GeneralTabPage diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 172c584c93..ee00e720b5 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -272,14 +272,6 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) bRet = FALSE; } break; - case SID_ATTR_SAVEDOCWINS : - { - bRet = TRUE; - if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCWINS)) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCWINS ), aSaveOptions.IsSaveDocWins()))) - bRet = FALSE; - } - break; case SID_ATTR_SAVEDOCVIEW : { bRet = TRUE; @@ -631,13 +623,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue()); } - // offene Fenster speichern - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCWINS), TRUE, &pItem)) - { - DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveDocWins(((const SfxBoolItem *)pItem)->GetValue()); - } - // Fenster-Einstellung speichern if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), TRUE, &pItem)) { diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 1cc519a111..0f9894ffd1 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -89,12 +89,11 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +using ::com::sun::star::document::XViewDataSupplier; +using ::com::sun::star::container::XIndexAccess; //==================================================================== -#define SFX_WINDOWS_STREAM "SfxWindows" -#define SFX_PREVIEW_STREAM "SfxPreview" - //==================================================================== static @@ -194,165 +193,101 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig //==================================================================== -SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame& rPreferedFrame ) +bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) { - if ( pImp->bLoadingWindows ) - return NULL; + return false; DBG_ASSERT( GetMedium(), "A Medium should exist here!"); - if( !GetMedium() ) - return 0; + if ( !GetMedium() ) + return false; // get correct mode SFX_APP(); SfxViewFrame* pPreferedViewFrame = rPreferedFrame.GetCurrentViewFrame(); - SvtSaveOptions aOpt; - BOOL bLoadDocWins = aOpt.IsSaveDocWins() && !pPreferedViewFrame; - - // try to get viewdata information for XML format - REFERENCE < XVIEWDATASUPPLIER > xViewDataSupplier( GetModel(), ::com::sun::star::uno::UNO_QUERY ); - REFERENCE < XINDEXACCESS > xViewData; + // obtain view data + Reference< XViewDataSupplier > xViewDataSupplier( GetModel(), UNO_QUERY ); + Reference< XIndexAccess > xViewData; if ( xViewDataSupplier.is() ) - { xViewData = xViewDataSupplier->getViewData(); - if ( !xViewData.is() ) - return NULL; - } - else - return NULL; - SfxViewFrame *pActiveFrame = 0; - String aWinData; - SfxItemSet *pSet = GetMedium()->GetItemSet(); + if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) + return false; + + SfxItemSet* pSet = GetMedium()->GetItemSet(); pImp->bLoadingWindows = TRUE; - BOOL bLoaded = FALSE; - sal_Int32 nView = 0; // get saved information for all views - SfxTopFrame* pCurrentTargetFrame = &rPreferedFrame; - while ( TRUE ) + // get viewdata and look for the stored ViewId + USHORT nViewId = 0; + SEQUENCE < PROPERTYVALUE > aUserData; + if ( xViewData->getByIndex( 0 ) >>= aUserData ) { - USHORT nViewId = 0; - String aUserData; // used in the binary format - SEQUENCE < PROPERTYVALUE > aSeq; // used in the XML format - - // XML format - // active view is the first view in the container - FASTBOOL bActive = ( nView == 0 ); - - if ( nView == xViewData->getCount() ) - // finished - break; - - // get viewdata and look for the stored ViewId - ::com::sun::star::uno::Any aAny = xViewData->getByIndex( nView++ ); - if ( aAny >>= aSeq ) + ::comphelper::NamedValueCollection aNamedUserData( aUserData ); + ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); + if ( sViewId.getLength() ) { - ::comphelper::NamedValueCollection aNamedUserData( aSeq ); - ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); - if ( sViewId.getLength() ) - { - sViewId = sViewId.copy( 4 ); // format is like in "view3" - nViewId = USHORT( sViewId.toInt32() ); - } + sViewId = sViewId.copy( 4 ); // format is like in "view3" + nViewId = USHORT( sViewId.toInt32() ); } + } - // load only active view, but current item is not the active one ? - // in XML format the active view is the first one - if ( !bLoadDocWins && !bActive ) - break; - - pSet->ClearItem( SID_USER_DATA ); - SfxViewFrame *pFrame = 0; - if ( pPreferedViewFrame ) + pSet->ClearItem( SID_USER_DATA ); + SfxViewFrame* pTargetFrame = pPreferedViewFrame; + if ( pTargetFrame ) + { + // use the frame from the arguments, but don't set a window size + if ( pTargetFrame->GetViewShell() || !pTargetFrame->GetObjectShell() ) { - // use the frame from the arguments, but don't set a window size - pFrame = pPreferedViewFrame; - if ( pFrame->GetViewShell() || !pFrame->GetObjectShell() ) - { - pSet->ClearItem( SID_VIEW_POS_SIZE ); - pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + pSet->ClearItem( SID_VIEW_POS_SIZE ); + pSet->ClearItem( SID_WIN_POSSIZE ); + pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - // avoid flickering controllers - SfxBindings &rBind = pFrame->GetBindings(); - rBind.ENTERREGISTRATIONS(); + // avoid flickering controllers + SfxBindings &rBind = pTargetFrame->GetBindings(); + rBind.ENTERREGISTRATIONS(); - // set document into frame - pCurrentTargetFrame->InsertDocument_Impl( *this ); + // set document into frame + rPreferedFrame.InsertDocument_Impl( *this ); - // restart controller updating - rBind.LEAVEREGISTRATIONS(); - } - else - { - // create new view - pFrame->CreateView_Impl( nViewId ); - } + // restart controller updating + rBind.LEAVEREGISTRATIONS(); } else { - if ( bLoadDocWins ) - { - // open in the background - pSet->Put( SfxUInt16Item( SID_VIEW_ZOOM_MODE, 0 ) ); - pSet->Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle() ) ); - } - - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - - if ( pCurrentTargetFrame ) - { - // Frame "ubergeben, allerdings ist der noch leer - pCurrentTargetFrame->InsertDocument_Impl( *this ); - pFrame = pCurrentTargetFrame->GetCurrentViewFrame(); - } - else - { - pFrame = SfxTopFrame::Create( this, nViewId, FALSE, pSet )->GetCurrentViewFrame(); - } - - // only temporary data, don't hold it in the itemset - pSet->ClearItem( SID_VIEW_POS_SIZE ); - pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->ClearItem( SID_VIEW_ZOOM_MODE ); - } - - bLoaded = TRUE; - - // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE - // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pFrame && pFrame->GetViewShell() ) - { - if ( aUserData.Len() ) - pFrame->GetViewShell()->ReadUserData( aUserData, !bLoadDocWins ); - else if ( aSeq.getLength() ) - pFrame->GetViewShell()->ReadUserDataSequence( aSeq, !bLoadDocWins ); + // create new view + pTargetFrame->CreateView_Impl( nViewId ); } + } + else + { + pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - // perhaps there are more windows to load - pCurrentTargetFrame = NULL; - - if ( bActive ) - pActiveFrame = pFrame; + // Frame "ubergeben, allerdings ist der noch leer + rPreferedFrame.InsertDocument_Impl( *this ); + pTargetFrame = rPreferedFrame.GetCurrentViewFrame(); - if( pPreferedViewFrame || !bLoadDocWins ) - // load only active window - break; + // only temporary data, don't hold it in the itemset + pSet->ClearItem( SID_VIEW_POS_SIZE ); + pSet->ClearItem( SID_WIN_POSSIZE ); + pSet->ClearItem( SID_VIEW_ZOOM_MODE ); } - if ( pActiveFrame ) + // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE + // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet + if ( pTargetFrame && pTargetFrame->GetViewShell() && aUserData.getLength() ) { - if ( !pPreferedViewFrame ) - // activate frame - pActiveFrame->MakeActive_Impl( TRUE ); + pTargetFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); } + if ( pTargetFrame && !pPreferedViewFrame ) + // activate frame + pTargetFrame->MakeActive_Impl( TRUE ); + pImp->bLoadingWindows = FALSE; - return pPreferedViewFrame && bLoaded ? pPreferedViewFrame : pActiveFrame; + return true; } //==================================================================== diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 496cd19564..03bb8687b4 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -789,7 +789,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) // Position und Groesse testen // Wenn diese schon gesetzt sind, soll offensichtlich nicht noch - // LoadWindows_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame() + // LoadView_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame() // an einer Task aufgerufen hat! ) const SfxItemSet* pSet = GetItemSet_Impl(); if ( !pSet ) @@ -816,10 +816,10 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation // aus den Dokument geladen werden, z.B. weil InsertDocument_Impl seinerseits - // aus LoadWindows_Impl aufgerufen wurde! + // aus LoadView_Impl aufgerufen wurde! if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) { - if ( rDoc.LoadWindows_Impl( *this ) ) + if ( rDoc.LoadView_Impl( *this ) ) { if ( GetCurrentDocument() != &rDoc ) // something went wrong during insertion diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e1dc2de3ac..5cfe61cc16 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2224,7 +2224,7 @@ SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId ) /* [Beschreibung] Erzeugt eine SfxViewShell f"ur diesen SfxViewFrame. Wird auch aus - + gerufen. */ -- cgit v1.2.3 From 0e969ad6fc9a6b33c33c8bcf086db3fb8d5cddf1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Nov 2009 14:20:13 +0100 Subject: [CWS autorecovery] #i65597# further refactored the loader code, cutting dead branches Sadly, there's still one use case which calls InsertDocument_Impl on a frame which already contains an SfxViewFrame: reloading the document (explicitly via SID_RELOAD, or implicitly via SID_EDITDOC). If this weren't the case, the code would look even simpler. On the medium run, the reload code should also be migrated to a ViewFactory usage. --- sfx2/inc/sfx2/topfrm.hxx | 1 + sfx2/source/doc/objcont.cxx | 62 +++++++---------- sfx2/source/doc/objxtor.cxx | 2 - sfx2/source/inc/objshimp.hxx | 2 - sfx2/source/view/frmload.cxx | 71 +++++-------------- sfx2/source/view/topfrm.cxx | 162 ++++++++++++++++++++----------------------- sfx2/source/view/viewfrm.cxx | 4 -- 7 files changed, 118 insertions(+), 186 deletions(-) diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx index b7aef0e586..ebea1b7b4c 100644 --- a/sfx2/inc/sfx2/topfrm.hxx +++ b/sfx2/inc/sfx2/topfrm.hxx @@ -78,6 +78,7 @@ public: SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; SAL_DLLPRIVATE void CheckMenuCloser_Impl( MenuBar* pMenubar ); + SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; //#endif }; diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 0f9894ffd1..09fbd8c213 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -193,19 +193,12 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig //==================================================================== -bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) +bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rTargetFrame ) { - if ( pImp->bLoadingWindows ) - return false; - DBG_ASSERT( GetMedium(), "A Medium should exist here!"); if ( !GetMedium() ) return false; - // get correct mode - SFX_APP(); - SfxViewFrame* pPreferedViewFrame = rPreferedFrame.GetCurrentViewFrame(); - // obtain view data Reference< XViewDataSupplier > xViewDataSupplier( GetModel(), UNO_QUERY ); Reference< XIndexAccess > xViewData; @@ -215,12 +208,7 @@ bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) return false; - SfxItemSet* pSet = GetMedium()->GetItemSet(); - - pImp->bLoadingWindows = TRUE; - - // get saved information for all views - // get viewdata and look for the stored ViewId + // obtain the ViewID from the view data USHORT nViewId = 0; SEQUENCE < PROPERTYVALUE > aUserData; if ( xViewData->getByIndex( 0 ) >>= aUserData ) @@ -234,23 +222,29 @@ bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) } } + SfxItemSet* pSet = GetMedium()->GetItemSet(); pSet->ClearItem( SID_USER_DATA ); - SfxViewFrame* pTargetFrame = pPreferedViewFrame; - if ( pTargetFrame ) + pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + + if ( rTargetFrame.GetCurrentViewFrame() ) { + // TODO: the only client of this case is the Reload-implementation for SFX-based documents. This should be + // migrated to use UNO mechanisms, too. In this case, we can simplify the code here. + // use the frame from the arguments, but don't set a window size - if ( pTargetFrame->GetViewShell() || !pTargetFrame->GetObjectShell() ) + SfxViewFrame* pViewFrame = rTargetFrame.GetCurrentViewFrame(); + if ( pViewFrame->GetViewShell() || !pViewFrame->GetObjectShell() ) { pSet->ClearItem( SID_VIEW_POS_SIZE ); pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + pSet->ClearItem( SID_VIEW_ZOOM_MODE ); // avoid flickering controllers - SfxBindings &rBind = pTargetFrame->GetBindings(); + SfxBindings &rBind = pViewFrame->GetBindings(); rBind.ENTERREGISTRATIONS(); // set document into frame - rPreferedFrame.InsertDocument_Impl( *this ); + rTargetFrame.InsertDocument_Impl( *this ); // restart controller updating rBind.LEAVEREGISTRATIONS(); @@ -258,35 +252,31 @@ bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) else { // create new view - pTargetFrame->CreateView_Impl( nViewId ); + pViewFrame->CreateView_Impl( nViewId ); } } else { - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - - // Frame "ubergeben, allerdings ist der noch leer - rPreferedFrame.InsertDocument_Impl( *this ); - pTargetFrame = rPreferedFrame.GetCurrentViewFrame(); - - // only temporary data, don't hold it in the itemset - pSet->ClearItem( SID_VIEW_POS_SIZE ); - pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->ClearItem( SID_VIEW_ZOOM_MODE ); + rTargetFrame.InsertDocument_Impl( *this ); } + SfxViewFrame* pViewFrame = rTargetFrame.GetCurrentViewFrame(); + + // only temporary data, don't hold it in the itemset + pSet->ClearItem( SID_VIEW_POS_SIZE ); + pSet->ClearItem( SID_WIN_POSSIZE ); + pSet->ClearItem( SID_VIEW_ZOOM_MODE ); // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pTargetFrame && pTargetFrame->GetViewShell() && aUserData.getLength() ) + if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) { - pTargetFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); + pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); } - if ( pTargetFrame && !pPreferedViewFrame ) + if ( pViewFrame ) // activate frame - pTargetFrame->MakeActive_Impl( TRUE ); + pViewFrame->MakeActive_Impl( TRUE ); - pImp->bLoadingWindows = FALSE; return true; } diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index d7470e9d8b..a5aa92af04 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -219,9 +219,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,bForbidCaching( sal_False ) ,bForbidReload( sal_False ) ,bSupportsEventMacros( sal_True ) - ,bLoadingWindows( sal_False ) ,bBasicInitialized( sal_False ) -// ,bHidden( sal_False ) ,bIsPrintJobCancelable( sal_True ) ,bOwnsStorage( sal_True ) ,bNoBaseURL( sal_False ) diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index 8ee3b79a6f..e9380b0010 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -103,9 +103,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess bForbidCaching : 1, bForbidReload : 1, bSupportsEventMacros: 1, - bLoadingWindows: 1, bBasicInitialized :1, - //bHidden :1, // indicates a hidden view shell bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable! bOwnsStorage:1, bNoBaseURL:1, diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 4c8193c68b..3b30522509 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -354,43 +354,15 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( !pRefererItem ) aSet.Put( SfxStringItem( SID_REFERER, String() ) ); - SfxFrame* pTargetFrame = NULL; - for ( pTargetFrame = SfxFrame::GetFirst(); pTargetFrame; pTargetFrame = SfxFrame::GetNext( *pTargetFrame ) ) - { - if ( pTargetFrame->GetFrameInterface() == _rTargetFrame ) - break; - } - - BOOL bFrameCreated = FALSE; - if ( !pTargetFrame ) - { - pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - bFrameCreated = TRUE; - } - + SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); if ( xModel.is() ) { - // !TODO: replace by ViewFactory - if ( _rTargetFrame->getController().is() ) - { - // remove old component - // if a frame was created already, it can't be an SfxComponent! - _rTargetFrame->setComponent( NULL, NULL ); - if ( !bFrameCreated ) - pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - } - aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) { if ( xModel == pDoc->GetModel() ) { - SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pTargetFrame ); - OSL_ENSURE( pTopFrame, "SfxFrameLoader_Impl::load: An SfxFrame which is no SfxTopFrame?!" ); - if ( !pTopFrame ) - return sal_False; - pTargetFrame->SetItemSet_Impl( &aSet ); aDescriptor.remove( "Model" ); @@ -398,7 +370,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV xModel->attachResource( sURL, aDescriptor.getPropertyValues() ); - return pTopFrame->InsertDocument_Impl( *pDoc ); + // TODO: replace by ViewFactory + return pTargetFrame->InsertDocument_Impl( *pDoc ); } } @@ -430,7 +403,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( aParam.Len() ) { sal_Bool bSuccess = impl_createNewDocWithSlotParam( (sal_uInt16)aParam.ToInt32(), pTargetFrame ); - if ( !bSuccess && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) + if ( !bSuccess && wFrame && !wFrame->GetCurrentDocument() ) { wFrame->SetFrameInterface_Impl( NULL ); wFrame->DoClose(); @@ -482,8 +455,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( !bUseTemplate ) { // execute "NewDocument" request - sal_Bool bSuccess = impl_createNewDoc( aSet, pTargetFrame, aFact );; - if ( !bSuccess && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) + sal_Bool bSuccess = impl_createNewDoc( aSet, pTargetFrame, aFact ); + if ( !bSuccess && wFrame && !wFrame->GetCurrentDocument() ) { wFrame->SetFrameInterface_Impl( NULL ); wFrame->DoClose(); @@ -529,25 +502,20 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV // !TODO: will be done by Framework! pDocMedium->SetUpdatePickList( !bHidden ); + /* + #121119# + We dont know why _pFrame can be corrupt here. + But if it was deleted it shouldnt exists inside our global list. + May be we can use the damaged pointer to detect if it was removed from + this global list. + */ impl_ensureValidFrame_throw( pTargetFrame ); - // !TODO: replace by ViewFactory - if ( pTargetFrame->GetFrameInterface()->getController().is() ) - { - // remove old component - // if a frame was created already, it can't be an SfxComponent! - //pTargetFrame->GetFrameInterface()->setComponent( 0, 0 ); - if ( !bFrameCreated ) - pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - } - - wFrame = pTargetFrame; aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); - pTargetFrame->SetItemSet_Impl( &aSet ); - SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pTargetFrame ); - OSL_ENSURE( pTopFrame, "SfxFrameLoader_Impl::load: An SfxFrame which is no SfxTopFrame?!" ); - if ( pTopFrame && pTopFrame->InsertDocument_Impl( *pDoc ) ) + // !TODO: replace by ViewFactory + pTargetFrame->SetItemSet_Impl( &aSet ); + if ( pTargetFrame->InsertDocument_Impl( *pDoc ) ) { pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); String aURL = pDoc->GetMedium()->GetName(); @@ -590,13 +558,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV void SfxFrameLoader_Impl::impl_ensureValidFrame_throw( const SfxFrame* _pFrame ) { - /* - #121119# - We dont know why pTargetFrame can be corrupt here. - But if it was deleted it shouldnt exists inside our global list. - May be we can use the damaged pointer to detect if it was removed from - this global list. - */ SfxFrame* pTmp = NULL; for ( pTmp = SfxFrame::GetFirst(); pTmp; pTmp = SfxFrame::GetNext( *pTmp ) ) { diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 03bb8687b4..0f5fe87476 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -781,21 +781,48 @@ String SfxTopFrame::GetWindowData() return aWinData; } +void SfxTopFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const +{ + Window *pWin = pImp->pWindow; + + // Groesse setzen + const Size aAppWindow( pImp->pWindow->GetDesktopRectPixel().GetSize() ); + Point aPos( rWinArea.TopLeft() ); + Size aSz( rWinArea.GetSize() ); + if ( aSz.Width() && aSz.Height() ) + { + aPos.X() = Min(aPos.X(), + long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) ); + aPos.Y() = Min(aPos.Y(), + long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) ); + if ( aPos.X() + aSz.Width() < + aAppWindow.Width() + aSz.Width() / 2 && + aPos.Y() + aSz.Height() < + aAppWindow.Height() + aSz.Height() / 2 ) + { + pWin->SetPosPixel( aPos ); + pWin->SetOutputSizePixel( aSz ); + } + } +} + sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) /* [Beschreibung] */ { - SfxObjectShell *pOld = GetCurrentDocument(); + const SfxObjectShell* pOldDocument = GetCurrentDocument(); + OSL_PRECOND( pOldDocument == NULL, + "SfxTopFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); - // Position und Groesse testen - // Wenn diese schon gesetzt sind, soll offensichtlich nicht noch - // LoadView_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame() - // an einer Task aufgerufen hat! ) const SfxItemSet* pSet = GetItemSet_Impl(); if ( !pSet ) pSet = rDoc.GetMedium()->GetItemSet(); SetItemSet_Impl(0); + // Position und Groesse testen + // Wenn diese schon gesetzt sind, soll offensichtlich nicht noch + // LoadView_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame() + // an einer Task aufgerufen hat! ) SFX_ITEMSET_ARG( pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size SFX_ITEMSET_ARG( pSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID SFX_ITEMSET_ARG( pSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom @@ -814,6 +841,8 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) if( !pImp->bHidden ) rDoc.OwnerLock( sal_True ); + const USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : 0; + // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation // aus den Dokument geladen werden, z.B. weil InsertDocument_Impl seinerseits // aus LoadView_Impl aufgerufen wurde! @@ -831,42 +860,39 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) UpdateDescriptor( &rDoc ); - SfxViewFrame *pFrame = GetCurrentViewFrame(); - if ( pFrame ) + SfxViewFrame* pViewFrame = GetCurrentViewFrame(); + if ( pViewFrame ) { - sal_Bool bChildActivated = sal_False; - if ( pFrame->GetActiveChildFrame_Impl() && pFrame->GetActiveChildFrame_Impl() == SfxViewFrame::Current() ) + // TODO: the only client of this case is the Reload-implementation for SFX-based documents. This should be + // migrated to use UNO mechanisms, too. In this case, we can simplify the code here. + if ( pViewFrame->GetActiveChildFrame_Impl() && pViewFrame->GetActiveChildFrame_Impl() == SfxViewFrame::Current() ) { - pFrame->SetActiveChildFrame_Impl(0); - SfxViewFrame::SetViewFrame( pFrame ); - bChildActivated = sal_True; + pViewFrame->SetActiveChildFrame_Impl(0); + SfxViewFrame::SetViewFrame( pViewFrame ); } - if ( pFrame->GetObjectShell() ) + if ( pViewFrame->GetObjectShell() ) { - pFrame->ReleaseObjectShell_Impl( sal_False ); + pViewFrame->ReleaseObjectShell_Impl( sal_False ); } if ( pViewIdItem ) - pFrame->SetViewData_Impl( pViewIdItem->GetValue(), String() ); - pFrame->SetObjectShell_Impl( rDoc ); + pViewFrame->SetViewData_Impl( pViewIdItem->GetValue(), String() ); + pViewFrame->SetObjectShell_Impl( rDoc ); } else { - // 1: internal embedded object - // 2: external embedded object - // 3: OLE server if ( pPluginMode && pPluginMode->GetValue() != 2 ) SetInPlace_Impl( TRUE ); - pFrame = new SfxTopViewFrame( this, &rDoc, pViewIdItem ? pViewIdItem->GetValue() : 0 ); - if ( !pFrame->GetViewShell() ) + pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId ); + if ( !pViewFrame->GetViewShell() ) return sal_False; if ( pPluginMode && pPluginMode->GetValue() == 1 ) { - pFrame->ForceOuterResize_Impl( FALSE ); - pFrame->GetBindings().HidePopups(TRUE); + pViewFrame->ForceOuterResize_Impl( FALSE ); + pViewFrame->GetBindings().HidePopups(TRUE); // MBA: layoutmanager of inplace frame starts locked and invisible GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); @@ -878,77 +904,39 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) } } - String aMark; - if ( pJumpItem ) - aMark = pJumpItem->GetValue(); - - if ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) - { - if ( pViewDataItem ) - pFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True ); - else if( aMark.Len() ) - GetCurrentViewFrame()->GetViewShell()->JumpToMark( aMark ); - } - else - { - // Daten setzen, die in FinishedLoading ausgewertet werden - MarkData_Impl*& rpMark = rDoc.Get_Impl()->pMarkData; - if (!rpMark) - rpMark = new MarkData_Impl; - rpMark->pFrame = GetCurrentViewFrame(); - if ( pViewDataItem ) - rpMark->aUserData = pViewDataItem->GetValue(); - else - rpMark->aMark = aMark; - } + OSL_ENSURE( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT, + "SfxTopFrame::InsertDocument_Impl: so this code wasn't dead?" ); + // Before CWS autorecovery, there was code which postponed setting the ViewData/Mark to a later time + // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since loads this method + // here is never called before the load process finished. + if ( pViewDataItem ) + pViewFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True ); + else if( pJumpItem ) + pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); // Position und Groesse setzen - //sal_uInt16 nWinMode = pModeItem ? pModeItem->GetValue() : 1; - if ( pAreaItem && !pOld ) - { - Window *pWin = pImp->pWindow; - - // Groesse setzen - const Rectangle aWinRect( pAreaItem->GetValue() ); - const Size aAppWindow( pImp->pWindow->GetDesktopRectPixel().GetSize() ); - Point aPos( aWinRect.TopLeft() ); - Size aSz(aWinRect.GetSize()); - if ( aSz.Width() && aSz.Height() ) - { - aPos.X() = Min(aPos.X(), - long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) ); - aPos.Y() = Min(aPos.Y(), - long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) ); - if ( aPos.X() + aSz.Width() < - aAppWindow.Width() + aSz.Width() / 2 && - aPos.Y() + aSz.Height() < - aAppWindow.Height() + aSz.Height() / 2 ) - { - pWin->SetPosPixel( aPos ); - pWin->SetOutputSizePixel( aSz ); - } - } - } + if ( pAreaItem && !pOldDocument ) + PositionWindow_Impl( pAreaItem->GetValue() ); if ( !pImp->bHidden ) { if ( rDoc.IsHelpDocument() || (pPluginMode && pPluginMode->GetValue() == 2) ) - pFrame->GetDispatcher()->HideUI( TRUE ); + pViewFrame->GetDispatcher()->HideUI( TRUE ); else - pFrame->GetDispatcher()->HideUI( FALSE ); + pViewFrame->GetDispatcher()->HideUI( FALSE ); if ( IsInPlace() ) - pFrame->LockAdjustPosSizePixel(); + pViewFrame->LockAdjustPosSizePixel(); if ( pPluginMode && pPluginMode->GetValue() == 3) GetWorkWindow_Impl()->SetInternalDockingAllowed(FALSE); if ( !IsInPlace() ) - pFrame->GetDispatcher()->Update_Impl(); - pFrame->Show(); + pViewFrame->GetDispatcher()->Update_Impl(); + pViewFrame->Show(); GetWindow().Show(); if ( !IsInPlace() || (pPluginMode && pPluginMode->GetValue() == 3) ) - pFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); + pViewFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); rDoc.OwnerLock( sal_False ); // Dont show container window! Its done by framework or directly @@ -956,11 +944,11 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) if ( IsInPlace() ) { - pFrame->UnlockAdjustPosSizePixel(); + pViewFrame->UnlockAdjustPosSizePixel(); // force resize for OLE server to fix layout problems of writer and math // see i53651 if ( pPluginMode && pPluginMode->GetValue() == 3 ) - pFrame->Resize(TRUE); + pViewFrame->Resize(TRUE); } } else @@ -970,19 +958,19 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) } // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen! - pFrame->UpdateTitle(); + pViewFrame->UpdateTitle(); if ( !IsInPlace() ) { - if ( pFrame->GetViewShell()->UseObjectSize() ) + if ( pViewFrame->GetViewShell()->UseObjectSize() ) { - GetCurrentViewFrame()->UnlockAdjustPosSizePixel(); - GetCurrentViewFrame()->Resize(TRUE); - GetCurrentViewFrame()->ForceInnerResize_Impl( FALSE ); - GetCurrentViewFrame()->Resize(TRUE); + pViewFrame->UnlockAdjustPosSizePixel(); + pViewFrame->Resize(TRUE); + pViewFrame->ForceInnerResize_Impl( FALSE ); + pViewFrame->Resize(TRUE); } else - GetCurrentViewFrame()->Resize(TRUE); + pViewFrame->Resize(TRUE); } SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 5cfe61cc16..d53088b10e 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2269,10 +2269,6 @@ SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId ) GetDispatcher()->Push( *pViewShell->GetSubShell() ); pViewShell->PushSubShells_Impl(); -#if defined SFX_HINT_VIEWCREATED - GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_VIEWCREATED ) ); -#endif - GetBindings().LEAVEREGISTRATIONS(); DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" ); -- cgit v1.2.3 From 0bc5985b0d760d4dcbe2b8571f6583f266a3aa0b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Nov 2009 14:32:25 +0100 Subject: [CWS autorecovery] removed the dead code for moving to the last record in a separate thread Part of the code relied in the SfxCancellable, which is going to be removed. Also, this feature wasn't used anymore for a long time now, if we want to have it, again, we should better re-implement it. --- svx/source/form/fmshell.cxx | 12 +- svx/source/form/fmshimp.cxx | 472 ------------------------------------------- svx/source/form/fmstring.src | 4 - svx/source/inc/fmresids.hrc | 2 +- svx/source/inc/fmshimp.hxx | 167 --------------- 5 files changed, 3 insertions(+), 654 deletions(-) diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 7ae8d6a811..ba9e969ae0 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -301,9 +301,6 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing) m_pFormView && m_pFormView->GetActualOutDev() && m_pFormView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW) { - if (GetImpl()->HasAnyPendingCursorAction()) - GetImpl()->CancelAnyPendingCursorAction(); - SdrPageView* pCurPageView = m_pFormView->GetSdrPageView(); // sal_uInt16 nPos = pCurPageView ? pCurPageView->GetWinList().Find((OutputDevice*)m_pFormView->GetActualOutDev()) : SDRPAGEVIEWWIN_NOTFOUND; @@ -1126,8 +1123,8 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich) || m_bDesignMode || !GetImpl()->getActiveForm().is() || GetImpl()->isInFilterMode() - || ( GetImpl()->HasPendingCursorAction(GetImpl()->getNavController()) - && (SID_FM_RECORD_TOTAL != nWhich) + || ( /*GetImpl()->HasPendingCursorAction(GetImpl()->getNavController()) + && */(SID_FM_RECORD_TOTAL != nWhich) ) ) rSet.DisableItem(nWhich); @@ -1415,11 +1412,6 @@ void FmFormShell::SetDesignMode( sal_Bool _bDesignMode ) if ( _bDesignMode == m_bDesignMode ) return; - // if we are moving our data source cursor currently .... - if ( GetImpl()->HasAnyPendingCursorAction() ) - // ... cancel this - GetImpl()->CancelAnyPendingCursorAction(); - FmFormModel* pModel = GetFormModel(); if (pModel) // fuer die Zeit des Uebergangs das Undo-Environment ausschalten, das sichert, dass man dort auch nicht-transiente diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 801e3f613f..d07c4195ba 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -408,11 +408,6 @@ sal_Bool FmXBoundFormFieldIterator::ShouldHandleElement(const Reference< XInterf return aVal.hasValue(); } -//============================================================================== - -DECL_CURSOR_ACTION_THREAD(FmMoveToLastThread) -IMPL_CURSOR_ACTION_THREAD(FmMoveToLastThread, SVX_RES(RID_STR_MOVING_CURSOR), last()); - //------------------------------------------------------------------------------ sal_Bool isControlList(const SdrMarkList& rMarkList) { @@ -834,8 +829,6 @@ void FmXFormShell::disposing() { ::osl::ClearableMutexGuard aGuard(m_aAsyncSafety); - if (HasAnyPendingCursorAction()) - CancelAnyPendingCursorAction(); aGuard.clear(); DBG_ASSERT(!m_nInvalidationEvent, "FmXFormShell::~FmXFormShell : still have an invalidation event !"); @@ -1828,10 +1821,6 @@ void FmXFormShell::setActiveController( const Reference< XFormController>& xCont if (xController != m_xActiveController) { - // if there is a async cursor action running we have to restore the locking state of the controls of the old controller - if (HasPendingCursorAction(Reference< XResultSet>(m_xActiveForm, UNO_QUERY))) - restoreControlLocks(); - ::osl::ClearableMutexGuard aGuard(m_aAsyncSafety); // switch all nav dispatchers belonging to the form of the current nav controller to 'non active' Reference< XResultSet> xNavigationForm; @@ -1911,10 +1900,6 @@ void FmXFormShell::setActiveController( const Reference< XFormController>& xCont if (m_xNavigationController.is()) xNavigationForm = Reference< XResultSet>(m_xNavigationController->getModel(), UNO_QUERY); - // if there is a async cursor action running we have to lock the controls of the new controller - if (HasPendingCursorAction(Reference< XResultSet>(m_xActiveForm, UNO_QUERY))) - setControlLocks(); - m_bInActivate = sal_False; m_pShell->UIFeatureChanged(); @@ -3150,312 +3135,6 @@ void FmXFormShell::clearFilter() } } -//------------------------------------------------------------------------------ -void FmXFormShell::setControlLocks() -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::setControlLocks" ); - if ( impl_checkDisposed() ) - return; - - Reference< XTabController> xCtrler(getActiveController(), UNO_QUERY); - if (!xCtrler.is()) - return; - - Reference< XControlContainer> xControls(xCtrler->getContainer(), UNO_QUERY); - if (!xControls.is()) - return; - - DBG_ASSERT( m_aControlLocks.empty(), "FmXFormShell::setControlLocks: locking state array isn't empty (called me twice ?)!" ); - - Sequence< Reference< XControl> > aControls = xControls->getControls(); - const Reference< XControl>* pControls = aControls.getConstArray(); - - // iterate through all bound controls, remember the old locking state, set the lock - for (sal_Int32 i=0; i xCtrl(pControls[i], UNO_QUERY); - if (!xCtrl.is()) - { - // it may be a container of controls - Reference< XIndexAccess> xContainer(pControls[i], UNO_QUERY); - if (xContainer.is()) - { // no recursion. we only know top level control containers (e.g. grid controls) - for (sal_Int16 j=0; jgetCount(); ++j) - { - xContainer->getByIndex(j) >>= xCtrl; - if (!xCtrl.is()) - continue; - - m_aControlLocks.push_back( xCtrl->getLock() ); - xCtrl->setLock(sal_True); - } - } - continue; - } - - m_aControlLocks.push_back( xCtrl->getLock() ); - xCtrl->setLock(sal_True); - } -} - -//------------------------------------------------------------------------------ -void FmXFormShell::restoreControlLocks() -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::restoreControlLocks" ); - if ( impl_checkDisposed() ) - return; - - Reference< XTabController> xCtrler(getActiveController(), UNO_QUERY); - if (!xCtrler.is()) - return; - - Reference< XControlContainer> xControls(xCtrler->getContainer(), UNO_QUERY); - if (!xControls.is()) - return; - - Sequence< Reference< XControl> > aControls(xControls->getControls()); - const Reference< XControl>* pControls = aControls.getConstArray(); - - // iterate through all bound controls, restore the old locking state - size_t nBoundControl = 0; - for (sal_Int32 i=0; i xCtrl(pControls[i], UNO_QUERY); - if (!xCtrl.is()) - { - // it may be a container of controls - Reference< XIndexAccess> xContainer(pControls[i], UNO_QUERY); - if (xContainer.is()) - { // no recursion. we only know top level control containers (e.g. grid controls) - for (sal_Int16 j=0; jgetCount(); ++j) - { - xContainer->getByIndex(j) >>= xCtrl; - if (!xCtrl.is()) - continue; - - DBG_ASSERT( nBoundControl < m_aControlLocks.size(), "FmXFormShell::restoreControlLocks: m_aControlLocks is invalid!" ); - xCtrl->setLock( m_aControlLocks[ nBoundControl ] ); - ++nBoundControl; - } - } - continue; - } - - DBG_ASSERT( nBoundControl < m_aControlLocks.size(), "FmXFormShell::restoreControlLocks: m_aControlLocks is invalid!" ); - // a violation of this condition would mean a) setControlLocks hasn't been called or b) the ControlContainer - // has changed since the last call to setControlLocks. - // a) clearly is a fault of the programmer and b) shouldn't be possible (as we are in alive mode) - xCtrl->setLock( m_aControlLocks[ nBoundControl ] ); - ++nBoundControl; - } - ::std::vector< sal_Bool > aEmpty; - m_aControlLocks.swap( aEmpty ); -} - -//------------------------------------------------------------------------------ -void FmXFormShell::DoAsyncCursorAction(const Reference< XFormController>& _xController, CURSOR_ACTION _eWhat) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::DoAsyncCursorAction" ); - if ( impl_checkDisposed() ) - return; - - DBG_ASSERT(_xController.is(), "FmXFormShell::DoAsyncCursorAction : invalid argument !"); - DoAsyncCursorAction(Reference< XResultSet>(_xController->getModel(), UNO_QUERY), _eWhat); -} - -//------------------------------------------------------------------------------ -void FmXFormShell::DoAsyncCursorAction(const Reference< XResultSet>& _xForm, CURSOR_ACTION _eWhat) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::DoAsyncCursorAction" ); - if ( impl_checkDisposed() ) - return; - - ::osl::MutexGuard aGuard(m_aAsyncSafety); - DBG_ASSERT(_xForm.is(), "FmXFormShell::DoAsyncCursorAction : invalid argument !"); - - // build the access path for the form - if (HasPendingCursorAction(_xForm)) - { - DBG_ERROR("FmXFormShell::DoAsyncCursorAction : invalid call !"); - return; - } - - CursorActionDescription& rDesc = m_aCursorActions[ _xForm ]; - // [] will create a new one if non-existent - DBG_ASSERT(rDesc.pThread == NULL, "FmXFormShell::DoAsyncCursorAction : the cursor action thread for this form is still alive !"); - - Reference< XResultSet > xCursor( getInternalForm( _xForm ), UNO_QUERY ); - switch (_eWhat) - { - case CA_MOVE_TO_LAST : - rDesc.pThread = new FmMoveToLastThread( xCursor ); - break; - case CA_MOVE_ABSOLUTE: - DBG_ERROR("FmXFormShell::DoAsyncCursorAction : CA_MOVE_ABSOLUTE not supported yet !"); - return; - } - rDesc.pThread->SetTerminationHdl(LINK(this, FmXFormShell, OnCursorActionDone)); - rDesc.pThread->EnableSelfDelete(sal_False); - - rDesc.bCanceling = sal_False; - - // set the control locks before starting the thread - DBG_ASSERT(getInternalForm(m_xActiveForm) == m_xActiveForm, "FmXFormShell::DoAsyncCursorAction : the active form should always be a internal one !"); - if (getInternalForm(_xForm) == m_xActiveForm) - setControlLocks(); - - // go ... - rDesc.pThread->create(); - - // set a priority slightly below normal - rDesc.pThread->setPriority(::vos::OThread::TPriority_BelowNormal); -} - -//------------------------------------------------------------------------------ -sal_Bool FmXFormShell::HasPendingCursorAction(const Reference< XResultSet>& _xForm) const -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasPendingCursorAction" ); - if ( impl_checkDisposed() ) - return sal_False; - - if (!_xForm.is()) - return sal_False; - - // TODO: if we ever re-implement the asynchronous cursor actions, then this will happen - // in the controller, and not in the form. In such a case, we here probably need to check - // whether the controller for the form has this "pending cursor action" - - return sal_False; -} - -//------------------------------------------------------------------------------ -sal_Bool FmXFormShell::HasPendingCursorAction(const Reference< XFormController>& xController) const -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasPendingCursorAction" ); - if ( impl_checkDisposed() ) - return sal_False; - - if (!xController.is()) - return sal_False; - - return HasPendingCursorAction(Reference< XResultSet>(xController->getModel(), UNO_QUERY)); -} - -//------------------------------------------------------------------------------ -sal_Bool FmXFormShell::HasAnyPendingCursorAction() const -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasAnyPendingCursorAction" ); - ::osl::MutexGuard aGuard( const_cast< FmXFormShell* >( this )->m_aAsyncSafety ); - - for ( CursorActions::const_iterator aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter ) - { - if (((*aIter).second.pThread != NULL) || ((*aIter).second.nFinishedEvent != 0)) - return sal_True; - } - return sal_False; -} - -//------------------------------------------------------------------------------ -void FmXFormShell::CancelAnyPendingCursorAction() -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::CancelAnyPendingCursorAction" ); - if ( impl_checkDisposed() ) - return; - - ::osl::ResettableMutexGuard aGuard( m_aAsyncSafety ); - - CursorActions::iterator aIter; - for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter) - { - if (!(*aIter).second.nFinishedEvent && (*aIter).second.pThread) - { // the thread is really running - (*aIter).second.bCanceling = sal_True; - - aGuard.clear(); - (*aIter).second.pThread->StopItWait(); - // StopItWait returns after the termination handler (our OnCursorActionDone) has been called - aGuard.reset(); - } - } - - // all threads are finished (means canceled), now do the cleanup - for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter) - { - if ((*aIter).second.pThread) - { - LINK(this, FmXFormShell, OnCursorActionDoneMainThread).Call((*aIter).second.pThread); - DBG_ASSERT((*aIter).second.pThread == NULL, "FmXFormShell::CancelAnyPendingCursorAction : strange behaviour of OnCursorActionDoneMainThread !"); - } - } -} - -//------------------------------------------------------------------------------ -IMPL_LINK(FmXFormShell, OnCursorActionDone, FmCursorActionThread*, pThread) -{ - if ( impl_checkDisposed() ) - return 0L; - - ::osl::MutexGuard aGuard(m_aAsyncSafety); - - // search the pos of the thread within m_aCursorActions - CursorActions::iterator aIter; - for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter) - { - if ((*aIter).second.pThread == pThread) - break; - } - - DBG_ASSERT(aIter != m_aCursorActions.end(), "FmXFormShell::OnCursorActionDone : could not ::std::find the thread !"); - DBG_ASSERT((*aIter).second.nFinishedEvent == 0, "FmXFormShell::OnCursorActionDone : another 'ActionDone' for this thread is pending !"); - // as we allow only one async action at a time (per form) this shouldn't happen - - if (!(*aIter).second.bCanceling) - (*aIter).second.nFinishedEvent = Application::PostUserEvent(LINK(this, FmXFormShell, OnCursorActionDoneMainThread), pThread); - // if bCanceling is sal_True an other thread's execution is in CancelAnyPendingCursorAction - return 0L; -} - -//------------------------------------------------------------------------------ -IMPL_LINK(FmXFormShell, OnCursorActionDoneMainThread, FmCursorActionThread*, pThread) -{ - if ( impl_checkDisposed() ) - return 0L; - - ::osl::MutexGuard aGuard(m_aAsyncSafety); - - // search the pos of the thread within m_aCursorActions - CursorActions::iterator aIter = m_aCursorActions.find( pThread->getDataSource() ); - DBG_ASSERT(aIter != m_aCursorActions.end(), "FmXFormShell::OnCursorActionDoneMainThread : could not ::std::find the thread data !"); - DBG_ASSERT((*aIter).second.pThread == pThread, "FmXFormShell::OnCursorActionDoneMainThread : invalid thread data !"); - - // remember some thread parameters - Reference< XResultSet> xForm(pThread->getDataSource(), UNO_QUERY); - - // throw away the thread - delete (*aIter).second.pThread; - (*aIter).second.pThread = NULL; - (*aIter).second.nFinishedEvent = 0; - (*aIter).second.bCanceling = sal_False; - // as we allow exactly one thread per form we may remove this ones data from m_aCursorActions - m_aCursorActions.erase(aIter); - - DBG_ASSERT(getInternalForm(m_xActiveForm) == m_xActiveForm, "FmXFormShell::DoAsyncCursorAction : the active form should always be a internal one !"); - DBG_ASSERT(getInternalForm(xForm) == xForm, "FmXFormShell::DoAsyncCursorAction : the thread's form should always be a internal one !"); - // if one of the two asserts above fails the upcoming comparison is senseless - if (xForm == m_xActiveForm) - { - // the active controller belongs to the form where the action is finished - // -> re-enable the controls if they are not locked because of another running thread - if (!HasPendingCursorAction(xForm)) - restoreControlLocks(); - } - - m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(DatabaseSlotMap); - // it may not be neccessary but me thinks it's faster without the check if we really have to do this - - return 0L; -} - //------------------------------------------------------------------------------ void FmXFormShell::CreateExternalView() { @@ -4419,155 +4098,4 @@ void ControlConversionMenuController::StateChanged(sal_uInt16 nSID, SfxItemState } } -//================================================================== - -FmCursorActionThread::FmCursorActionThread(const Reference< XResultSet>& _xDataSource, const UniString& _rStopperCaption) - :m_xDataSource(_xDataSource) - ,m_sStopperCaption(_rStopperCaption) - ,m_bCanceled(sal_False) - ,m_bDeleteMyself(sal_False) - ,m_bDisposeCursor(sal_False) - ,m_bTerminated(sal_False) - ,m_bRunFailed(sal_False) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmCursorActionThread::FmCursorActionThread" ); - DBG_ASSERT(m_xDataSource.is() && Reference< XCancellable>(m_xDataSource, UNO_QUERY).is(), - "FmCursorActionThread::FmCursorActionThread : invalid cursor !"); -} - -//------------------------------------------------------------------------------ -void FmCursorActionThread::run() -{ - // On instantiation of a SfxCancellable the application is notified and 'switches on' the red stop button. - // Unfortunally this is conditioned with the acquirement of the solar mutex, and the application tries - // only once and ignores the notification if it fails. - // To prevent that we get the solar mutex and _block_ 'til we got it. - // As we are in the 'top level execution' of this thread (with a rather small stack and no other mutexes locked) - // we shouldn't experience problems with deadlocks ... - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); - ThreadStopper* pStopper = new ThreadStopper(this, m_sStopperCaption); - aSolarGuard.clear(); - - // we're not canceled yet - ::osl::ClearableMutexGuard aInitGuard(m_aAccessSafety); - m_bCanceled = sal_False; - m_bRunFailed = sal_False; - aInitGuard.clear(); - - // start it - try - { - RunImpl(); - } - catch(SQLException e) - { - ::osl::MutexGuard aErrorGuard(m_aAccessSafety); - m_bRunFailed = sal_True; - m_aRunException = e; - } - catch(Exception&) - { - DBG_ERROR("FmCursorActionThread::run : catched a non-database exception !"); - } - - - sal_Bool bReallyCanceled; - ::osl::ClearableMutexGuard aEvalGuard(m_aAccessSafety); - bReallyCanceled = m_bCanceled; - aEvalGuard.clear(); - - pStopper->OwnerTerminated(); - // this will cause the stopper to delete itself (in the main thread) so we don't have to care of the - // solar mutex -} - -//------------------------------------------------------------------------------ -void FmCursorActionThread::onTerminated() -{ - ::osl::ClearableMutexGuard aResetGuard(m_aAccessSafety); - if (m_aTerminationHandler.IsSet()) - m_aTerminationHandler.Call(this); - - if (IsCursorDisposeEnabled()) - { - Reference< ::com::sun::star::lang::XComponent> xDataSourceComponent(m_xDataSource, UNO_QUERY); - if (xDataSourceComponent.is()) - xDataSourceComponent->dispose(); - } - - aResetGuard.clear(); - // with this StopItWait has a chance to do it's Terminated() - - ::osl::MutexGuard aGuard(m_aFinalExitControl); - // Terminated() in StopItWait still returns sal_False - m_bTerminated = sal_True; - // Terminated() now returns sal_True, but StopItWait can't exit until this method exits (because of the guarded m_aFinalExitControl) - - if (IsSelfDeleteEnabled()) - delete this; -} - -//------------------------------------------------------------------------------ -void FmCursorActionThread::StopIt() -{ - ::osl::MutexGuard aGuard(m_aAccessSafety); - m_bCanceled = sal_True; - - Reference< XCancellable> xCancel(m_xDataSource, UNO_QUERY); - DBG_ASSERT(xCancel.is(), "FmCursorActionThread::StopIt : invalid cursor !"); - xCancel->cancel(); -} - -//------------------------------------------------------------------------------ -void FmCursorActionThread::StopItWait() -{ - StopIt(); - - while (!Terminated()) - ; - - // OnTerminated has been called, but we can't simply exit : Suppose the caller want's to delete the thread object - // immediately after returning from StopItWait. With the following guard we ensure that we exit this method - // only after onTerminated has exited. - ::osl::ClearableMutexGuard aGuard(m_aFinalExitControl); - - // now onTerminated has exited, so we can leave, too -} - -//------------------------------------------------------------------------------ -FmCursorActionThread::ThreadStopper::ThreadStopper(FmCursorActionThread* pOwner, const UniString& rTitle) - :SfxCancellable(SFX_APP()->GetCancelManager(), rTitle) - ,m_pOwner(pOwner) -{ -} - -//------------------------------------------------------------------------------ -void FmCursorActionThread::ThreadStopper::Cancel() -{ - if (!m_pOwner) // the owner is already terminated and we're waiting for the OnDeleteInMainThread event - return; - - ::osl::MutexGuard aGuard(m_pOwner->m_aAccessSafety); - if (IsCancelled()) - // we already did pass this to our owner - return; - - SfxCancellable::Cancel(); - m_pOwner->StopIt(); -} - -//------------------------------------------------------------------------------ -void FmCursorActionThread::ThreadStopper::OwnerTerminated() -{ - m_pOwner = NULL; - Application::PostUserEvent(LINK(this, FmCursorActionThread::ThreadStopper, OnDeleteInMainThread), this); -} - -//------------------------------------------------------------------------------ -IMPL_LINK(FmCursorActionThread::ThreadStopper, OnDeleteInMainThread, FmCursorActionThread::ThreadStopper*, pThis) -{ - delete pThis; - return 0L; -} - //============================================================================== diff --git a/svx/source/form/fmstring.src b/svx/source/form/fmstring.src index e8867d1ef0..99c2fe8077 100644 --- a/svx/source/form/fmstring.src +++ b/svx/source/form/fmstring.src @@ -217,10 +217,6 @@ String RID_STR_PROPTITLE_FORMATTED { Text [ en-US ] = "Formatted Field"; }; -String RID_STR_MOVING_CURSOR -{ - Text [ en-US ] = "align data source"; -}; String RID_STR_PROPTITLE_LISTBOX { Text [ en-US ] = "List Box"; diff --git a/svx/source/inc/fmresids.hrc b/svx/source/inc/fmresids.hrc index 867d82dd7c..cd709b16da 100644 --- a/svx/source/inc/fmresids.hrc +++ b/svx/source/inc/fmresids.hrc @@ -196,7 +196,7 @@ #define RID_STR_FILTER_FILTER_OR (RID_FORMS_START + 80) #define RID_STR_PROPTITLE_FORMATTED (RID_FORMS_START + 81) #define RID_STR_SYNTAXERROR (RID_FORMS_START + 82) -#define RID_STR_MOVING_CURSOR (RID_FORMS_START + 83) + // FREE #define RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY (RID_FORMS_START + 84) #define RID_STR_SEARCH_ANYWHERE (RID_FORMS_START + 85) #define RID_STR_SEARCH_BEGINNING (RID_FORMS_START + 86) diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 0e13eedb31..4ceb644b6f 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -71,7 +71,6 @@ #include "fmsrccfg.hxx" #include #include -#include #include #include #include @@ -122,21 +121,6 @@ protected: virtual sal_Bool ShouldStepInto(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rContainer) const; }; -//======================================================================== -// I would prefer this to be a struct local to FmXFormShell but unfortunately local structs/classes -// are somewhat difficult with some of our compilers -class FmCursorActionThread; -struct SAL_DLLPRIVATE CursorActionDescription -{ - FmCursorActionThread* pThread; - ULONG nFinishedEvent; - // we want to do the cleanup of the thread in the main thread so we post an event to ourself - sal_Bool bCanceling; - // this thread is being canceled - - CursorActionDescription() : pThread(NULL), nFinishedEvent(0), bCanceling(sal_False) { } -}; - class FmFormPage; //======================================================================== struct SAL_DLLPRIVATE FmLoadAction @@ -205,18 +189,6 @@ class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE // we explicitly switch off the propbrw before leaving the design mode // this flag tells us if we have to switch it on again when reentering - typedef ::std::map< - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >, - CursorActionDescription, - ::comphelper::OInterfaceCompare< ::com::sun::star::sdbc::XResultSet > - > CursorActions; - CursorActions m_aCursorActions; - // all actions on async cursors - - ::std::vector< sal_Bool > - m_aControlLocks; - // while doing a async cursor action we have to lock all controls of the active controller. - // m_aControlLocks remembers the previous lock states to be restored afterwards. ::osl::Mutex m_aAsyncSafety; // secure the access to our thread related members ::osl::Mutex m_aInvalidationSafety; @@ -563,20 +535,7 @@ private: // --------------------------------------------------- // asyncronous cursor actions/navigation slot handling - void setControlLocks(); // lock all controls of the active controller - void restoreControlLocks(); // restore the lock state of all controls of the active controller - public: - enum CURSOR_ACTION { CA_MOVE_TO_LAST, CA_MOVE_ABSOLUTE }; - void DoAsyncCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController>& _xController, CURSOR_ACTION _eWhat); - void DoAsyncCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xForm, CURSOR_ACTION _eWhat); - - sal_Bool HasAnyPendingCursorAction() const; - void CancelAnyPendingCursorAction(); - - sal_Bool HasPendingCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController>& _xController) const; - sal_Bool HasPendingCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xForm) const; - /** execute the given form slot

Warning. Only a small set of slots implemented currently.

@param _nSlot @@ -589,9 +548,6 @@ public: bool IsFormSlotEnabled( sal_Int32 _nSlot, ::com::sun::star::form::runtime::FeatureState* _pCompleteState = NULL ); protected: - DECL_LINK(OnCursorActionDone, FmCursorActionThread*); - DECL_LINK(OnCursorActionDoneMainThread, FmCursorActionThread*); - DECL_LINK( OnLoadForms, FmFormPage* ); }; @@ -646,127 +602,4 @@ public: SVX_DLLPRIVATE virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState); }; -//================================================================== -// FmCursorActionThread -//================================================================== - -class SAL_DLLPRIVATE FmCursorActionThread : public ::vos::OThread -{ - Link m_aTerminationHandler; // the handler to be called upon termination - ::com::sun::star::sdbc::SQLException m_aRunException; // the database exception thrown by RunImpl - ::osl::Mutex m_aAccessSafety; // for securing the multi-thread access - ::osl::Mutex m_aFinalExitControl; // see StopItWait - -protected: - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> m_xDataSource; // the cursor which we work with - -private: - - UniString m_sStopperCaption; // the caption for the ThreadStopper - sal_Bool m_bCanceled:1; // StopIt has been called ? - sal_Bool m_bDeleteMyself:1; // delete the thread upon termination (defaults to sal_False) ? - sal_Bool m_bDisposeCursor:1; // dispose the cursor upon termination (defaults to sal_False) ? - sal_Bool m_bTerminated:1; // onTerminated already called ? - sal_Bool m_bRunFailed:1; // a database execption occured in RunImpl ? - - // a ThreadStopper will be instantiated so that the open can be canceled via the UI - class ThreadStopper : protected SfxCancellable - { - FmCursorActionThread* m_pOwner; - - virtual ~ThreadStopper() { } - - public: - ThreadStopper(FmCursorActionThread* pOwner, const UniString& rTitle); - - virtual void Cancel(); - - virtual void OwnerTerminated(); - // Normally the Owner (a FmCursorActionThread) would delete the stopper when terminated. - // Unfortunally the application doesn't remove the 'red light' when a SfxCancellable is deleted - // if it (the app) can't acquire the solar mutex. The deletion is IGNORED then. So we have make - // sure that a) the stopper is deleted from inside the main thread (where the solar mutex is locked) - // and b) that in the time between the termination of the thread and the deletion of the stopper - // the latter doesn't access the former. - // The OwnerTerminated cares for both aspects. - // SO DON'T DELETE THE STOPPER EXPLICITLY ! - - protected: - // HACK HACK HACK HACK HACK : this should be private, but MSVC doesn't accept the LINK-macro then .... - DECL_LINK(OnDeleteInMainThread, ThreadStopper*); - }; - friend class FmCursorActionThread::ThreadStopper; - - -public: - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> getDataSource() const { return m_xDataSource; } - -private: - sal_Bool Terminated() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bTerminated; } - -public: - FmCursorActionThread(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource, const UniString& _rStopperCaption); - virtual ~FmCursorActionThread() {} - - // control of self-deletion - sal_Bool IsSelfDeleteEnabled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bDeleteMyself; } - void EnableSelfDelete(sal_Bool bEnable) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_bDeleteMyself = bEnable; } - - // control of cursor-dipose - sal_Bool IsCursorDisposeEnabled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bDisposeCursor; } - void EnableCursorDispose(sal_Bool bEnable) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_bDisposeCursor = bEnable; } - - // error-access - sal_Bool RunFailed() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bRunFailed; } - ::com::sun::star::sdbc::SQLException GetRunException() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_aRunException; } - - /// the excution (within the method "run") was canceled ? - sal_Bool WasCanceled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bCanceled; } - - /// the handler will be called synchronously (the parameter is a pointer to the thread) - void SetTerminationHdl(const Link& aTermHdl) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_aTerminationHandler = aTermHdl; } - - /// cancels the process. returns to the caller immediately. to be called from another thread (of course ;) - void StopIt(); - - /// cancels the process. does not return to the caller until the thread is terminated. - void StopItWait(); - -protected: - virtual void SAL_CALL run(); - virtual void SAL_CALL onTerminated(); - - /// called from within run. run itself handles (de)initialisation of the cancel handling. - virtual void RunImpl() = 0; -}; - -//------------------------------------------------------------------------------ - -#define DECL_CURSOR_ACTION_THREAD(classname) \ - \ -class SAL_DLLPRIVATE classname : public FmCursorActionThread \ -{ \ -public: \ - classname(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource); \ -protected: \ - virtual void RunImpl(); \ -}; \ - - -//------------------------------------------------------------------------------ - -#define IMPL_CURSOR_ACTION_THREAD(classname, caption, action) \ - \ -classname::classname(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource) \ - :FmCursorActionThread(_xDataSource, caption) \ -{ \ -} \ - \ -void classname::RunImpl() \ -{ \ - m_xDataSource->action; \ -} \ - - - #endif // _SVX_FMSHIMP_HXX -- cgit v1.2.3 From 8fa122916f83c0850cb0fcea611913bb688ae244 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Nov 2009 14:38:46 +0100 Subject: [CWS autorecovery] removed SfxCancellable/SfxCancelManager, and (part of) its transitive closure No real-life use cases for this exist anymore, since nowadays document loading happens synchronously all the time. --- sfx2/inc/inettbc.hxx | 13 ----- sfx2/inc/sfx2/app.hxx | 2 - sfx2/inc/sfx2/docfile.hxx | 14 ----- sfx2/inc/sfx2/frame.hxx | 3 -- sfx2/inc/sfx2/viewfrm.hxx | 2 - sfx2/source/appl/appdata.cxx | 2 - sfx2/source/appl/appmisc.cxx | 7 --- sfx2/source/appl/appquit.cxx | 3 -- sfx2/source/appl/appreg.cxx | 1 - sfx2/source/appl/appserv.cxx | 1 - sfx2/source/bastyp/progress.cxx | 34 +++--------- sfx2/source/doc/docfile.cxx | 114 +--------------------------------------- sfx2/source/doc/objmisc.cxx | 2 - sfx2/source/inc/appdata.hxx | 2 - sfx2/source/inet/inettbc.cxx | 100 ----------------------------------- sfx2/source/view/frame.cxx | 12 ----- sfx2/source/view/impframe.cxx | 58 -------------------- sfx2/source/view/impframe.hxx | 11 +--- sfx2/source/view/makefile.mk | 1 - sfx2/source/view/topfrm.cxx | 18 ++----- sfx2/source/view/viewfrm.cxx | 15 ------ svx/inc/linkmgr.hxx | 2 - svx/inc/pch/precompiled_svx.hxx | 1 - svx/source/svxlink/fileobj.cxx | 8 --- svx/source/svxlink/fileobj.hxx | 1 - svx/source/svxlink/linkmgr.cxx | 10 ---- 26 files changed, 12 insertions(+), 425 deletions(-) delete mode 100644 sfx2/source/view/impframe.cxx diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx index 8eb30d8ba2..9f08127071 100644 --- a/sfx2/inc/inettbc.hxx +++ b/sfx2/inc/inettbc.hxx @@ -77,19 +77,6 @@ public: virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ); }; -class SfxCancelToolBoxControl_Impl : public SfxToolBoxControl -{ -public: - - SFX_DECL_TOOLBOX_CONTROL(); - - SfxCancelToolBoxControl_Impl( USHORT nSlotId, USHORT nId, ToolBox& rBox ); - - virtual SfxPopupWindowType GetPopupWindowType() const; - virtual SfxPopupWindow* CreatePopupWindow(); - virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ); -}; - #endif #endif diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx index 39dde5cdc6..a19181d391 100644 --- a/sfx2/inc/sfx2/app.hxx +++ b/sfx2/inc/sfx2/app.hxx @@ -61,7 +61,6 @@ class AppSettings; struct SfxChildWinContextFactory; class SfxAppData_Impl; class SfxBindings; -class SfxCancelManager; class SfxChildWinFactArr_Impl; class SfxChildWindow; class SfxDispatcher; @@ -222,7 +221,6 @@ public: // members SfxFilterMatcher& GetFilterMatcher(); - SfxCancelManager* GetCancelManager() const; SfxMacroConfig* GetMacroConfig() const; SfxProgress* GetProgress() const; const String& GetLastSaveDirectory() const; diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index ad63ad325c..49a71c4ad7 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -51,7 +51,6 @@ #include #include -#include #include #include @@ -67,16 +66,6 @@ class SfxItemSet; class DateTime; class SvStringsDtor; class SvEaMgr; -class SfxPoolCancelManager_Impl; - -#define SFX_TFPRIO_SYNCHRON 0 -#define SFX_TFPRIO_DOC 10 -#define SFX_TFPRIO_VISIBLE_LOWRES_GRAPHIC 20 -#define SFX_TFPRIO_VISIBLE_HIGHRES_GRAPHIC 21 -#define SFX_TFPRIO_PLUGINS 40 -#define SFX_TFPRIO_INVISIBLE_LOWRES_GRAPHIC 50 -#define SFX_TFPRIO_INVISIBLE_HIGHRES_GRAPHIC 51 -#define SFX_TFPRIO_DOWNLOADS 60 #define S2BS(s) ByteString( s, RTL_TEXTENCODING_MS_1252 ) @@ -160,7 +149,6 @@ public: void SetLoadTargetFrame(SfxFrame* pFrame ); SfxFrame* GetLoadTargetFrame() const; - void CancelTransfers(); void SetReferer( const String& rRefer ); const String& GetReferer( ) const; @@ -276,8 +264,6 @@ public: SAL_DLLPRIVATE sal_Bool TransferVersionList_Impl( SfxMedium& rMedium ); SAL_DLLPRIVATE sal_Bool SaveVersionList_Impl( sal_Bool bUseXML ); SAL_DLLPRIVATE sal_Bool RemoveVersion_Impl( const ::rtl::OUString& rVersion ); - SAL_DLLPRIVATE SfxPoolCancelManager_Impl* GetCancelManager_Impl() const; - SAL_DLLPRIVATE void SetCancelManager_Impl( SfxPoolCancelManager_Impl* pMgr ); SAL_DLLPRIVATE void SetExpired_Impl( const DateTime& rDateTime ); SAL_DLLPRIVATE SvKeyValueIterator* GetHeaderAttributes_Impl(); diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 1fc641dd2e..1f611b590f 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -86,7 +86,6 @@ class SfxMedium; class SfxFrameHistory_Impl; class SfxDispatcher; class SfxMedium; -class SfxCancellable; class Rectangle; class SfxRequest; class SfxUnoControllerItem; @@ -125,7 +124,6 @@ DECLARE_LIST( TargetList, String* ) //========================================================================== class SfxFrameArr_Impl; -class SfxCancelManager; struct SfxFramePickEntry_Impl; class SfxUnoFrame; class SFX2_DLLPUBLIC SfxFrame @@ -209,7 +207,6 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > & rLoader, SfxItemSet* pSet=0, sal_Bool bDontClose=sal_False ); DECL_DLLPRIVATE_STATIC_LINK( SfxFrame, BindingHasNewPart_Impl, void* ); - SAL_DLLPRIVATE SfxCancelManager* GetCancelManager() const; SAL_DLLPRIVATE void GetViewData_Impl(); SAL_DLLPRIVATE void ActivatePickEntry_Impl( SfxFramePickEntry_Impl*, sal_uInt16 nMode, SfxFrameDescriptor *pD = NULL ); SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 ); diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 805d257ffc..4bf3010db3 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -51,7 +51,6 @@ class SfxProgress; class SvData; class SfxViewShell; class SvPseudoObject; -class SfxCancelManager; class SystemWindow; class Fraction; class Point; @@ -250,7 +249,6 @@ public: { GetFrame()->GetTargetList( rList ); } void CancelTransfers() { GetFrame()->CancelTransfers(); } - SfxCancelManager* GetCancelManager() const; void SetModalMode( BOOL ); BOOL IsInModalMode() const; diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index d04ebcf822..27c79c267c 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -101,7 +101,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) : pTopFrames( new SfxFrameArr_Impl ), pInitLinkList(0), pMatcher( 0 ), - pCancelMgr( 0 ), pLabelResMgr( 0 ), pAppDispatch(NULL), pTemplates( 0 ), @@ -152,7 +151,6 @@ SfxAppData_Impl::~SfxAppData_Impl() { DeInitDDE(); delete pTopFrames; - delete pCancelMgr; delete pSecureURLs; delete pBasicManager; diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 1768229b1d..abada7ed11 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -329,13 +329,6 @@ ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon( SfxBindings& rBind return 0; } -SfxCancelManager* SfxApplication::GetCancelManager() const -{ - if ( !pAppData_Impl->pCancelMgr ) - pAppData_Impl->pCancelMgr = new SfxCancelManager; - return pAppData_Impl->pCancelMgr; -} - SfxResourceManager& SfxApplication::GetResourceManager() const { return *pAppData_Impl->pResMgr; } BOOL SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; } SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; } diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 213abbb8df..32f55a667e 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -119,9 +119,6 @@ BOOL SfxApplication::QueryExit_Impl() } } */ - // alles canceln was zu canceln ist - GetCancelManager()->Cancel(TRUE); - /* SfxObjectShell *pLastDocSh = SfxObjectShell::GetFirst(); if ( bQuit ) diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index bbd1041f5f..3eefd9db5e 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -76,7 +76,6 @@ void SfxApplication::Registrations_Impl() // Controller SfxToolBoxControl::RegisterControl(SID_REPEAT); SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL); - SfxCancelToolBoxControl_Impl::RegisterControl(SID_BROWSE_STOP); SfxAppToolBoxControl_Impl::RegisterControl( SID_NEWDOCDIRECT ); SfxAppToolBoxControl_Impl::RegisterControl( SID_AUTOPILOTMENU ); }; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 7a70f6f094..8366ef82a8 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -71,7 +71,6 @@ #include #include #include -#include #include #include #include diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx index 06791f4435..1935bb2d16 100644 --- a/sfx2/source/bastyp/progress.cxx +++ b/sfx2/source/bastyp/progress.cxx @@ -80,7 +80,7 @@ void AddNumber_Impl( String& aNumber, sal_uInt32 nArg ) } } -struct SfxProgress_Impl : public SfxCancellable +struct SfxProgress_Impl { Reference < XStatusIndicator > xStatusInd; String aText, aStateText; @@ -144,11 +144,9 @@ void SfxProgress_Impl::Enable_Impl( BOOL bEnable ) // ----------------------------------------------------------------------- -SfxProgress_Impl::SfxProgress_Impl( const String &rTitle ) - : SfxCancellable( SFX_APP()->GetCancelManager(), rTitle ), - pActiveProgress( 0 ) +SfxProgress_Impl::SfxProgress_Impl( const String &/*rTitle*/ ) + : pActiveProgress( 0 ) { - SFX_APP()->GetCancelManager()->RemoveCancellable(this); } // ----------------------------------------------------------------------- @@ -186,21 +184,6 @@ SfxProgress::SfxProgress pImp->bRunning = TRUE; pImp->bAllowRescheduling = Application::IsInExecute();; - if ( pObjSh ) - { - for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pObjSh ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pObjSh ) ) - { - pFrame->GetCancelManager()->InsertCancellable( pImp ); -/* - SfxBindings& rBindings = pFrame->GetBindings(); - rBindings.Invalidate( SID_BROWSE_STOP ); - if ( !rBindings.IsInRegistrations() ) - rBindings.Update( SID_BROWSE_STOP ); - rBindings.Invalidate( SID_BROWSE_STOP ); - */ - } - } - pImp->xObjSh = pObjSh; pImp->aText = rText; pImp->nMax = nRange; @@ -242,12 +225,7 @@ SfxProgress::~SfxProgress() if( pImp->bIsStatusText == TRUE ) GetpApp()->HideStatusText( ); SfxObjectShell* pDoc = pImp->xObjSh; - if ( pDoc ) - { - for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDoc ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDoc ) ) - pFrame->GetCancelManager()->RemoveCancellable( pImp );//Invalidate( SID_BROWSE_STOP ); - } - else + if ( !pDoc ) SFX_APP()->Invalidate( SID_BROWSE_STOP ); delete pImp; } @@ -390,8 +368,8 @@ BOOL SfxProgress::SetState { // wurde via Stop-Button angehalten? - if ( pImp->IsCancelled() ) - return FALSE; +// if ( pImp->IsCancelled() ) +// return FALSE; if( pImp->pActiveProgress ) return TRUE; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index f44ac7c3ec..9b6f3f15f6 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -260,79 +260,6 @@ void SAL_CALL SfxMediumHandler_Impl::handle( const com::sun::star::uno::Referenc m_xInter->handle( xRequest ); } -//---------------------------------------------------------------- -class SfxPoolCancelManager_Impl : public SfxCancelManager , - public SfxCancellable , - public SfxListener , - public SvRefBase -{ - SfxCancelManagerWeak wParent; - - ~SfxPoolCancelManager_Impl(); -public: - SfxPoolCancelManager_Impl( SfxCancelManager* pParent, const String& rName ); - - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - using SfxCancelManager::Cancel; - virtual void Cancel(); -}; - -//---------------------------------------------------------------- -SV_DECL_IMPL_REF( SfxPoolCancelManager_Impl ) - - -//---------------------------------------------------------------- -SfxPoolCancelManager_Impl::SfxPoolCancelManager_Impl( SfxCancelManager* pParent, const String& rName ) - : SfxCancelManager( pParent ), - SfxCancellable( pParent ? pParent : this, rName ), - wParent( pParent ) -{ - if( pParent ) - { - StartListening( *this ); - SetManager( 0 ); - } -} - -//---------------------------------------------------------------- -SfxPoolCancelManager_Impl::~SfxPoolCancelManager_Impl() -{ - for( sal_uInt16 nPos = GetCancellableCount(); nPos--; ) - { - // nicht an Parent uebernehmen! - SfxCancellable* pCbl = GetCancellable( nPos ); - if ( pCbl ) - pCbl->SetManager( 0 ); - } -} - - -//---------------------------------------------------------------- -void SfxPoolCancelManager_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& /*rHint*/ ) -{ - if( !GetCancellableCount() ) SetManager( 0 ); - else if( !GetManager() ) - { - if( !wParent.Is() ) wParent = SFX_APP()->GetCancelManager(); - SetManager( wParent ); - } -} - -//---------------------------------------------------------------- -void SfxPoolCancelManager_Impl::Cancel() -{ - SfxPoolCancelManager_ImplRef xThis = this; - for( sal_uInt16 nPos = GetCancellableCount(); nPos--; ) - { - SfxCancellable* pCbl = GetCancellable( nPos ); - // Wenn wir nicht im Button stehen - if( pCbl && pCbl != this ) - pCbl->Cancel(); - if( GetCancellableCount() < nPos ) - nPos = GetCancellableCount(); - } -} - //---------------------------------------------------------------- class SfxMedium_Impl : public SvCompatWeakBase { @@ -341,7 +268,6 @@ public: sal_Bool bUpdatePickList : 1; sal_Bool bIsTemp : 1; sal_Bool bForceSynchron : 1; - sal_Bool bDontCreateCancellable : 1; sal_Bool bDownloadDone : 1; sal_Bool bDontCallDoneLinkOnSharingError : 1; sal_Bool bIsStorage: 1; @@ -357,7 +283,6 @@ public: uno::Reference < embed::XStorage > xStorage; - SfxPoolCancelManager_ImplRef xCancelManager; SfxMedium* pAntiImpl; long nFileVersion; @@ -398,8 +323,6 @@ public: uno::Reference< logging::XSimpleLogRing > m_xLogRing; - SfxPoolCancelManager_Impl* GetCancelManager(); - SfxMedium_Impl( SfxMedium* pAntiImplP ); ~SfxMedium_Impl(); }; @@ -415,29 +338,12 @@ void SfxMedium::Cancel_Impl() SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); } -SfxPoolCancelManager_Impl* SfxMedium_Impl::GetCancelManager() -{ - if( !xCancelManager.Is() ) - { - if( !bDontCreateCancellable ) - xCancelManager = new SfxPoolCancelManager_Impl( - wLoadTargetFrame ? wLoadTargetFrame->GetCancelManager() : - SFX_APP()->GetCancelManager(), - pAntiImpl->GetURLObject().GetURLNoPass() ); - else - xCancelManager = new SfxPoolCancelManager_Impl( - 0, pAntiImpl->GetURLObject().GetURLNoPass() ); - } - return xCancelManager; -} - //------------------------------------------------------------------ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) : SvCompatWeakBase( pAntiImplP ), bUpdatePickList(sal_True), bIsTemp( sal_False ), bForceSynchron( sal_False ), - bDontCreateCancellable( sal_False ), bDownloadDone( sal_True ), bDontCallDoneLinkOnSharingError( sal_False ), bIsStorage( sal_False ), @@ -2374,25 +2280,7 @@ void SfxMedium::GetMedium_Impl() } } -//------------------------------------------------------------------ -SfxPoolCancelManager_Impl* SfxMedium::GetCancelManager_Impl() const -{ - return pImp->GetCancelManager(); -} - -//------------------------------------------------------------------ -void SfxMedium::SetCancelManager_Impl( SfxPoolCancelManager_Impl* pMgr ) -{ - pImp->xCancelManager = pMgr; -} - //---------------------------------------------------------------- -void SfxMedium::CancelTransfers() -{ - if( pImp->xCancelManager.Is() ) - pImp->xCancelManager->Cancel(); -} - sal_Bool SfxMedium::IsRemote() { return bRemote; @@ -3199,7 +3087,7 @@ sal_Bool SfxMedium::IsDownloadDone_Impl() void SfxMedium::SetDontCreateCancellable( ) { - pImp->bDontCreateCancellable = sal_True; + OSL_ENSURE( false, "SfxMedium::SetDontCreateCancellable: dead code!" ); } ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SfxMedium::GetInputStream() diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index ff4ed98058..0c3ccad221 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1161,7 +1161,6 @@ void SfxObjectShell::RegisterTransfer( SfxMedium& rMedium ) laden, muessen an der zugehoerigen SfxObjectShell angemeldet werden. So kann dokumentweise abgebrochen werden. */ { - rMedium.SetCancelManager_Impl( GetMedium()->GetCancelManager_Impl() ); rMedium.SetReferer( GetMedium()->GetName() ); } @@ -1565,7 +1564,6 @@ void SfxObjectShell::CancelTransfers() Hier koennen Transfers gecanceled werden, die nicht mit RegisterTransfer registiert wurden */ { - GetMedium()->CancelTransfers(); if( ( pImp->nLoadedFlags & SFX_LOADED_ALL ) != SFX_LOADED_ALL ) { AbortImport(); diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index 402ca3bdae..bdb40050e3 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -55,7 +55,6 @@ class SfxFilterMatcher; class SvUShorts; class ISfxTemplateCommon; class SfxFilterMatcher; -class SfxCancelManager; class SfxStatusDispatcher; class SfxDdeTriggerTopic_Impl; class SfxMiscCfg; @@ -112,7 +111,6 @@ public: // application members SfxFilterMatcher* pMatcher; - SfxCancelManager* pCancelMgr; ResMgr* pLabelResMgr; SfxStatusDispatcher* pAppDispatch; SfxDocumentTemplates* pTemplates; diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 895b1e7523..c5cd0952e0 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -305,102 +304,3 @@ void SfxURLToolBoxControl_Impl::StateChanged } } -//*************************************************************************** -// SfxCancelToolBoxControl_Impl -//*************************************************************************** - -SFX_IMPL_TOOLBOX_CONTROL(SfxCancelToolBoxControl_Impl,SfxBoolItem) - -//*************************************************************************** - -SfxCancelToolBoxControl_Impl::SfxCancelToolBoxControl_Impl( USHORT nSlotId, USHORT nId, ToolBox& rBox ) : - SfxToolBoxControl( nSlotId, nId, rBox ) -{ -} - -//*************************************************************************** - -SfxPopupWindowType SfxCancelToolBoxControl_Impl::GetPopupWindowType() const -{ - return SFX_POPUPWINDOW_ONTIMEOUT; -} - -//*************************************************************************** - -SfxPopupWindow* SfxCancelToolBoxControl_Impl::CreatePopupWindow() -{ - PopupMenu aMenu; - BOOL bExecute = FALSE, bSeparator = FALSE; - USHORT nIndex = 1; - for ( SfxCancelManager *pCancelMgr = SfxViewFrame::Current()->GetTopViewFrame()->GetCancelManager(); - pCancelMgr; - pCancelMgr = pCancelMgr->GetParent() ) - { - for ( USHORT n=0; nGetCancellableCount(); ++n ) - { - if ( !n && bSeparator ) - { - aMenu.InsertSeparator(); - bSeparator = FALSE; - } - String aItemText = pCancelMgr->GetCancellable(n)->GetTitle(); - if ( aItemText.Len() > 50 ) - { - aItemText.Erase( 48 ); - aItemText += DEFINE_CONST_UNICODE("..."); - } - aMenu.InsertItem( nIndex++, aItemText ); - bExecute = TRUE; - bSeparator = TRUE; - } - } - - ToolBox& rToolBox = GetToolBox(); - USHORT nId = bExecute ? aMenu.Execute( &rToolBox, rToolBox.GetPointerPosPixel() ) : 0; - GetToolBox().EndSelection(); -// ClearCache(); -// UpdateSlot(); - if ( nId ) - { - String aSearchText = aMenu.GetItemText(nId); - for ( SfxCancelManager *pCancelMgr = SfxViewFrame::Current()->GetTopViewFrame()->GetCancelManager(); - pCancelMgr; - pCancelMgr = pCancelMgr->GetParent() ) - { - for ( USHORT n = 0; n < pCancelMgr->GetCancellableCount(); ++n ) - { - SfxCancellable *pCancel = pCancelMgr->GetCancellable(n); - String aItemText = pCancel->GetTitle(); - if ( aItemText.Len() > 50 ) - { - aItemText.Erase( 48 ); - aItemText += DEFINE_CONST_UNICODE("..."); - } - - if ( aItemText == aSearchText ) - { - pCancel->Cancel(); - return 0; - } - } - } - - } - - return 0; -} - -//*************************************************************************** - -void SfxCancelToolBoxControl_Impl::StateChanged -( - USHORT nSID, - SfxItemState eState, - const SfxPoolItem* pState -) -{ - SfxVoidItem aVoidItem( nSID ); - //SfxToolBoxControl::StateChanged( nSID, eState, pState ? &aVoidItem : 0 ); - SfxToolBoxControl::StateChanged( nSID, eState, pState ); -} - diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index c0240e223c..6ed0694784 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -122,18 +122,6 @@ SvCompatWeakHdl* SfxFrame::GetHdl() return pImp->GetHdl(); } -SfxCancelManager* SfxFrame::GetCancelManager() const -{ - SfxFrame *pFrame = GetTopFrame(); - SfxCancelManager*& rpMgr = pFrame->pImp->pCancelMgr; - if ( !rpMgr ) - { - rpMgr = new SfxCancelManager( SFX_APP()->GetCancelManager() ); - pFrame->pImp->StartListening( *rpMgr ); - } - return rpMgr; -} - //-------------------------------------------------------------------- SfxFrame::~SfxFrame() diff --git a/sfx2/source/view/impframe.cxx b/sfx2/source/view/impframe.cxx deleted file mode 100644 index 5c22507979..0000000000 --- a/sfx2/source/view/impframe.cxx +++ /dev/null @@ -1,58 +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: impframe.cxx,v $ - * $Revision: 1.9 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -#ifndef GCC -#endif - -#include "impframe.hxx" - -#include - -#include -#include -#include - -void SfxFrame_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) -{ - SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint ); - if( pHint && pHint->GetId() == SFX_HINT_CANCELLABLE && pCurrentViewFrame ) - { - // vom Cancel-Manager - SfxBindings &rBind = pCurrentViewFrame->GetBindings(); - rBind.Invalidate( SID_BROWSE_STOP ); - if ( !rBind.IsInRegistrations() ) - rBind.Update( SID_BROWSE_STOP ); - rBind.Invalidate( SID_BROWSE_STOP ); - } -} - diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index c0312a1b54..6e15a4b0bc 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -31,8 +31,6 @@ #ifndef _SFX_IMPFRAME_HXX #define _SFX_IMPFRAME_HXX -#include - #include #include // SvBorder @@ -54,7 +52,7 @@ class SfxObjectShell; #define FRAME_SEARCH_CREATE 0x00000008 #endif -class SfxFrame_Impl : public SfxBroadcaster, public SvCompatWeakBase, public SfxListener +class SfxFrame_Impl : public SfxBroadcaster, public SvCompatWeakBase { friend class SfxFrame; @@ -74,8 +72,6 @@ friend class SfxFrame; sal_Bool bOwnsBindings : 1; sal_Bool bReleasingComponent : 1; sal_Bool bInPlace : 1; - SfxCancelManager* pCancelMgr; - SfxCancellable* pLoadCancellable; SfxFrame* pFrame; const SfxItemSet* pSet; SfxWorkWindow* pWorkWin; @@ -97,15 +93,12 @@ friend class SfxFrame; bOwnsBindings( sal_False ), bReleasingComponent( sal_False ), bInPlace( sal_False ), - pCancelMgr( 0 ), - pLoadCancellable( 0 ), pFrame( pAntiImplP ), pSet( 0 ), pWorkWin( 0 ) {} - virtual ~SfxFrame_Impl() { delete pCancelMgr; delete pLoadCancellable; } - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual ~SfxFrame_Impl() { } }; #endif diff --git a/sfx2/source/view/makefile.mk b/sfx2/source/view/makefile.mk index 98d34215e0..3ab9d5d7e2 100644 --- a/sfx2/source/view/makefile.mk +++ b/sfx2/source/view/makefile.mk @@ -59,7 +59,6 @@ SLOFILES = \ $(SLO)$/viewfac.obj \ $(SLO)$/orgmgr.obj \ $(SLO)$/viewfrm.obj \ - $(SLO)$/impframe.obj \ $(SLO)$/topfrm.obj \ $(SLO)$/sfxbasecontroller.obj \ $(SLO)$/userinputinterception.obj diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 496cd19564..704812b512 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -1493,21 +1493,9 @@ void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest ) break; } case SID_BROWSE_STOP: - { - if ( GetCancelManager() ) - GetCancelManager()->Cancel( TRUE ); - - // cancel jobs in hidden tasks - SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - for( USHORT nPos = rArr.Count(); nPos--; ) - { - SfxFrame *pFrame = rArr[ nPos ]; - if ( !pFrame->GetCurrentViewFrame() ) - pFrame->GetCancelManager()->Cancel( TRUE ); - } - + OSL_ENSURE( false, "SID_BROWSE_STOP is dead!" ); break; - } + case SID_FOCUSURLBOX: { SfxStateCache *pCache = GetBindings().GetAnyStateCache_Impl( SID_OPENURL ); @@ -1539,7 +1527,7 @@ void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet ) if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() ) rItemSet.DisableItem( SID_CREATELINK ); - pImp->pStopButtonTimer->SetButtonState( GetCancelManager()->CanCancel() ); + pImp->pStopButtonTimer->SetButtonState( FALSE ); if ( !pImp->pStopButtonTimer->GetButtonState() ) rItemSet.DisableItem( SID_BROWSE_STOP ); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e1dc2de3ac..d3a49aac11 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -172,7 +172,6 @@ struct SfxViewFrame_Impl String aActualURL; String aActualPresentationURL; SfxFrame* pFrame; - SfxCancelManager* pCancelMgr; svtools::AsynchronLink* pReloader; //SfxInPlaceFrame* pIPFrame; Window* pWindow; @@ -205,7 +204,6 @@ struct SfxViewFrame_Impl ~SfxViewFrame_Impl() { delete pReloader; - delete pCancelMgr; } }; @@ -1641,7 +1639,6 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) pImp->bEnabled = sal_True; pImp->nDocViewNo = 0; pImp->aMargin = Size( -1, -1 ); - pImp->pCancelMgr = 0; pImp->pWindow = 0; SetPool( &SFX_APP()->GetPool() ); @@ -2960,18 +2957,6 @@ SfxViewFrame* SfxViewFrame::GetTopViewFrame() const //------------------------------------------------------------------------- -SfxCancelManager *SfxViewFrame::GetCancelManager() const - -/*

Description

- - Returns a pointer to the of the top-view-frame of - this view-frame. -*/ - -{ - return GetTopViewFrame()->GetFrame()->GetCancelManager(); -} - void SfxViewFrame::SetWindow_Impl( Window *pWin ) { pImp->pWindow = pWin; diff --git a/svx/inc/linkmgr.hxx b/svx/inc/linkmgr.hxx index 4c18bf7a14..6568610acf 100644 --- a/svx/inc/linkmgr.hxx +++ b/svx/inc/linkmgr.hxx @@ -79,8 +79,6 @@ public: // (ist zur Zeit nur fuer die FileLinks interressant!) void CancelTransfers(); - static void SetTransferPriority( sfx2::SvBaseLink& rLink, USHORT nPrio ); - // um Status Informationen aus dem FileObject an den BaseLink zu // senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat // dann die entsprechenden Informationen als String. diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index 8e9bc4d179..4fe38e5218 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -757,7 +757,6 @@ #include "svtools/apearcfg.hxx" #include "svtools/brdcst.hxx" #include "svtools/cacheoptions.hxx" -#include "svtools/cancel.hxx" #include "svtools/cjkoptions.hxx" #include "svtools/cmdoptions.hxx" #include "svtools/cntwall.hxx" diff --git a/svx/source/svxlink/fileobj.cxx b/svx/source/svxlink/fileobj.cxx index a77c8852bb..ea1d1b7043 100644 --- a/svx/source/svxlink/fileobj.cxx +++ b/svx/source/svxlink/fileobj.cxx @@ -692,9 +692,6 @@ BOOL SvFileObject::IsDataComplete() const void SvFileObject::CancelTransfers() { - if( xMed.Is() ) - xMed->CancelTransfers(); - // und aus dem Cache austragen, wenn man mitten im Laden ist if( !bDataReady ) { @@ -706,11 +703,6 @@ void SvFileObject::CancelTransfers() } -void SvFileObject::SetTransferPriority( USHORT ) -{ -} - - void SvFileObject::SendStateChg_Impl( LinkState nState ) { if( !bStateChangeCalled && HasDataLinks() ) diff --git a/svx/source/svxlink/fileobj.hxx b/svx/source/svxlink/fileobj.hxx index 9acbcfb0a1..476977cbc4 100644 --- a/svx/source/svxlink/fileobj.hxx +++ b/svx/source/svxlink/fileobj.hxx @@ -91,7 +91,6 @@ public: virtual BOOL IsDataComplete() const; void CancelTransfers(); - void SetTransferPriority( USHORT nPrio ); }; diff --git a/svx/source/svxlink/linkmgr.cxx b/svx/source/svxlink/linkmgr.cxx index 5d96e0cfc4..38a8c56493 100644 --- a/svx/source/svxlink/linkmgr.cxx +++ b/svx/source/svxlink/linkmgr.cxx @@ -181,16 +181,6 @@ void SvxLinkManager::CancelTransfers() pFileObj->CancelTransfers(); } -void SvxLinkManager::SetTransferPriority( sfx2::SvBaseLink& /*rLink*/, USHORT /*nPrio*/ ) -{ -// SvFileObject* pFileObj = -// (SvFileObject*)SvFileObject::ClassFactory()-> -// CastAndAddRef( rLink.GetObj() ); -// OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & rLink.GetObjType()) ? -// (SvFileObject*)rLink.GetObj() : 0; -} - - // um Status Informationen aus dem FileObject an den BaseLink zu // senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat // dann die entsprechenden Informationen als String. -- cgit v1.2.3 From 42013c915144f21526a1a3f03c75e01e085cb5ff Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Nov 2009 20:48:33 +0100 Subject: [CWS autorecovery] while we are at it .... SID_BROWSE_STOP is dead, for a long time now ... --- sfx2/inc/sfx2/sfxsids.hrc | 2 +- sfx2/sdi/frmslots.sdi | 6 ---- sfx2/sdi/sfx.sdi | 78 +++++++++++++--------------------------- sfx2/source/appl/app.src | 5 --- sfx2/source/bastyp/progress.cxx | 3 -- sfx2/source/control/dispatch.cxx | 2 +- sfx2/source/view/topfrm.cxx | 48 ------------------------- 7 files changed, 27 insertions(+), 117 deletions(-) diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 8d8a3ac3a0..bca3a0ef19 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -305,7 +305,7 @@ // browse-ids #define SID_BROWSE_FORWARD (SID_SFX_START + 1300) #define SID_BROWSE_BACKWARD (SID_SFX_START + 1301) -#define SID_BROWSE_STOP (SID_SFX_START + 1302) + // FREE, formerly SID_BROWSE_STOP #define SID_BROWSE_HOME (SID_SFX_START + 1303) #define SID_AUTOBROWSE (SID_SFX_START + 1304) #define SID_AUTOMAIL (SID_SFX_START + 1305) diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi index 3af8e54d6c..17ab4f8483 100644 --- a/sfx2/sdi/frmslots.sdi +++ b/sfx2/sdi/frmslots.sdi @@ -435,12 +435,6 @@ interface TopWindow : BrowseWindow ExecMethod = INetExecute_Impl ; StateMethod = INetState_Impl ; ] - SID_BROWSE_STOP // ole(no) api() - [ - ExecMethod = INetExecute_Impl ; - StateMethod = INetState_Impl ; - ] - } //========================================================================= diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 26f55ccdd1..bf4561fe0d 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -901,34 +901,6 @@ SfxUInt32Item BuildVersion SID_BUILD_VERSION GroupId = GID_INTERN; ] -//-------------------------------------------------------------------------- -SfxVoidItem Stop SID_BROWSE_STOP -() -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* status: */ - SlotType = SfxBoolItem - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_NAVIGATOR; -] - //-------------------------------------------------------------------------- SfxStringItem Caption SID_CAPTION @@ -5897,31 +5869,31 @@ SfxVoidItem ExportDialog SID_EXPORT_DIALOG ] //-------------------------------------------------------------------------- -SfxVoidItem ImportDialog SID_IMPORT_DIALOG -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DOCUMENT; -] - -//-------------------------------------------------------------------------- +SfxVoidItem ImportDialog SID_IMPORT_DIALOG +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + +//-------------------------------------------------------------------------- SfxVoidItem SaveConfiguration SID_SAVECONFIG (SfxStringItem FileName SID_CFGFILE) [ diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index 555c7467aa..797b0dc7ba 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -654,11 +654,6 @@ ToolBox RID_ENVTOOLBOX Identifier = SID_OPENURL ; }; ToolBoxItem - { - Identifier = SID_BROWSE_STOP ; - Hide = TRUE; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx index 1935bb2d16..f4be3b70d5 100644 --- a/sfx2/source/bastyp/progress.cxx +++ b/sfx2/source/bastyp/progress.cxx @@ -224,9 +224,6 @@ SfxProgress::~SfxProgress() if( pImp->bIsStatusText == TRUE ) GetpApp()->HideStatusText( ); - SfxObjectShell* pDoc = pImp->xObjSh; - if ( !pDoc ) - SFX_APP()->Invalidate( SID_BROWSE_STOP ); delete pImp; } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index d76697b6c5..d7d3ad8715 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -2324,7 +2324,7 @@ sal_Bool SfxDispatcher::_FindServer { SFX_STACK(SfxDispatcher::_FindServer); - // Dispatcher gelockt? (SID_BROWSE_STOP und SID_HELP_PI trotzdem durchlassen) + // Dispatcher gelockt? (SID_HELP_PI trotzdem durchlassen) SfxApplication *pSfxApp = SFX_APP(); if ( IsLocked(nSlot) ) { diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 27a7e74132..fcd3ba6dc0 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -307,42 +307,6 @@ void SfxTopWindow_Impl::DoResize() pFrame->Resize(); } -class StopButtonTimer_Impl : public Timer -{ - BOOL bState; - SfxViewFrame* pFrame; -protected: - virtual void Timeout(); -public: - StopButtonTimer_Impl( SfxViewFrame*); - void SetButtonState( BOOL bStateP ); - BOOL GetButtonState() const { return bState; } -}; - -StopButtonTimer_Impl::StopButtonTimer_Impl( SfxViewFrame*p) - : bState( FALSE ) - , pFrame( p ) -{ - SetTimeout( 200 ); -} - -void StopButtonTimer_Impl::SetButtonState( BOOL bStateP ) -{ - if( bStateP ) - { - bState = TRUE; - Stop(); - } - else if( bState ) - Start(); -} - -void StopButtonTimer_Impl::Timeout() -{ - bState = FALSE; - pFrame->GetBindings().Invalidate( SID_BROWSE_STOP ); -} - class SfxTopViewWin_Impl : public Window { friend class SfxInternalFrame; @@ -391,12 +355,10 @@ public: sal_Bool bActive; Window* pWindow; String aFactoryName; - StopButtonTimer_Impl* pStopButtonTimer; SfxTopViewFrame_Impl() : bActive( sal_False ) , pWindow( 0 ) - , pStopButtonTimer( 0 ) {} }; @@ -1148,7 +1110,6 @@ SfxTopViewFrame::SfxTopViewFrame pCloser = 0; pImp = new SfxTopViewFrame_Impl; - pImp->pStopButtonTimer = new StopButtonTimer_Impl(this); //(mba)/task if ( !pFrame->GetTask() ) { @@ -1230,7 +1191,6 @@ SfxTopViewFrame::~SfxTopViewFrame() KillDispatcher_Impl(); delete pImp->pWindow; - delete pImp->pStopButtonTimer; delete pImp; } @@ -1480,10 +1440,6 @@ void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest ) */ break; } - case SID_BROWSE_STOP: - OSL_ENSURE( false, "SID_BROWSE_STOP is dead!" ); - break; - case SID_FOCUSURLBOX: { SfxStateCache *pCache = GetBindings().GetAnyStateCache_Impl( SID_OPENURL ); @@ -1514,10 +1470,6 @@ void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet ) sal_Bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED; if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() ) rItemSet.DisableItem( SID_CREATELINK ); - - pImp->pStopButtonTimer->SetButtonState( FALSE ); - if ( !pImp->pStopButtonTimer->GetButtonState() ) - rItemSet.DisableItem( SID_BROWSE_STOP ); } void SfxTopViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ) -- cgit v1.2.3 From acb76afa6e018638409f50b87310637d898c3b41 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Nov 2009 20:56:41 +0100 Subject: [CWS autorecovery] SfxFrame::Browse is dead, too --- sfx2/inc/sfx2/frame.hxx | 1 - sfx2/source/view/frame.cxx | 5 ----- sfx2/source/view/topfrm.cxx | 7 +------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 1f611b590f..4887b6bdda 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -215,7 +215,6 @@ public: SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* ); SAL_DLLPRIVATE sal_Bool IsClosing_Impl() const; SAL_DLLPRIVATE void SetIsClosing_Impl(); - SAL_DLLPRIVATE sal_Bool Browse( sal_Bool bForward, sal_uInt16 nDelta = 1, sal_Bool bNewFrame=sal_False ); // Methoden f"ur den Zugriff auf das aktuelle Set SAL_DLLPRIVATE void SetDescriptor( SfxFrameDescriptor* ); diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 6ed0694784..6da4a6ddde 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -408,11 +408,6 @@ void SfxFrame::SetFrameType_Impl( sal_uInt32 n ) pImp->nType = n; } -sal_Bool SfxFrame::Browse( sal_Bool /*bForward*/, sal_uInt16 /*nSteps*/, sal_Bool /*bNewFrame*/ ) -{ - return FALSE; -} - void SfxFrame::GetViewData_Impl() { // Alle zwischen Laden und Entfernen "anderbaren Daten aktualisieren; die diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 27a7e74132..c02c4981b9 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -1467,13 +1467,8 @@ void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest ) { case SID_BROWSE_FORWARD: case SID_BROWSE_BACKWARD: - { - // Anzeige der n"achsten oder vorherigen Seite aus der History - SFX_REQUEST_ARG( rRequest, pSteps, SfxUInt16Item, nSlotId, sal_False ); - GetFrame()->Browse( nSlotId == SID_BROWSE_FORWARD, pSteps ? pSteps->GetValue() : 1, - (rRequest.GetModifier() & KEY_MOD1) != 0 ); + OSL_ENSURE( false, "SfxTopViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" ); break; - } case SID_CREATELINK: { /*! (pb) we need new implementation to create a link -- cgit v1.2.3 From d85e51d1541d9c34644d35132b9cefa4acfda8a0 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Nov 2009 21:43:54 +0100 Subject: [CWS autorecovery] #i65597# when reloading an SFX document, do this via UNO, not via internal methods. In particular, do not re-use existing SfxTopFrames. This implies slightly more flickering, but this should be bearable nowadays. The advantage is more simplified code. Also, on the medium run, when UNO view factories are implemented for SFX documents, the old approach would not have worked, anyway. --- sfx2/source/doc/objcont.cxx | 37 +++------------ sfx2/source/view/topfrm.cxx | 56 ++++++++--------------- sfx2/source/view/viewfrm.cxx | 105 +++++++++++++++++++------------------------ 3 files changed, 71 insertions(+), 127 deletions(-) diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 09fbd8c213..f15660538b 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -226,39 +226,12 @@ bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rTargetFrame ) pSet->ClearItem( SID_USER_DATA ); pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - if ( rTargetFrame.GetCurrentViewFrame() ) - { - // TODO: the only client of this case is the Reload-implementation for SFX-based documents. This should be - // migrated to use UNO mechanisms, too. In this case, we can simplify the code here. - - // use the frame from the arguments, but don't set a window size - SfxViewFrame* pViewFrame = rTargetFrame.GetCurrentViewFrame(); - if ( pViewFrame->GetViewShell() || !pViewFrame->GetObjectShell() ) - { - pSet->ClearItem( SID_VIEW_POS_SIZE ); - pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->ClearItem( SID_VIEW_ZOOM_MODE ); - - // avoid flickering controllers - SfxBindings &rBind = pViewFrame->GetBindings(); - rBind.ENTERREGISTRATIONS(); + OSL_ENSURE( rTargetFrame.GetCurrentViewFrame() == NULL, + "SfxObjectShell::LoadView_Impl: no support (anymore) for loading into a non-empty frame!" ); + // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays + // done in higher layers, namely in the framework. - // set document into frame - rTargetFrame.InsertDocument_Impl( *this ); - - // restart controller updating - rBind.LEAVEREGISTRATIONS(); - } - else - { - // create new view - pViewFrame->CreateView_Impl( nViewId ); - } - } - else - { - rTargetFrame.InsertDocument_Impl( *this ); - } + rTargetFrame.InsertDocument_Impl( *this ); SfxViewFrame* pViewFrame = rTargetFrame.GetCurrentViewFrame(); // only temporary data, don't hold it in the itemset diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index a2a1bf6a3a..cb73c1086c 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -822,48 +822,30 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) UpdateDescriptor( &rDoc ); - SfxViewFrame* pViewFrame = GetCurrentViewFrame(); - if ( pViewFrame ) - { - // TODO: the only client of this case is the Reload-implementation for SFX-based documents. This should be - // migrated to use UNO mechanisms, too. In this case, we can simplify the code here. - if ( pViewFrame->GetActiveChildFrame_Impl() && pViewFrame->GetActiveChildFrame_Impl() == SfxViewFrame::Current() ) - { - pViewFrame->SetActiveChildFrame_Impl(0); - SfxViewFrame::SetViewFrame( pViewFrame ); - } + if ( pPluginMode && pPluginMode->GetValue() != 2 ) + SetInPlace_Impl( TRUE ); - if ( pViewFrame->GetObjectShell() ) - { - pViewFrame->ReleaseObjectShell_Impl( sal_False ); - } + OSL_ENSURE( GetCurrentViewFrame() == NULL, + "SfxTopFrame::InsertDocument_Impl: no support (anymore) for loading a document into a non-empty frame!" ); + // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays + // done in higher layers, namely in the framework. - if ( pViewIdItem ) - pViewFrame->SetViewData_Impl( pViewIdItem->GetValue(), String() ); - pViewFrame->SetObjectShell_Impl( rDoc ); - } - else - { - if ( pPluginMode && pPluginMode->GetValue() != 2 ) - SetInPlace_Impl( TRUE ); - - pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId ); - if ( !pViewFrame->GetViewShell() ) - return sal_False; + SfxViewFrame* pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId ); + if ( !pViewFrame->GetViewShell() ) + return sal_False; - if ( pPluginMode && pPluginMode->GetValue() == 1 ) - { - pViewFrame->ForceOuterResize_Impl( FALSE ); - pViewFrame->GetBindings().HidePopups(TRUE); + if ( pPluginMode && pPluginMode->GetValue() == 1 ) + { + pViewFrame->ForceOuterResize_Impl( FALSE ); + pViewFrame->GetBindings().HidePopups(TRUE); - // MBA: layoutmanager of inplace frame starts locked and invisible - GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); - GetWorkWindow_Impl()->Lock_Impl( TRUE ); + // MBA: layoutmanager of inplace frame starts locked and invisible + GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); + GetWorkWindow_Impl()->Lock_Impl( TRUE ); - GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - if ( GetCurrentViewFrame() ) - GetCurrentViewFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - } + GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + if ( GetCurrentViewFrame() ) + GetCurrentViewFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); } OSL_ENSURE( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT, diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index caee4fed81..c2a7e3349d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include @@ -56,6 +57,7 @@ #endif #include #include +#include #include #include #include @@ -66,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +82,7 @@ #include #include #include +#include #include #include @@ -245,6 +249,7 @@ SfxObjectShell* SfxViewFrame::GetImportingObjectShell_Impl() const } +//-------------------------------------------------------------------- class SfxViewNotificatedFrameList_Impl : public SfxListener, public SfxViewFrameArr_Impl { @@ -632,25 +637,22 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // bestehende SfxMDIFrames f"ur dieses Doc leeren // eigenes Format oder R/O jetzt editierbar "offnen? - SfxViewNotificatedFrameList_Impl aFrames; SfxObjectShellLock xNewObj; - sal_Bool bRestoreView = ( pURLItem == NULL ); TypeId aOldType = xOldObj->Type(); - SfxViewFrame *pView = GetFirst(xOldObj); - while(pView) + // collect the views of the document + // TODO: when UNO ViewFactories are available for SFX-based documents, the below code should + // be UNOized, too + typedef ::std::pair< Reference< XFrame >, USHORT > ViewDescriptor; + ::std::list< ViewDescriptor > aViewFrames; + SfxViewFrame *pView = GetFirst( xOldObj ); + while ( pView ) { - if( bHandsOff ) - pView->GetDispatcher()->LockUI_Impl(sal_True); - aFrames.InsertViewFrame( pView ); - pView->GetBindings().ENTERREGISTRATIONS(); - - // RestoreView nur wenn keine neue Datei geladen - // (Client-Pull-Reloading) - pView = /*bHandsOff ? (SfxTopViewFrame*) GetFirst( - xOldObj, TYPE(SfxTopViewFrame) ) :*/ - (SfxTopViewFrame*)GetNext( *pView, xOldObj, - TYPE( SfxTopViewFrame ) ); + Reference< XFrame > xFrame( pView->GetFrame()->GetFrameInterface() ); + OSL_ENSURE( xFrame.is(), "SfxViewFrame::ExecReload_Impl: no XFrame?!" ); + aViewFrames.push_back( ViewDescriptor( xFrame, pView->GetCurViewId() ) ); + + pView = (SfxTopViewFrame*)GetNext( *pView, xOldObj, TYPE( SfxTopViewFrame ) ); } DELETEZ( xOldObj->Get_Impl()->pReloadTimer ); @@ -759,12 +761,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_STANDARD ); + uno::Sequence < beans::PropertyValue > aLoadArgs; + TransformItems( SID_OPENDOC, *pNewSet, aLoadArgs ); try { - uno::Sequence < beans::PropertyValue > aProps; - TransformItems( SID_OPENDOC, *pNewSet, aProps ); uno::Reference < frame::XLoadable > xLoad( xNewObj->GetModel(), uno::UNO_QUERY ); - xLoad->load( aProps ); + xLoad->load( aLoadArgs ); } catch ( uno::Exception& ) { @@ -816,56 +818,48 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { if ( xNewObj->IsDocShared() ) { - // the file is shared but the closing can chang the sharing control file + // the file is shared but the closing can change the sharing control file xOldObj->DoNotCleanShareControlFile(); } + // the Reload and Silent items were only temporary, remove them xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_RELOAD ); xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_SILENT ); + TransformItems( SID_OPENDOC, *xNewObj->GetMedium()->GetItemSet(), aLoadArgs ); + UpdateDocument_Impl(); } - SfxViewFrame* pThis = (SfxViewFrame*)this; - sal_Bool bDeleted = aFrames.C40_GETPOS( SfxViewFrame, pThis ) == USHRT_MAX; - - if( !bDeleted ) + if ( xNewObj.Is() ) { - GetBindings().Invalidate( SID_RELOAD ); - pImp->bReloading = sal_False; - } - - // neues Doc in die bestehenden SfxMDIFrames einsetzen; wenn - // das Reload geklappt hat, mu\s in diesem Frame kein Dokument - // eingesetzt werden, weil das schon vom LoadEnvironment - // gemacht wurde - if ( xNewObj.Is() && xNewObj->Type() != aOldType ) - // RestoreView nur, wenn gleicher Dokumenttyp - bRestoreView = sal_False; + try + { + ::comphelper::NamedValueCollection aTransformLoadArgs( aLoadArgs ); + Reference< XModel > xDocument( xNewObj->GetModel(), UNO_SET_THROW ); + aTransformLoadArgs.put( "Model", xDocument ); - const sal_uInt16 nCount = aFrames.Count(); - for(sal_uInt16 i = 0; i < nCount; ++i) - { - SfxViewFrame *pCurrView = aFrames.GetObject( i ); - if ( xNewObj.Is() ) + while ( !aViewFrames.empty() ) + { + aTransformLoadArgs.put( "ViewId", aViewFrames.front().second ); + Reference< XComponentLoader > xLoader( aViewFrames.front().first, UNO_QUERY_THROW ); + xLoader->loadComponentFromURL( xDocument->getURL(), ::rtl::OUString::createFromAscii( "_self" ), 0, + aTransformLoadArgs.getPropertyValues() ); + aViewFrames.pop_front(); + } + } + catch( const Exception& ) { - //if( /*!bHandsOff &&*/ this != pView ) - pCurrView->ReleaseObjectShell_Impl( bRestoreView ); - pCurrView->SetRestoreView_Impl( bRestoreView ); - //if( pView != this || !xNewObj.Is() ) + // close the remaining frames + // Don't catch exceptions herein, if this fails, then we're left in an indetermined state, and + // crashing is better than trying to proceed + while ( !aViewFrames.empty() ) { - SfxTopFrame* pFrame = dynamic_cast< SfxTopFrame* >( pCurrView->GetFrame() ); - OSL_ENSURE( pFrame, "An SfxFrame which is no SfxTopFrame?!" ); - if ( pFrame ) - pFrame->InsertDocument_Impl( *xNewObj ); + Reference< util::XCloseable > xClose( aViewFrames.front().first, UNO_QUERY_THROW ); + xClose->close( sal_True ); + aViewFrames.pop_front(); } } - pCurrView->GetBindings().LEAVEREGISTRATIONS(); - pCurrView->GetDispatcher()->LockUI_Impl( sal_False ); - } - - if ( xNewObj.Is() ) - { // Propagate document closure. SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), xOldObj ) ); } @@ -873,11 +867,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // als erledigt recorden rReq.Done( sal_True ); rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), sal_True)); - if( !bDeleted ) - { - Notify( *GetObjectShell(), SfxSimpleHint( - SFX_HINT_TITLECHANGED )); - } return; } else -- cgit v1.2.3 From 818909f654decf8872056f9a1eccfc750b99d549 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Nov 2009 21:59:14 +0100 Subject: #i10000# --- sfx2/source/view/viewfrm.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c2a7e3349d..445d93bef1 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -638,7 +638,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // bestehende SfxMDIFrames f"ur dieses Doc leeren // eigenes Format oder R/O jetzt editierbar "offnen? SfxObjectShellLock xNewObj; - TypeId aOldType = xOldObj->Type(); // collect the views of the document // TODO: when UNO ViewFactories are available for SFX-based documents, the below code should -- cgit v1.2.3 From c8303bb35f1aab7c89e7cfa4168b3e4d5f5c0187 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 24 Nov 2009 09:45:17 +0100 Subject: [CWS autorecovery] removed (now) unused methods in Sfx(Top)Frame --- sfx2/inc/sfx2/topfrm.hxx | 1 - sfx2/inc/sfx2/viewfrm.hxx | 13 --- sfx2/source/appl/app.cxx | 3 - sfx2/source/view/topfrm.cxx | 43 --------- sfx2/source/view/viewfrm.cxx | 216 +------------------------------------------ 5 files changed, 1 insertion(+), 275 deletions(-) diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx index ebea1b7b4c..e1058faab7 100644 --- a/sfx2/inc/sfx2/topfrm.hxx +++ b/sfx2/inc/sfx2/topfrm.hxx @@ -77,7 +77,6 @@ public: SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; - SAL_DLLPRIVATE void CheckMenuCloser_Impl( MenuBar* pMenubar ); SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; //#endif }; diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 4bf3010db3..2d11a31384 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -265,18 +265,11 @@ public: void ChildWindowState(SfxItemSet&); //#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE SfxMacro* GetRecordingMacro_Impl(); SAL_DLLPRIVATE void SetFrame_Impl( SfxFrame* ); SAL_DLLPRIVATE void SetDowning_Impl(); SAL_DLLPRIVATE void GetDocNumber_Impl(); SAL_DLLPRIVATE BOOL IsDowning_Impl() const; - SAL_DLLPRIVATE void SetSetViewFrameAllowed_Impl( BOOL bSet ); - SAL_DLLPRIVATE BOOL IsSetViewFrameAllowed_Impl() const; - SAL_DLLPRIVATE void SetImportingObjectShell_Impl( SfxObjectShell* pSH ); - SAL_DLLPRIVATE SfxObjectShell* GetImportingObjectShell_Impl( ) const; SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell *pVSh ); - SAL_DLLPRIVATE void SetObjectShell_Impl( SfxObjectShell& rObjSh , - FASTBOOL bDefaultView = FALSE ); SAL_DLLPRIVATE void ReleaseObjectShell_Impl( BOOL bStoreView = FALSE ); SAL_DLLPRIVATE void GetState_Impl( SfxItemSet &rSet ); @@ -285,10 +278,8 @@ public: SAL_DLLPRIVATE void StateReload_Impl( SfxItemSet &rSet ); SAL_DLLPRIVATE void ExecView_Impl( SfxRequest &rReq ); SAL_DLLPRIVATE void StateView_Impl( SfxItemSet &rSet ); - SAL_DLLPRIVATE void PropState_Impl( SfxItemSet &rSet ); SAL_DLLPRIVATE void ExecHistory_Impl( SfxRequest &rReq ); SAL_DLLPRIVATE void StateHistory_Impl( SfxItemSet &rSet ); - SAL_DLLPRIVATE void SetParentViewFrame_Impl(SfxViewFrame *pParentFrame); SAL_DLLPRIVATE SfxViewFrame* GetParentViewFrame_Impl() const; SAL_DLLPRIVATE void ForceOuterResize_Impl(BOOL bOn=TRUE); SAL_DLLPRIVATE BOOL IsResizeInToOut_Impl() const; @@ -299,16 +290,13 @@ public: SAL_DLLPRIVATE void LockObjectShell_Impl(BOOL bLock=TRUE); - SAL_DLLPRIVATE SfxViewShell* CreateView_Impl( USHORT nViewId ); SAL_DLLPRIVATE void MakeActive_Impl( BOOL bActivate ); SAL_DLLPRIVATE void SetQuietMode_Impl( BOOL ); SAL_DLLPRIVATE const Size& GetMargin_Impl() const; - SAL_DLLPRIVATE void SetMargin_Impl( const Size& ); SAL_DLLPRIVATE void SetActiveChildFrame_Impl( SfxViewFrame* ); SAL_DLLPRIVATE SfxViewFrame* GetActiveChildFrame_Impl() const; SAL_DLLPRIVATE BOOL IsRestoreView_Impl() const; SAL_DLLPRIVATE void SetRestoreView_Impl( BOOL ); - SAL_DLLPRIVATE void SetViewData_Impl( USHORT, const String& ); SAL_DLLPRIVATE String& GetViewData_Impl(); SAL_DLLPRIVATE String GetActualPresentationURL_Impl() const; SAL_DLLPRIVATE static void CloseHiddenFrames_Impl(); @@ -316,7 +304,6 @@ public: SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &); SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl( USHORT nId ); SAL_DLLPRIVATE void AddDispatchMacroToBasic_Impl(const ::rtl::OUString& sMacro); - SAL_DLLPRIVATE BOOL ClearEventFlag_Impl(); //#endif }; diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index bfd31a1ed2..d7a82781a2 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -476,9 +476,6 @@ SfxDispatcher* SfxApplication::GetDispatcher_Impl() //-------------------------------------------------------------------- void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) { - if( pFrame && !pFrame->IsSetViewFrameAllowed_Impl() ) - return; - if ( pFrame != pAppData_Impl->pViewFrame ) { // get the containerframes ( if one of the frames is an InPlaceFrame ) diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index cb73c1086c..1b36895d89 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -1469,46 +1469,3 @@ void SfxTopViewFrame::Deactivate( sal_Bool bMDI ) pImp->bActive = sal_False; //(mba): hier evtl. wie in Beanframe NotifyEvent ?! } - -void SfxTopFrame::CheckMenuCloser_Impl( MenuBar* pMenuBar ) -{ - Reference < ::com::sun::star::frame::XFrame > xFrame = GetFrameInterface(); - - // checks if there is more than one "real" (not help) task window - // in this case a close button is inserted into the menubar - - DBG_ASSERT( xFrame.is(), "Attention: this bug is very hard to reproduce. Please try to remember how you triggered it!"); - if ( !xFrame.is() || !xFrame->getController().is() ) - // dummy component - return; - - Reference < ::com::sun::star::frame::XFramesSupplier > xDesktop( xFrame->getCreator(), UNO_QUERY ); - if ( !xDesktop.is() ) - // test only for task windows - return; - - sal_Bool bLastTask = sal_False; - Reference < ::com::sun::star::container::XIndexAccess > - xList ( xDesktop->getFrames(), ::com::sun::star::uno::UNO_QUERY ); - sal_Int32 nCount = xList->getCount(); - if ( nCount<=1 ) - // only one task - bLastTask = sal_True; - else if ( nCount==2 ) - { - // if we have to tasks, one can be the help task, that should be ignored - for( sal_Int32 i=0; i xTask; - ::com::sun::star::uno::Any aVal = xList->getByIndex(i); - if ( (aVal>>=xTask) && xTask.is() && xTask->getName().compareToAscii("OFFICE_HELP_TASK") == COMPARE_EQUAL ) - { - // one of the two open tasks was the help task -> ignored - bLastTask = sal_True; - break; - } - } - } - - pMenuBar->ShowCloser(bLastTask); -} diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c2a7e3349d..cb01f427a5 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -180,28 +180,22 @@ struct SfxViewFrame_Impl //SfxInPlaceFrame* pIPFrame; Window* pWindow; SfxViewFrame* pActiveChild; - SfxViewFrame* pParentViewFrame; - SfxObjectShell* pImportShell; Window* pFocusWin; - SfxMacro* pMacro; sal_uInt16 nDocViewNo; sal_uInt16 nCurViewId; sal_Bool bResizeInToOut:1; sal_Bool bDontOverwriteResizeInToOut:1; sal_Bool bObjLocked:1; sal_Bool bRestoreView:1; - sal_Bool bSetViewFrameLocked:1; sal_Bool bReloading:1; sal_Bool bIsDowning:1; sal_Bool bInCtor:1; sal_Bool bModal:1; sal_Bool bEnabled:1; - sal_Bool bEventFlag:1; sal_Bool bWindowWasEnabled:1; SfxViewFrame_Impl() : pReloader(0 ) - , pMacro( 0 ) , bWindowWasEnabled(sal_True) {} @@ -224,31 +218,6 @@ sal_Bool SfxViewFrame::IsDowning_Impl() const } -//------------------------------------------------------------------------- -void SfxViewFrame::SetSetViewFrameAllowed_Impl( sal_Bool bSet ) -{ - pImp->bSetViewFrameLocked = !bSet; -}; - -//------------------------------------------------------------------------- -sal_Bool SfxViewFrame::IsSetViewFrameAllowed_Impl() const -{ - return !pImp->bSetViewFrameLocked; -} - -//------------------------------------------------------------------------- -void SfxViewFrame::SetImportingObjectShell_Impl( SfxObjectShell* pSh ) -{ - pImp->pImportShell = pSh; -} - -//-------------------------------------------------------------------- -SfxObjectShell* SfxViewFrame::GetImportingObjectShell_Impl() const -{ - return pImp->pImportShell; -} - - //-------------------------------------------------------------------- class SfxViewNotificatedFrameList_Impl : public SfxListener, public SfxViewFrameArr_Impl @@ -1066,83 +1035,6 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) rSet.DisableItem( SID_REPEAT ); } -//-------------------------------------------------------------------- -void SfxViewFrame::SetObjectShell_Impl -( - SfxObjectShell& rObjSh, // eine initialisierte SfxObjectShell, - FASTBOOL bDefaultView // sal_True: nicht restaurieren -) - -/* [Beschreibung] - - Diese Methode setzt eine in den SfxViewFrame ein. - - Zuvor mu\s die vorherige SfxObjectShell, insofern schein eine gesetzt - wurde, mit der Methode ReleaseObjectShell() entfernt worden sein. Somit - kann durch Aufruf von ReleaseObjectShell() und SetObjectShell() die - SfxObjectShell ausgetauscht werden. - - - [Querverweise] - - -*/ - -{ - DBG_CHKTHIS(SfxViewFrame, 0); - DBG_ASSERT( !xObjSh.Is(), "old feature used: only one Object per View!" ); - - GetFrame()->ReleasingComponent_Impl( sal_False ); - - // Doc einsetzen - xObjSh = &rObjSh; - if ( xObjSh.Is() && xObjSh->IsPreview() ) - SetQuietMode_Impl( sal_True ); - - // Modulshell einf"ugen - SfxModule* pModule = xObjSh->GetModule(); - if( pModule ) - pDispatcher->InsertShell_Impl( *pModule, 1 ); - - pDispatcher->Push( rObjSh ); - pDispatcher->Flush(); - StartListening( rObjSh ); - - rObjSh.ViewAssigned(); - pDispatcher->SetReadOnly_Impl( rObjSh.IsReadOnly() ); - - const SfxMedium *pMedium = GetObjectShell()->GetMedium(); - SFX_ITEMSET_ARG( - pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False ); - if ( !pHiddenItem || !pHiddenItem->GetValue() ) - { - LockObjectShell_Impl(sal_True); - GetDocNumber_Impl(); - } - - // View erzeugen - if ( bDefaultView ) - SetRestoreView_Impl( sal_False ); - -// So darf man es nicht machen, da LaodWindows hierueber laeuft. Kann meiner Meinung nach -// auch nur beim Reload mit Dokumenttypwechsel passieren. -/* if ( xObjSh->Type() != pImp->aLastType ) - SetRestoreView_Impl( sal_False ); */ - - SwitchToViewShell_Impl( !IsRestoreView_Impl() ? (sal_uInt16) 0 : GetCurViewId() ); - rObjSh.PostActivateEvent_Impl( this ); - if ( Current() == this ) - SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), &rObjSh ) ); - - Notify( rObjSh, SfxSimpleHint(SFX_HINT_TITLECHANGED) ); - Notify( rObjSh, SfxSimpleHint(SFX_HINT_DOCCHANGED) ); - - // Zur Sicherheit, aber eigentlich sollte jetzt nichts mehr passieren - // ( kein erzwungenes Update ) - if ( SfxViewFrame::Current() == this ) - GetDispatcher()->Update_Impl(); -} - //-------------------------------------------------------------------- void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView ) @@ -1611,17 +1503,13 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) { pImp->bInCtor = sal_True; - pImp->pParentViewFrame = 0; pImp->bResizeInToOut = sal_True; pImp->bDontOverwriteResizeInToOut = sal_False; - pImp->pImportShell = 0; pImp->bObjLocked = sal_False; - pImp->bEventFlag = sal_True; pImp->pFocusWin = 0; pImp->pActiveChild = NULL; pImp->bRestoreView = sal_False; pImp->nCurViewId = 0; - pImp->bSetViewFrameLocked = sal_False; pImp->bReloading = sal_False; pImp->bIsDowning = sal_False; pImp->bModal = sal_False; @@ -1724,10 +1612,6 @@ SfxViewFrame::~SfxViewFrame() if ( GetFrame() && GetFrame()->GetCurrentViewFrame() == this ) GetFrame()->SetCurrentViewFrame_Impl( NULL ); - SfxObjectShell* pSh = pImp->pImportShell; - if( pSh ) - pSh->AbortImport(); - // von Frame-Liste abmelden SfxApplication *pSfxApp = SFX_APP(); SfxViewFrameArr_Impl &rFrames = pSfxApp->GetViewFrames_Impl(); @@ -1975,21 +1859,10 @@ void SfxViewFrame::SetViewShell_Impl( SfxViewShell *pVSh ) Der ParentViewFrame ist der ViewFrame des Containers bei internem InPlace */ -void SfxViewFrame::SetParentViewFrame_Impl(SfxViewFrame *pFrame) -{ - pImp->pParentViewFrame = pFrame; -} - -//-------------------------------------------------------------------- -/* - Beschreibung: - Der ParentViewFrame ist der ViewFrame des Containers bei internem InPlace -*/ - //TODO/LATER: is it still necessary? is there a replacement for GetParentViewFrame_Impl? SfxViewFrame* SfxViewFrame::GetParentViewFrame_Impl() const { - return pImp->pParentViewFrame; + return NULL; } //-------------------------------------------------------------------- @@ -2203,64 +2076,6 @@ void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus ) } } -//-------------------------------------------------------------------- - -SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId ) - -/* [Beschreibung] - - Erzeugt eine SfxViewShell f"ur diesen SfxViewFrame. Wird auch aus - - gerufen. -*/ - -{ - DBG_ASSERT( GetObjectShell(), "Kein Dokument!" ); - - LockAdjustPosSizePixel(); - - // passende View-Factory suchen - SfxObjectFactory &rDocFact = GetObjectShell()->GetFactory(); - sal_uInt16 nNewNo = nViewId ? USHRT_MAX : 0; - for ( sal_uInt16 nNo = 0; - nNo < rDocFact.GetViewFactoryCount(); - ++nNo ) - { - sal_uInt16 nFoundId = rDocFact.GetViewFactory(nNo).GetOrdinal(); - if ( nNewNo == USHRT_MAX ) - { - if ( nViewId == nFoundId ) - nNewNo = nNo; - } - } - - // per Factory erzeugen - GetBindings().ENTERREGISTRATIONS(); - SfxViewFactory &rViewFactory = rDocFact.GetViewFactory( nNewNo ); - SfxViewShell *pViewShell = rViewFactory.CreateInstance(this, 0); - SetViewShell_Impl(pViewShell); - UnlockAdjustPosSizePixel(); - - if ( GetWindow().IsReallyVisible() ) - DoAdjustPosSizePixel(pViewShell, Point(), GetWindow().GetOutputSizePixel()); - - // erste jetzt anzeigen (ausser wenn MTs BASIC-IDE mal wieder keins hat) - Window *pViewWin = pViewShell->GetWindow(); - if ( pViewWin && pViewShell->IsShowView_Impl() ) - pViewWin->Show(); - - // Dispatcher - GetDispatcher()->Push( *pViewShell ); - if ( pViewShell->GetSubShell() ) - GetDispatcher()->Push( *pViewShell->GetSubShell() ); - pViewShell->PushSubShells_Impl(); - - GetBindings().LEAVEREGISTRATIONS(); - - DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" ); - return pViewShell; -} - //------------------------------------------------------------------------- void SfxViewFrame::SetQuietMode_Impl( sal_Bool bOn ) @@ -2275,11 +2090,6 @@ SfxObjectShell* SfxViewFrame::GetObjectShell() return xObjSh; } -void SfxViewFrame::SetMargin_Impl( const Size& rMargin ) -{ - pImp->aMargin = rMargin; -} - const Size& SfxViewFrame::GetMargin_Impl() const { return pImp->aMargin; @@ -2508,14 +2318,6 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" ); return sal_True; } -//-------------------------------------------------------------------- - -void SfxViewFrame::SetViewData_Impl( sal_uInt16 nViewId, const String &rViewData ) -{ - pImp->bRestoreView = sal_True; - pImp->nCurViewId = nViewId; - pImp->aViewData = rViewData; -} //------------------------------------------------------------------------- String& SfxViewFrame::GetViewData_Impl() @@ -3770,11 +3572,6 @@ SfxChildWindow* SfxViewFrame::GetChildWindow(USHORT nId) return pWork ? pWork->GetChildWindow_Impl(nId) : NULL; } -SfxMacro* SfxViewFrame::GetRecordingMacro_Impl() -{ - return pImp->pMacro; -} - void SfxViewFrame::UpdateDocument_Impl() { SfxObjectShell* pDoc = GetObjectShell(); @@ -3785,17 +3582,6 @@ void SfxViewFrame::UpdateDocument_Impl() pDoc->UpdateFromTemplate_Impl(); } -BOOL SfxViewFrame::ClearEventFlag_Impl() -{ - if ( pImp->bEventFlag ) - { - pImp->bEventFlag = FALSE; - return TRUE; - } - else - return FALSE; -} - SfxViewFrame* SfxViewFrame::CreateViewFrame( SfxObjectShell& rDoc, sal_uInt16 nViewId, sal_Bool bHidden ) { SfxItemSet *pSet = rDoc.GetMedium()->GetItemSet(); -- cgit v1.2.3 From 0aa4ddde0b8c0d0540e2dd4f2af98401bd5df43b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Nov 2009 09:31:42 +0100 Subject: move LoadView_Impl from SfxObjectShell to SfxTopFrame --- sfx2/inc/sfx2/objsh.hxx | 4 +-- sfx2/inc/sfx2/topfrm.hxx | 1 + sfx2/source/doc/objcont.cxx | 65 ------------------------------------------ sfx2/source/doc/objxtor.cxx | 1 - sfx2/source/view/topfrm.cxx | 69 +++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 68 insertions(+), 72 deletions(-) diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 933c904a09..496c802673 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -221,7 +221,7 @@ private: SfxMedium * pMedium; // Beschreibung der Datei bzw. des Storage, in dem sich das Objekt befindet SfxStyleSheetBasePool* pStyleSheetPool; // StyleSheets SfxObjectCreateMode eCreateMode; // Zweck des Objekts - sal_uInt16 nViewNo; // Numerierung der MDIWins + sal_uInt16 nUnused; sal_Bool bHasName :1, // sal_True := bestehendes Objekt, sal_False := es ist ein neues Objekt bIsTmp :1; // temp. Storage @@ -785,10 +785,8 @@ public: // public-internals SAL_DLLPRIVATE IndexBitSet& GetNoSet_Impl(); SAL_DLLPRIVATE void SetProgress_Impl( SfxProgress *pProgress ); - SAL_DLLPRIVATE sal_uInt16& GetAktViewNo() { return nViewNo; } SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* ); SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 ); - SAL_DLLPRIVATE bool LoadView_Impl( SfxTopFrame& rPrefered ); SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl(); // configuration items diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx index e1058faab7..d805bfdf64 100644 --- a/sfx2/inc/sfx2/topfrm.hxx +++ b/sfx2/inc/sfx2/topfrm.hxx @@ -78,6 +78,7 @@ public: SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; + SAL_DLLPRIVATE bool LoadView_Impl( SfxObjectShell& rDoc ); //#endif }; diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index f15660538b..7b30345ff8 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -89,8 +88,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -using ::com::sun::star::document::XViewDataSupplier; -using ::com::sun::star::container::XIndexAccess; //==================================================================== @@ -193,68 +190,6 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig //==================================================================== -bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rTargetFrame ) -{ - DBG_ASSERT( GetMedium(), "A Medium should exist here!"); - if ( !GetMedium() ) - return false; - - // obtain view data - Reference< XViewDataSupplier > xViewDataSupplier( GetModel(), UNO_QUERY ); - Reference< XIndexAccess > xViewData; - if ( xViewDataSupplier.is() ) - xViewData = xViewDataSupplier->getViewData(); - - if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) - return false; - - // obtain the ViewID from the view data - USHORT nViewId = 0; - SEQUENCE < PROPERTYVALUE > aUserData; - if ( xViewData->getByIndex( 0 ) >>= aUserData ) - { - ::comphelper::NamedValueCollection aNamedUserData( aUserData ); - ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); - if ( sViewId.getLength() ) - { - sViewId = sViewId.copy( 4 ); // format is like in "view3" - nViewId = USHORT( sViewId.toInt32() ); - } - } - - SfxItemSet* pSet = GetMedium()->GetItemSet(); - pSet->ClearItem( SID_USER_DATA ); - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - - OSL_ENSURE( rTargetFrame.GetCurrentViewFrame() == NULL, - "SfxObjectShell::LoadView_Impl: no support (anymore) for loading into a non-empty frame!" ); - // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays - // done in higher layers, namely in the framework. - - rTargetFrame.InsertDocument_Impl( *this ); - SfxViewFrame* pViewFrame = rTargetFrame.GetCurrentViewFrame(); - - // only temporary data, don't hold it in the itemset - pSet->ClearItem( SID_VIEW_POS_SIZE ); - pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->ClearItem( SID_VIEW_ZOOM_MODE ); - - // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE - // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) - { - pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); - } - - if ( pViewFrame ) - // activate frame - pViewFrame->MakeActive_Impl( TRUE ); - - return true; -} - -//==================================================================== - void SfxObjectShell::UpdateDocInfoForSave() { uno::Reference xDocProps(getDocProperties()); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index a5aa92af04..50d10b4d49 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -315,7 +315,6 @@ SfxObjectShell::SfxObjectShell DBG_CTOR(SfxObjectShell, 0); bHasName = sal_False; - nViewNo = 0; pImp->bWaitingForPicklist = sal_True; diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 1b36895d89..3bdb23d491 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -39,9 +39,8 @@ #include #include #include -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include -#endif +#include #include #include #include @@ -59,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -104,6 +104,7 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; +using ::com::sun::star::document::XViewDataSupplier; //------------------------------------------------------------------------ @@ -768,6 +769,68 @@ void SfxTopFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const } } +bool SfxTopFrame::LoadView_Impl( SfxObjectShell& rDoc ) +{ + OSL_PRECOND( rDoc.GetMedium(), "SfxTopFrame::LoadView_Impl: no medium -> no view!"); + if ( !rDoc.GetMedium() ) + return false; + + OSL_PRECOND( GetCurrentViewFrame() == NULL, + "SfxObjectShell::LoadView_Impl: no support (anymore) for loading into a non-empty frame!" ); + // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays + // done in higher layers, namely in the framework. + if ( GetCurrentViewFrame() != NULL ) + return false; + + // obtain view data + Reference< XViewDataSupplier > xViewDataSupplier( rDoc.GetModel(), UNO_QUERY ); + Reference< XIndexAccess > xViewData; + if ( xViewDataSupplier.is() ) + xViewData = xViewDataSupplier->getViewData(); + + if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) + return false; + + // obtain the ViewID from the view data + USHORT nViewId = 0; + Sequence< PropertyValue > aUserData; + if ( xViewData->getByIndex( 0 ) >>= aUserData ) + { + ::comphelper::NamedValueCollection aNamedUserData( aUserData ); + ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); + if ( sViewId.getLength() ) + { + sViewId = sViewId.copy( 4 ); // format is like in "view3" + nViewId = USHORT( sViewId.toInt32() ); + } + } + + SfxItemSet* pSet = rDoc.GetMedium()->GetItemSet(); + pSet->ClearItem( SID_USER_DATA ); + pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + + InsertDocument_Impl( rDoc ); + SfxViewFrame* pViewFrame = GetCurrentViewFrame(); + + // only temporary data, don't hold it in the itemset + pSet->ClearItem( SID_VIEW_POS_SIZE ); + pSet->ClearItem( SID_WIN_POSSIZE ); + pSet->ClearItem( SID_VIEW_ZOOM_MODE ); + + // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE + // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet + if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) + { + pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); + } + + if ( pViewFrame ) + // activate frame + pViewFrame->MakeActive_Impl( TRUE ); + + return true; +} + sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) /* [Beschreibung] */ @@ -810,7 +873,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) // aus LoadView_Impl aufgerufen wurde! if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) { - if ( rDoc.LoadView_Impl( *this ) ) + if ( LoadView_Impl( rDoc ) ) { if ( GetCurrentDocument() != &rDoc ) // something went wrong during insertion -- cgit v1.2.3 From 97f44e6f634c75a6a407bc48674bcadf91f966d6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Nov 2009 09:32:26 +0100 Subject: [CWS autorecovery] get rid of LoadView_Impl, and thus the recursive calling of InsertDocument_Impl --- sfx2/inc/sfx2/topfrm.hxx | 1 - sfx2/source/view/topfrm.cxx | 189 +++++++++++++++++++++++--------------------- 2 files changed, 97 insertions(+), 93 deletions(-) diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx index d805bfdf64..e1058faab7 100644 --- a/sfx2/inc/sfx2/topfrm.hxx +++ b/sfx2/inc/sfx2/topfrm.hxx @@ -78,7 +78,6 @@ public: SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; - SAL_DLLPRIVATE bool LoadView_Impl( SfxObjectShell& rDoc ); //#endif }; diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 3bdb23d491..db06fbd7c9 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -769,85 +769,60 @@ void SfxTopFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const } } -bool SfxTopFrame::LoadView_Impl( SfxObjectShell& rDoc ) +namespace { - OSL_PRECOND( rDoc.GetMedium(), "SfxTopFrame::LoadView_Impl: no medium -> no view!"); - if ( !rDoc.GetMedium() ) - return false; - - OSL_PRECOND( GetCurrentViewFrame() == NULL, - "SfxObjectShell::LoadView_Impl: no support (anymore) for loading into a non-empty frame!" ); - // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays - // done in higher layers, namely in the framework. - if ( GetCurrentViewFrame() != NULL ) - return false; + bool lcl_getViewDataAndID( const Reference< XModel >& _rxDocument, Sequence< PropertyValue >& _o_viewData, USHORT& _o_viewId ) + { + _o_viewData.realloc(0); + _o_viewId = -1; - // obtain view data - Reference< XViewDataSupplier > xViewDataSupplier( rDoc.GetModel(), UNO_QUERY ); - Reference< XIndexAccess > xViewData; - if ( xViewDataSupplier.is() ) - xViewData = xViewDataSupplier->getViewData(); + Reference< XViewDataSupplier > xViewDataSupplier( _rxDocument, UNO_QUERY ); + Reference< XIndexAccess > xViewData; + if ( xViewDataSupplier.is() ) + xViewData = xViewDataSupplier->getViewData(); - if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) - return false; + if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) + return false; - // obtain the ViewID from the view data - USHORT nViewId = 0; - Sequence< PropertyValue > aUserData; - if ( xViewData->getByIndex( 0 ) >>= aUserData ) - { - ::comphelper::NamedValueCollection aNamedUserData( aUserData ); - ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); - if ( sViewId.getLength() ) + // obtain the ViewID from the view data + _o_viewId = 0; + if ( xViewData->getByIndex( 0 ) >>= _o_viewData ) { - sViewId = sViewId.copy( 4 ); // format is like in "view3" - nViewId = USHORT( sViewId.toInt32() ); + ::comphelper::NamedValueCollection aNamedUserData( _o_viewData ); + ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); + if ( sViewId.getLength() ) + { + sViewId = sViewId.copy( 4 ); // format is like in "view3" + _o_viewId = USHORT( sViewId.toInt32() ); + } } + return true; } - - SfxItemSet* pSet = rDoc.GetMedium()->GetItemSet(); - pSet->ClearItem( SID_USER_DATA ); - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - - InsertDocument_Impl( rDoc ); - SfxViewFrame* pViewFrame = GetCurrentViewFrame(); - - // only temporary data, don't hold it in the itemset - pSet->ClearItem( SID_VIEW_POS_SIZE ); - pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->ClearItem( SID_VIEW_ZOOM_MODE ); - - // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE - // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) - { - pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); - } - - if ( pViewFrame ) - // activate frame - pViewFrame->MakeActive_Impl( TRUE ); - - return true; } sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) /* [Beschreibung] */ { - const SfxObjectShell* pOldDocument = GetCurrentDocument(); - OSL_PRECOND( pOldDocument == NULL, + OSL_PRECOND( rDoc.GetMedium(), "SfxTopFrame::InsertDocument_Impl: no medium -> no view!"); + if ( !rDoc.GetMedium() ) + return sal_False; + + OSL_PRECOND( GetCurrentViewFrame() == NULL, + "SfxObjectShell::InsertDocument_Impl: no support (anymore) for loading into a non-empty frame!" ); + // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays + // done in higher layers, namely in the framework. + if ( GetCurrentViewFrame() != NULL ) + return sal_False; + + OSL_PRECOND( GetCurrentDocument() == NULL, "SfxTopFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); const SfxItemSet* pSet = GetItemSet_Impl(); if ( !pSet ) pSet = rDoc.GetMedium()->GetItemSet(); - SetItemSet_Impl(0); + SetItemSet_Impl( NULL ); - // Position und Groesse testen - // Wenn diese schon gesetzt sind, soll offensichtlich nicht noch - // LoadView_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame() - // an einer Task aufgerufen hat! ) SFX_ITEMSET_ARG( pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size SFX_ITEMSET_ARG( pSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID SFX_ITEMSET_ARG( pSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom @@ -857,47 +832,58 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) SFX_ITEMSET_ARG( pSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) SFX_ITEMSET_ARG( pSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) - if ( pEditItem && pEditItem->GetValue() ) + // hidden? + OSL_PRECOND( !pImp->bHidden, + "SfxTopFrame::InsertDocument_Impl: quite unexpected ... the below logic might not work in all cases here ..." ); + pImp->bHidden = pHidItem ? pHidItem->GetValue() : false; + + // plugin mode + const USHORT nPluginMode = pPluginMode ? pPluginMode->GetValue() : 0; + + // view only? + if ( pEditItem && pEditItem->GetValue() ) SetMenuBarOn_Impl( FALSE ); - if ( pHidItem ) - pImp->bHidden = pHidItem->GetValue(); + // view ID + USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : 0; if( !pImp->bHidden ) rDoc.OwnerLock( sal_True ); - const USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : 0; + Sequence< PropertyValue > aUserData; + bool bClearPosSizeZoom = false; + bool bReadUserData = false; - // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation - // aus den Dokument geladen werden, z.B. weil InsertDocument_Impl seinerseits - // aus LoadView_Impl aufgerufen wurde! - if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) + // if no view-related data exists in the set, then obtain the view data from the model + if ( !pJumpItem && !pViewDataItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) { - if ( LoadView_Impl( rDoc ) ) + nViewId = 0; + if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) { - if ( GetCurrentDocument() != &rDoc ) - // something went wrong during insertion - return sal_False; - rDoc.OwnerLock( sal_False ); - return sal_True; + SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); + + // clear the user data item in the medium - we'll use aUserData below + pMediumSet->ClearItem( SID_USER_DATA ); + pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + + bClearPosSizeZoom = bReadUserData = true; } } UpdateDescriptor( &rDoc ); - if ( pPluginMode && pPluginMode->GetValue() != 2 ) + if ( nPluginMode && ( nPluginMode != 2 ) ) SetInPlace_Impl( TRUE ); - OSL_ENSURE( GetCurrentViewFrame() == NULL, - "SfxTopFrame::InsertDocument_Impl: no support (anymore) for loading a document into a non-empty frame!" ); - // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays - // done in higher layers, namely in the framework. - SfxViewFrame* pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId ); if ( !pViewFrame->GetViewShell() ) + { + OSL_ENSURE( false, "SfxTopFrame::InsertDocument_Impl: something went wrong while creating the SfxTopViewFrame!" ); + pViewFrame->DoClose(); return sal_False; + } - if ( pPluginMode && pPluginMode->GetValue() == 1 ) + if ( nPluginMode == 1 ) { pViewFrame->ForceOuterResize_Impl( FALSE ); pViewFrame->GetBindings().HidePopups(TRUE); @@ -907,8 +893,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) GetWorkWindow_Impl()->Lock_Impl( TRUE ); GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - if ( GetCurrentViewFrame() ) - GetCurrentViewFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); } OSL_ENSURE( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT, @@ -917,17 +902,21 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since loads this method // here is never called before the load process finished. if ( pViewDataItem ) + { pViewFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True ); + } else if( pJumpItem ) + { pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); + } // Position und Groesse setzen - if ( pAreaItem && !pOldDocument ) + if ( pAreaItem ) PositionWindow_Impl( pAreaItem->GetValue() ); if ( !pImp->bHidden ) { - if ( rDoc.IsHelpDocument() || (pPluginMode && pPluginMode->GetValue() == 2) ) + if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) ) pViewFrame->GetDispatcher()->HideUI( TRUE ); else pViewFrame->GetDispatcher()->HideUI( FALSE ); @@ -935,26 +924,23 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) if ( IsInPlace() ) pViewFrame->LockAdjustPosSizePixel(); - if ( pPluginMode && pPluginMode->GetValue() == 3) + if ( ( nPluginMode == 3 ) ) GetWorkWindow_Impl()->SetInternalDockingAllowed(FALSE); if ( !IsInPlace() ) pViewFrame->GetDispatcher()->Update_Impl(); pViewFrame->Show(); GetWindow().Show(); - if ( !IsInPlace() || (pPluginMode && pPluginMode->GetValue() == 3) ) + if ( !IsInPlace() || ( nPluginMode == 3 ) ) pViewFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); rDoc.OwnerLock( sal_False ); - // Dont show container window! Its done by framework or directly - // by SfxTopFrame::Create() or SfxViewFrame::ExecView_Impl() ... - if ( IsInPlace() ) { pViewFrame->UnlockAdjustPosSizePixel(); // force resize for OLE server to fix layout problems of writer and math // see i53651 - if ( pPluginMode && pPluginMode->GetValue() == 3 ) + if ( nPluginMode == 3 ) pViewFrame->Resize(TRUE); } } @@ -981,7 +967,26 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) } SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); - return sal_True; + + if ( bClearPosSizeZoom ) + { + SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); + pMediumSet->ClearItem( SID_VIEW_POS_SIZE ); + pMediumSet->ClearItem( SID_WIN_POSSIZE ); + pMediumSet->ClearItem( SID_VIEW_ZOOM_MODE ); + } + + if ( bReadUserData ) + { + // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE + // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet + if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) + { + pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); + } + } + + return GetCurrentDocument() == &rDoc; } -- cgit v1.2.3 From afcbb9db9dd9935a347fc690af90cecb264c0ea3 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Nov 2009 09:33:27 +0100 Subject: broke down ::load into smaller pieces --- sfx2/inc/frmload.hxx | 45 ++++- sfx2/source/view/frmload.cxx | 379 +++++++++++++++++++++++-------------------- 2 files changed, 240 insertions(+), 184 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 73c524e8e7..d6db78bf96 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -52,6 +52,7 @@ #include #include #include +#include class SfxFilter; class SfxFilterMatcher; @@ -59,13 +60,14 @@ class SfxFrame; #include +class SfxFrameWeak; + class SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo > { ::comphelper::ComponentContext m_aContext; public: SfxFrameLoader_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory ); - virtual ~SfxFrameLoader_Impl(); SFX_DECL_XSERVICEINFO @@ -75,6 +77,9 @@ public: virtual sal_Bool SAL_CALL load( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL cancel() throw( ::com::sun::star::uno::RuntimeException ); +protected: + virtual ~SfxFrameLoader_Impl(); + private: const SfxFilter* impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& _rServiceName ) const; ::rtl::OUString impl_askForFilter_nothrow( @@ -84,22 +89,50 @@ private: const SfxFilter* impl_detectFilterForURL( const ::rtl::OUString& _rURL, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs, + const ::comphelper::NamedValueCollection& i_rDescriptor, const SfxFilterMatcher& rMatcher ) const; sal_Bool impl_createNewDocWithSlotParam( - const sal_uInt16 _nSlotID, - SfxFrame* _pFrame + const USHORT _nSlotID, + SfxFrame& i_rFrame ); sal_Bool impl_createNewDoc( - const SfxItemSet& _rSet, - SfxFrame* _pFrame, + const ::comphelper::NamedValueCollection& i_rDescriptor, + SfxFrame& i_rFrame, const ::rtl::OUString& _rFactoryURL ); void impl_ensureValidFrame_throw( const SfxFrame* _pFrame ); + + const SfxFilter* impl_determineFilter( + ::comphelper::NamedValueCollection& io_rDescriptor, + const SfxFilterMatcher& rMatcher + ); + + SfxAllItemSet impl_getInitialItemSet( + const ::comphelper::NamedValueCollection& i_rDescriptor + ) const; + + sal_Bool impl_loadExistingDocument( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_rxDocument, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxTargetFrame, + const ::comphelper::NamedValueCollection& i_rDescriptor + ); + + sal_Bool impl_cleanUp( + const sal_Bool i_bSuccess, + const SfxFrameWeak& i_wFrame + ); + + const SfxFilter* impl_determineTemplateDocument( + ::comphelper::NamedValueCollection& io_rDescriptor + ) const; + + USHORT impl_findSlotParam( + ::rtl::OUString& io_rFactoryURL + ); }; #endif diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index f388a4e636..4193503ab1 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -113,7 +113,7 @@ SfxFrameLoader_Impl::~SfxFrameLoader_Impl() // -------------------------------------------------------------------------------------------------------------------- const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUString& sURL, - const Sequence< PropertyValue >& rArgs, const SfxFilterMatcher& rMatcher ) const + const ::comphelper::NamedValueCollection& i_rDescriptor, const SfxFilterMatcher& rMatcher ) const { ::rtl::OUString sFilter; try @@ -128,11 +128,10 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt ::comphelper::NamedValueCollection aNewArgs; aNewArgs.put( "URL", sURL ); - ::comphelper::NamedValueCollection aOrgArgs( rArgs ); - if ( aOrgArgs.has( "InteractionHandler" ) ) - aNewArgs.put( "InteractionHandler", aOrgArgs.get( "InteractionHandler" ) ); - if ( aOrgArgs.has( "StatusIndicator" ) ) - aNewArgs.put( "StatusIndicator", aOrgArgs.get( "StatusIndicator" ) ); + if ( i_rDescriptor.has( "InteractionHandler" ) ) + aNewArgs.put( "InteractionHandler", i_rDescriptor.get( "InteractionHandler" ) ); + if ( i_rDescriptor.has( "StatusIndicator" ) ) + aNewArgs.put( "StatusIndicator", i_rDescriptor.get( "StatusIndicator" ) ); Sequence< PropertyValue > aQueryArgs( aNewArgs.getPropertyValues() ); ::rtl::OUString sType = xDetect->queryTypeByDescriptor( aQueryArgs, sal_True ); @@ -250,241 +249,270 @@ namespace } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const sal_uInt16 _nSlotID, SfxFrame* _pFrame ) +sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, SfxFrame& i_rFrame ) { SfxApplication* pApp = SFX_APP(); SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, pApp->GetPool() ); - aRequest.AppendItem( SfxFrameItem ( SID_DOCFRAME, _pFrame ) ); + aRequest.AppendItem( SfxFrameItem ( SID_DOCFRAME, &i_rFrame ) ); return lcl_getDispatchResult( pApp->ExecuteSlot( aRequest ) ); } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const SfxItemSet& _rSet, SfxFrame* _pFrame, const ::rtl::OUString& _rFactoryURL ) +sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, SfxFrame& i_rFrame, + const ::rtl::OUString& _rFactoryURL ) { - SfxApplication* pApp = SFX_APP(); + SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor ) ); - SfxRequest aRequest( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, _rSet ); - aRequest.AppendItem( SfxFrameItem( SID_DOCFRAME, _pFrame ) ); + SfxRequest aRequest( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, aSet ); + aRequest.AppendItem( SfxFrameItem( SID_DOCFRAME, &i_rFrame ) ); aRequest.AppendItem( SfxStringItem( SID_NEWDOCDIRECT, _rFactoryURL ) ); - SFX_ITEMSET_ARG( &_rSet, pDocumentTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE ); + SFX_ITEMSET_ARG( &aSet, pDocumentTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE ); if ( pDocumentTitleItem ) aRequest.AppendItem( *pDocumentTitleItem ); - return lcl_getDispatchResult( pApp->NewDocDirectExec_ImplOld( aRequest ) ); + return lcl_getDispatchResult( SFX_APP()->NewDocDirectExec_ImplOld( aRequest ) ); } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyValue >& rArgs, - const Reference< css::frame::XFrame >& _rTargetFrame ) - throw( css::uno::RuntimeException ) +const SfxFilter* SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor, const SfxFilterMatcher& rMatcher ) { - ENSURE_OR_THROW( _rTargetFrame.is(), "illegal NULL frame" ); + const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ); + const ::rtl::OUString sTypeName = io_rDescriptor.getOrDefault( "TypeName", ::rtl::OUString() ); + const ::rtl::OUString sFilterName = io_rDescriptor.getOrDefault( "FilterName", ::rtl::OUString() ); + const ::rtl::OUString sServiceName = io_rDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); + const Reference< XInteractionHandler > + xInteraction = io_rDescriptor.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ); - // this methods assumes that the filter is detected before, usually by calling the detect() method below - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + const SfxFilter* pFilter = NULL; - RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); + // get filter by its name directly ... + if ( sFilterName.getLength() ) + pFilter = rMatcher.GetFilter4FilterName( sFilterName ); - ::comphelper::NamedValueCollection aDescriptor( rArgs ); - const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() ); - const ::rtl::OUString sTypeName = aDescriptor.getOrDefault( "TypeName", ::rtl::OUString() ); - ::rtl::OUString sFilterName = aDescriptor.getOrDefault( "FilterName", ::rtl::OUString() ); - const ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); - const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); - const Reference< XInteractionHandler > - xInteraction = aDescriptor.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ); + // or search the preferred filter for the detected type ... + if ( !pFilter && sTypeName.getLength() ) + pFilter = rMatcher.GetFilter4EA( sTypeName ); - const SfxFilter* pFilter = NULL; - const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); + // or use given document service for detection too! + if ( !pFilter && sServiceName.getLength() ) + pFilter = impl_getFilterFromServiceName_nothrow( sServiceName ); - /* special mode: use already loaded model ... - In such case no filter name will be selected and no URL will be given! - Such informations are not neccessary. We have to create a new view only - and call setComponent() at the corresponding frame. */ - if( !xModel.is() ) + // or use interaction to ask user for right filter. + if ( !pFilter && xInteraction.is() && sURL.getLength() ) { + ::rtl::OUString sSelectedFilter = impl_askForFilter_nothrow( xInteraction, sURL ); + if ( sSelectedFilter.getLength() ) + pFilter = rMatcher.GetFilter4FilterName( sSelectedFilter ); + } - // get filter by its name directly ... - if ( sFilterName.getLength() ) - pFilter = rMatcher.GetFilter4FilterName( sFilterName ); + if ( pFilter ) + io_rDescriptor.put( "FilterName", ::rtl::OUString( pFilter->GetFilterName() ) ); - // or search the preferred filter for the detected type ... - if ( !pFilter && sTypeName.getLength() ) - pFilter = rMatcher.GetFilter4EA( sTypeName ); + return pFilter; +} - // or use given document service for detection too! - if ( !pFilter && sServiceName.getLength() ) - pFilter = impl_getFilterFromServiceName_nothrow( sServiceName ); +// -------------------------------------------------------------------------------------------------------------------- +SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::NamedValueCollection& i_rDescriptor ) const +{ + SfxAllItemSet aSet( SFX_APP()->GetPool() ); + TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); - // or use interaction to ask user for right filter. - if ( !pFilter && xInteraction.is() && sURL.getLength() ) - { - ::rtl::OUString sSelectedFilter = impl_askForFilter_nothrow( xInteraction, sURL ); - if ( sSelectedFilter.getLength() ) - pFilter = rMatcher.GetFilter4FilterName( sSelectedFilter ); - } + SFX_ITEMSET_ARG( &aSet, pRefererItem, SfxStringItem, SID_REFERER, FALSE ); + if ( !pRefererItem ) + aSet.Put( SfxStringItem( SID_REFERER, String() ) ); - if( !pFilter ) - return sal_False; + return aSet; +} + +// -------------------------------------------------------------------------------------------------------------------- +sal_Bool SfxFrameLoader_Impl::impl_loadExistingDocument( const Reference< XModel >& i_rxDocument, + const Reference< XFrame >& i_rxTargetFrame, + const ::comphelper::NamedValueCollection& i_rDescriptor ) +{ + ENSURE_OR_THROW( i_rxDocument.is() && i_rxTargetFrame.is(), "invallid model/frame" ); - // use filter names without prefix - sFilterName = pFilter->GetFilterName(); + SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor ) ); - // If detected filter indicates using of an own template format - // add property "AsTemplate" to descriptor. But suppress this step - // if such property already exists. - if ( pFilter->IsOwnTemplateFormat() && !aDescriptor.has( "AsTemplate" ) ) + SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxTargetFrame ); + aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); + + for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) + { + if ( i_rxDocument == pDoc->GetModel() ) { - aDescriptor.put( "AsTemplate", sal_Bool( sal_True ) ); + i_rxDocument->attachResource( i_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ), i_rDescriptor.getPropertyValues() ); + + pTargetFrame->SetItemSet_Impl( &aSet ); + return pTargetFrame->InsertDocument_Impl( *pDoc ); } } - // Achtung: beim Abraeumen der Objekte kann die SfxApp destruiert werden, vorher noch Deinitialize_Impl rufen - SfxApplication* pApp = SFX_APP(); + DBG_ERROR("Model is not based on SfxObjectShell - wrong frame loader use!"); + return sal_False; +} - // attention: Don't use rArgs, but instead aDescriptor, which is rArgs plus some - // changes - SfxAllItemSet aSet( pApp->GetPool() ); - TransformParameters( SID_OPENDOC, aDescriptor.getPropertyValues(), aSet ); +// -------------------------------------------------------------------------------------------------------------------- +sal_Bool SfxFrameLoader_Impl::impl_cleanUp( const sal_Bool i_bSuccess, const SfxFrameWeak& i_wFrame ) +{ + if ( !i_bSuccess && i_wFrame && !i_wFrame->GetCurrentDocument() ) + { + i_wFrame->SetFrameInterface_Impl( NULL ); + i_wFrame->DoClose(); + } - SFX_ITEMSET_ARG( &aSet, pRefererItem, SfxStringItem, SID_REFERER, FALSE ); - if ( !pRefererItem ) - aSet.Put( SfxStringItem( SID_REFERER, String() ) ); + return i_bSuccess; +} - SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - if ( xModel.is() ) +// -------------------------------------------------------------------------------------------------------------------- +const SfxFilter* SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const +{ + const ::rtl::OUString sTemplateRegioName = io_rDescriptor.getOrDefault( "TemplateRegionName", ::rtl::OUString() ); + const ::rtl::OUString sTemplateName = io_rDescriptor.getOrDefault( "TemplateName", ::rtl::OUString() ); + const ::rtl::OUString sServiceName = io_rDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); + const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ); + + // determine the full URL of the template to use, if any + String sTemplateURL; + if ( sTemplateRegioName.getLength() && sTemplateName.getLength() ) { - aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); + SfxDocumentTemplates aTmpFac; + aTmpFac.GetFull( sTemplateRegioName, sTemplateName, sTemplateURL ); + } + else + { + if ( sServiceName.getLength() ) + sTemplateURL = SfxObjectFactory::GetStandardTemplate( sServiceName ); + else + sTemplateURL = SfxObjectFactory::GetStandardTemplate( SfxObjectShell::GetServiceNameFromFactory( sURL ) ); + } - for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) + if ( sTemplateURL.Len() > 0 ) + { + // detect the filter for the template. Might still be NULL (if the template is broken, or does not + // exist, or some such), but this is handled by our caller the same way as if no template/URL was present. + const SfxFilter* pTemplateFilter = impl_detectFilterForURL( sTemplateURL, io_rDescriptor, SFX_APP()->GetFilterMatcher() ); + if ( pTemplateFilter ) { - if ( xModel == pDoc->GetModel() ) - { - pTargetFrame->SetItemSet_Impl( &aSet ); + // load the template document, but, well, "as template" + io_rDescriptor.put( "FilterName", ::rtl::OUString( pTemplateFilter->GetName() ) ); + io_rDescriptor.put( "FileName", ::rtl::OUString( sTemplateURL ) ); + io_rDescriptor.put( "AsTemplate", sal_True ); + } + return pTemplateFilter; + } - aDescriptor.remove( "Model" ); - aDescriptor.remove( "URL" ); + return NULL; +} - xModel->attachResource( sURL, aDescriptor.getPropertyValues() ); +// -------------------------------------------------------------------------------------------------------------------- +USHORT SfxFrameLoader_Impl::impl_findSlotParam( ::rtl::OUString& io_rFactoryURL ) +{ + ::rtl::OUString sSlotParam; + const sal_Int32 nParamPos = io_rFactoryURL.indexOf( '?' ); + if ( nParamPos >= 0 ) + { + // currently only the "slot" parameter is supported + const sal_Int32 nSlotPos = io_rFactoryURL.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "slot=" ), nParamPos ); + if ( nSlotPos > 0 ) + sSlotParam = io_rFactoryURL.copy( nSlotPos + 5 ); + io_rFactoryURL = io_rFactoryURL.copy( 0, nParamPos ); + } - // TODO: replace by ViewFactory - return pTargetFrame->InsertDocument_Impl( *pDoc ); - } - } + if ( sSlotParam.getLength() ) + return USHORT( sSlotParam.toInt32() ); - DBG_ERROR("Model is not based on SfxObjectShell - wrong frame loader use!"); + return 0; +} + +// -------------------------------------------------------------------------------------------------------------------- +sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyValue >& rArgs, + const Reference< css::frame::XFrame >& _rTargetFrame ) + throw( css::uno::RuntimeException ) +{ + ENSURE_OR_THROW( _rTargetFrame.is(), "illegal NULL frame" ); + + // this methods assumes that the filter is detected before, usually by calling the detect() method below + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); + + ::comphelper::NamedValueCollection aDescriptor( rArgs ); + const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); + + const SfxFilter* pDocumentFilter = NULL; + const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); + + // if a model is given, just load this into a newly created frame + if ( xModel.is() ) + return impl_loadExistingDocument( xModel, _rTargetFrame, aDescriptor ); + + // determine the filter to use + pDocumentFilter = impl_determineFilter( aDescriptor, rMatcher ); + if ( !pDocumentFilter ) return sal_False; - } + + // If detected filter indicates using of an own template format + // add property "AsTemplate" to descriptor. But suppress this step + // if such property already exists. + if ( pDocumentFilter->IsOwnTemplateFormat() && !aDescriptor.has( "AsTemplate" ) ) + aDescriptor.put( "AsTemplate", sal_Bool( sal_True ) ); // check for the URL pattern of our factory URLs + SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); + ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); SfxFrameWeak wFrame = pTargetFrame; - String aPrefix = String::CreateFromAscii( "private:factory/" ); - String aFact( sURL ); - if ( aPrefix.Len() == aFact.Match( aPrefix ) ) - { - // it's a factory URL - aFact.Erase( 0, aPrefix.Len() ); - - // look for parameters - String aParam; - USHORT nPos = aFact.Search( '?' ); - if ( nPos != STRING_NOTFOUND ) - { - // currently only the "slot" parameter is supported - USHORT nParamPos = aFact.Search( String::CreateFromAscii("slot="), nPos ); - if ( nParamPos != STRING_NOTFOUND ) - aParam = aFact.Copy( nParamPos+5, aFact.Len() ); - aFact.Erase( nPos, aFact.Len() ); - } - - if ( aParam.Len() ) - { - sal_Bool bSuccess = impl_createNewDocWithSlotParam( (sal_uInt16)aParam.ToInt32(), pTargetFrame ); - if ( !bSuccess && wFrame && !wFrame->GetCurrentDocument() ) - { - wFrame->SetFrameInterface_Impl( NULL ); - wFrame->DoClose(); - } - return bSuccess; - } + const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() ); + if ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 ) + { + ::rtl::OUString sFactory( sURL.copy( sizeof( "private:factory/" ) -1 ) ); - String sTemplateURL; - SFX_ITEMSET_ARG( &aSet, pTemplateRegionItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, FALSE ); - SFX_ITEMSET_ARG( &aSet, pTemplateNameItem, SfxStringItem, SID_TEMPLATE_NAME, FALSE ); - if ( pTemplateRegionItem && pTemplateNameItem ) - { - SfxDocumentTemplates aTmpFac; - aTmpFac.GetFull( pTemplateRegionItem->GetValue(), pTemplateNameItem->GetValue(), sTemplateURL ); - } - else + USHORT nSlotParam = impl_findSlotParam( sFactory ); + if ( nSlotParam != 0 ) { - if ( sServiceName.getLength() ) - sTemplateURL = SfxObjectFactory::GetStandardTemplate( sServiceName ); - else - sTemplateURL = SfxObjectFactory::GetStandardTemplate( SfxObjectShell::GetServiceNameFromFactory( sURL ) ); + sal_Bool bSuccess = impl_createNewDocWithSlotParam( nSlotParam, *pTargetFrame ); + return impl_cleanUp( bSuccess, wFrame ); } - BOOL bUseTemplate = (sTemplateURL.Len()>0); - if( bUseTemplate ) + const SfxFilter* pTemplateFilter = impl_determineTemplateDocument( aDescriptor ); + if ( !pTemplateFilter ) { - // #i21583# - // Forget the filter, which was detected for the corresponding "private:factory/xxx" URL. - // We must use the right filter, matching to this document ... not to the private URL! - const SfxFilter* pTemplateFilter = impl_detectFilterForURL(sTemplateURL, rArgs, rMatcher); - if (pTemplateFilter) - { - pFilter = pTemplateFilter; - sFilterName = pTemplateFilter->GetName(); - // standard template set -> load it "AsTemplate" - aSet.Put( SfxStringItem ( SID_FILE_NAME, sTemplateURL ) ); - aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) ); - } - - // #119268# - // something is wrong with the set default template (e.g. unknown format, missing file etcpp) - // The we have to jump into the following special code, where "private:factory/ URL's are handled. - // We cant "load" such private/factory URL's! - else - bUseTemplate = FALSE; + // no or no valid template found => just create a default doc of the desired type, without any template + sal_Bool bSuccess = impl_createNewDoc( aDescriptor, *pTargetFrame, sFactory ); + return impl_cleanUp( bSuccess, wFrame ); } - if ( !bUseTemplate ) - { - // execute "NewDocument" request - sal_Bool bSuccess = impl_createNewDoc( aSet, pTargetFrame, aFact ); - if ( !bSuccess && wFrame && !wFrame->GetCurrentDocument() ) - { - wFrame->SetFrameInterface_Impl( NULL ); - wFrame->DoClose(); - } - return bSuccess; - } + // #i21583# + // ignore/forget the filter which was detected for the corresponding "private:factory/xxx" URL. + pDocumentFilter = pTemplateFilter; } else { - // load the desired file - aSet.Put( SfxStringItem ( SID_FILE_NAME, sURL ) ); + aDescriptor.put( "FileName", sURL ); } - DBG_ASSERT( pFilter, "SfxFrameLoader_Impl::load: could not determine a filter!" ); - if ( !pFilter ) + const ::rtl::OUString sFilterName = aDescriptor.getOrDefault( "FilterName", ::rtl::OUString() ); + + // at this point, we need a filter + DBG_ASSERT( pDocumentFilter, "SfxFrameLoader_Impl::load: could not determine a filter!" ); + if ( !pDocumentFilter ) return sal_False; - // !TODO: replace by direct construction of model (needs view factory) - sal_Bool bDisaster = sal_False; - SfxObjectShell* pDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() ); + SfxObjectShell* pDoc = SfxObjectShell::CreateObject( pDocumentFilter->GetServiceName() ); if ( !pDoc ) return sal_False; + aDescriptor.put( "Frame", _rTargetFrame ); + SfxAllItemSet aSet( impl_getInitialItemSet( aDescriptor ) ); + aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); - aSet.Put( SfxUnoAnyItem( SID_FILLFRAME, makeAny( _rTargetFrame ) ) ); aSet.Put( SfxStringItem( SID_FILTER_NAME, sFilterName ) ); sal_Bool bLoadSuccess = sal_False; + sal_Bool bDisaster = sal_False; try { Reference< XLoadable > xLoadable( pDoc->GetModel(), UNO_QUERY ); @@ -504,7 +532,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV /* #121119# - We dont know why _pFrame can be corrupt here. + We dont know why pTargetFrame can be corrupt here. But if it was deleted it shouldnt exists inside our global list. May be we can use the damaged pointer to detect if it was removed from this global list. @@ -513,7 +541,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); - // !TODO: replace by ViewFactory pTargetFrame->SetItemSet_Impl( &aSet ); if ( pTargetFrame->InsertDocument_Impl( *pDoc ) ) { @@ -525,19 +552,15 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV else bDisaster = sal_True; } - catch ( css::uno::Exception& ) + catch ( Exception& ) { bDisaster = sal_True; } if ( bDisaster ) { - if ( wFrame && !wFrame->GetCurrentDocument() ) - { - // document loading was not successful; close SfxFrame (but not XFrame!) - wFrame->SetFrameInterface_Impl( NULL ); - wFrame->DoClose(); - } + // document loading was not successful; close SfxFrame (but not XFrame!) and document + impl_cleanUp( false, wFrame ); Reference< XCloseable > xCloseable( pDoc->GetModel(), UNO_QUERY ); if ( xCloseable.is() ) @@ -546,7 +569,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV { xCloseable->close( sal_True ); } - catch ( css::uno::Exception& ) + catch ( Exception& ) { DBG_UNHANDLED_EXCEPTION(); } -- cgit v1.2.3 From 3ba29d8b0675db42e894e53cd621748cb21d5cca Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Nov 2009 09:34:02 +0100 Subject: [CWS autorecovery] #i65597# moved creation of new documents from application to loader The loader was the only client of the respective application code, and needs to have better control over the document creation process. In the course of this move, some dead/duplicate/obsolete code has been removed. --- sfx2/inc/frmload.hxx | 15 ++-- sfx2/inc/sfx2/app.hxx | 2 - sfx2/inc/sfx2/objsh.hxx | 1 - sfx2/source/appl/appopen.cxx | 186 --------------------------------------- sfx2/source/appl/appuno.cxx | 110 +++++++++++++---------- sfx2/source/doc/objstor.cxx | 17 ---- sfx2/source/doc/sfxbasemodel.cxx | 62 +++++++------ sfx2/source/view/frmload.cxx | 72 ++++++++++----- 8 files changed, 150 insertions(+), 315 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index d6db78bf96..f8a4e21dec 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -56,7 +56,7 @@ class SfxFilter; class SfxFilterMatcher; -class SfxFrame; +class SfxTopFrame; #include @@ -95,24 +95,25 @@ private: sal_Bool impl_createNewDocWithSlotParam( const USHORT _nSlotID, - SfxFrame& i_rFrame + SfxTopFrame& i_rFrame ); sal_Bool impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxFrame& i_rFrame, - const ::rtl::OUString& _rFactoryURL + SfxTopFrame& i_rFrame, + const ::rtl::OUString& _rFactoryName ); - void impl_ensureValidFrame_throw( const SfxFrame* _pFrame ); + void impl_ensureValidFrame_throw( const SfxTopFrame* _pFrame ); const SfxFilter* impl_determineFilter( - ::comphelper::NamedValueCollection& io_rDescriptor, + ::comphelper::NamedValueCollection& io_rDescriptor, const SfxFilterMatcher& rMatcher ); SfxAllItemSet impl_getInitialItemSet( - const ::comphelper::NamedValueCollection& i_rDescriptor + const ::comphelper::NamedValueCollection& i_rDescriptor, + SfxTopFrame& i_rTargetFrame ) const; sal_Bool impl_loadExistingDocument( diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx index a19181d391..7d23e31065 100644 --- a/sfx2/inc/sfx2/app.hxx +++ b/sfx2/inc/sfx2/app.hxx @@ -267,7 +267,6 @@ public: SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl(); SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl(); - SAL_DLLPRIVATE SfxObjectShellLock NewDoc_Impl( const String& rFactory, const SfxItemSet* pSet = NULL ); SAL_DLLPRIVATE BOOL QueryExit_Impl(); SAL_DLLPRIVATE void SetOptions_Impl(const SfxItemSet &); SAL_DLLPRIVATE FASTBOOL Initialize_Impl(); @@ -293,7 +292,6 @@ public: // TODO/CLEANUP: still needed? SAL_DLLPRIVATE void NewDocDirectExec_Impl(SfxRequest &); SAL_DLLPRIVATE void NewDocExec_Impl(SfxRequest &); - SAL_DLLPRIVATE const SfxPoolItem* NewDocDirectExec_ImplOld(SfxRequest &); // used by FrameLoader to work with the old behaviour ... SAL_DLLPRIVATE void OpenDocExec_Impl(SfxRequest &); SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &); SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &); diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 496c802673..680bf43647 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -504,7 +504,6 @@ public: //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void SetLastMark_Impl( const String & ); SAL_DLLPRIVATE const String& GetLastMark_Impl() const; - SAL_DLLPRIVATE sal_Bool DoInitNew_Impl( const ::rtl::OUString& rName ); //#endif // DDE-Interface diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index adca56638c..f9af1c5add 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -514,65 +514,6 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil //-------------------------------------------------------------------- -SfxObjectShellLock SfxApplication::NewDoc_Impl( const String& rFact, const SfxItemSet *pSet ) -{ - SfxObjectShellLock xDoc; - String aFact( rFact ); - String aPrefix = String::CreateFromAscii( "private:factory/" ); - if ( aPrefix.Len() == aFact.Match( aPrefix ) ) - aFact.Erase( 0, aPrefix.Len() ); - USHORT nPos = aFact.Search( '?' ); - String aParam; - if ( nPos != STRING_NOTFOUND ) - { - aParam = aFact.Copy( nPos, aFact.Len() ); - aFact.Erase( nPos, aFact.Len() ); - aParam.Erase(0,1); - } - - xDoc = SfxObjectShell::CreateObjectByFactoryName( aFact ); - aParam = INetURLObject::decode( aParam, '%', INetURLObject::DECODE_WITH_CHARSET ); - if( xDoc.Is() ) - xDoc->DoInitNew_Impl( aParam ); - - if ( xDoc.Is() ) - { - if ( pSet ) - { - // TODO/LATER: Should the other arguments be transfered as well? - SFX_ITEMSET_ARG( pSet, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, FALSE); - if ( pDefaultPathItem ) - xDoc->GetMedium()->GetItemSet()->Put( *pDefaultPathItem ); - SFX_ITEMSET_ARG( pSet, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME, FALSE); - if ( pDefaultNameItem ) - xDoc->GetMedium()->GetItemSet()->Put( *pDefaultNameItem ); - SFX_ITEMSET_ARG( pSet, pTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE ); - if ( pTitleItem ) - xDoc->GetMedium()->GetItemSet()->Put( *pTitleItem ); - } - - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel ( xDoc->GetModel(), ::com::sun::star::uno::UNO_QUERY ); - if ( xModel.is() ) - { - SfxItemSet* pNew = xDoc->GetMedium()->GetItemSet()->Clone(); - pNew->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL ); - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs; - TransformItems( SID_OPENDOC, *pNew, aArgs ); - - sal_Int32 nLength = aArgs.getLength(); - aArgs.realloc( nLength + 1 ); - - aArgs[nLength].Name = DEFINE_CONST_UNICODE("Title"); - aArgs[nLength].Value <<= ::rtl::OUString( xDoc->GetTitle( SFX_TITLE_DETECT ) ); - - xModel->attachResource( ::rtl::OUString(), aArgs ); - delete pNew; - } - } - - return xDoc; -} - void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); @@ -606,133 +547,6 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq ) rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) ); } -const SfxPoolItem* SfxApplication::NewDocDirectExec_ImplOld( SfxRequest& rReq ) -{ - DBG_MEMTEST(); -/* - SFX_REQUEST_ARG(rReq, pHidden, SfxBoolItem, SID_HIDDEN, FALSE); -//(mba)/task - - if ( !pHidden || !pHidden->GetValue() ) - Application::GetAppWindow()->EnterWait(); -*/ - SfxObjectShellLock xDoc; - - // Factory-RegNo kann per Parameter angegeben sein - SfxErrorContext aEc(ERRCTX_SFX_NEWDOCDIRECT); - rReq.GetArgs(); // -Wall required?? - String aFactory; - rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) ); - SFX_REQUEST_ARG( rReq, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, FALSE ); - if( pFactoryName ) - aFactory = pFactoryName->GetValue(); - else - aFactory = SvtModuleOptions().GetDefaultModuleName(); - - SFX_REQUEST_ARG( rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS, FALSE); - if ( pFileFlagsItem ) - { - // Werte auf einzelne Items verteilen - String aFileFlags = pFileFlagsItem->GetValue(); - aFileFlags.ToUpperAscii(); - if ( STRING_NOTFOUND != aFileFlags.Search( 0x0054 ) ) // T = 54h - rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) ); - if ( STRING_NOTFOUND != aFileFlags.Search( 0x0048 ) ) // H = 48h - rReq.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); - if ( STRING_NOTFOUND != aFileFlags.Search( 0x0052 ) ) // R = 52h - rReq.AppendItem( SfxBoolItem( SID_DOC_READONLY, TRUE ) ); - if ( STRING_NOTFOUND != aFileFlags.Search( 0x0042 ) ) // B = 42h - rReq.AppendItem( SfxBoolItem( SID_PREVIEW, TRUE ) ); - if ( STRING_NOTFOUND != aFileFlags.Search( 0x0053 ) ) // S = 53h - rReq.AppendItem( SfxBoolItem( SID_SILENT, TRUE ) ); - } - - xDoc = NewDoc_Impl( aFactory, rReq.GetArgs() ); - if ( xDoc.Is() ) - { - SFX_REQUEST_ARG(rReq, pReadonly, SfxBoolItem, SID_DOC_READONLY, FALSE); - if ( pReadonly ) - xDoc->GetMedium()->GetItemSet()->Put( *pReadonly ); - - SFX_REQUEST_ARG(rReq, pPreview, SfxBoolItem, SID_PREVIEW, FALSE); - if ( pPreview ) - xDoc->GetMedium()->GetItemSet()->Put( *pPreview ); - - SFX_REQUEST_ARG(rReq, pSilent, SfxBoolItem, SID_SILENT, FALSE); - if ( pSilent ) - xDoc->GetMedium()->GetItemSet()->Put( *pSilent ); - - SFX_REQUEST_ARG(rReq, pFlags, SfxStringItem, SID_OPTIONS, FALSE); - if ( pFlags ) - xDoc->GetMedium()->GetItemSet()->Put( *pFlags ); - } - - // View erzeugen - if ( xDoc.Is() ) - { - SFX_REQUEST_ARG(rReq, pHidden, SfxBoolItem, SID_HIDDEN, FALSE); - BOOL bHidden = FALSE; - if ( pHidden ) - { - xDoc->GetMedium()->GetItemSet()->Put( *pHidden, SID_HIDDEN ); - bHidden = pHidden->GetValue(); - } - - SFX_REQUEST_ARG(rReq, pViewId, SfxUInt16Item, SID_VIEW_ID, FALSE); - USHORT nViewId = 0; - if ( pViewId ) - { - xDoc->GetMedium()->GetItemSet()->Put( *pViewId, SID_VIEW_ID ); - nViewId = pViewId->GetValue(); - } - - xDoc->SetActivateEvent_Impl( SFX_EVENT_CREATEDOC ); -// xDoc->Get_Impl()->nLoadedFlags = SFX_LOADED_ALL; - const SfxItemSet* pInternalArgs = rReq.GetInternalArgs_Impl(); - if( pInternalArgs ) - xDoc->GetMedium()->GetItemSet()->Put( *pInternalArgs ); - SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME, FALSE); - - SfxFrame* pFrame = NULL; - if (pFrameItem) - pFrame = pFrameItem->GetFrame(); - else - pFrame = (SfxFrame*)SfxTopFrame::Create(xDoc, nViewId, bHidden, pInternalArgs); - if ( pFrame ) - { - if ( pFrame->GetCurrentDocument() == xDoc || pFrame->PrepareClose_Impl( TRUE, TRUE ) == TRUE ) - { - if ( bHidden ) - { - xDoc->RestoreNoDelete(); - xDoc->OwnerLock( TRUE ); - xDoc->Get_Impl()->bHiddenLockedByAPI = TRUE; - } - - if ( pFrame->GetCurrentDocument() != xDoc ) - { - SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pFrame ); - OSL_ENSURE( pTopFrame, "An SfxFrame which is no SfxTopFrame?!" ); - if ( pTopFrame && pTopFrame->InsertDocument_Impl( *xDoc ) ) - rReq.SetReturnValue( SfxFrameItem( 0, pFrame ) ); - else - xDoc->DoClose(); - } - } - else - xDoc.Clear(); - } - } - - return rReq.GetReturnValue(); - -//(mba)/task -/* - if ( !pHidden || !pHidden->GetValue() ) - Application::GetAppWindow()->LeaveWait(); - */ -} - //-------------------------------------------------------------------- void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 81d198412a..5613cd143b 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -147,54 +147,56 @@ using namespace ::com::sun::star::io; #define FRAMELOADER_SERVICENAME "com.sun.star.frame.FrameLoader" #define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler" -static const String sTemplateRegionName = String::CreateFromAscii( "TemplateRegionName" ); -static const String sTemplateName = String::CreateFromAscii( "TemplateName" ); -static const String sAsTemplate = String::CreateFromAscii( "AsTemplate" ); -static const String sOpenNewView = String::CreateFromAscii( "OpenNewView" ); -static const String sViewId = String::CreateFromAscii( "ViewId" ); -static const String sPluginMode = String::CreateFromAscii( "PluginMode" ); -static const String sReadOnly = String::CreateFromAscii( "ReadOnly" ); -static const String sStartPresentation = String::CreateFromAscii( "StartPresentation" ); -static const String sFrameName = String::CreateFromAscii( "FrameName" ); -static const String sMediaType = String::CreateFromAscii( "MediaType" ); -static const String sPostData = String::CreateFromAscii( "PostData" ); -static const String sCharacterSet = String::CreateFromAscii( "CharacterSet" ); -static const String sInputStream = String::CreateFromAscii( "InputStream" ); -static const String sStream = String::CreateFromAscii( "Stream" ); -static const String sOutputStream = String::CreateFromAscii( "OutputStream" ); -static const String sHidden = String::CreateFromAscii( "Hidden" ); -static const String sPreview = String::CreateFromAscii( "Preview" ); -static const String sViewOnly = String::CreateFromAscii( "ViewOnly" ); -static const String sDontEdit = String::CreateFromAscii( "DontEdit" ); -static const String sSilent = String::CreateFromAscii( "Silent" ); -static const String sJumpMark = String::CreateFromAscii( "JumpMark" ); -static const String sFileName = String::CreateFromAscii( "FileName" ); -static const String sSalvageURL = String::CreateFromAscii( "SalvagedFile" ); -static const String sStatusInd = String::CreateFromAscii( "StatusIndicator" ); -static const String sModel = String::CreateFromAscii( "Model" ); -static const String sFrame = String::CreateFromAscii( "Frame" ); -static const String sViewData = String::CreateFromAscii( "ViewData" ); -static const String sFilterData = String::CreateFromAscii( "FilterData" ); -static const String sSelectionOnly = String::CreateFromAscii( "SelectionOnly" ); -static const String sFilterFlags = String::CreateFromAscii( "FilterFlags" ); -static const String sMacroExecMode = String::CreateFromAscii( "MacroExecutionMode" ); -static const String sUpdateDocMode = String::CreateFromAscii( "UpdateDocMode" ); -static const String sMinimized = String::CreateFromAscii( "Minimized" ); -static const String sInteractionHdl = String::CreateFromAscii( "InteractionHandler" ); -static const String sWindowState = String::CreateFromAscii( "WindowState" ); -static const String sUCBContent = String::CreateFromAscii( "UCBContent" ); -static const String sRepairPackage = String::CreateFromAscii( "RepairPackage" ); -static const String sDocumentTitle = String::CreateFromAscii( "DocumentTitle" ); -static const String sComponentData = String::CreateFromAscii( "ComponentData" ); -static const String sComponentContext = String::CreateFromAscii( "ComponentContext" ); -static const String sDocumentBaseURL = String::CreateFromAscii( "DocumentBaseURL" ); -static const String sHierarchicalDocumentName = String::CreateFromAscii( "HierarchicalDocumentName" ); -static const String sCopyStreamIfPossible = String::CreateFromAscii( "CopyStreamIfPossible" ); -static const String sNoAutoSave = String::CreateFromAscii( "NoAutoSave" ); -static const String sFolderName = String::CreateFromAscii( "FolderName" ); -static const String sUseSystemDialog = String::CreateFromAscii( "UseSystemDialog" ); -static const String sStandardDir = String::CreateFromAscii( "StandardDir" ); -static const String sBlackList = String::CreateFromAscii( "BlackList" ); +static const String sTemplateRegionName = String::CreateFromAscii( "TemplateRegionName" ); +static const String sTemplateName = String::CreateFromAscii( "TemplateName" ); +static const String sAsTemplate = String::CreateFromAscii( "AsTemplate" ); +static const String sOpenNewView = String::CreateFromAscii( "OpenNewView" ); +static const String sViewId = String::CreateFromAscii( "ViewId" ); +static const String sPluginMode = String::CreateFromAscii( "PluginMode" ); +static const String sReadOnly = String::CreateFromAscii( "ReadOnly" ); +static const String sStartPresentation = String::CreateFromAscii( "StartPresentation" ); +static const String sFrameName = String::CreateFromAscii( "FrameName" ); +static const String sMediaType = String::CreateFromAscii( "MediaType" ); +static const String sPostData = String::CreateFromAscii( "PostData" ); +static const String sCharacterSet = String::CreateFromAscii( "CharacterSet" ); +static const String sInputStream = String::CreateFromAscii( "InputStream" ); +static const String sStream = String::CreateFromAscii( "Stream" ); +static const String sOutputStream = String::CreateFromAscii( "OutputStream" ); +static const String sHidden = String::CreateFromAscii( "Hidden" ); +static const String sPreview = String::CreateFromAscii( "Preview" ); +static const String sViewOnly = String::CreateFromAscii( "ViewOnly" ); +static const String sDontEdit = String::CreateFromAscii( "DontEdit" ); +static const String sSilent = String::CreateFromAscii( "Silent" ); +static const String sJumpMark = String::CreateFromAscii( "JumpMark" ); +static const String sFileName = String::CreateFromAscii( "FileName" ); +static const String sSalvageURL = String::CreateFromAscii( "SalvagedFile" ); +static const String sStatusInd = String::CreateFromAscii( "StatusIndicator" ); +static const String sModel = String::CreateFromAscii( "Model" ); +static const String sFrame = String::CreateFromAscii( "Frame" ); +static const String sViewData = String::CreateFromAscii( "ViewData" ); +static const String sFilterData = String::CreateFromAscii( "FilterData" ); +static const String sSelectionOnly = String::CreateFromAscii( "SelectionOnly" ); +static const String sFilterFlags = String::CreateFromAscii( "FilterFlags" ); +static const String sMacroExecMode = String::CreateFromAscii( "MacroExecutionMode" ); +static const String sUpdateDocMode = String::CreateFromAscii( "UpdateDocMode" ); +static const String sMinimized = String::CreateFromAscii( "Minimized" ); +static const String sInteractionHdl = String::CreateFromAscii( "InteractionHandler" ); +static const String sWindowState = String::CreateFromAscii( "WindowState" ); +static const String sUCBContent = String::CreateFromAscii( "UCBContent" ); +static const String sRepairPackage = String::CreateFromAscii( "RepairPackage" ); +static const String sDocumentTitle = String::CreateFromAscii( "DocumentTitle" ); +static const String sComponentData = String::CreateFromAscii( "ComponentData" ); +static const String sComponentContext = String::CreateFromAscii( "ComponentContext" ); +static const String sDocumentBaseURL = String::CreateFromAscii( "DocumentBaseURL" ); +static const String sHierarchicalDocumentName = String::CreateFromAscii( "HierarchicalDocumentName" ); +static const String sCopyStreamIfPossible = String::CreateFromAscii( "CopyStreamIfPossible" ); +static const String sNoAutoSave = String::CreateFromAscii( "NoAutoSave" ); +static const String sFolderName = String::CreateFromAscii( "FolderName" ); +static const String sUseSystemDialog = String::CreateFromAscii( "UseSystemDialog" ); +static const String sStandardDir = String::CreateFromAscii( "StandardDir" ); +static const String sBlackList = String::CreateFromAscii( "BlackList" ); +static const String sSuggestedSaveAsDir = String::CreateFromAscii( "SuggestedSaveAsDir" ); +static const String sSuggestedSaveAsName = String::CreateFromAscii( "SuggestedSaveAsName" ); void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -701,6 +703,18 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque rSet.Put( stringList ); } } + else if ( aName == sSuggestedSaveAsDir ) + { + SfxStringItem aItem( SID_DEFAULTFILEPATH, String() ); + if ( aItem.PutValue( rProp.Value ) ) + rSet.Put( aItem ); + } + else if ( aName == sSuggestedSaveAsName ) + { + SfxStringItem aItem( SID_DEFAULTFILENAME, String() ); + if ( aItem.PutValue( rProp.Value ) ) + rSet.Put( aItem ); + } else if ( aName == sFileName ) { ::rtl::OUString sVal; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index e1a8c626b2..bc0b3aa171 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -448,23 +448,6 @@ sal_Bool SfxObjectShell::Load( SfxMedium& rMedium ) return GeneralInit_Impl( rMedium.GetStorage(), sal_True ); } -//------------------------------------------------------------------------- -sal_Bool SfxObjectShell::DoInitNew_Impl( const ::rtl::OUString& rName ) - -/* [Beschreibung] -*/ - -{ - if ( rName.getLength() ) - { - DBG_ERROR( "This code is intended to be removed, the caller part must be checked!\n" ); - return DoInitNew(0); - } - else - return DoInitNew(0); -} - - sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed ) /* [Beschreibung] diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 25d2d964e9..5e0ccf5789 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -73,6 +73,7 @@ #include #include // can be removed when this is a "real" service #include +#include #include #include #include @@ -967,53 +968,50 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& if ( m_pData->m_pObjectShell.Is() ) { m_pData->m_sURL = rURL; - uno::Sequence< beans::PropertyValue > aNewSeqArgs( rArgs.getLength() ); - sal_Int32 nNewLen = 0; - for ( sal_Int32 nInd = 0; nInd < rArgs.getLength(); nInd++ ) + SfxObjectShell* pObjectShell = m_pData->m_pObjectShell; + + ::comphelper::NamedValueCollection aArgs( rArgs ); + + Sequence< sal_Int32 > aWinExtent; + if ( ( aArgs.get( "WinExtent" ) >>= aWinExtent )&& ( aWinExtent.getLength() == 4 ) ) { - if ( rArgs[nInd].Name.equalsAscii( "WinExtent" ) ) - { - Sequence< sal_Int32 > aSize; - if ( ( rArgs[nInd].Value >>= aSize ) && aSize.getLength() == 4 ) - { - Rectangle aTmpRect( aSize[0], aSize[1], aSize[2], aSize[3] ); - aTmpRect = OutputDevice::LogicToLogic( aTmpRect, MAP_100TH_MM, m_pData->m_pObjectShell->GetMapUnit() ); - m_pData->m_pObjectShell->SetVisArea( aTmpRect ); - } - } - else if ( rArgs[nInd].Name.equalsAscii( "BreakMacroSignature" ) ) - { - sal_Bool bBreakMacroSign = sal_False; - rArgs[nInd].Value >>= bBreakMacroSign; - m_pData->m_pObjectShell->BreakMacroSign_Impl( bBreakMacroSign ); - } - else if ( !rArgs[nInd].Name.equalsAscii( "Stream" ) && !rArgs[nInd].Name.equalsAscii( "InputStream" ) ) - { - // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be ignored here - aNewSeqArgs[nNewLen++] = rArgs[nInd]; - } + Rectangle aVisArea( aWinExtent[0], aWinExtent[1], aWinExtent[2], aWinExtent[3] ); + aVisArea = OutputDevice::LogicToLogic( aVisArea, MAP_100TH_MM, pObjectShell->GetMapUnit() ); + pObjectShell->SetVisArea( aVisArea ); + } + + sal_Bool bBreakMacroSign = sal_False; + if ( aArgs.get( "BreakMacroSignature" ) >>= bBreakMacroSign ) + { + pObjectShell->BreakMacroSign_Impl( bBreakMacroSign ); } - aNewSeqArgs.realloc( nNewLen ); + aArgs.remove( "WinExtent" ); + aArgs.remove( "BreakMacroSignature" ); + aArgs.remove( "Stream" ); + aArgs.remove( "InputStream" ); - m_pData->m_seqArguments = aNewSeqArgs; + // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here - if( m_pData->m_pObjectShell->GetMedium() ) + m_pData->m_seqArguments = aArgs.getPropertyValues(); + + SfxMedium* pMedium = pObjectShell->GetMedium(); + if ( pMedium ) { - SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() ); + SfxAllItemSet aSet( pObjectShell->GetPool() ); TransformParameters( SID_OPENDOC, rArgs, aSet ); - m_pData->m_pObjectShell->GetMedium()->GetItemSet()->Put( aSet ); + pMedium->GetItemSet()->Put( aSet ); SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False ); if ( pItem ) - m_pData->m_pObjectShell->GetMedium()->SetFilter( - m_pData->m_pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( pItem->GetValue() ) ); + pMedium->SetFilter( + pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( pItem->GetValue() ) ); SFX_ITEMSET_ARG( &aSet, pTitleItem, SfxStringItem, SID_DOCINFO_TITLE, sal_False ); if ( pTitleItem ) { - SfxViewFrame* pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell ); + SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pObjectShell ); if ( pFrame ) pFrame->UpdateTitle(); } diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 4193503ab1..9d3662e090 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include #include @@ -75,6 +77,7 @@ namespace css = ::com::sun::star; #include #include #include +#include #include "brokenpackageint.hxx" #include "objshimp.hxx" @@ -249,7 +252,7 @@ namespace } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, SfxFrame& i_rFrame ) +sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, SfxTopFrame& i_rFrame ) { SfxApplication* pApp = SFX_APP(); @@ -260,20 +263,44 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlo } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, SfxFrame& i_rFrame, - const ::rtl::OUString& _rFactoryURL ) +sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, SfxTopFrame& i_rFrame, + const ::rtl::OUString& _rFactoryName ) { - SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor ) ); + OSL_PRECOND( i_rFrame.GetCurrentDocument() == NULL, + "SfxFrameLoader_Impl::impl_createNewDoc: inserting into an already-occupied frame is not supported anymore!" ); + if ( i_rFrame.GetCurrentDocument() != NULL ) + return sal_False; + + SfxErrorContext aEc( ERRCTX_SFX_NEWDOCDIRECT ); + + // create new document + SfxObjectShellLock xDoc = SfxObjectShell::CreateObjectByFactoryName( _rFactoryName ); + if ( !xDoc.Is() || !xDoc->DoInitNew( NULL ) ) + return sal_False; - SfxRequest aRequest( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, aSet ); - aRequest.AppendItem( SfxFrameItem( SID_DOCFRAME, &i_rFrame ) ); - aRequest.AppendItem( SfxStringItem( SID_NEWDOCDIRECT, _rFactoryURL ) ); + Reference< XModel > xModel( xDoc->GetModel(), UNO_QUERY ); + OSL_ENSURE( xModel.is(), "SfxFrameLoader_Impl::impl_createNewDoc: not sure this is really allowed ..." ); + if ( xModel.is() ) + { + ::comphelper::NamedValueCollection aArgs( i_rDescriptor ); + aArgs.remove( "StatusIndicator" ); // TODO: why this? + + xModel->attachResource( ::rtl::OUString(), aArgs.getPropertyValues() ); + } + + const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False ); + if ( bHidden ) + { + xDoc->RestoreNoDelete(); + xDoc->OwnerLock( TRUE ); + xDoc->Get_Impl()->bHiddenLockedByAPI = TRUE; + } - SFX_ITEMSET_ARG( &aSet, pDocumentTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE ); - if ( pDocumentTitleItem ) - aRequest.AppendItem( *pDocumentTitleItem ); + if ( i_rFrame.InsertDocument_Impl( *xDoc ) ) + return sal_True; - return lcl_getDispatchResult( SFX_APP()->NewDocDirectExec_ImplOld( aRequest ) ); + xDoc->DoClose(); + return sal_False; } // -------------------------------------------------------------------------------------------------------------------- @@ -315,7 +342,8 @@ const SfxFilter* SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedV } // -------------------------------------------------------------------------------------------------------------------- -SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::NamedValueCollection& i_rDescriptor ) const +SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::NamedValueCollection& i_rDescriptor, + SfxTopFrame& i_rTargetFrame ) const { SfxAllItemSet aSet( SFX_APP()->GetPool() ); TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); @@ -324,6 +352,8 @@ SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::N if ( !pRefererItem ) aSet.Put( SfxStringItem( SID_REFERER, String() ) ); + aSet.Put( SfxFrameItem( SID_DOCFRAME, &i_rTargetFrame ) ); + return aSet; } @@ -334,10 +364,8 @@ sal_Bool SfxFrameLoader_Impl::impl_loadExistingDocument( const Reference< XModel { ENSURE_OR_THROW( i_rxDocument.is() && i_rxTargetFrame.is(), "invallid model/frame" ); - SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor ) ); - SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxTargetFrame ); - aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); + ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) { @@ -345,6 +373,7 @@ sal_Bool SfxFrameLoader_Impl::impl_loadExistingDocument( const Reference< XModel { i_rxDocument->attachResource( i_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ), i_rDescriptor.getPropertyValues() ); + SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor, *pTargetFrame ) ); pTargetFrame->SetItemSet_Impl( &aSet ); return pTargetFrame->InsertDocument_Impl( *pDoc ); } @@ -440,16 +469,16 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); ::comphelper::NamedValueCollection aDescriptor( rArgs ); - const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); - - const SfxFilter* pDocumentFilter = NULL; - const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); + const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); // if a model is given, just load this into a newly created frame if ( xModel.is() ) return impl_loadExistingDocument( xModel, _rTargetFrame, aDescriptor ); // determine the filter to use + const SfxFilter* pDocumentFilter = NULL; + const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); + pDocumentFilter = impl_determineFilter( aDescriptor, rMatcher ); if ( !pDocumentFilter ) return sal_False; @@ -506,9 +535,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV return sal_False; aDescriptor.put( "Frame", _rTargetFrame ); - SfxAllItemSet aSet( impl_getInitialItemSet( aDescriptor ) ); - aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); + SfxAllItemSet aSet( impl_getInitialItemSet( aDescriptor, *pTargetFrame ) ); aSet.Put( SfxStringItem( SID_FILTER_NAME, sFilterName ) ); sal_Bool bLoadSuccess = sal_False; @@ -579,7 +607,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV return bLoadSuccess; } -void SfxFrameLoader_Impl::impl_ensureValidFrame_throw( const SfxFrame* _pFrame ) +void SfxFrameLoader_Impl::impl_ensureValidFrame_throw( const SfxTopFrame* _pFrame ) { SfxFrame* pTmp = NULL; for ( pTmp = SfxFrame::GetFirst(); pTmp; pTmp = SfxFrame::GetNext( *pTmp ) ) -- cgit v1.2.3 From 7611382f8650f14e5cfd86ec97c2979388313c1c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Nov 2009 10:45:06 +0100 Subject: oops, forgot one direction for the SID_DEFAULTFILE*<->SuggestedSaveAs* conversion --- sfx2/source/appl/appuno.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 5613cd143b..9053fbcd0d 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1494,6 +1494,16 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta ((SfxStringListItem*)pItem)->GetStringList( aList ); pValue[nActProp++].Value <<= aList ; } + if ( rSet.GetItemState( SID_DEFAULTFILEPATH, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = sSuggestedSaveAsDir; + pValue[nActProp++].Value = pItem->QueryValue; + } + if ( rSet.GetItemState( SID_DEFAULTFILENAME, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = sSuggestedSaveAsName; + pValue[nActProp++].Value = pItem->QueryValue; + } if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = sFrameName; -- cgit v1.2.3 From fc67855348ecf729e9bd314a391873dd36ab4a78 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Nov 2009 10:51:52 +0100 Subject: [CWS autorecovery] also transform the Referer/SID_REFERER when translating between an UNO-MediaDescriptor ad an ItemSet --- sfx2/source/appl/appuno.cxx | 16 ++++++++++++++-- sfx2/source/view/frmload.cxx | 8 +++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 9053fbcd0d..b430ca1519 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -197,6 +197,7 @@ static const String sStandardDir = String::CreateFromAscii( "Stan static const String sBlackList = String::CreateFromAscii( "BlackList" ); static const String sSuggestedSaveAsDir = String::CreateFromAscii( "SuggestedSaveAsDir" ); static const String sSuggestedSaveAsName = String::CreateFromAscii( "SuggestedSaveAsName" ); +static const String sReferer = String::CreateFromAscii( "Referer" ); void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -715,6 +716,12 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if ( aItem.PutValue( rProp.Value ) ) rSet.Put( aItem ); } + else if ( aName == sReferer ) + { + SfxStringItem aItem( SID_REFERER, String() ); + if ( aItem.PutValue( rProp.Value ) ) + rSet.Put( aItem ); + } else if ( aName == sFileName ) { ::rtl::OUString sVal; @@ -1497,12 +1504,17 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( rSet.GetItemState( SID_DEFAULTFILEPATH, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = sSuggestedSaveAsDir; - pValue[nActProp++].Value = pItem->QueryValue; + pItem->QueryValue( pValue[nActProp++].Value ); } if ( rSet.GetItemState( SID_DEFAULTFILENAME, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = sSuggestedSaveAsName; - pValue[nActProp++].Value = pItem->QueryValue; + pItem->QueryValue( pValue[nActProp++].Value ); + } + if ( rSet.GetItemState( SID_REFERER, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = sReferer; + pItem->QueryValue( pValue[nActProp++].Value ); } if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 9d3662e090..855e21f51b 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -348,10 +348,6 @@ SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::N SfxAllItemSet aSet( SFX_APP()->GetPool() ); TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); - SFX_ITEMSET_ARG( &aSet, pRefererItem, SfxStringItem, SID_REFERER, FALSE ); - if ( !pRefererItem ) - aSet.Put( SfxStringItem( SID_REFERER, String() ) ); - aSet.Put( SfxFrameItem( SID_DOCFRAME, &i_rTargetFrame ) ); return aSet; @@ -469,9 +465,11 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); ::comphelper::NamedValueCollection aDescriptor( rArgs ); - const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); + if ( !aDescriptor.has( "Referer" ) ) + aDescriptor.put( "Referer", ::rtl::OUString() ); // if a model is given, just load this into a newly created frame + const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); if ( xModel.is() ) return impl_loadExistingDocument( xModel, _rTargetFrame, aDescriptor ); -- cgit v1.2.3 From c1fd59f9ffac049fa65e4dcc05a77e6e390740bd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Nov 2009 11:13:46 +0100 Subject: do not explicitly transform SuggestedSaveAs* and Referer, they're covered by the implicit transformation of the SID_OPENDOC arguments --- sfx2/source/appl/appuno.cxx | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index b430ca1519..0e3a3c1e5c 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -195,9 +195,6 @@ static const String sFolderName = String::CreateFromAscii( "Fold static const String sUseSystemDialog = String::CreateFromAscii( "UseSystemDialog" ); static const String sStandardDir = String::CreateFromAscii( "StandardDir" ); static const String sBlackList = String::CreateFromAscii( "BlackList" ); -static const String sSuggestedSaveAsDir = String::CreateFromAscii( "SuggestedSaveAsDir" ); -static const String sSuggestedSaveAsName = String::CreateFromAscii( "SuggestedSaveAsName" ); -static const String sReferer = String::CreateFromAscii( "Referer" ); void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -704,24 +701,6 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque rSet.Put( stringList ); } } - else if ( aName == sSuggestedSaveAsDir ) - { - SfxStringItem aItem( SID_DEFAULTFILEPATH, String() ); - if ( aItem.PutValue( rProp.Value ) ) - rSet.Put( aItem ); - } - else if ( aName == sSuggestedSaveAsName ) - { - SfxStringItem aItem( SID_DEFAULTFILENAME, String() ); - if ( aItem.PutValue( rProp.Value ) ) - rSet.Put( aItem ); - } - else if ( aName == sReferer ) - { - SfxStringItem aItem( SID_REFERER, String() ); - if ( aItem.PutValue( rProp.Value ) ) - rSet.Put( aItem ); - } else if ( aName == sFileName ) { ::rtl::OUString sVal; @@ -1501,21 +1480,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta ((SfxStringListItem*)pItem)->GetStringList( aList ); pValue[nActProp++].Value <<= aList ; } - if ( rSet.GetItemState( SID_DEFAULTFILEPATH, sal_False, &pItem ) == SFX_ITEM_SET ) - { - pValue[nActProp].Name = sSuggestedSaveAsDir; - pItem->QueryValue( pValue[nActProp++].Value ); - } - if ( rSet.GetItemState( SID_DEFAULTFILENAME, sal_False, &pItem ) == SFX_ITEM_SET ) - { - pValue[nActProp].Name = sSuggestedSaveAsName; - pItem->QueryValue( pValue[nActProp++].Value ); - } - if ( rSet.GetItemState( SID_REFERER, sal_False, &pItem ) == SFX_ITEM_SET ) - { - pValue[nActProp].Name = sReferer; - pItem->QueryValue( pValue[nActProp++].Value ); - } if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = sFrameName; -- cgit v1.2.3 From f84131ff7b28482f17f6126b43ce0fd5d581723c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Nov 2009 10:31:39 +0100 Subject: [CWS autorecovery] removed unused *_Impl methods --- sfx2/inc/sfx2/objsh.hxx | 25 ------------------------- sfx2/inc/sfx2/viewfrm.hxx | 5 +---- sfx2/source/doc/objmisc.cxx | 6 ------ sfx2/source/doc/objstor.cxx | 25 ------------------------- sfx2/source/doc/objxtor.cxx | 21 --------------------- sfx2/source/view/viewfrm.cxx | 37 ++----------------------------------- 6 files changed, 3 insertions(+), 116 deletions(-) diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 680bf43647..d7447cddab 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -227,11 +227,8 @@ private: private: //#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE void Construct_Impl(); SAL_DLLPRIVATE void UpdateTime_Impl(const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties> & i_xDocProps); - SAL_DLLPRIVATE sal_Bool MakeBackup_Impl(const String &rName, - sal_Bool bCopyAllways = sal_False); SAL_DLLPRIVATE sal_Bool SaveTo_Impl(SfxMedium &rMedium, const SfxItemSet* pSet ); @@ -250,10 +247,6 @@ protected: */ void SetHasNoBasic(); -//#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE void StartLoading_Impl(); -//#endif - /// template method, called by FlushDocInfo; this implementation is empty virtual void DoFlushDocInfo(); @@ -501,10 +494,6 @@ public: void SetTitle( const String& rTitle ); String GetTitle( sal_uInt16 nMaxLen = 0 ) const; void InvalidateName(); // Zuruecksetzen auf unbenannt -//#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE void SetLastMark_Impl( const String & ); - SAL_DLLPRIVATE const String& GetLastMark_Impl() const; -//#endif // DDE-Interface virtual long DdeExecute( const String& rCmd ); @@ -618,9 +607,6 @@ public: virtual SEQUENCE< OUSTRING > GetEventNames(); -//REMOVE SotStorageStreamRef GetConfigurationStream( const String& rName, BOOL bCreate=FALSE ); -//REMOVE SvStorageRef GetConfigurationStorage( SotStorage* pStor=NULL ); - Window* GetDialogParent( SfxMedium* pMedium=0 ); String UpdateTitle( SfxMedium* pMed=NULL, USHORT nDocViewNo=0 ); static SfxObjectShell* CreateObject( const String& rServiceName, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD ); @@ -673,12 +659,10 @@ public: virtual Printer * GetDocumentPrinter(); virtual OutputDevice* GetDocumentRefDev(); virtual void OnDocumentPrinterChanged( Printer * pNewPrinter ); - //virtual UINT32 GetViewAspect() const; virtual Rectangle GetVisArea( USHORT nAspect ) const; virtual void SetVisArea( const Rectangle & rVisArea ); const Rectangle & GetVisArea() const; void SetVisAreaSize( const Size & rVisSize ); -//REMOVE virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CreateTransferableSnapshot(); virtual ULONG GetMiscStatus() const; MapUnit GetMapUnit() const; @@ -722,9 +706,6 @@ public: SAL_DLLPRIVATE ::rtl::OUString CreateTempCopyOfStorage_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); - SAL_DLLPRIVATE static sal_Bool NoDependencyFromManifest_Impl( - const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); - SAL_DLLPRIVATE void InitOwnModel_Impl(); SAL_DLLPRIVATE void BreakMacroSign_Impl( sal_Bool bBreakMacroSing ); SAL_DLLPRIVATE void CheckSecurityOnLoading_Impl(); @@ -733,7 +714,6 @@ public: const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >& aInfos ); SAL_DLLPRIVATE void CheckEncryption_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ); - SAL_DLLPRIVATE SEQUENCE< OUSTRING > GetEventNames_Impl(); SAL_DLLPRIVATE void InitBasicManager_Impl(); SAL_DLLPRIVATE SfxObjectShell_Impl* Get_Impl() { return pImp; } @@ -767,12 +747,10 @@ public: const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr ); SAL_DLLPRIVATE void PositionView_Impl(); SAL_DLLPRIVATE void UpdateFromTemplate_Impl(); - SAL_DLLPRIVATE void Reload_Impl(); SAL_DLLPRIVATE sal_Bool CanReload_Impl(); SAL_DLLPRIVATE void SetNamedVisibility_Impl(); SAL_DLLPRIVATE sal_Bool DoSave_Impl( const SfxItemSet* pSet=0 ); SAL_DLLPRIVATE sal_Bool Save_Impl( const SfxItemSet* pSet=0 ); - SAL_DLLPRIVATE void UpdatePickList_Impl(); SAL_DLLPRIVATE sal_Bool PreDoSaveAs_Impl(const String &rFileName, const String &rFiltName, SfxItemSet *); SAL_DLLPRIVATE sal_Bool APISaveAs_Impl ( const String& aFileName, SfxItemSet* aParams ); SAL_DLLPRIVATE sal_Bool CommonSaveAs_Impl ( const INetURLObject& aURL, const String& aFilterName, SfxItemSet* aParams ); @@ -789,9 +767,6 @@ public: SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl(); // configuration items - SAL_DLLPRIVATE SfxEventConfigItem_Impl* GetEventConfig_Impl( sal_Bool bForce=sal_False ); - SAL_DLLPRIVATE SfxAcceleratorManager* GetAccMgr_Impl(); - SAL_DLLPRIVATE SfxToolBoxConfig* GetToolBoxConfig_Impl(); SAL_DLLPRIVATE sal_uInt16 ImplGetSignatureState( sal_Bool bScriptingContent = FALSE ); SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 2d11a31384..4dad7e97d8 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -270,7 +270,7 @@ public: SAL_DLLPRIVATE void GetDocNumber_Impl(); SAL_DLLPRIVATE BOOL IsDowning_Impl() const; SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell *pVSh ); - SAL_DLLPRIVATE void ReleaseObjectShell_Impl( BOOL bStoreView = FALSE ); + SAL_DLLPRIVATE void ReleaseObjectShell_Impl(); SAL_DLLPRIVATE void GetState_Impl( SfxItemSet &rSet ); SAL_DLLPRIVATE void ExecReload_Impl( SfxRequest &rReq ); @@ -295,9 +295,6 @@ public: SAL_DLLPRIVATE const Size& GetMargin_Impl() const; SAL_DLLPRIVATE void SetActiveChildFrame_Impl( SfxViewFrame* ); SAL_DLLPRIVATE SfxViewFrame* GetActiveChildFrame_Impl() const; - SAL_DLLPRIVATE BOOL IsRestoreView_Impl() const; - SAL_DLLPRIVATE void SetRestoreView_Impl( BOOL ); - SAL_DLLPRIVATE String& GetViewData_Impl(); SAL_DLLPRIVATE String GetActualPresentationURL_Impl() const; SAL_DLLPRIVATE static void CloseHiddenFrames_Impl(); SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 0c3ccad221..7df10f2549 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -2022,12 +2022,6 @@ void SfxObjectShell::SetHeaderAttributesForSourceViewHack() ->SetAttributes(); } -void SfxObjectShell::StartLoading_Impl() -{ - pImp->nLoadedFlags = 0; - pImp->bModelInitialized = sal_False; -} - sal_Bool SfxObjectShell::IsPreview() const { if ( !pMedium ) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index bc0b3aa171..06c228d71b 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -211,31 +211,6 @@ sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd ) return sal_False; } -//------------------------------------------------------------------------- -sal_Bool SfxObjectShell::NoDependencyFromManifest_Impl( const uno::Reference< embed::XStorage >& xStorage ) -{ - uno::Sequence< ::rtl::OUString > aElements = xStorage->getElementNames(); - for ( sal_Int32 nInd = 0; nInd < aElements.getLength(); nInd++ ) - { - if ( xStorage->isStorageElement( aElements[nInd] ) ) - { - // if there are other standard elements that do not need manifest.xml the following - // list can be extended - if ( !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) ) - && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Configurations" ) ) ) - && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Configurations2" ) ) ) - && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Thumbnails" ) ) ) - && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ) ) ) - { - // the substorage is not know as one that does not need manifest.xml - return sal_False; - } - } - } - - return sal_True; -} - //------------------------------------------------------------------------- sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl( ::rtl::OUString aURL, diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 50d10b4d49..3bcbd5c4b3 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -862,20 +862,6 @@ sal_Bool SfxObjectShell::DoClose() //-------------------------------------------------------------------- -void SfxObjectShell::SetLastMark_Impl( const String &rMark ) -{ - pImp->aMark = rMark; -} - -//-------------------------------------------------------------------- - -const String& SfxObjectShell::GetLastMark_Impl() const -{ - return pImp->aMark; -} - -//-------------------------------------------------------------------- - SfxObjectShell* SfxObjectShell::GetObjectShell() { return this; @@ -900,13 +886,6 @@ SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames() return *pEventNameContainer; } -SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames_Impl() -{ - if (!pImp->xEventNames.getLength()) - pImp->xEventNames = GetEventNames(); - return pImp->xEventNames; -} - //-------------------------------------------------------------------- void SfxObjectShell::SetModel( SfxBaseModel* pModel ) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 72f489b930..1fc77ff622 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -170,11 +170,9 @@ struct SfxViewFrame_Impl SvBorder aBorder; Size aMargin; Size aSize; - String aViewData; String aFrameTitle; TypeId aLastType; String aActualURL; - String aActualPresentationURL; SfxFrame* pFrame; svtools::AsynchronLink* pReloader; //SfxInPlaceFrame* pIPFrame; @@ -186,7 +184,6 @@ struct SfxViewFrame_Impl sal_Bool bResizeInToOut:1; sal_Bool bDontOverwriteResizeInToOut:1; sal_Bool bObjLocked:1; - sal_Bool bRestoreView:1; sal_Bool bReloading:1; sal_Bool bIsDowning:1; sal_Bool bInCtor:1; @@ -1035,7 +1032,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) } //-------------------------------------------------------------------- -void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView ) +void SfxViewFrame::ReleaseObjectShell_Impl() /* [Beschreibung] @@ -1068,10 +1065,6 @@ void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView ) SfxViewShell *pDyingViewSh = GetViewShell(); if ( pDyingViewSh ) { - SetRestoreView_Impl( bStoreView ); - if ( bStoreView ) - pDyingViewSh->WriteUserData( GetViewData_Impl(), sal_True ); - // Jetzt alle SubShells wechhauen pDyingViewSh->PushSubShells_Impl( sal_False ); sal_uInt16 nLevel = pDispatcher->GetShellLevel( *pDyingViewSh ); @@ -1507,7 +1500,6 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) pImp->bObjLocked = sal_False; pImp->pFocusWin = 0; pImp->pActiveChild = NULL; - pImp->bRestoreView = sal_False; pImp->nCurViewId = 0; pImp->bReloading = sal_False; pImp->bIsDowning = sal_False; @@ -2280,13 +2272,6 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl pSh->PushSubShells_Impl(); GetDispatcher()->Flush(); - if ( pImp->bRestoreView && pImp->aViewData.Len() ) - { - // restore view data if required - pSh->ReadUserData( pImp->aViewData, sal_True ); - pImp->bRestoreView = sal_False; - } - // create UI elements before size is set if ( SfxViewFrame::Current() == this ) GetDispatcher()->Update_Impl( sal_True ); @@ -2318,24 +2303,6 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl return sal_True; } -//------------------------------------------------------------------------- -String& SfxViewFrame::GetViewData_Impl() -{ - return pImp->aViewData; -} - -//------------------------------------------------------------------------- -sal_Bool SfxViewFrame::IsRestoreView_Impl() const -{ - return pImp->bRestoreView; -} - -//------------------------------------------------------------------------- -void SfxViewFrame::SetRestoreView_Impl( sal_Bool bOn ) -{ - pImp->bRestoreView = bOn; -} - //------------------------------------------------------------------------- sal_uInt16 SfxViewFrame::GetCurViewId() const { @@ -2762,7 +2729,7 @@ String SfxViewFrame::GetActualPresentationURL_Impl() const { if ( xObjSh.Is() ) return xObjSh->GetMedium()->GetName(); - return pImp->aActualPresentationURL; + return String(); } void SfxViewFrame::SetModalMode( sal_Bool bModal ) -- cgit v1.2.3 From a11628cc8e24beef1bbde2933b291c0d0e418204 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Nov 2009 11:18:19 +0100 Subject: [CWS autorecovery] further streamlined the SFX frame loader's load method --- sfx2/inc/frmload.hxx | 18 ++-- sfx2/source/doc/sfxbasemodel.cxx | 7 ++ sfx2/source/view/frmload.cxx | 218 ++++++++++++++++----------------------- 3 files changed, 103 insertions(+), 140 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index f8a4e21dec..5d04fbc13e 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -95,25 +95,21 @@ private: sal_Bool impl_createNewDocWithSlotParam( const USHORT _nSlotID, - SfxTopFrame& i_rFrame + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame ); sal_Bool impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxTopFrame& i_rFrame, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame, const ::rtl::OUString& _rFactoryName ); - void impl_ensureValidFrame_throw( const SfxTopFrame* _pFrame ); - - const SfxFilter* impl_determineFilter( - ::comphelper::NamedValueCollection& io_rDescriptor, - const SfxFilterMatcher& rMatcher + void impl_determineFilter( + ::comphelper::NamedValueCollection& io_rDescriptor ); SfxAllItemSet impl_getInitialItemSet( - const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxTopFrame& i_rTargetFrame + const ::comphelper::NamedValueCollection& i_rDescriptor ) const; sal_Bool impl_loadExistingDocument( @@ -127,12 +123,12 @@ private: const SfxFrameWeak& i_wFrame ); - const SfxFilter* impl_determineTemplateDocument( + bool impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const; USHORT impl_findSlotParam( - ::rtl::OUString& io_rFactoryURL + const ::rtl::OUString& i_rFactoryURL ); }; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 5e0ccf5789..5e95cfb048 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1911,6 +1911,13 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >& nError ? nError : ERRCODE_IO_CANTREAD ); } } + + BOOL bHidden = FALSE; + SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False); + if ( pHidItem ) + bHidden = pHidItem->GetValue(); + // !TODO: will be done by Framework! + pMedium->SetUpdatePickList( !bHidden ); } } diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 855e21f51b..6157d4100b 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -252,24 +252,26 @@ namespace } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, SfxTopFrame& i_rFrame ) +sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, const Reference< XFrame >& i_rxFrame ) { - SfxApplication* pApp = SFX_APP(); + SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxFrame ); + ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + SfxFrameWeak wFrame = pTargetFrame; - SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, pApp->GetPool() ); - aRequest.AppendItem( SfxFrameItem ( SID_DOCFRAME, &i_rFrame ) ); + SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() ); + aRequest.AppendItem( SfxFrameItem ( SID_DOCFRAME, pTargetFrame ) ); - return lcl_getDispatchResult( pApp->ExecuteSlot( aRequest ) ); + sal_Bool bSuccess = lcl_getDispatchResult( SFX_APP()->ExecuteSlot( aRequest ) ); + return impl_cleanUp( bSuccess, wFrame ); } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, SfxTopFrame& i_rFrame, +sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, const Reference< XFrame >& i_rxFrame, const ::rtl::OUString& _rFactoryName ) { - OSL_PRECOND( i_rFrame.GetCurrentDocument() == NULL, - "SfxFrameLoader_Impl::impl_createNewDoc: inserting into an already-occupied frame is not supported anymore!" ); - if ( i_rFrame.GetCurrentDocument() != NULL ) - return sal_False; + SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxFrame ); + ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + SfxFrameWeak wFrame = pTargetFrame; SfxErrorContext aEc( ERRCTX_SFX_NEWDOCDIRECT ); @@ -296,15 +298,12 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueC xDoc->Get_Impl()->bHiddenLockedByAPI = TRUE; } - if ( i_rFrame.InsertDocument_Impl( *xDoc ) ) - return sal_True; - - xDoc->DoClose(); - return sal_False; + sal_Bool bSuccess = pTargetFrame->InsertDocument_Impl( *xDoc ); + return impl_cleanUp( bSuccess, wFrame ); } // -------------------------------------------------------------------------------------------------------------------- -const SfxFilter* SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor, const SfxFilterMatcher& rMatcher ) +void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ) { const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ); const ::rtl::OUString sTypeName = io_rDescriptor.getOrDefault( "TypeName", ::rtl::OUString() ); @@ -313,6 +312,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedV const Reference< XInteractionHandler > xInteraction = io_rDescriptor.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ); + const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); const SfxFilter* pFilter = NULL; // get filter by its name directly ... @@ -323,7 +323,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedV if ( !pFilter && sTypeName.getLength() ) pFilter = rMatcher.GetFilter4EA( sTypeName ); - // or use given document service for detection too! + // or use given document service for detection, too if ( !pFilter && sServiceName.getLength() ) pFilter = impl_getFilterFromServiceName_nothrow( sServiceName ); @@ -336,20 +336,26 @@ const SfxFilter* SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedV } if ( pFilter ) + { io_rDescriptor.put( "FilterName", ::rtl::OUString( pFilter->GetFilterName() ) ); - return pFilter; + // If detected filter indicates using of an own template format + // add property "AsTemplate" to descriptor. But suppress this step + // if such property already exists. + if ( pFilter->IsOwnTemplateFormat() && !io_rDescriptor.has( "AsTemplate" ) ) + io_rDescriptor.put( "AsTemplate", sal_Bool( sal_True ) ); + + // The DocumentService property will finally be used to determine the document type to create, so + // override it with the service name as indicated by the found filter. + io_rDescriptor.put( "DocumentService", ::rtl::OUString( pFilter->GetServiceName() ) ); + } } // -------------------------------------------------------------------------------------------------------------------- -SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxTopFrame& i_rTargetFrame ) const +SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::NamedValueCollection& i_rDescriptor ) const { SfxAllItemSet aSet( SFX_APP()->GetPool() ); TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); - - aSet.Put( SfxFrameItem( SID_DOCFRAME, &i_rTargetFrame ) ); - return aSet; } @@ -369,7 +375,7 @@ sal_Bool SfxFrameLoader_Impl::impl_loadExistingDocument( const Reference< XModel { i_rxDocument->attachResource( i_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ), i_rDescriptor.getPropertyValues() ); - SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor, *pTargetFrame ) ); + SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor ) ); pTargetFrame->SetItemSet_Impl( &aSet ); return pTargetFrame->InsertDocument_Impl( *pDoc ); } @@ -392,7 +398,7 @@ sal_Bool SfxFrameLoader_Impl::impl_cleanUp( const sal_Bool i_bSuccess, const Sfx } // -------------------------------------------------------------------------------------------------------------------- -const SfxFilter* SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const +bool SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const { const ::rtl::OUString sTemplateRegioName = io_rDescriptor.getOrDefault( "TemplateRegionName", ::rtl::OUString() ); const ::rtl::OUString sTemplateName = io_rDescriptor.getOrDefault( "TemplateName", ::rtl::OUString() ); @@ -425,25 +431,28 @@ const SfxFilter* SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelp io_rDescriptor.put( "FilterName", ::rtl::OUString( pTemplateFilter->GetName() ) ); io_rDescriptor.put( "FileName", ::rtl::OUString( sTemplateURL ) ); io_rDescriptor.put( "AsTemplate", sal_True ); + + // #i21583# + // the DocumentService property will finally be used to create the document. Thus, override any possibly + // present value with the document service of the template. + io_rDescriptor.put( "DocumentService", ::rtl::OUString( pTemplateFilter->GetServiceName() ) ); + return true; } - return pTemplateFilter; } - - return NULL; + return false; } // -------------------------------------------------------------------------------------------------------------------- -USHORT SfxFrameLoader_Impl::impl_findSlotParam( ::rtl::OUString& io_rFactoryURL ) +USHORT SfxFrameLoader_Impl::impl_findSlotParam( const ::rtl::OUString& i_rFactoryURL ) { ::rtl::OUString sSlotParam; - const sal_Int32 nParamPos = io_rFactoryURL.indexOf( '?' ); + const sal_Int32 nParamPos = i_rFactoryURL.indexOf( '?' ); if ( nParamPos >= 0 ) { // currently only the "slot" parameter is supported - const sal_Int32 nSlotPos = io_rFactoryURL.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "slot=" ), nParamPos ); + const sal_Int32 nSlotPos = i_rFactoryURL.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "slot=" ), nParamPos ); if ( nSlotPos > 0 ) - sSlotParam = io_rFactoryURL.copy( nSlotPos + 5 ); - io_rFactoryURL = io_rFactoryURL.copy( 0, nParamPos ); + sSlotParam = i_rFactoryURL.copy( nSlotPos + 5 ); } if ( sSlotParam.getLength() ) @@ -465,125 +474,90 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); ::comphelper::NamedValueCollection aDescriptor( rArgs ); + + // ensure the descriptor contains a referrer if ( !aDescriptor.has( "Referer" ) ) aDescriptor.put( "Referer", ::rtl::OUString() ); - // if a model is given, just load this into a newly created frame + // if a model is given, just plug this into a newly created frame const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); if ( xModel.is() ) return impl_loadExistingDocument( xModel, _rTargetFrame, aDescriptor ); - // determine the filter to use - const SfxFilter* pDocumentFilter = NULL; - const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); - - pDocumentFilter = impl_determineFilter( aDescriptor, rMatcher ); - if ( !pDocumentFilter ) - return sal_False; - - // If detected filter indicates using of an own template format - // add property "AsTemplate" to descriptor. But suppress this step - // if such property already exists. - if ( pDocumentFilter->IsOwnTemplateFormat() && !aDescriptor.has( "AsTemplate" ) ) - aDescriptor.put( "AsTemplate", sal_Bool( sal_True ) ); - - // check for the URL pattern of our factory URLs - SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); - SfxFrameWeak wFrame = pTargetFrame; - + // special handling for some weird factory URLs a la private:factory/swriter?slot=21053 const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() ); - if ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 ) + const bool bIsFactoryURL = ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 ); + if ( bIsFactoryURL ) { - ::rtl::OUString sFactory( sURL.copy( sizeof( "private:factory/" ) -1 ) ); - - USHORT nSlotParam = impl_findSlotParam( sFactory ); + USHORT nSlotParam = impl_findSlotParam( sURL.copy( sizeof( "private:factory/" ) -1 ) ); if ( nSlotParam != 0 ) { - sal_Bool bSuccess = impl_createNewDocWithSlotParam( nSlotParam, *pTargetFrame ); - return impl_cleanUp( bSuccess, wFrame ); + return impl_createNewDocWithSlotParam( nSlotParam, _rTargetFrame ); } + } - const SfxFilter* pTemplateFilter = impl_determineTemplateDocument( aDescriptor ); - if ( !pTemplateFilter ) + // determine the filter to use, and update the descriptor with its information + impl_determineFilter( aDescriptor ); + + // check for factory URLs to create a new doc, instead of loading one + if ( bIsFactoryURL ) + { + bool bDescribesValidTemplate = impl_determineTemplateDocument( aDescriptor ); + if ( !bDescribesValidTemplate ) { // no or no valid template found => just create a default doc of the desired type, without any template - sal_Bool bSuccess = impl_createNewDoc( aDescriptor, *pTargetFrame, sFactory ); - return impl_cleanUp( bSuccess, wFrame ); + return impl_createNewDoc( aDescriptor, _rTargetFrame, sURL.copy( sizeof( "private:factory/" ) -1 ) ); } - - // #i21583# - // ignore/forget the filter which was detected for the corresponding "private:factory/xxx" URL. - pDocumentFilter = pTemplateFilter; } else { - aDescriptor.put( "FileName", sURL ); + // compatibility + aDescriptor.put( "FileName", aDescriptor.get( "URL" ) ); } - const ::rtl::OUString sFilterName = aDescriptor.getOrDefault( "FilterName", ::rtl::OUString() ); - - // at this point, we need a filter - DBG_ASSERT( pDocumentFilter, "SfxFrameLoader_Impl::load: could not determine a filter!" ); - if ( !pDocumentFilter ) - return sal_False; + // TODO: is this needed? finally, when loading is successfull, then ther should be no need for this item, + // as the document can always obtain its frame. In particular, there might be situations where this frame + // is access, but already disposed: Imagine the user loading a document, opening a second view on it, and + // then closing the first view/frame. + aDescriptor.put( "Frame", _rTargetFrame ); - SfxObjectShell* pDoc = SfxObjectShell::CreateObject( pDocumentFilter->GetServiceName() ); + // create a new doc + ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); + SfxObjectShell* pDoc = SfxObjectShell::CreateObject( sServiceName ); if ( !pDoc ) return sal_False; - aDescriptor.put( "Frame", _rTargetFrame ); - - SfxAllItemSet aSet( impl_getInitialItemSet( aDescriptor, *pTargetFrame ) ); - aSet.Put( SfxStringItem( SID_FILTER_NAME, sFilterName ) ); - sal_Bool bLoadSuccess = sal_False; - sal_Bool bDisaster = sal_False; + SfxFrameWeak wFrame; try { - Reference< XLoadable > xLoadable( pDoc->GetModel(), UNO_QUERY ); - Sequence< PropertyValue > aLoadArgs; - TransformItems( SID_OPENDOC, aSet, aLoadArgs ); - - xLoadable->load( aLoadArgs ); - - SfxMedium* pDocMedium = pDoc->GetMedium(); - BOOL bHidden = FALSE; - SFX_ITEMSET_ARG( pDocMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False); - if ( pHidItem ) - bHidden = pHidItem->GetValue(); + // load the document + Reference< XLoadable > xLoadable( pDoc->GetModel(), UNO_QUERY_THROW ); + xLoadable->load( aDescriptor.getPropertyValues() ); - // !TODO: will be done by Framework! - pDocMedium->SetUpdatePickList( !bHidden ); + // create a frame + SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); + ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + wFrame = pTargetFrame; - /* - #121119# - We dont know why pTargetFrame can be corrupt here. - But if it was deleted it shouldnt exists inside our global list. - May be we can use the damaged pointer to detect if it was removed from - this global list. - */ - impl_ensureValidFrame_throw( pTargetFrame ); + // insert the document into the frame + SfxAllItemSet aSet( impl_getInitialItemSet( aDescriptor ) ); + pTargetFrame->SetItemSet_Impl( &aSet ); + if ( !pTargetFrame->InsertDocument_Impl( *pDoc ) ) + throw RuntimeException(); - aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); + pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); + String aURL = pDoc->GetMedium()->GetName(); + SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) ); - pTargetFrame->SetItemSet_Impl( &aSet ); - if ( pTargetFrame->InsertDocument_Impl( *pDoc ) ) - { - pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); - String aURL = pDoc->GetMedium()->GetName(); - SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) ); - bLoadSuccess = sal_True; - } - else - bDisaster = sal_True; + bLoadSuccess = sal_True; } catch ( Exception& ) { - bDisaster = sal_True; + DBG_UNHANDLED_EXCEPTION(); } - if ( bDisaster ) + if ( !bLoadSuccess ) { // document loading was not successful; close SfxFrame (but not XFrame!) and document impl_cleanUp( false, wFrame ); @@ -605,20 +579,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV return bLoadSuccess; } -void SfxFrameLoader_Impl::impl_ensureValidFrame_throw( const SfxTopFrame* _pFrame ) -{ - SfxFrame* pTmp = NULL; - for ( pTmp = SfxFrame::GetFirst(); pTmp; pTmp = SfxFrame::GetNext( *pTmp ) ) - { - if ( _pFrame == pTmp ) - // all fine, frame still alive - return; - } - - DBG_ERROR( "#121119# You found the reason for a stacktrace! Frame destroyed while loading document." ); - throw RuntimeException( ::rtl::OUString(), *this ); -} - void SfxFrameLoader_Impl::cancel() throw( RuntimeException ) { } -- cgit v1.2.3 From 2132439ce42da7587bde6de70b0535877a4bbfaa Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Nov 2009 11:18:19 +0100 Subject: [CWS autorecovery] even closer to an SFX document loader working in the proper order --- sfx2/inc/frmload.hxx | 32 ++++---- sfx2/source/view/frmload.cxx | 174 +++++++++++++++++++++++++------------------ 2 files changed, 122 insertions(+), 84 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 5d04fbc13e..3e2aa67f14 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -31,6 +31,9 @@ #ifndef _SFX_FRMLOAD_HXX #define _SFX_FRMLOAD_HXX +#include "sfx2/sfxuno.hxx" +#include "sfx2/objsh.hxx" + /** === begin UNO includes === **/ #include #include @@ -58,8 +61,6 @@ class SfxFilter; class SfxFilterMatcher; class SfxTopFrame; -#include - class SfxFrameWeak; class SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo > @@ -101,23 +102,13 @@ private: sal_Bool impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame, - const ::rtl::OUString& _rFactoryName + const ::rtl::OUString& i_rFactoryName ); void impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ); - SfxAllItemSet impl_getInitialItemSet( - const ::comphelper::NamedValueCollection& i_rDescriptor - ) const; - - sal_Bool impl_loadExistingDocument( - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_rxDocument, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxTargetFrame, - const ::comphelper::NamedValueCollection& i_rDescriptor - ); - sal_Bool impl_cleanUp( const sal_Bool i_bSuccess, const SfxFrameWeak& i_wFrame @@ -130,6 +121,21 @@ private: USHORT impl_findSlotParam( const ::rtl::OUString& i_rFactoryURL ); + + SfxObjectShellLock impl_findObjectShell( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_rxDocument + ); + + sal_Bool impl_plugDocIntoFrame( + const ::comphelper::NamedValueCollection& i_rDescriptor, + SfxTopFrame& i_rTargetFrame, + SfxObjectShell& i_rDocument + ); + + void impl_lockHiddenDocument( + SfxObjectShell& i_rDocument, + const ::comphelper::NamedValueCollection& i_rDescriptor + ); }; #endif diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 6157d4100b..f7aa013a3f 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -265,40 +265,55 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlo return impl_cleanUp( bSuccess, wFrame ); } +// -------------------------------------------------------------------------------------------------------------------- +void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) +{ + const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False ); + if ( bHidden ) + { + i_rDocument.RestoreNoDelete(); + i_rDocument.OwnerLock( TRUE ); + i_rDocument.Get_Impl()->bHiddenLockedByAPI = TRUE; + } +} + // -------------------------------------------------------------------------------------------------------------------- sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, const Reference< XFrame >& i_rxFrame, - const ::rtl::OUString& _rFactoryName ) + const ::rtl::OUString& i_rFactoryName ) { SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxFrame ); ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); SfxFrameWeak wFrame = pTargetFrame; - SfxErrorContext aEc( ERRCTX_SFX_NEWDOCDIRECT ); - // create new document - SfxObjectShellLock xDoc = SfxObjectShell::CreateObjectByFactoryName( _rFactoryName ); - if ( !xDoc.Is() || !xDoc->DoInitNew( NULL ) ) - return sal_False; - - Reference< XModel > xModel( xDoc->GetModel(), UNO_QUERY ); - OSL_ENSURE( xModel.is(), "SfxFrameLoader_Impl::impl_createNewDoc: not sure this is really allowed ..." ); - if ( xModel.is() ) + SfxObjectShellLock xDoc; + try { + const ::rtl::OUString sServiceName = SfxObjectShell::GetServiceNameFromFactory( i_rFactoryName ); + Reference< XModel > xModel( m_aContext.createComponent( sServiceName ), UNO_QUERY_THROW ); + + Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW ); + xLoadable->initNew(); + + xDoc = impl_findObjectShell( xModel ); + ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the newly created model" ); + ::comphelper::NamedValueCollection aArgs( i_rDescriptor ); aArgs.remove( "StatusIndicator" ); // TODO: why this? xModel->attachResource( ::rtl::OUString(), aArgs.getPropertyValues() ); } - - const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False ); - if ( bHidden ) + catch( const Exception& ) { - xDoc->RestoreNoDelete(); - xDoc->OwnerLock( TRUE ); - xDoc->Get_Impl()->bHiddenLockedByAPI = TRUE; + // TODO: catch (and handle?) ErrorCodeIOException, and perhaps others ... + DBG_UNHANDLED_EXCEPTION(); + return sal_False; } - sal_Bool bSuccess = pTargetFrame->InsertDocument_Impl( *xDoc ); + // if the document is created hidden, prevent it being deleted until it is shown or disposed + impl_lockHiddenDocument( *xDoc, i_rDescriptor ); + + const sal_Bool bSuccess = pTargetFrame->InsertDocument_Impl( *xDoc ); return impl_cleanUp( bSuccess, wFrame ); } @@ -352,37 +367,28 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti } // -------------------------------------------------------------------------------------------------------------------- -SfxAllItemSet SfxFrameLoader_Impl::impl_getInitialItemSet( const ::comphelper::NamedValueCollection& i_rDescriptor ) const +sal_Bool SfxFrameLoader_Impl::impl_plugDocIntoFrame( const ::comphelper::NamedValueCollection& i_rDescriptor, + SfxTopFrame& i_rTargetFrame, SfxObjectShell& i_rDocument ) { SfxAllItemSet aSet( SFX_APP()->GetPool() ); TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); - return aSet; + i_rTargetFrame.SetItemSet_Impl( &aSet ); + return i_rTargetFrame.InsertDocument_Impl( i_rDocument ); } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_loadExistingDocument( const Reference< XModel >& i_rxDocument, - const Reference< XFrame >& i_rxTargetFrame, - const ::comphelper::NamedValueCollection& i_rDescriptor ) +SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel >& i_rxDocument ) { - ENSURE_OR_THROW( i_rxDocument.is() && i_rxTargetFrame.is(), "invallid model/frame" ); - - SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxTargetFrame ); - ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); - for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) { if ( i_rxDocument == pDoc->GetModel() ) { - i_rxDocument->attachResource( i_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ), i_rDescriptor.getPropertyValues() ); - - SfxAllItemSet aSet( impl_getInitialItemSet( i_rDescriptor ) ); - pTargetFrame->SetItemSet_Impl( &aSet ); - return pTargetFrame->InsertDocument_Impl( *pDoc ); + return pDoc; } } - DBG_ERROR("Model is not based on SfxObjectShell - wrong frame loader use!"); - return sal_False; + DBG_ERROR( "SfxFrameLoader_Impl::impl_findObjectShell: model is not based on SfxObjectShell - wrong frame loader usage!" ); + return NULL; } // -------------------------------------------------------------------------------------------------------------------- @@ -468,7 +474,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV { ENSURE_OR_THROW( _rTargetFrame.is(), "illegal NULL frame" ); - // this methods assumes that the filter is detected before, usually by calling the detect() method below ::vos::OGuard aGuard( Application::GetSolarMutex() ); RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); @@ -479,34 +484,36 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( !aDescriptor.has( "Referer" ) ) aDescriptor.put( "Referer", ::rtl::OUString() ); - // if a model is given, just plug this into a newly created frame - const Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); - if ( xModel.is() ) - return impl_loadExistingDocument( xModel, _rTargetFrame, aDescriptor ); + // TODO: is this needed? finally, when loading is successfull, then ther should be no need for this item, + // as the document can always obtain its frame. In particular, there might be situations where this frame + // is access, but already disposed: Imagine the user loading a document, opening a second view on it, and + // then closing the first view/frame. + aDescriptor.put( "Frame", _rTargetFrame ); - // special handling for some weird factory URLs a la private:factory/swriter?slot=21053 + // check for factory URLs to create a new doc, instead of loading one const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() ); const bool bIsFactoryURL = ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 ); if ( bIsFactoryURL ) { - USHORT nSlotParam = impl_findSlotParam( sURL.copy( sizeof( "private:factory/" ) -1 ) ); + OSL_ENSURE( !aDescriptor.has( "Model" ), "SfxFrameLoader_Impl::load: sure you know what you're doing?" ); + // Before the loader refactoring, the model would have won over the URL, that is, the model would have been + // loaded into a newly created frame. /me thinks this doesn't make sense at all, also, it made the code + // in this method more complex. So, the order was changed, now the factory URL wins over the Model. + // If somebody *rightfully* passes both of them, we might need to re-consider the behavior. + + const ::rtl::OUString sFactory = sURL.copy( sizeof( "private:factory/" ) -1 ); + // special handling for some weird factory URLs a la private:factory/swriter?slot=21053 + USHORT nSlotParam = impl_findSlotParam( sFactory ); if ( nSlotParam != 0 ) { return impl_createNewDocWithSlotParam( nSlotParam, _rTargetFrame ); } - } - - // determine the filter to use, and update the descriptor with its information - impl_determineFilter( aDescriptor ); - // check for factory URLs to create a new doc, instead of loading one - if ( bIsFactoryURL ) - { bool bDescribesValidTemplate = impl_determineTemplateDocument( aDescriptor ); if ( !bDescribesValidTemplate ) { // no or no valid template found => just create a default doc of the desired type, without any template - return impl_createNewDoc( aDescriptor, _rTargetFrame, sURL.copy( sizeof( "private:factory/" ) -1 ) ); + return impl_createNewDoc( aDescriptor, _rTargetFrame, sFactory ); } } else @@ -515,40 +522,65 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV aDescriptor.put( "FileName", aDescriptor.get( "URL" ) ); } - // TODO: is this needed? finally, when loading is successfull, then ther should be no need for this item, - // as the document can always obtain its frame. In particular, there might be situations where this frame - // is access, but already disposed: Imagine the user loading a document, opening a second view on it, and - // then closing the first view/frame. - aDescriptor.put( "Frame", _rTargetFrame ); - - // create a new doc - ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); - SfxObjectShell* pDoc = SfxObjectShell::CreateObject( sServiceName ); - if ( !pDoc ) - return sal_False; + // did the caller already pass a model? + Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); + const bool bExternalModel = xModel.is(); sal_Bool bLoadSuccess = sal_False; SfxFrameWeak wFrame; try { - // load the document - Reference< XLoadable > xLoadable( pDoc->GetModel(), UNO_QUERY_THROW ); - xLoadable->load( aDescriptor.getPropertyValues() ); + // no model passed from outside? => create one from scratch + if ( !xModel.is() ) + { + // beforehand, determine the filter to use, and update the descriptor with its information + impl_determineFilter( aDescriptor ); + + // create the new doc + ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); + xModel.set( m_aContext.createComponent( sServiceName ), UNO_QUERY_THROW ); + + // load it + Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW ); + xLoadable->load( aDescriptor.getPropertyValues() ); + } + else + { + // tell the doc its load args. + xModel->attachResource( aDescriptor.getOrDefault( "URL", ::rtl::OUString() ), aDescriptor.getPropertyValues() ); + + // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could + // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs) + // with the ones passed to the loader here. For instance, what about the MacroExecutionMode? The document + // might have a mode other than the one passed to the loader, and we always overwrite the former with + // the latter. + } // create a frame SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); wFrame = pTargetFrame; + // get the SfxObjectShell (still needed at the moment) + SfxObjectShellLock xDoc = impl_findObjectShell( xModel ); + ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" ); + + // if the document is created hidden, prevent it being deleted until it is shown or disposed + impl_lockHiddenDocument( *xDoc, aDescriptor ); + // insert the document into the frame - SfxAllItemSet aSet( impl_getInitialItemSet( aDescriptor ) ); - pTargetFrame->SetItemSet_Impl( &aSet ); - if ( !pTargetFrame->InsertDocument_Impl( *pDoc ) ) + if ( !impl_plugDocIntoFrame( aDescriptor, *pTargetFrame, *xDoc ) ) throw RuntimeException(); - pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); - String aURL = pDoc->GetMedium()->GetName(); - SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) ); + if ( !bExternalModel ) + { + // TODO: which of those statements are allowed in the ExternalModel-case, too? + // I think the broadcast isn't, but the UpdateDocument_Impl might. + pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); + String aURL = xDoc->GetMedium()->GetName(); + SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) ); + // TODO: grokking suggests nobody might be interested in this SID_OPENURL broadcast, anyway? + } bLoadSuccess = sal_True; } @@ -562,11 +594,11 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV // document loading was not successful; close SfxFrame (but not XFrame!) and document impl_cleanUp( false, wFrame ); - Reference< XCloseable > xCloseable( pDoc->GetModel(), UNO_QUERY ); - if ( xCloseable.is() ) + if ( !bExternalModel ) { try { + Reference< XCloseable > xCloseable( xModel, UNO_QUERY_THROW ); xCloseable->close( sal_True ); } catch ( Exception& ) -- cgit v1.2.3 From 20ffdeb5b6f6f1150ce223a22cdbe4fb01db3d20 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Nov 2009 11:18:19 +0100 Subject: [CWS autorecovery] last step, for the moment, of loader streamlining --- sfx2/inc/frmload.hxx | 32 ++--- sfx2/source/view/frmload.cxx | 292 +++++++++++++++++++++++-------------------- 2 files changed, 171 insertions(+), 153 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 3e2aa67f14..158ef36e11 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -82,10 +82,13 @@ protected: virtual ~SfxFrameLoader_Impl(); private: - const SfxFilter* impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& _rServiceName ) const; + const SfxFilter* impl_getFilterFromServiceName_nothrow( + const ::rtl::OUString& i_rServiceName + ) const; + ::rtl::OUString impl_askForFilter_nothrow( - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxHandler, - const ::rtl::OUString& _rDocumentURL + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& i_rxHandler, + const ::rtl::OUString& i_rDocumentURL ) const; const SfxFilter* impl_detectFilterForURL( @@ -99,20 +102,14 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame ); - sal_Bool impl_createNewDoc( - const ::comphelper::NamedValueCollection& i_rDescriptor, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame, - const ::rtl::OUString& i_rFactoryName - ); - void impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor - ); + ) const; sal_Bool impl_cleanUp( const sal_Bool i_bSuccess, const SfxFrameWeak& i_wFrame - ); + ) const; bool impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor @@ -120,22 +117,27 @@ private: USHORT impl_findSlotParam( const ::rtl::OUString& i_rFactoryURL - ); + ) const; SfxObjectShellLock impl_findObjectShell( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_rxDocument - ); + ) const; sal_Bool impl_plugDocIntoFrame( const ::comphelper::NamedValueCollection& i_rDescriptor, SfxTopFrame& i_rTargetFrame, SfxObjectShell& i_rDocument - ); + ) const; void impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor - ); + ) const; + + void impl_handleCaughtError_nothrow( + const ::com::sun::star::uno::Any& i_rCaughtError, + const ::comphelper::NamedValueCollection& i_rDescriptor + ) const; }; #endif diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index f7aa013a3f..97de00ad6f 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -32,80 +32,76 @@ #include "precompiled_sfx2.hxx" #include "frmload.hxx" - -#include - -#include +#include "objshimp.hxx" +#include "sfx2/app.hxx" +#include "sfx2/dispatch.hxx" +#include "sfx2/docfac.hxx" +#include "sfx2/docfile.hxx" +#include "sfx2/docfilt.hxx" +#include "sfx2/doctempl.hxx" +#include "sfx2/fcontnr.hxx" +#include "sfx2/frame.hxx" +#include "sfx2/request.hxx" +#include "sfx2/sfx.hrc" +#include "sfx2/sfxsids.hrc" +#include "sfx2/sfxuno.hxx" +#include "sfx2/topfrm.hxx" +#include "sfx2/viewfrm.hxx" + +/** === begin UNO includes === **/ #include +#include #include +#include #include -#include -#include +#include +/** === end UNO includes === **/ -#include -#include - -#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include -#include #include +#include +#include +#include #include +#include #include -#include -#include -#include -#include -#include - -#ifndef css -namespace css = ::com::sun::star; -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "brokenpackageint.hxx" -#include "objshimp.hxx" +#include +#include -// do not remove the markers below /** === begin UNO using === **/ -using ::com::sun::star::uno::Reference; -using ::com::sun::star::task::XInteractionHandler; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::container::XContainerQuery; using ::com::sun::star::container::XEnumeration; -using ::com::sun::star::uno::makeAny; +using ::com::sun::star::document::XTypeDetection; using ::com::sun::star::frame::XFrame; -using ::com::sun::star::uno::Exception; +using ::com::sun::star::frame::XLoadable; +using ::com::sun::star::frame::XModel; +using ::com::sun::star::lang::XMultiServiceFactory; +using ::com::sun::star::task::XInteractionHandler; +using ::com::sun::star::task::XInteractionHandler2; using ::com::sun::star::task::XInteractionRequest; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::task::XStatusIndicator; -using ::com::sun::star::document::XTypeDetection; +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Exception; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::UNO_SET_THROW; +using ::com::sun::star::uno::makeAny; using ::com::sun::star::util::XCloseable; -using ::com::sun::star::frame::XLoadable; /** === end UNO using === **/ -SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< css::lang::XMultiServiceFactory >& _rxFactory ) +SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< XMultiServiceFactory >& _rxFactory ) :m_aContext( _rxFactory ) { } @@ -149,7 +145,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt { throw; } - catch( const css::uno::Exception& ) + catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); sFilter = ::rtl::OUString(); @@ -162,12 +158,12 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt } // -------------------------------------------------------------------------------------------------------------------- -const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& _rServiceName ) const +const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& i_rServiceName ) const { try { ::comphelper::NamedValueCollection aQuery; - aQuery.put( "DocumentService", _rServiceName ); + aQuery.put( "DocumentService", i_rServiceName ); const Reference< XContainerQuery > xQuery( m_aContext.createComponent( "com.sun.star.document.FilterFactory" ), @@ -207,17 +203,17 @@ const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( con } // -------------------------------------------------------------------------------------------------------------------- -::rtl::OUString SfxFrameLoader_Impl::impl_askForFilter_nothrow( const Reference< XInteractionHandler >& _rxHandler, - const ::rtl::OUString& _rDocumentURL ) const +::rtl::OUString SfxFrameLoader_Impl::impl_askForFilter_nothrow( const Reference< XInteractionHandler >& i_rxHandler, + const ::rtl::OUString& i_rDocumentURL ) const { - ENSURE_OR_THROW( _rxHandler.is(), "invalid interaction handler" ); + ENSURE_OR_THROW( i_rxHandler.is(), "invalid interaction handler" ); ::rtl::OUString sFilterName; try { - ::framework::RequestFilterSelect* pRequest = new ::framework::RequestFilterSelect( _rDocumentURL ); + ::framework::RequestFilterSelect* pRequest = new ::framework::RequestFilterSelect( i_rDocumentURL ); Reference< XInteractionRequest > xRequest ( pRequest ); - _rxHandler->handle( xRequest ); + i_rxHandler->handle( xRequest ); if( !pRequest->isAbort() ) sFilterName = pRequest->getFilter(); } @@ -266,7 +262,7 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlo } // -------------------------------------------------------------------------------------------------------------------- -void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) +void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) const { const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False ); if ( bHidden ) @@ -278,47 +274,7 @@ void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDoc( const ::comphelper::NamedValueCollection& i_rDescriptor, const Reference< XFrame >& i_rxFrame, - const ::rtl::OUString& i_rFactoryName ) -{ - SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxFrame ); - ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); - SfxFrameWeak wFrame = pTargetFrame; - - // create new document - SfxObjectShellLock xDoc; - try - { - const ::rtl::OUString sServiceName = SfxObjectShell::GetServiceNameFromFactory( i_rFactoryName ); - Reference< XModel > xModel( m_aContext.createComponent( sServiceName ), UNO_QUERY_THROW ); - - Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW ); - xLoadable->initNew(); - - xDoc = impl_findObjectShell( xModel ); - ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the newly created model" ); - - ::comphelper::NamedValueCollection aArgs( i_rDescriptor ); - aArgs.remove( "StatusIndicator" ); // TODO: why this? - - xModel->attachResource( ::rtl::OUString(), aArgs.getPropertyValues() ); - } - catch( const Exception& ) - { - // TODO: catch (and handle?) ErrorCodeIOException, and perhaps others ... - DBG_UNHANDLED_EXCEPTION(); - return sal_False; - } - - // if the document is created hidden, prevent it being deleted until it is shown or disposed - impl_lockHiddenDocument( *xDoc, i_rDescriptor ); - - const sal_Bool bSuccess = pTargetFrame->InsertDocument_Impl( *xDoc ); - return impl_cleanUp( bSuccess, wFrame ); -} - -// -------------------------------------------------------------------------------------------------------------------- -void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ) +void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ) const { const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() ); const ::rtl::OUString sTypeName = io_rDescriptor.getOrDefault( "TypeName", ::rtl::OUString() ); @@ -368,7 +324,7 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti // -------------------------------------------------------------------------------------------------------------------- sal_Bool SfxFrameLoader_Impl::impl_plugDocIntoFrame( const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxTopFrame& i_rTargetFrame, SfxObjectShell& i_rDocument ) + SfxTopFrame& i_rTargetFrame, SfxObjectShell& i_rDocument ) const { SfxAllItemSet aSet( SFX_APP()->GetPool() ); TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); @@ -377,7 +333,7 @@ sal_Bool SfxFrameLoader_Impl::impl_plugDocIntoFrame( const ::comphelper::NamedVa } // -------------------------------------------------------------------------------------------------------------------- -SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel >& i_rxDocument ) +SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel >& i_rxDocument ) const { for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) { @@ -392,7 +348,7 @@ SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< X } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_cleanUp( const sal_Bool i_bSuccess, const SfxFrameWeak& i_wFrame ) +sal_Bool SfxFrameLoader_Impl::impl_cleanUp( const sal_Bool i_bSuccess, const SfxFrameWeak& i_wFrame ) const { if ( !i_bSuccess && i_wFrame && !i_wFrame->GetCurrentDocument() ) { @@ -449,7 +405,7 @@ bool SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedVal } // -------------------------------------------------------------------------------------------------------------------- -USHORT SfxFrameLoader_Impl::impl_findSlotParam( const ::rtl::OUString& i_rFactoryURL ) +USHORT SfxFrameLoader_Impl::impl_findSlotParam( const ::rtl::OUString& i_rFactoryURL ) const { ::rtl::OUString sSlotParam; const sal_Int32 nParamPos = i_rFactoryURL.indexOf( '?' ); @@ -468,9 +424,41 @@ USHORT SfxFrameLoader_Impl::impl_findSlotParam( const ::rtl::OUString& i_rFactor } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyValue >& rArgs, - const Reference< css::frame::XFrame >& _rTargetFrame ) - throw( css::uno::RuntimeException ) +void SfxFrameLoader_Impl::impl_handleCaughtError_nothrow( const Any& i_rCaughtError, const ::comphelper::NamedValueCollection& i_rDescriptor ) const +{ + try + { + const Reference< XInteractionHandler > xInteraction = + i_rDescriptor.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ); + if ( !xInteraction.is() ) + return; + ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( i_rCaughtError ) ); + ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove ); + pRequest->addContinuation( pApprove.get() ); + + const Reference< XInteractionHandler2 > xHandler( xInteraction, UNO_QUERY_THROW ); + #if OSL_DEBUG_LEVEL > 0 + const sal_Bool bHandled = + #endif + xHandler->handleInteractionRequest( pRequest.get() ); + + #if OSL_DEBUG_LEVEL > 0 + if ( !bHandled ) + // the interaction handler couldn't deal with this error + // => report it as assertion, at least (done in the DBG_UNHANDLED_EXCEPTION below) + ::cppu::throwException( i_rCaughtError ); + #endif + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +// -------------------------------------------------------------------------------------------------------------------- +sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rArgs, + const Reference< XFrame >& _rTargetFrame ) + throw( RuntimeException ) { ENSURE_OR_THROW( _rTargetFrame.is(), "illegal NULL frame" ); @@ -493,6 +481,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV // check for factory URLs to create a new doc, instead of loading one const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() ); const bool bIsFactoryURL = ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 ); + bool bInitNewModel = bIsFactoryURL; if ( bIsFactoryURL ) { OSL_ENSURE( !aDescriptor.has( "Model" ), "SfxFrameLoader_Impl::load: sure you know what you're doing?" ); @@ -510,10 +499,17 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV } bool bDescribesValidTemplate = impl_determineTemplateDocument( aDescriptor ); - if ( !bDescribesValidTemplate ) + if ( bDescribesValidTemplate ) { - // no or no valid template found => just create a default doc of the desired type, without any template - return impl_createNewDoc( aDescriptor, _rTargetFrame, sFactory ); + // if the media descriptor allowed us to determine a template document to create the new document + // from, then do not init a new document model from scratch (below), but instead load the + // template document + bInitNewModel = false; + } + else + { + const ::rtl::OUString sServiceName = SfxObjectShell::GetServiceNameFromFactory( sFactory ); + aDescriptor.put( "DocumentService", sServiceName ); } } else @@ -534,15 +530,30 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( !xModel.is() ) { // beforehand, determine the filter to use, and update the descriptor with its information - impl_determineFilter( aDescriptor ); + if ( !bInitNewModel ) + { + impl_determineFilter( aDescriptor ); + } // create the new doc ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); xModel.set( m_aContext.createComponent( sServiceName ), UNO_QUERY_THROW ); - // load it + // load resp. init it Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW ); - xLoadable->load( aDescriptor.getPropertyValues() ); + if ( bInitNewModel ) + { + xLoadable->initNew(); + + ::comphelper::NamedValueCollection aArgs( aDescriptor ); + aArgs.remove( "StatusIndicator" ); // TODO: why this? + + xModel->attachResource( ::rtl::OUString(), aArgs.getPropertyValues() ); + } + else + { + xLoadable->load( aDescriptor.getPropertyValues() ); + } } else { @@ -567,6 +578,13 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV // if the document is created hidden, prevent it being deleted until it is shown or disposed impl_lockHiddenDocument( *xDoc, aDescriptor ); + // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef, + // then this would not be necessary, /me thinks. That is, the *Lock classes inc/dec a "Lock" counter + // (additional to the ref counter) in their ctor/dtor, and if the lock counter goes to 0, the + // object is closed (DoClose). The impl_lockHiddenDocument is to prevent exactly that premature + // closing. However, a *Ref object wouldn't close, anyway. And in case of unsuccessfull loading, the + // code at the very end of this method cares for closing the XModel, which should also close the + // ObjectShell. // insert the document into the frame if ( !impl_plugDocIntoFrame( aDescriptor, *pTargetFrame, *xDoc ) ) @@ -574,37 +592,35 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( !bExternalModel ) { - // TODO: which of those statements are allowed in the ExternalModel-case, too? - // I think the broadcast isn't, but the UpdateDocument_Impl might. pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); - String aURL = xDoc->GetMedium()->GetName(); - SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) ); - // TODO: grokking suggests nobody might be interested in this SID_OPENURL broadcast, anyway? + String sURL = xDoc->GetMedium()->GetName(); + if ( sURL.Len() ) + SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sURL ) ); } bLoadSuccess = sal_True; } catch ( Exception& ) { - DBG_UNHANDLED_EXCEPTION(); + Any aError( ::cppu::getCaughtException() ); + if ( !aDescriptor.getOrDefault( "Silent", sal_False ) ) + impl_handleCaughtError_nothrow( aError, aDescriptor ); } - if ( !bLoadSuccess ) - { - // document loading was not successful; close SfxFrame (but not XFrame!) and document - impl_cleanUp( false, wFrame ); + // clean up, if necessary + impl_cleanUp( bLoadSuccess, wFrame ); - if ( !bExternalModel ) + // if loading was not successful, also close the document (the SfxFrame was already closed by impl_cleanUp) + if ( !bLoadSuccess && !bExternalModel ) + { + try { - try - { - Reference< XCloseable > xCloseable( xModel, UNO_QUERY_THROW ); - xCloseable->close( sal_True ); - } - catch ( Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } + Reference< XCloseable > xCloseable( xModel, UNO_QUERY_THROW ); + xCloseable->close( sal_True ); + } + catch ( Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); } } -- cgit v1.2.3 From 0224d899033c67cd69e7572a977b6809d981e6c5 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Nov 2009 11:39:31 +0100 Subject: #i10000# --- sfx2/source/view/frmload.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 97de00ad6f..9742e7ca6e 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -593,9 +593,9 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA if ( !bExternalModel ) { pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); - String sURL = xDoc->GetMedium()->GetName(); - if ( sURL.Len() ) - SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sURL ) ); + String sDocumentURL = xDoc->GetMedium()->GetName(); + if ( sDocumentURL.Len() ) + SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) ); } bLoadSuccess = sal_True; -- cgit v1.2.3 From 639ce27c998648fe2edd986b7a5d3753b9dd279a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Nov 2009 09:58:13 +0100 Subject: #i10000# --- sfx2/inc/pch/precompiled_sfx2.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx index d5f547494e..3c8607f7a3 100644 --- a/sfx2/inc/pch/precompiled_sfx2.hxx +++ b/sfx2/inc/pch/precompiled_sfx2.hxx @@ -496,7 +496,6 @@ #include "svtools/aeitem.hxx" #include "svtools/asynclink.hxx" #include "svtools/brdcst.hxx" -#include "svtools/cancel.hxx" #include "svtools/cntwids.hrc" #include "svtools/controldims.hrc" #include "svtools/cstitem.hxx" -- cgit v1.2.3 From 580cf70df813ac561c57cff7a319ca2c9983763a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Nov 2009 11:49:21 +0100 Subject: [CWS autorecovery] #i65597# refactored SfxViewFrame::SwitchToViewShell_Impl to move some functionality to the UNO implementations, instead of doing it here. This is another step towards a fully UNOized view factory for SFX documents. --- sfx2/inc/frmload.hxx | 2 +- sfx2/inc/sfx2/docfac.hxx | 1 + sfx2/inc/sfx2/sfxbasecontroller.hxx | 12 +- sfx2/inc/sfx2/viewfrm.hxx | 4 + sfx2/inc/sfx2/viewsh.hxx | 2 +- sfx2/source/control/dispatch.cxx | 2 +- sfx2/source/doc/docfac.cxx | 16 ++- sfx2/source/view/sfxbasecontroller.cxx | 87 ++++++------ sfx2/source/view/topfrm.cxx | 10 +- sfx2/source/view/viewfrm.cxx | 236 ++++++++++++++------------------- sfx2/source/view/viewsh.cxx | 11 +- 11 files changed, 178 insertions(+), 205 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 158ef36e11..968ab52fbe 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -63,7 +63,7 @@ class SfxTopFrame; class SfxFrameWeak; -class SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo > +class SAL_DLLPRIVATE SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo > { ::comphelper::ComponentContext m_aContext; diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx index c555835434..8ab0017251 100644 --- a/sfx2/inc/sfx2/docfac.hxx +++ b/sfx2/inc/sfx2/docfac.hxx @@ -109,6 +109,7 @@ public: //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void SetModule_Impl( SfxModule* ); SAL_DLLPRIVATE static void UpdateFilterContainers_Impl(); + SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ); //#endif private: diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx index 6fc721d38b..946f90e6cd 100644 --- a/sfx2/inc/sfx2/sfxbasecontroller.hxx +++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx @@ -499,21 +499,13 @@ public: SAL_DLLPRIVATE BOOL HasMouseClickListeners_Impl(); SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > impl_getTitleHelper (); //#endif +private: + SAL_DLLPRIVATE void ConnectSfxFrame_Impl( const bool i_bConnect ); //________________________________________________________________________________________________________ // private variables //________________________________________________________________________________________________________ - /** With this method you can set the flag that controlls whether the - frame is released together with a controller when the later one is - disposed. - @param bFlag - When passing , the default value of this flag, then - disposing the controller results in releasing the frame. - Passing leaves the frame unaffected. - */ - void FrameIsReleasedWithController (sal_Bool bFlag); - private: IMPL_SfxBaseController_DataContainer* m_pData ; diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 4dad7e97d8..d4c86169c4 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -301,7 +301,11 @@ public: SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &); SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl( USHORT nId ); SAL_DLLPRIVATE void AddDispatchMacroToBasic_Impl(const ::rtl::OUString& sMacro); + //#endif +private: + SAL_DLLPRIVATE SfxViewShell* LoadNewView_Impl( const USHORT i_nNewViewNo, SfxViewShell* i_pOldShell ); + SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); }; //-------------------------------------------------------------------- diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index ae45545cba..7f54777d6c 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -339,11 +339,11 @@ public: SAL_DLLPRIVATE void SetFrameSet_Impl(SfxFrameSetDescriptor*); SAL_DLLPRIVATE void CheckIPClient_Impl( SfxInPlaceClient*, const Rectangle& ); SAL_DLLPRIVATE void PushSubShells_Impl( BOOL bPush=TRUE ); + SAL_DLLPRIVATE void PopSubShells_Impl() { PushSubShells_Impl( FALSE ); } SAL_DLLPRIVATE void TakeOwnerShip_Impl(); SAL_DLLPRIVATE void CheckOwnerShip_Impl(); SAL_DLLPRIVATE void TakeFrameOwnerShip_Impl(); SAL_DLLPRIVATE BOOL ExecKey_Impl(const KeyEvent& aKey); - #endif }; diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index d7d3ad8715..5f22fb3a33 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -522,7 +522,7 @@ void SfxDispatcher::Pop SfxApplication *pSfxApp = SFX_APP(); #ifdef DBG_UTIL - ByteString aMsg( "SfxDispatcher(" ); + ByteString aMsg( "-SfxDispatcher(" ); aMsg += ByteString::CreateFromInt64( (sal_uIntPtr) this ); aMsg += bPush ? ")::Push(" : ")::Pop("; if ( rShell.GetInterface() ) diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 1c1ac4ea27..e38b3eab62 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -305,10 +305,22 @@ String SfxObjectFactory::GetModuleName() const ::rtl::OUString sModuleName = aPropSet.getUnpackedValueOrDefault(PROP_MODULEUINAME, ::rtl::OUString()); return String(sModuleName); } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } + catch(const css::uno::RuntimeException&) + { throw; } catch(const css::uno::Exception&) {} return String(); } + + +sal_uInt16 SfxObjectFactory::GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) +{ + for ( sal_uInt16 curViewNo = 0; curViewNo < GetViewFactoryCount(); ++curViewNo ) + { + const sal_uInt16 curViewId = GetViewFactory( curViewNo ).GetOrdinal(); + if ( i_nViewId == curViewId ) + return curViewNo; + } + return i_nFallback; +} diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 5a64421423..4dd84cd793 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +87,7 @@ #include #include #include +#include #include @@ -440,17 +442,6 @@ struct IMPL_SfxBaseController_DataContainer SfxBaseController* m_pController ; sal_Bool m_bDisposing ; sal_Bool m_bSuspendState; - /** When this flag is (the default) then in dispose() the frame - and with it the view shell are released together with the - controller. - A derived class can set the flag to when it wants to - exchange controllers that work on the same view shell. One - application is the Impress Multi Pane GUI that changes shells that - are stacked on one view shell. Controllers are associated with the - stacked shells and thus must not destroy the view shell which is not - affected by the switching. - */ - sal_Bool m_bIsFrameReleasedWithController; css::uno::Reference< css::frame::XTitle > m_xTitleHelper; IMPL_SfxBaseController_DataContainer( MUTEX& aMutex , @@ -465,7 +456,6 @@ struct IMPL_SfxBaseController_DataContainer , m_pController ( pController ) , m_bDisposing ( sal_False ) , m_bSuspendState ( sal_False ) - , m_bIsFrameReleasedWithController( sal_True ) { } @@ -703,9 +693,7 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame if ( m_pData->m_pViewShell ) { - SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ; - pActFrame->Enable( TRUE ); - pActFrame->GetDispatcher()->Lock( FALSE ); + ConnectSfxFrame_Impl( true ); } } } @@ -766,9 +754,7 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( ::com:: BOOL bRet = bOther || pDocShell->PrepareClose(); if ( bRet ) { - // disable window and dispatcher until suspend call is withdrawn - pActFrame->Enable( FALSE ); - pActFrame->GetDispatcher()->Lock( TRUE ); + ConnectSfxFrame_Impl( false ); m_pData->m_bSuspendState = sal_True; } @@ -781,9 +767,7 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( ::com:: if ( m_pData->m_pViewShell ) { - SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ; - pActFrame->Enable( TRUE ); - pActFrame->GetDispatcher()->Lock( FALSE ); + ConnectSfxFrame_Impl( true ); } m_pData->m_bSuspendState = sal_False; @@ -1102,11 +1086,6 @@ void SfxBaseController::BorderWidthsChanged_Impl() // SfxBaseController -> XComponent //________________________________________________________________________________________________________ -void SfxBaseController::FrameIsReleasedWithController (sal_Bool bFlag) -{ - m_pData->m_bIsFrameReleasedWithController = bFlag; -} - void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::RuntimeException ) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); @@ -1123,13 +1102,10 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime if ( m_pData->m_pViewShell ) { SfxViewFrame* pFrame = m_pData->m_pViewShell->GetViewFrame() ; - if (m_pData->m_bIsFrameReleasedWithController) - { - if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell ) - pFrame->GetFrame()->SetIsClosing_Impl(); - m_pData->m_pViewShell->DiscardClients_Impl(); - m_pData->m_pViewShell->pImp->bControllerSet = sal_False ; - } + if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell ) + pFrame->GetFrame()->SetIsClosing_Impl(); + m_pData->m_pViewShell->DiscardClients_Impl(); + m_pData->m_pViewShell->pImp->bControllerSet = sal_False ; if ( pFrame ) { @@ -1146,12 +1122,9 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime pView = SfxViewFrame::GetNext( *pView, pDoc ); } - if ( m_pData->m_bIsFrameReleasedWithController ) - { - SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc ) ); - if ( !pView ) - SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) ); - } + SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc ) ); + if ( !pView ) + SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) ); REFERENCE< XMODEL > xModel = pDoc->GetModel(); REFERENCE < ::com::sun::star::util::XCloseable > xCloseable( xModel, com::sun::star::uno::UNO_QUERY ); @@ -1168,8 +1141,7 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime m_pData->m_xListener->disposing( aObject ); SfxViewShell *pShell = m_pData->m_pViewShell; m_pData->m_pViewShell = NULL; - if ( pFrame->GetViewShell() == pShell - && m_pData->m_bIsFrameReleasedWithController) + if ( pFrame->GetViewShell() == pShell ) { // Enter registrations only allowed if we are the owner! if ( pFrame->GetFrame()->OwnsBindings_Impl() ) @@ -1374,6 +1346,39 @@ BOOL SfxBaseController::HasMouseClickListeners_Impl() return m_pData->m_aUserInputInterception.hasMouseClickListeners(); } +void SfxBaseController::ConnectSfxFrame_Impl( const bool i_bConnect ) +{ + ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" ); + SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame(); + ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" ); + + // disable window and dispatcher + pActFrame->Enable( i_bConnect ); + pActFrame->GetDispatcher()->Lock( !i_bConnect ); + + if ( i_bConnect ) + { + pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell ); + if ( m_pData->m_pViewShell->GetSubShell() ) + pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() ); + m_pData->m_pViewShell->PushSubShells_Impl(); + pActFrame->GetDispatcher()->Flush(); + + Window* pEditWin = m_pData->m_pViewShell->GetWindow(); + if ( pEditWin && m_pData->m_pViewShell->IsShowView_Impl() ) + pEditWin->Show(); + + if ( SfxViewFrame::Current() == pActFrame ) + pActFrame->GetDispatcher()->Update_Impl( sal_True ); + } + + // invalidate slot corresponding to the view shell + const sal_uInt16 nViewNo = m_pData->m_pViewShell->GetObjectShell()->GetFactory().GetViewNo_Impl( pActFrame->GetCurViewId(), USHRT_MAX ); + DBG_ASSERT( nViewNo != USHRT_MAX, "view shell id not found" ); + if ( nViewNo != USHRT_MAX ) + pActFrame->GetBindings().Invalidate( nViewNo + SID_VIEWSHELL0 ); +} + //============================================================================= css::uno::Reference< css::frame::XTitle > SfxBaseController::impl_getTitleHelper () { diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index db06fbd7c9..6aa132fb4d 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -1180,15 +1180,9 @@ SfxTopViewFrame::SfxTopViewFrame LockAdjustPosSizePixel(); } - try - { - if ( pObjShell ) - SwitchToViewShell_Impl( nViewId ); - } - catch (com::sun::star::uno::Exception& ) + if ( pObjShell && !SwitchToViewShell_Impl( nViewId ) ) { - // make sure that the ctor is left regularly - ReleaseObjectShell_Impl(); + // TODO: better error handling? Under which conditions can this fail? return; } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 1fc77ff622..c830c9d0dd 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -101,6 +101,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; +using ::com::sun::star::awt::XWindow; namespace css = ::com::sun::star; #ifndef GCC @@ -1031,6 +1032,29 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) rSet.DisableItem( SID_REPEAT ); } +//-------------------------------------------------------------------- +void SfxViewFrame::PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ) +{ + i_rViewShell.PopSubShells_Impl(); + sal_uInt16 nLevel = pDispatcher->GetShellLevel( i_rViewShell ); + if ( nLevel != USHRT_MAX ) + { + if ( nLevel ) + { + // more sub shells on the stack, which were not affected by PopSubShells_Impl + SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 ); + if ( pSubShell == i_rViewShell.GetSubShell() ) + // "real" sub shells will be deleted elsewhere + pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL ); + else + pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE ); + } + pDispatcher->Pop( i_rViewShell ); + pDispatcher->Flush(); + } + +} + //-------------------------------------------------------------------- void SfxViewFrame::ReleaseObjectShell_Impl() @@ -1044,7 +1068,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl() die SfxObjectShell ausgetauscht werden. Zwischen RealeaseObjectShell() und SetObjectShell() darf die Kontrolle - nicht an das ::com::sun::star::chaos::System abgegeben werden. + nicht an das System abgegeben werden. [Querverweise] @@ -1065,21 +1089,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl() SfxViewShell *pDyingViewSh = GetViewShell(); if ( pDyingViewSh ) { - // Jetzt alle SubShells wechhauen - pDyingViewSh->PushSubShells_Impl( sal_False ); - sal_uInt16 nLevel = pDispatcher->GetShellLevel( *pDyingViewSh ); - if ( nLevel && nLevel != USHRT_MAX ) - { - // Es gibt immer nocht SubShells - SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 ); - if ( pSubShell == pDyingViewSh->GetSubShell() ) - //"Echte" Subshells nicht deleten - pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL ); - else - pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE ); - } - pDispatcher->Pop( *pDyingViewSh ); - pDispatcher->Flush(); + PopShellAndSubShells_Impl( *pDyingViewSh ); pDyingViewSh->DisconnectAllClients(); SetViewShell_Impl(0); delete pDyingViewSh; @@ -2126,11 +2136,58 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const return pViewFrame; } +//-------------------------------------------------------------------- +SfxViewShell* SfxViewFrame::LoadNewView_Impl( const USHORT i_nNewViewNo, SfxViewShell* i_pOldShell ) +{ + OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewView_Impl: not allowed to be called with an exsiting view shell!" ); + OSL_PRECOND( GetObjectShell() != NULL, "SfxViewFrame::LoadNewView_Impl: no document -> no loading!" ); + + // our UNO doc + const Reference < XModel > xModel( GetObjectShell()->GetModel(), UNO_QUERY_THROW ); + + // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // >>> to be moved into a UNO view factory implementation + SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); + + // remember ViewID + pImp->nCurViewId = rDocumentFactory.GetViewFactory( i_nNewViewNo ).GetOrdinal(); + // TODO: shouldn't this be done in success case only? + + SfxViewFactory& rViewFactory = rDocumentFactory.GetViewFactory( i_nNewViewNo ); + + SfxViewShell* pViewShell = rViewFactory.CreateInstance( this, i_pOldShell ); + ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" ); + + // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also + GetDispatcher()->SetDisableFlags( 0 ); + SetViewShell_Impl( pViewShell ); + + // ensure a default controller, if the view shell did not provide an own implementation + if ( !pViewShell->GetController().is() ) + pViewShell->SetController( new SfxBaseController( pViewShell ) ); + + // <<< to be moved into a UNO view factory implementation + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + // introduce model/view/controller to each other + Reference < XWindow > xWindow( GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY ); + Reference < XFrame > xFrame( GetFrame()->GetFrameInterface() ); + Reference < XController > xController( pViewShell->GetController() ); + + xController->attachModel( xModel ); + xModel->connectController( xController ); + xFrame->setComponent( xWindow, xController ); + xController->attachFrame( xFrame ); + xModel->setCurrentController( xController ); + + return pViewShell; +} + //-------------------------------------------------------------------- sal_Bool SfxViewFrame::SwitchToViewShell_Impl ( - sal_uInt16 nViewId, /* > 0 + sal_uInt16 nViewIdOrNo, /* > 0 Registrierungs-Id der View, auf die umge- schaltet werden soll, bzw. die erstmalig erzeugt werden soll. @@ -2139,7 +2196,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl Es soll die Default-View verwendet werden. */ sal_Bool bIsIndex /* sal_True - 'nViewId' ist keine Registrations-Id sondern + 'nViewIdOrNo' ist keine Registrations-Id sondern ein Index in die f"ur die in diesem dargestellte . */ @@ -2166,133 +2223,44 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl */ { - try{ - DBG_ASSERT( GetObjectShell(), "Kein Dokument!" ); - - SfxObjectFactory &rDocFact = GetObjectShell()->GetFactory(); - - // find index of old and new ViewShell - sal_uInt16 nOldNo = USHRT_MAX, nNewNo = USHRT_MAX; - bIsIndex |= 0 == nViewId; - for ( sal_uInt16 nNo = 0; nNo < rDocFact.GetViewFactoryCount(); ++nNo ) - { - sal_uInt16 nFoundId = rDocFact.GetViewFactory(nNo).GetOrdinal(); - if ( nNewNo == USHRT_MAX ) - { - if ( bIsIndex && nViewId == nNo ) - { - nNewNo = nNo; - nViewId = nFoundId; // for nViewId == 0 - } - else if ( !bIsIndex && nViewId == nFoundId ) - nNewNo = nNo; - } - if ( pImp->nCurViewId == nFoundId ) - nOldNo = nNo; - } - - if ( nNewNo == USHRT_MAX ) + try { - // unknown ID -> fall back to default - sal_uInt16 nFoundId = rDocFact.GetViewFactory(0).GetOrdinal(); - nNewNo = 0; - nViewId = nFoundId; - if ( pImp->nCurViewId == nFoundId ) - nOldNo = 0; - } - - SfxViewShell *pSh = GetViewShell(); + ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" ); - DBG_ASSERT( !pSh || nOldNo != USHRT_MAX, "old shell id not found" ); - - // does a ViewShell exist already? - SfxViewShell *pOldSh = pSh; - if ( pOldSh ) - { - // ask wether it can be closed - if ( !pOldSh->PrepareClose() ) - return sal_False; + GetBindings().ENTERREGISTRATIONS(); + LockAdjustPosSizePixel(); - // remove SubShells from Dispatcher before switching to new ViewShell - pOldSh->PushSubShells_Impl( sal_False ); - sal_uInt16 nLevel = pDispatcher->GetShellLevel( *pOldSh ); - if ( nLevel ) + // if we already have a view shell, remove it + SfxViewShell* pOldSh = GetViewShell(); + if ( pOldSh ) { - SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 ); - if ( pSubShell == pOldSh->GetSubShell() ) - //"real" SubShells are not deleted - pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL ); - else - // SubShells only known to Dispatcher must be deleted - pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE ); - } - - pDispatcher->Pop( *pOldSh ); - GetBindings().Invalidate( nOldNo + SID_VIEWSHELL0 ); - } - - // remember ViewID - pImp->nCurViewId = nViewId; - GetBindings().Invalidate( nNewNo + SID_VIEWSHELL0 ); + // ask wether it can be closed + Reference< XController > xController( pOldSh->GetController(), UNO_SET_THROW ); + if ( !xController->suspend( sal_True ) ) + return sal_False; - // create new ViewShell - SfxViewFactory &rViewFactory = rDocFact.GetViewFactory( nNewNo ); - LockAdjustPosSizePixel(); - - GetBindings().ENTERREGISTRATIONS(); - pSh = rViewFactory.CreateInstance(this, pOldSh); - - Window *pEditWin = pSh->GetWindow(); - DBG_ASSERT( !pEditWin || !pEditWin->IsReallyVisible(), "don`t show your ViewShell`s Window by yourself!" ); - - // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also - GetDispatcher()->SetDisableFlags( 0 ); - SetViewShell_Impl(pSh); + // remove sub shells from Dispatcher before switching to new ViewShell + PopShellAndSubShells_Impl( *pOldSh ); - Reference < ::com::sun::star::awt::XWindow > xWindow( - GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY ); - Reference < XFrame > xFrame( GetFrame()->GetFrameInterface() ); - if ( !pSh->GetController().is() ) - pSh->SetController( new SfxBaseController( pSh ) ); - Reference < XController > xController( pSh->GetController() ); - xFrame->setComponent( xWindow, xController ); - - xController->attachFrame( xFrame ); - Reference < XModel > xModel( GetObjectShell()->GetModel() ); - if ( xModel.is() ) - { - xController->attachModel( xModel ); - xModel->connectController( xController ); - xModel->setCurrentController( xController ); - } - - GetDispatcher()->Push( *pSh ); - if ( pSh->GetSubShell() ) - GetDispatcher()->Push( *pSh->GetSubShell() ); - pSh->PushSubShells_Impl(); - GetDispatcher()->Flush(); - - // create UI elements before size is set - if ( SfxViewFrame::Current() == this ) - GetDispatcher()->Update_Impl( sal_True ); - - // allow resize events to be processed - UnlockAdjustPosSizePixel(); + // reset view shell, that's a precondition for the LoadNewView_Impl below + SetViewShell_Impl( NULL ); + } - Window* pFrameWin = &GetWindow(); - if ( pFrameWin != &GetFrame()->GetWindow() ) - pFrameWin->Show(); + // create and load new ViewShell + SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory(); + const sal_uInt16 nNewNo = ( bIsIndex || !nViewIdOrNo ) ? nViewIdOrNo : rDocFact.GetViewNo_Impl( nViewIdOrNo, 0 ); + SfxViewShell* pNewSh = LoadNewView_Impl( nNewNo, pOldSh ); - if ( GetWindow().IsReallyVisible() ) - DoAdjustPosSizePixel( pSh, Point(), GetWindow().GetOutputSizePixel() ); + // allow resize events to be processed + UnlockAdjustPosSizePixel(); - if ( pEditWin && pSh->IsShowView_Impl() ) - pEditWin->Show(); + if ( GetWindow().IsReallyVisible() ) + DoAdjustPosSizePixel( pNewSh, Point(), GetWindow().GetOutputSizePixel() ); - GetBindings().LEAVEREGISTRATIONS(); - delete pOldSh; + GetBindings().LEAVEREGISTRATIONS(); + delete pOldSh; } - catch ( com::sun::star::uno::Exception& ) + catch ( const com::sun::star::uno::Exception& ) { // the SfxCode is not able to cope with exceptions thrown while creating views // the code will crash in the stack unwinding procedure, so we shouldn't let exceptions go through here diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index a16439698e..3412b65f8f 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1517,16 +1517,12 @@ void SfxViewShell::PushSubShells_Impl( BOOL bPush ) { for ( USHORT n=0; nPush( *pImp->aArr[n] ); - -// HACK(evtl. PushSubShells fuer SW virtuell machen oder im SW umbauen) -// Notify( *this, SfxSimpleHint( SFX_HINT_RESERVED4 ) ); } else if ( nCount ) { - pDisp->Pop( *pImp->aArr[0], SFX_SHELL_POP_UNTIL ); - -// HACK(evtl. PushSubShells fuer SW virtuell machen oder im SW umbauen) -// Notify( *this, SfxSimpleHint( SFX_HINT_RESERVED3 ) ); + SfxShell& rPopUntil = *pImp->aArr[0]; + if ( pDisp->GetShellLevel( rPopUntil ) != USHRT_MAX ) + pDisp->Pop( rPopUntil, SFX_SHELL_POP_UNTIL ); } pDisp->Flush(); @@ -2243,3 +2239,4 @@ void SfxViewShell::AddRemoveClipboardListener( const uno::Reference < datatransf { } } + -- cgit v1.2.3 From 723df465fba17b019abe3f64853a1e9a01fec180 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Nov 2009 13:45:16 +0100 Subject: [CWS autorecovery] removed nUnused --- sfx2/inc/sfx2/objsh.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index d7447cddab..bde2d27517 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -221,7 +221,6 @@ private: SfxMedium * pMedium; // Beschreibung der Datei bzw. des Storage, in dem sich das Objekt befindet SfxStyleSheetBasePool* pStyleSheetPool; // StyleSheets SfxObjectCreateMode eCreateMode; // Zweck des Objekts - sal_uInt16 nUnused; sal_Bool bHasName :1, // sal_True := bestehendes Objekt, sal_False := es ist ein neues Objekt bIsTmp :1; // temp. Storage -- cgit v1.2.3 From 1dc50bbeece1276044225f448f8f77243f301057 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Nov 2009 21:16:24 +0100 Subject: [CWS autorecovery] merged SfxTopFrame into SfxFrame SfxTopFrame was the only class deriving from the abstract class SfxFrame, so both can effectively be treated as one class. --- sfx2/inc/frmload.hxx | 3 +- sfx2/inc/sfx2/frame.hxx | 57 +++++++------- sfx2/inc/sfx2/objsh.hxx | 1 - sfx2/inc/sfx2/topfrm.hxx | 40 ---------- sfx2/source/control/bindings.cxx | 2 +- sfx2/source/control/dispatch.cxx | 4 +- sfx2/source/view/frame.cxx | 51 ++++-------- sfx2/source/view/frmload.cxx | 6 +- sfx2/source/view/impframe.hxx | 53 +++++++------ sfx2/source/view/ipclient.cxx | 8 +- sfx2/source/view/topfrm.cxx | 166 ++++++++++++--------------------------- sfx2/source/view/viewfrm.cxx | 14 ++-- 12 files changed, 139 insertions(+), 266 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 968ab52fbe..56330fd127 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -59,7 +59,6 @@ class SfxFilter; class SfxFilterMatcher; -class SfxTopFrame; class SfxFrameWeak; @@ -125,7 +124,7 @@ private: sal_Bool impl_plugDocIntoFrame( const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxTopFrame& i_rTargetFrame, + SfxFrame& i_rTargetFrame, SfxObjectShell& i_rDocument ) const; diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 4887b6bdda..5e812df71f 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -90,6 +90,7 @@ class Rectangle; class SfxRequest; class SfxUnoControllerItem; class SvCompatWeakHdl; +class SystemWindow; typedef SfxFrame* SfxFramePtr; class SfxFrameArr_Impl; @@ -129,43 +130,47 @@ class SfxUnoFrame; class SFX2_DLLPUBLIC SfxFrame { friend class SfxFrameIterator; - friend struct SfxFramePickEntry_Impl; - friend class SfxUnoFrame; - friend class SfxViewFrame; /*HACK!*/ + friend class SfxTopWindow_Impl; +// friend struct SfxFramePickEntry_Impl; +// friend class SfxUnoFrame; +// friend class SfxViewFrame; /*HACK!*/ private: - String aName; SfxFrame* pParentFrame; SfxFrameArr_Impl* pChildArr; SfxFrame_Impl* pImp; - SfxUnoFrame* pUnoImp; + Window* pWindow; protected: - virtual sal_Bool Close() = 0; - virtual ~SfxFrame(); + sal_Bool Close(); + virtual ~SfxFrame(); //#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE void SetCurrentDocument_Impl( SfxObjectShell* ); - SAL_DLLPRIVATE void InsertChildFrame_Impl( SfxFrame*, sal_uInt16 nPos = 0 ); SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* ); - SAL_DLLPRIVATE void SetIsTop_Impl( sal_Bool bIsTop = sal_True ); //#endif + SfxFrame( ); // not implemented + SAL_DLLPRIVATE SfxFrame( Window& i_rExternalWindow, bool bHidden ); + public: TYPEINFO(); - SfxFrame(SfxFrame* pParent = 0); + + static SfxFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); + static SfxFrame* Create( SfxObjectShell* pDoc = NULL, USHORT nViewId = NULL, bool bHidden = false, const SfxItemSet* pSet = NULL); + static SfxFrame* Create( SfxObjectShell* pDoc, Window& rWindow, USHORT nViewId = 0, bool bHidden = false, const SfxItemSet* pSet = NULL ); SvCompatWeakHdl* GetHdl(); - virtual Window& GetWindow() const = 0; + Window& GetWindow() const; void CancelTransfers( sal_Bool bCancelLoadEnv = sal_True ); sal_Bool DoClose(); sal_uInt16 GetChildFrameCount() const; SfxFrame* GetChildFrame( sal_uInt16 nPos ) const; - const String& GetFrameName() const - { return aName; } SfxFrame* GetParentFrame() const { return pParentFrame; } + void SetPresentationMode( BOOL bSet ); + SystemWindow* GetSystemWindow() const; + static SfxFrame* GetFirst(); static SfxFrame* GetNext( SfxFrame& ); @@ -202,13 +207,7 @@ public: SAL_DLLPRIVATE sal_Bool DoClose_Impl(); SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet ); - SAL_DLLPRIVATE sal_uInt16 LoadComponent_Impl( const ::rtl::OUString& rURL, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > & rLoader, - SfxItemSet* pSet=0, sal_Bool bDontClose=sal_False ); - DECL_DLLPRIVATE_STATIC_LINK( SfxFrame, BindingHasNewPart_Impl, void* ); SAL_DLLPRIVATE void GetViewData_Impl(); - SAL_DLLPRIVATE void ActivatePickEntry_Impl( SfxFramePickEntry_Impl*, sal_uInt16 nMode, SfxFrameDescriptor *pD = NULL ); SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 ); SAL_DLLPRIVATE sal_uInt16 PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing=sal_False ); SAL_DLLPRIVATE sal_Bool DocIsModified_Impl(); @@ -221,11 +220,6 @@ public: SAL_DLLPRIVATE SfxFrameDescriptor* GetDescriptor() const; SAL_DLLPRIVATE void Lock_Impl( sal_Bool bLock ); - SAL_DLLPRIVATE sal_uInt16 GetLockCount_Impl() const; - //sal_Bool IsLocked_Impl() const - // { return GetLockCount_Impl() > 0; } - SAL_DLLPRIVATE void CloseOnUnlock_Impl(); - SAL_DLLPRIVATE SfxViewFrame* ActivateChildFrame_Impl(); SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl() const; SAL_DLLPRIVATE sal_Bool IsAutoLoadLocked_Impl() const; @@ -243,13 +237,18 @@ public: SAL_DLLPRIVATE Rectangle GetTopOuterRectPixel_Impl() const; SAL_DLLPRIVATE void CreateWorkWindow_Impl(); SAL_DLLPRIVATE void SetWorkWindow_Impl( SfxWorkWindow* pWorkwin ); - SAL_DLLPRIVATE const SvBorder& GetBorder_Impl() const; SAL_DLLPRIVATE void GrabFocusOnComponent_Impl(); - SAL_DLLPRIVATE void ReFill_Impl( const SfxFrameSetDescriptor* pSet ); - SAL_DLLPRIVATE void CloseDocument_Impl(); SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool ); -// sal_Bool IsPlugin_Impl() const; + + SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc ); + SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock ); + SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); + SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; + SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; + SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; //#endif +private: + SAL_DLLPRIVATE void Construct_Impl(); }; SV_DECL_COMPAT_WEAK( SfxFrame ) diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index bde2d27517..c6183fe7cc 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -95,7 +95,6 @@ class GDIMetaFile; class Bitmap; class INetURLObject; class IndexBitSet; -class SfxTopFrame; class SfxAcceleratorManager; class JobSetup; class Size; diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx index e1058faab7..88feca76f0 100644 --- a/sfx2/inc/sfx2/topfrm.hxx +++ b/sfx2/inc/sfx2/topfrm.hxx @@ -41,46 +41,8 @@ #include class SfxViewShell; -class SfxTopFrame; -class SfxTopFrame_Impl; namespace svtools { class AsynchronLink; } -// class SfxTopFrame ----------------------------------------------------- - -class SFX2_DLLPUBLIC SfxTopFrame : public SfxFrame -{ -friend class SfxTopWindow_Impl; -friend class SfxTopFrameWindow_Impl; -friend class SfxTopFrame_Impl; - - SfxTopFrame_Impl* pImp; - Window* pWindow; - SAL_DLLPRIVATE SfxTopFrame( Window* pWindow=NULL, sal_Bool bHidden = sal_False ); - SAL_DLLPRIVATE virtual ~SfxTopFrame(); -public: - TYPEINFO(); - - static SfxTopFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); - static SfxTopFrame* Create( SfxObjectShell* pDoc=0, USHORT nViewId=0, BOOL bHidden=sal_False, const SfxItemSet* pSet=NULL ); - static SfxTopFrame* Create( SfxObjectShell* pDoc, Window* pWindow, USHORT nViewId=0, BOOL bHidden=sal_False, const SfxItemSet* pSet=NULL ); - - virtual Window& GetWindow() const; - virtual BOOL Close(); - String GetWindowData(); - - void SetPresentationMode( BOOL bSet ); - SystemWindow* GetSystemWindow() const; - -//#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc ); - SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock ); - SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); - SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; - SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; - SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; -//#endif -}; - // class SfxTopViewFrame ------------------------------------------------- class SfxTopViewFrame_Impl; @@ -115,8 +77,6 @@ public: SAL_DLLPRIVATE void GetState_Impl(SfxItemSet &); SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &); SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); - SAL_DLLPRIVATE SfxTopFrame* GetTopFrame_Impl() - { return (SfxTopFrame*) GetFrame(); } //#endif }; diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 02efe0aeba..0e071def45 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -2350,7 +2350,7 @@ SystemWindow* SfxBindings::GetSystemWindow() const while ( pFrame->GetParentViewFrame_Impl() ) pFrame = pFrame->GetParentViewFrame_Impl(); SfxTopViewFrame* pTop = PTR_CAST( SfxTopViewFrame, pFrame->GetTopViewFrame() ); - return pTop->GetTopFrame_Impl()->GetTopWindow_Impl(); + return pTop->GetFrame()->GetTopWindow_Impl(); } BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 5f22fb3a33..12da99dba8 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1679,7 +1679,7 @@ void SfxDispatcher::SetMenu_Impl() SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ); if ( pTop && pTop->GetBindings().GetDispatcher() == this ) { - SfxTopFrame* pFrm = pTop->GetTopFrame_Impl(); + SfxFrame* pFrm = pTop->GetFrame(); if ( pFrm->IsMenuBarOn_Impl() ) { com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( pFrm->GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); @@ -2914,7 +2914,7 @@ void SfxDispatcher::HideUI( sal_Bool bHide ) SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ); if ( pTop && pTop->GetBindings().GetDispatcher() == this ) { - SfxTopFrame* pFrm = pTop->GetTopFrame_Impl(); + SfxFrame* pFrm = pTop->GetFrame(); if ( pFrm->IsMenuBarOn_Impl() ) { com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( pFrm->GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 6da4a6ddde..742b074e58 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -104,28 +104,27 @@ TYPEINIT1(SfxFrame, SfxListener); TYPEINIT1_AUTOFACTORY(SfxFrameItem, SfxPoolItem); TYPEINIT1(SfxUsrAnyItem, SfxPoolItem); -SfxFrame::SfxFrame(SfxFrame* pParent): - pParentFrame( pParent ), - pChildArr(0), - pUnoImp(0) +SvCompatWeakHdl* SfxFrame::GetHdl() +{ + return pImp->GetHdl(); +} + +//-------------------------------------------------------------------- +void SfxFrame::Construct_Impl() { pImp = new SfxFrame_Impl( this ); - if ( pParent ) - pParent->InsertChildFrame_Impl( this ); if ( !pFramesArr_Impl ) pFramesArr_Impl = new SfxFrameArr_Impl; pFramesArr_Impl->Insert( this, pFramesArr_Impl->Count() ); } -SvCompatWeakHdl* SfxFrame::GetHdl() -{ - return pImp->GetHdl(); -} - //-------------------------------------------------------------------- SfxFrame::~SfxFrame() { + RemoveTopFrame_Impl( this ); + DELETEZ( pWindow ); + pFramesArr_Impl->Remove( pFramesArr_Impl->GetPos( this ) ); if ( pParentFrame ) @@ -277,14 +276,6 @@ SfxFrame* SfxFrame::GetChildFrame( sal_uInt16 nPos ) const return 0L; } -void SfxFrame::InsertChildFrame_Impl( SfxFrame* pFrame, sal_uInt16 nPos ) -{ - if ( !pChildArr ) - pChildArr = new SfxFrameArr_Impl; - pChildArr->Insert( pFrame, nPos ); - pFrame->pParentFrame = this; -} - void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame ) { DBG_ASSERT( pChildArr, "Unbekannter Frame!"); @@ -294,10 +285,10 @@ void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame ) SfxFrame* SfxFrame::GetTopFrame() const { - SfxFrame *pParent = (SfxFrame*) this; + const SfxFrame* pParent = this; while ( pParent->pParentFrame ) pParent = pParent->pParentFrame; - return pParent; + return const_cast< SfxFrame* >( pParent ); } sal_Bool SfxFrame::IsClosing_Impl() const @@ -321,11 +312,9 @@ SfxViewFrame* SfxFrame::InsertDocument( SfxObjectShell& rDoc, SfxFrame*& rpTarge if ( rpTargetFrame ) { - SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( rpTargetFrame ); - OSL_ENSURE( pTopFrame, "SfxFrame::InsertDocument: an SfxFrame which is no SfxTopFrame?!" ); if ( bHidden ) rDoc.PutItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); - pTopFrame->InsertDocument_Impl( rDoc ); + rpTargetFrame->InsertDocument_Impl( rDoc ); pViewFrame = rpTargetFrame->GetCurrentViewFrame(); } else @@ -385,12 +374,7 @@ SfxObjectShell* SfxFrame::GetCurrentDocument() const { return pImp->pCurrentViewFrame ? pImp->pCurrentViewFrame->GetObjectShell() : - pImp->pCurrentObjectShell; -} - -void SfxFrame::SetCurrentDocument_Impl( SfxObjectShell *pDoc ) -{ - pImp->pCurrentObjectShell = pDoc; + NULL; } void SfxFrame::SetCurrentViewFrame_Impl( SfxViewFrame *pFrame ) @@ -558,8 +542,6 @@ void SfxFrame::GetTargetList( TargetList& rList ) const for ( sal_uInt16 n=0; nGetFrameName().Len() ) - rList.Insert( new String (pFrame->GetFrameName()) ); pFrame->GetTargetList( rList ); } } @@ -915,11 +897,6 @@ void SfxFrame::CreateWorkWindow_Impl() pImp->pWorkWin = new SfxFrameWorkWin_Impl( &pFrame->GetWindow(), this, pFrame ); } -const SvBorder& SfxFrame::GetBorder_Impl() const -{ - return pImp->aBorder; -} - void SfxFrame::GrabFocusOnComponent_Impl() { if ( pImp->bReleasingComponent ) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 9742e7ca6e..3c8ab65a2c 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -250,7 +250,7 @@ namespace // -------------------------------------------------------------------------------------------------------------------- sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, const Reference< XFrame >& i_rxFrame ) { - SfxTopFrame* pTargetFrame = SfxTopFrame::Create( i_rxFrame ); + SfxFrame* pTargetFrame = SfxFrame::Create( i_rxFrame ); ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); SfxFrameWeak wFrame = pTargetFrame; @@ -324,7 +324,7 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti // -------------------------------------------------------------------------------------------------------------------- sal_Bool SfxFrameLoader_Impl::impl_plugDocIntoFrame( const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxTopFrame& i_rTargetFrame, SfxObjectShell& i_rDocument ) const + SfxFrame& i_rTargetFrame, SfxObjectShell& i_rDocument ) const { SfxAllItemSet aSet( SFX_APP()->GetPool() ); TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); @@ -568,7 +568,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } // create a frame - SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); + SfxFrame* pTargetFrame = SfxFrame::Create( _rTargetFrame ); ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); wFrame = pTargetFrame; diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index 6e15a4b0bc..b27dd2c685 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -54,14 +54,12 @@ class SfxObjectShell; class SfxFrame_Impl : public SfxBroadcaster, public SvCompatWeakBase { -friend class SfxFrame; - +public: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame; String aFrameIdName; sal_uInt32 nType; sal_uInt32 nHistoryPos; SfxViewFrame* pCurrentViewFrame; - SfxObjectShell* pCurrentObjectShell; SfxFrameDescriptor* pDescr; sal_uInt16 nFrameId; sal_uInt16 nLocks; @@ -76,27 +74,36 @@ friend class SfxFrame; const SfxItemSet* pSet; SfxWorkWindow* pWorkWin; SvBorder aBorder; + // formerly SfxTopFrame + Window* pExternalWindow; + bool bHidden; + bool bLockResize; + bool bMenuBarOn; - SfxFrame_Impl( SfxFrame* pAntiImplP ) : - SvCompatWeakBase( pAntiImplP ), - nType( 0L ), - nHistoryPos( 0 ), - pCurrentViewFrame( NULL ), - pCurrentObjectShell( NULL ), - pDescr( NULL ), - nFrameId( 0 ), - nLocks( 0 ), - bCloseOnUnlock( sal_False ), - bClosing(sal_False), - bPrepClosing(sal_False), - bInCancelTransfers( sal_False ), - bOwnsBindings( sal_False ), - bReleasingComponent( sal_False ), - bInPlace( sal_False ), - pFrame( pAntiImplP ), - pSet( 0 ), - pWorkWin( 0 ) - {} + SfxFrame_Impl( SfxFrame* pAntiImplP ) + :SvCompatWeakBase( pAntiImplP ) + ,nType( 0L ) + ,nHistoryPos( 0 ) + ,pCurrentViewFrame( NULL ) + ,pDescr( NULL ) + ,nFrameId( 0 ) + ,nLocks( 0 ) + ,bCloseOnUnlock( sal_False ) + ,bClosing(sal_False) + ,bPrepClosing(sal_False) + ,bInCancelTransfers( sal_False ) + ,bOwnsBindings( sal_False ) + ,bReleasingComponent( sal_False ) + ,bInPlace( sal_False ) + ,pFrame( pAntiImplP ) + ,pSet( 0 ) + ,pWorkWin( 0 ) + ,pExternalWindow( NULL ) + ,bHidden( false ) + ,bLockResize( false ) + ,bMenuBarOn( true ) + { + } virtual ~SfxFrame_Impl() { } }; diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 18fe96ebb0..b9de954a1e 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -986,7 +986,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) { if ( m_pViewSh ) - ((SfxTopFrame*)m_pViewSh->GetViewFrame()->GetTopFrame())->LockResize_Impl(TRUE); + m_pViewSh->GetViewFrame()->GetTopFrame()->LockResize_Impl(TRUE); try { m_pImp->m_xObject->setClientSite( m_pImp->m_xClient ); @@ -1036,7 +1036,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) if ( m_pViewSh ) { SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); - ((SfxTopFrame*)pFrame->GetTopFrame())->LockResize_Impl(FALSE); + pFrame->GetTopFrame()->LockResize_Impl(FALSE); pFrame->GetTopFrame()->Resize(); } } @@ -1097,7 +1097,7 @@ void SfxInPlaceClient::DeactivateObject() } if ( m_pViewSh ) - ((SfxTopFrame*)m_pViewSh->GetViewFrame()->GetTopFrame())->LockResize_Impl(TRUE); + m_pViewSh->GetViewFrame()->GetTopFrame()->LockResize_Impl(TRUE); if ( m_pImp->m_xObject->getStatus( m_pImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) { @@ -1119,7 +1119,7 @@ void SfxInPlaceClient::DeactivateObject() { SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); SfxViewFrame::SetViewFrame( pFrame ); - ((SfxTopFrame*)pFrame->GetTopFrame())->LockResize_Impl(FALSE); + pFrame->GetTopFrame()->LockResize_Impl(FALSE); pFrame->GetTopFrame()->Resize(); } } diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 6aa132fb4d..e6419cd9ce 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -71,6 +71,7 @@ #include #include #include +#include #include @@ -97,6 +98,7 @@ #include #include "statcach.hxx" #include +#include "impframe.hxx" using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -134,24 +136,12 @@ static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService ) return sVar; } -class SfxTopFrame_Impl -{ -public: - Window* pWindow; // maybe external - BOOL bHidden; - BOOL bLockResize; - BOOL bMenuBarOn; -}; - class SfxTopWindow_Impl : public Window { public: - SfxTopFrame* pFrame; + SfxFrame* pFrame; - SfxTopWindow_Impl( SfxTopFrame* pF ); -// : Window( pF->pImp->pWindow, WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK ) -// , pFrame( pF ) -// { SetBackground(); } + SfxTopWindow_Impl( SfxFrame* pF, Window& i_rExternalWindow ); ~SfxTopWindow_Impl( ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); @@ -164,8 +154,8 @@ public: DECL_LINK( CloserHdl, void* ); }; -SfxTopWindow_Impl::SfxTopWindow_Impl( SfxTopFrame* pF ) - : Window( pF->pImp->pWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK ) +SfxTopWindow_Impl::SfxTopWindow_Impl( SfxFrame* pF, Window& i_rExternalWindow ) + : Window( &i_rExternalWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK ) , pFrame( pF ) { } @@ -195,7 +185,7 @@ long SfxTopWindow_Impl::Notify( NotifyEvent& rNEvt ) { if ( pView->GetViewShell() && !pView->GetViewShell()->GetUIActiveIPClient_Impl() && !pFrame->IsInPlace() ) { - DBG_TRACE("SfxTopFrame: GotFocus"); + DBG_TRACE("SfxFrame: GotFocus"); pView->MakeActive_Impl( FALSE ); } @@ -390,10 +380,10 @@ static String _getTabString() return result; } -SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, BOOL bHidden, const SfxItemSet* pSet ) +SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, const SfxItemSet* pSet ) { Reference < XFrame > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); - SfxTopFrame *pFrame = NULL; + SfxFrame *pFrame = NULL; BOOL bNewView = FALSE; if ( pSet ) { @@ -470,7 +460,7 @@ SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, BOOL bHi SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; for( USHORT nPos = rArr.Count(); nPos--; ) { - SfxTopFrame *pF = (SfxTopFrame*) rArr[ nPos ]; + SfxFrame *pF = rArr[ nPos ]; if ( pF->GetCurrentDocument() == pDoc ) { pFrame = pF; @@ -539,21 +529,21 @@ SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, BOOL bHi return pFrame; } -SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, Window* pWindow, USHORT nViewId, BOOL bHidden, const SfxItemSet* pSet ) +SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, Window& rWindow, USHORT nViewId, bool bHidden, const SfxItemSet* pSet ) { Reference < ::com::sun::star::lang::XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() ); Reference < XFramesSupplier > xDesktop ( xFact->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); Reference < XFrame > xFrame( xFact->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Frame") ), UNO_QUERY ); - xFrame->initialize( VCLUnoHelper::GetInterface ( pWindow ) ); + uno::Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY ); + xFrame->initialize( xWin.get() ); if ( xDesktop.is() ) xDesktop->getFrames()->append( xFrame ); - uno::Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( pWindow ), uno::UNO_QUERY ); if ( xWin.is() && xWin->isActive() ) xFrame->activate(); - SfxTopFrame* pFrame = new SfxTopFrame( pWindow ); + SfxFrame* pFrame = new SfxFrame( rWindow, false ); pFrame->SetFrameInterface_Impl( xFrame ); pFrame->pImp->bHidden = bHidden; @@ -568,59 +558,34 @@ SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, Window* pWindow, USHORT return pFrame; } -SfxTopFrame* SfxTopFrame::Create( Reference < XFrame > xFrame ) +SfxFrame* SfxFrame::Create( Reference < XFrame > xFrame ) { // create a new TopFrame to an external XFrame object ( wrap controller ) - DBG_ASSERT( xFrame.is(), "Wrong parameter!" ); - + ENSURE_OR_THROW( xFrame.is(), "NULL frame not allowed" ); Window* pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - SfxTopFrame* pFrame = new SfxTopFrame( pWindow ); + ENSURE_OR_THROW( pWindow, "frame without container window not allowed" ); + + SfxFrame* pFrame = new SfxFrame( *pWindow, false ); pFrame->SetFrameInterface_Impl( xFrame ); return pFrame; } -SfxTopFrame::SfxTopFrame( Window* pExternal, sal_Bool bHidden ) - : SfxFrame( NULL ) - , pWindow( NULL ) +SfxFrame::SfxFrame( Window& i_rExternalWindow, bool i_bHidden ) + :pParentFrame( NULL ) + ,pChildArr( NULL ) + ,pImp( NULL ) + ,pWindow( NULL ) { - pImp = new SfxTopFrame_Impl; - pImp->bHidden = bHidden; - pImp->bLockResize = FALSE; - pImp->bMenuBarOn = TRUE; - InsertTopFrame_Impl( this ); - if ( pExternal ) - { - pImp->pWindow = pExternal; - } - else - { - DBG_ERROR( "TopFrame without window created!" ); -/* - pImp->pWindow = new SfxTopFrameWindow_Impl( this ); - pImp->pWindow->SetActivateMode( ACTIVATE_MODE_GRABFOCUS ); - pImp->pWindow->SetPosSizePixel( Point( 20,20 ), Size( 800,600 ) ); - if ( GetFrameInterface().is() ) - GetFrameInterface()->initialize( VCLUnoHelper::GetInterface( pImp->pWindow ) ); - pImp->pWindow->Show(); - */ - } + Construct_Impl(); - pWindow = new SfxTopWindow_Impl( this ); -/** AS: - Hide this window till the component was realy loaded. Otherwhise it overpaint e.g. the old component hardly - and produce repaint errors. - pWindow->Show(); - */ -} + pImp->bHidden = i_bHidden; + InsertTopFrame_Impl( this ); + pImp->pExternalWindow = &i_rExternalWindow; -SfxTopFrame::~SfxTopFrame() -{ - RemoveTopFrame_Impl( this ); - DELETEZ( pWindow ); - delete pImp; + pWindow = new SfxTopWindow_Impl( this, i_rExternalWindow ); } -void SfxTopFrame::SetPresentationMode( BOOL bSet ) +void SfxFrame::SetPresentationMode( BOOL bSet ) { if ( GetCurrentViewFrame() ) GetCurrentViewFrame()->GetWindow().SetBorderStyle( bSet ? WINDOW_BORDER_NOBORDER : WINDOW_BORDER_NORMAL ); @@ -644,32 +609,31 @@ void SfxTopFrame::SetPresentationMode( BOOL bSet ) GetCurrentViewFrame()->GetDispatcher()->Update_Impl( TRUE ); } -SystemWindow* -SfxTopFrame::GetSystemWindow() const +SystemWindow* SfxFrame::GetSystemWindow() const { return GetTopWindow_Impl(); } -SystemWindow* SfxTopFrame::GetTopWindow_Impl() const +SystemWindow* SfxFrame::GetTopWindow_Impl() const { - if ( pImp->pWindow->IsSystemWindow() ) - return (SystemWindow*) pImp->pWindow; + if ( pImp->pExternalWindow->IsSystemWindow() ) + return (SystemWindow*) pImp->pExternalWindow; else return NULL; } -Window& SfxTopFrame::GetWindow() const +Window& SfxFrame::GetWindow() const { return *pWindow; } -sal_Bool SfxTopFrame::Close() +sal_Bool SfxFrame::Close() { delete this; return sal_True; } -void SfxTopFrame::LockResize_Impl( BOOL bLock ) +void SfxFrame::LockResize_Impl( BOOL bLock ) { pImp->bLockResize = bLock; } @@ -684,7 +648,7 @@ IMPL_LINK( SfxTopWindow_Impl, CloserHdl, void*, EMPTYARG ) return 0L; } -void SfxTopFrame::SetMenuBarOn_Impl( BOOL bOn ) +void SfxFrame::SetMenuBarOn_Impl( BOOL bOn ) { pImp->bMenuBarOn = bOn; @@ -708,48 +672,17 @@ void SfxTopFrame::SetMenuBarOn_Impl( BOOL bOn ) } } -BOOL SfxTopFrame::IsMenuBarOn_Impl() const +BOOL SfxFrame::IsMenuBarOn_Impl() const { return pImp->bMenuBarOn; } -String SfxTopFrame::GetWindowData() -{ - String aActWinData; - char cToken = ','; - - SfxViewFrame *pActFrame = SfxViewFrame::Current(); - SfxViewFrame *pFrame = GetCurrentViewFrame(); - const sal_Bool bActWin = ( pActFrame->GetTopViewFrame() == pFrame ); - - // ::com::sun::star::sdbcx::User-Daten der ViewShell - String aUserData; - pFrame->GetViewShell()->WriteUserData(aUserData); - - // assemble ini-data - String aWinData; - aWinData += String::CreateFromInt32( pFrame->GetCurViewId() ); - aWinData += cToken; - - aWinData += '1'; // former attribute "isfloating" - aWinData += cToken; - - // aktives kennzeichnen - aWinData += cToken; - aWinData += bActWin ? '1' : '0'; - - aWinData += cToken; - aWinData += aUserData; - - return aWinData; -} - -void SfxTopFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const +void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const { - Window *pWin = pImp->pWindow; + Window *pWin = pImp->pExternalWindow; // Groesse setzen - const Size aAppWindow( pImp->pWindow->GetDesktopRectPixel().GetSize() ); + const Size aAppWindow( pImp->pExternalWindow->GetDesktopRectPixel().GetSize() ); Point aPos( rWinArea.TopLeft() ); Size aSz( rWinArea.GetSize() ); if ( aSz.Width() && aSz.Height() ) @@ -800,11 +733,11 @@ namespace } } -sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) +sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) /* [Beschreibung] */ { - OSL_PRECOND( rDoc.GetMedium(), "SfxTopFrame::InsertDocument_Impl: no medium -> no view!"); + OSL_PRECOND( rDoc.GetMedium(), "SfxFrame::InsertDocument_Impl: no medium -> no view!"); if ( !rDoc.GetMedium() ) return sal_False; @@ -816,7 +749,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) return sal_False; OSL_PRECOND( GetCurrentDocument() == NULL, - "SfxTopFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); + "SfxFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); const SfxItemSet* pSet = GetItemSet_Impl(); if ( !pSet ) @@ -834,7 +767,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) // hidden? OSL_PRECOND( !pImp->bHidden, - "SfxTopFrame::InsertDocument_Impl: quite unexpected ... the below logic might not work in all cases here ..." ); + "SfxFrame::InsertDocument_Impl: quite unexpected ... the below logic might not work in all cases here ..." ); pImp->bHidden = pHidItem ? pHidItem->GetValue() : false; // plugin mode @@ -878,7 +811,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) SfxViewFrame* pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId ); if ( !pViewFrame->GetViewShell() ) { - OSL_ENSURE( false, "SfxTopFrame::InsertDocument_Impl: something went wrong while creating the SfxTopViewFrame!" ); + OSL_ENSURE( false, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxTopViewFrame!" ); pViewFrame->DoClose(); return sal_False; } @@ -897,7 +830,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) } OSL_ENSURE( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT, - "SfxTopFrame::InsertDocument_Impl: so this code wasn't dead?" ); + "SfxFrame::InsertDocument_Impl: so this code wasn't dead?" ); // Before CWS autorecovery, there was code which postponed setting the ViewData/Mark to a later time // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since loads this method // here is never called before the load process finished. @@ -998,7 +931,6 @@ long SfxViewFrameClose_Impl( void* /*pObj*/, void* pArg ) return 0; } -TYPEINIT1(SfxTopFrame, SfxFrame); TYPEINIT1(SfxTopViewFrame, SfxViewFrame); //-------------------------------------------------------------------- @@ -1078,7 +1010,7 @@ String SfxTopViewFrame::UpdateTitle() GetBindings().Invalidate( SID_NEWDOCDIRECT ); /* AS_TITLE - Window* pWindow = GetTopFrame_Impl()->GetTopWindow_Impl(); + Window* pWindow = GetFrame()->GetTopWindow_Impl(); if ( pWindow && pWindow->GetText() != aTitle ) pWindow->SetText( aTitle ); */ diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c830c9d0dd..506aac04ff 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2391,10 +2391,10 @@ void SfxViewFrame::ExecView_Impl if ( pFrameItem ) { pFrameItem->GetValue() >>= xFrame; - pFrame = SfxTopFrame::Create( xFrame ); + pFrame = SfxFrame::Create( xFrame ); } else - pFrame = SfxTopFrame::Create(); + pFrame = SfxFrame::Create(); SfxAllItemSet aSet( SFX_APP()->GetPool() ); SFX_REQUEST_ARG( rReq, pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False ); @@ -2431,7 +2431,7 @@ void SfxViewFrame::ExecView_Impl { Reference < XFrame > xFrame; pFrameItem->GetValue() >>= xFrame; - SfxTopFrame* pFrame = SfxTopFrame::Create( xFrame ); + SfxFrame* pFrame = SfxFrame::Create( xFrame ); pMed->GetItemSet()->ClearItem( SID_HIDDEN ); pFrame->InsertDocument_Impl( *GetObjectShell() ); if ( !bHidden ) @@ -2441,7 +2441,7 @@ void SfxViewFrame::ExecView_Impl { SfxAllItemSet aSet( GetPool() ); aSet.Put( SfxBoolItem( SID_OPEN_NEW_VIEW, TRUE ) ); - SfxFrame* pFrame = SfxTopFrame::Create( GetObjectShell(), GetCurViewId(), bHidden, &aSet ); + SfxFrame* pFrame = SfxFrame::Create( GetObjectShell(), GetCurViewId(), bHidden, &aSet ); if ( bHidden ) pFrame->GetCurrentViewFrame()->LockObjectShell_Impl( TRUE ); } @@ -3125,7 +3125,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() ); if ( pTop ) { - WorkWindow* pWork = (WorkWindow*) pTop->GetTopFrame_Impl()->GetTopWindow_Impl(); + WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl(); if ( pWork ) { com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( @@ -3276,7 +3276,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() ); if ( pTop ) { - WorkWindow* pWork = (WorkWindow*) pTop->GetTopFrame_Impl()->GetTopWindow_Impl(); + WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl(); if ( pWork ) { rSet.Put( SfxBoolItem( nWhich, pWork->IsFullScreenMode() ) ); @@ -3524,7 +3524,7 @@ SfxViewFrame* SfxViewFrame::CreateViewFrame( SfxObjectShell& rDoc, sal_uInt16 nV if ( bHidden ) pSet->Put( SfxBoolItem( SID_HIDDEN, sal_True ) ); - SfxFrame *pFrame = SfxTopFrame::Create( &rDoc, 0, bHidden ); + SfxFrame *pFrame = SfxFrame::Create( &rDoc, 0, bHidden ); return pFrame->GetCurrentViewFrame(); } -- cgit v1.2.3 From 4c9f7ba5ee4bef7615a0b086c846ae7d554c7b5d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 29 Nov 2009 20:56:55 +0100 Subject: #i10000# --- sfx2/source/view/frame.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 742b074e58..53a5b658dc 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -905,12 +905,12 @@ void SfxFrame::GrabFocusOnComponent_Impl() return; } - Window* pWindow = &GetWindow(); + Window* pFocusWindow = &GetWindow(); if ( GetCurrentViewFrame() && GetCurrentViewFrame()->GetViewShell() && GetCurrentViewFrame()->GetViewShell()->GetWindow() ) - pWindow = GetCurrentViewFrame()->GetViewShell()->GetWindow(); + pFocusWindow = GetCurrentViewFrame()->GetViewShell()->GetWindow(); - if( !pWindow->HasChildPathFocus() ) - pWindow->GrabFocus(); + if( !pFocusWindow->HasChildPathFocus() ) + pFocusWindow->GrabFocus(); } void SfxFrame::ReleasingComponent_Impl( sal_Bool bSet ) -- cgit v1.2.3 From 9786bb7321344142cc2da2b4a75a9fa4df26842f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Nov 2009 12:56:04 +0100 Subject: [CWS autorecovery] merged SfxTopViewFrame into SfxViewFrame SfxTopViewFrame was the only class deriving from the abstract class SfxViewFrame, so both can effectively be treated as one class. This change was done to make subsequent refactorings easier. --- sfx2/inc/sfx2/bindings.hxx | 3 +- sfx2/inc/sfx2/shell.hxx | 1 - sfx2/inc/sfx2/topfrm.hxx | 84 --------- sfx2/inc/sfx2/viewfrm.hxx | 43 ++--- sfx2/inc/sfx2/viewsh.hxx | 4 - sfx2/prj/d.lst | 1 - sfx2/sdi/frmslots.sdi | 14 +- sfx2/sdi/makefile.mk | 1 - sfx2/sdi/mdislots.sdi | 48 ----- sfx2/sdi/sfxslots.sdi | 1 - sfx2/source/appl/app.cxx | 2 +- sfx2/source/appl/appbas.cxx | 2 +- sfx2/source/appl/appdde.cxx | 4 +- sfx2/source/appl/appmisc.cxx | 2 +- sfx2/source/appl/appopen.cxx | 12 +- sfx2/source/appl/appreg.cxx | 3 +- sfx2/source/appl/appserv.cxx | 2 +- sfx2/source/appl/sfxpicklist.cxx | 2 +- sfx2/source/appl/workwin.cxx | 2 +- sfx2/source/bastyp/fltfnc.cxx | 2 +- sfx2/source/control/bindings.cxx | 4 +- sfx2/source/control/dispatch.cxx | 29 +-- sfx2/source/doc/objcont.cxx | 2 +- sfx2/source/doc/objserv.cxx | 9 +- sfx2/source/doc/objxtor.cxx | 12 +- sfx2/source/doc/printhelper.cxx | 6 +- sfx2/source/doc/sfxbasemodel.cxx | 16 +- sfx2/source/inc/objshimp.hxx | 1 - sfx2/source/view/frame.cxx | 2 +- sfx2/source/view/impviewframe.hxx | 87 +++++++++ sfx2/source/view/ipclient.cxx | 2 +- sfx2/source/view/topfrm.cxx | 335 +++++++++-------------------------- sfx2/source/view/viewfrm.cxx | 364 ++++++++++++++++---------------------- sfx2/source/view/viewsh.cxx | 2 +- 34 files changed, 397 insertions(+), 707 deletions(-) delete mode 100644 sfx2/inc/sfx2/topfrm.hxx delete mode 100644 sfx2/sdi/mdislots.sdi create mode 100644 sfx2/source/view/impviewframe.hxx diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx index eccbc16cbc..85442c1cc8 100644 --- a/sfx2/inc/sfx2/bindings.hxx +++ b/sfx2/inc/sfx2/bindings.hxx @@ -99,8 +99,7 @@ class SFX2_DLLPUBLIC SfxBindings: public SfxBroadcaster der Klasse SfxBindings. Sie wird von der SfxApplication automatisch angelegt und zerst"ort. Instanzen werden aber i.d.R. "uber das Makro oder den zugeh"origen besorgt - werden. Bestimmte SfxViewFrame Subklassen (z.B. ) - legen ihre eigene Instanz der SfxBindings an. + werden. Die SfxBindings verwalten alle in den an ihr angemeldeten Controllern gebundenen Slot-Ids und cachen die jeweiligen diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx index 154cef1257..14ef5ab703 100644 --- a/sfx2/inc/sfx2/shell.hxx +++ b/sfx2/inc/sfx2/shell.hxx @@ -89,7 +89,6 @@ enum SfxInterfaceId SFX_INTERFACE_NONE, SFX_INTERFACE_SFXAPP, SFX_INTERFACE_SFXDOCSH, - SFX_INTERFACE_SFXTOPFRM, SFX_INTERFACE_SFXIPFRM, SFX_INTERFACE_SFXVIEWSH, SFX_INTERFACE_SFXVIEWFRM, diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx deleted file mode 100644 index 88feca76f0..0000000000 --- a/sfx2/inc/sfx2/topfrm.hxx +++ /dev/null @@ -1,84 +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: topfrm.hxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SFX_TOPFRM_HXX -#define _SFX_TOPFRM_HXX - -#include "sal/config.h" -#include "sfx2/dllapi.h" -#include "sal/types.h" -#include -#include -#include - -#include -#include - -class SfxViewShell; -namespace svtools { class AsynchronLink; } - -// class SfxTopViewFrame ------------------------------------------------- - -class SfxTopViewFrame_Impl; -class SFX2_DLLPUBLIC SfxTopViewFrame : public SfxViewFrame -{ -friend class SfxTopWindow_Impl; -friend class SfxTopViewFrame_Impl; - - SfxTopViewFrame_Impl* pImp; - svtools::AsynchronLink* pCloser; - -protected: - - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - virtual void Activate( BOOL bUI ); - virtual void Deactivate( BOOL bUI ); - virtual BOOL Close(); - virtual ~SfxTopViewFrame(); - -public: - TYPEINFO(); - SFX_DECL_INTERFACE(SFX_INTERFACE_SFXTOPFRM) - - SfxTopViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc=NULL, USHORT nViewId=0 ); - - virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ); - SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder ); - virtual String UpdateTitle(); - -//#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE void Exec_Impl(SfxRequest &); - SAL_DLLPRIVATE void GetState_Impl(SfxItemSet &); - SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &); - SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); -//#endif -}; - -#endif // #ifndef _SFX_TOPFRM_HXX - diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index d4c86169c4..7fa0eaff7e 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -61,6 +61,10 @@ namespace sfx2 { class SvLinkSource; } +namespace svtools +{ + class AsynchronLink; +} #ifndef SFX_DECL_OBJECTSHELL_DEFINED #define SFX_DECL_OBJECTSHELL_DEFINED @@ -129,6 +133,7 @@ Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder ); Rectangle & operator -= ( Rectangle & rRect, const SvBorder & rBorder ); +DBG_NAMEEX(SfxViewFrame) class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener { struct SfxViewFrame_Impl* pImp; @@ -143,11 +148,13 @@ private: SAL_DLLPRIVATE void Construct_Impl( SfxObjectShell *pObjSh=NULL ); #endif +// SfxViewFrame( SfxBindings&, SfxFrame*, SfxObjectShell *pDoc, sal_uInt32 nType ); +// SfxViewFrame( SfxObjectShell&, SfxBindings&, SfxFrame* p = NULL, sal_uInt32 nType = NULL ); +// SfxViewFrame( const SfxViewFrame &, SfxBindings &, SfxFrame *pFrame ); + protected: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - SAL_DLLPRIVATE void SetWindow_Impl( Window *pWin ); - #ifndef _SFX_HXX SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); SAL_DLLPRIVATE void KillDispatcher_Impl(); @@ -156,28 +163,20 @@ protected: virtual ~SfxViewFrame(); public: + SfxViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc = NULL, USHORT nViewId = 0 ); + TYPEINFO(); SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM) - SfxViewFrame( SfxBindings&, SfxFrame*, SfxObjectShell *pDoc=0, sal_uInt32 nType = 0 ); - SfxViewFrame(SfxObjectShell&, SfxBindings&, SfxFrame*p=0, sal_uInt32 nType = 0); - SfxViewFrame( - const SfxViewFrame &, SfxBindings &, SfxFrame *pFrame); - static void SetViewFrame( SfxViewFrame* ); static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, BOOL bHidden=FALSE ); static SfxViewFrame* Current(); - static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, - TypeId aType = 0, - BOOL bOnlyVisible = TRUE ); - static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, - const SfxObjectShell* pDoc = 0, - TypeId aType = 0 , - BOOL bOnlyVisible = TRUE ); - static USHORT Count(TypeId = 0); + static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); + static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); + static USHORT Count(); void DoActivate(BOOL bMDI, SfxViewFrame *pOld=NULL); void DoDeactivate(BOOL bMDI, SfxViewFrame *pOld=NULL); @@ -189,8 +188,7 @@ public: SfxBindings& GetBindings() { return *pBindings; } const SfxBindings& GetBindings() const { return *pBindings; } Window& GetWindow() const; - virtual void SetZoomFactor( const Fraction &rZoomX, - const Fraction &rZoomY ) = 0; + virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ); SfxProgress* GetProgress() const; #ifdef ENABLE_INIMANAGER//MUSTINI @@ -214,6 +212,8 @@ public: void ToTop(); void Enable( BOOL bEnable ); virtual BOOL Close(); + virtual void Activate( BOOL bUI ); + virtual void Deactivate( BOOL bUI ); // DDE-Interface virtual long DdeExecute( const String& rCmd ); @@ -225,10 +225,10 @@ public: const ::com::sun::star::uno::Any & rValue ); virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem ); - virtual void ShowStatusText( const String& rText ); - virtual void HideStatusText(); + void ShowStatusText( const String& rText ); + void HideStatusText(); - virtual String UpdateTitle(); + String UpdateTitle(); // interne Handler SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder ); @@ -302,6 +302,9 @@ public: SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl( USHORT nId ); SAL_DLLPRIVATE void AddDispatchMacroToBasic_Impl(const ::rtl::OUString& sMacro); + SAL_DLLPRIVATE void Exec_Impl(SfxRequest &); + SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &); + SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); //#endif private: SAL_DLLPRIVATE SfxViewShell* LoadNewView_Impl( const USHORT i_nNewViewNo, SfxViewShell* i_pOldShell ); diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 7f54777d6c..26f0ed2219 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -160,11 +160,7 @@ class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener { #ifdef _SFXVIEWSH_HXX friend class SfxViewFrame; -friend class SfxTopViewFrame; friend class SfxPlugInFrame; -friend class SfxInternalFrame; -friend class SfxExternalTopViewFrame_Impl; -friend class SfxOfficeDocController; friend class SfxBaseController; #endif diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst index 77acce9a7b..ed411940ed 100644 --- a/sfx2/prj/d.lst +++ b/sfx2/prj/d.lst @@ -57,7 +57,6 @@ mkdir: %_DEST%\inc%_EXT%\sfx2 ..\inc\sfx2\imgdef.hxx %_DEST%\inc%_EXT%\sfx2\imgdef.hxx ..\inc\sfx2\ipclient.hxx %_DEST%\inc%_EXT%\sfx2\ipclient.hxx ..\inc\sfx2\macrconf.hxx %_DEST%\inc%_EXT%\sfx2\macrconf.hxx -..\inc\sfx2\topfrm.hxx %_DEST%\inc%_EXT%\sfx2\topfrm.hxx ..\inc\sfx2\mgetempl.hxx %_DEST%\inc%_EXT%\sfx2\mgetempl.hxx ..\inc\mieclip.hxx %_DEST%\inc%_EXT%\sfx2\mieclip.hxx ..\inc\sfx2\minarray.hxx %_DEST%\inc%_EXT%\sfx2\minarray.hxx diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi index 17ab4f8483..acaa547472 100644 --- a/sfx2/sdi/frmslots.sdi +++ b/sfx2/sdi/frmslots.sdi @@ -441,11 +441,23 @@ interface TopWindow : BrowseWindow shell SfxViewFrame { - import BrowseWindow [Automation]; + import TopWindow [Automation]; SID_FORMATMENUSTATE [ StateMethod = MiscState_Impl ; ] + + SID_ACTIVATE // ole(no) api(final/play/rec) + [ + ExecMethod = Exec_Impl ; + StateMethod = GetState_Impl ; + ] + + SID_SHOWPOPUPS + [ + ExecMethod = Exec_Impl ; + StateMethod = GetState_Impl ; + ] } diff --git a/sfx2/sdi/makefile.mk b/sfx2/sdi/makefile.mk index f8def0a3c2..3e353b67b9 100644 --- a/sfx2/sdi/makefile.mk +++ b/sfx2/sdi/makefile.mk @@ -54,7 +54,6 @@ SVSDI1DEPEND= \ appslots.sdi \ sfxslots.sdi \ docslots.sdi \ - mdislots.sdi \ viwslots.sdi \ frmslots.sdi diff --git a/sfx2/sdi/mdislots.sdi b/sfx2/sdi/mdislots.sdi deleted file mode 100644 index 88ffba4505..0000000000 --- a/sfx2/sdi/mdislots.sdi +++ /dev/null @@ -1,48 +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 - * - * $Revision$ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -shell SfxTopViewFrame : SfxViewFrame -{ - import TopWindow [Automation]; - - SID_ACTIVATE // ole(no) api(final/play/rec) - [ - ExecMethod = Exec_Impl ; - StateMethod = GetState_Impl ; - ] - - SID_SHOWPOPUPS - [ - ExecMethod = Exec_Impl ; - StateMethod = GetState_Impl ; - ] -} - diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi index 7954591236..7da283228f 100644 --- a/sfx2/sdi/sfxslots.sdi +++ b/sfx2/sdi/sfxslots.sdi @@ -132,7 +132,6 @@ TypeLibFile( "sfxslots.tlb" ) include "docslots.sdi" include "frmslots.sdi" include "viwslots.sdi" - include "mdislots.sdi" include "appslots.sdi" } diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index d7a82781a2..8e26f1dbd0 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -111,7 +111,7 @@ #include #include #include -#include +#include #include "appdata.hxx" #include "openflag.hxx" #include "app.hrc" diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index a7d965a097..c6667aaf26 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -354,7 +354,7 @@ void SfxApplication::EnterBasicCall() } // die SbxObjects der SfxShells auf den Stacks der Frames erzeugen - for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,0,sal_False); + for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,sal_False); pFrame; pFrame = SfxViewFrame::GetNext(*pFrame,0,0,sal_False) ) { diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 45e1e23d55..8f18fb2e31 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -49,7 +49,7 @@ #include "appdata.hxx" #include #include -#include +#include #include #include "sfxtypes.hxx" #include @@ -632,7 +632,7 @@ String ImplDdeService::Topics() SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType ); while( pShell ) { - if( SfxViewFrame::GetFirst( pShell, TYPE(SfxTopViewFrame) )) + if( SfxViewFrame::GetFirst( pShell ) ) { if( sRet.Len() ) sRet += '\t'; diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index abada7ed11..1890e627ec 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -89,7 +89,7 @@ #include #include #include -#include +#include #include "openflag.hxx" #include #include diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index f9af1c5add..a2c3e09e19 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -104,7 +104,7 @@ #include "sfxresid.hxx" #include #include "app.hrc" -#include +#include #include #include #include @@ -196,7 +196,7 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded // Vergleiche anhand der URLs INetURLObject aUrl( xDoc->GetMedium()->GetName() ); if ( !aUrl.HasError() && aUrl == aUrlToFind && - (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, 0, TRUE )) && + (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, TRUE )) && !xDoc->IsLoading()) { break; @@ -213,12 +213,10 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded DBG_ASSERT( !bForbidVisible, "Unsichtbares kann nicht aktiviert werden" ); - SfxTopViewFrame *pFrame; - for( pFrame = (SfxTopViewFrame*) - SfxViewFrame::GetFirst( xDoc, TYPE(SfxTopViewFrame) ); + SfxViewFrame* pFrame; + for( pFrame = SfxViewFrame::GetFirst( xDoc ); pFrame && !pFrame->IsVisible_Impl(); - pFrame = (SfxTopViewFrame*) - SfxViewFrame::GetNext( *pFrame, xDoc, TYPE(SfxTopViewFrame) ) ) ; + pFrame = SfxViewFrame::GetNext( *pFrame, xDoc ) ) ; if ( pFrame ) { SfxViewFrame *pCur = SfxViewFrame::Current(); diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index 3eefd9db5e..a436f592b2 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -46,7 +46,7 @@ #include "stbitem.hxx" #include #include -#include +#include #include "partwnd.hxx" #include #include "recfloat.hxx" @@ -62,7 +62,6 @@ void SfxApplication::Registrations_Impl() SfxApplication::RegisterInterface(); SfxModule::RegisterInterface(); SfxViewFrame::RegisterInterface(); - SfxTopViewFrame::RegisterInterface(); SfxObjectShell::RegisterInterface(); SfxViewShell::RegisterInterface(); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 8366ef82a8..fcf06615da 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -131,7 +131,7 @@ #include "minfitem.hxx" #include #include -#include +#include #include "sfxpicklist.hxx" #include "imestatuswindow.hxx" #include diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index b96a5e7d03..7b03f615fc 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -449,7 +449,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) return; // ignore hidden documents - if ( !SfxViewFrame::GetFirst( pDocSh, 0, TRUE ) ) + if ( !SfxViewFrame::GetFirst( pDocSh, TRUE ) ) return; ::rtl::OUString aTitle = pDocSh->GetTitle(SFX_TITLE_PICKLIST); diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 5e2bb23e93..6cce817694 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -41,7 +41,7 @@ #include #include #include "workwin.hxx" -#include +#include #include "arrdecl.hxx" #include #include diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 9f944e01b4..f502c4a9a6 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -127,7 +127,7 @@ using namespace ::vos; #include #include #include -#include +#include #include "helper.hxx" #include "fltlst.hxx" #include diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 0e071def45..5a525884e5 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -71,7 +71,7 @@ #include #include #include -#include +#include #include #include @@ -2349,7 +2349,7 @@ SystemWindow* SfxBindings::GetSystemWindow() const SfxViewFrame *pFrame = pDispatcher->GetFrame(); while ( pFrame->GetParentViewFrame_Impl() ) pFrame = pFrame->GetParentViewFrame_Impl(); - SfxTopViewFrame* pTop = PTR_CAST( SfxTopViewFrame, pFrame->GetTopViewFrame() ); + SfxViewFrame* pTop = pFrame->GetTopViewFrame(); return pTop->GetFrame()->GetTopWindow_Impl(); } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 12da99dba8..66da60e7e2 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -79,7 +79,7 @@ #include #include #include -#include +#include #include #include #include @@ -1676,7 +1676,7 @@ void SfxDispatcher::SetMenu_Impl() { if ( pImp->pFrame ) { - SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ); + SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame(); if ( pTop && pTop->GetBindings().GetDispatcher() == this ) { SfxFrame* pFrm = pTop->GetFrame(); @@ -1732,7 +1732,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce ) if ( !bUpdate || pImp->pFrame->GetFrame()->IsClosing_Impl() ) return 0; - SfxTopViewFrame* pTop = pImp->pFrame ? PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ) : NULL; + SfxViewFrame* pTop = pImp->pFrame ? pImp->pFrame->GetTopViewFrame() : NULL; sal_Bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this; if ( !bUIActive && pTop && GetBindings() == &pTop->GetBindings() ) @@ -2911,7 +2911,7 @@ void SfxDispatcher::HideUI( sal_Bool bHide ) pImp->bNoUI = bHide; if ( pImp->pFrame ) { - SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ); + SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame(); if ( pTop && pTop->GetBindings().GetDispatcher() == this ) { SfxFrame* pFrm = pTop->GetFrame(); @@ -3160,27 +3160,6 @@ void SfxDispatcher::InvalidateBindings_Impl( sal_Bool bModify ) pFrame; pFrame = SfxViewFrame::GetNext( *pFrame ) ) pFrame->GetBindings().InvalidateAll(bModify); -/* - // alle Bindings sind betroffen - for ( SfxInPlaceFrame *pIPFrame = (SfxInPlaceFrame*) - SfxViewFrame::GetFirst(0, TYPE(SfxInPlaceFrame)); - pIPFrame; - pIPFrame = (SfxInPlaceFrame*) - SfxViewFrame::GetNext(*pIPFrame, 0, TYPE(SfxInPlaceFrame)) ) - pIPFrame->GetBindings().InvalidateAll(bModify); - - for ( SfxPlugInFrame *pPIFrame = (SfxPlugInFrame*) - SfxViewFrame::GetFirst(0, TYPE(SfxPlugInFrame)); - pPIFrame; - pPIFrame = (SfxPlugInFrame*) - SfxViewFrame::GetNext(*pPIFrame, 0, TYPE(SfxPlugInFrame)) ) - pPIFrame->GetBindings().InvalidateAll(bModify); - - for ( SfxTask* pTask = SfxTask::GetFirst(); pTask; - pTask = SfxTask::GetNext( *pTask ) ) - if ( !pTask->IsExternal() ) - pTask->GetBindings()->InvalidateAll(bModify); -*/ } else { diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 7b30345ff8..99396d6307 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -76,7 +76,7 @@ #include "sfxhelp.hxx" #include #include -#include +#include #include "basmgr.hxx" #include #include "doc.hrc" diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 8cf35d3533..96f60fefb9 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -88,7 +88,7 @@ #include "sfxtypes.hxx" //#include "interno.hxx" #include -#include +#include #include "versdlg.hxx" #include "doc.hrc" #include @@ -140,8 +140,6 @@ public: #define SfxObjectShell #include "sfxslots.hxx" -svtools::AsynchronLink* pPendingCloser = 0; - //========================================================================= @@ -283,7 +281,7 @@ void SfxObjectShell::PrintExec_Impl(SfxRequest &rReq) void SfxObjectShell::PrintState_Impl(SfxItemSet &rSet) { bool bPrinting = false; - SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame)); + SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); if ( pFrame ) { SfxPrinter *pPrinter = pFrame->GetViewShell()->GetPrinter(); @@ -1218,8 +1216,7 @@ void SfxObjectShell::ExecView_Impl(SfxRequest &rReq) { case SID_ACTIVATE: { - SfxViewFrame *pFrame = - SfxViewFrame::GetFirst( this, TYPE(SfxTopViewFrame), TRUE ); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, TRUE ); if ( pFrame ) pFrame->GetFrame()->Appear(); rReq.SetReturnValue( SfxObjectItem( 0, pFrame ) ); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 3bcbd5c4b3..97450f6fc5 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -134,7 +134,6 @@ DBG_NAME(SfxObjectShell) #define DocumentInfo #include "sfxslots.hxx" -extern svtools::AsynchronLink* pPendingCloser; static WeakReference< XInterface > s_xCurrentComponent; //========================================================================= @@ -251,7 +250,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,pFrame( 0 ) ,pTbxConfig( 0 ) ,eFlags( SFXOBJECTSHELL_UNDEFINED ) - ,pCloser( 0 ) ,bReadOnlyUI( sal_False ) ,bHiddenLockedByAPI( sal_False ) ,bInCloseEvent( sal_False ) @@ -271,9 +269,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) SfxObjectShell_Impl::~SfxObjectShell_Impl() { - if ( pPendingCloser == pCloser ) - pPendingCloser = 0; - delete pCloser; delete pBasicManager; } @@ -489,7 +484,7 @@ SfxObjectShell* SfxObjectShell::GetFirst continue; if ( ( !pType || pSh->IsA(*pType) ) && - ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True ))) + ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True ))) return pSh; } @@ -522,7 +517,7 @@ SfxObjectShell* SfxObjectShell::GetNext continue; if ( ( !pType || pSh->IsA(*pType) ) && - ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True ))) + ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True ))) return pSh; } return 0; @@ -566,8 +561,7 @@ sal_uInt16 SfxObjectShell::PrepareClose return sal_False; // prepare views for closing - for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst( - this, TYPE(SfxViewFrame)); + for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this ); pFrm; pFrm = SfxViewFrame::GetNext( *pFrm, this ) ) { DBG_ASSERT(pFrm->GetViewShell(),"KeineShell"); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index ca0e28d322..43fc9f1fba 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -269,7 +269,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro // Printer beschaffen SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? - SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0; + SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0; if ( !pViewFrm ) return uno::Sequence< beans::PropertyValue >(); @@ -320,7 +320,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > { // alten Printer beschaffen SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? - SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0; + SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0; if ( !pViewFrm ) return; @@ -583,7 +583,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // get view for sfx printing capabilities SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? - SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0; + SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0; if ( !pViewFrm ) return; SfxViewShell* pView = pViewFrm->GetViewShell(); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 5e95cfb048..739a72272d 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -118,7 +118,7 @@ #include #include #include -#include +#include #include "appdata.hxx" #include #include @@ -361,8 +361,10 @@ SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell* pObjectShell ) if ( !pObjectShell ) return; - for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pObjectShell, TYPE(SfxTopViewFrame) ); pFrame; - pFrame = SfxViewFrame::GetNext(*pFrame, pObjectShell, TYPE(SfxTopViewFrame) ) ) + for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pObjectShell ); + pFrame; + pFrame = SfxViewFrame::GetNext( *pFrame, pObjectShell ) + ) { SfxFrame* pSfxFrame = pFrame->GetFrame(); if ( pSfxFrame ) @@ -2937,7 +2939,7 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() { SfxViewFrame *pActFrame = SfxViewFrame::Current(); if ( !pActFrame || pActFrame->GetObjectShell() != m_pData->m_pObjectShell ) - pActFrame = SfxViewFrame::GetFirst(m_pData->m_pObjectShell, TYPE(SfxTopViewFrame)); + pActFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell ); if ( !pActFrame || !pActFrame->GetViewShell() ) // currently no frame for this document at all or View is under construction @@ -2958,8 +2960,8 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() sal_Int32 nCount = 0; uno::Sequence < beans::PropertyValue > aSeq; ::com::sun::star::uno::Any aAny; - for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(m_pData->m_pObjectShell, TYPE(SfxTopViewFrame) ); pFrame; - pFrame = SfxViewFrame::GetNext(*pFrame, m_pData->m_pObjectShell, TYPE(SfxTopViewFrame) ) ) + for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell ); pFrame; + pFrame = SfxViewFrame::GetNext( *pFrame, m_pData->m_pObjectShell ) ) { BOOL bIsActive = ( pFrame == pActFrame ); pFrame->GetViewShell()->WriteUserDataSequence( aSeq ); @@ -3391,7 +3393,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz if ( !m_pData->m_pObjectShell.Is() ) throw uno::Exception(); // TODO: error handling - SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ); + SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ); if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame()->IsInPlace() ) { Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame()->GetFrameInterface()->getContainerWindow() ); diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index e9380b0010..bb18ca9ee4 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -143,7 +143,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess SfxFrame* pFrame; SfxToolBoxConfig* pTbxConfig; SfxObjectShellFlags eFlags; - svtools::AsynchronLink* pCloser; String aBaseURL; sal_Bool bReadOnlyUI; SvRefBaseRef xHeaderAttributes; diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 53a5b658dc..b076369a51 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -80,7 +80,7 @@ #include #include "impframe.hxx" #include -#include +#include #include "workwin.hxx" #include #include diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx new file mode 100644 index 0000000000..ce170b3c48 --- /dev/null +++ b/sfx2/source/view/impviewframe.hxx @@ -0,0 +1,87 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef SFX2_IMPVIEWFRAME_HXX +#define SFX2_IMPVIEWFRAME_HXX + +struct SfxViewFrame_Impl +{ + SvBorder aBorder; + Size aMargin; + Size aSize; + String aFrameTitle; + TypeId aLastType; + String aActualURL; + SfxFrame* pFrame; + svtools::AsynchronLink* pReloader; + Window* pWindow; + SfxViewFrame* pActiveChild; + Window* pFocusWin; + sal_uInt16 nDocViewNo; + sal_uInt16 nCurViewId; + sal_Bool bResizeInToOut:1; + sal_Bool bDontOverwriteResizeInToOut:1; + sal_Bool bObjLocked:1; + sal_Bool bReloading:1; + sal_Bool bIsDowning:1; + sal_Bool bInCtor:1; + sal_Bool bModal:1; + sal_Bool bEnabled:1; + sal_Bool bWindowWasEnabled:1; + sal_Bool bActive; + String aFactoryName; + + SfxViewFrame_Impl() + : pReloader(0 ) + , pWindow( 0 ) + , bWindowWasEnabled(sal_True) + , bActive( sal_False ) + {} + + ~SfxViewFrame_Impl() + { + delete pReloader; + } +}; + +class SfxTopViewWin_Impl : public Window +{ + BOOL bActive; + SfxViewFrame* pFrame; + +public: + SfxTopViewWin_Impl( SfxViewFrame* p, Window& rParent, WinBits nBits=0 ) : + Window( &rParent, nBits | WB_BORDER | WB_CLIPCHILDREN ), + bActive( FALSE ), + pFrame( p ) + { + p->GetFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + } + + virtual void Resize(); + virtual void StateChanged( StateChangedType nStateChange ); +}; + +#endif SFX2_IMPVIEWFRAME_HXX diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index b9de954a1e..663c182fee 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -60,7 +60,7 @@ #include #include "workwin.hxx" #include "guisaveas.hxx" -#include +#include #include #include #include diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index e6419cd9ce..af2ca6847e 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -33,7 +33,7 @@ #ifndef GCC #endif -#include +#include #include #include #include @@ -99,6 +99,7 @@ #include "statcach.hxx" #include #include "impframe.hxx" +#include "impviewframe.hxx" using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -110,11 +111,6 @@ using ::com::sun::star::document::XViewDataSupplier; //------------------------------------------------------------------------ -#define SfxTopViewFrame -#include "sfxslots.hxx" - -DBG_NAME(SfxTopViewFrame) - #include static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService ) { @@ -298,27 +294,6 @@ void SfxTopWindow_Impl::DoResize() pFrame->Resize(); } -class SfxTopViewWin_Impl : public Window -{ -friend class SfxInternalFrame; - - BOOL bActive; - SfxTopViewFrame* pFrame; - -public: - SfxTopViewWin_Impl( SfxTopViewFrame* p, - Window *pParent, WinBits nBits=0 ) : - Window( pParent, nBits | WB_BORDER | WB_CLIPCHILDREN ), - bActive( FALSE ), - pFrame( p ) - { - p->GetFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - } - - virtual void Resize(); - virtual void StateChanged( StateChangedType nStateChange ); -}; - //-------------------------------------------------------------------- void SfxTopViewWin_Impl::StateChanged( StateChangedType nStateChange ) { @@ -343,18 +318,11 @@ void SfxTopViewWin_Impl::Resize() class SfxTopViewFrame_Impl { public: - sal_Bool bActive; - Window* pWindow; - String aFactoryName; SfxTopViewFrame_Impl() - : bActive( sal_False ) - , pWindow( 0 ) {} }; -static svtools::AsynchronLink* pPendingCloser = 0; - static String _getTabString() { String result; @@ -808,10 +776,10 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) if ( nPluginMode && ( nPluginMode != 2 ) ) SetInPlace_Impl( TRUE ); - SfxViewFrame* pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId ); + SfxViewFrame* pViewFrame = new SfxViewFrame( this, &rDoc, nViewId ); if ( !pViewFrame->GetViewShell() ) { - OSL_ENSURE( false, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxTopViewFrame!" ); + OSL_ENSURE( false, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); pViewFrame->DoClose(); return sal_False; } @@ -931,19 +899,12 @@ long SfxViewFrameClose_Impl( void* /*pObj*/, void* pArg ) return 0; } -TYPEINIT1(SfxTopViewFrame, SfxViewFrame); - //-------------------------------------------------------------------- -SFX_IMPL_INTERFACE(SfxTopViewFrame,SfxViewFrame,SfxResId(0)) -{ -} - -//-------------------------------------------------------------------- -String SfxTopViewFrame::UpdateTitle() +String SfxViewFrame::UpdateTitle() /* [Beschreibung] - Mit dieser Methode kann der SfxTopViewFrame gezwungen werden, sich sofort + Mit dieser Methode kann der SfxViewFrame gezwungen werden, sich sofort den neuen Titel vom der zu besorgen. [Anmerkung] @@ -964,11 +925,9 @@ String SfxTopViewFrame::UpdateTitle() switch( ( (SfxSimpleHint&) rHint ).GetId() ) { case SFX_HINT_TITLECHANGED: - for ( SfxTopViewFrame *pTop = (SfxTopViewFrame*) - SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame)); + for ( SfxViewFrame *pTop = SfxViewFrame::GetFirst( this ); pTop; - pTop = (SfxTopViewFrame*) - SfxViewFrame::GetNext(this, TYPE(SfxTopViewFrame)); + pTop = SfxViewFrame::GetNext( this ); { pTop->UpdateTitle(); ... pTop->GetName() ... @@ -981,12 +940,61 @@ String SfxTopViewFrame::UpdateTitle() */ { - DBG_CHKTHIS(SfxTopViewFrame, 0); + DBG_CHKTHIS(SfxViewFrame, 0); const SfxObjectFactory &rFact = GetObjectShell()->GetFactory(); pImp->aFactoryName = String::CreateFromAscii( rFact.GetShortName() ); - String aTitle = SfxViewFrame::UpdateTitle(); + SfxObjectShell *pObjSh = GetObjectShell(); + if ( !pObjSh ) + return String(); + +// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) +// // kein UpdateTitle mit Embedded-ObjectShell +// return String(); + + const SfxMedium *pMedium = pObjSh->GetMedium(); + String aURL; + GetFrame(); // -Wall required?? + if ( pObjSh->HasName() ) + { + INetURLObject aTmp( pMedium->GetName() ); + aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + } + + if ( aURL != pImp->aActualURL ) + // URL hat sich ge"andert + pImp->aActualURL = aURL; + + // gibt es noch eine weitere View? + sal_uInt16 nViews=0; + for ( SfxViewFrame *pView= GetFirst(pObjSh); + pView && nViews<2; + pView = GetNext(*pView,pObjSh) ) + if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) && + !IsDowning_Impl()) + nViews++; + + // Titel des Fensters + String aTitle; + if ( nViews == 2 || pImp->nDocViewNo > 1 ) + // dann die Nummer dranh"angen + aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo ); + else + aTitle = pObjSh->UpdateTitle(); + + // Name des SbxObjects + String aSbxName = pObjSh->SfxShell::GetName(); + if ( IsVisible_Impl() ) + { + aSbxName += ':'; + aSbxName += String::CreateFromInt32(pImp->nDocViewNo); + } + + SetName( aSbxName ); + pImp->aFrameTitle = aTitle; + GetBindings().Invalidate( SID_FRAMETITLE ); + GetBindings().Invalidate( SID_CURRENT_URL ); ::rtl::OUString aProductName; ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName; @@ -1017,200 +1025,7 @@ String SfxTopViewFrame::UpdateTitle() return aTitle; } -//-------------------------------------------------------------------- -void SfxTopViewFrame::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) -{ - {DBG_CHKTHIS(SfxTopViewFrame, 0);} - - if( IsDowning_Impl()) - return; - - // we know only SimpleHints - if ( rHint.IsA(TYPE(SfxSimpleHint)) ) - { - switch( ( (SfxSimpleHint&) rHint ).GetId() ) - { - case SFX_HINT_MODECHANGED: - case SFX_HINT_TITLECHANGED: - // when the document changes its title, change views too - UpdateTitle(); - break; - - case SFX_HINT_DEINITIALIZING: - // on all other changes force repaint - GetFrame()->DoClose(); - return; - } - } - - SfxViewFrame::Notify( rBC, rHint ); -} - -//-------------------------------------------------------------------- -sal_Bool SfxTopViewFrame::Close() -{ - {DBG_CHKTHIS(SfxTopViewFrame, 0);} - - // Modaler Dialog oben ?? -// if ( pImp->GetModalDialog() ) -// return sal_False; - - // eigentliches Schlie\sen - if ( SfxViewFrame::Close() ) - { - if (SfxViewFrame::Current() == this) - SfxViewFrame::SetViewFrame(0); - - // Da der Dispatcher leer ger"aumt wird, kann man ihn auch nicht mehr - // vern"unftig verwenden - also besser still legen - GetDispatcher()->Lock(sal_True); - delete this; - - return sal_True; - } - - return sal_False; -} - -SfxTopViewFrame::SfxTopViewFrame -( - SfxFrame* pFrame, - SfxObjectShell* pObjShell, - sal_uInt16 nViewId -) - -/* [Beschreibung] - - Ctor des SfxTopViewFrame f"ur eine aus der Ressource. - Die 'nViewId' der zu erzeugenden kann angegeben werden - (default ist die zuerst registrierte SfxViewShell-Subklasse). -*/ - - : SfxViewFrame( *(new SfxBindings), pFrame, pObjShell, SFXFRAME_HASTITLE ) -{ - DBG_CTOR(SfxTopViewFrame, 0); - - pCloser = 0; - pImp = new SfxTopViewFrame_Impl; - -//(mba)/task if ( !pFrame->GetTask() ) - { - pImp->pWindow = new SfxTopViewWin_Impl( this, &pFrame->GetWindow() ); - pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() ); - SetWindow_Impl( pImp->pWindow ); - pFrame->SetOwnsBindings_Impl( sal_True ); - pFrame->CreateWorkWindow_Impl(); - } - - sal_uInt32 nType = SFXFRAME_OWNSDOCUMENT | SFXFRAME_HASTITLE; - if ( pObjShell && pObjShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) - nType |= SFXFRAME_EXTERNAL; - GetFrame()->SetFrameType_Impl( GetFrame()->GetFrameType() | nType ); - - if ( GetFrame()->IsInPlace() ) - { - LockAdjustPosSizePixel(); - } - - if ( pObjShell && !SwitchToViewShell_Impl( nViewId ) ) - { - // TODO: better error handling? Under which conditions can this fail? - return; - } - - if ( GetFrame()->IsInPlace() ) - { - UnlockAdjustPosSizePixel(); - } - else if ( GetViewShell() && GetViewShell()->UseObjectSize() ) - { - // initiale Gr"o\se festlegen - // Zuerst die logischen Koordinaten von IP-Objekt und EditWindow - // ber"ucksichtigen - LockAdjustPosSizePixel(); - ForceInnerResize_Impl( TRUE ); - - Window *pWindow = GetViewShell()->GetWindow(); - - // Da in den Applikationen bei der R"ucktransformation immer die - // Eckpunkte tranformiert werden und nicht die Size (um die Ecken - // alignen zu k"onnen), transformieren wir hier auch die Punkte, um - // m"oglichst wenig Rundungsfehler zu erhalten. -/* - Rectangle aRect = pWindow->LogicToLogic( GetObjectShell()->GetVisArea(), - GetObjectShell()->GetMapUnit(), - pWindow->GetMapMode() ); -*/ - Rectangle aRect = pWindow->LogicToPixel( GetObjectShell()->GetVisArea() ); - Size aSize = aRect.GetSize(); - GetViewShell()->GetWindow()->SetSizePixel( aSize ); - DoAdjustPosSizePixel(GetViewShell(), Point(), aSize ); - } -} - -//------------------------------------------------------------------------ -SfxTopViewFrame::~SfxTopViewFrame() -{ - DBG_DTOR(SfxTopViewFrame, 0); - - SetDowning_Impl(); - - if ( SfxViewFrame::Current() == this ) - SfxViewFrame::SetViewFrame(NULL); - - ReleaseObjectShell_Impl(); - if ( pPendingCloser == pCloser ) - pPendingCloser = 0; - delete pCloser; - if ( GetFrame()->OwnsBindings_Impl() ) - // Die Bindings l"oscht der Frame! - KillDispatcher_Impl(); - - delete pImp->pWindow; - delete pImp; -} - -//------------------------------------------------------------------------ -sal_Bool SfxTopViewFrame::SetBorderPixelImpl( const SfxViewShell *pVSh, const SvBorder &rBorder ) -{ - if( SfxViewFrame::SetBorderPixelImpl( GetViewShell(), rBorder ) ) - { - if ( IsResizeInToOut_Impl() && !GetFrame()->IsInPlace() ) - { - Size aSize = pVSh->GetWindow()->GetOutputSizePixel(); - if ( aSize.Width() && aSize.Height() ) - { - aSize.Width() += rBorder.Left() + rBorder.Right(); - aSize.Height() += rBorder.Top() + rBorder.Bottom(); - - Size aOldSize = GetWindow().GetOutputSizePixel(); - GetWindow().SetOutputSizePixel( aSize ); - Window* pParent = &GetWindow(); - while ( pParent->GetParent() ) - pParent = pParent->GetParent(); - Size aOuterSize = pParent->GetOutputSizePixel(); - aOuterSize.Width() += ( aSize.Width() - aOldSize.Width() ); - aOuterSize.Height() += ( aSize.Height() - aOldSize.Height() ); - pParent->SetOutputSizePixel( aOuterSize ); - } - } - else - { - Point aPoint; - Rectangle aEditArea( aPoint, GetWindow().GetOutputSizePixel() ); - aEditArea.Left() += rBorder.Left(); - aEditArea.Right() -= rBorder.Right(); - aEditArea.Top() += rBorder.Top(); - aEditArea.Bottom() -= rBorder.Bottom(); - pVSh->GetWindow()->SetPosSizePixel( aEditArea.TopLeft(), aEditArea.GetSize() ); - } - return sal_True; - - } - return sal_False; -} - -void SfxTopViewFrame::Exec_Impl(SfxRequest &rReq ) +void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) { // Wenn gerade die Shells ausgetauscht werden... if ( !GetObjectShell() || !GetViewShell() ) @@ -1304,10 +1119,9 @@ void SfxTopViewFrame::Exec_Impl(SfxRequest &rReq ) // weitere Views auf dasselbe Doc? SfxObjectShell *pDocSh = GetObjectShell(); int bOther = sal_False; - for ( const SfxTopViewFrame *pFrame = - (SfxTopViewFrame *)SfxViewFrame::GetFirst( pDocSh, TYPE(SfxTopViewFrame) ); + for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh ); !bOther && pFrame; - pFrame = (SfxTopViewFrame *)SfxViewFrame::GetNext( *pFrame, pDocSh, TYPE(SfxTopViewFrame) ) ) + pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) ) bOther = (pFrame != this); // Doc braucht nur gefragt zu werden, wenn keine weitere View @@ -1339,7 +1153,7 @@ void SfxTopViewFrame::Exec_Impl(SfxRequest &rReq ) rReq.Done(); } -void SfxTopViewFrame::GetState_Impl( SfxItemSet &rSet ) +void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) { SfxObjectShell *pDocSh = GetObjectShell(); @@ -1388,6 +1202,17 @@ void SfxTopViewFrame::GetState_Impl( SfxItemSet &rSet ) break; } + case SID_OBJECT: + if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() ) + { + uno::Any aAny; + aAny <<= GetViewShell()->GetVerbs(); + rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) ); + } + else + rSet.DisableItem( SID_OBJECT ); + break; + default: DBG_ERROR( "invalid message-id" ); } @@ -1396,14 +1221,14 @@ void SfxTopViewFrame::GetState_Impl( SfxItemSet &rSet ) } } -void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest ) +void SfxViewFrame::INetExecute_Impl( SfxRequest &rRequest ) { sal_uInt16 nSlotId = rRequest.GetSlot(); switch( nSlotId ) { case SID_BROWSE_FORWARD: case SID_BROWSE_BACKWARD: - OSL_ENSURE( false, "SfxTopViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" ); + OSL_ENSURE( false, "SfxViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" ); break; case SID_CREATELINK: { @@ -1430,7 +1255,7 @@ void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest ) rRequest.Done(); } -void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet ) +void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet ) { rItemSet.DisableItem( SID_BROWSE_FORWARD ); rItemSet.DisableItem( SID_BROWSE_BACKWARD ); @@ -1443,12 +1268,12 @@ void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet ) rItemSet.DisableItem( SID_CREATELINK ); } -void SfxTopViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ) +void SfxViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ) { GetViewShell()->SetZoomFactor( rZoomX, rZoomY ); } -void SfxTopViewFrame::Activate( sal_Bool bMDI ) +void SfxViewFrame::Activate( sal_Bool bMDI ) { DBG_ASSERT(GetViewShell(), "Keine Shell"); if ( bMDI ) @@ -1456,7 +1281,7 @@ void SfxTopViewFrame::Activate( sal_Bool bMDI ) //(mba): hier evtl. wie in Beanframe NotifyEvent ?! } -void SfxTopViewFrame::Deactivate( sal_Bool bMDI ) +void SfxViewFrame::Deactivate( sal_Bool bMDI ) { DBG_ASSERT(GetViewShell(), "Keine Shell"); if ( bMDI ) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 506aac04ff..4fcc96ea6f 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -131,7 +131,7 @@ namespace css = ::com::sun::star; #include #include #include -#include +#include #include "viewimp.hxx" #include #include @@ -144,11 +144,14 @@ namespace css = ::com::sun::star; #include "macro.hxx" #include "minfitem.hxx" #include "../appl/app.hrc" +#include "impviewframe.hxx" + //------------------------------------------------------------------------- DBG_NAME(SfxViewFrame) #define SfxViewFrame #include "sfxslots.hxx" +#undef SfxViewFrame //------------------------------------------------------------------------- @@ -166,43 +169,6 @@ TYPEINIT1(SfxViewFrameItem, SfxPoolItem); //========================================================================= -struct SfxViewFrame_Impl -{ - SvBorder aBorder; - Size aMargin; - Size aSize; - String aFrameTitle; - TypeId aLastType; - String aActualURL; - SfxFrame* pFrame; - svtools::AsynchronLink* pReloader; - //SfxInPlaceFrame* pIPFrame; - Window* pWindow; - SfxViewFrame* pActiveChild; - Window* pFocusWin; - sal_uInt16 nDocViewNo; - sal_uInt16 nCurViewId; - sal_Bool bResizeInToOut:1; - sal_Bool bDontOverwriteResizeInToOut:1; - sal_Bool bObjLocked:1; - sal_Bool bReloading:1; - sal_Bool bIsDowning:1; - sal_Bool bInCtor:1; - sal_Bool bModal:1; - sal_Bool bEnabled:1; - sal_Bool bWindowWasEnabled:1; - - SfxViewFrame_Impl() - : pReloader(0 ) - , bWindowWasEnabled(sal_True) - {} - - ~SfxViewFrame_Impl() - { - delete pReloader; - } -}; - //------------------------------------------------------------------------- void SfxViewFrame::SetDowning_Impl() { @@ -618,7 +584,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) OSL_ENSURE( xFrame.is(), "SfxViewFrame::ExecReload_Impl: no XFrame?!" ); aViewFrames.push_back( ViewDescriptor( xFrame, pView->GetCurViewId() ) ); - pView = (SfxTopViewFrame*)GetNext( *pView, xOldObj, TYPE( SfxTopViewFrame ) ); + pView = GetNext( *pView, xOldObj ); } DELETEZ( xOldObj->Get_Impl()->pReloadTimer ); @@ -1128,104 +1094,6 @@ void SfxViewFrame::ReleaseObjectShell_Impl() GetDispatcher()->SetDisableFlags( 0 ); } -//------------------------------------------------------------------------- - -String SfxViewFrame::UpdateTitle() - -/* [Beschreibung] - - Mit dieser Methode kann der SfxMDIFrame gezwungen werden, sich sofort - den neuen Titel vom der zu besorgen. - - [Anmerkung] - - Dies ist z.B. dann notwendig, wenn man der SfxObjectShell als SfxListener - zuh"ort und dort auf den SFX_HINT_TITLECHANGED reagieren - m"ochte, um dann die Titel seiner Views abzufragen. Diese Views (SfxMDIFrames) - jedoch sind ebenfalls SfxListener und da die Reihenfolge der Benachrichtigung - nicht feststeht, mu\s deren Titel-Update vorab erzwungen werden. - - - [Beispiel] - - void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) - { - if ( rHint.IsA(TYPE(SfxSimpleHint)) ) - { - switch( ( (SfxSimpleHint&) rHint ).GetId() ) - { - case SFX_HINT_TITLECHANGED: - for ( SfxMDIFrame *pMDI = (SfxMDIFrame*) - SfxViewFrame::GetFirst(this, TYPE(SfxMDIFrame)); - pMDI; - pMDI = (SfxMDIFrame*) - SfxViewFrame::GetNext(this, TYPE(SfxMDIFrame)); - { - pMDI->UpdateTitle(); - ... pMDI->GetName() ... - } - break; - ... - } - } - } -*/ - -{ - SfxObjectShell *pObjSh = GetObjectShell(); - if ( !pObjSh ) - return String(); - -// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) -// // kein UpdateTitle mit Embedded-ObjectShell -// return String(); - - const SfxMedium *pMedium = pObjSh->GetMedium(); - String aURL; - GetFrame(); // -Wall required?? - if ( pObjSh->HasName() ) - { - INetURLObject aTmp( pMedium->GetName() ); - aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); - } - - if ( aURL != pImp->aActualURL ) - // URL hat sich ge"andert - pImp->aActualURL = aURL; - - // gibt es noch eine weitere View? - sal_uInt16 nViews=0; - for ( SfxViewFrame *pView= GetFirst(pObjSh); - pView && nViews<2; - pView = GetNext(*pView,pObjSh) ) - if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) && - !IsDowning_Impl()) - nViews++; - - // Titel des Fensters - String aTitle; - if ( nViews == 2 || pImp->nDocViewNo > 1 ) - // dann die Nummer dranh"angen - aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo ); - else - aTitle = pObjSh->UpdateTitle(); - - // Name des SbxObjects - String aSbxName = pObjSh->SfxShell::GetName(); - if ( IsVisible_Impl() ) - { - aSbxName += ':'; - aSbxName += String::CreateFromInt32(pImp->nDocViewNo); - } - - SetName( aSbxName ); - pImp->aFrameTitle = aTitle; - GetBindings().Invalidate( SID_FRAMETITLE ); - GetBindings().Invalidate( SID_CURRENT_URL ); - return aTitle; -} - - //-------------------------------------------------------------------- sal_Bool SfxViewFrame::Close() { @@ -1237,7 +1105,15 @@ sal_Bool SfxViewFrame::Close() // auch nicht mehr automatisch gespeichert werden! if ( GetViewShell() ) GetViewShell()->DiscardClients_Impl(); - Broadcast( SfxSimpleHint(SFX_HINT_DYING) ); + Broadcast( SfxSimpleHint( SFX_HINT_DYING ) ); + + if (SfxViewFrame::Current() == this) + SfxViewFrame::SetViewFrame( NULL ); + + // Da der Dispatcher leer ger"aumt wird, kann man ihn auch nicht mehr + // vern"unftig verwenden - also besser still legen + GetDispatcher()->Lock(sal_True); + delete this; return sal_True; } @@ -1366,12 +1242,43 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh ) //------------------------------------------------------------------------ sal_Bool SfxViewFrame::SetBorderPixelImpl ( - const SfxViewShell* /*pSh*/, + const SfxViewShell* pVSh, const SvBorder& rBorder ) { pImp->aBorder = rBorder; + + if ( IsResizeInToOut_Impl() && !GetFrame()->IsInPlace() ) + { + Size aSize = pVSh->GetWindow()->GetOutputSizePixel(); + if ( aSize.Width() && aSize.Height() ) + { + aSize.Width() += rBorder.Left() + rBorder.Right(); + aSize.Height() += rBorder.Top() + rBorder.Bottom(); + + Size aOldSize = GetWindow().GetOutputSizePixel(); + GetWindow().SetOutputSizePixel( aSize ); + Window* pParent = &GetWindow(); + while ( pParent->GetParent() ) + pParent = pParent->GetParent(); + Size aOuterSize = pParent->GetOutputSizePixel(); + aOuterSize.Width() += ( aSize.Width() - aOldSize.Width() ); + aOuterSize.Height() += ( aSize.Height() - aOldSize.Height() ); + pParent->SetOutputSizePixel( aOuterSize ); + } + } + else + { + Point aPoint; + Rectangle aEditArea( aPoint, GetWindow().GetOutputSizePixel() ); + aEditArea.Left() += rBorder.Left(); + aEditArea.Right() -= rBorder.Right(); + aEditArea.Top() += rBorder.Top(); + aEditArea.Bottom() -= rBorder.Bottom(); + pVSh->GetWindow()->SetPosSizePixel( aEditArea.TopLeft(), aEditArea.GetSize() ); + } + return sal_True; } @@ -1389,15 +1296,22 @@ const SvBorder& SfxViewFrame::GetBorderPixelImpl void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { {DBG_CHKTHIS(SfxViewFrame, 0);} - if ( !xObjSh.Is() ) + + if( IsDowning_Impl()) return; + // we know only SimpleHints if ( rHint.IsA(TYPE(SfxSimpleHint)) ) { switch( ( (SfxSimpleHint&) rHint ).GetId() ) { case SFX_HINT_MODECHANGED: { + UpdateTitle(); + + if ( !xObjSh.Is() ) + break; + // r/o Umschaltung? SfxBindings& rBind = GetBindings(); rBind.Invalidate( SID_RELOAD ); @@ -1442,10 +1356,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) case SFX_HINT_DYING: case SFX_HINT_DEINITIALIZING: // when the Object is being deleted, destroy the view too + GetFrame()->DoClose(); if ( xObjSh.Is() ) ReleaseObjectShell_Impl(); - else - GetFrame()->DoClose(); break; } @@ -1470,6 +1383,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) case SFX_EVENT_OPENDOC: case SFX_EVENT_CREATEDOC: { + if ( !xObjSh.Is() ) + break; + SfxBindings& rBind = GetBindings(); rBind.Invalidate( SID_RELOAD ); rBind.Invalidate( SID_EDITDOC ); @@ -1556,53 +1472,84 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) pImp->bInCtor = sal_False; } -//------------------------------------------------------------------------ -SfxViewFrame::SfxViewFrame( SfxObjectShell &rObjShell, SfxBindings &rBindings, - SfxFrame* pParent, sal_uInt32 nType ) -: - pImp( new SfxViewFrame_Impl ), - pDispatcher(0), - pBindings(&rBindings), - nAdjustPosPixelLock( 0 ) -{ - DBG_CTOR(SfxViewFrame, 0); - - SetFrame_Impl( pParent ); - pImp->pFrame->SetCurrentViewFrame_Impl( this ); - GetFrame()->SetFrameType_Impl( GetFrameType() | nType ); - Construct_Impl( &rObjShell ); -} +SfxViewFrame::SfxViewFrame +( + SfxFrame* pFrame, + SfxObjectShell* pObjShell, + sal_uInt16 nViewId +) -//------------------------------------------------------------------------ -SfxViewFrame::SfxViewFrame(const SfxViewFrame &rCopy, SfxBindings &rBindings, - SfxFrame *pFrame ) -: - pImp( new SfxViewFrame_Impl ), - pDispatcher(0), - pBindings(&rBindings), - nAdjustPosPixelLock( 0 ) -{ - DBG_CTOR(SfxViewFrame, 0); +/* [Beschreibung] - SetFrame_Impl( pFrame ); - pImp->pFrame->SetCurrentViewFrame_Impl( this ); - GetFrame()->SetFrameType_Impl( rCopy.GetFrameType() ); - Construct_Impl( rCopy.GetObjectShell() ); -} + Ctor des SfxViewFrame f"ur eine aus der Ressource. + Die 'nViewId' der zu erzeugenden kann angegeben werden + (default ist die zuerst registrierte SfxViewShell-Subklasse). +*/ -SfxViewFrame::SfxViewFrame( SfxBindings& rBindings, SfxFrame *pFrame, - SfxObjectShell *pDoc, sal_uInt32 nType ) : pImp( new SfxViewFrame_Impl ) , pDispatcher(0) - , pBindings(&rBindings) + , pBindings( new SfxBindings ) , nAdjustPosPixelLock( 0 ) { - DBG_CTOR(SfxViewFrame, 0); + DBG_CTOR( SfxViewFrame, NULL ); SetFrame_Impl( pFrame ); pImp->pFrame->SetCurrentViewFrame_Impl( this ); - GetFrame()->SetFrameType_Impl( GetFrameType() | nType ); - Construct_Impl( pDoc); + GetFrame()->SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE ); + Construct_Impl( pObjShell ); + +//(mba)/task if ( !pFrame->GetTask() ) + { + pImp->pWindow = new SfxTopViewWin_Impl( this, pFrame->GetWindow() ); + pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() ); + pFrame->SetOwnsBindings_Impl( sal_True ); + pFrame->CreateWorkWindow_Impl(); + } + + sal_uInt32 nType = SFXFRAME_OWNSDOCUMENT | SFXFRAME_HASTITLE; + if ( pObjShell && pObjShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + nType |= SFXFRAME_EXTERNAL; + GetFrame()->SetFrameType_Impl( GetFrame()->GetFrameType() | nType ); + + if ( GetFrame()->IsInPlace() ) + { + LockAdjustPosSizePixel(); + } + + if ( pObjShell && !SwitchToViewShell_Impl( nViewId ) ) + { + // TODO: better error handling? Under which conditions can this fail? + return; + } + + if ( GetFrame()->IsInPlace() ) + { + UnlockAdjustPosSizePixel(); + } + else if ( GetViewShell() && GetViewShell()->UseObjectSize() ) + { + // initiale Gr"o\se festlegen + // Zuerst die logischen Koordinaten von IP-Objekt und EditWindow + // ber"ucksichtigen + LockAdjustPosSizePixel(); + ForceInnerResize_Impl( TRUE ); + + Window *pWindow = GetViewShell()->GetWindow(); + + // Da in den Applikationen bei der R"ucktransformation immer die + // Eckpunkte tranformiert werden und nicht die Size (um die Ecken + // alignen zu k"onnen), transformieren wir hier auch die Punkte, um + // m"oglichst wenig Rundungsfehler zu erhalten. +/* + Rectangle aRect = pWindow->LogicToLogic( GetObjectShell()->GetVisArea(), + GetObjectShell()->GetMapUnit(), + pWindow->GetMapMode() ); +*/ + Rectangle aRect = pWindow->LogicToPixel( GetObjectShell()->GetVisArea() ); + Size aSize = aRect.GetSize(); + GetViewShell()->GetWindow()->SetSizePixel( aSize ); + DoAdjustPosSizePixel(GetViewShell(), Point(), aSize ); + } } //------------------------------------------------------------------------ @@ -1610,6 +1557,19 @@ SfxViewFrame::~SfxViewFrame() { DBG_DTOR(SfxViewFrame, 0); + SetDowning_Impl(); + + if ( SfxViewFrame::Current() == this ) + SfxViewFrame::SetViewFrame( NULL ); + + ReleaseObjectShell_Impl(); + + if ( GetFrame()->OwnsBindings_Impl() ) + // Die Bindings l"oscht der Frame! + KillDispatcher_Impl(); + + delete pImp->pWindow; + if ( GetFrame() && GetFrame()->GetCurrentViewFrame() == this ) GetFrame()->SetCurrentViewFrame_Impl( NULL ); @@ -1653,12 +1613,11 @@ SfxViewFrame* SfxViewFrame::Current() } //-------------------------------------------------------------------- -sal_uInt16 SfxViewFrame::Count(TypeId aType) +sal_uInt16 SfxViewFrame::Count() /* [Beschreibung] - Liefert die Anzahl der sichtbaren -Instanzen vom Typ - 'aType' bzw. aller sichtbaren, falls 'aType==0' (default). + Liefert die Anzahl der sichtbaren -Instanzen. */ { @@ -1669,8 +1628,7 @@ sal_uInt16 SfxViewFrame::Count(TypeId aType) for ( sal_uInt16 i = 0; i < nCount; ++i ) { SfxViewFrame *pFrame = rFrames[i]; - if ( ( !aType || pFrame->IsA(aType) ) && - pFrame->IsVisible_Impl() ) + if ( pFrame->IsVisible_Impl() ) ++nFound; } return nFound; @@ -1681,7 +1639,6 @@ sal_uInt16 SfxViewFrame::Count(TypeId aType) SfxViewFrame* SfxViewFrame::GetFirst ( const SfxObjectShell* pDoc, - TypeId aType, sal_Bool bOnlyIfVisible ) { @@ -1692,9 +1649,9 @@ SfxViewFrame* SfxViewFrame::GetFirst for ( sal_uInt16 nPos = 0; nPos < rFrames.Count(); ++nPos ) { SfxViewFrame *pFrame = rFrames.GetObject(nPos); - if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) && - ( !aType || pFrame->IsA(aType) ) && - ( !bOnlyIfVisible || pFrame->IsVisible_Impl()) ) + if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) + && ( !bOnlyIfVisible || pFrame->IsVisible_Impl() ) + ) return pFrame; } @@ -1707,7 +1664,6 @@ SfxViewFrame* SfxViewFrame::GetNext ( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc, - TypeId aType, sal_Bool bOnlyIfVisible ) { @@ -1724,9 +1680,9 @@ SfxViewFrame* SfxViewFrame::GetNext for ( ++nPos; nPos < rFrames.Count(); ++nPos ) { SfxViewFrame *pFrame = rFrames.GetObject(nPos); - if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) && - ( !aType || pFrame->IsA(aType) ) && - ( !bOnlyIfVisible || pFrame->IsVisible_Impl()) ) + if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) + && ( !bOnlyIfVisible || pFrame->IsVisible_Impl() ) + ) return pFrame; } return 0; @@ -2624,19 +2580,6 @@ void SfxViewFrame::StateView_Impl } } -//------------------------------------------------------------------------- -void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) -{ - if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() ) - { - uno::Any aAny; - aAny <<= GetViewShell()->GetVerbs(); - rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) ); - } - else - rSet.DisableItem( SID_OBJECT ); -} - //------------------------------------------------------------------------- void SfxViewFrame::ToTop() { @@ -2676,13 +2619,6 @@ SfxViewFrame* SfxViewFrame::GetTopViewFrame() const return GetFrame()->GetTopFrame()->GetCurrentViewFrame(); } -//------------------------------------------------------------------------- - -void SfxViewFrame::SetWindow_Impl( Window *pWin ) -{ - pImp->pWindow = pWin; -} - Window& SfxViewFrame::GetWindow() const { return pImp->pWindow ? *pImp->pWindow : GetFrame()->GetWindow(); @@ -3122,7 +3058,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) case SID_WIN_FULLSCREEN: { SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot(), FALSE); - SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() ); + SfxViewFrame *pTop = GetTopViewFrame(); if ( pTop ) { WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl(); @@ -3273,7 +3209,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) case SID_WIN_FULLSCREEN: { - SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() ); + SfxViewFrame* pTop = GetTopViewFrame(); if ( pTop ) { WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl(); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 3412b65f8f..3747953091 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -84,7 +84,7 @@ #include "view.hrc" #include "sfxlocal.hrc" #include -#include +#include #include "mailmodelapi.hxx" #include #include -- cgit v1.2.3 From c4deb970f321815a809a5814b1a034166ef874b1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Nov 2009 12:56:04 +0100 Subject: [CWS autorecovery] forgot to remove some includes --- formula/source/ui/dlg/formula.cxx | 1 - sfx2/source/view/frmload.cxx | 1 - 2 files changed, 2 deletions(-) diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 897f53b59b..2437325094 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 3c8ab65a2c..d8446ba93a 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -45,7 +45,6 @@ #include "sfx2/sfx.hrc" #include "sfx2/sfxsids.hrc" #include "sfx2/sfxuno.hxx" -#include "sfx2/topfrm.hxx" #include "sfx2/viewfrm.hxx" /** === begin UNO includes === **/ -- cgit v1.2.3 From 351eb9f80e6d769b4dc5a6d0b22de19505b82d42 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Nov 2009 12:56:05 +0100 Subject: [CWS autorecovery] removed some dead/unused stuff SID_BACKTOWEBTOP, some SFX_VIEW_* flags, some SFXFRAME_* flags, all BROWSE_* flags --- sfx2/inc/sfx2/frame.hxx | 18 +------- sfx2/inc/sfx2/sfxsids.hrc | 2 +- sfx2/inc/sfx2/viewfrm.hxx | 4 -- sfx2/inc/sfx2/viewsh.hxx | 18 -------- sfx2/sdi/frmslots.sdi | 5 --- sfx2/sdi/sfx.sdi | 25 ----------- sfx2/source/doc/objxtor.cxx | 2 +- sfx2/source/view/frame.cxx | 2 +- sfx2/source/view/impviewframe.hxx | 9 ++-- sfx2/source/view/topfrm.cxx | 10 +---- sfx2/source/view/viewfrm.cxx | 88 +++++---------------------------------- sfx2/source/view/viewimp.hxx | 2 - sfx2/source/view/viewsh.cxx | 29 +------------ svx/inc/globlmn_tmpl.hrc | 6 --- 14 files changed, 21 insertions(+), 199 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 5e812df71f..8446fc8cdb 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -97,19 +97,7 @@ class SfxFrameArr_Impl; DECLARE_LIST( TargetList, String* ) -#define SFXFRAME_INTERNAL 0x0001 -#define SFXFRAME_EXTERNAL 0x0002 -#define SFXFRAME_OWNSDOCUMENT 0x0004 -#define SFXFRAME_PLUGIN 0x0008 -#define SFXFRAME_HASTITLE 0x0010 -#define SFXFRAME_SERVER 0x0020 // Is es ein Frame, der in einem Container steckt ? - -#define BROWSE_NORMAL 0 -#define BROWSE_FORWARD 1 -#define BROWSE_BACKWARD 2 -#define NO_BROWSE 3 -#define BROWSE_FRAME 4 -#define BROWSE_MAX_MODE 10 +#define SFXFRAME_HASTITLE 0x0001 //========================================================================== // Ein SfxFrame ist eine Verwaltungsklasse f"ur Fenster und deren Inhalte. @@ -126,14 +114,10 @@ DECLARE_LIST( TargetList, String* ) class SfxFrameArr_Impl; struct SfxFramePickEntry_Impl; -class SfxUnoFrame; class SFX2_DLLPUBLIC SfxFrame { friend class SfxFrameIterator; friend class SfxTopWindow_Impl; -// friend struct SfxFramePickEntry_Impl; -// friend class SfxUnoFrame; -// friend class SfxViewFrame; /*HACK!*/ private: SfxFrame* pParentFrame; diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index bca3a0ef19..8a78d44bd4 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -522,7 +522,7 @@ #define SID_LOGOUT (SID_SFX_START + 1652) #define SID_JUMPMARK (SID_SFX_START + 1654) #define SID_BROWSE (SID_SFX_START + 1658) -#define SID_BACKTOWEBTOP (SID_SFX_START + 1657) + // FREE (was: SID_BACKTOWEBTOP) #define SID_SEGMENTSIZE (SID_SFX_START + 1659) #define SID_VIEW_DATA_SOURCE_BROWSER (SID_SFX_START + 1660) #define SID_TOGGLE_MENUBAR (SID_SFX_START + 1661) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 7fa0eaff7e..86e22bd4a1 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -148,10 +148,6 @@ private: SAL_DLLPRIVATE void Construct_Impl( SfxObjectShell *pObjSh=NULL ); #endif -// SfxViewFrame( SfxBindings&, SfxFrame*, SfxObjectShell *pDoc, sal_uInt32 nType ); -// SfxViewFrame( SfxObjectShell&, SfxBindings&, SfxFrame* p = NULL, sal_uInt32 nType = NULL ); -// SfxViewFrame( const SfxViewFrame &, SfxBindings &, SfxFrame *pFrame ); - protected: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 26f0ed2219..8ec71a7844 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -97,24 +97,12 @@ enum SfxScrollingMode // @[SfxViewShell-Flags] -#define SFX_VIEW_MAXIMIZE_FIRST 0x0001 /* die erste View wird maximiert - dargestellt */ -#define SFX_VIEW_OPTIMIZE_EACH 0x0002 /* jede View wird in optimaler - Gr"o\se dargestellt */ -#define SFX_VIEW_DISABLE_ACCELS 0x0004 /* die Acceleratoren werden - disabled, solange diese - View den Focus hat */ -#define SFX_VIEW_OBJECTSIZE_EMBEDDED 0x0008 /* Views von embedded Objekten - werden in optimaler Gr"o\se - dargestellt */ #define SFX_VIEW_HAS_PRINTOPTIONS 0x0010 /* Options-Button und Options- Dialog im PrintDialog */ #define SFX_VIEW_CAN_PRINT 0x0020 /* enabled Printing ohne Printer erzeugen zu m"ussen */ #define SFX_VIEW_NO_SHOW 0x0040 /* Window der ViewShell darf nicht automatisch geshowed werden */ -#define SFX_VIEW_IMPLEMENTED_AS_FRAMESET 0x0080 /* Das Dokument ist als - Frameset implementiert*/ #define SFX_VIEW_NO_NEWWINDOW 0x0100 /* keine weitere View erlauben */ /* [Beschreibung] @@ -169,8 +157,6 @@ friend class SfxBaseController; SfxViewFrame* pFrame; SfxShell* pSubShell; Window* pWindow; - BOOL bMaximizeFirst; - BOOL bOptimizeEach; BOOL bNoNewWindow; protected: @@ -221,9 +207,6 @@ public: void VisAreaChanged(const Rectangle& rRect); // Verhaltens-Flags - BOOL IsMaximizeFirst() const { return bMaximizeFirst; } - BOOL IsOptimizeEach() const { return bOptimizeEach; } - HACK(inline) BOOL UseObjectSize() const; SfxScrollingMode GetScrollingMode() const; void SetScrollingMode( SfxScrollingMode eMode ); @@ -309,7 +292,6 @@ public: SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor ); SAL_DLLPRIVATE void RemoveContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor ); SAL_DLLPRIVATE FASTBOOL GlobalKeyInput_Impl( const KeyEvent &rKeyEvent ); - SAL_DLLPRIVATE BOOL IsImplementedAsFrameset_Impl() const; SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient ) { GetIPClientList_Impl(TRUE)->Insert(pIPClient); } diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi index acaa547472..ca76da69a4 100644 --- a/sfx2/sdi/frmslots.sdi +++ b/sfx2/sdi/frmslots.sdi @@ -410,11 +410,6 @@ interface TopWindow : BrowseWindow ExecMethod = Exec_Impl ; StateMethod = GetState_Impl ; ] - SID_BACKTOWEBTOP // ole(no) api(final/play/rec) - [ - ExecMethod = Exec_Impl ; - StateMethod = GetState_Impl ; - ] SID_BROWSE_FORWARD // ole(no) api() [ ExecMethod = INetExecute_Impl ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index bf4561fe0d..efa2c0e23a 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -561,31 +561,6 @@ SfxVoidItem Backspace SID_BACKSPACE GroupId = GID_EDIT; ] -//-------------------------------------------------------------------------- -SfxVoidItem BackToWebtop SID_BACKTOWEBTOP -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_VIEW; -] - //-------------------------------------------------------------------------- SfxVoidItem BasicBreak SID_BASICBREAK () diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 97450f6fc5..a0fe84a8bc 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -586,7 +586,7 @@ sal_uInt16 SfxObjectShell::PrepareClose // nur fuer in sichtbaren Fenstern dargestellte Dokumente fragen SfxViewFrame *pFrame = SfxObjectShell::Current() == this ? SfxViewFrame::Current() : SfxViewFrame::GetFirst( this ); - while ( pFrame && (pFrame->GetFrameType() & SFXFRAME_SERVER ) ) + while ( pFrame ) pFrame = SfxViewFrame::GetNext( *pFrame, this ); sal_Bool bClose = sal_False; diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index b076369a51..68a6a01ea3 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -536,7 +536,7 @@ void SfxFrame::GetTargetList( TargetList& rList ) const } SfxViewFrame* pView = GetCurrentViewFrame(); - if( pView && pView->GetViewShell() && !pView->GetViewShell()->IsImplementedAsFrameset_Impl() && pChildArr ) + if( pView && pView->GetViewShell() && pChildArr ) { sal_uInt16 nCount = pChildArr->Count(); for ( sal_uInt16 n=0; nGetViewShell()->UseObjectSize() ) - { - pViewFrame->UnlockAdjustPosSizePixel(); - pViewFrame->Resize(TRUE); - pViewFrame->ForceInnerResize_Impl( FALSE ); - pViewFrame->Resize(TRUE); - } - else - pViewFrame->Resize(TRUE); + pViewFrame->Resize(TRUE); } SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 4fcc96ea6f..6f919c8c80 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -855,14 +855,6 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) { SfxFrame* pFrame = GetTopFrame(); SfxViewFrame *pView = pFrame->GetCurrentViewFrame(); - if ( pView && pView->GetViewShell() && - pView->GetViewShell()->IsImplementedAsFrameset_Impl() && - pView->GetViewShell()->GetInterface()->GetSlot( nWhich ) ) - { - // Hack f"ur Explorer: Reload wird an der ViewShell ausgef"uhrt - pView->GetViewShell()->GetSlotState( nWhich, 0, &rSet ); - break; - } if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) rSet.DisableItem(nWhich); @@ -1217,24 +1209,8 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh ) return; } - if ( GetViewShell()->UseObjectSize() ) - { - // Zun"achst die Gr"o\se des MDI-Fensters berechnen - - DoAdjustPosSizePixel( GetViewShell(), Point(), - GetViewShell()->GetWindow()->GetSizePixel() ); - - // Da nach einem InnerResize die Position des EditFensters und - // damit auch der Tools nocht stimmt, mu\s nun noch einmal von - // au\sen resized werden ! - - ForceOuterResize_Impl(sal_True); - } - DoAdjustPosSizePixel( (SfxViewShell *) GetViewShell(), Point(), GetWindow().GetOutputSizePixel() ); - if ( GetViewShell()->UseObjectSize() ) - ForceOuterResize_Impl(sal_False); } } } @@ -1420,7 +1396,6 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) //------------------------------------------------------------------------ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) { - pImp->bInCtor = sal_True; pImp->bResizeInToOut = sal_True; pImp->bDontOverwriteResizeInToOut = sal_False; pImp->bObjLocked = sal_False; @@ -1469,7 +1444,6 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) SfxViewFrame *pThis = this; // wegen der kranken Array-Syntax SfxViewFrameArr_Impl &rViewArr = SFX_APP()->GetViewFrames_Impl(); rViewArr.C40_INSERT(SfxViewFrame, pThis, rViewArr.Count() ); - pImp->bInCtor = sal_False; } SfxViewFrame::SfxViewFrame @@ -1486,30 +1460,21 @@ SfxViewFrame::SfxViewFrame (default ist die zuerst registrierte SfxViewShell-Subklasse). */ - : pImp( new SfxViewFrame_Impl ) + : pImp( new SfxViewFrame_Impl( pFrame ) ) , pDispatcher(0) , pBindings( new SfxBindings ) , nAdjustPosPixelLock( 0 ) { DBG_CTOR( SfxViewFrame, NULL ); - SetFrame_Impl( pFrame ); - pImp->pFrame->SetCurrentViewFrame_Impl( this ); - GetFrame()->SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE ); + pFrame->SetCurrentViewFrame_Impl( this ); + pFrame->SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE ); Construct_Impl( pObjShell ); -//(mba)/task if ( !pFrame->GetTask() ) - { - pImp->pWindow = new SfxTopViewWin_Impl( this, pFrame->GetWindow() ); - pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() ); - pFrame->SetOwnsBindings_Impl( sal_True ); - pFrame->CreateWorkWindow_Impl(); - } - - sal_uInt32 nType = SFXFRAME_OWNSDOCUMENT | SFXFRAME_HASTITLE; - if ( pObjShell && pObjShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) - nType |= SFXFRAME_EXTERNAL; - GetFrame()->SetFrameType_Impl( GetFrame()->GetFrameType() | nType ); + pImp->pWindow = new SfxTopViewWin_Impl( this, pFrame->GetWindow() ); + pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() ); + pFrame->SetOwnsBindings_Impl( sal_True ); + pFrame->CreateWorkWindow_Impl(); if ( GetFrame()->IsInPlace() ) { @@ -1526,30 +1491,6 @@ SfxViewFrame::SfxViewFrame { UnlockAdjustPosSizePixel(); } - else if ( GetViewShell() && GetViewShell()->UseObjectSize() ) - { - // initiale Gr"o\se festlegen - // Zuerst die logischen Koordinaten von IP-Objekt und EditWindow - // ber"ucksichtigen - LockAdjustPosSizePixel(); - ForceInnerResize_Impl( TRUE ); - - Window *pWindow = GetViewShell()->GetWindow(); - - // Da in den Applikationen bei der R"ucktransformation immer die - // Eckpunkte tranformiert werden und nicht die Size (um die Ecken - // alignen zu k"onnen), transformieren wir hier auch die Punkte, um - // m"oglichst wenig Rundungsfehler zu erhalten. -/* - Rectangle aRect = pWindow->LogicToLogic( GetObjectShell()->GetVisArea(), - GetObjectShell()->GetMapUnit(), - pWindow->GetMapMode() ); -*/ - Rectangle aRect = pWindow->LogicToPixel( GetObjectShell()->GetVisArea() ); - Size aSize = aRect.GetSize(); - GetViewShell()->GetWindow()->SetSizePixel( aSize ); - DoAdjustPosSizePixel(GetViewShell(), Point(), aSize ); - } } //------------------------------------------------------------------------ @@ -1806,7 +1747,7 @@ void SfxViewFrame::SetViewShell_Impl( SfxViewShell *pVSh ) SfxShell::SetViewShell_Impl( pVSh ); // Hack: InPlaceMode - if ( pVSh && !pVSh->UseObjectSize() ) + if ( pVSh ) pImp->bResizeInToOut = sal_False; } @@ -1844,7 +1785,7 @@ void SfxViewFrame::DoAdjustPosSize( SfxViewShell *pSh, const Point rPos, const Size &rSize ) { DBG_CHKTHIS(SfxViewFrame, 0); - if( pSh && !nAdjustPosPixelLock && pSh->UseObjectSize()) + if( pSh && !nAdjustPosPixelLock ) { Window *pWindow = pSh->GetWindow(); Point aPos = pWindow->LogicToPixel(rPos); @@ -1927,7 +1868,7 @@ void SfxViewFrame::Show() LockObjectShell_Impl( sal_True ); // Doc-Shell Titel-Nummer anpassen, get unique view-no - if ( 0 == pImp->nDocViewNo && !(GetFrameType() & SFXFRAME_PLUGIN ) ) + if ( 0 == pImp->nDocViewNo ) { GetDocNumber_Impl(); UpdateTitle(); @@ -1958,8 +1899,6 @@ void SfxViewFrame::Show() //-------------------------------------------------------------------- sal_Bool SfxViewFrame::IsVisible_Impl() const { - //Window *pWin = pImp->bInCtor ? 0 : &GetWindow(); - //return GetFrame()->HasComponent() || pImp->bObjLocked || ( pWin && pWin->IsVisible() ); return pImp->bObjLocked; } @@ -2266,9 +2205,6 @@ void SfxViewFrame::ExecView_Impl { // Bei Mail etc. k"onnen die Frames nicht angesprochen werden SfxFrame *pParent = GetFrame()->GetParentFrame(); - if ( pParent && pParent->GetCurrentViewFrame()-> - GetViewShell()->IsImplementedAsFrameset_Impl() ) - break; SfxViewFrame *pRet = NULL; SFX_REQUEST_ARG( @@ -2669,11 +2605,7 @@ void SfxViewFrame::Resize( BOOL bForce ) } else { - if ( pShell->UseObjectSize() ) - ForceOuterResize_Impl(TRUE); DoAdjustPosSizePixel( pShell, Point(), aSize ); - if ( pShell->UseObjectSize() ) - ForceOuterResize_Impl(FALSE); } } } diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index 6b0c77071c..dfd851244f 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -85,12 +85,10 @@ struct SfxViewShell_Impl Size aOptimalSize; Size aMargin; USHORT nPrinterLocks; - BOOL bUseObjectSize; BOOL bCanPrint; BOOL bHasPrintOptions; BOOL bPlugInsActive; BOOL bIsShowView; - BOOL bFrameSetImpl; BOOL bOwnsMenu; BOOL bGotOwnerShip; BOOL bGotFrameOwnerShip; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 3747953091..53399c1c45 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1255,8 +1255,6 @@ SfxViewShell::SfxViewShell ,pFrame(pViewFrame) ,pSubShell(0) ,pWindow(0) - ,bMaximizeFirst( 0 != (nFlags & SFX_VIEW_MAXIMIZE_FIRST) ) - ,bOptimizeEach(0 != (nFlags & SFX_VIEW_OPTIMIZE_EACH)) ,bNoNewWindow( 0 != (nFlags & SFX_VIEW_NO_NEWWINDOW) ) { DBG_CTOR(SfxViewShell, 0); @@ -1266,11 +1264,7 @@ SfxViewShell::SfxViewShell pImp->bIsShowView = !(SFX_VIEW_NO_SHOW == (nFlags & SFX_VIEW_NO_SHOW)); - pImp->bUseObjectSize = FALSE; -// SFX_CREATE_MODE_EMBEDDED==pFrame->GetObjectShell()->GetCreateMode() && -// SFX_VIEW_OBJECTSIZE_EMBEDDED == (nFlags & SFX_VIEW_OBJECTSIZE_EMBEDDED); pImp->bCanPrint = SFX_VIEW_CAN_PRINT == (nFlags & SFX_VIEW_CAN_PRINT); - pImp->bFrameSetImpl = (nFlags & SFX_VIEW_IMPLEMENTED_AS_FRAMESET) != 0; pImp->bHasPrintOptions = SFX_VIEW_HAS_PRINTOPTIONS == (nFlags & SFX_VIEW_HAS_PRINTOPTIONS); pImp->bPlugInsActive = TRUE; @@ -1778,13 +1772,6 @@ void SfxViewShell::DisconnectAllClients() //-------------------------------------------------------------------- -BOOL SfxViewShell::UseObjectSize() const -{ - return pImp->bUseObjectSize; -} - -//-------------------------------------------------------------------- - void SfxViewShell::QueryObjAreaPixel( Rectangle& ) const { } @@ -1794,14 +1781,7 @@ void SfxViewShell::QueryObjAreaPixel( Rectangle& ) const void SfxViewShell::AdjustVisArea(const Rectangle& rRect) { DBG_ASSERT (pFrame, "Kein Frame?"); - if ( UseObjectSize() ) - { - Point aPos = rRect.TopLeft(); - Size aSize = GetObjectShell()->GetVisArea().GetSize(); - GetObjectShell()->SetVisArea( Rectangle(aPos, aSize) ); - } - else - GetObjectShell()->SetVisArea( rRect ); + GetObjectShell()->SetVisArea( rRect ); } //-------------------------------------------------------------------- @@ -1973,13 +1953,6 @@ SfxFrame* SfxViewShell::GetSmartSelf( SfxFrame* pSelf, SfxMedium& /*rMedium*/ ) return pSelf; } -//-------------------------------------------------------------------- - -BOOL SfxViewShell::IsImplementedAsFrameset_Impl( ) const -{ - return pImp->bFrameSetImpl; -} - //------------------------------------------------------------------------ void SfxViewShell::JumpToMark( const String& rMark ) diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc index 327bd45d53..128c5c5ded 100644 --- a/svx/inc/globlmn_tmpl.hrc +++ b/svx/inc/globlmn_tmpl.hrc @@ -471,12 +471,6 @@ HelpID = SID_LOGOUT ; \ Text [ en-US ] = "Logout" ; \ -#define ITEM_FILE_BACKTOWEBTOP \ - Identifier = SID_BACKTOWEBTOP ; \ - Command = ".uno:BackToWebtop" ; \ - HelpID = SID_BACKTOWEBTOP ; \ - Text [ en-US ] = "Back to Webtop"; \ - #define ITEM_EDIT_UNDO \ Identifier = SID_UNDO ; \ Command = ".uno:UndoAction" ; \ -- cgit v1.2.3 From 4113a3cbafb6a12ac7ea0129e751fd5bc35b3067 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Nov 2009 13:33:40 +0100 Subject: #i10000# --- sfx2/source/view/impviewframe.hxx | 3 ++- sfx2/source/view/viewfrm.cxx | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx index 87ac9e4352..521a7428de 100644 --- a/sfx2/source/view/impviewframe.hxx +++ b/sfx2/source/view/impviewframe.hxx @@ -85,4 +85,5 @@ public: virtual void StateChanged( StateChangedType nStateChange ); }; -#endif SFX2_IMPVIEWFRAME_HXX +#endif // SFX2_IMPVIEWFRAME_HXX + diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 6f919c8c80..133774f2c6 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -854,7 +854,6 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) case SID_RELOAD: { SfxFrame* pFrame = GetTopFrame(); - SfxViewFrame *pView = pFrame->GetCurrentViewFrame(); if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) rSet.DisableItem(nWhich); @@ -2204,8 +2203,6 @@ void SfxViewFrame::ExecView_Impl case SID_FILLFRAME: { // Bei Mail etc. k"onnen die Frames nicht angesprochen werden - SfxFrame *pParent = GetFrame()->GetParentFrame(); - SfxViewFrame *pRet = NULL; SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_FILLFRAME, sal_False ); -- cgit v1.2.3 From 0648026a8672f317cef5c259a5b1b2033a05c4d7 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 2 Dec 2009 14:28:50 +0100 Subject: dba33e: #i102366# ColumnAliasInOrderBy now in properties as well --- connectivity/source/drivers/ado/ado.xcu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu index a61ac3aaa1..89ac9b1e5a 100755 --- a/connectivity/source/drivers/ado/ado.xcu +++ b/connectivity/source/drivers/ado/ado.xcu @@ -157,6 +157,11 @@ 3
+ + + false + + -- cgit v1.2.3 From a92b2f77b8793dece8f8b927dc599bcac475f197 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 09:29:06 +0100 Subject: autorecovery: ConnectSfxFrame_Impl: show the view frame's window, if it is different from the frame's window (this code got lost in some of the previous stages, which killed impress' full-screen slide show) --- sfx2/source/view/sfxbasecontroller.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 4dd84cd793..6a5c5ae8d3 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1370,6 +1370,10 @@ void SfxBaseController::ConnectSfxFrame_Impl( const bool i_bConnect ) if ( SfxViewFrame::Current() == pActFrame ) pActFrame->GetDispatcher()->Update_Impl( sal_True ); + + Window* pFrameWin = &pActFrame->GetWindow(); + if ( pFrameWin != &pActFrame->GetFrame()->GetWindow() ) + pFrameWin->Show(); } // invalidate slot corresponding to the view shell -- cgit v1.2.3 From 058aaaf72e6dd9ee317e5368f1a6bfd72ecd340d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 09:29:45 +0100 Subject: [CWS autorecovery] SwitchToViewShell_Impl moved into the SfxFrame --- sfx2/inc/sfx2/frame.hxx | 4 +--- sfx2/inc/sfx2/viewfrm.hxx | 5 +++-- sfx2/source/view/frame.cxx | 12 +----------- sfx2/source/view/frmload.cxx | 3 +-- sfx2/source/view/impframe.hxx | 2 -- sfx2/source/view/topfrm.cxx | 38 +++++++++++++++----------------------- sfx2/source/view/viewfrm.cxx | 21 ++------------------- 7 files changed, 23 insertions(+), 62 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 8446fc8cdb..cc28173887 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -209,8 +209,6 @@ public: SAL_DLLPRIVATE static void InsertTopFrame_Impl( SfxFrame* pFrame ); SAL_DLLPRIVATE static void RemoveTopFrame_Impl( SfxFrame* pFrame ); - SAL_DLLPRIVATE void SetItemSet_Impl( const SfxItemSet* pSet ); - SAL_DLLPRIVATE const SfxItemSet* GetItemSet_Impl(); SAL_DLLPRIVATE void SetOwnsBindings_Impl( sal_Bool bSet ); SAL_DLLPRIVATE sal_Bool OwnsBindings_Impl() const; SAL_DLLPRIVATE void InvalidateUnoControllers_Impl(); @@ -224,7 +222,7 @@ public: SAL_DLLPRIVATE void GrabFocusOnComponent_Impl(); SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool ); - SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc ); + SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& rSet ); SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock ); SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 86e22bd4a1..d68efb0a1c 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -152,14 +152,13 @@ protected: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); #ifndef _SFX_HXX - SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); SAL_DLLPRIVATE void KillDispatcher_Impl(); #endif virtual ~SfxViewFrame(); public: - SfxViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc = NULL, USHORT nViewId = 0 ); + SfxViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc = NULL ); TYPEINFO(); SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM) @@ -301,6 +300,8 @@ public: SAL_DLLPRIVATE void Exec_Impl(SfxRequest &); SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &); SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); + + SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); //#endif private: SAL_DLLPRIVATE SfxViewShell* LoadNewView_Impl( const USHORT i_nNewViewNo, SfxViewShell* i_pOldShell ); diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 68a6a01ea3..d49e8ae95f 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -314,7 +314,7 @@ SfxViewFrame* SfxFrame::InsertDocument( SfxObjectShell& rDoc, SfxFrame*& rpTarge { if ( bHidden ) rDoc.PutItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); - rpTargetFrame->InsertDocument_Impl( rDoc ); + rpTargetFrame->InsertDocument_Impl( rDoc, *rDoc.GetMedium()->GetItemSet() ); pViewFrame = rpTargetFrame->GetCurrentViewFrame(); } else @@ -760,16 +760,6 @@ void SfxFrame::SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< : GetCurrentViewFrame()->GetBindings().SetRecorder_Impl( xRecorder ); } -void SfxFrame::SetItemSet_Impl( const SfxItemSet* pSet ) -{ - pImp->pSet = pSet; -} - -const SfxItemSet* SfxFrame::GetItemSet_Impl() -{ - return pImp->pSet; -} - void SfxFrame::Appear() { if ( GetCurrentViewFrame() ) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index d8446ba93a..e868d92d23 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -327,8 +327,7 @@ sal_Bool SfxFrameLoader_Impl::impl_plugDocIntoFrame( const ::comphelper::NamedVa { SfxAllItemSet aSet( SFX_APP()->GetPool() ); TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); - i_rTargetFrame.SetItemSet_Impl( &aSet ); - return i_rTargetFrame.InsertDocument_Impl( i_rDocument ); + return i_rTargetFrame.InsertDocument_Impl( i_rDocument, aSet ); } // -------------------------------------------------------------------------------------------------------------------- diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index b27dd2c685..110f7dc545 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -71,7 +71,6 @@ public: sal_Bool bReleasingComponent : 1; sal_Bool bInPlace : 1; SfxFrame* pFrame; - const SfxItemSet* pSet; SfxWorkWindow* pWorkWin; SvBorder aBorder; // formerly SfxTopFrame @@ -96,7 +95,6 @@ public: ,bReleasingComponent( sal_False ) ,bInPlace( sal_False ) ,pFrame( pAntiImplP ) - ,pSet( 0 ) ,pWorkWin( 0 ) ,pExternalWindow( NULL ) ,bHidden( false ) diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 10984b6093..4fb07ee837 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -484,12 +484,11 @@ SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, */ } - pFrame->SetItemSet_Impl( pSet ); if ( pDoc && pDoc != pFrame->GetCurrentDocument() ) { if ( nViewId ) pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - pFrame->InsertDocument_Impl( *pDoc ); + pFrame->InsertDocument_Impl( *pDoc, pSet ? *pSet : *pDoc->GetMedium()->GetItemSet() ); if ( pWindow && !bHidden ) pWindow->Show(); } @@ -515,12 +514,11 @@ SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, Window& rWindow, USHORT nViewI pFrame->SetFrameInterface_Impl( xFrame ); pFrame->pImp->bHidden = bHidden; - pFrame->SetItemSet_Impl( pSet ); if ( pDoc ) { if ( nViewId ) pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - pFrame->InsertDocument_Impl( *pDoc ); + pFrame->InsertDocument_Impl( *pDoc, pSet ? *pSet : *pDoc->GetMedium()->GetItemSet() ); } return pFrame; @@ -675,7 +673,7 @@ namespace bool lcl_getViewDataAndID( const Reference< XModel >& _rxDocument, Sequence< PropertyValue >& _o_viewData, USHORT& _o_viewId ) { _o_viewData.realloc(0); - _o_viewId = -1; + _o_viewId = 0; Reference< XViewDataSupplier > xViewDataSupplier( _rxDocument, UNO_QUERY ); Reference< XIndexAccess > xViewData; @@ -701,7 +699,7 @@ namespace } } -sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) +sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& rSet ) /* [Beschreibung] */ { @@ -719,19 +717,14 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) OSL_PRECOND( GetCurrentDocument() == NULL, "SfxFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); - const SfxItemSet* pSet = GetItemSet_Impl(); - if ( !pSet ) - pSet = rDoc.GetMedium()->GetItemSet(); - SetItemSet_Impl( NULL ); - - SFX_ITEMSET_ARG( pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size - SFX_ITEMSET_ARG( pSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID - SFX_ITEMSET_ARG( pSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom - SFX_ITEMSET_ARG( pSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False ); // hidden - SFX_ITEMSET_ARG( pSet, pViewDataItem, SfxStringItem, SID_USER_DATA, sal_False ); // view data - SFX_ITEMSET_ARG( pSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False ); // view only - SFX_ITEMSET_ARG( pSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) - SFX_ITEMSET_ARG( pSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) + SFX_ITEMSET_ARG( &rSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size + SFX_ITEMSET_ARG( &rSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID + SFX_ITEMSET_ARG( &rSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom + SFX_ITEMSET_ARG( &rSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False ); // hidden + SFX_ITEMSET_ARG( &rSet, pViewDataItem, SfxStringItem, SID_USER_DATA, sal_False ); // view data + SFX_ITEMSET_ARG( &rSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False ); // view only + SFX_ITEMSET_ARG( &rSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) + SFX_ITEMSET_ARG( &rSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) // hidden? OSL_PRECOND( !pImp->bHidden, @@ -758,7 +751,6 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) // if no view-related data exists in the set, then obtain the view data from the model if ( !pJumpItem && !pViewDataItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) { - nViewId = 0; if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) { SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); @@ -776,9 +768,9 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) if ( nPluginMode && ( nPluginMode != 2 ) ) SetInPlace_Impl( TRUE ); - SfxViewFrame* pViewFrame = new SfxViewFrame( this, &rDoc, nViewId ); - if ( !pViewFrame->GetViewShell() ) - { + SfxViewFrame* pViewFrame = new SfxViewFrame( this, &rDoc ); + if ( !pViewFrame->SwitchToViewShell_Impl( nViewId ) ) + { // TODO: better error handling? Under which conditions can this fail? OSL_ENSURE( false, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); pViewFrame->DoClose(); return sal_False; diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 133774f2c6..90f9c1d939 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1448,8 +1448,7 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) SfxViewFrame::SfxViewFrame ( SfxFrame* pFrame, - SfxObjectShell* pObjShell, - sal_uInt16 nViewId + SfxObjectShell* pObjShell ) /* [Beschreibung] @@ -1474,22 +1473,6 @@ SfxViewFrame::SfxViewFrame pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() ); pFrame->SetOwnsBindings_Impl( sal_True ); pFrame->CreateWorkWindow_Impl(); - - if ( GetFrame()->IsInPlace() ) - { - LockAdjustPosSizePixel(); - } - - if ( pObjShell && !SwitchToViewShell_Impl( nViewId ) ) - { - // TODO: better error handling? Under which conditions can this fail? - return; - } - - if ( GetFrame()->IsInPlace() ) - { - UnlockAdjustPosSizePixel(); - } } //------------------------------------------------------------------------ @@ -2322,7 +2305,7 @@ void SfxViewFrame::ExecView_Impl pFrameItem->GetValue() >>= xFrame; SfxFrame* pFrame = SfxFrame::Create( xFrame ); pMed->GetItemSet()->ClearItem( SID_HIDDEN ); - pFrame->InsertDocument_Impl( *GetObjectShell() ); + pFrame->InsertDocument_Impl( *GetObjectShell(), *pMed->GetItemSet() ); if ( !bHidden ) xFrame->getContainerWindow()->setVisible( sal_True ); } -- cgit v1.2.3 From 981afc6631f32a409af373c1c82aa46fcfc4b002 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 09:29:45 +0100 Subject: [CWS autorecovery] initial implementation of XModel2::createViewController --- sfx2/inc/sfx2/sfxbasecontroller.hxx | 150 +++++-------------------------- sfx2/inc/sfx2/viewsh.hxx | 2 + sfx2/source/doc/sfxbasemodel.cxx | 91 +++++++++++++++++-- sfx2/source/view/sfxbasecontroller.cxx | 159 +++++++-------------------------- sfx2/source/view/topfrm.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 66 +++++++------- sfx2/source/view/viewsh.cxx | 19 ++++ 7 files changed, 195 insertions(+), 294 deletions(-) diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx index 946f90e6cd..3682ba19a7 100644 --- a/sfx2/inc/sfx2/sfxbasecontroller.hxx +++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -46,7 +46,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -70,27 +71,16 @@ #define ANY ::com::sun::star::uno::Any #define SEQUENCE ::com::sun::star::uno::Sequence #define XDISPATCH ::com::sun::star::frame::XDispatch -#define XDISPATCHPROVIDER ::com::sun::star::frame::XDispatchProvider #define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor #define XMODEL ::com::sun::star::frame::XModel #define XFRAME ::com::sun::star::frame::XFrame -#define XCONTROLLER ::com::sun::star::frame::XController -#define XCONTROLLERBORDER ::com::sun::star::frame::XControllerBorder #define XEVENTLISTENER ::com::sun::star::lang::XEventListener #define MUTEX ::osl::Mutex #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException #define UNOTYPE ::com::sun::star::uno::Type -#define OWEAKOBJECT ::cppu::OWeakObject -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider #define UNOURL ::com::sun::star::util::URL #define OUSTRING ::rtl::OUString -#define XSTATUSINDICATORSUPPLIER ::com::sun::star::task::XStatusIndicatorSupplier -#define XCONTEXTMENUINTERCEPTION ::com::sun::star::ui::XContextMenuInterception #define XCONTEXTMENUINTERCEPTOR ::com::sun::star::ui::XContextMenuInterceptor -#define XUSERINPUTINTERCEPTION ::com::sun::star::awt::XUserInputInterception -#define XDISPATCHINFORMATIONPROVIDER ::com::sun::star::frame::XDispatchInformationProvider -#define XTITLE ::com::sun::star::frame::XTitle -#define XTITLECHANGEBROADCASTER ::com::sun::star::frame::XTitleChangeBroadcaster //________________________________________________________________________________________________________ // forwards @@ -98,6 +88,8 @@ struct IMPL_SfxBaseController_DataContainer ; // impl. struct to hold member of class SfxBaseController +class SfxViewFrame; + sal_Int16 MapGroupIDToCommandGroup( sal_Int16 nGroupID ); sal_Bool SupportsCommandGroup( sal_Int16 nCommandGroup ); sal_Int16 MapCommandGroupToGroupID( sal_Int16 nCommandGroup ); @@ -106,36 +98,19 @@ sal_Int16 MapCommandGroupToGroupID( sal_Int16 nCommandGroup ); // class declarations //________________________________________________________________________________________________________ -struct IMPL_SfxBaseController_MutexContainer -{ - MUTEX m_aMutex ; -} ; - -/**_______________________________________________________________________________________________________ - @short - - - @descr - - - @implements - - - @base - -*/ - -// Forward to impl-baseclass! -//class IMPL_SfxBaseController ; - -class SFX2_DLLPUBLIC SfxBaseController : public XTYPEPROVIDER - , public XCONTROLLER - , public XCONTROLLERBORDER - , public XDISPATCHPROVIDER - , public XSTATUSINDICATORSUPPLIER - , public XCONTEXTMENUINTERCEPTION - , public XUSERINPUTINTERCEPTION - , public XDISPATCHINFORMATIONPROVIDER - , public XTITLE - , public XTITLECHANGEBROADCASTER - , public IMPL_SfxBaseController_MutexContainer - , public OWEAKOBJECT +typedef ::cppu::WeakImplHelper9 < ::com::sun::star::frame::XController2 + , ::com::sun::star::frame::XControllerBorder + , ::com::sun::star::frame::XDispatchProvider + , ::com::sun::star::task::XStatusIndicatorSupplier + , ::com::sun::star::ui::XContextMenuInterception + , ::com::sun::star::awt::XUserInputInterception + , ::com::sun::star::frame::XDispatchInformationProvider + , ::com::sun::star::frame::XTitle + , ::com::sun::star::frame::XTitleChangeBroadcaster + > SfxBaseController_Base; + +class SFX2_DLLPUBLIC SfxBaseController :public SfxBaseController_Base + ,public ::cppu::BaseMutex { //________________________________________________________________________________________________________ // public methods @@ -180,93 +155,13 @@ public: SAL_DLLPRIVATE void ReleaseShell_Impl(); SAL_DLLPRIVATE void BorderWidthsChanged_Impl(); - //____________________________________________________________________________________________________ - // XInterface - //____________________________________________________________________________________________________ - - /**___________________________________________________________________________________________________ - @short give answer, if interface is supported - @descr The interfaces are searched by type. - - @seealso XInterface - - @param "rType" is the type of searched interface. - - @return Any information about found interface - - @onerror A RuntimeException is thrown. - */ - - virtual ANY SAL_CALL queryInterface( const UNOTYPE& rType ) throw( RUNTIMEEXCEPTION ) ; - - /**___________________________________________________________________________________________________ - @short increment refcount - @descr - - - @seealso XInterface - @seealso release() - - @param - - - @return - - - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL acquire() throw() ; - - /**___________________________________________________________________________________________________ - @short decrement refcount - @descr - - - @seealso XInterface - @seealso acquire() - - @param - - - @return - - - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL release() throw() ; + ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL getStatusIndicator( ) throw (::com::sun::star::uno::RuntimeException); //____________________________________________________________________________________________________ - // XTypeProvider + // XController2 //____________________________________________________________________________________________________ - - /**___________________________________________________________________________________________________ - @short get information about supported interfaces - @descr - - - @seealso XTypeProvider - - @param - - - @return Sequence of types of all supported interfaces - - @onerror A RuntimeException is thrown. - */ - - virtual SEQUENCE< UNOTYPE > SAL_CALL getTypes() throw( RUNTIMEEXCEPTION ) ; - - /**___________________________________________________________________________________________________ - @short get implementation id - @descr This ID is neccessary for UNO-caching. If there no ID, cache is disabled. - Another way, cache is enabled. - - @seealso XTypeProvider - - @param - - - @return ID as Sequence of byte - - @onerror A RuntimeException is thrown. - */ - - virtual SEQUENCE< sal_Int8 > SAL_CALL getImplementationId() throw( RUNTIMEEXCEPTION ) ; - - ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL getStatusIndicator( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getComponentWindow() throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getViewControllerName() throw (::com::sun::star::uno::RuntimeException); //____________________________________________________________________________________________________ // XController @@ -501,6 +396,7 @@ public: //#endif private: SAL_DLLPRIVATE void ConnectSfxFrame_Impl( const bool i_bConnect ); + SAL_DLLPRIVATE SfxViewFrame* GetViewFrame_Impl() const; //________________________________________________________________________________________________________ // private variables diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 8ec71a7844..a1dcf4960c 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -180,6 +180,8 @@ public: const TypeId* pType = 0, BOOL bOnlyVisible = TRUE ); static SfxViewShell* Current(); + static SfxViewShell* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController ); + // Ctoren/Dtoren Initialisierung TYPEINFO(); SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWSH) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 739a72272d..d377ceb62e 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -102,6 +102,8 @@ // includes of my own project //________________________________________________________________________________________________________ +#include +#include "viewfac.hxx" #include #include #include @@ -141,6 +143,11 @@ static const ::rtl::OUString SERVICENAME_DESKTOP = ::rtl::OUString::createFromAs namespace css = ::com::sun::star; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::frame::XFrame; +using ::com::sun::star::frame::XController; +using ::com::sun::star::frame::XController2; +using ::com::sun::star::lang::IllegalArgumentException; /** This Listener is used to get notified when the XDocumentProperties of the XModel change. @@ -3914,29 +3921,99 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL SfxBaseModel::getCo css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewControllerNames() throw (css::uno::RuntimeException) { - return css::uno::Sequence< ::rtl::OUString >(); + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( impl_isDisposed() ) + throw lang::DisposedException(); + + const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); + const sal_Int32 nViewFactoryCount = rDocumentFactory.GetViewFactoryCount(); + + Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount ); + for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo ) + { + ::rtl::OUStringBuffer aViewName; + aViewName.appendAscii( "view" ); + aViewName.append( nViewNo ); + aViewNames[nViewNo] = aViewName.makeStringAndClear(); + } + return aViewNames; } //============================================================================= // css::frame::XModel2 -css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& /*Frame*/) +css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDefaultViewController( const css::uno::Reference< css::frame::XFrame >& i_rFrame ) throw (css::uno::RuntimeException , css::lang::IllegalArgumentException, css::uno::Exception ) { - return css::uno::Reference< css::frame::XController2 >(); + return createViewController( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "view0" ) ), Sequence< PropertyValue >(), i_rFrame ); + // TODO: extende the SfxViewFactory with support for speaking view names } //============================================================================= // css::frame::XModel2 -css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createViewController(const ::rtl::OUString& /*ViewName*/, - const css::uno::Sequence< css::beans::PropertyValue >& /*Arguments*/, - const css::uno::Reference< css::frame::XFrame >& /*Frame */) +css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createViewController( + const ::rtl::OUString& i_rViewName, const Sequence< PropertyValue >& i_rArguments, const Reference< XFrame >& i_rFrame ) throw (css::uno::RuntimeException , css::lang::IllegalArgumentException, css::uno::Exception ) { - return css::uno::Reference< css::frame::XController2 >(); + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( impl_isDisposed() ) + throw lang::DisposedException(); + + // number of view to create + if ( i_rViewName.indexOfAsciiL( "view", 4 ) != 0 ) + throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); + const USHORT nViewId = (USHORT)i_rViewName.copy( 4 ).toInt32(); + + SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); + sal_Int32 nViewNo = -1; + for ( nViewNo = 0; nViewNo < rDocumentFactory.GetViewFactoryCount(); ++nViewNo ) + if ( rDocumentFactory.GetViewFactory( nViewNo ).GetOrdinal() == nViewId ) + break; + if ( nViewNo >= rDocumentFactory.GetViewFactoryCount() ) + throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); + + // determine previous shell (used in some special cases) + ::comphelper::NamedValueCollection aCreationArgs( i_rArguments ); + Reference< XController > xPreviousController = aCreationArgs.getOrDefault( "PreviousView", Reference< XController >() ); + SfxViewShell* pOldViewShell = SfxViewShell::Get( xPreviousController ); + OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell != NULL ), + "SfxBaseModel::createViewController: invalid old controller!" ); + + // determine the ViewFrame belonging to the given XFrame + SfxViewFrame* pViewFrame = NULL; + for ( pViewFrame = SfxViewFrame::GetFirst( GetObjectShell(), FALSE ); + pViewFrame; + pViewFrame= SfxViewFrame::GetNext( *pViewFrame, GetObjectShell(), FALSE ) + ) + { + if ( pViewFrame->GetFrame()->GetFrameInterface() == i_rFrame ) + break; + } + if ( !pViewFrame ) + // TODO: Effectively, this means that only our dedicated SFX-Loader can load documents into an arbitrary + // XFrame, since it will (directly or indirectly) create the Sfx(View)Frame which we need here. + // We should evaluate whether (after the re-factoring) it is possible/feasible to allow for an arbitrary + // XFrame here, by creating the necessary Sfx(View)Frame ourself. Finally, this is what a "view factory" + // is about ... + throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "invalid frame" ) ), *this, 3 ); + + // delegate to SFX' view factory + SfxViewFactory& rViewFactory = rDocumentFactory.GetViewFactory( nViewNo ); + SfxViewShell* pViewShell = rViewFactory.CreateInstance( pViewFrame, pOldViewShell ); + ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" ); + + // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also + pViewFrame->GetDispatcher()->SetDisableFlags( 0 ); + pViewFrame->SetViewShell_Impl( pViewShell ); + + // ensure a default controller, if the view shell did not provide an own implementation + if ( !pViewShell->GetController().is() ) + pViewShell->SetController( new SfxBaseController( pViewShell ) ); + + return Reference< XController2 >( pViewShell->GetController(), UNO_QUERY_THROW ); } //============================================================================= diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 6a5c5ae8d3..3821ec7bc6 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -113,6 +114,13 @@ #define TIMEOUT_START_RESCHEDULE 10L /* 10th s */ using namespace ::com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::lang::DisposedException; +using ::com::sun::star::awt::XWindow; +using ::com::sun::star::frame::XController; +using ::com::sun::star::frame::XDispatchProvider; namespace css = ::com::sun::star; struct GroupIDToCommandGroup @@ -224,7 +232,7 @@ void reschedule() class SfxStatusIndicator : public ::cppu::WeakImplHelper2< ::com::sun::star::task::XStatusIndicator, ::com::sun::star::lang::XEventListener > { friend class SfxBaseController; - ::com::sun::star::uno::Reference < XCONTROLLER > xOwner; + ::com::sun::star::uno::Reference < XController > xOwner; ::com::sun::star::uno::Reference < ::com::sun::star::task::XStatusIndicator > xProgress; SfxWorkWindow* pWorkWindow; sal_Int32 _nRange; @@ -517,8 +525,7 @@ void SAL_CALL IMPL_SfxBaseController_ListenerHelper::disposing( const EVENTOBJEC //________________________________________________________________________________________________________ DBG_NAME(sfx2_SfxBaseController) SfxBaseController::SfxBaseController( SfxViewShell* pViewShell ) - : IMPL_SfxBaseController_MutexContainer ( ) - , m_pData ( new IMPL_SfxBaseController_DataContainer( m_aMutex, pViewShell, this )) + : m_pData ( new IMPL_SfxBaseController_DataContainer( m_aMutex, pViewShell, this )) { DBG_CTOR(sfx2_SfxBaseController,NULL); m_pData->m_pViewShell->SetController( this ); @@ -535,138 +542,40 @@ SfxBaseController::~SfxBaseController() } //________________________________________________________________________________________________________ -// SfxBaseController -> XInterface +// SfxBaseController -> XController2 //________________________________________________________________________________________________________ -ANY SAL_CALL SfxBaseController::queryInterface( const UNOTYPE& rType ) throw( RUNTIMEEXCEPTION ) -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Ask for my own supported interfaces ... - ANY aReturn( ::cppu::queryInterface( rType , - static_cast< XTYPEPROVIDER* > ( this ) , - static_cast< XCOMPONENT* > ( this ) , - static_cast< XCONTROLLER* > ( this ) , - static_cast< XCONTROLLERBORDER* > ( this ) , - static_cast< XUSERINPUTINTERCEPTION* > ( this ) , - static_cast< XSTATUSINDICATORSUPPLIER* > ( this ) , - static_cast< XCONTEXTMENUINTERCEPTION* > ( this ) , - static_cast< XDISPATCHPROVIDER* > ( this ), - static_cast< XTITLE* > ( this ), - static_cast< XTITLECHANGEBROADCASTER* > ( this ), - static_cast< XDISPATCHINFORMATIONPROVIDER* > ( this ) ) ) ; - - // If searched interface supported by this class ... - if ( aReturn.hasValue() == sal_True ) - { - // ... return this information. - return aReturn ; - } - else - { - // Else; ... ask baseclass for interfaces! - return OWeakObject::queryInterface( rType ) ; - } -} -//________________________________________________________________________________________________________ -// SfxBaseController -> XInterface -//________________________________________________________________________________________________________ - -void SAL_CALL SfxBaseController::acquire() throw() +Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (RuntimeException) { - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - OWeakObject::acquire() ; -} - -//________________________________________________________________________________________________________ -// SfxBaseController -> XInterface -//________________________________________________________________________________________________________ - -void SAL_CALL SfxBaseController::release() throw() -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( !m_pData->m_pViewShell ) + throw DisposedException(); - // Forward to baseclass - OWeakObject::release() ; + return Reference< XWindow >( GetViewFrame_Impl()->GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY_THROW ); } -//________________________________________________________________________________________________________ -// SfxBaseController -> XTypeProvider -//________________________________________________________________________________________________________ - -SEQUENCE< UNOTYPE > SAL_CALL SfxBaseController::getTypes() throw( RUNTIMEEXCEPTION ) +::rtl::OUString SAL_CALL SfxBaseController::getViewControllerName() throw (RuntimeException) { - // Optimize this method ! - // We initialize a static variable only one time. And we don't must use a mutex at every call! - // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL! - static OTYPECOLLECTION* pTypeCollection = NULL ; - - if ( pTypeCollection == NULL ) - { - // Ready for multithreading; get global mutex for first call of this method only! see before - MUTEXGUARD aGuard( MUTEX::getGlobalMutex() ) ; - - // Control these pointer again ... it can be, that another instance will be faster then these! - if ( pTypeCollection == NULL ) - { - // Create a static typecollection ... - static OTYPECOLLECTION aTypeCollection( ::getCppuType(( const REFERENCE< XTYPEPROVIDER >*)NULL ) , - ::getCppuType(( const REFERENCE< XCONTROLLER >*)NULL ) , - ::getCppuType(( const REFERENCE< XCONTROLLERBORDER >*)NULL ) , - ::getCppuType(( const REFERENCE< XDISPATCHPROVIDER >*)NULL ) , - ::getCppuType(( const REFERENCE< XSTATUSINDICATORSUPPLIER >*)NULL ) , - ::getCppuType(( const REFERENCE< XCONTEXTMENUINTERCEPTION >*)NULL ) , - ::getCppuType(( const REFERENCE< XUSERINPUTINTERCEPTION >*)NULL ) , - ::getCppuType(( const REFERENCE< XTITLE >*)NULL ) , - ::getCppuType(( const REFERENCE< XTITLECHANGEBROADCASTER >*)NULL ) , - ::getCppuType(( const REFERENCE< XDISPATCHINFORMATIONPROVIDER >*)NULL ) ); - // ... and set his address to static pointer! - pTypeCollection = &aTypeCollection ; - } - } + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( !m_pData->m_pViewShell ) + throw DisposedException(); - return pTypeCollection->getTypes() ; + ::rtl::OUStringBuffer sViewName; + sViewName.appendAscii( "view" ); + sViewName.append( sal_Int32( GetViewFrame_Impl()->GetCurViewId() ) ); + return sViewName.makeStringAndClear(); } -//________________________________________________________________________________________________________ -// SfxBaseController -> XTypeProvider -//________________________________________________________________________________________________________ - -SEQUENCE< sal_Int8 > SAL_CALL SfxBaseController::getImplementationId() throw( RUNTIMEEXCEPTION ) +SfxViewFrame* SfxBaseController::GetViewFrame_Impl() const { - // Create one Id for all instances of this class. - // Use ethernet address to do this! (sal_True) - - // Optimize this method - // We initialize a static variable only one time. And we don't must use a mutex at every call! - // For the first call; pID is NULL - for the second call pID is different from NULL! - static OIMPLEMENTATIONID* pID = NULL ; - - if ( pID == NULL ) - { - // Ready for multithreading; get global mutex for first call of this method only! see before - MUTEXGUARD aGuard( MUTEX::getGlobalMutex() ) ; - - // Control these pointer again ... it can be, that another instance will be faster then these! - if ( pID == NULL ) - { - // Create a new static ID ... - static OIMPLEMENTATIONID aID( sal_False ) ; - // ... and set his address to static pointer! - pID = &aID ; - } - } - - return pID->getImplementationId() ; + ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" ); + SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame(); + ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" ); + return pActFrame; } //________________________________________________________________________________________________________ -// SfxBaseController -> XController +// SfxBaseController -> XController2 -> XController //________________________________________________________________________________________________________ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame ) throw( ::com::sun::star::uno::RuntimeException ) @@ -856,7 +765,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& if ( xFrame.is() ) xFrame->setName( sTargetFrameName ); - REFERENCE < XDISPATCHPROVIDER > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY ); + Reference< XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY ); if ( xProv.is() ) return xProv->queryDispatch( aURL, sTargetFrameName, ::com::sun::star::frame::FrameSearchFlag::SELF ); } @@ -1089,11 +998,11 @@ void SfxBaseController::BorderWidthsChanged_Impl() void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::RuntimeException ) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); - REFERENCE < XCONTROLLER > xTmp( this ); + Reference< XController > xTmp( this ); m_pData->m_bDisposing = sal_True ; EVENTOBJECT aEventObject; - aEventObject.Source = (XCONTROLLER*)this ; + aEventObject.Source = *this ; m_pData->m_aListenerContainer.disposeAndClear( aEventObject ) ; if ( m_pData->m_pController && m_pData->m_pController->getFrame().is() ) @@ -1110,7 +1019,7 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime if ( pFrame ) { EVENTOBJECT aObject; - aObject.Source = (OWEAKOBJECT*)this ; + aObject.Source = *this ; SfxObjectShell* pDoc = pFrame->GetObjectShell() ; SfxViewFrame *pView = SfxViewFrame::GetFirst(pDoc); diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 4fb07ee837..7f78bcbdcf 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -792,7 +792,7 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& OSL_ENSURE( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT, "SfxFrame::InsertDocument_Impl: so this code wasn't dead?" ); // Before CWS autorecovery, there was code which postponed setting the ViewData/Mark to a later time - // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since loads this method + // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method // here is never called before the load process finished. if ( pViewDataItem ) { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 90f9c1d939..82d8f42a66 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -66,7 +66,7 @@ #include #include #include -#include +#include #include #include #include @@ -1328,12 +1328,15 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) break; } - case SFX_HINT_DYING: case SFX_HINT_DEINITIALIZING: - // when the Object is being deleted, destroy the view too GetFrame()->DoClose(); + break; + case SFX_HINT_DYING: + // when the Object is being deleted, destroy the view too if ( xObjSh.Is() ) ReleaseObjectShell_Impl(); + else + GetFrame()->DoClose(); break; } @@ -2019,43 +2022,37 @@ SfxViewShell* SfxViewFrame::LoadNewView_Impl( const USHORT i_nNewViewNo, SfxView OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewView_Impl: not allowed to be called with an exsiting view shell!" ); OSL_PRECOND( GetObjectShell() != NULL, "SfxViewFrame::LoadNewView_Impl: no document -> no loading!" ); - // our UNO doc - const Reference < XModel > xModel( GetObjectShell()->GetModel(), UNO_QUERY_THROW ); + const Reference < XFrame > xFrame( GetFrame()->GetFrameInterface() ); + const Reference < XModel2 > xModel( GetObjectShell()->GetModel(), UNO_QUERY_THROW ); - // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // >>> to be moved into a UNO view factory implementation - SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); + const USHORT nViewId = GetObjectShell()->GetFactory().GetViewFactory( i_nNewViewNo ).GetOrdinal(); + ::rtl::OUStringBuffer sViewName; + sViewName.appendAscii( "view" ); + sViewName.append( sal_Int32( nViewId ) ); + // TODO: extende the SfxViewFactory with support for speaking view names - // remember ViewID - pImp->nCurViewId = rDocumentFactory.GetViewFactory( i_nNewViewNo ).GetOrdinal(); - // TODO: shouldn't this be done in success case only? + // let the model create a new controller + ::comphelper::NamedValueCollection aViewCreationArgs; + if ( i_pOldShell != NULL ) + aViewCreationArgs.put( "PreviousView", i_pOldShell->GetController() ); - SfxViewFactory& rViewFactory = rDocumentFactory.GetViewFactory( i_nNewViewNo ); + const Reference< XController2 > xController( xModel->createViewController( + sViewName.makeStringAndClear(), + aViewCreationArgs.getPropertyValues(), + xFrame + ) ); + SfxViewShell* pViewShell = SfxViewShell::Get( xController.get() ); + ENSURE_OR_THROW( pViewShell, "invalid controller returned by view factory" ); - SfxViewShell* pViewShell = rViewFactory.CreateInstance( this, i_pOldShell ); - ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" ); - - // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also - GetDispatcher()->SetDisableFlags( 0 ); - SetViewShell_Impl( pViewShell ); - - // ensure a default controller, if the view shell did not provide an own implementation - if ( !pViewShell->GetController().is() ) - pViewShell->SetController( new SfxBaseController( pViewShell ) ); - - // <<< to be moved into a UNO view factory implementation - // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + // remember ViewID + pImp->nCurViewId = nViewId; // introduce model/view/controller to each other - Reference < XWindow > xWindow( GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY ); - Reference < XFrame > xFrame( GetFrame()->GetFrameInterface() ); - Reference < XController > xController( pViewShell->GetController() ); - - xController->attachModel( xModel ); - xModel->connectController( xController ); - xFrame->setComponent( xWindow, xController ); + xController->attachModel( xModel.get() ); + xModel->connectController( xController.get() ); + xFrame->setComponent( xController->getComponentWindow(), xController.get() ); xController->attachFrame( xFrame ); - xModel->setCurrentController( xController ); + xModel->setCurrentController( xController.get() ); return pViewShell; } @@ -2141,7 +2138,8 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl { // the SfxCode is not able to cope with exceptions thrown while creating views // the code will crash in the stack unwinding procedure, so we shouldn't let exceptions go through here - DBG_ERROR("Exception in SwitchToViewShell_Impl - urgent issue. Please contact development!"); + DBG_UNHANDLED_EXCEPTION(); + return sal_False; } DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" ); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 53399c1c45..0904012a5d 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1360,6 +1360,25 @@ SfxViewShell* SfxViewShell::Current() //-------------------------------------------------------------------- +SfxViewShell* SfxViewShell::Get( const Reference< XController>& i_rController ) +{ + if ( !i_rController.is() ) + return NULL; + + SfxViewShell* pViewShell = NULL; + for ( SfxViewShell* pViewShell = SfxViewShell::GetFirst( NULL, FALSE ); + pViewShell; + pViewShell = SfxViewShell::GetNext( *pViewShell, NULL, FALSE ) + ) + { + if ( pViewShell->GetController() == i_rController ) + return pViewShell; + } + return NULL; +} + +//-------------------------------------------------------------------- + SdrView* SfxViewShell::GetDrawView() const /* [Beschreibung] -- cgit v1.2.3 From a9d821bdcce632edae82623d2855b3892e7bbca8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 09:29:45 +0100 Subject: [CWS autorecovery] somewhat separated the 'switch view shell on SFX level' from the 'load new document on UNO level' case --- sfx2/inc/sfx2/sfxbasemodel.hxx | 3 + sfx2/inc/sfx2/viewfrm.hxx | 19 ++++-- sfx2/source/doc/sfxbasemodel.cxx | 61 +++++++++++++----- sfx2/source/view/frmload.cxx | 10 +-- sfx2/source/view/impframe.hxx | 7 --- sfx2/source/view/topfrm.cxx | 11 ++-- sfx2/source/view/viewfrm.cxx | 130 ++++++++++++++++++++++++++++----------- 7 files changed, 166 insertions(+), 75 deletions(-) diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index e6d68889e4..2694865e2f 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -200,6 +200,7 @@ class SfxPrinter; class SfxViewShell; class SfxObjectShell ; class SfxEventHint; +class SfxViewFrame; struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of class SfxBaseModel //________________________________________________________________________________________________________ @@ -1521,6 +1522,8 @@ private: SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper (); SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper (); + SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ) const; + //________________________________________________________________________________________________________ // private variables and methods //________________________________________________________________________________________________________ diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index d68efb0a1c..80f95ddd9a 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -41,6 +41,7 @@ #include #include #include +#include class SfxMacro; class SvBorder; @@ -164,9 +165,8 @@ public: SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM) static void SetViewFrame( SfxViewFrame* ); - static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, - USHORT nViewId=0, - BOOL bHidden=FALSE ); + static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, BOOL bHidden = FALSE ); + static SfxViewFrame* Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* Current(); static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); @@ -301,11 +301,20 @@ public: SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &); SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); - SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); + SAL_DLLPRIVATE void SetCurViewId_Impl( const USHORT i_nID ); + //#endif private: - SAL_DLLPRIVATE SfxViewShell* LoadNewView_Impl( const USHORT i_nNewViewNo, SfxViewShell* i_pOldShell ); + SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); + SAL_DLLPRIVATE SfxViewShell* LoadNewView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); + SAL_DLLPRIVATE static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > + LoadDocument_Impl( + const SfxObjectShell& i_rDoc, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rArgs, + const USHORT i_nViewId + ); }; //-------------------------------------------------------------------- diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index d377ceb62e..89a3f75ed2 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3947,7 +3947,46 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef css::uno::Exception ) { return createViewController( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "view0" ) ), Sequence< PropertyValue >(), i_rFrame ); - // TODO: extende the SfxViewFactory with support for speaking view names + // TODO: extend the SfxViewFactory with support for speaking view names +} + +//============================================================================= +SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ) const +{ + SfxViewFrame* pViewFrame = NULL; + for ( pViewFrame = SfxViewFrame::GetFirst( GetObjectShell(), FALSE ); + pViewFrame; + pViewFrame= SfxViewFrame::GetNext( *pViewFrame, GetObjectShell(), FALSE ) + ) + { + if ( pViewFrame->GetFrame()->GetFrameInterface() == i_rFrame ) + break; + } + if ( !pViewFrame ) + { + // no view frame, yet, but perhaps a mere frame? + SfxFrame* pFrame = NULL; + for ( pFrame = SfxFrame::GetFirst(); + pFrame; + pFrame = SfxFrame::GetNext( *pFrame ) + ) + { + if ( ( pFrame->GetFrameInterface() == i_rFrame ) + && ( pFrame->GetCurrentViewFrame() == NULL ) + // TODO: this condition is somewhat hacky, as it relies on the fact that this is (usually) + // the SfxFrame which is, up the stack, within its InsertDocument_Impl call. + // Before the refactoring is finally done, this is to be removed. + ) + break; + } + if ( !pFrame ) + { + pFrame = SfxFrame::Create( i_rFrame ); + ENSURE_OR_THROW( pFrame, "no SfxFrame created for the XFrame" ); + } + pViewFrame = new SfxViewFrame( pFrame, GetObjectShell() ); + } + return pViewFrame; } //============================================================================= @@ -3983,22 +4022,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie "SfxBaseModel::createViewController: invalid old controller!" ); // determine the ViewFrame belonging to the given XFrame - SfxViewFrame* pViewFrame = NULL; - for ( pViewFrame = SfxViewFrame::GetFirst( GetObjectShell(), FALSE ); - pViewFrame; - pViewFrame= SfxViewFrame::GetNext( *pViewFrame, GetObjectShell(), FALSE ) - ) - { - if ( pViewFrame->GetFrame()->GetFrameInterface() == i_rFrame ) - break; - } - if ( !pViewFrame ) - // TODO: Effectively, this means that only our dedicated SFX-Loader can load documents into an arbitrary - // XFrame, since it will (directly or indirectly) create the Sfx(View)Frame which we need here. - // We should evaluate whether (after the re-factoring) it is possible/feasible to allow for an arbitrary - // XFrame here, by creating the necessary Sfx(View)Frame ourself. Finally, this is what a "view factory" - // is about ... - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "invalid frame" ) ), *this, 3 ); + SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame ); // delegate to SFX' view factory SfxViewFactory& rViewFactory = rDocumentFactory.GetViewFactory( nViewNo ); @@ -4009,6 +4033,9 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie pViewFrame->GetDispatcher()->SetDisableFlags( 0 ); pViewFrame->SetViewShell_Impl( pViewShell ); + // remember ViewID + pViewFrame->SetCurViewId_Impl( rViewFactory.GetOrdinal() ); + // ensure a default controller, if the view shell did not provide an own implementation if ( !pViewShell->GetController().is() ) pViewShell->SetController( new SfxBaseController( pViewShell ) ); diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index e868d92d23..37659082ef 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -565,11 +565,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // the latter. } - // create a frame - SfxFrame* pTargetFrame = SfxFrame::Create( _rTargetFrame ); - ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); - wFrame = pTargetFrame; - // get the SfxObjectShell (still needed at the moment) SfxObjectShellLock xDoc = impl_findObjectShell( xModel ); ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" ); @@ -584,6 +579,11 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // code at the very end of this method cares for closing the XModel, which should also close the // ObjectShell. + // create a frame + SfxFrame* pTargetFrame = SfxFrame::Create( _rTargetFrame ); + ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + wFrame = pTargetFrame; + // insert the document into the frame if ( !impl_plugDocIntoFrame( aDescriptor, *pTargetFrame, *xDoc ) ) throw RuntimeException(); diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index 110f7dc545..4f3150978c 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -56,14 +56,10 @@ class SfxFrame_Impl : public SfxBroadcaster, public SvCompatWeakBase { public: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame; - String aFrameIdName; sal_uInt32 nType; - sal_uInt32 nHistoryPos; SfxViewFrame* pCurrentViewFrame; SfxFrameDescriptor* pDescr; - sal_uInt16 nFrameId; sal_uInt16 nLocks; - sal_Bool bCloseOnUnlock : 1; sal_Bool bClosing : 1; sal_Bool bPrepClosing : 1; sal_Bool bInCancelTransfers : 1; @@ -82,12 +78,9 @@ public: SfxFrame_Impl( SfxFrame* pAntiImplP ) :SvCompatWeakBase( pAntiImplP ) ,nType( 0L ) - ,nHistoryPos( 0 ) ,pCurrentViewFrame( NULL ) ,pDescr( NULL ) - ,nFrameId( 0 ) ,nLocks( 0 ) - ,bCloseOnUnlock( sal_False ) ,bClosing(sal_False) ,bPrepClosing(sal_False) ,bInCancelTransfers( sal_False ) diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 7f78bcbdcf..3d9ae38447 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -34,6 +34,7 @@ #endif #include +#include #include #include #include @@ -768,13 +769,11 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& if ( nPluginMode && ( nPluginMode != 2 ) ) SetInPlace_Impl( TRUE ); - SfxViewFrame* pViewFrame = new SfxViewFrame( this, &rDoc ); - if ( !pViewFrame->SwitchToViewShell_Impl( nViewId ) ) - { // TODO: better error handling? Under which conditions can this fail? - OSL_ENSURE( false, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); - pViewFrame->DoClose(); + SfxViewFrame* pViewFrame = SfxViewFrame::Create( *this, rDoc, nViewId ? nViewId : rDoc.GetFactory().GetViewFactory( 0 ).GetOrdinal() ); + OSL_ENSURE( pViewFrame, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); + if ( !pViewFrame ) + // TODO: better error handling? Under which conditions can this fail? return sal_False; - } if ( nPluginMode == 1 ) { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 82d8f42a66..af965cbb61 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -102,6 +102,7 @@ using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using ::com::sun::star::awt::XWindow; +using ::com::sun::star::beans::PropertyValue; namespace css = ::com::sun::star; #ifndef GCC @@ -2017,44 +2018,93 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const } //-------------------------------------------------------------------- -SfxViewShell* SfxViewFrame::LoadNewView_Impl( const USHORT i_nNewViewNo, SfxViewShell* i_pOldShell ) +Reference< XController2 > SfxViewFrame::LoadDocument_Impl( + const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const Sequence< PropertyValue >& i_rArgs, + const USHORT i_nViewId ) { - OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewView_Impl: not allowed to be called with an exsiting view shell!" ); - OSL_PRECOND( GetObjectShell() != NULL, "SfxViewFrame::LoadNewView_Impl: no document -> no loading!" ); - - const Reference < XFrame > xFrame( GetFrame()->GetFrameInterface() ); - const Reference < XModel2 > xModel( GetObjectShell()->GetModel(), UNO_QUERY_THROW ); + ENSURE_OR_THROW( i_rFrame.is(), "illegal frame" ); + const Reference < XModel2 > xModel( i_rDoc.GetModel(), UNO_QUERY_THROW ); - const USHORT nViewId = GetObjectShell()->GetFactory().GetViewFactory( i_nNewViewNo ).GetOrdinal(); ::rtl::OUStringBuffer sViewName; sViewName.appendAscii( "view" ); - sViewName.append( sal_Int32( nViewId ) ); - // TODO: extende the SfxViewFactory with support for speaking view names + sViewName.append( sal_Int32( i_nViewId ) ); + // TODO: extend the SfxViewFactory with support for speaking view names // let the model create a new controller + const Reference< XController2 > xController( xModel->createViewController( + sViewName.makeStringAndClear(), + i_rArgs, + i_rFrame + ), UNO_SET_THROW ); + + // introduce model/view/controller to each other + xController->attachModel( xModel.get() ); + xModel->connectController( xController.get() ); + i_rFrame->setComponent( xController->getComponentWindow(), xController.get() ); + xController->attachFrame( i_rFrame ); + xModel->setCurrentController( xController.get() ); + + return xController; +} + +//-------------------------------------------------------------------- +SfxViewShell* SfxViewFrame::LoadNewView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ) +{ + ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" ); + OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewView_Impl: not allowed to be called with an exsiting view shell!" ); + ::comphelper::NamedValueCollection aViewCreationArgs; if ( i_pOldShell != NULL ) aViewCreationArgs.put( "PreviousView", i_pOldShell->GetController() ); - const Reference< XController2 > xController( xModel->createViewController( - sViewName.makeStringAndClear(), + const Reference< XController2 > xController = LoadDocument_Impl( + *GetObjectShell(), + GetFrame()->GetFrameInterface(), aViewCreationArgs.getPropertyValues(), - xFrame - ) ); + i_nViewId + ); + SfxViewShell* pViewShell = SfxViewShell::Get( xController.get() ); ENSURE_OR_THROW( pViewShell, "invalid controller returned by view factory" ); + return pViewShell; +} - // remember ViewID - pImp->nCurViewId = nViewId; +//-------------------------------------------------------------------- - // introduce model/view/controller to each other - xController->attachModel( xModel.get() ); - xModel->connectController( xController.get() ); - xFrame->setComponent( xController->getComponentWindow(), xController.get() ); - xController->attachFrame( xFrame ); - xModel->setCurrentController( xController.get() ); +SfxViewFrame* SfxViewFrame::Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ) +{ + bool bSuccess = false; + SfxViewFrame* pViewFrame = NULL; + try + { + Reference< XController2 > xController = LoadDocument_Impl( + i_rDoc, i_rFrame.GetFrameInterface(), Sequence< PropertyValue >(), i_nViewId ); + ENSURE_OR_THROW( xController.is(), "invalid controller returned by LoadDocument_Impl" ); + // this is expected to throw in case of a failure ... - return pViewShell; + if ( xController.is() ) + { + for ( pViewFrame = SfxViewFrame::GetFirst( &i_rDoc, FALSE ); + pViewFrame; + pViewFrame = SfxViewFrame::GetNext( *pViewFrame, &i_rDoc, FALSE ) + ) + { + if ( pViewFrame->GetViewShell()->GetController() == xController ) + break; + } + if ( !pViewFrame ) + { + OSL_ENSURE( false, "SfxViewFrame::Create: wrong controller implementation!" ); + Reference< XComponent > xComponent( xController, UNO_QUERY_THROW ); + xComponent->dispose(); + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return pViewFrame; } //-------------------------------------------------------------------- @@ -2099,13 +2149,9 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl { try { - ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" ); - - GetBindings().ENTERREGISTRATIONS(); - LockAdjustPosSizePixel(); - // if we already have a view shell, remove it SfxViewShell* pOldSh = GetViewShell(); + OSL_PRECOND( pOldSh, "SfxViewFrame::SwitchToViewShell_Impl: that's called *switch* (not for *initial-load*) for a reason" ); if ( pOldSh ) { // ask wether it can be closed @@ -2120,10 +2166,13 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl SetViewShell_Impl( NULL ); } + GetBindings().ENTERREGISTRATIONS(); + LockAdjustPosSizePixel(); + // create and load new ViewShell SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory(); - const sal_uInt16 nNewNo = ( bIsIndex || !nViewIdOrNo ) ? nViewIdOrNo : rDocFact.GetViewNo_Impl( nViewIdOrNo, 0 ); - SfxViewShell* pNewSh = LoadNewView_Impl( nNewNo, pOldSh ); + const sal_uInt16 nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; + SfxViewShell* pNewSh = LoadNewView_Impl( nViewId, pOldSh ); // allow resize events to be processed UnlockAdjustPosSizePixel(); @@ -2146,6 +2195,12 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl return sal_True; } +//------------------------------------------------------------------------- +void SfxViewFrame::SetCurViewId_Impl( const USHORT i_nID ) +{ + pImp->nCurViewId = i_nID; +} + //------------------------------------------------------------------------- sal_uInt16 SfxViewFrame::GetCurViewId() const { @@ -2224,10 +2279,14 @@ void SfxViewFrame::ExecView_Impl case SID_VIEWSHELL: { const SfxPoolItem *pItem = 0; - if ( rReq.GetArgs() && - SFX_ITEM_SET == rReq.GetArgs()->GetItemState( SID_VIEWSHELL, sal_False, &pItem ) ) - rReq.SetReturnValue( SfxBoolItem(0, SwitchToViewShell_Impl( - (sal_uInt16)((const SfxUInt16Item*) pItem)->GetValue()) )); + if ( rReq.GetArgs() + && SFX_ITEM_SET == rReq.GetArgs()->GetItemState( SID_VIEWSHELL, sal_False, &pItem ) + ) + { + const sal_uInt16 nViewId = static_cast< const SfxUInt16Item* >( pItem )->GetValue(); + BOOL bSuccess = SwitchToViewShell_Impl( nViewId ); + rReq.SetReturnValue( SfxBoolItem( 0, bSuccess ) ); + } break; } @@ -2237,8 +2296,9 @@ void SfxViewFrame::ExecView_Impl case SID_VIEWSHELL3: case SID_VIEWSHELL4: { - rReq.SetReturnValue( SfxBoolItem(0, - SwitchToViewShell_Impl( rReq.GetSlot() - SID_VIEWSHELL0, sal_True ) ) ); + const sal_uInt16 nViewNo = rReq.GetSlot() - SID_VIEWSHELL0; + BOOL bSuccess = SwitchToViewShell_Impl( nViewNo, sal_True ); + rReq.SetReturnValue( SfxBoolItem( 0, bSuccess ) ); break; } -- cgit v1.2.3 From 181a83c2b702eb7b68a910aab6227cc92f45b5e1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 09:29:45 +0100 Subject: [CWS autorecovery] replace InsertDocument_Impl calls with UNO component loading --- sfx2/inc/sfx2/frame.hxx | 2 +- sfx2/source/view/frmload.cxx | 7 +-- sfx2/source/view/topfrm.cxx | 108 ++++++++++++++++++++----------------------- 3 files changed, 56 insertions(+), 61 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index cc28173887..63d7622a90 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -141,7 +141,7 @@ public: static SfxFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); static SfxFrame* Create( SfxObjectShell* pDoc = NULL, USHORT nViewId = NULL, bool bHidden = false, const SfxItemSet* pSet = NULL); - static SfxFrame* Create( SfxObjectShell* pDoc, Window& rWindow, USHORT nViewId = 0, bool bHidden = false, const SfxItemSet* pSet = NULL ); + static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ); SvCompatWeakHdl* GetHdl(); Window& GetWindow() const; diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 37659082ef..9ce223d6ea 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -470,9 +470,9 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA if ( !aDescriptor.has( "Referer" ) ) aDescriptor.put( "Referer", ::rtl::OUString() ); - // TODO: is this needed? finally, when loading is successfull, then ther should be no need for this item, + // TODO: is this needed? finally, when loading is successfull, then there should be no need for this item, // as the document can always obtain its frame. In particular, there might be situations where this frame - // is access, but already disposed: Imagine the user loading a document, opening a second view on it, and + // is accessed, but already disposed: Imagine the user loading a document, opening a second view on it, and // then closing the first view/frame. aDescriptor.put( "Frame", _rTargetFrame ); @@ -570,7 +570,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" ); // if the document is created hidden, prevent it being deleted until it is shown or disposed - impl_lockHiddenDocument( *xDoc, aDescriptor ); + if ( !bExternalModel ) + impl_lockHiddenDocument( *xDoc, aDescriptor ); // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef, // then this would not be necessary, /me thinks. That is, the *Lock classes inc/dec a "Lock" counter // (additional to the ref counter) in their ctor/dtor, and if the lock counter goes to 0, the diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 3d9ae38447..79611aa09d 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -109,6 +111,9 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; using ::com::sun::star::document::XViewDataSupplier; +using ::com::sun::star::lang::XMultiServiceFactory; +using ::com::sun::star::lang::XComponent; +using ::com::sun::star::frame::XComponentLoader; //------------------------------------------------------------------------ @@ -447,44 +452,6 @@ SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, pFrame->pImp->bHidden = bHidden; Window* pWindow = pFrame->GetTopWindow_Impl(); - if ( pWindow && pDoc ) - { - ::rtl::OUString aDocServiceName( pDoc->GetFactory().GetDocumentServiceName() ); - ::rtl::OUString aProductName; - ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName; - String aTitle = pDoc->GetTitle( SFX_TITLE_DETECT ); - aTitle += String::CreateFromAscii( " - " ); - aTitle += String(aProductName); - aTitle += ' '; - aTitle += String( GetModuleName_Impl( aDocServiceName ) ); -#ifndef PRODUCT - ::rtl::OUString aDefault; - aTitle += DEFINE_CONST_UNICODE(" ["); - String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); - aTitle += aVerId; - aTitle += ']'; -#endif - - // append TAB string if available - aTitle += _getTabString(); - - /* AS_TITLE - pWindow->SetText( aTitle ); - */ - - /* AS_ICON - if( pWindow->GetType() == WINDOW_WORKWINDOW ) - { - SvtModuleOptions::EFactory eFactory; - if( SvtModuleOptions::ClassifyFactoryByName( aDocServiceName, eFactory ) ) - { - WorkWindow* pWorkWindow = (WorkWindow*)pWindow; - pWorkWindow->SetIcon( (sal_uInt16) SvtModuleOptions().GetFactoryIcon( eFactory ) ); - } - } - */ - } - if ( pDoc && pDoc != pFrame->GetCurrentDocument() ) { if ( nViewId ) @@ -497,29 +464,58 @@ SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, return pFrame; } -SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, Window& rWindow, USHORT nViewId, bool bHidden, const SfxItemSet* pSet ) +SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ) { - Reference < ::com::sun::star::lang::XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() ); - Reference < XFramesSupplier > xDesktop ( xFact->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); - Reference < XFrame > xFrame( xFact->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Frame") ), UNO_QUERY ); + SfxFrame* pFrame = NULL; + try + { + // create and initialize new top level frame for this window + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference < XFramesSupplier > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); + Reference < XFrame > xFrame( aContext.createComponent( "com.sun.star.frame.Frame"), UNO_QUERY_THROW ); - uno::Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY ); - xFrame->initialize( xWin.get() ); - if ( xDesktop.is() ) + Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW ); + xFrame->initialize( xWin.get() ); xDesktop->getFrames()->append( xFrame ); - if ( xWin.is() && xWin->isActive() ) - xFrame->activate(); + if ( xWin->isActive() ) + xFrame->activate(); - SfxFrame* pFrame = new SfxFrame( rWindow, false ); - pFrame->SetFrameInterface_Impl( xFrame ); - pFrame->pImp->bHidden = bHidden; + // create load arguments + Sequence< PropertyValue > aLoadArgs; + TransformItems( SID_OPENDOC, *rDoc.GetMedium()->GetItemSet(), aLoadArgs ); - if ( pDoc ) - { + ::comphelper::NamedValueCollection aArgs( aLoadArgs ); + aArgs.put( "Model", rDoc.GetModel() ); + aArgs.put( "Hidden", bHidden ); if ( nViewId ) - pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - pFrame->InsertDocument_Impl( *pDoc, pSet ? *pSet : *pDoc->GetMedium()->GetItemSet() ); + aArgs.put( "ViewId", nViewId ); + + aLoadArgs = aArgs.getPropertyValues(); + + // load the doc into that frame + Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); + xLoader->loadComponentFromURL( + rDoc.GetModel()->getURL(), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ), + 0, + aLoadArgs + ); + + for ( pFrame = SfxFrame::GetFirst(); + pFrame; + pFrame = SfxFrame::GetNext( *pFrame ) + ) + { + if ( pFrame->GetFrameInterface() == xFrame ) + break; + } + + OSL_ENSURE( pFrame, "SfxFrame::Create: load succeeded, but no SfxFrame was created during this!" ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); } return pFrame; @@ -728,9 +724,7 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& SFX_ITEMSET_ARG( &rSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) // hidden? - OSL_PRECOND( !pImp->bHidden, - "SfxFrame::InsertDocument_Impl: quite unexpected ... the below logic might not work in all cases here ..." ); - pImp->bHidden = pHidItem ? pHidItem->GetValue() : false; + pImp->bHidden = pHidItem ? pHidItem->GetValue() : pImp->bHidden; // plugin mode const USHORT nPluginMode = pPluginMode ? pPluginMode->GetValue() : 0; -- cgit v1.2.3 From 9b83e73693428f16caa9874f486a21945c431f65 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 13:51:54 +0100 Subject: autorecovery: migrated the Window/NewWindow functionality to UNO => one less client of InsertDocument_Impl --- sfx2/inc/sfx2/frame.hxx | 4 +- sfx2/inc/sfx2/viewfrm.hxx | 2 +- sfx2/source/view/frmload.cxx | 6 -- sfx2/source/view/impframe.hxx | 4 +- sfx2/source/view/topfrm.cxx | 143 +++++++++++++++++++++++++----------------- sfx2/source/view/viewfrm.cxx | 133 ++++++++++++++++++--------------------- 6 files changed, 150 insertions(+), 142 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 63d7622a90..8b7cc98024 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -134,13 +134,13 @@ protected: //#endif SfxFrame( ); // not implemented - SAL_DLLPRIVATE SfxFrame( Window& i_rExternalWindow, bool bHidden ); + SAL_DLLPRIVATE SfxFrame( Window& i_rContainerWindow, bool bHidden ); public: TYPEINFO(); static SfxFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); - static SfxFrame* Create( SfxObjectShell* pDoc = NULL, USHORT nViewId = NULL, bool bHidden = false, const SfxItemSet* pSet = NULL); + static SfxFrame* Create( SfxObjectShell& rDoc, const USHORT nViewId, const bool bHidden ); static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ); SvCompatWeakHdl* GetHdl(); diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 80f95ddd9a..6e753c21bd 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -312,7 +312,7 @@ private: LoadDocument_Impl( const SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rArgs, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rViewFactoryArgs, const USHORT i_nViewId ); }; diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 9ce223d6ea..3ca48bb107 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -482,12 +482,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA bool bInitNewModel = bIsFactoryURL; if ( bIsFactoryURL ) { - OSL_ENSURE( !aDescriptor.has( "Model" ), "SfxFrameLoader_Impl::load: sure you know what you're doing?" ); - // Before the loader refactoring, the model would have won over the URL, that is, the model would have been - // loaded into a newly created frame. /me thinks this doesn't make sense at all, also, it made the code - // in this method more complex. So, the order was changed, now the factory URL wins over the Model. - // If somebody *rightfully* passes both of them, we might need to re-consider the behavior. - const ::rtl::OUString sFactory = sURL.copy( sizeof( "private:factory/" ) -1 ); // special handling for some weird factory URLs a la private:factory/swriter?slot=21053 USHORT nSlotParam = impl_findSlotParam( sFactory ); diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index 4f3150978c..4382139794 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -70,7 +70,7 @@ public: SfxWorkWindow* pWorkWin; SvBorder aBorder; // formerly SfxTopFrame - Window* pExternalWindow; + Window* pExternalContainerWindow; bool bHidden; bool bLockResize; bool bMenuBarOn; @@ -89,7 +89,7 @@ public: ,bInPlace( sal_False ) ,pFrame( pAntiImplP ) ,pWorkWin( 0 ) - ,pExternalWindow( NULL ) + ,pExternalContainerWindow( NULL ) ,bHidden( false ) ,bLockResize( false ) ,bMenuBarOn( true ) diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 79611aa09d..c334e3613b 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -143,7 +143,7 @@ class SfxTopWindow_Impl : public Window public: SfxFrame* pFrame; - SfxTopWindow_Impl( SfxFrame* pF, Window& i_rExternalWindow ); + SfxTopWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow ); ~SfxTopWindow_Impl( ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); @@ -156,8 +156,8 @@ public: DECL_LINK( CloserHdl, void* ); }; -SfxTopWindow_Impl::SfxTopWindow_Impl( SfxFrame* pF, Window& i_rExternalWindow ) - : Window( &i_rExternalWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK ) +SfxTopWindow_Impl::SfxTopWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow ) + : Window( &i_rContainerWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK ) , pFrame( pF ) { } @@ -354,29 +354,67 @@ static String _getTabString() return result; } -SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, const SfxItemSet* pSet ) +namespace { - Reference < XFrame > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); - SfxFrame *pFrame = NULL; - BOOL bNewView = FALSE; - if ( pSet ) + Reference< XFrame > lcl_findStartModuleFrame() { - SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_OPEN_NEW_VIEW, sal_False ); - bNewView = pItem && pItem->GetValue(); + try + { + Reference < XFramesSupplier > xSupplier( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW ); + Reference < XIndexAccess > xContainer( xSupplier->getFrames(), UNO_QUERY_THROW ); + + Reference< XModuleManager > xCheck( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.ModuleManager" ) ), UNO_QUERY_THROW ); + + sal_Int32 nCount = xContainer->getCount(); + for ( sal_Int32 i=0; i xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW ); + ::rtl::OUString sModule = xCheck->identify( xFrame ); + if ( sModule.equalsAscii( "com.sun.star.frame.StartModule" ) ) + return xFrame; + } + catch( const UnknownModuleException& ) + { + // silence + } + catch(const Exception&) + { + // re-throw, caught below + throw; + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return NULL; } +} + +SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, const USHORT nViewId, const bool bHidden ) +{ + if ( nViewId ) + rDoc.GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + if ( bHidden ) + rDoc.GetMedium()->GetItemSet()->Put( SfxBoolItem( SID_HIDDEN, sal_True ) ); - if ( pDoc && !bHidden && !bNewView ) + Reference < XFrame > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); + SfxFrame* pFrame = NULL; + + if ( !bHidden ) { URL aTargetURL; - aTargetURL.Complete = pDoc->GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + aTargetURL.Complete = rDoc.GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); BOOL bIsBasic = FALSE; if ( !aTargetURL.Complete.getLength() ) { - String sFactory = String::CreateFromAscii(pDoc->GetFactory().GetShortName()); - bIsBasic = (sFactory.CompareIgnoreCaseToAscii("sbasic")==COMPARE_EQUAL); - - if (!bIsBasic) + String sFactory = String::CreateFromAscii( rDoc.GetFactory().GetShortName() ); + bIsBasic = ( sFactory.CompareIgnoreCaseToAscii("sbasic") == COMPARE_EQUAL ); + if ( !bIsBasic ) { String aURL = String::CreateFromAscii("private:factory/"); aURL += sFactory; @@ -384,47 +422,27 @@ SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, } } - if (bIsBasic) + if ( bIsBasic ) { - Reference < XFramesSupplier > xSupplier( xDesktop, UNO_QUERY ); - if (xSupplier.is()) - { - Reference < XIndexAccess > xContainer(xSupplier->getFrames(), UNO_QUERY); - if (xContainer.is()) - { - Reference< ::com::sun::star::frame::XModuleManager > xCheck(::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager" )), UNO_QUERY); - sal_Int32 nCount = xContainer->getCount(); - for (sal_Int32 i=0; i xFrame; - if (!(xContainer->getByIndex(i) >>= xFrame) || !xFrame.is()) - continue; - ::rtl::OUString sModule = xCheck->identify(xFrame); - if (sModule.equalsAscii("com.sun.star.frame.StartModule")) - { - pFrame = Create(xFrame); - break; - } - } - catch(const Exception&) {} - } - } - } + // for the Basic IDE, we need to manually find the start module (if present), since the below code + // of dispatching the model into a "_default" frame will not work here. + // (TODO: Why doesn't it? If it would, we could spare the extra code here.) + Reference< XFrame > xFrame( lcl_findStartModuleFrame() ); + if ( xFrame.is() ) + pFrame = Create( xFrame ); } else { Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); - Reference < ::com::sun::star::frame::XDispatchProvider > xProv( xDesktop, UNO_QUERY ); - Reference < ::com::sun::star::frame::XDispatch > xDisp; + Reference < XDispatchProvider > xProv( xDesktop, UNO_QUERY ); + Reference < XDispatch > xDisp; if ( xProv.is() ) { - Sequence < ::com::sun::star::beans::PropertyValue > aSeq(1); + Sequence < PropertyValue > aSeq(1); aSeq[0].Name = ::rtl::OUString::createFromAscii("Model"); - aSeq[0].Value <<= pDoc->GetModel(); + aSeq[0].Value <<= rDoc.GetModel(); ::rtl::OUString aTargetFrame( ::rtl::OUString::createFromAscii("_default") ); xDisp = xProv->queryDispatch( aTargetURL, aTargetFrame , 0 ); if ( xDisp.is() ) @@ -435,12 +453,15 @@ SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, for( USHORT nPos = rArr.Count(); nPos--; ) { SfxFrame *pF = rArr[ nPos ]; - if ( pF->GetCurrentDocument() == pDoc ) + if ( pF->GetCurrentDocument() == &rDoc ) { pFrame = pF; break; } } + OSL_ENSURE( pFrame, "SfxFrame::Create: loading the doc via a dispatcher failed, it seems!" ); + if ( pFrame ) + return pFrame; } } @@ -452,11 +473,9 @@ SfxFrame* SfxFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, bool bHidden, pFrame->pImp->bHidden = bHidden; Window* pWindow = pFrame->GetTopWindow_Impl(); - if ( pDoc && pDoc != pFrame->GetCurrentDocument() ) + if ( &rDoc != pFrame->GetCurrentDocument() ) { - if ( nViewId ) - pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - pFrame->InsertDocument_Impl( *pDoc, pSet ? *pSet : *pDoc->GetMedium()->GetItemSet() ); + pFrame->InsertDocument_Impl( rDoc, *rDoc.GetMedium()->GetItemSet() ); if ( pWindow && !bHidden ) pWindow->Show(); } @@ -533,7 +552,7 @@ SfxFrame* SfxFrame::Create( Reference < XFrame > xFrame ) return pFrame; } -SfxFrame::SfxFrame( Window& i_rExternalWindow, bool i_bHidden ) +SfxFrame::SfxFrame( Window& i_rContainerWindow, bool i_bHidden ) :pParentFrame( NULL ) ,pChildArr( NULL ) ,pImp( NULL ) @@ -543,9 +562,15 @@ SfxFrame::SfxFrame( Window& i_rExternalWindow, bool i_bHidden ) pImp->bHidden = i_bHidden; InsertTopFrame_Impl( this ); - pImp->pExternalWindow = &i_rExternalWindow; + pImp->pExternalContainerWindow = &i_rContainerWindow; + + pWindow = new SfxTopWindow_Impl( this, i_rContainerWindow ); - pWindow = new SfxTopWindow_Impl( this, i_rExternalWindow ); + // always show pWindow, which is the ComponentWindow of the XFrame we live in + // nowadays, since SfxFrames can be created with an XFrame only, hiding or showing the complete XFrame + // is not done at level of the container window, not at SFX level. Thus, the component window can + // always be visible. + pWindow->Show(); } void SfxFrame::SetPresentationMode( BOOL bSet ) @@ -579,8 +604,8 @@ SystemWindow* SfxFrame::GetSystemWindow() const SystemWindow* SfxFrame::GetTopWindow_Impl() const { - if ( pImp->pExternalWindow->IsSystemWindow() ) - return (SystemWindow*) pImp->pExternalWindow; + if ( pImp->pExternalContainerWindow->IsSystemWindow() ) + return (SystemWindow*) pImp->pExternalContainerWindow; else return NULL; } @@ -642,10 +667,10 @@ BOOL SfxFrame::IsMenuBarOn_Impl() const void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const { - Window *pWin = pImp->pExternalWindow; + Window *pWin = pImp->pExternalContainerWindow; // Groesse setzen - const Size aAppWindow( pImp->pExternalWindow->GetDesktopRectPixel().GetSize() ); + const Size aAppWindow( pImp->pExternalContainerWindow->GetDesktopRectPixel().GetSize() ); Point aPos( rWinArea.TopLeft() ); Size aSz( rWinArea.GetSize() ); if ( aSz.Width() && aSz.Height() ) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index af965cbb61..f8512aa392 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -82,6 +82,7 @@ #include #include #include +#include #include #include @@ -2019,7 +2020,7 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const //-------------------------------------------------------------------- Reference< XController2 > SfxViewFrame::LoadDocument_Impl( - const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const Sequence< PropertyValue >& i_rArgs, + const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const Sequence< PropertyValue >& i_rViewFactoryArgs, const USHORT i_nViewId ) { ENSURE_OR_THROW( i_rFrame.is(), "illegal frame" ); @@ -2033,7 +2034,7 @@ Reference< XController2 > SfxViewFrame::LoadDocument_Impl( // let the model create a new controller const Reference< XController2 > xController( xModel->createViewController( sViewName.makeStringAndClear(), - i_rArgs, + i_rViewFactoryArgs, i_rFrame ), UNO_SET_THROW ); @@ -2305,75 +2306,71 @@ void SfxViewFrame::ExecView_Impl case SID_NEWWINDOW: { // Hack. demnaechst virtuelle Funktion - if ( !GetViewShell()->NewWindowAllowed() && !GetObjectShell()->HasName() ) + if ( !GetViewShell()->NewWindowAllowed() ) + { + OSL_ENSURE( false, "You should have disabled the 'Window/New Window' slot!" ); return; + } // ViewData bei FrameSets rekursiv holen GetFrame()->GetViewData_Impl(); - SfxMedium *pMed = GetObjectShell()->GetMedium(); + SfxMedium* pMed = GetObjectShell()->GetMedium(); + + // obtain user data String aUserData; GetViewShell()->WriteUserData( aUserData, sal_True ); - if ( !GetViewShell()->NewWindowAllowed() ) + pMed->GetItemSet()->Put( SfxStringItem( SID_USER_DATA, aUserData ) ); + + // do not open the new window hidden + pMed->GetItemSet()->ClearItem( SID_HIDDEN ); + + // the view ID (optional arg. TODO: this is currently not supported in the slot definition ...) + SFX_REQUEST_ARG( rReq, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); + const USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : GetCurViewId(); + + Reference < XFrame > xFrame; + // the frame (optional arg. TODO: this is currently not supported in the slot definition ...) + SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, sal_False ); + if ( pFrameItem ) + pFrameItem->GetValue() >>= xFrame; + + bool bOwnFrame = false; + bool bSuccess = false; + try { - SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, sal_False ); - SfxFrame *pFrame = NULL; - Reference < XFrame > xFrame; - if ( pFrameItem ) + if ( !xFrame.is() ) { - pFrameItem->GetValue() >>= xFrame; - pFrame = SfxFrame::Create( xFrame ); + // if no frame was given, default-create one + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); + xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + bOwnFrame = true; + } + + LoadDocument_Impl( *GetObjectShell(), xFrame, Sequence< PropertyValue >(), nViewId ); + bSuccess = true; + + if ( bOwnFrame ) + { + // ensure the frame/windows is visible + Reference< XWindow > xContainerWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); + xContainerWindow->setVisible( sal_True ); } - else - pFrame = SfxFrame::Create(); - - SfxAllItemSet aSet( SFX_APP()->GetPool() ); - SFX_REQUEST_ARG( rReq, pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False ); - if ( pHiddenItem ) - aSet.Put( *pHiddenItem ); - - SFX_ITEMSET_ARG( pMed->GetItemSet(), pRefererItem, SfxStringItem, SID_REFERER, sal_False ); - SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE( "private:user" ) ); - if ( !pRefererItem ) - pRefererItem = &aReferer; - - aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetName() ) ); - aSet.Put( SfxStringItem( SID_USER_DATA, aUserData ) ); - aSet.Put( SfxUInt16Item( SID_VIEW_ID, GetCurViewId() ) ); - aSet.Put( *pRefererItem ); - if( pMed->GetFilter() ) - aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName()) ); - aSet.Put( SfxFrameItem ( SID_DOCFRAME, pFrame ) ); - if ( xFrame.is() ) - GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, aSet ); - else - GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, aSet ); } - else + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + if ( !bSuccess && bOwnFrame ) { - pMed->GetItemSet()->Put( SfxStringItem( SID_USER_DATA, aUserData ) ); - - BOOL bHidden = FALSE; - SFX_REQUEST_ARG( rReq, pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False ); - if ( pHiddenItem ) - bHidden = pHiddenItem->GetValue(); - SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, sal_False ); - if ( pFrameItem ) + try { - Reference < XFrame > xFrame; - pFrameItem->GetValue() >>= xFrame; - SfxFrame* pFrame = SfxFrame::Create( xFrame ); - pMed->GetItemSet()->ClearItem( SID_HIDDEN ); - pFrame->InsertDocument_Impl( *GetObjectShell(), *pMed->GetItemSet() ); - if ( !bHidden ) - xFrame->getContainerWindow()->setVisible( sal_True ); + xFrame->dispose(); } - else + catch( const Exception& ) { - SfxAllItemSet aSet( GetPool() ); - aSet.Put( SfxBoolItem( SID_OPEN_NEW_VIEW, TRUE ) ); - SfxFrame* pFrame = SfxFrame::Create( GetObjectShell(), GetCurViewId(), bHidden, &aSet ); - if ( bHidden ) - pFrame->GetCurrentViewFrame()->LockObjectShell_Impl( TRUE ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2540,13 +2537,10 @@ void SfxViewFrame::StateView_Impl case SID_NEWWINDOW: { - if ( !GetViewShell()->NewWindowAllowed() /* && !pDocSh->HasName() */ ) - rSet.DisableItem( nWhich ); - else - { - if (impl_maxOpenDocCountReached()) - rSet.DisableItem( nWhich ); - } + if ( !GetViewShell()->NewWindowAllowed() + || impl_maxOpenDocCountReached() + ) + rSet.DisableItem( nWhich ); break; } } @@ -3424,14 +3418,9 @@ void SfxViewFrame::UpdateDocument_Impl() SfxViewFrame* SfxViewFrame::CreateViewFrame( SfxObjectShell& rDoc, sal_uInt16 nViewId, sal_Bool bHidden ) { - SfxItemSet *pSet = rDoc.GetMedium()->GetItemSet(); - if ( nViewId ) - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - if ( bHidden ) - pSet->Put( SfxBoolItem( SID_HIDDEN, sal_True ) ); - - SfxFrame *pFrame = SfxFrame::Create( &rDoc, 0, bHidden ); - return pFrame->GetCurrentViewFrame(); + SfxFrame* pFrame = SfxFrame::Create( rDoc, nViewId, bHidden ); + OSL_ENSURE( pFrame, "SfxViewFrame::CreateViewFrame: failed!" ); + return pFrame ? pFrame->GetCurrentViewFrame() : NULL; } void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame ) -- cgit v1.2.3 From f08449e9a373ecf7e063872a7535bce491217ea5 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 14:16:22 +0100 Subject: autorecovery: SID_USER_DATA is effectively dead --- sfx2/inc/sfx2/sfxsids.hrc | 2 +- sfx2/source/view/frame.cxx | 3 --- sfx2/source/view/topfrm.cxx | 13 ++----------- sfx2/source/view/viewfrm.cxx | 6 ------ 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 8a78d44bd4..a67dc30468 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -582,7 +582,7 @@ #define SID_VIEW_ZOOM_MODE (SID_SFX_START + 521) #define SID_VIEW_POS_SIZE (SID_SFX_START + 522) #define SID_VIEW_ID (SID_SFX_START + 523) -#define SID_USER_DATA (SID_SFX_START + 524) + // FREE, was SID_USER_DATA #define SID_VIEW_DATA (SID_SFX_START + 1582) #define SID_SILENT (SID_SFX_START + 528) #define SID_HIDDEN (SID_SFX_START + 534) diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index d49e8ae95f..37865a0a2a 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -404,10 +404,7 @@ void SfxFrame::GetViewData_Impl() sal_Bool bReadOnly = pMed->GetOpenMode() == SFX_STREAM_READONLY; GetDescriptor()->SetReadOnly( bReadOnly ); - String aUserData; - pViewFrame->GetViewShell()->WriteUserData( aUserData, sal_True ); SfxItemSet *pSet = GetDescriptor()->GetArgs(); - pSet->Put( SfxStringItem( SID_USER_DATA, aUserData )); sal_Bool bGetViewData = sal_False; if ( GetController().is() && pSet->GetItemState( SID_VIEW_DATA ) != SFX_ITEM_SET ) { diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index c334e3613b..3d8f0c3bcd 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -743,7 +743,6 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& SFX_ITEMSET_ARG( &rSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID SFX_ITEMSET_ARG( &rSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom SFX_ITEMSET_ARG( &rSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False ); // hidden - SFX_ITEMSET_ARG( &rSet, pViewDataItem, SfxStringItem, SID_USER_DATA, sal_False ); // view data SFX_ITEMSET_ARG( &rSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False ); // view only SFX_ITEMSET_ARG( &rSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) SFX_ITEMSET_ARG( &rSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) @@ -769,16 +768,12 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& bool bReadUserData = false; // if no view-related data exists in the set, then obtain the view data from the model - if ( !pJumpItem && !pViewDataItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) + if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) { if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) { SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); - - // clear the user data item in the medium - we'll use aUserData below - pMediumSet->ClearItem( SID_USER_DATA ); pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - bClearPosSizeZoom = bReadUserData = true; } } @@ -812,11 +807,7 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& // Before CWS autorecovery, there was code which postponed setting the ViewData/Mark to a later time // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method // here is never called before the load process finished. - if ( pViewDataItem ) - { - pViewFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True ); - } - else if( pJumpItem ) + if( pJumpItem ) { pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index f8512aa392..d9ee601242 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -609,7 +609,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { pNewSet = new SfxAllItemSet( *pMedium->GetItemSet() ); pNewSet->ClearItem( SID_VIEW_ID ); - pNewSet->ClearItem( SID_USER_DATA ); pNewSet->ClearItem( SID_STREAM ); pNewSet->ClearItem( SID_INPUTSTREAM ); pNewSet->Put( SfxStringItem( SID_FILTER_NAME, pMedium->GetFilter()->GetName() ) ); @@ -2316,11 +2315,6 @@ void SfxViewFrame::ExecView_Impl GetFrame()->GetViewData_Impl(); SfxMedium* pMed = GetObjectShell()->GetMedium(); - // obtain user data - String aUserData; - GetViewShell()->WriteUserData( aUserData, sal_True ); - pMed->GetItemSet()->Put( SfxStringItem( SID_USER_DATA, aUserData ) ); - // do not open the new window hidden pMed->GetItemSet()->ClearItem( SID_HIDDEN ); -- cgit v1.2.3 From 5ea1a156b009a3f36f5fab3a9c3b1baff3837d67 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 15:14:26 +0100 Subject: autorecovery: oops, broke the PrepareClose with a change some while ago. Fixed. --- sfx2/source/doc/objxtor.cxx | 103 +++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 54 deletions(-) diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index a0fe84a8bc..135bd11bb2 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -586,73 +586,68 @@ sal_uInt16 SfxObjectShell::PrepareClose // nur fuer in sichtbaren Fenstern dargestellte Dokumente fragen SfxViewFrame *pFrame = SfxObjectShell::Current() == this ? SfxViewFrame::Current() : SfxViewFrame::GetFirst( this ); - while ( pFrame ) - pFrame = SfxViewFrame::GetNext( *pFrame, this ); sal_Bool bClose = sal_False; - if ( bUI && IsModified() ) + if ( bUI && IsModified() && pFrame ) { - if ( pFrame ) + // minimierte restoren + SfxFrame* pTop = pFrame->GetTopFrame(); + SfxViewFrame::SetViewFrame( pTop->GetCurrentViewFrame() ); + pFrame->GetFrame()->Appear(); + + // fragen, ob gespeichert werden soll + short nRet = RET_YES; + //TODO/CLEANUP + //brauchen wir UI=2 noch? + //if( SfxApplication::IsPlugin() == sal_False || bUI == 2 ) { - // minimierte restoren - SfxFrame* pTop = pFrame->GetTopFrame(); - SfxViewFrame::SetViewFrame( pTop->GetCurrentViewFrame() ); - pFrame->GetFrame()->Appear(); - - // fragen, ob gespeichert werden soll - short nRet = RET_YES; - //TODO/CLEANUP - //brauchen wir UI=2 noch? - //if( SfxApplication::IsPlugin() == sal_False || bUI == 2 ) + //initiate help agent to inform about "print modifies the document" + SvtPrintWarningOptions aPrintOptions; + if (aPrintOptions.IsModifyDocumentOnPrintingAllowed() && + HasName() && getDocProperties()->getPrintDate().Month > 0) { - //initiate help agent to inform about "print modifies the document" - SvtPrintWarningOptions aPrintOptions; - if (aPrintOptions.IsModifyDocumentOnPrintingAllowed() && - HasName() && getDocProperties()->getPrintDate().Month > 0) - { - SfxHelp::OpenHelpAgent(pFirst->GetFrame(), HID_CLOSE_WARNING); - } - const Reference< XTitle > xTitle(pImp->xModel, UNO_QUERY_THROW); - const ::rtl::OUString sTitle = xTitle->getTitle (); - nRet = ExecuteQuerySaveDocument(&pFrame->GetWindow(),sTitle); + SfxHelp::OpenHelpAgent(pFirst->GetFrame(), HID_CLOSE_WARNING); } - /*HACK for plugin::destroy()*/ + const Reference< XTitle > xTitle(pImp->xModel, UNO_QUERY_THROW); + const ::rtl::OUString sTitle = xTitle->getTitle (); + nRet = ExecuteQuerySaveDocument(&pFrame->GetWindow(),sTitle); + } + /*HACK for plugin::destroy()*/ - if ( RET_YES == nRet ) + if ( RET_YES == nRet ) + { + // per Dispatcher speichern + const SfxPoolItem *pPoolItem; + if ( IsSaveVersionOnClose() ) { - // per Dispatcher speichern - const SfxPoolItem *pPoolItem; - if ( IsSaveVersionOnClose() ) - { - SfxStringItem aItem( SID_DOCINFO_COMMENTS, String( SfxResId( STR_AUTOMATICVERSION ) ) ); - SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); - const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, 0 }; - pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs ); - } - else - { - SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); - const SfxPoolItem* ppArgs[] = { &aWarnItem, 0 }; - pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs ); - } - - if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) ) - return sal_False; - else - bClose = sal_True; + SfxStringItem aItem( SID_DOCINFO_COMMENTS, String( SfxResId( STR_AUTOMATICVERSION ) ) ); + SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); + const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, 0 }; + pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs ); } - else if ( RET_CANCEL == nRet ) - // abgebrochen - return sal_False; - else if ( RET_NEWTASK == nRet ) + else { - return RET_NEWTASK; + SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); + const SfxPoolItem* ppArgs[] = { &aWarnItem, 0 }; + pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs ); } + + if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) ) + return sal_False; else - { - // Bei Nein nicht noch Informationlost bClose = sal_True; - } + } + else if ( RET_CANCEL == nRet ) + // abgebrochen + return sal_False; + else if ( RET_NEWTASK == nRet ) + { + return RET_NEWTASK; + } + else + { + // Bei Nein nicht noch Informationlost + bClose = sal_True; } } -- cgit v1.2.3 From 8b10e7dfcee6b72edaaacef3d5f488def39e4c02 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 15:14:42 +0100 Subject: autorecovery: SID_NEWWINDOW now also uses the UNO loader, instead of LoadDocument_Impl, since the latter is to be removed later during this refactoring --- sfx2/inc/sfx2/viewfrm.hxx | 32 ++++++++++++++++++++++++++++++- sfx2/source/view/viewfrm.cxx | 45 ++++++++++++++++++++++++++++++-------------- 2 files changed, 62 insertions(+), 15 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 6e753c21bd..52d54f629c 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -306,7 +306,6 @@ public: //#endif private: SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); - SAL_DLLPRIVATE SfxViewShell* LoadNewView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); SAL_DLLPRIVATE static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > LoadDocument_Impl( @@ -315,6 +314,37 @@ private: const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rViewFactoryArgs, const USHORT i_nViewId ); + + /** loads a new view of our document into our frame + + This method completely bypasses the UNO loader mechanism, it exchanges the current view on SFX level. Use + it for quick inplace view switches only. + */ + SAL_DLLPRIVATE SfxViewShell* LoadNewSfxView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ); + + /** loads the given existing document into the given frame + + This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked. Don't + use this method if you want to plug the document into the frame on SFX level only. In such a case, use + LoadNewSfxView_Impl instead. + + @param i_rDoc + the document to load + @param i_rFrame + the frame to load the document into + @param i_rLoadArgs + the arguments to pass to the component loader. If this sequence is empty, then the current arguments of the + model will be obtained, and passed to the loader. This ensures that any arguments in the model will be preserved, + instead of being reset. + @param i_nViewId + the ID of the view to create + */ + SAL_DLLPRIVATE static void LoadViewIntoFrame_Impl( + const SfxObjectShell& i_rDoc, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rLoadArgs, + const USHORT i_nViewId + ); }; //-------------------------------------------------------------------- diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index d9ee601242..c078a88451 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -767,16 +767,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { try { - ::comphelper::NamedValueCollection aTransformLoadArgs( aLoadArgs ); - Reference< XModel > xDocument( xNewObj->GetModel(), UNO_SET_THROW ); - aTransformLoadArgs.put( "Model", xDocument ); - while ( !aViewFrames.empty() ) { - aTransformLoadArgs.put( "ViewId", aViewFrames.front().second ); - Reference< XComponentLoader > xLoader( aViewFrames.front().first, UNO_QUERY_THROW ); - xLoader->loadComponentFromURL( xDocument->getURL(), ::rtl::OUString::createFromAscii( "_self" ), 0, - aTransformLoadArgs.getPropertyValues() ); + LoadViewIntoFrame_Impl( *xNewObj, aViewFrames.front().first, aLoadArgs, aViewFrames.front().second ); aViewFrames.pop_front(); } } @@ -2048,10 +2041,34 @@ Reference< XController2 > SfxViewFrame::LoadDocument_Impl( } //-------------------------------------------------------------------- -SfxViewShell* SfxViewFrame::LoadNewView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ) +void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, + const Sequence< PropertyValue >& i_rLoadArgs, const USHORT i_nViewId ) +{ + Reference< XModel > xDocument( i_rDoc.GetModel(), UNO_SET_THROW ); + + ::comphelper::NamedValueCollection aTransformLoadArgs( i_rLoadArgs.getLength() ? i_rLoadArgs : xDocument->getArgs() ); + aTransformLoadArgs.put( "Model", xDocument ); + aTransformLoadArgs.put( "ViewId", sal_Int16( i_nViewId ) ); + + ::rtl::OUString sURL( xDocument->getURL() ); + if ( !sURL.getLength() ) + { + ::rtl::OUStringBuffer aURLComposer; + aURLComposer.appendAscii( "private:factory/" ); + aURLComposer.appendAscii( i_rDoc.GetFactory().GetShortName() ); + sURL = aURLComposer.makeStringAndClear(); + } + + Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); + xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0, + aTransformLoadArgs.getPropertyValues() ); +} + +//-------------------------------------------------------------------- +SfxViewShell* SfxViewFrame::LoadNewSfxView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ) { ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" ); - OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewView_Impl: not allowed to be called with an exsiting view shell!" ); + OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewSfxView_Impl: not allowed to be called with an exsiting view shell!" ); ::comphelper::NamedValueCollection aViewCreationArgs; if ( i_pOldShell != NULL ) @@ -2162,7 +2179,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl // remove sub shells from Dispatcher before switching to new ViewShell PopShellAndSubShells_Impl( *pOldSh ); - // reset view shell, that's a precondition for the LoadNewView_Impl below + // reset view shell, that's a precondition for the LoadNewSfxView_Impl below SetViewShell_Impl( NULL ); } @@ -2172,7 +2189,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl // create and load new ViewShell SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory(); const sal_uInt16 nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; - SfxViewShell* pNewSh = LoadNewView_Impl( nViewId, pOldSh ); + SfxViewShell* pNewSh = LoadNewSfxView_Impl( nViewId, pOldSh ); // allow resize events to be processed UnlockAdjustPosSizePixel(); @@ -2341,12 +2358,12 @@ void SfxViewFrame::ExecView_Impl bOwnFrame = true; } - LoadDocument_Impl( *GetObjectShell(), xFrame, Sequence< PropertyValue >(), nViewId ); + LoadViewIntoFrame_Impl( *GetObjectShell(), xFrame, Sequence< PropertyValue >(), nViewId ); bSuccess = true; if ( bOwnFrame ) { - // ensure the frame/windows is visible + // ensure the frame/window is visible Reference< XWindow > xContainerWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); xContainerWindow->setVisible( sal_True ); } -- cgit v1.2.3 From 96ae152785318670d845370c325843df105400bb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 4 Dec 2009 10:11:06 +0100 Subject: autorecovery: another client of InsertDocument_Impl died ... SfxFrame::InsertDocument has been replaced with SfxViewFrame::LoadDocument, which now uses the UNO loader to load the existing document into a frame, instead of going the direct (non-UNO-, pure-SFX-) way --- sfx2/inc/frmload.hxx | 4 ++ sfx2/inc/sfx2/frame.hxx | 2 - sfx2/inc/sfx2/viewfrm.hxx | 30 +++++++++ sfx2/source/view/frame.cxx | 20 ------ sfx2/source/view/frmload.cxx | 36 ++++++++-- sfx2/source/view/topfrm.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 153 +++++++++++++++++++++++++++++-------------- 7 files changed, 171 insertions(+), 76 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 56330fd127..e690e07d77 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -137,6 +137,10 @@ private: const ::com::sun::star::uno::Any& i_rCaughtError, const ::comphelper::NamedValueCollection& i_rDescriptor ) const; + + SfxFrame* impl_getOrCreateEmptySfxFrame( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame + ) const; }; #endif diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 8b7cc98024..b9fadc111f 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -158,8 +158,6 @@ public: static SfxFrame* GetFirst(); static SfxFrame* GetNext( SfxFrame& ); - static SfxViewFrame* - InsertDocument( SfxObjectShell& rDoc, SfxFrame*& rpTargetFrame, const USHORT nViewId = 0, const bool bHidden = false ); const SfxPoolItem* LoadDocumentSynchron( SfxItemSet& aSet ); SfxBroadcaster& GetBroadcaster() const; diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 52d54f629c..351d0fc83e 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -168,11 +168,16 @@ public: static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, BOOL bHidden = FALSE ); static SfxViewFrame* Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ); + static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId = 0 ); + static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); + static SfxViewFrame* Current(); static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); static USHORT Count(); + static SfxViewFrame* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController, const SfxObjectShell* i_pDoc = NULL ); + void DoActivate(BOOL bMDI, SfxViewFrame *pOld=NULL); void DoDeactivate(BOOL bMDI, SfxViewFrame *pOld=NULL); @@ -338,6 +343,8 @@ private: instead of being reset. @param i_nViewId the ID of the view to create + @throws Exception + if something goes wrong. The caller is responsible for handling this. */ SAL_DLLPRIVATE static void LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, @@ -345,6 +352,29 @@ private: const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rLoadArgs, const USHORT i_nViewId ); + + /** loads the given existing document into the given frame + + This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked. Don't + use this method if you want to plug the document into the frame on SFX level only. In such a case, use + LoadNewSfxView_Impl instead. + + If no frame is given, a blank top level frame is created. + + If anything fails during the process, as much as possible is cleaned up. + + @param i_rDoc + the document to load + @param i_rFrame + the frame to load the document into. Might be , in which case a new frame is created. + @param i_nViewId + the ID of the view to create + */ + SAL_DLLPRIVATE static SfxViewFrame* LoadViewIntoFrame_Impl_NoThrow( + const SfxObjectShell& i_rDoc, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, + const USHORT i_nViewId + ); }; //-------------------------------------------------------------------- diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 37865a0a2a..2ee95ed768 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -306,26 +306,6 @@ sal_uInt16 SfxFrame::GetChildFrameCount() const return pChildArr ? pChildArr->Count() : 0; } -SfxViewFrame* SfxFrame::InsertDocument( SfxObjectShell& rDoc, SfxFrame*& rpTargetFrame, const USHORT nViewId, const bool bHidden ) -{ - SfxViewFrame* pViewFrame = NULL; - - if ( rpTargetFrame ) - { - if ( bHidden ) - rDoc.PutItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); - rpTargetFrame->InsertDocument_Impl( rDoc, *rDoc.GetMedium()->GetItemSet() ); - pViewFrame = rpTargetFrame->GetCurrentViewFrame(); - } - else - { - pViewFrame = SfxViewFrame::CreateViewFrame( rDoc, nViewId, bHidden ); - if( pViewFrame ) - rpTargetFrame = pViewFrame->GetFrame(); - } - return pViewFrame; -} - void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ ) { if( !pImp->bInCancelTransfers ) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 3ca48bb107..894b1e6f4d 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -246,11 +246,38 @@ namespace } } +// -------------------------------------------------------------------------------------------------------------------- +SfxFrame* SfxFrameLoader_Impl::impl_getOrCreateEmptySfxFrame( const Reference< XFrame >& i_rFrame ) const +{ + for ( SfxFrame* pFrame = SfxFrame::GetFirst(); + pFrame; + pFrame = SfxFrame::GetNext( *pFrame ) + ) + { + if ( pFrame->GetFrameInterface() == i_rFrame ) + { + if ( ( pFrame->GetCurrentViewFrame() != NULL ) + || ( pFrame->GetCurrentDocument() != NULL ) + ) + // an empty SfxFrame was requested, so we can't use this instance. + // Note that it is perfectly letgitimate that during loading into an XFrame which already contains + // a document, there exist two SfxFrame instances bound to this XFrame - the old one, which will be + // destroyed later, and the new one, which we're going to create + continue; + + return pFrame; + } + } + + SfxFrame* pFrame = SfxFrame::Create( i_rFrame ); + ENSURE_OR_THROW( pFrame, "could not create an SfxFrame" ); + return pFrame; +} + // -------------------------------------------------------------------------------------------------------------------- sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, const Reference< XFrame >& i_rxFrame ) { - SfxFrame* pTargetFrame = SfxFrame::Create( i_rxFrame ); - ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + SfxFrame* pTargetFrame = impl_getOrCreateEmptySfxFrame( i_rxFrame ); SfxFrameWeak wFrame = pTargetFrame; SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() ); @@ -550,7 +577,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA else { // tell the doc its load args. - xModel->attachResource( aDescriptor.getOrDefault( "URL", ::rtl::OUString() ), aDescriptor.getPropertyValues() ); + xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() ); // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs) @@ -575,8 +602,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // ObjectShell. // create a frame - SfxFrame* pTargetFrame = SfxFrame::Create( _rTargetFrame ); - ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + SfxFrame* pTargetFrame = impl_getOrCreateEmptySfxFrame( _rTargetFrame ); wFrame = pTargetFrame; // insert the document into the frame diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 3d8f0c3bcd..d1936148d3 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -429,7 +429,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, const USHORT nViewId, const bo // (TODO: Why doesn't it? If it would, we could spare the extra code here.) Reference< XFrame > xFrame( lcl_findStartModuleFrame() ); if ( xFrame.is() ) - pFrame = Create( xFrame ); + pFrame = SfxFrame::Create( xFrame ); } else { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c078a88451..0cd19cc0d9 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2040,6 +2040,56 @@ Reference< XController2 > SfxViewFrame::LoadDocument_Impl( return xController; } +//-------------------------------------------------------------------- +SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, + const USHORT i_nViewId ) +{ + Reference< XFrame > xFrame( i_rFrame ); + bool bOwnFrame = false; + bool bSuccess = false; + try + { + if ( !xFrame.is() ) + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); + xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + bOwnFrame = true; + } + + LoadViewIntoFrame_Impl( i_rDoc, xFrame, Sequence< PropertyValue >(), i_nViewId ); + bSuccess = true; + + if ( bOwnFrame ) + { + // ensure the frame/window is visible + Reference< XWindow > xContainerWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); + xContainerWindow->setVisible( sal_True ); + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + if ( bSuccess ) + return SfxViewFrame::Get( xFrame->getController(), &i_rDoc ); + + if ( bOwnFrame ) + { + try + { + xFrame->dispose(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + return NULL; +} + //-------------------------------------------------------------------- void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const Sequence< PropertyValue >& i_rLoadArgs, const USHORT i_nViewId ) @@ -2088,6 +2138,58 @@ SfxViewShell* SfxViewFrame::LoadNewSfxView_Impl( const USHORT i_nViewId, SfxView //-------------------------------------------------------------------- +SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId ) +{ + Reference< XFrame > xFrame; + if ( i_pTargetFrame ) + xFrame = i_pTargetFrame->GetFrameInterface(); + + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, xFrame, i_nViewId ); +} + +//-------------------------------------------------------------------- + +SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId ) +{ + return LoadDocument( i_rDoc, i_pFrameItem ? i_pFrameItem->GetFrame() : NULL, i_nViewId ); +} + +//-------------------------------------------------------------------- + +SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, const SfxObjectShell* i_pDoc ) +{ + if ( !i_rController.is() ) + return NULL; + + const SfxObjectShell* pDoc = i_pDoc; + if ( !pDoc ) + { + Reference< XModel > xDocument( i_rController->getModel() ); + for ( pDoc = SfxObjectShell::GetFirst( 0, false ); + pDoc; + pDoc = SfxObjectShell::GetNext( *pDoc, 0, false ) + ) + { + if ( pDoc->GetModel() == xDocument ) + break; + } + } + + SfxViewFrame* pViewFrame = NULL; + for ( pViewFrame = SfxViewFrame::GetFirst( pDoc, FALSE ); + pViewFrame; + pViewFrame = SfxViewFrame::GetNext( *pViewFrame, pDoc, FALSE ) + ) + { + if ( pViewFrame->GetViewShell()->GetController() == i_rController ) + break; + } + + return pViewFrame; +} + +//-------------------------------------------------------------------- + SfxViewFrame* SfxViewFrame::Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ) { bool bSuccess = false; @@ -2097,18 +2199,11 @@ SfxViewFrame* SfxViewFrame::Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, Reference< XController2 > xController = LoadDocument_Impl( i_rDoc, i_rFrame.GetFrameInterface(), Sequence< PropertyValue >(), i_nViewId ); ENSURE_OR_THROW( xController.is(), "invalid controller returned by LoadDocument_Impl" ); - // this is expected to throw in case of a failure ... + // LoadDocument_Impl is expected to throw in case of a failure ... if ( xController.is() ) { - for ( pViewFrame = SfxViewFrame::GetFirst( &i_rDoc, FALSE ); - pViewFrame; - pViewFrame = SfxViewFrame::GetNext( *pViewFrame, &i_rDoc, FALSE ) - ) - { - if ( pViewFrame->GetViewShell()->GetController() == xController ) - break; - } + pViewFrame = SfxViewFrame::Get( xController.get(), &i_rDoc ); if ( !pViewFrame ) { OSL_ENSURE( false, "SfxViewFrame::Create: wrong controller implementation!" ); @@ -2345,45 +2440,7 @@ void SfxViewFrame::ExecView_Impl if ( pFrameItem ) pFrameItem->GetValue() >>= xFrame; - bool bOwnFrame = false; - bool bSuccess = false; - try - { - if ( !xFrame.is() ) - { - // if no frame was given, default-create one - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); - xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); - bOwnFrame = true; - } - - LoadViewIntoFrame_Impl( *GetObjectShell(), xFrame, Sequence< PropertyValue >(), nViewId ); - bSuccess = true; - - if ( bOwnFrame ) - { - // ensure the frame/window is visible - Reference< XWindow > xContainerWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); - xContainerWindow->setVisible( sal_True ); - } - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - - if ( !bSuccess && bOwnFrame ) - { - try - { - xFrame->dispose(); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - } + LoadViewIntoFrame_Impl_NoThrow( *GetObjectShell(), xFrame, nViewId ); rReq.Done(); break; -- cgit v1.2.3 From 5619eeb870f49ff18427773f0886279120da1483 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 4 Dec 2009 12:17:03 +0100 Subject: autorecovery: open the Basic IDE via SFX' document loader --- sfx2/inc/sfx2/frame.hxx | 1 + sfx2/source/appl/appserv.cxx | 65 ++++++++++++++++++++++++++++++++++---------- sfx2/source/view/topfrm.cxx | 22 ++++++++++++--- 3 files changed, 70 insertions(+), 18 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index b9fadc111f..eaf08c108d 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -140,6 +140,7 @@ public: TYPEINFO(); static SfxFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); + static SfxFrame* CreateBlank(); static SfxFrame* Create( SfxObjectShell& rDoc, const USHORT nViewId, const bool bHidden ); static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index fcf06615da..c42f93a22b 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -98,6 +98,7 @@ #include #include "about.hxx" +#include "frmload.hxx" #include "referers.hxx" #include #include @@ -822,6 +823,24 @@ namespace } return _pFallback; } + + const ::rtl::OUString& lcl_getBasicIDEServiceName() + { + static const ::rtl::OUString s_sBasicName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.BasicIDE" ) ); + return s_sBasicName; + } + + SfxViewFrame* lcl_getBasicIDEViewFrame( SfxObjectShell* i_pBasicIDE ) + { + SfxViewFrame* pView = SfxViewFrame::GetFirst( i_pBasicIDE ); + while ( pView ) + { + if ( pView->GetObjectShell()->GetFactory().GetDocumentServiceName() == lcl_getBasicIDEServiceName() ) + break; + pView = SfxViewFrame::GetNext( *pView, i_pBasicIDE ); + } + return pView; + } } void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) @@ -902,22 +921,40 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) case SID_BASICIDE_APPEAR: { - SfxViewFrame* pView = SfxViewFrame::GetFirst(); - ::rtl::OUString aBasicName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.BasicIDE" ) ); - while ( pView ) - { - if ( pView->GetObjectShell()->GetFactory().GetDocumentServiceName() == aBasicName ) - break; - pView = SfxViewFrame::GetNext( *pView ); - } - + SfxViewFrame* pView = lcl_getBasicIDEViewFrame( NULL ); if ( !pView ) { - SfxObjectShell* pDocShell = SfxObjectShell::CreateObject( aBasicName ); - pDocShell->DoInitNew( 0 ); - pDocShell->SetModified( FALSE ); - pView = SfxViewFrame::CreateViewFrame( *pDocShell, 0 ); - pView->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC:1" ) ) ); + SfxObjectShell* pBasicIDE = SfxObjectShell::CreateObject( lcl_getBasicIDEServiceName() ); + pBasicIDE->DoInitNew( 0 ); + pBasicIDE->SetModified( FALSE ); + try + { + // load the Basic IDE via direct access to the SFX frame loader. A generic loadComponentFromURL + // (which could be done via SfxViewFrame::LoadDocument) is not feasible here, since the Basic IDE + // does not really play nice with the framework's concept. For instance, it is a "singleton document", + // which conflicts, at the latest, with the framework's concept of loading into _blank frames. + // So, since we know that our frame loader can handle it, we skip the generic framework loader + // mechanism, and the type detection (which doesn't know about the Basic IDE). + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XSynchronousFrameLoader > xLoader( aContext.createComponent( + SfxFrameLoader_Impl::impl_getStaticImplementationName() ), UNO_QUERY_THROW ); + ::comphelper::NamedValueCollection aLoadArgs; + aLoadArgs.put( "Model", pBasicIDE->GetModel() ); + aLoadArgs.put( "URL", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sbasic" ) ) ); + + SfxFrame* pFrame = SfxFrame::CreateBlank(); + ENSURE_OR_THROW( pFrame, "could not create a blank SfxFrame" ); + + xLoader->load( aLoadArgs.getPropertyValues(), pFrame->GetFrameInterface() ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + pView = lcl_getBasicIDEViewFrame( pBasicIDE ); + if ( pView ) + pView->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC:1" ) ) ); } if ( pView ) diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index d1936148d3..711ccfa88b 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -394,6 +394,23 @@ namespace } } +SfxFrame* SfxFrame::CreateBlank() +{ + SfxFrame* pFrame = NULL; + try + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); + Reference < XFrame > xFrame = xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ); + pFrame = Create( xFrame ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return pFrame; +} + SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, const USHORT nViewId, const bool bHidden ) { if ( nViewId ) @@ -466,10 +483,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, const USHORT nViewId, const bo } if ( !pFrame ) - { - Reference < XFrame > xFrame = xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ); - pFrame = Create( xFrame ); - } + pFrame = SfxFrame::CreateBlank(); pFrame->pImp->bHidden = bHidden; Window* pWindow = pFrame->GetTopWindow_Impl(); -- cgit v1.2.3 From 05fdc431ab75d7576213ebb970043265d3f7886b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 4 Dec 2009 21:29:53 +0100 Subject: autorecovery: replace some calls to SfxViewFrame::CreateViewFrame with calls to the (newly introduced) SfxViewFrame::LoadHiddenDocument This way, we got rid of some more clients of InsertDocument_Impl. Final goal is to remove SfxViewFrame::CreateViewFrame completely, so the UNO loader is the only (indirect) client of InsertDocument_Impl. --- sfx2/inc/sfx2/viewfrm.hxx | 7 +++++-- sfx2/source/view/frmload.cxx | 24 +++++++++++++++--------- sfx2/source/view/topfrm.cxx | 7 ++++--- sfx2/source/view/viewfrm.cxx | 31 +++++++++++++++++++++++-------- 4 files changed, 47 insertions(+), 22 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 351d0fc83e..e7e6b4cc5d 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -168,6 +168,7 @@ public: static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, BOOL bHidden = FALSE ); static SfxViewFrame* Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ); + static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId = 0 ); static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); @@ -350,7 +351,8 @@ private: const SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rLoadArgs, - const USHORT i_nViewId + const USHORT i_nViewId, + const bool i_bHidden ); /** loads the given existing document into the given frame @@ -373,7 +375,8 @@ private: SAL_DLLPRIVATE static SfxViewFrame* LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, - const USHORT i_nViewId + const USHORT i_nViewId, + const bool i_bHidden ); }; diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 894b1e6f4d..7ea3a4fdde 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -291,12 +291,19 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlo void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) const { const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False ); - if ( bHidden ) - { - i_rDocument.RestoreNoDelete(); - i_rDocument.OwnerLock( TRUE ); - i_rDocument.Get_Impl()->bHiddenLockedByAPI = TRUE; - } + if ( !bHidden ) + return; + + const SfxViewFrame* pExistingViewFrame = SfxViewFrame::GetFirst( &i_rDocument ); + if ( pExistingViewFrame ) + return; + + // the document is to be loaded hidden, and it is not yet displayed in any other frame + // To prevent it from being closed when the loader returns, increase its OwnerLock + // (the OwnerLock is normally increased by every frame in which the document is displayed, and by this loader) + i_rDocument.RestoreNoDelete(); + i_rDocument.OwnerLock( TRUE ); + i_rDocument.Get_Impl()->bHiddenLockedByAPI = TRUE; } // -------------------------------------------------------------------------------------------------------------------- @@ -590,9 +597,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA SfxObjectShellLock xDoc = impl_findObjectShell( xModel ); ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" ); - // if the document is created hidden, prevent it being deleted until it is shown or disposed - if ( !bExternalModel ) - impl_lockHiddenDocument( *xDoc, aDescriptor ); + // if the document is created hidden, prevent it from being deleted until it is shown or disposed + impl_lockHiddenDocument( *xDoc, aDescriptor ); // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef, // then this would not be necessary, /me thinks. That is, the *Lock classes inc/dec a "Lock" counter // (additional to the ref counter) in their ctor/dtor, and if the lock counter goes to 0, the diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 711ccfa88b..6cb69cc58e 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -816,11 +816,12 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); } - OSL_ENSURE( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT, + OSL_ENSURE( ( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT ) + || ( pJumpItem == NULL ), "SfxFrame::InsertDocument_Impl: so this code wasn't dead?" ); - // Before CWS autorecovery, there was code which postponed setting the ViewData/Mark to a later time + // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method - // here is never called before the load process finished. + // here is never called before the load process finished. At least not with a jump item != NULL. if( pJumpItem ) { pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 0cd19cc0d9..688a76f0db 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -769,7 +769,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { while ( !aViewFrames.empty() ) { - LoadViewIntoFrame_Impl( *xNewObj, aViewFrames.front().first, aLoadArgs, aViewFrames.front().second ); + LoadViewIntoFrame_Impl( *xNewObj, aViewFrames.front().first, aLoadArgs, aViewFrames.front().second, false ); aViewFrames.pop_front(); } } @@ -2042,8 +2042,12 @@ Reference< XController2 > SfxViewFrame::LoadDocument_Impl( //-------------------------------------------------------------------- SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, - const USHORT i_nViewId ) + const USHORT i_nViewId, const bool i_bHidden ) { + OSL_PRECOND( !i_bHidden || !i_rFrame.is(), + "SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow: loading *hidden* into an *existing* frame is not supported!" ); + // Care for this frame's visibility yourself, please + Reference< XFrame > xFrame( i_rFrame ); bool bOwnFrame = false; bool bSuccess = false; @@ -2057,10 +2061,10 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell bOwnFrame = true; } - LoadViewIntoFrame_Impl( i_rDoc, xFrame, Sequence< PropertyValue >(), i_nViewId ); + LoadViewIntoFrame_Impl( i_rDoc, xFrame, Sequence< PropertyValue >(), i_nViewId, i_bHidden ); bSuccess = true; - if ( bOwnFrame ) + if ( bOwnFrame && !i_bHidden ) { // ensure the frame/window is visible Reference< XWindow > xContainerWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); @@ -2092,13 +2096,17 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell //-------------------------------------------------------------------- void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, - const Sequence< PropertyValue >& i_rLoadArgs, const USHORT i_nViewId ) + const Sequence< PropertyValue >& i_rLoadArgs, const USHORT i_nViewId, + const bool i_bHidden ) { Reference< XModel > xDocument( i_rDoc.GetModel(), UNO_SET_THROW ); ::comphelper::NamedValueCollection aTransformLoadArgs( i_rLoadArgs.getLength() ? i_rLoadArgs : xDocument->getArgs() ); aTransformLoadArgs.put( "Model", xDocument ); - aTransformLoadArgs.put( "ViewId", sal_Int16( i_nViewId ) ); + if ( i_nViewId ) + aTransformLoadArgs.put( "ViewId", sal_Int16( i_nViewId ) ); + if ( i_bHidden ) + aTransformLoadArgs.put( "Hidden", i_bHidden ); ::rtl::OUString sURL( xDocument->getURL() ); if ( !sURL.getLength() ) @@ -2138,13 +2146,20 @@ SfxViewShell* SfxViewFrame::LoadNewSfxView_Impl( const USHORT i_nViewId, SfxView //-------------------------------------------------------------------- +SfxViewFrame* SfxViewFrame::LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ) +{ + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, Reference< XFrame >(), i_nViewId, true ); +} + +//-------------------------------------------------------------------- + SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId ) { Reference< XFrame > xFrame; if ( i_pTargetFrame ) xFrame = i_pTargetFrame->GetFrameInterface(); - return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, xFrame, i_nViewId ); + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, xFrame, i_nViewId, false ); } //-------------------------------------------------------------------- @@ -2440,7 +2455,7 @@ void SfxViewFrame::ExecView_Impl if ( pFrameItem ) pFrameItem->GetValue() >>= xFrame; - LoadViewIntoFrame_Impl_NoThrow( *GetObjectShell(), xFrame, nViewId ); + LoadViewIntoFrame_Impl_NoThrow( *GetObjectShell(), xFrame, nViewId, false ); rReq.Done(); break; -- cgit v1.2.3 From fb8c77bb55e11e96325b226dae6202b79710f493 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 4 Dec 2009 21:45:24 +0100 Subject: autorecovery: SfxViewFrame::Create => SfxViewFrame::Create_Impl (this is a module-private method, really) --- sfx2/inc/sfx2/viewfrm.hxx | 2 +- sfx2/source/view/topfrm.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index e7e6b4cc5d..77822ed525 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -166,7 +166,6 @@ public: static void SetViewFrame( SfxViewFrame* ); static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, BOOL bHidden = FALSE ); - static SfxViewFrame* Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId = 0 ); @@ -308,6 +307,7 @@ public: SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); SAL_DLLPRIVATE void SetCurViewId_Impl( const USHORT i_nID ); + SAL_DLLPRIVATE static SfxViewFrame* Create_Impl( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ); //#endif private: diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 6cb69cc58e..fc0c61bb79 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -797,7 +797,7 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& if ( nPluginMode && ( nPluginMode != 2 ) ) SetInPlace_Impl( TRUE ); - SfxViewFrame* pViewFrame = SfxViewFrame::Create( *this, rDoc, nViewId ? nViewId : rDoc.GetFactory().GetViewFactory( 0 ).GetOrdinal() ); + SfxViewFrame* pViewFrame = SfxViewFrame::Create_Impl( *this, rDoc, nViewId ? nViewId : rDoc.GetFactory().GetViewFactory( 0 ).GetOrdinal() ); OSL_ENSURE( pViewFrame, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); if ( !pViewFrame ) // TODO: better error handling? Under which conditions can this fail? diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 688a76f0db..5da4fc76af 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2205,7 +2205,7 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c //-------------------------------------------------------------------- -SfxViewFrame* SfxViewFrame::Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ) +SfxViewFrame* SfxViewFrame::Create_Impl( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ) { bool bSuccess = false; SfxViewFrame* pViewFrame = NULL; @@ -2221,7 +2221,7 @@ SfxViewFrame* SfxViewFrame::Create( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, pViewFrame = SfxViewFrame::Get( xController.get(), &i_rDoc ); if ( !pViewFrame ) { - OSL_ENSURE( false, "SfxViewFrame::Create: wrong controller implementation!" ); + OSL_ENSURE( false, "SfxViewFrame::Create_Impl: wrong controller implementation!" ); Reference< XComponent > xComponent( xController, UNO_QUERY_THROW ); xComponent->dispose(); } -- cgit v1.2.3 From e0e218e72a7b48bc0d202171f941aded250472ba Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 4 Dec 2009 22:09:14 +0100 Subject: autorecovery: rename SfxViewFrame's LoadDocument to LoadDocumentIntoFrame, and introduce a new LoadDocument, which does not take any frame-like argument. Makes writing code easier (and more explicit) for clients which do not have a frame, but want to load non-hidden. --- sfx2/inc/sfx2/viewfrm.hxx | 5 +++-- sfx2/source/appl/appserv.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 13 ++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 77822ed525..b86ab78b6b 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -168,8 +168,9 @@ public: static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, BOOL bHidden = FALSE ); static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); - static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId = 0 ); - static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); + static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); + static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId = 0 ); + static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); static SfxViewFrame* Current(); static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index c42f93a22b..09db519a99 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -930,7 +930,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) try { // load the Basic IDE via direct access to the SFX frame loader. A generic loadComponentFromURL - // (which could be done via SfxViewFrame::LoadDocument) is not feasible here, since the Basic IDE + // (which could be done via SfxViewFrame::LoadDocumentIntoFrame) is not feasible here, since the Basic IDE // does not really play nice with the framework's concept. For instance, it is a "singleton document", // which conflicts, at the latest, with the framework's concept of loading into _blank frames. // So, since we know that our frame loader can handle it, we skip the generic framework loader diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 5da4fc76af..44b2d61f9c 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2153,7 +2153,14 @@ SfxViewFrame* SfxViewFrame::LoadHiddenDocument( SfxObjectShell& i_rDoc, const US //-------------------------------------------------------------------- -SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId ) +SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ) +{ + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, Reference< XFrame >(), i_nViewId, false ); +} + +//-------------------------------------------------------------------- + +SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId ) { Reference< XFrame > xFrame; if ( i_pTargetFrame ) @@ -2164,9 +2171,9 @@ SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const SfxFrame //-------------------------------------------------------------------- -SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId ) +SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId ) { - return LoadDocument( i_rDoc, i_pFrameItem ? i_pFrameItem->GetFrame() : NULL, i_nViewId ); + return LoadDocumentIntoFrame( i_rDoc, i_pFrameItem ? i_pFrameItem->GetFrame() : NULL, i_nViewId ); } //-------------------------------------------------------------------- -- cgit v1.2.3 From a1732bfb06ae69e5914efc801514d44b1dc3b13d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Dec 2009 09:43:09 +0100 Subject: #i10000# --- sfx2/source/view/viewsh.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 0904012a5d..0c75cf4f16 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1365,7 +1365,6 @@ SfxViewShell* SfxViewShell::Get( const Reference< XController>& i_rController ) if ( !i_rController.is() ) return NULL; - SfxViewShell* pViewShell = NULL; for ( SfxViewShell* pViewShell = SfxViewShell::GetFirst( NULL, FALSE ); pViewShell; pViewShell = SfxViewShell::GetNext( *pViewShell, NULL, FALSE ) -- cgit v1.2.3 From 5de3701b59b2a2205a2c41ccc4ab26cd4e6501e1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Dec 2009 10:36:00 +0100 Subject: #i10000# --- sfx2/source/view/topfrm.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index fc0c61bb79..11ed679af5 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -34,7 +34,7 @@ #endif #include -#include +#include "viewfac.hxx" #include #include #include diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 44b2d61f9c..8356a11d5b 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2214,7 +2214,6 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c SfxViewFrame* SfxViewFrame::Create_Impl( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ) { - bool bSuccess = false; SfxViewFrame* pViewFrame = NULL; try { -- cgit v1.2.3 From 7ac2ff1d85d68f53680262efa240448821539a3d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Dec 2009 13:42:47 +0100 Subject: autorecovery: oops, this test code was not intended to be committed --- sfx2/source/view/viewprn.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index bac24f88dc..0f1ae3d110 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -440,10 +440,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) return; } - int provokeCrash = 0; - int dummy = 1 / provokeCrash; - (void)dummy; - const USHORT nId = rReq.GetSlot(); switch( nId ) { -- cgit v1.2.3 From 042ff6fb68d4620a848d015f2415690c5f643702 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Dec 2009 14:33:16 +0100 Subject: autorecovery: when re-connecting in a suspend call, do not push the shells, again (they're not yet popped) --- sfx2/inc/sfx2/sfxbasecontroller.hxx | 8 +++++++- sfx2/source/view/sfxbasecontroller.cxx | 31 +++++++++++++++++++------------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx index 3682ba19a7..7ade240be0 100644 --- a/sfx2/inc/sfx2/sfxbasecontroller.hxx +++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx @@ -395,7 +395,13 @@ public: SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > impl_getTitleHelper (); //#endif private: - SAL_DLLPRIVATE void ConnectSfxFrame_Impl( const bool i_bConnect ); + enum ConnectSfxFrame + { + E_CONNECT, + E_DISCONNECT, + E_RECONNECT + }; + SAL_DLLPRIVATE void ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ); SAL_DLLPRIVATE SfxViewFrame* GetViewFrame_Impl() const; //________________________________________________________________________________________________________ diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 3821ec7bc6..608f307525 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -602,7 +602,7 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame if ( m_pData->m_pViewShell ) { - ConnectSfxFrame_Impl( true ); + ConnectSfxFrame_Impl( E_CONNECT ); } } } @@ -663,7 +663,7 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( ::com:: BOOL bRet = bOther || pDocShell->PrepareClose(); if ( bRet ) { - ConnectSfxFrame_Impl( false ); + ConnectSfxFrame_Impl( E_DISCONNECT ); m_pData->m_bSuspendState = sal_True; } @@ -676,7 +676,7 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( ::com:: if ( m_pData->m_pViewShell ) { - ConnectSfxFrame_Impl( true ); + ConnectSfxFrame_Impl( E_RECONNECT ); } m_pData->m_bSuspendState = sal_False; @@ -1255,23 +1255,30 @@ BOOL SfxBaseController::HasMouseClickListeners_Impl() return m_pData->m_aUserInputInterception.hasMouseClickListeners(); } -void SfxBaseController::ConnectSfxFrame_Impl( const bool i_bConnect ) +void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) { ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" ); SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame(); ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" ); + const bool bConnect = ( i_eConnect != E_DISCONNECT ); + // disable window and dispatcher - pActFrame->Enable( i_bConnect ); - pActFrame->GetDispatcher()->Lock( !i_bConnect ); + pActFrame->Enable( bConnect ); + pActFrame->GetDispatcher()->Lock( !bConnect ); - if ( i_bConnect ) + if ( bConnect ) { - pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell ); - if ( m_pData->m_pViewShell->GetSubShell() ) - pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() ); - m_pData->m_pViewShell->PushSubShells_Impl(); - pActFrame->GetDispatcher()->Flush(); + // upon DISCONNECT, we did *not* pop the shells from the stack (this is done elsewhere), so upon + // RECONNECT, we're not allowed to push them + if ( i_eConnect != E_RECONNECT ) + { + pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell ); + if ( m_pData->m_pViewShell->GetSubShell() ) + pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() ); + m_pData->m_pViewShell->PushSubShells_Impl(); + pActFrame->GetDispatcher()->Flush(); + } Window* pEditWin = m_pData->m_pViewShell->GetWindow(); if ( pEditWin && m_pData->m_pViewShell->IsShowView_Impl() ) -- cgit v1.2.3 From 05e45e6464af98035a483f18e8ff2f2de2e25cb3 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Dec 2009 14:44:27 +0100 Subject: autorecovery: also implement XInteractionHandler2, if our delegator supports it --- .../interaction/preventduplicateinteraction.hxx | 28 ++++++++- .../interaction/preventduplicateinteraction.cxx | 73 ++++++++++++++++++++++ 2 files changed, 99 insertions(+), 2 deletions(-) diff --git a/framework/inc/interaction/preventduplicateinteraction.hxx b/framework/inc/interaction/preventduplicateinteraction.hxx index 5ba991bf32..f0cd38642e 100644 --- a/framework/inc/interaction/preventduplicateinteraction.hxx +++ b/framework/inc/interaction/preventduplicateinteraction.hxx @@ -40,7 +40,7 @@ //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ -#include +#include #include #include @@ -86,7 +86,7 @@ struct ThreadHelpBase2 }; class PreventDuplicateInteraction : private ThreadHelpBase2 - ,public ::cppu::WeakImplHelper1< css::task::XInteractionHandler > + ,public ::cppu::WeakImplHelper1< css::task::XInteractionHandler2 > { //_____________________________________ // structs, types etcp. @@ -158,6 +158,30 @@ class PreventDuplicateInteraction : private ThreadHelpBase2 virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest) throw(css::uno::RuntimeException); + //_________________________________ + /** + @interface XInteractionHandler2 + @short called from outside to handle a problem + @descr We filter the incoming interactions. some of them + will be forwarded to the generic UI interaction handler. + So we must not implement it twice. Some other ones + will be aborted only. + + @threadsafe yes + */ + virtual ::sal_Bool SAL_CALL handleInteractionRequest( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest ) + throw (::com::sun::star::uno::RuntimeException); + + //_________________________________ + /** + @interface XInterface + @short called to query another interface of the component + @descr Will allow to query for XInteractionHandler2 if and only if m_xHandler supports this interface, too. + + @threadsafe yes + */ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) + throw (::com::sun::star::uno::RuntimeException); //_____________________________________ // c++ interface public: diff --git a/framework/source/interaction/preventduplicateinteraction.cxx b/framework/source/interaction/preventduplicateinteraction.cxx index bd97ef1d2a..ec962a724e 100644 --- a/framework/source/interaction/preventduplicateinteraction.cxx +++ b/framework/source/interaction/preventduplicateinteraction.cxx @@ -111,6 +111,20 @@ void PreventDuplicateInteraction::useDefaultUUIHandler() // <- SAFE } +//_________________________________________________________________________________________________________________ +css::uno::Any SAL_CALL PreventDuplicateInteraction::queryInterface( const css::uno::Type& aType ) + throw (css::uno::RuntimeException) +{ + if ( aType.equals( XInteractionHandler2::static_type() ) ) + { + ::osl::ResettableMutexGuard aLock(m_aLock); + css::uno::Reference< css::task::XInteractionHandler2 > xHandler( m_xHandler, css::uno::UNO_QUERY ); + if ( !xHandler.is() ) + return css::uno::Any(); + } + return ::cppu::WeakImplHelper1< css::task::XInteractionHandler2 >::queryInterface( aType ); +} + //_________________________________________________________________________________________________________________ void SAL_CALL PreventDuplicateInteraction::handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest) @@ -169,6 +183,65 @@ void SAL_CALL PreventDuplicateInteraction::handle(const css::uno::Reference< css //_________________________________________________________________________________________________________________ +::sal_Bool SAL_CALL PreventDuplicateInteraction::handleInteractionRequest( const css::uno::Reference< css::task::XInteractionRequest >& xRequest ) + throw (css::uno::RuntimeException) +{ + css::uno::Any aRequest = xRequest->getRequest(); + sal_Bool bHandleIt = sal_True; + + // SAFE -> + ::osl::ResettableMutexGuard aLock(m_aLock); + + InteractionList::iterator pIt; + for ( pIt = m_lInteractionRules.begin(); + pIt != m_lInteractionRules.end() ; + ++pIt ) + { + InteractionInfo& rInfo = *pIt; + + if (aRequest.isExtractableTo(rInfo.m_aInteraction)) + { + ++rInfo.m_nCallCount; + rInfo.m_xRequest = xRequest; + bHandleIt = (rInfo.m_nCallCount <= rInfo.m_nMaxCount); + break; + } + } + + css::uno::Reference< css::task::XInteractionHandler2 > xHandler( m_xHandler, css::uno::UNO_QUERY ); + OSL_ENSURE( xHandler.is() || !m_xHandler.is(), + "PreventDuplicateInteraction::handleInteractionRequest: inconsistency!" ); + + aLock.clear(); + // <- SAFE + + if ( + (bHandleIt ) && + (xHandler.is()) + ) + { + return xHandler->handleInteractionRequest(xRequest); + } + else + { + const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > lContinuations = xRequest->getContinuations(); + sal_Int32 c = lContinuations.getLength(); + sal_Int32 i = 0; + for (i=0; i xAbort(lContinuations[i], css::uno::UNO_QUERY); + if (xAbort.is()) + { + xAbort->select(); + break; + } + } + } + return false; +} + +//_________________________________________________________________________________________________________________ + void PreventDuplicateInteraction::addInteractionRule(const PreventDuplicateInteraction::InteractionInfo& aInteractionInfo) { // SAFE -> -- cgit v1.2.3 From 643967c0d690e0c660a71aca2e6128eb06ff0b54 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 8 Dec 2009 19:05:15 +0100 Subject: aw079: #i107360# test code for trapezoid decomposer --- drawinglayer/source/processor2d/vclprocessor2d.cxx | 86 +++++++++++++--------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 05a73e1e5e..625a26797e 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -77,6 +77,7 @@ // for test, can be removed again #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -666,51 +667,70 @@ namespace drawinglayer basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon()); aLocalPolyPolygon.transform(maCurrentTransformation); - mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon); - if(mnPolygonStrokePrimitive2D && getOptionsDrawinglayer().IsAntiAliasing()) + static bool bCheckTrapezoidDecomposition(false); + static bool bShowOutlinesThere(false); + if(bCheckTrapezoidDecomposition) { - // 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 - mpOutputDevice->SetFillColor(); - mpOutputDevice->SetLineColor(Color(aPolygonColor)); - const sal_uInt32 nCount(aLocalPolyPolygon.count()); - - for(sal_uInt32 a(0); a < nCount; a++) + // clip against discrete ViewPort + const basegfx::B2DRange& rDiscreteViewport = getViewInformation2D().getDiscreteViewport(); + aLocalPolyPolygon = basegfx::tools::clipPolyPolygonOnRange( + aLocalPolyPolygon, rDiscreteViewport, true, false); + + if(aLocalPolyPolygon.count()) { - mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0); - } - } + // subdivide + aLocalPolyPolygon = basegfx::tools::adaptiveSubdivideByDistance( + aLocalPolyPolygon, 0.5); - static bool bTestPolygonClipping(false); - if(bTestPolygonClipping) - { - static bool bInside(true); - static bool bFilled(false); - static bool bLine(false); + // trapezoidize + const basegfx::B2DTrapezoidVector aB2DTrapezoidVector(basegfx::tools::trapezoidSubdivide( + aLocalPolyPolygon)); - basegfx::B2DRange aRange(aLocalPolyPolygon.getB2DRange()); - aRange.grow(aRange.getWidth() * -0.1); + const sal_uInt32 nCount(aB2DTrapezoidVector.size()); - if(bFilled) - { - basegfx::B2DPolyPolygon aFilledClipped(basegfx::tools::clipPolyPolygonOnRange(aLocalPolyPolygon, aRange, bInside, false)); - basegfx::BColor aRand(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0); - mpOutputDevice->SetFillColor(Color(aRand)); - mpOutputDevice->SetLineColor(); - mpOutputDevice->DrawPolyPolygon(aFilledClipped); + if(nCount) + { + basegfx::BColor aInvPolygonColor(aPolygonColor); + aInvPolygonColor.invert(); + + for(sal_uInt32 a(0); a < nCount; a++) + { + const basegfx::B2DPolygon aTempPolygon(aB2DTrapezoidVector[a].getB2DPolygon()); + + if(bShowOutlinesThere) + { + mpOutputDevice->SetFillColor(Color(aPolygonColor)); + mpOutputDevice->SetLineColor(); + } + + mpOutputDevice->DrawPolygon(aTempPolygon); + + if(bShowOutlinesThere) + { + mpOutputDevice->SetFillColor(); + mpOutputDevice->SetLineColor(Color(aInvPolygonColor)); + mpOutputDevice->DrawPolyLine(aTempPolygon, 0.0); + } + } + } } + } + else + { + mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon); - if(bLine) + if(mnPolygonStrokePrimitive2D && getOptionsDrawinglayer().IsAntiAliasing()) { - basegfx::B2DPolyPolygon aLineClipped(basegfx::tools::clipPolyPolygonOnRange(aLocalPolyPolygon, aRange, bInside, true)); - basegfx::BColor aRand(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0); + // 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 mpOutputDevice->SetFillColor(); - mpOutputDevice->SetLineColor(Color(aRand)); + mpOutputDevice->SetLineColor(Color(aPolygonColor)); + const sal_uInt32 nCount(aLocalPolyPolygon.count()); - for(sal_uInt32 a(0); a < aLineClipped.count(); a++) + for(sal_uInt32 a(0); a < nCount; a++) { - mpOutputDevice->DrawPolyLine(aLineClipped.getB2DPolygon(a), 0.0); + mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0); } } } -- cgit v1.2.3 From f5b58cfa27f16382ccb92c96aa82fe2a59abaf77 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 8 Dec 2009 19:09:16 +0100 Subject: aw079: #i107346# flag for WrongSpell in SdrTextAttribute --- svx/inc/svx/sdr/attribute/sdrtextattribute.hxx | 5 ++++- svx/source/sdr/attribute/sdrtextattribute.cxx | 13 +++++++++---- svx/source/sdr/primitive2d/sdrattributecreator.cxx | 10 +++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx index aaba3620ea..3b84402676 100644 --- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx @@ -81,6 +81,7 @@ namespace drawinglayer unsigned mbScroll : 1; unsigned mbInEditMode : 1; unsigned mbFixedCellHeight : 1; + unsigned mbWrongSpell : 1; public: SdrTextAttribute( @@ -99,7 +100,8 @@ namespace drawinglayer bool bBlink, bool bScroll, bool bInEditMode, - bool bFixedCellHeight); + bool bFixedCellHeight, + bool bWrongSpell); ~SdrTextAttribute(); // copy constructor and assigment operator @@ -119,6 +121,7 @@ namespace drawinglayer bool isScroll() const { return mbScroll; } bool isInEditMode() const { return mbInEditMode; } bool isFixedCellHeight() const { return mbFixedCellHeight; } + bool isWrongSpell() const { return mbWrongSpell; } const SdrFormTextAttribute* getSdrFormTextAttribute() const { return mpSdrFormTextAttribute; } sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; } sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; } diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 244946e393..1c72623610 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -65,7 +65,8 @@ namespace drawinglayer bool bBlink, bool bScroll, bool bInEditMode, - bool bFixedCellHeight) + bool bFixedCellHeight, + bool bWrongSpell) : mpSdrText(&rSdrText), maOutlinerParaObject(rOutlinerParaObject), mpSdrFormTextAttribute(0), @@ -82,7 +83,8 @@ namespace drawinglayer mbBlink(bBlink), mbScroll(bScroll), mbInEditMode(bInEditMode), - mbFixedCellHeight(bFixedCellHeight) + mbFixedCellHeight(bFixedCellHeight), + mbWrongSpell(bWrongSpell) { if(XFT_NONE != eFormTextStyle) { @@ -123,7 +125,8 @@ namespace drawinglayer mbBlink(rCandidate.isBlink()), mbScroll(rCandidate.isScroll()), mbInEditMode(rCandidate.isInEditMode()), - mbFixedCellHeight(rCandidate.isFixedCellHeight()) + mbFixedCellHeight(rCandidate.isFixedCellHeight()), + mbWrongSpell(rCandidate.isWrongSpell()) { if(rCandidate.getSdrFormTextAttribute()) { @@ -164,6 +167,7 @@ namespace drawinglayer mbScroll = rCandidate.isScroll(); mbInEditMode = rCandidate.isInEditMode(); mbFixedCellHeight = rCandidate.isFixedCellHeight(); + mbWrongSpell = rCandidate.isWrongSpell(); return *this; } @@ -197,7 +201,8 @@ namespace drawinglayer && isBlink() == rCandidate.isBlink() && isScroll() == rCandidate.isScroll() && isInEditMode() == rCandidate.isInEditMode() - && isFixedCellHeight() == rCandidate.isFixedCellHeight()); + && isFixedCellHeight() == rCandidate.isFixedCellHeight() + && isWrongSpell() == rCandidate.isWrongSpell()); } void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 417445b7d7..82d7681208 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -77,6 +77,9 @@ #include #include #include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -523,6 +526,10 @@ namespace drawinglayer const SdrFitToSizeType eFit(rTextObj.GetFitToSize()); const SdrTextAniKind eAniKind(rTextObj.GetTextAniKind()); + // #i107346# + const SdrOutliner& rDrawTextOutliner = rText.GetModel()->GetDrawOutliner(&rTextObj); + const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EE_CNTRL_ONLINESPELLING); + pRetval = new attribute::SdrTextAttribute( rText, aOutlinerParaObject, @@ -539,7 +546,8 @@ namespace drawinglayer SDRTEXTANI_BLINK == eAniKind, SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind, bInEditMode, - ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue(), + bWrongSpell); } return pRetval; -- cgit v1.2.3 From 54284cd1766b8fc654d9fca36007e3a7306a8e8b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 9 Dec 2009 10:12:26 +0100 Subject: autorecovery: SfxViewFrame::CreateViewFrame does not have any clients anymore - removed --- sfx2/inc/sfx2/viewfrm.hxx | 1 - sfx2/source/view/viewfrm.cxx | 7 ------- 2 files changed, 8 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index b86ab78b6b..9fb96d006d 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -165,7 +165,6 @@ public: SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM) static void SetViewFrame( SfxViewFrame* ); - static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc, USHORT nViewId=0, BOOL bHidden = FALSE ); static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 8356a11d5b..7164e69065 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -3505,13 +3505,6 @@ void SfxViewFrame::UpdateDocument_Impl() pDoc->UpdateFromTemplate_Impl(); } -SfxViewFrame* SfxViewFrame::CreateViewFrame( SfxObjectShell& rDoc, sal_uInt16 nViewId, sal_Bool bHidden ) -{ - SfxFrame* pFrame = SfxFrame::Create( rDoc, nViewId, bHidden ); - OSL_ENSURE( pFrame, "SfxViewFrame::CreateViewFrame: failed!" ); - return pFrame ? pFrame->GetCurrentViewFrame() : NULL; -} - void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame ) { SFX_APP()->SetViewFrame_Impl( pFrame ); -- cgit v1.2.3 From 149d9920cdad6a5fc5ec440e54b0aab304b60052 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 9 Dec 2009 10:27:30 +0100 Subject: autorecovery: removed a (now unused) flavour of SfxFrame::Create --- sfx2/inc/sfx2/frame.hxx | 1 - sfx2/source/view/topfrm.cxx | 86 --------------------------------------------- 2 files changed, 87 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index eaf08c108d..02658d7744 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -141,7 +141,6 @@ public: static SfxFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); static SfxFrame* CreateBlank(); - static SfxFrame* Create( SfxObjectShell& rDoc, const USHORT nViewId, const bool bHidden ); static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ); SvCompatWeakHdl* GetHdl(); diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 11ed679af5..d675ddecbe 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -411,92 +411,6 @@ SfxFrame* SfxFrame::CreateBlank() return pFrame; } -SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, const USHORT nViewId, const bool bHidden ) -{ - if ( nViewId ) - rDoc.GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - if ( bHidden ) - rDoc.GetMedium()->GetItemSet()->Put( SfxBoolItem( SID_HIDDEN, sal_True ) ); - - Reference < XFrame > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); - SfxFrame* pFrame = NULL; - - if ( !bHidden ) - { - URL aTargetURL; - aTargetURL.Complete = rDoc.GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - - BOOL bIsBasic = FALSE; - if ( !aTargetURL.Complete.getLength() ) - { - String sFactory = String::CreateFromAscii( rDoc.GetFactory().GetShortName() ); - bIsBasic = ( sFactory.CompareIgnoreCaseToAscii("sbasic") == COMPARE_EQUAL ); - if ( !bIsBasic ) - { - String aURL = String::CreateFromAscii("private:factory/"); - aURL += sFactory; - aTargetURL.Complete = aURL; - } - } - - if ( bIsBasic ) - { - // for the Basic IDE, we need to manually find the start module (if present), since the below code - // of dispatching the model into a "_default" frame will not work here. - // (TODO: Why doesn't it? If it would, we could spare the extra code here.) - Reference< XFrame > xFrame( lcl_findStartModuleFrame() ); - if ( xFrame.is() ) - pFrame = SfxFrame::Create( xFrame ); - } - else - { - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); - xTrans->parseStrict( aTargetURL ); - - Reference < XDispatchProvider > xProv( xDesktop, UNO_QUERY ); - Reference < XDispatch > xDisp; - if ( xProv.is() ) - { - Sequence < PropertyValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString::createFromAscii("Model"); - aSeq[0].Value <<= rDoc.GetModel(); - ::rtl::OUString aTargetFrame( ::rtl::OUString::createFromAscii("_default") ); - xDisp = xProv->queryDispatch( aTargetURL, aTargetFrame , 0 ); - if ( xDisp.is() ) - xDisp->dispatch( aTargetURL, aSeq ); - } - - SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - for( USHORT nPos = rArr.Count(); nPos--; ) - { - SfxFrame *pF = rArr[ nPos ]; - if ( pF->GetCurrentDocument() == &rDoc ) - { - pFrame = pF; - break; - } - } - OSL_ENSURE( pFrame, "SfxFrame::Create: loading the doc via a dispatcher failed, it seems!" ); - if ( pFrame ) - return pFrame; - } - } - - if ( !pFrame ) - pFrame = SfxFrame::CreateBlank(); - - pFrame->pImp->bHidden = bHidden; - Window* pWindow = pFrame->GetTopWindow_Impl(); - if ( &rDoc != pFrame->GetCurrentDocument() ) - { - pFrame->InsertDocument_Impl( rDoc, *rDoc.GetMedium()->GetItemSet() ); - if ( pWindow && !bHidden ) - pWindow->Show(); - } - - return pFrame; -} - SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ) { SfxFrame* pFrame = NULL; -- cgit v1.2.3 From 3efdfc8e6d4dc744326b471c7eeed55228d2cee6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 9 Dec 2009 11:12:09 +0100 Subject: autorecovery: split topfrm.cxx into viewfrm2.cxx and frame2.cxx, cleaned up some includes, removed some relict 'Top' in impl-class names --- sfx2/inc/sfx2/frame.hxx | 4 +- sfx2/source/view/frame2.cxx | 661 ++++++++++++++++++++ sfx2/source/view/impviewframe.hxx | 9 +- sfx2/source/view/makefile.mk | 5 +- sfx2/source/view/topfrm.cxx | 1212 ------------------------------------- sfx2/source/view/viewfrm.cxx | 2 +- sfx2/source/view/viewfrm2.cxx | 536 ++++++++++++++++ 7 files changed, 1209 insertions(+), 1220 deletions(-) create mode 100644 sfx2/source/view/frame2.cxx delete mode 100644 sfx2/source/view/topfrm.cxx create mode 100644 sfx2/source/view/viewfrm2.cxx diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 02658d7744..ecd9bffeb4 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -117,7 +117,7 @@ struct SfxFramePickEntry_Impl; class SFX2_DLLPUBLIC SfxFrame { friend class SfxFrameIterator; - friend class SfxTopWindow_Impl; + friend class SfxFrameWindow_Impl; private: SfxFrame* pParentFrame; @@ -129,9 +129,7 @@ protected: sal_Bool Close(); virtual ~SfxFrame(); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* ); -//#endif SfxFrame( ); // not implemented SAL_DLLPRIVATE SfxFrame( Window& i_rContainerWindow, bool bHidden ); diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx new file mode 100644 index 0000000000..9bcd21ebee --- /dev/null +++ b/sfx2/source/view/frame2.cxx @@ -0,0 +1,661 @@ +/************************************************************************* + * + * 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: topfrm.cxx,v $ + * $Revision: 1.97 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sfx2.hxx" + +#include "impframe.hxx" +#include "objshimp.hxx" +#include "sfxhelp.hxx" +#include "viewfac.hxx" +#include "workwin.hxx" + +#include "sfx2/app.hxx" +#include "sfx2/bindings.hxx" +#include "sfx2/dispatch.hxx" +#include "sfx2/docfac.hxx" +#include "sfx2/docfile.hxx" +#include "sfx2/event.hxx" +#include "sfx2/objface.hxx" +#include "sfx2/request.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::util; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::beans; +using ::com::sun::star::document::XViewDataSupplier; +using ::com::sun::star::lang::XMultiServiceFactory; +using ::com::sun::star::lang::XComponent; +using ::com::sun::star::frame::XComponentLoader; + +//------------------------------------------------------------------------ + +class SfxFrameWindow_Impl : public Window +{ +public: + SfxFrame* pFrame; + + SfxFrameWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow ); + ~SfxFrameWindow_Impl( ); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + virtual void StateChanged( StateChangedType nStateChange ); + virtual long PreNotify( NotifyEvent& rNEvt ); + virtual long Notify( NotifyEvent& rEvt ); + virtual void Resize(); + virtual void GetFocus(); + void DoResize(); + DECL_LINK( CloserHdl, void* ); +}; + +SfxFrameWindow_Impl::SfxFrameWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow ) + : Window( &i_rContainerWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK ) + , pFrame( pF ) +{ +} + +SfxFrameWindow_Impl::~SfxFrameWindow_Impl( ) +{ +} + +void SfxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt ) +{ + Window::DataChanged( rDCEvt ); + SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl(); + if ( pWorkWin ) + pWorkWin->DataChanged_Impl( rDCEvt ); +} + +long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt ) +{ + if ( pFrame->IsClosing_Impl() || !pFrame->GetFrameInterface().is() ) + return sal_False; + + SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); + if ( !pView || !pView->GetObjectShell() ) + return Window::Notify( rNEvt ); + + if ( rNEvt.GetType() == EVENT_GETFOCUS ) + { + if ( pView->GetViewShell() && !pView->GetViewShell()->GetUIActiveIPClient_Impl() && !pFrame->IsInPlace() ) + { + DBG_TRACE("SfxFrame: GotFocus"); + pView->MakeActive_Impl( FALSE ); + } + + // TODO/LATER: do we still need this code? + Window* pWindow = rNEvt.GetWindow(); + ULONG nHelpId = 0; + while ( !nHelpId && pWindow ) + { + nHelpId = pWindow->GetHelpId(); + pWindow = pWindow->GetParent(); + } + + if ( nHelpId ) + SfxHelp::OpenHelpAgent( pFrame, nHelpId ); + + // if focus was on an external window, the clipboard content might have been changed + pView->GetBindings().Invalidate( SID_PASTE ); + pView->GetBindings().Invalidate( SID_PASTE_SPECIAL ); + return sal_True; + } + else if( rNEvt.GetType() == EVENT_KEYINPUT ) + { + if ( pView->GetViewShell()->KeyInput( *rNEvt.GetKeyEvent() ) ) + return TRUE; + } + else if ( rNEvt.GetType() == EVENT_EXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTDISABLE*/ ) + { + pView->SetModalMode( sal_True ); + return sal_True; + } + else if ( rNEvt.GetType() == EVENT_ENDEXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTENABLE*/ ) + { + //EnableInput( sal_True, sal_True ); + pView->SetModalMode( sal_False ); + return sal_True; + } + + return Window::Notify( rNEvt ); +} + +long SfxFrameWindow_Impl::PreNotify( NotifyEvent& rNEvt ) +{ + USHORT nType = rNEvt.GetType(); + if ( nType == EVENT_KEYINPUT || nType == EVENT_KEYUP ) + { + SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); + SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL; + if ( pShell && pShell->HasKeyListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) ) + return sal_True; + } + else if ( nType == EVENT_MOUSEBUTTONUP || nType == EVENT_MOUSEBUTTONDOWN ) + { + Window* pWindow = rNEvt.GetWindow(); + SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); + SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL; + if ( pShell ) + if ( pWindow == pShell->GetWindow() || pShell->GetWindow()->IsChild( pWindow ) ) + if ( pShell->HasMouseClickListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) ) + return sal_True; + } + + if ( nType == EVENT_MOUSEBUTTONDOWN ) + { + Window* pWindow = rNEvt.GetWindow(); + const MouseEvent* pMEvent = rNEvt.GetMouseEvent(); + Point aPos = pWindow->OutputToScreenPixel( pMEvent->GetPosPixel() ); + SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl(); + if ( pWorkWin ) + pWorkWin->EndAutoShow_Impl( aPos ); + } + + return Window::PreNotify( rNEvt ); +} + +void SfxFrameWindow_Impl::GetFocus() +{ + if ( pFrame && !pFrame->IsClosing_Impl() && pFrame->GetCurrentViewFrame() && pFrame->GetFrameInterface().is() ) + pFrame->GetCurrentViewFrame()->MakeActive_Impl( TRUE ); +} + +void SfxFrameWindow_Impl::Resize() +{ + if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() ) + DoResize(); +} + +void SfxFrameWindow_Impl::StateChanged( StateChangedType nStateChange ) +{ + if ( nStateChange == STATE_CHANGE_INITSHOW ) + { + pFrame->pImp->bHidden = FALSE; + if ( pFrame->IsInPlace() ) + // TODO/MBA: workaround for bug in LayoutManager: the final resize does not get through because the + // LayoutManager works asynchronously and between resize and time execution the DockingAcceptor was exchanged so that + // the resize event never is sent to the component + SetSizePixel( GetParent()->GetOutputSizePixel() ); + + DoResize(); + SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); + if ( pView ) + pView->GetBindings().GetWorkWindow_Impl()->ShowChilds_Impl(); + } + + Window::StateChanged( nStateChange ); +} + +void SfxFrameWindow_Impl::DoResize() +{ + if ( !pFrame->pImp->bLockResize ) + pFrame->Resize(); +} + +SfxFrame* SfxFrame::CreateBlank() +{ + SfxFrame* pFrame = NULL; + try + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); + Reference < XFrame > xFrame = xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ); + pFrame = Create( xFrame ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return pFrame; +} + +SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ) +{ + SfxFrame* pFrame = NULL; + try + { + // create and initialize new top level frame for this window + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference < XFramesSupplier > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); + Reference < XFrame > xFrame( aContext.createComponent( "com.sun.star.frame.Frame"), UNO_QUERY_THROW ); + + Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW ); + xFrame->initialize( xWin.get() ); + xDesktop->getFrames()->append( xFrame ); + + if ( xWin->isActive() ) + xFrame->activate(); + + // create load arguments + Sequence< PropertyValue > aLoadArgs; + TransformItems( SID_OPENDOC, *rDoc.GetMedium()->GetItemSet(), aLoadArgs ); + + ::comphelper::NamedValueCollection aArgs( aLoadArgs ); + aArgs.put( "Model", rDoc.GetModel() ); + aArgs.put( "Hidden", bHidden ); + if ( nViewId ) + aArgs.put( "ViewId", nViewId ); + + aLoadArgs = aArgs.getPropertyValues(); + + // load the doc into that frame + Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); + xLoader->loadComponentFromURL( + rDoc.GetModel()->getURL(), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ), + 0, + aLoadArgs + ); + + for ( pFrame = SfxFrame::GetFirst(); + pFrame; + pFrame = SfxFrame::GetNext( *pFrame ) + ) + { + if ( pFrame->GetFrameInterface() == xFrame ) + break; + } + + OSL_ENSURE( pFrame, "SfxFrame::Create: load succeeded, but no SfxFrame was created during this!" ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + return pFrame; +} + +SfxFrame* SfxFrame::Create( Reference < XFrame > xFrame ) +{ + // create a new TopFrame to an external XFrame object ( wrap controller ) + ENSURE_OR_THROW( xFrame.is(), "NULL frame not allowed" ); + Window* pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); + ENSURE_OR_THROW( pWindow, "frame without container window not allowed" ); + + SfxFrame* pFrame = new SfxFrame( *pWindow, false ); + pFrame->SetFrameInterface_Impl( xFrame ); + return pFrame; +} + +SfxFrame::SfxFrame( Window& i_rContainerWindow, bool i_bHidden ) + :pParentFrame( NULL ) + ,pChildArr( NULL ) + ,pImp( NULL ) + ,pWindow( NULL ) +{ + Construct_Impl(); + + pImp->bHidden = i_bHidden; + InsertTopFrame_Impl( this ); + pImp->pExternalContainerWindow = &i_rContainerWindow; + + pWindow = new SfxFrameWindow_Impl( this, i_rContainerWindow ); + + // always show pWindow, which is the ComponentWindow of the XFrame we live in + // nowadays, since SfxFrames can be created with an XFrame only, hiding or showing the complete XFrame + // is not done at level of the container window, not at SFX level. Thus, the component window can + // always be visible. + pWindow->Show(); +} + +void SfxFrame::SetPresentationMode( BOOL bSet ) +{ + if ( GetCurrentViewFrame() ) + GetCurrentViewFrame()->GetWindow().SetBorderStyle( bSet ? WINDOW_BORDER_NOBORDER : WINDOW_BORDER_NORMAL ); + + Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY ); + Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; + + if ( xPropSet.is() ) + { + Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + aValue >>= xLayoutManager; + } + + if ( xLayoutManager.is() ) + xLayoutManager->setVisible( !bSet ); // we don't want to have ui in presentation mode + + SetMenuBarOn_Impl( !bSet ); + if ( GetWorkWindow_Impl() ) + GetWorkWindow_Impl()->SetDockingAllowed( !bSet ); + if ( GetCurrentViewFrame() ) + GetCurrentViewFrame()->GetDispatcher()->Update_Impl( TRUE ); +} + +SystemWindow* SfxFrame::GetSystemWindow() const +{ + return GetTopWindow_Impl(); +} + +SystemWindow* SfxFrame::GetTopWindow_Impl() const +{ + if ( pImp->pExternalContainerWindow->IsSystemWindow() ) + return (SystemWindow*) pImp->pExternalContainerWindow; + else + return NULL; +} + +Window& SfxFrame::GetWindow() const +{ + return *pWindow; +} + +sal_Bool SfxFrame::Close() +{ + delete this; + return sal_True; +} + +void SfxFrame::LockResize_Impl( BOOL bLock ) +{ + pImp->bLockResize = bLock; +} + +IMPL_LINK( SfxFrameWindow_Impl, CloserHdl, void*, EMPTYARG ) +{ + if ( pFrame && !pFrame->PrepareClose_Impl( TRUE ) ) + return 0L; + + if ( pFrame ) + pFrame->GetCurrentViewFrame()->GetBindings().Execute( SID_CLOSEWIN, 0, 0, SFX_CALLMODE_ASYNCHRON ); + return 0L; +} + +void SfxFrame::SetMenuBarOn_Impl( BOOL bOn ) +{ + pImp->bMenuBarOn = bOn; + + Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY ); + Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; + + if ( xPropSet.is() ) + { + Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + aValue >>= xLayoutManager; + } + + if ( xLayoutManager.is() ) + { + rtl::OUString aMenuBarURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" )); + + if ( bOn ) + xLayoutManager->showElement( aMenuBarURL ); + else + xLayoutManager->hideElement( aMenuBarURL ); + } +} + +BOOL SfxFrame::IsMenuBarOn_Impl() const +{ + return pImp->bMenuBarOn; +} + +void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const +{ + Window *pWin = pImp->pExternalContainerWindow; + + // Groesse setzen + const Size aAppWindow( pImp->pExternalContainerWindow->GetDesktopRectPixel().GetSize() ); + Point aPos( rWinArea.TopLeft() ); + Size aSz( rWinArea.GetSize() ); + if ( aSz.Width() && aSz.Height() ) + { + aPos.X() = Min(aPos.X(), + long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) ); + aPos.Y() = Min(aPos.Y(), + long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) ); + if ( aPos.X() + aSz.Width() < + aAppWindow.Width() + aSz.Width() / 2 && + aPos.Y() + aSz.Height() < + aAppWindow.Height() + aSz.Height() / 2 ) + { + pWin->SetPosPixel( aPos ); + pWin->SetOutputSizePixel( aSz ); + } + } +} + +namespace +{ + bool lcl_getViewDataAndID( const Reference< XModel >& _rxDocument, Sequence< PropertyValue >& _o_viewData, USHORT& _o_viewId ) + { + _o_viewData.realloc(0); + _o_viewId = 0; + + Reference< XViewDataSupplier > xViewDataSupplier( _rxDocument, UNO_QUERY ); + Reference< XIndexAccess > xViewData; + if ( xViewDataSupplier.is() ) + xViewData = xViewDataSupplier->getViewData(); + + if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) + return false; + + // obtain the ViewID from the view data + _o_viewId = 0; + if ( xViewData->getByIndex( 0 ) >>= _o_viewData ) + { + ::comphelper::NamedValueCollection aNamedUserData( _o_viewData ); + ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); + if ( sViewId.getLength() ) + { + sViewId = sViewId.copy( 4 ); // format is like in "view3" + _o_viewId = USHORT( sViewId.toInt32() ); + } + } + return true; + } +} + +sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& rSet ) +/* [Beschreibung] + */ +{ + OSL_PRECOND( rDoc.GetMedium(), "SfxFrame::InsertDocument_Impl: no medium -> no view!"); + if ( !rDoc.GetMedium() ) + return sal_False; + + OSL_PRECOND( GetCurrentViewFrame() == NULL, + "SfxObjectShell::InsertDocument_Impl: no support (anymore) for loading into a non-empty frame!" ); + // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays + // done in higher layers, namely in the framework. + if ( GetCurrentViewFrame() != NULL ) + return sal_False; + + OSL_PRECOND( GetCurrentDocument() == NULL, + "SfxFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); + + SFX_ITEMSET_ARG( &rSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size + SFX_ITEMSET_ARG( &rSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID + SFX_ITEMSET_ARG( &rSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom + SFX_ITEMSET_ARG( &rSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False ); // hidden + SFX_ITEMSET_ARG( &rSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False ); // view only + SFX_ITEMSET_ARG( &rSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) + SFX_ITEMSET_ARG( &rSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) + + // hidden? + pImp->bHidden = pHidItem ? pHidItem->GetValue() : pImp->bHidden; + + // plugin mode + const USHORT nPluginMode = pPluginMode ? pPluginMode->GetValue() : 0; + + // view only? + if ( pEditItem && pEditItem->GetValue() ) + SetMenuBarOn_Impl( FALSE ); + + // view ID + USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : 0; + + if( !pImp->bHidden ) + rDoc.OwnerLock( sal_True ); + + Sequence< PropertyValue > aUserData; + bool bClearPosSizeZoom = false; + bool bReadUserData = false; + + // if no view-related data exists in the set, then obtain the view data from the model + if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) + { + if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) + { + SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); + pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + bClearPosSizeZoom = bReadUserData = true; + } + } + + UpdateDescriptor( &rDoc ); + + if ( nPluginMode && ( nPluginMode != 2 ) ) + SetInPlace_Impl( TRUE ); + + SfxViewFrame* pViewFrame = SfxViewFrame::Create_Impl( *this, rDoc, nViewId ? nViewId : rDoc.GetFactory().GetViewFactory( 0 ).GetOrdinal() ); + OSL_ENSURE( pViewFrame, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); + if ( !pViewFrame ) + // TODO: better error handling? Under which conditions can this fail? + return sal_False; + + if ( nPluginMode == 1 ) + { + pViewFrame->ForceOuterResize_Impl( FALSE ); + pViewFrame->GetBindings().HidePopups(TRUE); + + // MBA: layoutmanager of inplace frame starts locked and invisible + GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); + GetWorkWindow_Impl()->Lock_Impl( TRUE ); + + GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + } + + OSL_ENSURE( ( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT ) + || ( pJumpItem == NULL ), + "SfxFrame::InsertDocument_Impl: so this code wasn't dead?" ); + // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time + // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method + // here is never called before the load process finished. At least not with a jump item != NULL. + if( pJumpItem ) + { + pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); + } + + // Position und Groesse setzen + if ( pAreaItem ) + PositionWindow_Impl( pAreaItem->GetValue() ); + + if ( !pImp->bHidden ) + { + if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) ) + pViewFrame->GetDispatcher()->HideUI( TRUE ); + else + pViewFrame->GetDispatcher()->HideUI( FALSE ); + + if ( IsInPlace() ) + pViewFrame->LockAdjustPosSizePixel(); + + if ( ( nPluginMode == 3 ) ) + GetWorkWindow_Impl()->SetInternalDockingAllowed(FALSE); + + if ( !IsInPlace() ) + pViewFrame->GetDispatcher()->Update_Impl(); + pViewFrame->Show(); + GetWindow().Show(); + if ( !IsInPlace() || ( nPluginMode == 3 ) ) + pViewFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); + rDoc.OwnerLock( sal_False ); + + if ( IsInPlace() ) + { + pViewFrame->UnlockAdjustPosSizePixel(); + // force resize for OLE server to fix layout problems of writer and math + // see i53651 + if ( nPluginMode == 3 ) + pViewFrame->Resize(TRUE); + } + } + else + { + DBG_ASSERT( !IsInPlace() && !pPluginMode, "Special modes not compatible with hidden mode!" ); + GetWindow().Show(); + } + + // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen! + pViewFrame->UpdateTitle(); + + if ( !IsInPlace() ) + { + pViewFrame->Resize(TRUE); + } + + SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); + + if ( bClearPosSizeZoom ) + { + SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); + pMediumSet->ClearItem( SID_VIEW_POS_SIZE ); + pMediumSet->ClearItem( SID_WIN_POSSIZE ); + pMediumSet->ClearItem( SID_VIEW_ZOOM_MODE ); + } + + if ( bReadUserData ) + { + // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE + // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet + if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) + { + pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); + } + } + + return GetCurrentDocument() == &rDoc; +} + diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx index 521a7428de..932eb49f1f 100644 --- a/sfx2/source/view/impviewframe.hxx +++ b/sfx2/source/view/impviewframe.hxx @@ -26,6 +26,11 @@ #ifndef SFX2_IMPVIEWFRAME_HXX #define SFX2_IMPVIEWFRAME_HXX +#include "sfx2/viewfrm.hxx" + +#include +#include + struct SfxViewFrame_Impl { SvBorder aBorder; @@ -67,13 +72,13 @@ struct SfxViewFrame_Impl } }; -class SfxTopViewWin_Impl : public Window +class SfxFrameViewWindow_Impl : public Window { BOOL bActive; SfxViewFrame* pFrame; public: - SfxTopViewWin_Impl( SfxViewFrame* p, Window& rParent, WinBits nBits=0 ) : + SfxFrameViewWindow_Impl( SfxViewFrame* p, Window& rParent, WinBits nBits=0 ) : Window( &rParent, nBits | WB_BORDER | WB_CLIPCHILDREN ), bActive( FALSE ), pFrame( p ) diff --git a/sfx2/source/view/makefile.mk b/sfx2/source/view/makefile.mk index 3ab9d5d7e2..a240ea8705 100644 --- a/sfx2/source/view/makefile.mk +++ b/sfx2/source/view/makefile.mk @@ -49,17 +49,18 @@ SRC1FILES = \ view.src SLOFILES = \ - $(SLO)$/ipclient.obj \ + $(SLO)$/ipclient.obj \ $(SLO)$/viewsh.obj \ $(SLO)$/frmload.obj \ $(SLO)$/frame.obj \ + $(SLO)$/frame2.obj \ $(SLO)$/printer.obj \ $(SLO)$/prnmon.obj \ $(SLO)$/viewprn.obj \ $(SLO)$/viewfac.obj \ $(SLO)$/orgmgr.obj \ $(SLO)$/viewfrm.obj \ - $(SLO)$/topfrm.obj \ + $(SLO)$/viewfrm2.obj \ $(SLO)$/sfxbasecontroller.obj \ $(SLO)$/userinputinterception.obj diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx deleted file mode 100644 index d675ddecbe..0000000000 --- a/sfx2/source/view/topfrm.cxx +++ /dev/null @@ -1,1212 +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: topfrm.cxx,v $ - * $Revision: 1.97 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - -#include -#include "viewfac.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _TOOLKIT_UNOHLP_HXX -#include -#endif -#ifndef _UNO_COM_SUN_STAR_AWT_POSSIZE_HPP_ -#include -#endif -#include -#ifndef _COM_SUN_STAR_CONTAINER_XPROPERTYSET_HPP_ -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -// wg. pTopFrames -#include "appdata.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "objshimp.hxx" -#include "workwin.hxx" -#include "sfxtypes.hxx" -#include "splitwin.hxx" -#include "arrdecl.hxx" -#include "sfxhelp.hxx" -#include -#include -#include "statcach.hxx" -#include -#include "impframe.hxx" -#include "impviewframe.hxx" - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::frame; -using namespace ::com::sun::star::util; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::beans; -using ::com::sun::star::document::XViewDataSupplier; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::lang::XComponent; -using ::com::sun::star::frame::XComponentLoader; - -//------------------------------------------------------------------------ - -#include -static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService ) -{ - uno::Reference< container::XNameAccess > xMM( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")), uno::UNO_QUERY ); - ::rtl::OUString sVar; - if ( !xMM.is() ) - return sVar; - - try - { - ::comphelper::SequenceAsHashMap aAnalyzer( xMM->getByName(sDocService) ); - sVar = aAnalyzer.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("ooSetupFactoryUIName"), ::rtl::OUString() ); - } - catch( uno::Exception& ) - { - sVar = ::rtl::OUString(); - } - - return sVar; -} - -class SfxTopWindow_Impl : public Window -{ -public: - SfxFrame* pFrame; - - SfxTopWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow ); - ~SfxTopWindow_Impl( ); - - virtual void DataChanged( const DataChangedEvent& rDCEvt ); - virtual void StateChanged( StateChangedType nStateChange ); - virtual long PreNotify( NotifyEvent& rNEvt ); - virtual long Notify( NotifyEvent& rEvt ); - virtual void Resize(); - virtual void GetFocus(); - void DoResize(); - DECL_LINK( CloserHdl, void* ); -}; - -SfxTopWindow_Impl::SfxTopWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow ) - : Window( &i_rContainerWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK ) - , pFrame( pF ) -{ -} - -SfxTopWindow_Impl::~SfxTopWindow_Impl( ) -{ -} - -void SfxTopWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt ) -{ - Window::DataChanged( rDCEvt ); - SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl(); - if ( pWorkWin ) - pWorkWin->DataChanged_Impl( rDCEvt ); -} - -long SfxTopWindow_Impl::Notify( NotifyEvent& rNEvt ) -{ - if ( pFrame->IsClosing_Impl() || !pFrame->GetFrameInterface().is() ) - return sal_False; - - SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); - if ( !pView || !pView->GetObjectShell() ) - return Window::Notify( rNEvt ); - - if ( rNEvt.GetType() == EVENT_GETFOCUS ) - { - if ( pView->GetViewShell() && !pView->GetViewShell()->GetUIActiveIPClient_Impl() && !pFrame->IsInPlace() ) - { - DBG_TRACE("SfxFrame: GotFocus"); - pView->MakeActive_Impl( FALSE ); - } - - // TODO/LATER: do we still need this code? - Window* pWindow = rNEvt.GetWindow(); - ULONG nHelpId = 0; - while ( !nHelpId && pWindow ) - { - nHelpId = pWindow->GetHelpId(); - pWindow = pWindow->GetParent(); - } - - if ( nHelpId ) - SfxHelp::OpenHelpAgent( pFrame, nHelpId ); - - // if focus was on an external window, the clipboard content might have been changed - pView->GetBindings().Invalidate( SID_PASTE ); - pView->GetBindings().Invalidate( SID_PASTE_SPECIAL ); - return sal_True; - } - else if( rNEvt.GetType() == EVENT_KEYINPUT ) - { - if ( pView->GetViewShell()->KeyInput( *rNEvt.GetKeyEvent() ) ) - return TRUE; - } - else if ( rNEvt.GetType() == EVENT_EXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTDISABLE*/ ) - { - pView->SetModalMode( sal_True ); - return sal_True; - } - else if ( rNEvt.GetType() == EVENT_ENDEXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTENABLE*/ ) - { - //EnableInput( sal_True, sal_True ); - pView->SetModalMode( sal_False ); - return sal_True; - } - - return Window::Notify( rNEvt ); -} - -long SfxTopWindow_Impl::PreNotify( NotifyEvent& rNEvt ) -{ - USHORT nType = rNEvt.GetType(); - if ( nType == EVENT_KEYINPUT || nType == EVENT_KEYUP ) - { - SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); - SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL; - if ( pShell && pShell->HasKeyListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) ) - return sal_True; - } - else if ( nType == EVENT_MOUSEBUTTONUP || nType == EVENT_MOUSEBUTTONDOWN ) - { - Window* pWindow = rNEvt.GetWindow(); - SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); - SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL; - if ( pShell ) - if ( pWindow == pShell->GetWindow() || pShell->GetWindow()->IsChild( pWindow ) ) - if ( pShell->HasMouseClickListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) ) - return sal_True; - } - - if ( nType == EVENT_MOUSEBUTTONDOWN ) - { - Window* pWindow = rNEvt.GetWindow(); - const MouseEvent* pMEvent = rNEvt.GetMouseEvent(); - Point aPos = pWindow->OutputToScreenPixel( pMEvent->GetPosPixel() ); - SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl(); - if ( pWorkWin ) - pWorkWin->EndAutoShow_Impl( aPos ); - } - - return Window::PreNotify( rNEvt ); -} - -void SfxTopWindow_Impl::GetFocus() -{ - if ( pFrame && !pFrame->IsClosing_Impl() && pFrame->GetCurrentViewFrame() && pFrame->GetFrameInterface().is() ) - pFrame->GetCurrentViewFrame()->MakeActive_Impl( TRUE ); -} - -void SfxTopWindow_Impl::Resize() -{ - if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() ) - DoResize(); -} - -void SfxTopWindow_Impl::StateChanged( StateChangedType nStateChange ) -{ - if ( nStateChange == STATE_CHANGE_INITSHOW ) - { - pFrame->pImp->bHidden = FALSE; - if ( pFrame->IsInPlace() ) - // TODO/MBA: workaround for bug in LayoutManager: the final resize does not get through because the - // LayoutManager works asynchronously and between resize and time execution the DockingAcceptor was exchanged so that - // the resize event never is sent to the component - SetSizePixel( GetParent()->GetOutputSizePixel() ); - - DoResize(); - SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); - if ( pView ) - pView->GetBindings().GetWorkWindow_Impl()->ShowChilds_Impl(); - } - - Window::StateChanged( nStateChange ); -} - -void SfxTopWindow_Impl::DoResize() -{ - if ( !pFrame->pImp->bLockResize ) - pFrame->Resize(); -} - -//-------------------------------------------------------------------- -void SfxTopViewWin_Impl::StateChanged( StateChangedType nStateChange ) -{ - if ( nStateChange == STATE_CHANGE_INITSHOW ) - { - SfxObjectShell* pDoc = pFrame->GetObjectShell(); - if ( pDoc && !pFrame->IsVisible_Impl() ) - pFrame->Show(); - - pFrame->Resize(); - } - else - Window::StateChanged( nStateChange ); -} - -void SfxTopViewWin_Impl::Resize() -{ - if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() ) - pFrame->Resize(); -} - -class SfxTopViewFrame_Impl -{ -public: - - SfxTopViewFrame_Impl() - {} -}; - -static String _getTabString() -{ - String result; - - Reference < XMaterialHolder > xHolder( - ::comphelper::getProcessServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.tab.tabreg") ), UNO_QUERY ); - if (xHolder.is()) - { - rtl::OUString aTabString; - Sequence< NamedValue > sMaterial; - if (xHolder->getMaterial() >>= sMaterial) { - for (int i=0; i < sMaterial.getLength(); i++) { - if ((sMaterial[i].Name.equalsAscii("title")) && - (sMaterial[i].Value >>= aTabString)) - { - result += ' '; - result += String(aTabString); - } - } - } - } - return result; -} - -namespace -{ - Reference< XFrame > lcl_findStartModuleFrame() - { - try - { - Reference < XFramesSupplier > xSupplier( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW ); - Reference < XIndexAccess > xContainer( xSupplier->getFrames(), UNO_QUERY_THROW ); - - Reference< XModuleManager > xCheck( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.ModuleManager" ) ), UNO_QUERY_THROW ); - - sal_Int32 nCount = xContainer->getCount(); - for ( sal_Int32 i=0; i xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW ); - ::rtl::OUString sModule = xCheck->identify( xFrame ); - if ( sModule.equalsAscii( "com.sun.star.frame.StartModule" ) ) - return xFrame; - } - catch( const UnknownModuleException& ) - { - // silence - } - catch(const Exception&) - { - // re-throw, caught below - throw; - } - } - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return NULL; - } -} - -SfxFrame* SfxFrame::CreateBlank() -{ - SfxFrame* pFrame = NULL; - try - { - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); - Reference < XFrame > xFrame = xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ); - pFrame = Create( xFrame ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return pFrame; -} - -SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ) -{ - SfxFrame* pFrame = NULL; - try - { - // create and initialize new top level frame for this window - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - Reference < XFramesSupplier > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); - Reference < XFrame > xFrame( aContext.createComponent( "com.sun.star.frame.Frame"), UNO_QUERY_THROW ); - - Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW ); - xFrame->initialize( xWin.get() ); - xDesktop->getFrames()->append( xFrame ); - - if ( xWin->isActive() ) - xFrame->activate(); - - // create load arguments - Sequence< PropertyValue > aLoadArgs; - TransformItems( SID_OPENDOC, *rDoc.GetMedium()->GetItemSet(), aLoadArgs ); - - ::comphelper::NamedValueCollection aArgs( aLoadArgs ); - aArgs.put( "Model", rDoc.GetModel() ); - aArgs.put( "Hidden", bHidden ); - if ( nViewId ) - aArgs.put( "ViewId", nViewId ); - - aLoadArgs = aArgs.getPropertyValues(); - - // load the doc into that frame - Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); - xLoader->loadComponentFromURL( - rDoc.GetModel()->getURL(), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ), - 0, - aLoadArgs - ); - - for ( pFrame = SfxFrame::GetFirst(); - pFrame; - pFrame = SfxFrame::GetNext( *pFrame ) - ) - { - if ( pFrame->GetFrameInterface() == xFrame ) - break; - } - - OSL_ENSURE( pFrame, "SfxFrame::Create: load succeeded, but no SfxFrame was created during this!" ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - - return pFrame; -} - -SfxFrame* SfxFrame::Create( Reference < XFrame > xFrame ) -{ - // create a new TopFrame to an external XFrame object ( wrap controller ) - ENSURE_OR_THROW( xFrame.is(), "NULL frame not allowed" ); - Window* pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - ENSURE_OR_THROW( pWindow, "frame without container window not allowed" ); - - SfxFrame* pFrame = new SfxFrame( *pWindow, false ); - pFrame->SetFrameInterface_Impl( xFrame ); - return pFrame; -} - -SfxFrame::SfxFrame( Window& i_rContainerWindow, bool i_bHidden ) - :pParentFrame( NULL ) - ,pChildArr( NULL ) - ,pImp( NULL ) - ,pWindow( NULL ) -{ - Construct_Impl(); - - pImp->bHidden = i_bHidden; - InsertTopFrame_Impl( this ); - pImp->pExternalContainerWindow = &i_rContainerWindow; - - pWindow = new SfxTopWindow_Impl( this, i_rContainerWindow ); - - // always show pWindow, which is the ComponentWindow of the XFrame we live in - // nowadays, since SfxFrames can be created with an XFrame only, hiding or showing the complete XFrame - // is not done at level of the container window, not at SFX level. Thus, the component window can - // always be visible. - pWindow->Show(); -} - -void SfxFrame::SetPresentationMode( BOOL bSet ) -{ - if ( GetCurrentViewFrame() ) - GetCurrentViewFrame()->GetWindow().SetBorderStyle( bSet ? WINDOW_BORDER_NOBORDER : WINDOW_BORDER_NORMAL ); - - Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY ); - Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; - - if ( xPropSet.is() ) - { - Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); - aValue >>= xLayoutManager; - } - - if ( xLayoutManager.is() ) - xLayoutManager->setVisible( !bSet ); // we don't want to have ui in presentation mode - - SetMenuBarOn_Impl( !bSet ); - if ( GetWorkWindow_Impl() ) - GetWorkWindow_Impl()->SetDockingAllowed( !bSet ); - if ( GetCurrentViewFrame() ) - GetCurrentViewFrame()->GetDispatcher()->Update_Impl( TRUE ); -} - -SystemWindow* SfxFrame::GetSystemWindow() const -{ - return GetTopWindow_Impl(); -} - -SystemWindow* SfxFrame::GetTopWindow_Impl() const -{ - if ( pImp->pExternalContainerWindow->IsSystemWindow() ) - return (SystemWindow*) pImp->pExternalContainerWindow; - else - return NULL; -} - -Window& SfxFrame::GetWindow() const -{ - return *pWindow; -} - -sal_Bool SfxFrame::Close() -{ - delete this; - return sal_True; -} - -void SfxFrame::LockResize_Impl( BOOL bLock ) -{ - pImp->bLockResize = bLock; -} - -IMPL_LINK( SfxTopWindow_Impl, CloserHdl, void*, EMPTYARG ) -{ - if ( pFrame && !pFrame->PrepareClose_Impl( TRUE ) ) - return 0L; - - if ( pFrame ) - pFrame->GetCurrentViewFrame()->GetBindings().Execute( SID_CLOSEWIN, 0, 0, SFX_CALLMODE_ASYNCHRON ); - return 0L; -} - -void SfxFrame::SetMenuBarOn_Impl( BOOL bOn ) -{ - pImp->bMenuBarOn = bOn; - - Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY ); - Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; - - if ( xPropSet.is() ) - { - Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); - aValue >>= xLayoutManager; - } - - if ( xLayoutManager.is() ) - { - rtl::OUString aMenuBarURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" )); - - if ( bOn ) - xLayoutManager->showElement( aMenuBarURL ); - else - xLayoutManager->hideElement( aMenuBarURL ); - } -} - -BOOL SfxFrame::IsMenuBarOn_Impl() const -{ - return pImp->bMenuBarOn; -} - -void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const -{ - Window *pWin = pImp->pExternalContainerWindow; - - // Groesse setzen - const Size aAppWindow( pImp->pExternalContainerWindow->GetDesktopRectPixel().GetSize() ); - Point aPos( rWinArea.TopLeft() ); - Size aSz( rWinArea.GetSize() ); - if ( aSz.Width() && aSz.Height() ) - { - aPos.X() = Min(aPos.X(), - long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) ); - aPos.Y() = Min(aPos.Y(), - long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) ); - if ( aPos.X() + aSz.Width() < - aAppWindow.Width() + aSz.Width() / 2 && - aPos.Y() + aSz.Height() < - aAppWindow.Height() + aSz.Height() / 2 ) - { - pWin->SetPosPixel( aPos ); - pWin->SetOutputSizePixel( aSz ); - } - } -} - -namespace -{ - bool lcl_getViewDataAndID( const Reference< XModel >& _rxDocument, Sequence< PropertyValue >& _o_viewData, USHORT& _o_viewId ) - { - _o_viewData.realloc(0); - _o_viewId = 0; - - Reference< XViewDataSupplier > xViewDataSupplier( _rxDocument, UNO_QUERY ); - Reference< XIndexAccess > xViewData; - if ( xViewDataSupplier.is() ) - xViewData = xViewDataSupplier->getViewData(); - - if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) - return false; - - // obtain the ViewID from the view data - _o_viewId = 0; - if ( xViewData->getByIndex( 0 ) >>= _o_viewData ) - { - ::comphelper::NamedValueCollection aNamedUserData( _o_viewData ); - ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); - if ( sViewId.getLength() ) - { - sViewId = sViewId.copy( 4 ); // format is like in "view3" - _o_viewId = USHORT( sViewId.toInt32() ); - } - } - return true; - } -} - -sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& rSet ) -/* [Beschreibung] - */ -{ - OSL_PRECOND( rDoc.GetMedium(), "SfxFrame::InsertDocument_Impl: no medium -> no view!"); - if ( !rDoc.GetMedium() ) - return sal_False; - - OSL_PRECOND( GetCurrentViewFrame() == NULL, - "SfxObjectShell::InsertDocument_Impl: no support (anymore) for loading into a non-empty frame!" ); - // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays - // done in higher layers, namely in the framework. - if ( GetCurrentViewFrame() != NULL ) - return sal_False; - - OSL_PRECOND( GetCurrentDocument() == NULL, - "SfxFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); - - SFX_ITEMSET_ARG( &rSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size - SFX_ITEMSET_ARG( &rSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID - SFX_ITEMSET_ARG( &rSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom - SFX_ITEMSET_ARG( &rSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False ); // hidden - SFX_ITEMSET_ARG( &rSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False ); // view only - SFX_ITEMSET_ARG( &rSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) - SFX_ITEMSET_ARG( &rSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) - - // hidden? - pImp->bHidden = pHidItem ? pHidItem->GetValue() : pImp->bHidden; - - // plugin mode - const USHORT nPluginMode = pPluginMode ? pPluginMode->GetValue() : 0; - - // view only? - if ( pEditItem && pEditItem->GetValue() ) - SetMenuBarOn_Impl( FALSE ); - - // view ID - USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : 0; - - if( !pImp->bHidden ) - rDoc.OwnerLock( sal_True ); - - Sequence< PropertyValue > aUserData; - bool bClearPosSizeZoom = false; - bool bReadUserData = false; - - // if no view-related data exists in the set, then obtain the view data from the model - if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) - { - if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) - { - SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); - pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - bClearPosSizeZoom = bReadUserData = true; - } - } - - UpdateDescriptor( &rDoc ); - - if ( nPluginMode && ( nPluginMode != 2 ) ) - SetInPlace_Impl( TRUE ); - - SfxViewFrame* pViewFrame = SfxViewFrame::Create_Impl( *this, rDoc, nViewId ? nViewId : rDoc.GetFactory().GetViewFactory( 0 ).GetOrdinal() ); - OSL_ENSURE( pViewFrame, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); - if ( !pViewFrame ) - // TODO: better error handling? Under which conditions can this fail? - return sal_False; - - if ( nPluginMode == 1 ) - { - pViewFrame->ForceOuterResize_Impl( FALSE ); - pViewFrame->GetBindings().HidePopups(TRUE); - - // MBA: layoutmanager of inplace frame starts locked and invisible - GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); - GetWorkWindow_Impl()->Lock_Impl( TRUE ); - - GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - } - - OSL_ENSURE( ( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT ) - || ( pJumpItem == NULL ), - "SfxFrame::InsertDocument_Impl: so this code wasn't dead?" ); - // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time - // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method - // here is never called before the load process finished. At least not with a jump item != NULL. - if( pJumpItem ) - { - pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); - } - - // Position und Groesse setzen - if ( pAreaItem ) - PositionWindow_Impl( pAreaItem->GetValue() ); - - if ( !pImp->bHidden ) - { - if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) ) - pViewFrame->GetDispatcher()->HideUI( TRUE ); - else - pViewFrame->GetDispatcher()->HideUI( FALSE ); - - if ( IsInPlace() ) - pViewFrame->LockAdjustPosSizePixel(); - - if ( ( nPluginMode == 3 ) ) - GetWorkWindow_Impl()->SetInternalDockingAllowed(FALSE); - - if ( !IsInPlace() ) - pViewFrame->GetDispatcher()->Update_Impl(); - pViewFrame->Show(); - GetWindow().Show(); - if ( !IsInPlace() || ( nPluginMode == 3 ) ) - pViewFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); - rDoc.OwnerLock( sal_False ); - - if ( IsInPlace() ) - { - pViewFrame->UnlockAdjustPosSizePixel(); - // force resize for OLE server to fix layout problems of writer and math - // see i53651 - if ( nPluginMode == 3 ) - pViewFrame->Resize(TRUE); - } - } - else - { - DBG_ASSERT( !IsInPlace() && !pPluginMode, "Special modes not compatible with hidden mode!" ); - GetWindow().Show(); - } - - // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen! - pViewFrame->UpdateTitle(); - - if ( !IsInPlace() ) - { - pViewFrame->Resize(TRUE); - } - - SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); - - if ( bClearPosSizeZoom ) - { - SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); - pMediumSet->ClearItem( SID_VIEW_POS_SIZE ); - pMediumSet->ClearItem( SID_WIN_POSSIZE ); - pMediumSet->ClearItem( SID_VIEW_ZOOM_MODE ); - } - - if ( bReadUserData ) - { - // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE - // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) - { - pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); - } - } - - return GetCurrentDocument() == &rDoc; -} - - -//======================================================================== - -long SfxViewFrameClose_Impl( void* /*pObj*/, void* pArg ) -{ - ((SfxViewFrame*)pArg)->GetFrame()->DoClose(); - return 0; -} - -//-------------------------------------------------------------------- -String SfxViewFrame::UpdateTitle() - -/* [Beschreibung] - - Mit dieser Methode kann der SfxViewFrame gezwungen werden, sich sofort - den neuen Titel vom der zu besorgen. - - [Anmerkung] - - Dies ist z.B. dann notwendig, wenn man der SfxObjectShell als SfxListener - zuh"ort und dort auf den SFX_HINT_TITLECHANGED reagieren - m"ochte, um dann die Titel seiner Views abzufragen. Diese Views (SfxTopViewFrames) - jedoch sind ebenfalls SfxListener und da die Reihenfolge der Benachrichtigung - nicht feststeht, mu\s deren Titel-Update vorab erzwungen werden. - - - [Beispiel] - - void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) - { - if ( rHint.IsA(TYPE(SfxSimpleHint)) ) - { - switch( ( (SfxSimpleHint&) rHint ).GetId() ) - { - case SFX_HINT_TITLECHANGED: - for ( SfxViewFrame *pTop = SfxViewFrame::GetFirst( this ); - pTop; - pTop = SfxViewFrame::GetNext( this ); - { - pTop->UpdateTitle(); - ... pTop->GetName() ... - } - break; - ... - } - } - } -*/ - -{ - DBG_CHKTHIS(SfxViewFrame, 0); - - const SfxObjectFactory &rFact = GetObjectShell()->GetFactory(); - pImp->aFactoryName = String::CreateFromAscii( rFact.GetShortName() ); - - SfxObjectShell *pObjSh = GetObjectShell(); - if ( !pObjSh ) - return String(); - -// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) -// // kein UpdateTitle mit Embedded-ObjectShell -// return String(); - - const SfxMedium *pMedium = pObjSh->GetMedium(); - String aURL; - GetFrame(); // -Wall required?? - if ( pObjSh->HasName() ) - { - INetURLObject aTmp( pMedium->GetName() ); - aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); - } - - if ( aURL != pImp->aActualURL ) - // URL hat sich ge"andert - pImp->aActualURL = aURL; - - // gibt es noch eine weitere View? - sal_uInt16 nViews=0; - for ( SfxViewFrame *pView= GetFirst(pObjSh); - pView && nViews<2; - pView = GetNext(*pView,pObjSh) ) - if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) && - !IsDowning_Impl()) - nViews++; - - // Titel des Fensters - String aTitle; - if ( nViews == 2 || pImp->nDocViewNo > 1 ) - // dann die Nummer dranh"angen - aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo ); - else - aTitle = pObjSh->UpdateTitle(); - - // Name des SbxObjects - String aSbxName = pObjSh->SfxShell::GetName(); - if ( IsVisible_Impl() ) - { - aSbxName += ':'; - aSbxName += String::CreateFromInt32(pImp->nDocViewNo); - } - - SetName( aSbxName ); - pImp->aFrameTitle = aTitle; - GetBindings().Invalidate( SID_FRAMETITLE ); - GetBindings().Invalidate( SID_CURRENT_URL ); - - ::rtl::OUString aProductName; - ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName; - - aTitle += String::CreateFromAscii( " - " ); - aTitle += String(aProductName); - aTitle += ' '; - ::rtl::OUString aDocServiceName( GetObjectShell()->GetFactory().GetDocumentServiceName() ); - aTitle += String( GetModuleName_Impl( aDocServiceName ) ); -#ifndef PRODUCT - ::rtl::OUString aDefault; - aTitle += DEFINE_CONST_UNICODE(" ["); - String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); - aTitle += aVerId; - aTitle += ']'; -#endif - - // append TAB string if available - aTitle += _getTabString(); - - GetBindings().Invalidate( SID_NEWDOCDIRECT ); - - /* AS_TITLE - Window* pWindow = GetFrame()->GetTopWindow_Impl(); - if ( pWindow && pWindow->GetText() != aTitle ) - pWindow->SetText( aTitle ); - */ - return aTitle; -} - -void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) -{ - // Wenn gerade die Shells ausgetauscht werden... - if ( !GetObjectShell() || !GetViewShell() ) - return; - - switch ( rReq.GetSlot() ) - { - case SID_SHOWPOPUPS : - { - SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS, FALSE); - BOOL bShow = pShowItem ? pShowItem->GetValue() : TRUE; - SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID, FALSE); - USHORT nId = pIdItem ? pIdItem->GetValue() : 0; - - // ausfuehren - SfxWorkWindow *pWorkWin = GetFrame()->GetWorkWindow_Impl(); - if ( bShow ) - { - // Zuerst die Floats auch anzeigbar machen - pWorkWin->MakeChildsVisible_Impl( bShow ); - GetDispatcher()->Update_Impl( TRUE ); - - // Dann anzeigen - GetBindings().HidePopups( !bShow ); - } - else - { - // Alles hiden - SfxBindings *pBind = &GetBindings(); - while ( pBind ) - { - pBind->HidePopupCtrls_Impl( !bShow ); - pBind = pBind->GetSubBindings_Impl(); - } - - pWorkWin->HidePopups_Impl( !bShow, TRUE, nId ); - pWorkWin->MakeChildsVisible_Impl( bShow ); - } - - Invalidate( rReq.GetSlot() ); - rReq.Done(); - break; - } - - case SID_ACTIVATE: - { - MakeActive_Impl( TRUE ); - rReq.SetReturnValue( SfxObjectItem( 0, this ) ); - break; - } - - case SID_WIN_POSSIZE: - break; - - case SID_NEWDOCDIRECT : - { - SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, FALSE); - String aFactName; - if ( pFactoryItem ) - aFactName = pFactoryItem->GetValue(); - else if ( pImp->aFactoryName.Len() ) - aFactName = pImp->aFactoryName; - else - { - DBG_ERROR("Missing argument!"); - break; - } - - SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() ); - String aFact = String::CreateFromAscii("private:factory/"); - aFact += aFactName; - aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) ); - aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) ); - aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_blank" ) ) ); - SFX_APP()->ExecuteSlot( aReq ); - const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() ); - if ( pItem ) - rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) ); - break; - } - - case SID_CLOSEWIN: - { - // disable CloseWin, if frame is not a task - Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY ); - if ( !xTask.is() ) - break; - - if ( GetViewShell()->PrepareClose() ) - { - // weitere Views auf dasselbe Doc? - SfxObjectShell *pDocSh = GetObjectShell(); - int bOther = sal_False; - for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh ); - !bOther && pFrame; - pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) ) - bOther = (pFrame != this); - - // Doc braucht nur gefragt zu werden, wenn keine weitere View - sal_Bool bClosed = sal_False; - sal_Bool bUI = TRUE; - if ( ( bOther || pDocSh->PrepareClose( bUI ) ) ) - { - if ( !bOther ) - pDocSh->SetModified( FALSE ); - rReq.Done(); // unbedingt vor Close() rufen! - bClosed = sal_False; - try - { - xTask->close(sal_True); - bClosed = sal_True; - } - catch( CloseVetoException& ) - { - bClosed = sal_False; - } - } - - rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bClosed )); - } - return; - } - } - - rReq.Done(); -} - -void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) -{ - SfxObjectShell *pDocSh = GetObjectShell(); - - if ( !pDocSh ) - return; - - const sal_uInt16 *pRanges = rSet.GetRanges(); - DBG_ASSERT(pRanges, "Set ohne Bereich"); - while ( *pRanges ) - { - for ( sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich ) - { - switch(nWhich) - { - case SID_NEWDOCDIRECT : - { - if ( pImp->aFactoryName.Len() ) - { - String aFact = String::CreateFromAscii("private:factory/"); - aFact += pImp->aFactoryName; - rSet.Put( SfxStringItem( nWhich, aFact ) ); - } - break; - } - - case SID_NEWWINDOW: - rSet.DisableItem(nWhich); - break; - - case SID_CLOSEWIN: - { - // disable CloseWin, if frame is not a task - Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY ); - if ( !xTask.is() ) - rSet.DisableItem(nWhich); - break; - } - - case SID_SHOWPOPUPS : - break; - - case SID_WIN_POSSIZE: - { - rSet.Put( SfxRectangleItem( nWhich, Rectangle( - GetWindow().GetPosPixel(), GetWindow().GetSizePixel() ) ) ); - break; - } - - case SID_OBJECT: - if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() ) - { - uno::Any aAny; - aAny <<= GetViewShell()->GetVerbs(); - rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) ); - } - else - rSet.DisableItem( SID_OBJECT ); - break; - - default: - DBG_ERROR( "invalid message-id" ); - } - } - ++pRanges; - } -} - -void SfxViewFrame::INetExecute_Impl( SfxRequest &rRequest ) -{ - sal_uInt16 nSlotId = rRequest.GetSlot(); - switch( nSlotId ) - { - case SID_BROWSE_FORWARD: - case SID_BROWSE_BACKWARD: - OSL_ENSURE( false, "SfxViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" ); - break; - case SID_CREATELINK: - { -/*! (pb) we need new implementation to create a link -*/ - break; - } - case SID_FOCUSURLBOX: - { - SfxStateCache *pCache = GetBindings().GetAnyStateCache_Impl( SID_OPENURL ); - if( pCache ) - { - SfxControllerItem* pCtrl = pCache->GetItemLink(); - while( pCtrl ) - { - pCtrl->StateChanged( SID_FOCUSURLBOX, SFX_ITEM_UNKNOWN, 0 ); - pCtrl = pCtrl->GetItemLink(); - } - } - } - } - - // Recording - rRequest.Done(); -} - -void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet ) -{ - rItemSet.DisableItem( SID_BROWSE_FORWARD ); - rItemSet.DisableItem( SID_BROWSE_BACKWARD ); - - // Add/SaveToBookmark bei BASIC-IDE, QUERY-EDITOR etc. disablen - SfxObjectShell *pDocSh = GetObjectShell(); - sal_Bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC ); - sal_Bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED; - if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() ) - rItemSet.DisableItem( SID_CREATELINK ); -} - -void SfxViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ) -{ - GetViewShell()->SetZoomFactor( rZoomX, rZoomY ); -} - -void SfxViewFrame::Activate( sal_Bool bMDI ) -{ - DBG_ASSERT(GetViewShell(), "Keine Shell"); - if ( bMDI ) - pImp->bActive = sal_True; -//(mba): hier evtl. wie in Beanframe NotifyEvent ?! -} - -void SfxViewFrame::Deactivate( sal_Bool bMDI ) -{ - DBG_ASSERT(GetViewShell(), "Keine Shell"); - if ( bMDI ) - pImp->bActive = sal_False; -//(mba): hier evtl. wie in Beanframe NotifyEvent ?! -} diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 7164e69065..c9a76dc16f 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1466,7 +1466,7 @@ SfxViewFrame::SfxViewFrame pFrame->SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE ); Construct_Impl( pObjShell ); - pImp->pWindow = new SfxTopViewWin_Impl( this, pFrame->GetWindow() ); + pImp->pWindow = new SfxFrameViewWindow_Impl( this, pFrame->GetWindow() ); pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() ); pFrame->SetOwnsBindings_Impl( sal_True ); pFrame->CreateWorkWindow_Impl(); diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx new file mode 100644 index 0000000000..91e57feb31 --- /dev/null +++ b/sfx2/source/view/viewfrm2.cxx @@ -0,0 +1,536 @@ +/************************************************************************* + * + * 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: topfrm.cxx,v $ + * $Revision: 1.97 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sfx2.hxx" + +#include "impviewframe.hxx" +#include "statcach.hxx" +#include "viewfac.hxx" +#include "workwin.hxx" + +#include "sfx2/app.hxx" +#include "sfx2/bindings.hxx" +#include "sfx2/ctrlitem.hxx" +#include "sfx2/dispatch.hxx" +#include "sfx2/docfac.hxx" +#include "sfx2/docfile.hxx" +#include "sfx2/objitem.hxx" +#include "sfx2/objsh.hxx" +#include "sfx2/request.hxx" +#include "sfx2/viewfrm.hxx" +#include "sfx2/viewsh.hxx" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::util; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::beans; +using ::com::sun::star::lang::XMultiServiceFactory; +using ::com::sun::star::lang::XComponent; + +//------------------------------------------------------------------------ + +static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService ) +{ + uno::Reference< container::XNameAccess > xMM( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")), uno::UNO_QUERY ); + ::rtl::OUString sVar; + if ( !xMM.is() ) + return sVar; + + try + { + ::comphelper::NamedValueCollection aAnalyzer( xMM->getByName( sDocService ) ); + sVar = aAnalyzer.getOrDefault( "ooSetupFactoryUIName", ::rtl::OUString() ); + } + catch( uno::Exception& ) + { + sVar = ::rtl::OUString(); + } + + return sVar; +} + +//-------------------------------------------------------------------- +void SfxFrameViewWindow_Impl::StateChanged( StateChangedType nStateChange ) +{ + if ( nStateChange == STATE_CHANGE_INITSHOW ) + { + SfxObjectShell* pDoc = pFrame->GetObjectShell(); + if ( pDoc && !pFrame->IsVisible_Impl() ) + pFrame->Show(); + + pFrame->Resize(); + } + else + Window::StateChanged( nStateChange ); +} + +void SfxFrameViewWindow_Impl::Resize() +{ + if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() ) + pFrame->Resize(); +} + +static String _getTabString() +{ + String result; + + Reference < XMaterialHolder > xHolder( + ::comphelper::getProcessServiceFactory()->createInstance( + DEFINE_CONST_UNICODE("com.sun.star.tab.tabreg") ), UNO_QUERY ); + if (xHolder.is()) + { + rtl::OUString aTabString; + Sequence< NamedValue > sMaterial; + if (xHolder->getMaterial() >>= sMaterial) { + for (int i=0; i < sMaterial.getLength(); i++) { + if ((sMaterial[i].Name.equalsAscii("title")) && + (sMaterial[i].Value >>= aTabString)) + { + result += ' '; + result += String(aTabString); + } + } + } + } + return result; +} + +//======================================================================== + +//-------------------------------------------------------------------- +String SfxViewFrame::UpdateTitle() + +/* [Beschreibung] + + Mit dieser Methode kann der SfxViewFrame gezwungen werden, sich sofort + den neuen Titel vom der zu besorgen. + + [Anmerkung] + + Dies ist z.B. dann notwendig, wenn man der SfxObjectShell als SfxListener + zuh"ort und dort auf den SFX_HINT_TITLECHANGED reagieren + m"ochte, um dann die Titel seiner Views abzufragen. Diese Views (SfxTopViewFrames) + jedoch sind ebenfalls SfxListener und da die Reihenfolge der Benachrichtigung + nicht feststeht, mu\s deren Titel-Update vorab erzwungen werden. + + + [Beispiel] + + void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) + { + if ( rHint.IsA(TYPE(SfxSimpleHint)) ) + { + switch( ( (SfxSimpleHint&) rHint ).GetId() ) + { + case SFX_HINT_TITLECHANGED: + for ( SfxViewFrame *pTop = SfxViewFrame::GetFirst( this ); + pTop; + pTop = SfxViewFrame::GetNext( this ); + { + pTop->UpdateTitle(); + ... pTop->GetName() ... + } + break; + ... + } + } + } +*/ + +{ + DBG_CHKTHIS(SfxViewFrame, 0); + + const SfxObjectFactory &rFact = GetObjectShell()->GetFactory(); + pImp->aFactoryName = String::CreateFromAscii( rFact.GetShortName() ); + + SfxObjectShell *pObjSh = GetObjectShell(); + if ( !pObjSh ) + return String(); + +// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) +// // kein UpdateTitle mit Embedded-ObjectShell +// return String(); + + const SfxMedium *pMedium = pObjSh->GetMedium(); + String aURL; + GetFrame(); // -Wall required?? + if ( pObjSh->HasName() ) + { + INetURLObject aTmp( pMedium->GetName() ); + aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + } + + if ( aURL != pImp->aActualURL ) + // URL hat sich ge"andert + pImp->aActualURL = aURL; + + // gibt es noch eine weitere View? + sal_uInt16 nViews=0; + for ( SfxViewFrame *pView= GetFirst(pObjSh); + pView && nViews<2; + pView = GetNext(*pView,pObjSh) ) + if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) && + !IsDowning_Impl()) + nViews++; + + // Titel des Fensters + String aTitle; + if ( nViews == 2 || pImp->nDocViewNo > 1 ) + // dann die Nummer dranh"angen + aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo ); + else + aTitle = pObjSh->UpdateTitle(); + + // Name des SbxObjects + String aSbxName = pObjSh->SfxShell::GetName(); + if ( IsVisible_Impl() ) + { + aSbxName += ':'; + aSbxName += String::CreateFromInt32(pImp->nDocViewNo); + } + + SetName( aSbxName ); + pImp->aFrameTitle = aTitle; + GetBindings().Invalidate( SID_FRAMETITLE ); + GetBindings().Invalidate( SID_CURRENT_URL ); + + ::rtl::OUString aProductName; + ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName; + + aTitle += String::CreateFromAscii( " - " ); + aTitle += String(aProductName); + aTitle += ' '; + ::rtl::OUString aDocServiceName( GetObjectShell()->GetFactory().GetDocumentServiceName() ); + aTitle += String( GetModuleName_Impl( aDocServiceName ) ); +#ifndef PRODUCT + ::rtl::OUString aDefault; + aTitle += DEFINE_CONST_UNICODE(" ["); + String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); + aTitle += aVerId; + aTitle += ']'; +#endif + + // append TAB string if available + aTitle += _getTabString(); + + GetBindings().Invalidate( SID_NEWDOCDIRECT ); + + /* AS_TITLE + Window* pWindow = GetFrame()->GetTopWindow_Impl(); + if ( pWindow && pWindow->GetText() != aTitle ) + pWindow->SetText( aTitle ); + */ + return aTitle; +} + +void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) +{ + // Wenn gerade die Shells ausgetauscht werden... + if ( !GetObjectShell() || !GetViewShell() ) + return; + + switch ( rReq.GetSlot() ) + { + case SID_SHOWPOPUPS : + { + SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS, FALSE); + BOOL bShow = pShowItem ? pShowItem->GetValue() : TRUE; + SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID, FALSE); + USHORT nId = pIdItem ? pIdItem->GetValue() : 0; + + // ausfuehren + SfxWorkWindow *pWorkWin = GetFrame()->GetWorkWindow_Impl(); + if ( bShow ) + { + // Zuerst die Floats auch anzeigbar machen + pWorkWin->MakeChildsVisible_Impl( bShow ); + GetDispatcher()->Update_Impl( TRUE ); + + // Dann anzeigen + GetBindings().HidePopups( !bShow ); + } + else + { + // Alles hiden + SfxBindings *pBind = &GetBindings(); + while ( pBind ) + { + pBind->HidePopupCtrls_Impl( !bShow ); + pBind = pBind->GetSubBindings_Impl(); + } + + pWorkWin->HidePopups_Impl( !bShow, TRUE, nId ); + pWorkWin->MakeChildsVisible_Impl( bShow ); + } + + Invalidate( rReq.GetSlot() ); + rReq.Done(); + break; + } + + case SID_ACTIVATE: + { + MakeActive_Impl( TRUE ); + rReq.SetReturnValue( SfxObjectItem( 0, this ) ); + break; + } + + case SID_WIN_POSSIZE: + break; + + case SID_NEWDOCDIRECT : + { + SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, FALSE); + String aFactName; + if ( pFactoryItem ) + aFactName = pFactoryItem->GetValue(); + else if ( pImp->aFactoryName.Len() ) + aFactName = pImp->aFactoryName; + else + { + DBG_ERROR("Missing argument!"); + break; + } + + SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() ); + String aFact = String::CreateFromAscii("private:factory/"); + aFact += aFactName; + aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) ); + aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) ); + aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_blank" ) ) ); + SFX_APP()->ExecuteSlot( aReq ); + const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() ); + if ( pItem ) + rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) ); + break; + } + + case SID_CLOSEWIN: + { + // disable CloseWin, if frame is not a task + Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY ); + if ( !xTask.is() ) + break; + + if ( GetViewShell()->PrepareClose() ) + { + // weitere Views auf dasselbe Doc? + SfxObjectShell *pDocSh = GetObjectShell(); + int bOther = sal_False; + for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh ); + !bOther && pFrame; + pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) ) + bOther = (pFrame != this); + + // Doc braucht nur gefragt zu werden, wenn keine weitere View + sal_Bool bClosed = sal_False; + sal_Bool bUI = TRUE; + if ( ( bOther || pDocSh->PrepareClose( bUI ) ) ) + { + if ( !bOther ) + pDocSh->SetModified( FALSE ); + rReq.Done(); // unbedingt vor Close() rufen! + bClosed = sal_False; + try + { + xTask->close(sal_True); + bClosed = sal_True; + } + catch( CloseVetoException& ) + { + bClosed = sal_False; + } + } + + rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bClosed )); + } + return; + } + } + + rReq.Done(); +} + +void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) +{ + SfxObjectShell *pDocSh = GetObjectShell(); + + if ( !pDocSh ) + return; + + const sal_uInt16 *pRanges = rSet.GetRanges(); + DBG_ASSERT(pRanges, "Set ohne Bereich"); + while ( *pRanges ) + { + for ( sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich ) + { + switch(nWhich) + { + case SID_NEWDOCDIRECT : + { + if ( pImp->aFactoryName.Len() ) + { + String aFact = String::CreateFromAscii("private:factory/"); + aFact += pImp->aFactoryName; + rSet.Put( SfxStringItem( nWhich, aFact ) ); + } + break; + } + + case SID_NEWWINDOW: + rSet.DisableItem(nWhich); + break; + + case SID_CLOSEWIN: + { + // disable CloseWin, if frame is not a task + Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY ); + if ( !xTask.is() ) + rSet.DisableItem(nWhich); + break; + } + + case SID_SHOWPOPUPS : + break; + + case SID_WIN_POSSIZE: + { + rSet.Put( SfxRectangleItem( nWhich, Rectangle( + GetWindow().GetPosPixel(), GetWindow().GetSizePixel() ) ) ); + break; + } + + case SID_OBJECT: + if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() ) + { + uno::Any aAny; + aAny <<= GetViewShell()->GetVerbs(); + rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) ); + } + else + rSet.DisableItem( SID_OBJECT ); + break; + + default: + DBG_ERROR( "invalid message-id" ); + } + } + ++pRanges; + } +} + +void SfxViewFrame::INetExecute_Impl( SfxRequest &rRequest ) +{ + sal_uInt16 nSlotId = rRequest.GetSlot(); + switch( nSlotId ) + { + case SID_BROWSE_FORWARD: + case SID_BROWSE_BACKWARD: + OSL_ENSURE( false, "SfxViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" ); + break; + case SID_CREATELINK: + { +/*! (pb) we need new implementation to create a link +*/ + break; + } + case SID_FOCUSURLBOX: + { + SfxStateCache *pCache = GetBindings().GetAnyStateCache_Impl( SID_OPENURL ); + if( pCache ) + { + SfxControllerItem* pCtrl = pCache->GetItemLink(); + while( pCtrl ) + { + pCtrl->StateChanged( SID_FOCUSURLBOX, SFX_ITEM_UNKNOWN, 0 ); + pCtrl = pCtrl->GetItemLink(); + } + } + } + } + + // Recording + rRequest.Done(); +} + +void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet ) +{ + rItemSet.DisableItem( SID_BROWSE_FORWARD ); + rItemSet.DisableItem( SID_BROWSE_BACKWARD ); + + // Add/SaveToBookmark bei BASIC-IDE, QUERY-EDITOR etc. disablen + SfxObjectShell *pDocSh = GetObjectShell(); + sal_Bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC ); + sal_Bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED; + if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() ) + rItemSet.DisableItem( SID_CREATELINK ); +} + +void SfxViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ) +{ + GetViewShell()->SetZoomFactor( rZoomX, rZoomY ); +} + +void SfxViewFrame::Activate( sal_Bool bMDI ) +{ + DBG_ASSERT(GetViewShell(), "Keine Shell"); + if ( bMDI ) + pImp->bActive = sal_True; +//(mba): hier evtl. wie in Beanframe NotifyEvent ?! +} + +void SfxViewFrame::Deactivate( sal_Bool bMDI ) +{ + DBG_ASSERT(GetViewShell(), "Keine Shell"); + if ( bMDI ) + pImp->bActive = sal_False; +//(mba): hier evtl. wie in Beanframe NotifyEvent ?! +} -- cgit v1.2.3 From 6bf2031182b9a7a9ea0fb4e84651262d9cb0e23f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 9 Dec 2009 11:33:24 +0100 Subject: autorecovery: removed some unused members of SfxObjectShell_Impl --- sfx2/source/doc/objserv.cxx | 21 ++++----------------- sfx2/source/doc/objxtor.cxx | 25 ++----------------------- sfx2/source/inc/objshimp.hxx | 24 +----------------------- sfx2/source/view/viewfrm.cxx | 3 --- 4 files changed, 7 insertions(+), 66 deletions(-) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 96f60fefb9..314d9fccff 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -428,28 +428,15 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) // collect data for dialog String aURL, aTitle; - if ( HasName() && !pImp->aNewName.Len() ) + if ( HasName() ) { aURL = GetMedium()->GetName(); aTitle = GetTitle(); } else { - if ( !pImp->aNewName.Len() ) - { - aURL = DEFINE_CONST_UNICODE( "private:factory/" ); - aURL += String::CreateFromAscii( GetFactory().GetShortName() ); - // aTitle = String( SfxResId( STR_NONAME ) ); - } - else - { - aURL = DEFINE_CONST_UNICODE( "[private:factory/" ); - aURL += String::CreateFromAscii( GetFactory().GetShortName() ); - aURL += DEFINE_CONST_UNICODE( "]" ); - INetURLObject aURLObj( pImp->aNewName ); - aURL += String(aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI )); - // aTitle = aURLObj.GetBase(); - } + aURL = DEFINE_CONST_UNICODE( "private:factory/" ); + aURL += String::CreateFromAscii( GetFactory().GetShortName() ); aTitle = GetTitle(); } @@ -1191,7 +1178,7 @@ void SfxObjectShell::StateProps_Impl(SfxItemSet &rSet) case SID_CLOSING: { - rSet.Put( SfxBoolItem( SID_CLOSING, Get_Impl()->bInCloseEvent ) ); + rSet.Put( SfxBoolItem( SID_CLOSING, false ) ); break; } diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 135bd11bb2..a26b81f19b 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -189,8 +189,6 @@ TYPEINIT1(SfxObjectShell, SfxShell); //-------------------------------------------------------------------- SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) :mpObjectContainer(0) - ,pAccMgr(0) - ,pCfgMgr( 0) ,pBasicManager( new SfxBasicManagerHolder ) ,rDocShell( _rDocShell ) ,aMacroMode( *this ) @@ -199,10 +197,8 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,nVisualDocumentNumber( USHRT_MAX) ,nDocumentSignatureState( SIGNATURESTATE_UNKNOWN ) ,nScriptingSignatureState( SIGNATURESTATE_UNKNOWN ) - ,bTemplateConfig( sal_False) ,bInList( sal_False) ,bClosing( sal_False) - ,bSetInPlaceObj( sal_False) ,bIsSaving( sal_False) ,bPasswd( sal_False) ,bIsTmp( sal_False) @@ -213,11 +209,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,bInPrepareClose( sal_False ) ,bPreparedForClose( sal_False ) ,bWaitingForPicklist( sal_False ) - ,bModuleSearched( sal_False ) - ,bIsHelpObjSh( sal_False ) - ,bForbidCaching( sal_False ) ,bForbidReload( sal_False ) - ,bSupportsEventMacros( sal_True ) ,bBasicInitialized( sal_False ) ,bIsPrintJobCancelable( sal_True ) ,bOwnsStorage( sal_True ) @@ -236,30 +228,24 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,m_bAllowShareControlFileClean( sal_True ) ,lErr(ERRCODE_NONE) ,nEventId ( 0) - ,bDoNotTouchDocInfo( sal_False ) ,pReloadTimer ( 0) ,pMarkData( 0 ) ,nLoadedFlags ( SFX_LOADED_MAINDOCUMENT ) ,nFlagsInProgress( 0 ) - ,bInFrame( sal_False ) ,bModalMode( sal_False ) ,bRunningMacro( sal_False ) ,bReloadAvailable( sal_False ) ,nAutoLoadLocks( 0 ) ,pModule( 0 ) - ,pFrame( 0 ) - ,pTbxConfig( 0 ) ,eFlags( SFXOBJECTSHELL_UNDEFINED ) ,bReadOnlyUI( sal_False ) ,bHiddenLockedByAPI( sal_False ) - ,bInCloseEvent( sal_False ) ,nStyleFilter( 0 ) ,bDisposing( sal_False ) ,m_bEnableSetModified( sal_True ) ,m_bIsModified( sal_False ) ,m_nMapUnit( MAP_100TH_MM ) ,m_bCreateTempStor( sal_False ) - ,m_xDocInfoListener() ,m_bIsInit( sal_False ) ,m_bIncomplEncrWarnShown( sal_False ) { @@ -341,10 +327,6 @@ SfxObjectShell::~SfxObjectShell() SfxObjectShell::Close(); pImp->xModel = NULL; -// DELETEX(pImp->pEventConfig); -// DELETEX(pImp->pTbxConfig); -// DELETEX(pImp->pAccMgr); -// DELETEX(pImp->pCfgMgr); DELETEX(pImp->pReloadTimer ); SfxApplication *pSfxApp = SFX_APP(); @@ -881,12 +863,9 @@ void SfxObjectShell::SetModel( SfxBaseModel* pModel ) { OSL_ENSURE( !pImp->xModel.is() || pModel == NULL, "Model already set!" ); pImp->xModel = pModel; - if ( pModel ) { + if ( pModel ) + { pModel->addCloseListener( new SfxModelListener_Impl(this) ); - //pImp->m_xDocInfoListener = new SfxDocInfoListener_Impl(*this); - //uno::Reference xMB( - // pModel->getDocumentProperties(), uno::UNO_QUERY_THROW); - //xMB->addModifyListener(pImp->m_xDocInfoListener); } } diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index bb18ca9ee4..b3faaef409 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -65,8 +65,6 @@ class SfxBasicManagerHolder; struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess { ::comphelper::EmbeddedObjectContainer* mpObjectContainer; - SfxAcceleratorManager* pAccMgr; - SfxConfigManager* pCfgMgr; SfxBasicManagerHolder* pBasicManager; SfxObjectShell& rDocShell; @@ -84,10 +82,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess sal_uInt16 nVisualDocumentNumber; sal_Int16 nDocumentSignatureState; sal_Int16 nScriptingSignatureState; - sal_Bool bTemplateConfig:1, - bInList:1, // ob per First/Next erreichbar + sal_Bool bInList:1, // ob per First/Next erreichbar bClosing:1, // sal_True w"aehrend Close(), um Benachrichtigungs-Rekursionen zu verhindern - bSetInPlaceObj:1, // sal_True, falls bereits versucht wurde pInPlaceObject zu casten bIsSaving:1, bPasswd:1, bIsTmp:1, @@ -98,11 +94,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess bInPrepareClose : 1, bPreparedForClose : 1, bWaitingForPicklist : 1,// Muss noch in die Pickliste - bModuleSearched : 1, - bIsHelpObjSh : 1, - bForbidCaching : 1, bForbidReload : 1, - bSupportsEventMacros: 1, bBasicInitialized :1, bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable! bOwnsStorage:1, @@ -120,34 +112,23 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess m_bSharedXMLFlag:1, // whether the flag should be stored in xml file m_bAllowShareControlFileClean:1; // whether the flag should be stored in xml file - String aNewName; // Der Name, unter dem das Doc gespeichert - // werden soll IndexBitSet aBitSet; sal_uInt32 lErr; sal_uInt16 nEventId; // falls vor Activate noch ein // Open/Create gesendet werden mu/s - sal_Bool bDoNotTouchDocInfo; - AutoReloadTimer_Impl *pReloadTimer; MarkData_Impl* pMarkData; sal_uInt16 nLoadedFlags; sal_uInt16 nFlagsInProgress; - String aMark; - Size aViewSize; // wird leider vom Writer beim - sal_Bool bInFrame; // HTML-Import gebraucht sal_Bool bModalMode; sal_Bool bRunningMacro; sal_Bool bReloadAvailable; sal_uInt16 nAutoLoadLocks; SfxModule* pModule; - SfxFrame* pFrame; - SfxToolBoxConfig* pTbxConfig; SfxObjectShellFlags eFlags; - String aBaseURL; sal_Bool bReadOnlyUI; SvRefBaseRef xHeaderAttributes; sal_Bool bHiddenLockedByAPI; - sal_Bool bInCloseEvent; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel; sal_uInt16 nStyleFilter; sal_Bool bDisposing; @@ -161,9 +142,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess sal_Bool m_bCreateTempStor; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xDocStorage; - ::com::sun::star::uno::Reference< - ::com::sun::star::util::XModifyListener > m_xDocInfoListener; - sal_Bool m_bIsInit; ::rtl::OUString m_aSharedFileURL; diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c9a76dc16f..f02963d7a6 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -677,9 +677,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False); SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedReferer, SfxStringItem, SID_REFERER, sal_False); - if( !pURLItem || pURLItem->GetValue() == xOldObj->GetMedium()->GetName() ) - xOldObj->Get_Impl()->bForbidCaching = sal_True; - sal_Bool bHasStorage = pMedium->HasStorage_Impl(); if( bHandsOff ) { -- cgit v1.2.3 From 1e9965d8403e907b4b050d1eadab301bc50cbbf2 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 9 Dec 2009 12:29:14 +0100 Subject: autorecovery: streamlined InsertDocument_Impl, as preparation for moving its content into XModel2::createViewController or XController2::attachFrame or ... --- sfx2/inc/frmload.hxx | 10 +++---- sfx2/inc/sfx2/frame.hxx | 3 ++- sfx2/inc/sfx2/sfxsids.hrc | 4 +-- sfx2/source/appl/appdde.cxx | 5 +--- sfx2/source/appl/appuno.cxx | 8 ------ sfx2/source/doc/sfxbasemodel.cxx | 5 ++++ sfx2/source/view/frame2.cxx | 56 +++++++++++++++------------------------- sfx2/source/view/frmload.cxx | 33 +++++++++++------------ 8 files changed, 50 insertions(+), 74 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index e690e07d77..edb6d59d5d 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -122,12 +122,6 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_rxDocument ) const; - sal_Bool impl_plugDocIntoFrame( - const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxFrame& i_rTargetFrame, - SfxObjectShell& i_rDocument - ) const; - void impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor @@ -141,6 +135,10 @@ private: SfxFrame* impl_getOrCreateEmptySfxFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ) const; + + void impl_removeLoaderArguments( + ::comphelper::NamedValueCollection& io_rDescriptor + ); }; #endif diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index ecd9bffeb4..8e6a8ca3bc 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -71,6 +71,7 @@ namespace com #include #include #include +#include class SvBorder; class SfxWorkWindow; @@ -218,7 +219,7 @@ public: SAL_DLLPRIVATE void GrabFocusOnComponent_Impl(); SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool ); - SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& rSet ); + SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper::NamedValueCollection& i_rArgs ); SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock ); SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index a67dc30468..9f86bb8765 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -579,8 +579,8 @@ #define SID_SFX_free_END (SID_SFX_START + 3999) #define SID_OPEN_NEW_VIEW (SID_SFX_START + 520) -#define SID_VIEW_ZOOM_MODE (SID_SFX_START + 521) -#define SID_VIEW_POS_SIZE (SID_SFX_START + 522) + // FREE, was SID_VIEW_ZOOM_MODE + // FREE, was SID_VIEW_POS_SIZE #define SID_VIEW_ID (SID_SFX_START + 523) // FREE, was SID_USER_DATA #define SID_VIEW_DATA (SID_SFX_START + 1582) diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 8f18fb2e31..d149a99381 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -597,16 +597,13 @@ BOOL ImplDdeService::MakeTopic( const String& rNm ) SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) ); SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, TRUE); // SfxBoolItem aHidden(SID_HIDDEN, TRUE); - // minimiert! - SfxUInt16Item aViewStat( SID_VIEW_ZOOM_MODE, 0 ); - SfxRectangleItem aRectItem( SID_VIEW_POS_SIZE, Rectangle() ); SfxBoolItem aSilent(SID_SILENT, TRUE); SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl(); const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aName, &aNewView, - &aViewStat,&aRectItem/*aHidden*/, + /*aHidden,*/ &aSilent, 0L ); if( pRet && pRet->ISA( SfxViewFrameItem ) && diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 0e3a3c1e5c..3b6b6f131d 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1020,8 +1020,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_WIN_POSSIZE ) == SFX_ITEM_SET ) nAdditional++; - // if ( rSet.GetItemState( SID_VIEW_POS_SIZE ) == SFX_ITEM_SET ) - // nAdditional++; if ( rSet.GetItemState( SID_POSTDATA ) == SFX_ITEM_SET ) nAdditional++; if ( rSet.GetItemState( SID_FILLFRAME ) == SFX_ITEM_SET ) @@ -1521,12 +1519,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } - SFX_ITEMSET_ARG( &rSet, pRectItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); - if ( pRectItem ) - { - DBG_ERROR("PosSizeItem not supported yet!"); - } - if ( rSet.GetItemState( SID_CHARSET, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = sCharacterSet; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 89a3f75ed2..e25ad1bad9 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4040,6 +4040,11 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie if ( !pViewShell->GetController().is() ) pViewShell->SetController( new SfxBaseController( pViewShell ) ); + // some initial view settings, coming from our most recent attachResource call + ::comphelper::NamedValueCollection aDocumentLoadArgs( getArgs() ); + if ( aDocumentLoadArgs.getOrDefault( "ViewOnly", false ) ) + pViewFrame->GetFrame()->SetMenuBarOn_Impl( FALSE ); + return Reference< XController2 >( pViewShell->GetController(), UNO_QUERY_THROW ); } diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 9bcd21ebee..c5d5b03eb0 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -467,7 +467,7 @@ void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const namespace { - bool lcl_getViewDataAndID( const Reference< XModel >& _rxDocument, Sequence< PropertyValue >& _o_viewData, USHORT& _o_viewId ) + bool lcl_getViewDataAndID( const Reference< XModel >& _rxDocument, Sequence< PropertyValue >& _o_viewData, sal_Int16& _o_viewId ) { _o_viewData.realloc(0); _o_viewId = 0; @@ -481,7 +481,6 @@ namespace return false; // obtain the ViewID from the view data - _o_viewId = 0; if ( xViewData->getByIndex( 0 ) >>= _o_viewData ) { ::comphelper::NamedValueCollection aNamedUserData( _o_viewData ); @@ -489,14 +488,14 @@ namespace if ( sViewId.getLength() ) { sViewId = sViewId.copy( 4 ); // format is like in "view3" - _o_viewId = USHORT( sViewId.toInt32() ); + _o_viewId = sal_Int16( sViewId.toInt32() ); } } return true; } } -sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& rSet ) +sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper::NamedValueCollection& i_rArgs ) /* [Beschreibung] */ { @@ -514,42 +513,35 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& OSL_PRECOND( GetCurrentDocument() == NULL, "SfxFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); - SFX_ITEMSET_ARG( &rSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size - SFX_ITEMSET_ARG( &rSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID - SFX_ITEMSET_ARG( &rSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom - SFX_ITEMSET_ARG( &rSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False ); // hidden - SFX_ITEMSET_ARG( &rSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False ); // view only - SFX_ITEMSET_ARG( &rSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False ); // plugin (external inplace) - SFX_ITEMSET_ARG( &rSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False ); // jump (GotoBookmark) + // view ID + sal_Int16 nViewId = 0; + const bool bHasViewId = i_rArgs.get_ensureType( "ViewId", nViewId ); - // hidden? - pImp->bHidden = pHidItem ? pHidItem->GetValue() : pImp->bHidden; + // jump mark + ::rtl::OUString sJumpMark; + const bool bHasJumpMark = i_rArgs.get_ensureType( "JumpMark", sJumpMark ); // plugin mode - const USHORT nPluginMode = pPluginMode ? pPluginMode->GetValue() : 0; - - // view only? - if ( pEditItem && pEditItem->GetValue() ) - SetMenuBarOn_Impl( FALSE ); - - // view ID - USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : 0; + sal_Int16 nPluginMode = 0; + const bool bHasPluginMode = i_rArgs.get_ensureType( "PluginMode", nPluginMode ); + // hidden? + pImp->bHidden = i_rArgs.getOrDefault( "Hidden", pImp->bHidden ); if( !pImp->bHidden ) rDoc.OwnerLock( sal_True ); Sequence< PropertyValue > aUserData; - bool bClearPosSizeZoom = false; + bool bClearWinPosSizeItem = false; bool bReadUserData = false; // if no view-related data exists in the set, then obtain the view data from the model - if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem ) + if ( !bHasJumpMark && !bHasPluginMode && !bHasViewId ) { if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) { SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - bClearPosSizeZoom = bReadUserData = true; + bClearWinPosSizeItem = bReadUserData = true; } } @@ -578,20 +570,16 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& } OSL_ENSURE( ( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT ) - || ( pJumpItem == NULL ), + || ( !bHasJumpMark ), "SfxFrame::InsertDocument_Impl: so this code wasn't dead?" ); // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method // here is never called before the load process finished. At least not with a jump item != NULL. - if( pJumpItem ) + if( bHasJumpMark ) { - pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); + pViewFrame->GetViewShell()->JumpToMark( sJumpMark ); } - // Position und Groesse setzen - if ( pAreaItem ) - PositionWindow_Impl( pAreaItem->GetValue() ); - if ( !pImp->bHidden ) { if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) ) @@ -624,7 +612,7 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& } else { - DBG_ASSERT( !IsInPlace() && !pPluginMode, "Special modes not compatible with hidden mode!" ); + DBG_ASSERT( !IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" ); GetWindow().Show(); } @@ -638,12 +626,10 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const SfxItemSet& SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); - if ( bClearPosSizeZoom ) + if ( bClearWinPosSizeItem ) { SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); - pMediumSet->ClearItem( SID_VIEW_POS_SIZE ); pMediumSet->ClearItem( SID_WIN_POSSIZE ); - pMediumSet->ClearItem( SID_VIEW_ZOOM_MODE ); } if ( bReadUserData ) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 7ea3a4fdde..0d541cc928 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -355,15 +355,6 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti } } -// -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_plugDocIntoFrame( const ::comphelper::NamedValueCollection& i_rDescriptor, - SfxFrame& i_rTargetFrame, SfxObjectShell& i_rDocument ) const -{ - SfxAllItemSet aSet( SFX_APP()->GetPool() ); - TransformParameters( SID_OPENDOC, i_rDescriptor.getPropertyValues(), aSet ); - return i_rTargetFrame.InsertDocument_Impl( i_rDocument, aSet ); -} - // -------------------------------------------------------------------------------------------------------------------- SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel >& i_rxDocument ) const { @@ -468,11 +459,11 @@ void SfxFrameLoader_Impl::impl_handleCaughtError_nothrow( const Any& i_rCaughtEr ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove ); pRequest->addContinuation( pApprove.get() ); - const Reference< XInteractionHandler2 > xHandler( xInteraction, UNO_QUERY_THROW ); + const Reference< XInteractionHandler2 > xHandler( xInteraction, UNO_QUERY ); #if OSL_DEBUG_LEVEL > 0 const sal_Bool bHandled = #endif - xHandler->handleInteractionRequest( pRequest.get() ); + xHandler.is() && xHandler->handleInteractionRequest( pRequest.get() ); #if OSL_DEBUG_LEVEL > 0 if ( !bHandled ) @@ -487,6 +478,14 @@ void SfxFrameLoader_Impl::impl_handleCaughtError_nothrow( const Any& i_rCaughtEr } } +// -------------------------------------------------------------------------------------------------------------------- +void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCollection& io_rDescriptor ) +{ + // remove the arguments which are for the loader only, and not for a call to attachResource + io_rDescriptor.remove( "StatusIndicator" ); + io_rDescriptor.remove( "Model" ); +} + // -------------------------------------------------------------------------------------------------------------------- sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rArgs, const Reference< XFrame >& _rTargetFrame ) @@ -571,10 +570,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA { xLoadable->initNew(); - ::comphelper::NamedValueCollection aArgs( aDescriptor ); - aArgs.remove( "StatusIndicator" ); // TODO: why this? - - xModel->attachResource( ::rtl::OUString(), aArgs.getPropertyValues() ); + impl_removeLoaderArguments( aDescriptor ); + xModel->attachResource( ::rtl::OUString(), aDescriptor.getPropertyValues() ); } else { @@ -583,7 +580,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } else { - // tell the doc its load args. + // tell the doc its (current) load args. xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() ); // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could @@ -611,8 +608,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA SfxFrame* pTargetFrame = impl_getOrCreateEmptySfxFrame( _rTargetFrame ); wFrame = pTargetFrame; - // insert the document into the frame - if ( !impl_plugDocIntoFrame( aDescriptor, *pTargetFrame, *xDoc ) ) + // plug the document into the frame + if ( !pTargetFrame->InsertDocument_Impl( *xDoc, aDescriptor ) ) throw RuntimeException(); if ( !bExternalModel ) -- cgit v1.2.3 From 0bdf4c628a30923b6cde3f19f61e6563753ada86 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 9 Dec 2009 12:48:52 +0100 Subject: autorecovery: removed SID_WIN_POSSIZE There were two places which wrote this item (one being the TransformParameters in appuno.cxx, one a GetState method at the view frame), and both had different opinions whether this item should be an SfxStringItem or an SfxRectangleItem. Also, there seemed to be no code at all which evaluated this item. --- sfx2/inc/sfx2/sfxsids.hrc | 2 +- sfx2/sdi/frmslots.sdi | 5 ----- sfx2/sdi/sfx.sdi | 27 --------------------------- sfx2/source/appl/appbas.cxx | 5 ----- sfx2/source/appl/appuno.cxx | 18 ------------------ sfx2/source/view/frame2.cxx | 23 +++++------------------ sfx2/source/view/viewfrm2.cxx | 10 ---------- 7 files changed, 6 insertions(+), 84 deletions(-) diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 9f86bb8765..e23eec3931 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -733,7 +733,7 @@ #define SID_WIN_MINIMIZED (SID_SFX_START + 625) #define SID_WIN_MAXIMIZED (SID_SFX_START + 626) #define SID_WIN_FULLSCREEN (SID_SFX_START + 627) -#define SID_WIN_POSSIZE (SID_SFX_START + 628) + // FREE, was SID_WIN_POSSIZE #define SID_WIN_VISIBLE (SID_SFX_START + 629) #define SID_VIEWSHELL0 (SID_SFX_START + 630) diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi index ca76da69a4..716505e4c8 100644 --- a/sfx2/sdi/frmslots.sdi +++ b/sfx2/sdi/frmslots.sdi @@ -400,11 +400,6 @@ interface TopWindow : BrowseWindow [ StateMethod = StateView_Impl ; ] - SID_WIN_POSSIZE // ole(no) api(final/play/rec) - [ - ExecMethod = Exec_Impl ; - StateMethod = GetState_Impl ; - ] SID_CLOSEWIN // ole(no) api(final/play/rec) [ ExecMethod = Exec_Impl ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index efa2c0e23a..7caf442758 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -399,33 +399,6 @@ SfxVoidItem AddWatch SID_BASICIDE_ADDWATCH GroupId = GID_MACRO; ] -//-------------------------------------------------------------------------- -SfxRectangleItem Area SID_WIN_POSSIZE - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = FALSE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = ; -] - //-------------------------------------------------------------------------- SfxStringItem Author SID_DOCINFO_AUTHOR diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index c6667aaf26..a7a663a128 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -425,11 +425,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) break; } - case SID_WIN_POSSIZE: - { - break; - } - case SID_INTERACTIVEMODE: { break; diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 3b6b6f131d..1c61ee0423 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -181,7 +181,6 @@ static const String sMacroExecMode = String::CreateFromAscii( "Macr static const String sUpdateDocMode = String::CreateFromAscii( "UpdateDocMode" ); static const String sMinimized = String::CreateFromAscii( "Minimized" ); static const String sInteractionHdl = String::CreateFromAscii( "InteractionHandler" ); -static const String sWindowState = String::CreateFromAscii( "WindowState" ); static const String sUCBContent = String::CreateFromAscii( "UCBContent" ); static const String sRepairPackage = String::CreateFromAscii( "RepairPackage" ); static const String sDocumentTitle = String::CreateFromAscii( "DocumentTitle" ); @@ -741,14 +740,6 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_CONTENTTYPE, sVal ) ); } - else if ( aName == sWindowState ) - { - ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); - DBG_ASSERT( bOK, "invalid type or value for WindowState" ); - if (bOK) - rSet.Put( SfxStringItem( SID_WIN_POSSIZE, sVal ) ); - } else if ( aName == sTemplateName ) { ::rtl::OUString sVal; @@ -1018,8 +1009,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_CONTENTTYPE ) == SFX_ITEM_SET ) nAdditional++; - if ( rSet.GetItemState( SID_WIN_POSSIZE ) == SFX_ITEM_SET ) - nAdditional++; if ( rSet.GetItemState( SID_POSTDATA ) == SFX_ITEM_SET ) nAdditional++; if ( rSet.GetItemState( SID_FILLFRAME ) == SFX_ITEM_SET ) @@ -1175,8 +1164,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta continue; if ( nId == SID_CONTENTTYPE ) continue; - if ( nId == SID_WIN_POSSIZE ) - continue; if ( nId == SID_TEMPLATE_NAME ) continue; if ( nId == SID_TEMPLATE_REGIONNAME ) @@ -1498,11 +1485,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = sMediaType; pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } - if ( rSet.GetItemState( SID_WIN_POSSIZE, sal_False, &pItem ) == SFX_ITEM_SET ) - { - pValue[nActProp].Name = sWindowState; - pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); - } if ( rSet.GetItemState( SID_TEMPLATE_NAME, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = sTemplateName; diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index c5d5b03eb0..9c9aefa6e2 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -530,18 +530,14 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper if( !pImp->bHidden ) rDoc.OwnerLock( sal_True ); - Sequence< PropertyValue > aUserData; - bool bClearWinPosSizeItem = false; - bool bReadUserData = false; - // if no view-related data exists in the set, then obtain the view data from the model + Sequence< PropertyValue > aUserData; if ( !bHasJumpMark && !bHasPluginMode && !bHasViewId ) { if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) { SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - bClearWinPosSizeItem = bReadUserData = true; } } @@ -626,20 +622,11 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); - if ( bClearWinPosSizeItem ) - { - SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); - pMediumSet->ClearItem( SID_WIN_POSSIZE ); - } - - if ( bReadUserData ) + // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE + // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet + if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) { - // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE - // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) - { - pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); - } + pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); } return GetCurrentDocument() == &rDoc; diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 91e57feb31..9d11d21d13 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -323,9 +323,6 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) break; } - case SID_WIN_POSSIZE: - break; - case SID_NEWDOCDIRECT : { SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, FALSE); @@ -441,13 +438,6 @@ void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) case SID_SHOWPOPUPS : break; - case SID_WIN_POSSIZE: - { - rSet.Put( SfxRectangleItem( nWhich, Rectangle( - GetWindow().GetPosPixel(), GetWindow().GetSizePixel() ) ) ); - break; - } - case SID_OBJECT: if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() ) { -- cgit v1.2.3 From ca7547d907a2b3b14829a92cdfc38cac1bda14ba Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 10 Dec 2009 12:41:09 +0100 Subject: autorecovery: moved some code from SfxFrame::InsertDocument_Impl to where the view is actually created (or connected) --- sfx2/inc/frmload.hxx | 5 ++ sfx2/inc/sfx2/frame.hxx | 1 + sfx2/source/control/dispatch.cxx | 1 + sfx2/source/doc/objmisc.cxx | 2 +- sfx2/source/doc/sfxbasemodel.cxx | 16 ++++ sfx2/source/view/frame2.cxx | 133 ++------------------------------- sfx2/source/view/frmload.cxx | 44 +++++++++++ sfx2/source/view/sfxbasecontroller.cxx | 126 +++++++++++++++++++++++++++---- 8 files changed, 187 insertions(+), 141 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index edb6d59d5d..aa72dbebd1 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -139,6 +139,11 @@ private: void impl_removeLoaderArguments( ::comphelper::NamedValueCollection& io_rDescriptor ); + + void impl_determineViewID_nothrow( + const SfxObjectShell& i_rDocument, + ::comphelper::NamedValueCollection& io_rDescriptor + ); }; #endif diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 8e6a8ca3bc..c9ce04de7c 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -225,6 +225,7 @@ public: SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; + SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const; //#endif private: SAL_DLLPRIVATE void Construct_Impl(); diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 66da60e7e2..88806e4368 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -530,6 +530,7 @@ void SfxDispatcher::Pop else aMsg += ByteString::CreateFromInt64( (sal_uIntPtr) &rShell ); aMsg += bDelete ? ") with delete" : ")"; + if ( bUntil ) aMsg += " (up to)"; DbgTrace( aMsg.GetBuffer() ); #endif diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 7df10f2549..05af1b6205 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1552,7 +1552,7 @@ void SfxObjectShell::PositionView_Impl() sal_Bool SfxObjectShell::IsLoading() const /* [Beschreibung ] - Wurde bereits FinishedLoading aufgerufeb? */ + Has FinishedLoading been called? */ { return !( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ); } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index e25ad1bad9..9021413e6a 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -104,6 +104,7 @@ #include #include "viewfac.hxx" +#include "workwin.hxx" #include #include #include @@ -4045,6 +4046,21 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie if ( aDocumentLoadArgs.getOrDefault( "ViewOnly", false ) ) pViewFrame->GetFrame()->SetMenuBarOn_Impl( FALSE ); + const sal_Int16 nPluginMode = aDocumentLoadArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) ); + if ( nPluginMode == 1 ) + { + pViewFrame->ForceOuterResize_Impl( FALSE ); + pViewFrame->GetBindings().HidePopups( TRUE ); + + SfxFrame* pFrame = pViewFrame->GetFrame(); + // MBA: layoutmanager of inplace frame starts locked and invisible + pFrame->GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); + pFrame->GetWorkWindow_Impl()->Lock_Impl( TRUE ); + + pFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + } + return Reference< XController2 >( pViewShell->GetController(), UNO_QUERY_THROW ); } diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 9c9aefa6e2..1941ecfc27 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -48,8 +48,6 @@ #include #include -#include -#include #include #include #include @@ -72,7 +70,6 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; -using ::com::sun::star::document::XViewDataSupplier; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XComponent; using ::com::sun::star::frame::XComponentLoader; @@ -465,36 +462,6 @@ void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const } } -namespace -{ - bool lcl_getViewDataAndID( const Reference< XModel >& _rxDocument, Sequence< PropertyValue >& _o_viewData, sal_Int16& _o_viewId ) - { - _o_viewData.realloc(0); - _o_viewId = 0; - - Reference< XViewDataSupplier > xViewDataSupplier( _rxDocument, UNO_QUERY ); - Reference< XIndexAccess > xViewData; - if ( xViewDataSupplier.is() ) - xViewData = xViewDataSupplier->getViewData(); - - if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) - return false; - - // obtain the ViewID from the view data - if ( xViewData->getByIndex( 0 ) >>= _o_viewData ) - { - ::comphelper::NamedValueCollection aNamedUserData( _o_viewData ); - ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() ); - if ( sViewId.getLength() ) - { - sViewId = sViewId.copy( 4 ); // format is like in "view3" - _o_viewId = sal_Int16( sViewId.toInt32() ); - } - } - return true; - } -} - sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper::NamedValueCollection& i_rArgs ) /* [Beschreibung] */ @@ -514,12 +481,10 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper "SfxFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); // view ID - sal_Int16 nViewId = 0; - const bool bHasViewId = i_rArgs.get_ensureType( "ViewId", nViewId ); + sal_Int16 nViewId = i_rArgs.getOrDefault( "ViewId", sal_Int16( 0 ) ); // jump mark - ::rtl::OUString sJumpMark; - const bool bHasJumpMark = i_rArgs.get_ensureType( "JumpMark", sJumpMark ); + const bool bHasJumpMark = i_rArgs.has( "JumpMark" ); // plugin mode sal_Int16 nPluginMode = 0; @@ -527,19 +492,6 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper // hidden? pImp->bHidden = i_rArgs.getOrDefault( "Hidden", pImp->bHidden ); - if( !pImp->bHidden ) - rDoc.OwnerLock( sal_True ); - - // if no view-related data exists in the set, then obtain the view data from the model - Sequence< PropertyValue > aUserData; - if ( !bHasJumpMark && !bHasPluginMode && !bHasViewId ) - { - if ( lcl_getViewDataAndID( rDoc.GetModel(), aUserData, nViewId ) ) - { - SfxItemSet* pMediumSet = rDoc.GetMedium()->GetItemSet(); - pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - } - } UpdateDescriptor( &rDoc ); @@ -552,83 +504,10 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper // TODO: better error handling? Under which conditions can this fail? return sal_False; - if ( nPluginMode == 1 ) - { - pViewFrame->ForceOuterResize_Impl( FALSE ); - pViewFrame->GetBindings().HidePopups(TRUE); - - // MBA: layoutmanager of inplace frame starts locked and invisible - GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); - GetWorkWindow_Impl()->Lock_Impl( TRUE ); - - GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); - } - - OSL_ENSURE( ( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT ) - || ( !bHasJumpMark ), - "SfxFrame::InsertDocument_Impl: so this code wasn't dead?" ); - // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time - // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method - // here is never called before the load process finished. At least not with a jump item != NULL. - if( bHasJumpMark ) - { - pViewFrame->GetViewShell()->JumpToMark( sJumpMark ); - } - - if ( !pImp->bHidden ) - { - if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) ) - pViewFrame->GetDispatcher()->HideUI( TRUE ); - else - pViewFrame->GetDispatcher()->HideUI( FALSE ); - - if ( IsInPlace() ) - pViewFrame->LockAdjustPosSizePixel(); - - if ( ( nPluginMode == 3 ) ) - GetWorkWindow_Impl()->SetInternalDockingAllowed(FALSE); - - if ( !IsInPlace() ) - pViewFrame->GetDispatcher()->Update_Impl(); - pViewFrame->Show(); - GetWindow().Show(); - if ( !IsInPlace() || ( nPluginMode == 3 ) ) - pViewFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); - rDoc.OwnerLock( sal_False ); - - if ( IsInPlace() ) - { - pViewFrame->UnlockAdjustPosSizePixel(); - // force resize for OLE server to fix layout problems of writer and math - // see i53651 - if ( nPluginMode == 3 ) - pViewFrame->Resize(TRUE); - } - } - else - { - DBG_ASSERT( !IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" ); - GetWindow().Show(); - } - - // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen! - pViewFrame->UpdateTitle(); - - if ( !IsInPlace() ) - { - pViewFrame->Resize(TRUE); - } - - SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); - - // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE - // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) - { - pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); - } - return GetCurrentDocument() == &rDoc; } +bool SfxFrame::IsMarkedHidden_Impl() const +{ + return pImp->bHidden; +} diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 0d541cc928..28f8138c5e 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -54,6 +54,8 @@ #include #include #include +#include +#include /** === end UNO includes === **/ #include @@ -98,6 +100,8 @@ using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::uno::UNO_SET_THROW; using ::com::sun::star::uno::makeAny; using ::com::sun::star::util::XCloseable; +using ::com::sun::star::document::XViewDataSupplier; +using ::com::sun::star::container::XIndexAccess; /** === end UNO using === **/ SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< XMultiServiceFactory >& _rxFactory ) @@ -486,6 +490,43 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo io_rDescriptor.remove( "Model" ); } +// -------------------------------------------------------------------------------------------------------------------- +void SfxFrameLoader_Impl::impl_determineViewID_nothrow( const SfxObjectShell& i_rDocument, ::comphelper::NamedValueCollection& io_rDescriptor ) +{ + if ( io_rDescriptor.has( "ViewId" ) ) + // nothing to do + return; + + try + { + Reference< XViewDataSupplier > xViewDataSupplier( i_rDocument.GetModel(), UNO_QUERY ); + Reference< XIndexAccess > xViewData; + if ( xViewDataSupplier.is() ) + xViewData.set( xViewDataSupplier->getViewData() ); + + if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) + // no view data stored together with the model + return; + + // obtain the ViewID from the view data + Sequence< PropertyValue > aViewData; + if ( !( xViewData->getByIndex( 0 ) >>= aViewData ) ) + return; + + ::comphelper::NamedValueCollection aNamedViewData( aViewData ); + ::rtl::OUString sViewId = aNamedViewData.getOrDefault( "ViewId", ::rtl::OUString() ); + if ( !sViewId.getLength() ) + return; + + sViewId = sViewId.copy( 4 ); // format is like in "view3" + io_rDescriptor.put( "ViewId", sal_Int16( sViewId.toInt32() ) ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + // -------------------------------------------------------------------------------------------------------------------- sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rArgs, const Reference< XFrame >& _rTargetFrame ) @@ -608,6 +649,9 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA SfxFrame* pTargetFrame = impl_getOrCreateEmptySfxFrame( _rTargetFrame ); wFrame = pTargetFrame; + // ensure the ID of the to-be-created view is in the descriptor, if possible + impl_determineViewID_nothrow( *xDoc, aDescriptor ); + // plug the document into the frame if ( !pTargetFrame->InsertDocument_Impl( *xDoc, aDescriptor ) ) throw RuntimeException(); diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 608f307525..302514f5e4 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -121,6 +123,12 @@ using ::com::sun::star::lang::DisposedException; using ::com::sun::star::awt::XWindow; using ::com::sun::star::frame::XController; using ::com::sun::star::frame::XDispatchProvider; +using ::com::sun::star::document::XViewDataSupplier; +using ::com::sun::star::container::XIndexAccess; +using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::Exception; namespace css = ::com::sun::star; struct GroupIDToCommandGroup @@ -603,6 +611,10 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame if ( m_pData->m_pViewShell ) { ConnectSfxFrame_Impl( E_CONNECT ); + + // attaching the frame to the controller is the last step in the creation of a new view, so notify this + SfxEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell() ); + SFX_APP()->NotifyEvent( aHint ); } } } @@ -1258,14 +1270,14 @@ BOOL SfxBaseController::HasMouseClickListeners_Impl() void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) { ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" ); - SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame(); - ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" ); + SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame(); + ENSURE_OR_THROW( pViewFrame, "a view shell without a view frame is pretty pathological" ); const bool bConnect = ( i_eConnect != E_DISCONNECT ); // disable window and dispatcher - pActFrame->Enable( bConnect ); - pActFrame->GetDispatcher()->Lock( !bConnect ); + pViewFrame->Enable( bConnect ); + pViewFrame->GetDispatcher()->Lock( !bConnect ); if ( bConnect ) { @@ -1273,30 +1285,118 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) // RECONNECT, we're not allowed to push them if ( i_eConnect != E_RECONNECT ) { - pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell ); + pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell ); if ( m_pData->m_pViewShell->GetSubShell() ) - pActFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() ); + pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() ); m_pData->m_pViewShell->PushSubShells_Impl(); - pActFrame->GetDispatcher()->Flush(); + pViewFrame->GetDispatcher()->Flush(); } Window* pEditWin = m_pData->m_pViewShell->GetWindow(); if ( pEditWin && m_pData->m_pViewShell->IsShowView_Impl() ) pEditWin->Show(); - if ( SfxViewFrame::Current() == pActFrame ) - pActFrame->GetDispatcher()->Update_Impl( sal_True ); + if ( SfxViewFrame::Current() == pViewFrame ) + pViewFrame->GetDispatcher()->Update_Impl( sal_True ); - Window* pFrameWin = &pActFrame->GetWindow(); - if ( pFrameWin != &pActFrame->GetFrame()->GetWindow() ) + Window* pFrameWin = &pViewFrame->GetWindow(); + if ( pFrameWin != &pViewFrame->GetFrame()->GetWindow() ) pFrameWin->Show(); + + if ( i_eConnect == E_CONNECT ) + { + ::comphelper::NamedValueCollection aDocumentArgs( getModel()->getArgs() ); + + const sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) ); + const bool bHasPluginMode = ( nPluginMode != 0 ); + + SfxFrame* pFrame = pViewFrame->GetFrame(); + SfxObjectShell& rDoc = *m_pData->m_pViewShell->GetObjectShell(); + if ( !pFrame->IsMarkedHidden_Impl() ) + { + if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) ) + pViewFrame->GetDispatcher()->HideUI( TRUE ); + else + pViewFrame->GetDispatcher()->HideUI( FALSE ); + + if ( pFrame->IsInPlace() ) + pViewFrame->LockAdjustPosSizePixel(); + + if ( nPluginMode == 3 ) + pFrame->GetWorkWindow_Impl()->SetInternalDockingAllowed( FALSE ); + + if ( !pFrame->IsInPlace() ) + pViewFrame->GetDispatcher()->Update_Impl(); + pViewFrame->Show(); + pFrame->GetWindow().Show(); + if ( !pFrame->IsInPlace() || ( nPluginMode == 3 ) ) + pViewFrame->MakeActive_Impl( pFrame->GetFrameInterface()->isActive() ); + + if ( pFrame->IsInPlace() ) + { + pViewFrame->UnlockAdjustPosSizePixel(); + // force resize for OLE server to fix layout problems of writer and math + // see i53651 + if ( nPluginMode == 3 ) + pViewFrame->Resize( TRUE ); + } + } + else + { + DBG_ASSERT( !pFrame->IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" ); + pFrame->GetWindow().Show(); + } + + // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen! + pViewFrame->UpdateTitle(); + + if ( !pFrame->IsInPlace() ) + pViewFrame->Resize( TRUE ); + + // if there's a JumpMark given, then, well, jump to it + const ::rtl::OUString sJumpMark = aDocumentArgs.getOrDefault( "JumpMark", ::rtl::OUString() ); + const bool bHasJumpMark = ( sJumpMark.getLength() > 0 ); + OSL_ENSURE( ( !m_pData->m_pViewShell->GetObjectShell()->IsLoading() ) + || ( !sJumpMark.getLength() ), + "SfxBaseController::ConnectSfxFrame_Impl: so this code wasn't dead?" ); + // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time + // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method + // here is never called before the load process finished. At least not with a non-empty jump mark + if ( sJumpMark.getLength() ) + m_pData->m_pViewShell->JumpToMark( sJumpMark ); + + // if no plugin mode and no jump mark was supplied, check whether the document itself can provide view data, and + // if so, forward it to the view/shell. + if ( !bHasPluginMode && !bHasJumpMark ) + { + try + { + Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY ); + Reference< XIndexAccess > xViewData; + if ( xViewDataSupplier.is() ) + xViewData = xViewDataSupplier->getViewData(); + if ( xViewData.is() && xViewData->getCount() > 0 ) + { + Sequence< PropertyValue > aViewData; + if ( ( xViewData->getByIndex( 0 ) >>= aViewData ) && ( aViewData.getLength() ) ) + { + m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE ); + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + } } // invalidate slot corresponding to the view shell - const sal_uInt16 nViewNo = m_pData->m_pViewShell->GetObjectShell()->GetFactory().GetViewNo_Impl( pActFrame->GetCurViewId(), USHRT_MAX ); + const sal_uInt16 nViewNo = m_pData->m_pViewShell->GetObjectShell()->GetFactory().GetViewNo_Impl( pViewFrame->GetCurViewId(), USHRT_MAX ); DBG_ASSERT( nViewNo != USHRT_MAX, "view shell id not found" ); if ( nViewNo != USHRT_MAX ) - pActFrame->GetBindings().Invalidate( nViewNo + SID_VIEWSHELL0 ); + pViewFrame->GetBindings().Invalidate( nViewNo + SID_VIEWSHELL0 ); } //============================================================================= -- cgit v1.2.3 From 28209834d56317a2f27f872f6d99a4280ae55c49 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 10 Dec 2009 12:41:28 +0100 Subject: autorecovery: when doing a loadComponentFromURL with an existing model, ensure this also works for unsaved documents --- sfx2/inc/sfx2/docfac.hxx | 1 + sfx2/source/doc/docfac.cxx | 8 ++++++++ sfx2/source/view/frame2.cxx | 6 +++++- sfx2/source/view/viewfrm.cxx | 7 +------ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx index 8ab0017251..6def9fb37a 100644 --- a/sfx2/inc/sfx2/docfac.hxx +++ b/sfx2/inc/sfx2/docfac.hxx @@ -85,6 +85,7 @@ public: const SvGlobalName& GetClassId() const; SfxObjectShellFlags GetFlags() { return nFlags; } const char* GetShortName() const { return pShortName; } + String GetFactoryURL() const; // shortcut for "private:factory/GetShortName()" String GetFactoryName() const { return String::CreateFromAscii( pShortName ); } String GetModuleName() const; void SetDocumentTypeNameResource( const ResId& rId ); diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index e38b3eab62..8117c42a6c 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -287,6 +287,14 @@ const SvGlobalName& SfxObjectFactory::GetClassId() const return pImpl->aClassName; } +String SfxObjectFactory::GetFactoryURL() const +{ + ::rtl::OUStringBuffer aURLComposer; + aURLComposer.appendAscii( "private:factory/" ); + aURLComposer.appendAscii( GetShortName() ); + return aURLComposer.makeStringAndClear(); +} + String SfxObjectFactory::GetModuleName() const { static ::rtl::OUString SERVICENAME_MODULEMANAGER = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 1941ecfc27..0cce0c7702 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -285,9 +285,13 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI aLoadArgs = aArgs.getPropertyValues(); // load the doc into that frame + ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() ); + if ( sLoaderURL.getLength() == 0 ) + sLoaderURL = rDoc.GetFactory().GetFactoryURL(); + Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( - rDoc.GetModel()->getURL(), + sLoaderURL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ), 0, aLoadArgs diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index f02963d7a6..49416ce39c 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2107,12 +2107,7 @@ void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const R ::rtl::OUString sURL( xDocument->getURL() ); if ( !sURL.getLength() ) - { - ::rtl::OUStringBuffer aURLComposer; - aURLComposer.appendAscii( "private:factory/" ); - aURLComposer.appendAscii( i_rDoc.GetFactory().GetShortName() ); - sURL = aURLComposer.makeStringAndClear(); - } + sURL = i_rDoc.GetFactory().GetFactoryURL(); Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0, -- cgit v1.2.3 From 2ca5b4d670845760662a91bb1ffb0a4ec60e5ebe Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 10 Dec 2009 12:41:41 +0100 Subject: autorecovery: Basic IDE now again loads in the start module frame, if applicable --- sfx2/source/appl/appserv.cxx | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 09db519a99..0eb45cd795 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -95,6 +95,7 @@ #include #include +#include #include #include "about.hxx" @@ -841,6 +842,42 @@ namespace } return pView; } + Reference< XFrame > lcl_findStartModuleFrame( const ::comphelper::ComponentContext& i_rContext ) + { + try + { + Reference < XFramesSupplier > xSupplier( i_rContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); + Reference < XIndexAccess > xContainer( xSupplier->getFrames(), UNO_QUERY_THROW ); + + Reference< XModuleManager > xCheck( i_rContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW ); + + sal_Int32 nCount = xContainer->getCount(); + for ( sal_Int32 i=0; i xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW ); + ::rtl::OUString sModule = xCheck->identify( xFrame ); + if ( sModule.equalsAscii( "com.sun.star.frame.StartModule" ) ) + return xFrame; + } + catch( const UnknownModuleException& ) + { + // silence + } + catch(const Exception&) + { + // re-throw, caught below + throw; + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return NULL; + } } void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) @@ -942,8 +979,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) aLoadArgs.put( "Model", pBasicIDE->GetModel() ); aLoadArgs.put( "URL", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sbasic" ) ) ); - SfxFrame* pFrame = SfxFrame::CreateBlank(); - ENSURE_OR_THROW( pFrame, "could not create a blank SfxFrame" ); + Reference< XFrame > xStartModuleFrame( lcl_findStartModuleFrame( aContext ) ); + SfxFrame* pFrame = xStartModuleFrame.is() ? SfxFrame::Create( xStartModuleFrame ) : SfxFrame::CreateBlank(); + ENSURE_OR_THROW( pFrame, "could not create a SfxFrame to load the Basic IDE into!" ); xLoader->load( aLoadArgs.getPropertyValues(), pFrame->GetFrameInterface() ); } -- cgit v1.2.3 From e5aa24f3c6d304f92c6eaaf0341b83d22b179125 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 10 Dec 2009 13:20:56 +0100 Subject: autorecovery: guard the creation of the SfxViewShell in Enter/LeaveRegistration --- sfx2/source/doc/sfxbasemodel.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 9021413e6a..6a0989a4e6 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4024,10 +4024,13 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie // determine the ViewFrame belonging to the given XFrame SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame ); + OSL_POSTCOND( pViewFrame, "SfxBaseModel::createViewController: no frame?" ); // delegate to SFX' view factory SfxViewFactory& rViewFactory = rDocumentFactory.GetViewFactory( nViewNo ); + pViewFrame->GetBindings().ENTERREGISTRATIONS(); SfxViewShell* pViewShell = rViewFactory.CreateInstance( pViewFrame, pOldViewShell ); + pViewFrame->GetBindings().LEAVEREGISTRATIONS(); ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" ); // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also -- cgit v1.2.3 From f726e1cf4c15c0d97a16bd4386af06d67b492fa4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 10 Dec 2009 15:36:53 +0100 Subject: autorecovery: step 1 of final roll up of calling hierarchy --- sfx2/inc/frmload.hxx | 2 +- sfx2/inc/sfx2/frame.hxx | 2 +- sfx2/source/view/frame2.cxx | 43 ++++------------------------ sfx2/source/view/frmload.cxx | 67 ++++++++++++++++++++++++++------------------ 4 files changed, 47 insertions(+), 67 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index aa72dbebd1..a1e5542567 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -140,7 +140,7 @@ private: ::comphelper::NamedValueCollection& io_rDescriptor ); - void impl_determineViewID_nothrow( + sal_Int16 impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, ::comphelper::NamedValueCollection& io_rDescriptor ); diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index c9ce04de7c..84aa3090bf 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -219,7 +219,7 @@ public: SAL_DLLPRIVATE void GrabFocusOnComponent_Impl(); SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool ); - SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper::NamedValueCollection& i_rArgs ); + SAL_DLLPRIVATE void PrepareForDoc_Impl( SfxObjectShell& i_rDoc, const ::comphelper::NamedValueCollection& i_rArgs ); SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock ); SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 0cce0c7702..7093fb7392 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -34,7 +34,6 @@ #include "impframe.hxx" #include "objshimp.hxx" #include "sfxhelp.hxx" -#include "viewfac.hxx" #include "workwin.hxx" #include "sfx2/app.hxx" @@ -466,49 +465,19 @@ void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const } } -sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc, const ::comphelper::NamedValueCollection& i_rArgs ) -/* [Beschreibung] - */ +void SfxFrame::PrepareForDoc_Impl( SfxObjectShell& i_rDoc, const ::comphelper::NamedValueCollection& i_rArgs ) { - OSL_PRECOND( rDoc.GetMedium(), "SfxFrame::InsertDocument_Impl: no medium -> no view!"); - if ( !rDoc.GetMedium() ) - return sal_False; - - OSL_PRECOND( GetCurrentViewFrame() == NULL, - "SfxObjectShell::InsertDocument_Impl: no support (anymore) for loading into a non-empty frame!" ); - // Since some refactoring in CWS autorecovery, this shouldn't happen anymore. Frame re-usage is nowadays - // done in higher layers, namely in the framework. - if ( GetCurrentViewFrame() != NULL ) - return sal_False; - - OSL_PRECOND( GetCurrentDocument() == NULL, - "SfxFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); - - // view ID - sal_Int16 nViewId = i_rArgs.getOrDefault( "ViewId", sal_Int16( 0 ) ); - - // jump mark - const bool bHasJumpMark = i_rArgs.has( "JumpMark" ); - - // plugin mode - sal_Int16 nPluginMode = 0; - const bool bHasPluginMode = i_rArgs.get_ensureType( "PluginMode", nPluginMode ); - // hidden? + OSL_ENSURE( !pImp->bHidden, "when does this happen?" ); pImp->bHidden = i_rArgs.getOrDefault( "Hidden", pImp->bHidden ); - UpdateDescriptor( &rDoc ); + // update our descriptor + UpdateDescriptor( &i_rDoc ); + // plugin mode + sal_Int16 nPluginMode = i_rArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) ); if ( nPluginMode && ( nPluginMode != 2 ) ) SetInPlace_Impl( TRUE ); - - SfxViewFrame* pViewFrame = SfxViewFrame::Create_Impl( *this, rDoc, nViewId ? nViewId : rDoc.GetFactory().GetViewFactory( 0 ).GetOrdinal() ); - OSL_ENSURE( pViewFrame, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" ); - if ( !pViewFrame ) - // TODO: better error handling? Under which conditions can this fail? - return sal_False; - - return GetCurrentDocument() == &rDoc; } bool SfxFrame::IsMarkedHidden_Impl() const diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 28f8138c5e..4092bda904 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -33,6 +33,7 @@ #include "frmload.hxx" #include "objshimp.hxx" +#include "viewfac.hxx" #include "sfx2/app.hxx" #include "sfx2/dispatch.hxx" #include "sfx2/docfac.hxx" @@ -491,40 +492,46 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo } // -------------------------------------------------------------------------------------------------------------------- -void SfxFrameLoader_Impl::impl_determineViewID_nothrow( const SfxObjectShell& i_rDocument, ::comphelper::NamedValueCollection& io_rDescriptor ) +sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, ::comphelper::NamedValueCollection& io_rDescriptor ) { - if ( io_rDescriptor.has( "ViewId" ) ) - // nothing to do - return; - + sal_Int16 nViewId = io_rDescriptor.getOrDefault( "ViewId", sal_Int16( 0 ) ); try { - Reference< XViewDataSupplier > xViewDataSupplier( i_rDocument.GetModel(), UNO_QUERY ); - Reference< XIndexAccess > xViewData; - if ( xViewDataSupplier.is() ) - xViewData.set( xViewDataSupplier->getViewData() ); - - if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) - // no view data stored together with the model - return; - - // obtain the ViewID from the view data - Sequence< PropertyValue > aViewData; - if ( !( xViewData->getByIndex( 0 ) >>= aViewData ) ) - return; - - ::comphelper::NamedValueCollection aNamedViewData( aViewData ); - ::rtl::OUString sViewId = aNamedViewData.getOrDefault( "ViewId", ::rtl::OUString() ); - if ( !sViewId.getLength() ) - return; - - sViewId = sViewId.copy( 4 ); // format is like in "view3" - io_rDescriptor.put( "ViewId", sal_Int16( sViewId.toInt32() ) ); + if ( nViewId == 0 ) do + { + Reference< XViewDataSupplier > xViewDataSupplier( i_rDocument.GetModel(), UNO_QUERY ); + Reference< XIndexAccess > xViewData; + if ( xViewDataSupplier.is() ) + xViewData.set( xViewDataSupplier->getViewData() ); + + if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) + // no view data stored together with the model + break; + + // obtain the ViewID from the view data + Sequence< PropertyValue > aViewData; + if ( !( xViewData->getByIndex( 0 ) >>= aViewData ) ) + break; + + ::comphelper::NamedValueCollection aNamedViewData( aViewData ); + ::rtl::OUString sViewId = aNamedViewData.getOrDefault( "ViewId", ::rtl::OUString() ); + if ( !sViewId.getLength() ) + break; + + sViewId = sViewId.copy( 4 ); // format is like in "view3" + nViewId = sal_Int16( sViewId.toInt32() ); + io_rDescriptor.put( "ViewId", nViewId ); + } + while ( false ); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } + + if ( nViewId == 0 ) + nViewId = i_rDocument.GetFactory().GetViewFactory( 0 ).GetOrdinal(); + return nViewId; } // -------------------------------------------------------------------------------------------------------------------- @@ -649,11 +656,15 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA SfxFrame* pTargetFrame = impl_getOrCreateEmptySfxFrame( _rTargetFrame ); wFrame = pTargetFrame; + // prepare it + pTargetFrame->PrepareForDoc_Impl( *xDoc, aDescriptor ); + // ensure the ID of the to-be-created view is in the descriptor, if possible - impl_determineViewID_nothrow( *xDoc, aDescriptor ); + sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); // plug the document into the frame - if ( !pTargetFrame->InsertDocument_Impl( *xDoc, aDescriptor ) ) + SfxViewFrame* pViewFrame = SfxViewFrame::Create_Impl( *pTargetFrame, *xDoc, nViewId ); + if ( !pViewFrame ) throw RuntimeException(); if ( !bExternalModel ) -- cgit v1.2.3 From 258027a442827882e259c7249395b969baa58f80 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 10 Dec 2009 15:36:53 +0100 Subject: autorecovery: step 2 of final roll up of calling hierarchy --- sfx2/inc/sfx2/docfac.hxx | 5 +++- sfx2/inc/sfx2/viewfrm.hxx | 15 +++++------ sfx2/inc/viewfac.hxx | 3 +++ sfx2/source/doc/docfac.cxx | 17 +++++++++++- sfx2/source/doc/sfxbasemodel.cxx | 26 +++++------------- sfx2/source/view/frmload.cxx | 21 ++++++++++----- sfx2/source/view/sfxbasecontroller.cxx | 16 ++++++++---- sfx2/source/view/viewfac.cxx | 12 ++++++--- sfx2/source/view/viewfrm.cxx | 48 +++++----------------------------- 9 files changed, 77 insertions(+), 86 deletions(-) diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx index 6def9fb37a..f410d711c2 100644 --- a/sfx2/inc/sfx2/docfac.hxx +++ b/sfx2/inc/sfx2/docfac.hxx @@ -97,6 +97,9 @@ public: USHORT GetViewFactoryCount() const; SfxViewFactory& GetViewFactory(USHORT i = 0) const; + /// returns the view factory whose GetViewName delivers the requested logical name + SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const; + // Filter const SfxFilter* GetTemplateFilter() const; static String GetStandardTemplate( const String& rServiceName ); @@ -110,7 +113,7 @@ public: //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void SetModule_Impl( SfxModule* ); SAL_DLLPRIVATE static void UpdateFilterContainers_Impl(); - SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ); + SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) const; //#endif private: diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 9fb96d006d..cf6f07e57b 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -307,26 +307,25 @@ public: SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); SAL_DLLPRIVATE void SetCurViewId_Impl( const USHORT i_nID ); - SAL_DLLPRIVATE static SfxViewFrame* Create_Impl( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ); - -//#endif -private: - SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); - SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); SAL_DLLPRIVATE static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > LoadDocument_Impl( const SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rViewFactoryArgs, - const USHORT i_nViewId + const ::rtl::OUString& i_rViewName ); +//#endif +private: + SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); + SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); + /** loads a new view of our document into our frame This method completely bypasses the UNO loader mechanism, it exchanges the current view on SFX level. Use it for quick inplace view switches only. */ - SAL_DLLPRIVATE SfxViewShell* LoadNewSfxView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ); + SAL_DLLPRIVATE SfxViewShell* LoadNewSfxView_Impl( const ::rtl::OUString& i_rViewName, SfxViewShell* i_pOldShell ); /** loads the given existing document into the given frame diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx index c500f38df1..ca19c8eacc 100644 --- a/sfx2/inc/viewfac.hxx +++ b/sfx2/inc/viewfac.hxx @@ -59,6 +59,9 @@ public: { return String( aDescription ); } USHORT GetOrdinal() const { return nOrd; } + /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID + String GetViewName() const; + private: SfxViewCtor fnCreate; SfxViewInit fnInit; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 8117c42a6c..7679b72f7a 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -322,7 +322,7 @@ String SfxObjectFactory::GetModuleName() const } -sal_uInt16 SfxObjectFactory::GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) +sal_uInt16 SfxObjectFactory::GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) const { for ( sal_uInt16 curViewNo = 0; curViewNo < GetViewFactoryCount(); ++curViewNo ) { @@ -332,3 +332,18 @@ sal_uInt16 SfxObjectFactory::GetViewNo_Impl( const sal_uInt16 i_nViewId, const s } return i_nFallback; } + +SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rViewName ) const +{ + SfxViewFactory* pViewFactory = NULL; + for ( USHORT nViewNo = 0; + nViewNo < GetViewFactoryCount(); + ++nViewNo + ) + { + SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) ); + if ( rViewFac.GetViewName() == i_rViewName ) + return &rViewFac; + } + return NULL; +} diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 6a0989a4e6..f6d2f4eb15 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3931,12 +3931,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount ); for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo ) - { - ::rtl::OUStringBuffer aViewName; - aViewName.appendAscii( "view" ); - aViewName.append( nViewNo ); - aViewNames[nViewNo] = aViewName.makeStringAndClear(); - } + aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName(); return aViewNames; } @@ -4002,17 +3997,9 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie if ( impl_isDisposed() ) throw lang::DisposedException(); - // number of view to create - if ( i_rViewName.indexOfAsciiL( "view", 4 ) != 0 ) - throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); - const USHORT nViewId = (USHORT)i_rViewName.copy( 4 ).toInt32(); - - SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); - sal_Int32 nViewNo = -1; - for ( nViewNo = 0; nViewNo < rDocumentFactory.GetViewFactoryCount(); ++nViewNo ) - if ( rDocumentFactory.GetViewFactory( nViewNo ).GetOrdinal() == nViewId ) - break; - if ( nViewNo >= rDocumentFactory.GetViewFactoryCount() ) + // find the proper SFX view factory + SfxViewFactory* pViewFactory = GetObjectShell()->GetFactory().GetViewFactoryByViewName( i_rViewName ); + if ( !pViewFactory ) throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); // determine previous shell (used in some special cases) @@ -4027,9 +4014,8 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie OSL_POSTCOND( pViewFrame, "SfxBaseModel::createViewController: no frame?" ); // delegate to SFX' view factory - SfxViewFactory& rViewFactory = rDocumentFactory.GetViewFactory( nViewNo ); pViewFrame->GetBindings().ENTERREGISTRATIONS(); - SfxViewShell* pViewShell = rViewFactory.CreateInstance( pViewFrame, pOldViewShell ); + SfxViewShell* pViewShell = pViewFactory->CreateInstance( pViewFrame, pOldViewShell ); pViewFrame->GetBindings().LEAVEREGISTRATIONS(); ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" ); @@ -4038,7 +4024,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie pViewFrame->SetViewShell_Impl( pViewShell ); // remember ViewID - pViewFrame->SetCurViewId_Impl( rViewFactory.GetOrdinal() ); + pViewFrame->SetCurViewId_Impl( pViewFactory->GetOrdinal() ); // ensure a default controller, if the view shell did not provide an own implementation if ( !pViewShell->GetController().is() ) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 4092bda904..79af216f05 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -103,6 +103,7 @@ using ::com::sun::star::uno::makeAny; using ::com::sun::star::util::XCloseable; using ::com::sun::star::document::XViewDataSupplier; using ::com::sun::star::container::XIndexAccess; +using ::com::sun::star::frame::XController2; /** === end UNO using === **/ SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< XMultiServiceFactory >& _rxFactory ) @@ -518,9 +519,12 @@ sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxO if ( !sViewId.getLength() ) break; - sViewId = sViewId.copy( 4 ); // format is like in "view3" - nViewId = sal_Int16( sViewId.toInt32() ); - io_rDescriptor.put( "ViewId", nViewId ); + // somewhat weird convention here ... in the view data, the ViewId is a string, effectively describing + // a view name. In the document load descriptor, the ViewId is in fact the numeric ID. + + SfxViewFactory* pViewFactory = i_rDocument.GetFactory().GetViewFactoryByViewName( sViewId ); + if ( pViewFactory ) + io_rDescriptor.put( "ViewId", sal_Int16( pViewFactory->GetOrdinal() ) ); } while ( false ); } @@ -660,12 +664,15 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA pTargetFrame->PrepareForDoc_Impl( *xDoc, aDescriptor ); // ensure the ID of the to-be-created view is in the descriptor, if possible - sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); + const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); + const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 ); + const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() ); // plug the document into the frame - SfxViewFrame* pViewFrame = SfxViewFrame::Create_Impl( *pTargetFrame, *xDoc, nViewId ); - if ( !pViewFrame ) - throw RuntimeException(); + Reference< XController2 > xController = SfxViewFrame::LoadDocument_Impl( + *xDoc, pTargetFrame->GetFrameInterface(), Sequence< PropertyValue >(), sViewName ); + ENSURE_OR_THROW( xController.is(), "invalid controller" ); + // this is expected to throw in case of a failure ... if ( !bExternalModel ) { diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 302514f5e4..5be1e8e31c 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -95,6 +95,7 @@ #include #include +#include "viewfac.hxx" #define OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper #define OINTERFACECONTAINERHELPER ::cppu::OInterfaceContainerHelper @@ -565,13 +566,18 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run ::rtl::OUString SAL_CALL SfxBaseController::getViewControllerName() throw (RuntimeException) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( !m_pData->m_pViewShell ) + if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() ) throw DisposedException(); - ::rtl::OUStringBuffer sViewName; - sViewName.appendAscii( "view" ); - sViewName.append( sal_Int32( GetViewFrame_Impl()->GetCurViewId() ) ); - return sViewName.makeStringAndClear(); + const SfxObjectFactory& rDocFac( m_pData->m_pViewShell->GetObjectShell()->GetFactory() ); + sal_uInt16 nViewNo = rDocFac.GetViewNo_Impl( GetViewFrame_Impl()->GetCurViewId(), rDocFac.GetViewFactoryCount() ); + OSL_ENSURE( nViewNo < rDocFac.GetViewFactoryCount(), "SfxBaseController::getViewControllerName: view ID not found in view factories!" ); + + ::rtl::OUString sViewName; + if ( nViewNo < rDocFac.GetViewFactoryCount() ) + sViewName = rDocFac.GetViewFactory( nViewNo ).GetViewName(); + + return sViewName; } SfxViewFrame* SfxBaseController::GetViewFrame_Impl() const diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index 09ef5d2e1f..a8a201e170 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -32,10 +32,8 @@ #include "precompiled_sfx2.hxx" // INCLUDE --------------------------------------------------------------- -#ifndef GCC -#endif - #include +#include #include "viewfac.hxx" // STATIC DATA ----------------------------------------------------------- @@ -54,6 +52,14 @@ void SfxViewFactory::InitFactory() (*fnInit)(); } +String SfxViewFactory::GetViewName() const +{ + ::rtl::OUStringBuffer aViewName; + aViewName.appendAscii( "view" ); + aViewName.append( GetOrdinal() ); + return aViewName.makeStringAndClear(); +} + // CTOR / DTOR ----------------------------------------------------------- SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 49416ce39c..6de00d48eb 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2010,19 +2010,14 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const //-------------------------------------------------------------------- Reference< XController2 > SfxViewFrame::LoadDocument_Impl( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const Sequence< PropertyValue >& i_rViewFactoryArgs, - const USHORT i_nViewId ) + const ::rtl::OUString& i_rViewName ) { ENSURE_OR_THROW( i_rFrame.is(), "illegal frame" ); const Reference < XModel2 > xModel( i_rDoc.GetModel(), UNO_QUERY_THROW ); - ::rtl::OUStringBuffer sViewName; - sViewName.appendAscii( "view" ); - sViewName.append( sal_Int32( i_nViewId ) ); - // TODO: extend the SfxViewFactory with support for speaking view names - // let the model create a new controller const Reference< XController2 > xController( xModel->createViewController( - sViewName.makeStringAndClear(), + i_rViewName, i_rViewFactoryArgs, i_rFrame ), UNO_SET_THROW ); @@ -2115,7 +2110,7 @@ void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const R } //-------------------------------------------------------------------- -SfxViewShell* SfxViewFrame::LoadNewSfxView_Impl( const USHORT i_nViewId, SfxViewShell* i_pOldShell ) +SfxViewShell* SfxViewFrame::LoadNewSfxView_Impl( const ::rtl::OUString& i_rViewName , SfxViewShell* i_pOldShell ) { ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" ); OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewSfxView_Impl: not allowed to be called with an exsiting view shell!" ); @@ -2128,7 +2123,7 @@ SfxViewShell* SfxViewFrame::LoadNewSfxView_Impl( const USHORT i_nViewId, SfxView *GetObjectShell(), GetFrame()->GetFrameInterface(), aViewCreationArgs.getPropertyValues(), - i_nViewId + i_rViewName ); SfxViewShell* pViewShell = SfxViewShell::Get( xController.get() ); @@ -2204,36 +2199,6 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c //-------------------------------------------------------------------- -SfxViewFrame* SfxViewFrame::Create_Impl( SfxFrame& i_rFrame, SfxObjectShell& i_rDoc, const USHORT i_nViewId ) -{ - SfxViewFrame* pViewFrame = NULL; - try - { - Reference< XController2 > xController = LoadDocument_Impl( - i_rDoc, i_rFrame.GetFrameInterface(), Sequence< PropertyValue >(), i_nViewId ); - ENSURE_OR_THROW( xController.is(), "invalid controller returned by LoadDocument_Impl" ); - // LoadDocument_Impl is expected to throw in case of a failure ... - - if ( xController.is() ) - { - pViewFrame = SfxViewFrame::Get( xController.get(), &i_rDoc ); - if ( !pViewFrame ) - { - OSL_ENSURE( false, "SfxViewFrame::Create_Impl: wrong controller implementation!" ); - Reference< XComponent > xComponent( xController, UNO_QUERY_THROW ); - xComponent->dispose(); - } - } - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return pViewFrame; -} - -//-------------------------------------------------------------------- - sal_Bool SfxViewFrame::SwitchToViewShell_Impl ( sal_uInt16 nViewIdOrNo, /* > 0 @@ -2296,8 +2261,9 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl // create and load new ViewShell SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory(); - const sal_uInt16 nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; - SfxViewShell* pNewSh = LoadNewSfxView_Impl( nViewId, pOldSh ); + const sal_Int16 nViewNo = ( bIsIndex || !nViewIdOrNo ) ? nViewIdOrNo : rDocFact.GetViewNo_Impl( nViewIdOrNo, 0 ); + const ::rtl::OUString sViewName( rDocFact.GetViewFactory( nViewNo ).GetViewName() ); + SfxViewShell* pNewSh = LoadNewSfxView_Impl( sViewName, pOldSh ); // allow resize events to be processed UnlockAdjustPosSizePixel(); -- cgit v1.2.3 From 078a74712208ef74d6573451a96420250a970b73 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Dec 2009 10:43:27 +0100 Subject: dba33e: #i107327#: remove unused method (thanks to cmc) --- connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx | 6 ------ connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx | 1 - 2 files changed, 7 deletions(-) diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx index dc422f3cfa..bd4bfddb5f 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx @@ -33,12 +33,6 @@ #include #include -ini_Section * IniParser::getSection(OUString const & secName) -{ - if (mAllSection.find(secName) != mAllSection.end()) - return &mAllSection[secName]; - return NULL; -} IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException ) { OUString iniUrl; diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx index 7a556d9a1e..13cc611350 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx @@ -75,7 +75,6 @@ class IniParser IniSectionMap mAllSection; public: IniSectionMap * getAllSection(){return &mAllSection;}; - ini_Section * getSection(OUString const & secName); IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException ); #if OSL_DEBUG_LEVEL > 0 void Dump(); -- cgit v1.2.3 From e2adc84270e966a5b504093817a843d00364d3f4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Dec 2009 11:28:14 +0100 Subject: autorecovery: made JumpMark a argument of the to-be-created view. For this purpose, the loader moves this argument from the loader args to the args which are later passed to XModel2.createViewController, and the Controller implementation retrieves it from there. (In this course, XController2.getCreationArguments has been introduced, and implemented in the two known XController2 implementations in the code base.) --- sfx2/inc/frmload.hxx | 5 ++++ sfx2/inc/sfx2/sfxbasecontroller.hxx | 4 ++- sfx2/inc/sfx2/viewsh.hxx | 2 ++ sfx2/source/doc/sfxbasemodel.cxx | 7 ++++++ sfx2/source/view/frmload.cxx | 32 ++++++++++++++++++++--- sfx2/source/view/sfxbasecontroller.cxx | 46 +++++++++++++++++++++++++--------- sfx2/source/view/viewsh.cxx | 5 ++++ 7 files changed, 84 insertions(+), 17 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index a1e5542567..3179959d16 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -142,6 +142,11 @@ private: sal_Int16 impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, + const ::comphelper::NamedValueCollection& i_rDescriptor + ); + + ::comphelper::NamedValueCollection + impl_extractViewCreationArgs( ::comphelper::NamedValueCollection& io_rDescriptor ); }; diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx index 7ade240be0..0cbafe87db 100644 --- a/sfx2/inc/sfx2/sfxbasecontroller.hxx +++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx @@ -162,6 +162,7 @@ public: //____________________________________________________________________________________________________ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getComponentWindow() throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getViewControllerName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCreationArguments() throw (::com::sun::star::uno::RuntimeException); //____________________________________________________________________________________________________ // XController @@ -392,6 +393,7 @@ public: SAL_DLLPRIVATE BOOL HandleEvent_Impl( NotifyEvent& rEvent ); SAL_DLLPRIVATE BOOL HasKeyListeners_Impl(); SAL_DLLPRIVATE BOOL HasMouseClickListeners_Impl(); + SAL_DLLPRIVATE void SetCreationArguments_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rCreationArgs ); SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > impl_getTitleHelper (); //#endif private: @@ -402,7 +404,7 @@ private: E_RECONNECT }; SAL_DLLPRIVATE void ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ); - SAL_DLLPRIVATE SfxViewFrame* GetViewFrame_Impl() const; + SAL_DLLPRIVATE SfxViewFrame& GetViewFrame_Impl() const; //________________________________________________________________________________________________________ // private variables diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index a1dcf4960c..5fba2c462c 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -311,6 +311,8 @@ public: SAL_DLLPRIVATE BOOL HasKeyListeners_Impl(); SAL_DLLPRIVATE BOOL HasMouseClickListeners_Impl(); + SAL_DLLPRIVATE SfxBaseController* GetBaseController_Impl() const; + // Shell Interface SAL_DLLPRIVATE void ExecPrint_Impl(SfxRequest &); SAL_DLLPRIVATE void ExecMisc_Impl(SfxRequest &); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index f6d2f4eb15..3fd931a0b4 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4008,6 +4008,8 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie SfxViewShell* pOldViewShell = SfxViewShell::Get( xPreviousController ); OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell != NULL ), "SfxBaseModel::createViewController: invalid old controller!" ); + // now that we used that arg, remove it, so the controller will not remember it below + aCreationArgs.remove( "PreviousView" ); // determine the ViewFrame belonging to the given XFrame SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame ); @@ -4030,6 +4032,11 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie if ( !pViewShell->GetController().is() ) pViewShell->SetController( new SfxBaseController( pViewShell ) ); + // pass the creation arguments to the controller + SfxBaseController* pBaseController = pViewShell->GetBaseController_Impl(); + ENSURE_OR_THROW( pBaseController, "invalid controller implementation!" ); + pBaseController->SetCreationArguments_Impl( aCreationArgs.getPropertyValues() ); + // some initial view settings, coming from our most recent attachResource call ::comphelper::NamedValueCollection aDocumentLoadArgs( getArgs() ); if ( aDocumentLoadArgs.getOrDefault( "ViewOnly", false ) ) diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 79af216f05..d5504d5bb4 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -493,9 +493,28 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo } // -------------------------------------------------------------------------------------------------------------------- -sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, ::comphelper::NamedValueCollection& io_rDescriptor ) +::comphelper::NamedValueCollection SfxFrameLoader_Impl::impl_extractViewCreationArgs( ::comphelper::NamedValueCollection& io_rDescriptor ) { - sal_Int16 nViewId = io_rDescriptor.getOrDefault( "ViewId", sal_Int16( 0 ) ); + const sal_Char* pKnownViewArgs[] = { + "JumpMark" + }; + + ::comphelper::NamedValueCollection aViewArgs; + for ( size_t i=0; i < sizeof( pKnownViewArgs ) / sizeof( pKnownViewArgs[0] ); ++i ) + { + if ( io_rDescriptor.has( pKnownViewArgs[i] ) ) + { + aViewArgs.put( pKnownViewArgs[i], io_rDescriptor.get( pKnownViewArgs[i] ) ); + io_rDescriptor.remove( pKnownViewArgs[i] ); + } + } + return aViewArgs; +} + +// -------------------------------------------------------------------------------------------------------------------- +sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) +{ + sal_Int16 nViewId = i_rDescriptor.getOrDefault( "ViewId", sal_Int16( 0 ) ); try { if ( nViewId == 0 ) do @@ -524,7 +543,7 @@ sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxO SfxViewFactory* pViewFactory = i_rDocument.GetFactory().GetViewFactoryByViewName( sViewId ); if ( pViewFactory ) - io_rDescriptor.put( "ViewId", sal_Int16( pViewFactory->GetOrdinal() ) ); + nViewId = sal_Int16( pViewFactory->GetOrdinal() ); } while ( false ); } @@ -668,9 +687,14 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 ); const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() ); + // extract view releant arguments from the loader args + ::comphelper::NamedValueCollection aViewCreationArgs( impl_extractViewCreationArgs( aDescriptor ) ); + // TODO: this should probably be done before the content of aDescriptor is actually passed to the + // XModel, i.e. before its load/initNew is called. + // plug the document into the frame Reference< XController2 > xController = SfxViewFrame::LoadDocument_Impl( - *xDoc, pTargetFrame->GetFrameInterface(), Sequence< PropertyValue >(), sViewName ); + *xDoc, pTargetFrame->GetFrameInterface(), aViewCreationArgs.getPropertyValues(), sViewName ); ENSURE_OR_THROW( xController.is(), "invalid controller" ); // this is expected to throw in case of a failure ... diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 5be1e8e31c..67c8a3df34 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -130,6 +130,11 @@ using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::Exception; +using ::com::sun::star::frame::XFrame; +using ::com::sun::star::frame::XFrameActionListener; +using ::com::sun::star::util::XCloseListener; +using ::com::sun::star::task::XStatusIndicator; +using ::com::sun::star::frame::XTitle; namespace css = ::com::sun::star; struct GroupIDToCommandGroup @@ -448,18 +453,19 @@ void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::notifyClosing( const E struct IMPL_SfxBaseController_DataContainer { - REFERENCE < XFRAME > m_xFrame; - REFERENCE < XFRAMEACTIONLISTENER > m_xListener ; - REFERENCE < XCLOSELISTENER > m_xCloseListener ; + Reference< XFrame > m_xFrame ; + Reference< XFrameActionListener > m_xListener ; + Reference< XCloseListener > m_xCloseListener ; ::sfx2::UserInputInterception m_aUserInputInterception; OMULTITYPEINTERFACECONTAINERHELPER m_aListenerContainer ; - OINTERFACECONTAINERHELPER m_aInterceptorContainer ; - REFERENCE < ::com::sun::star::task::XStatusIndicator > m_xIndicator; + OINTERFACECONTAINERHELPER m_aInterceptorContainer ; + Reference< XStatusIndicator > m_xIndicator ; SfxViewShell* m_pViewShell ; SfxBaseController* m_pController ; sal_Bool m_bDisposing ; - sal_Bool m_bSuspendState; - css::uno::Reference< css::frame::XTitle > m_xTitleHelper; + sal_Bool m_bSuspendState ; + Reference< XTitle > m_xTitleHelper ; + Sequence< PropertyValue > m_aCreationArgs ; IMPL_SfxBaseController_DataContainer( MUTEX& aMutex , SfxViewShell* pViewShell , @@ -560,7 +566,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run if ( !m_pData->m_pViewShell ) throw DisposedException(); - return Reference< XWindow >( GetViewFrame_Impl()->GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY_THROW ); + return Reference< XWindow >( GetViewFrame_Impl().GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY_THROW ); } ::rtl::OUString SAL_CALL SfxBaseController::getViewControllerName() throw (RuntimeException) @@ -570,7 +576,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run throw DisposedException(); const SfxObjectFactory& rDocFac( m_pData->m_pViewShell->GetObjectShell()->GetFactory() ); - sal_uInt16 nViewNo = rDocFac.GetViewNo_Impl( GetViewFrame_Impl()->GetCurViewId(), rDocFac.GetViewFactoryCount() ); + sal_uInt16 nViewNo = rDocFac.GetViewNo_Impl( GetViewFrame_Impl().GetCurViewId(), rDocFac.GetViewFactoryCount() ); OSL_ENSURE( nViewNo < rDocFac.GetViewFactoryCount(), "SfxBaseController::getViewControllerName: view ID not found in view factories!" ); ::rtl::OUString sViewName; @@ -580,12 +586,27 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run return sViewName; } -SfxViewFrame* SfxBaseController::GetViewFrame_Impl() const +Sequence< PropertyValue > SAL_CALL SfxBaseController::getCreationArguments() throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() ) + throw DisposedException(); + + return m_pData->m_aCreationArgs; +} + +void SfxBaseController::SetCreationArguments_Impl( const Sequence< PropertyValue >& i_rCreationArgs ) +{ + OSL_ENSURE( m_pData->m_aCreationArgs.getLength() == 0, "SfxBaseController::SetCreationArguments_Impl: not intended to be called twice!" ); + m_pData->m_aCreationArgs = i_rCreationArgs; +} + +SfxViewFrame& SfxBaseController::GetViewFrame_Impl() const { ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" ); SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame(); ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" ); - return pActFrame; + return *pActFrame; } //________________________________________________________________________________________________________ @@ -1360,7 +1381,8 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) pViewFrame->Resize( TRUE ); // if there's a JumpMark given, then, well, jump to it - const ::rtl::OUString sJumpMark = aDocumentArgs.getOrDefault( "JumpMark", ::rtl::OUString() ); + ::comphelper::NamedValueCollection aViewArgs( getCreationArguments() ); + const ::rtl::OUString sJumpMark = aViewArgs.getOrDefault( "JumpMark", ::rtl::OUString() ); const bool bHasJumpMark = ( sJumpMark.getLength() > 0 ); OSL_ENSURE( ( !m_pData->m_pViewShell->GetObjectShell()->IsLoading() ) || ( !sJumpMark.getLength() ), diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 0c75cf4f16..23ee7f381e 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2010,6 +2010,11 @@ Reference < XController > SfxViewShell::GetController() return pImp->pController; } +SfxBaseController* SfxViewShell::GetBaseController_Impl() const +{ + return pImp->pController; +} + void SfxViewShell::AddContextMenuInterceptor_Impl( const REFERENCE< XCONTEXTMENUINTERCEPTOR >& xInterceptor ) { pImp->aInterceptorContainer.addInterface( xInterceptor ); -- cgit v1.2.3 From faf64ce0ed864f3d0052c89d1f7e2cab6b2eef9e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Dec 2009 13:10:00 +0100 Subject: autorecovery: allowed the SFX doc loader to in-place replace a view in an existing frame This was previously done in SfxViewFrame::LoadNewSfxView_Impl. Now, the loader recognizes if a model is to be loaded into a frame with an existing view to the same model, and properly handles this (passing a PreviousViewController argument to the view factory). LoadNewSfxView_Impl died in this course (the remaining few lines have been outline). --- sfx2/inc/sfx2/viewfrm.hxx | 17 ++----- sfx2/source/doc/sfxbasemodel.cxx | 4 +- sfx2/source/view/frmload.cxx | 95 +++++++++++++++++++++++++--------------- sfx2/source/view/viewfrm.cxx | 62 ++++++++++++-------------- 4 files changed, 94 insertions(+), 84 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index cf6f07e57b..247cb6066a 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -320,18 +320,9 @@ private: SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); - /** loads a new view of our document into our frame - - This method completely bypasses the UNO loader mechanism, it exchanges the current view on SFX level. Use - it for quick inplace view switches only. - */ - SAL_DLLPRIVATE SfxViewShell* LoadNewSfxView_Impl( const ::rtl::OUString& i_rViewName, SfxViewShell* i_pOldShell ); - /** loads the given existing document into the given frame - This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked. Don't - use this method if you want to plug the document into the frame on SFX level only. In such a case, use - LoadNewSfxView_Impl instead. + This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked. @param i_rDoc the document to load @@ -346,7 +337,7 @@ private: @throws Exception if something goes wrong. The caller is responsible for handling this. */ - SAL_DLLPRIVATE static void LoadViewIntoFrame_Impl( + SAL_DLLPRIVATE static SfxViewShell* LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rLoadArgs, @@ -356,9 +347,7 @@ private: /** loads the given existing document into the given frame - This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked. Don't - use this method if you want to plug the document into the frame on SFX level only. In such a case, use - LoadNewSfxView_Impl instead. + This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked. If no frame is given, a blank top level frame is created. diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 3fd931a0b4..8e3747771e 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4004,12 +4004,12 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie // determine previous shell (used in some special cases) ::comphelper::NamedValueCollection aCreationArgs( i_rArguments ); - Reference< XController > xPreviousController = aCreationArgs.getOrDefault( "PreviousView", Reference< XController >() ); + Reference< XController > xPreviousController = aCreationArgs.getOrDefault( "PreviousViewController", Reference< XController >() ); SfxViewShell* pOldViewShell = SfxViewShell::Get( xPreviousController ); OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell != NULL ), "SfxBaseModel::createViewController: invalid old controller!" ); // now that we used that arg, remove it, so the controller will not remember it below - aCreationArgs.remove( "PreviousView" ); + aCreationArgs.remove( "PreviousViewController" ); // determine the ViewFrame belonging to the given XFrame SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame ); diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index d5504d5bb4..a0d6a55908 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -47,6 +47,7 @@ #include "sfx2/sfxsids.hrc" #include "sfx2/sfxuno.hxx" #include "sfx2/viewfrm.hxx" +#include "sfx2/viewsh.hxx" /** === begin UNO includes === **/ #include @@ -104,6 +105,7 @@ using ::com::sun::star::util::XCloseable; using ::com::sun::star::document::XViewDataSupplier; using ::com::sun::star::container::XIndexAccess; using ::com::sun::star::frame::XController2; +using ::com::sun::star::frame::XController; /** === end UNO using === **/ SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< XMultiServiceFactory >& _rxFactory ) @@ -580,21 +582,25 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // then closing the first view/frame. aDescriptor.put( "Frame", _rTargetFrame ); + // did the caller already pass a model? + Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); + const bool bExternalModel = xModel.is(); + // check for factory URLs to create a new doc, instead of loading one const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() ); const bool bIsFactoryURL = ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 ); bool bInitNewModel = bIsFactoryURL; - if ( bIsFactoryURL ) + if ( bIsFactoryURL && !bExternalModel ) { const ::rtl::OUString sFactory = sURL.copy( sizeof( "private:factory/" ) -1 ); // special handling for some weird factory URLs a la private:factory/swriter?slot=21053 - USHORT nSlotParam = impl_findSlotParam( sFactory ); + const USHORT nSlotParam = impl_findSlotParam( sFactory ); if ( nSlotParam != 0 ) { return impl_createNewDocWithSlotParam( nSlotParam, _rTargetFrame ); } - bool bDescribesValidTemplate = impl_determineTemplateDocument( aDescriptor ); + const bool bDescribesValidTemplate = impl_determineTemplateDocument( aDescriptor ); if ( bDescribesValidTemplate ) { // if the media descriptor allowed us to determine a template document to create the new document @@ -614,14 +620,16 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA aDescriptor.put( "FileName", aDescriptor.get( "URL" ) ); } - // did the caller already pass a model? - Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); - const bool bExternalModel = xModel.is(); - sal_Bool bLoadSuccess = sal_False; SfxFrameWeak wFrame; try { + // extract view releant arguments from the loader args + ::comphelper::NamedValueCollection aViewCreationArgs( impl_extractViewCreationArgs( aDescriptor ) ); + + // it's allowed to to an "in-place replace" of a view/controller in a frame + Reference< XController > xReplacedViewController; + // no model passed from outside? => create one from scratch if ( !xModel.is() ) { @@ -632,11 +640,11 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } // create the new doc - ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); + const ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() ); xModel.set( m_aContext.createComponent( sServiceName ), UNO_QUERY_THROW ); // load resp. init it - Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW ); + const Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW ); if ( bInitNewModel ) { xLoadable->initNew(); @@ -651,20 +659,36 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } else { + // if the existent model is to be loaded into a frame where already another view to the same model + // exists, then preserve this info for the view factory + Reference< XController > xPreviousController( _rTargetFrame->getController() ); + if ( ( xPreviousController.is() ) + && ( xModel == xPreviousController->getModel() ) + ) + { + aViewCreationArgs.put( "PreviousViewController", xPreviousController ); + xReplacedViewController = xPreviousController; + } + // tell the doc its (current) load args. + impl_removeLoaderArguments( aDescriptor ); xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() ); - - // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could - // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs) - // with the ones passed to the loader here. For instance, what about the MacroExecutionMode? The document - // might have a mode other than the one passed to the loader, and we always overwrite the former with - // the latter. + // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could + // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs) + // with the ones passed to the loader here. For instance, what about the MacroExecutionMode? The document + // might have a mode other than the one passed to the loader, and we always overwrite the former with + // the latter. } // get the SfxObjectShell (still needed at the moment) - SfxObjectShellLock xDoc = impl_findObjectShell( xModel ); + const SfxObjectShellLock xDoc = impl_findObjectShell( xModel ); ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" ); + // ensure the ID of the to-be-created view is in the descriptor, if possible + const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); + const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 ); + const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() ); + // if the document is created hidden, prevent it from being deleted until it is shown or disposed impl_lockHiddenDocument( *xDoc, aDescriptor ); // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef, @@ -675,25 +699,26 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // code at the very end of this method cares for closing the XModel, which should also close the // ObjectShell. - // create a frame - SfxFrame* pTargetFrame = impl_getOrCreateEmptySfxFrame( _rTargetFrame ); - wFrame = pTargetFrame; - - // prepare it - pTargetFrame->PrepareForDoc_Impl( *xDoc, aDescriptor ); - - // ensure the ID of the to-be-created view is in the descriptor, if possible - const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); - const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 ); - const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() ); + // obtain/create a frame + SfxFrame* pTargetFrame = NULL; + if ( xReplacedViewController.is() ) + { + SfxViewFrame* pReplacedViewFrame = SfxViewFrame::GetFirst( xDoc, false ); + ENSURE_OR_THROW( pReplacedViewFrame, "replacing a non-SFX view of a SFX-document should is impossible" ); + pTargetFrame = pReplacedViewFrame->GetFrame(); + ENSURE_OR_THROW( pTargetFrame, "invalid existing view - could not obtain an SfxFrame" ); + } + else + { + pTargetFrame = impl_getOrCreateEmptySfxFrame( _rTargetFrame ); + wFrame = pTargetFrame; - // extract view releant arguments from the loader args - ::comphelper::NamedValueCollection aViewCreationArgs( impl_extractViewCreationArgs( aDescriptor ) ); - // TODO: this should probably be done before the content of aDescriptor is actually passed to the - // XModel, i.e. before its load/initNew is called. + // prepare it + pTargetFrame->PrepareForDoc_Impl( *xDoc, aDescriptor ); + } // plug the document into the frame - Reference< XController2 > xController = SfxViewFrame::LoadDocument_Impl( + const Reference< XController2 > xController = SfxViewFrame::LoadDocument_Impl( *xDoc, pTargetFrame->GetFrameInterface(), aViewCreationArgs.getPropertyValues(), sViewName ); ENSURE_OR_THROW( xController.is(), "invalid controller" ); // this is expected to throw in case of a failure ... @@ -701,7 +726,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA if ( !bExternalModel ) { pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); - String sDocumentURL = xDoc->GetMedium()->GetName(); + const String sDocumentURL = xDoc->GetMedium()->GetName(); if ( sDocumentURL.Len() ) SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) ); } @@ -710,7 +735,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } catch ( Exception& ) { - Any aError( ::cppu::getCaughtException() ); + const Any aError( ::cppu::getCaughtException() ); if ( !aDescriptor.getOrDefault( "Silent", sal_False ) ) impl_handleCaughtError_nothrow( aError, aDescriptor ); } @@ -723,7 +748,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA { try { - Reference< XCloseable > xCloseable( xModel, UNO_QUERY_THROW ); + const Reference< XCloseable > xCloseable( xModel, UNO_QUERY_THROW ); xCloseable->close( sal_True ); } catch ( Exception& ) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 6de00d48eb..66e9355c9a 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2042,7 +2042,7 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell Reference< XFrame > xFrame( i_rFrame ); bool bOwnFrame = false; - bool bSuccess = false; + SfxViewShell* pSuccessView = NULL; try { if ( !xFrame.is() ) @@ -2053,8 +2053,13 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell bOwnFrame = true; } - LoadViewIntoFrame_Impl( i_rDoc, xFrame, Sequence< PropertyValue >(), i_nViewId, i_bHidden ); - bSuccess = true; + pSuccessView = LoadViewIntoFrame_Impl( + i_rDoc, + xFrame, + Sequence< PropertyValue >(), // means "reuse existing model's args" + i_nViewId, + i_bHidden + ); if ( bOwnFrame && !i_bHidden ) { @@ -2068,8 +2073,8 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell DBG_UNHANDLED_EXCEPTION(); } - if ( bSuccess ) - return SfxViewFrame::Get( xFrame->getController(), &i_rDoc ); + if ( pSuccessView ) + return pSuccessView->GetViewFrame(); if ( bOwnFrame ) { @@ -2087,7 +2092,7 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell } //-------------------------------------------------------------------- -void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, +SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const Sequence< PropertyValue >& i_rLoadArgs, const USHORT i_nViewId, const bool i_bHidden ) { @@ -2099,6 +2104,8 @@ void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const R aTransformLoadArgs.put( "ViewId", sal_Int16( i_nViewId ) ); if ( i_bHidden ) aTransformLoadArgs.put( "Hidden", i_bHidden ); + else + aTransformLoadArgs.remove( "Hidden" ); ::rtl::OUString sURL( xDocument->getURL() ); if ( !sURL.getLength() ) @@ -2107,27 +2114,10 @@ void SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const R Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0, aTransformLoadArgs.getPropertyValues() ); -} - -//-------------------------------------------------------------------- -SfxViewShell* SfxViewFrame::LoadNewSfxView_Impl( const ::rtl::OUString& i_rViewName , SfxViewShell* i_pOldShell ) -{ - ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" ); - OSL_PRECOND( GetViewShell() == NULL, "SfxViewFrame::LoadNewSfxView_Impl: not allowed to be called with an exsiting view shell!" ); - - ::comphelper::NamedValueCollection aViewCreationArgs; - if ( i_pOldShell != NULL ) - aViewCreationArgs.put( "PreviousView", i_pOldShell->GetController() ); - const Reference< XController2 > xController = LoadDocument_Impl( - *GetObjectShell(), - GetFrame()->GetFrameInterface(), - aViewCreationArgs.getPropertyValues(), - i_rViewName - ); - - SfxViewShell* pViewShell = SfxViewShell::Get( xController.get() ); - ENSURE_OR_THROW( pViewShell, "invalid controller returned by view factory" ); + SfxViewShell* pViewShell = SfxViewShell::Get( i_rFrame->getController() ); + ENSURE_OR_THROW( pViewShell, + "SfxViewFrame::LoadViewIntoFrame_Impl: loading an SFX doc into a frame resulted in a non-SFX view - quite impossible" ); return pViewShell; } @@ -2239,6 +2229,8 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl { try { + ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" ); + // if we already have a view shell, remove it SfxViewShell* pOldSh = GetViewShell(); OSL_PRECOND( pOldSh, "SfxViewFrame::SwitchToViewShell_Impl: that's called *switch* (not for *initial-load*) for a reason" ); @@ -2251,19 +2243,23 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl // remove sub shells from Dispatcher before switching to new ViewShell PopShellAndSubShells_Impl( *pOldSh ); - - // reset view shell, that's a precondition for the LoadNewSfxView_Impl below - SetViewShell_Impl( NULL ); } GetBindings().ENTERREGISTRATIONS(); LockAdjustPosSizePixel(); - // create and load new ViewShell + // ID of the new view SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory(); - const sal_Int16 nViewNo = ( bIsIndex || !nViewIdOrNo ) ? nViewIdOrNo : rDocFact.GetViewNo_Impl( nViewIdOrNo, 0 ); - const ::rtl::OUString sViewName( rDocFact.GetViewFactory( nViewNo ).GetViewName() ); - SfxViewShell* pNewSh = LoadNewSfxView_Impl( sViewName, pOldSh ); + const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; + + // create and load new ViewShell + SfxViewShell* pNewSh = LoadViewIntoFrame_Impl( + *GetObjectShell(), + GetFrame()->GetFrameInterface(), + Sequence< PropertyValue >(), // means "reuse existing model's args" + nViewId, + false + ); // allow resize events to be processed UnlockAdjustPosSizePixel(); -- cgit v1.2.3 From 2df3e46edeb2f97e9f259476b135c5290bcb17a7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Dec 2009 13:49:14 +0100 Subject: autorecovery: moved SfxViewFrame::LoadDocument_Impl to SfxFrameLoader_Impl::impl_createDocumentView --- sfx2/inc/frmload.hxx | 12 +++++++++++- sfx2/inc/sfx2/viewfrm.hxx | 7 ------- sfx2/source/view/frmload.cxx | 31 +++++++++++++++++++++++++++---- sfx2/source/view/viewfrm.cxx | 25 ------------------------- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 3179959d16..90b9bc09cf 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -37,6 +37,8 @@ /** === begin UNO includes === **/ #include #include +#include +#include #include #include #include @@ -119,7 +121,7 @@ private: ) const; SfxObjectShellLock impl_findObjectShell( - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_rxDocument + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rxDocument ) const; void impl_lockHiddenDocument( @@ -149,6 +151,14 @@ private: impl_extractViewCreationArgs( ::comphelper::NamedValueCollection& io_rDescriptor ); + + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > + impl_createDocumentView( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rModel, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, + const ::comphelper::NamedValueCollection& i_rViewFactoryArgs, + const ::rtl::OUString& i_rViewName + ); }; #endif diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 247cb6066a..1e8c8fd30a 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -307,13 +307,6 @@ public: SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); SAL_DLLPRIVATE void SetCurViewId_Impl( const USHORT i_nID ); - SAL_DLLPRIVATE static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > - LoadDocument_Impl( - const SfxObjectShell& i_rDoc, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rViewFactoryArgs, - const ::rtl::OUString& i_rViewName - ); //#endif private: diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index a0d6a55908..d6f3ded262 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -106,6 +106,7 @@ using ::com::sun::star::document::XViewDataSupplier; using ::com::sun::star::container::XIndexAccess; using ::com::sun::star::frame::XController2; using ::com::sun::star::frame::XController; +using ::com::sun::star::frame::XModel2; /** === end UNO using === **/ SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< XMultiServiceFactory >& _rxFactory ) @@ -364,7 +365,7 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti } // -------------------------------------------------------------------------------------------------------------------- -SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel >& i_rxDocument ) const +SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const { for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) { @@ -559,6 +560,28 @@ sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxO return nViewId; } +// -------------------------------------------------------------------------------------------------------------------- +Reference< XController2 > SfxFrameLoader_Impl::impl_createDocumentView( const Reference< XModel2 >& i_rModel, + const Reference< XFrame >& i_rFrame, const ::comphelper::NamedValueCollection& i_rViewFactoryArgs, + const ::rtl::OUString& i_rViewName ) +{ + // let the model create a new controller + const Reference< XController2 > xController( i_rModel->createViewController( + i_rViewName, + i_rViewFactoryArgs.getPropertyValues(), + i_rFrame + ), UNO_SET_THROW ); + + // introduce model/view/controller to each other + xController->attachModel( i_rModel.get() ); + i_rModel->connectController( xController.get() ); + i_rFrame->setComponent( xController->getComponentWindow(), xController.get() ); + xController->attachFrame( i_rFrame ); + i_rModel->setCurrentController( xController.get() ); + + return xController; +} + // -------------------------------------------------------------------------------------------------------------------- sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rArgs, const Reference< XFrame >& _rTargetFrame ) @@ -583,7 +606,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA aDescriptor.put( "Frame", _rTargetFrame ); // did the caller already pass a model? - Reference< XModel > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel >() ); + Reference< XModel2 > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel2 >() ); const bool bExternalModel = xModel.is(); // check for factory URLs to create a new doc, instead of loading one @@ -718,8 +741,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } // plug the document into the frame - const Reference< XController2 > xController = SfxViewFrame::LoadDocument_Impl( - *xDoc, pTargetFrame->GetFrameInterface(), aViewCreationArgs.getPropertyValues(), sViewName ); + const Reference< XController2 > xController = impl_createDocumentView( xModel, pTargetFrame->GetFrameInterface(), + aViewCreationArgs, sViewName ); ENSURE_OR_THROW( xController.is(), "invalid controller" ); // this is expected to throw in case of a failure ... diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 66e9355c9a..02589258e1 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2007,31 +2007,6 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const return pViewFrame; } -//-------------------------------------------------------------------- -Reference< XController2 > SfxViewFrame::LoadDocument_Impl( - const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const Sequence< PropertyValue >& i_rViewFactoryArgs, - const ::rtl::OUString& i_rViewName ) -{ - ENSURE_OR_THROW( i_rFrame.is(), "illegal frame" ); - const Reference < XModel2 > xModel( i_rDoc.GetModel(), UNO_QUERY_THROW ); - - // let the model create a new controller - const Reference< XController2 > xController( xModel->createViewController( - i_rViewName, - i_rViewFactoryArgs, - i_rFrame - ), UNO_SET_THROW ); - - // introduce model/view/controller to each other - xController->attachModel( xModel.get() ); - xModel->connectController( xController.get() ); - i_rFrame->setComponent( xController->getComponentWindow(), xController.get() ); - xController->attachFrame( i_rFrame ); - xModel->setCurrentController( xController.get() ); - - return xController; -} - //-------------------------------------------------------------------- SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const USHORT i_nViewId, const bool i_bHidden ) -- cgit v1.2.3 From bd2348d26d4243084e3375a85f2e4e5fa8109d66 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 11 Dec 2009 18:16:26 +0100 Subject: chart43: #i107575# avoid assertion 'ImageAryData::Failed to load image' while activating a chart --- officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu index cc40843f4d..7c59065095 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu @@ -529,7 +529,7 @@ Select Chart Element - 1 + 0 -- cgit v1.2.3 From a811ce952de224ddb68c2a36667896831b3a33f6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Dec 2009 21:51:06 +0100 Subject: autorecovery: moved more SFX-dependent code from frame loader's ::load to proper place in SfxBaseModel/Controller --- sfx2/inc/sfx2/frame.hxx | 2 +- sfx2/source/doc/sfxbasemodel.cxx | 91 +++++++++++++++++++++++++++++----------- sfx2/source/view/frame.cxx | 4 +- sfx2/source/view/frame2.cxx | 8 ++-- sfx2/source/view/frmload.cxx | 43 +------------------ 5 files changed, 75 insertions(+), 73 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 84aa3090bf..a5b8d81ff2 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -219,7 +219,7 @@ public: SAL_DLLPRIVATE void GrabFocusOnComponent_Impl(); SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool ); - SAL_DLLPRIVATE void PrepareForDoc_Impl( SfxObjectShell& i_rDoc, const ::comphelper::NamedValueCollection& i_rArgs ); + SAL_DLLPRIVATE void PrepareForDoc_Impl( SfxObjectShell& i_rDoc ); SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock ); SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn ); SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 8e3747771e..7eba0e5b12 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1157,12 +1157,26 @@ void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XCon if ( impl_isDisposed() ) throw lang::DisposedException(); + OSL_PRECOND( xController.is(), "SfxBaseModel::connectController: invalid controller!" ); + if ( !xController.is() ) + return; + sal_uInt32 nOldCount = m_pData->m_seqControllers.getLength(); uno::Sequence< uno::Reference< frame::XController > > aNewSeq( nOldCount + 1 ); for ( sal_uInt32 n = 0; n < nOldCount; n++ ) aNewSeq.getArray()[n] = m_pData->m_seqControllers.getConstArray()[n]; aNewSeq.getArray()[nOldCount] = xController; m_pData->m_seqControllers = aNewSeq; + + if ( m_pData->m_seqControllers.getLength() == 1 ) + { + SfxViewFrame* pViewFrame = SfxViewFrame::Get( xController, GetObjectShell() ); + ENSURE_OR_THROW( pViewFrame, "SFX document without SFX view!?" ); + pViewFrame->UpdateDocument_Impl(); + const String sDocumentURL = GetObjectShell()->GetMedium()->GetName(); + if ( sDocumentURL.Len() ) + SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) ); + } } //________________________________________________________________________________________________________ @@ -3942,8 +3956,16 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef css::lang::IllegalArgumentException, css::uno::Exception ) { - return createViewController( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "view0" ) ), Sequence< PropertyValue >(), i_rFrame ); - // TODO: extend the SfxViewFactory with support for speaking view names + ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); + if ( impl_isDisposed() ) + throw lang::DisposedException(); + + const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); + const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName(); + + aGuard.clear(); + + return createViewController( sDefaultViewName, Sequence< PropertyValue >(), i_rFrame ); } //============================================================================= @@ -3960,27 +3982,37 @@ SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const ::com::sun::star:: } if ( !pViewFrame ) { - // no view frame, yet, but perhaps a mere frame? - SfxFrame* pFrame = NULL; - for ( pFrame = SfxFrame::GetFirst(); - pFrame; - pFrame = SfxFrame::GetNext( *pFrame ) - ) + #if OSL_DEBUG_LEVEL > 0 + for ( SfxFrame* pCheckFrame = SfxFrame::GetFirst(); + pCheckFrame; + pCheckFrame = SfxFrame::GetNext( *pCheckFrame ) + ) { - if ( ( pFrame->GetFrameInterface() == i_rFrame ) - && ( pFrame->GetCurrentViewFrame() == NULL ) - // TODO: this condition is somewhat hacky, as it relies on the fact that this is (usually) - // the SfxFrame which is, up the stack, within its InsertDocument_Impl call. - // Before the refactoring is finally done, this is to be removed. - ) + if ( pCheckFrame->GetFrameInterface() == i_rFrame ) + { + if ( ( pCheckFrame->GetCurrentViewFrame() != NULL ) + || ( pCheckFrame->GetCurrentDocument() != NULL ) + ) + // Note that it is perfectly letgitimate that during loading into an XFrame which already contains + // a document, there exist two SfxFrame instances bound to this XFrame - the old one, which will be + // destroyed later, and the new one, which we're going to create + continue; + + OSL_ENSURE( false, "SfxBaseModel::FindOrCreateViewFrame_Impl: there already is an SfxFrame for the given XFrame, but no view in it!" ); + // nowadays, we're the only instance allowed to create an SfxFrame for an XFrame, so this case here should not happen break; + } } - if ( !pFrame ) - { - pFrame = SfxFrame::Create( i_rFrame ); - ENSURE_OR_THROW( pFrame, "no SfxFrame created for the XFrame" ); - } - pViewFrame = new SfxViewFrame( pFrame, GetObjectShell() ); + #endif + + SfxFrame* pTargetFrame = SfxFrame::Create( i_rFrame ); + ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + + // prepare it + pTargetFrame->PrepareForDoc_Impl( *GetObjectShell() ); + + // create view frame + pViewFrame = new SfxViewFrame( pTargetFrame, GetObjectShell() ); } return pViewFrame; } @@ -3997,23 +4029,32 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie if ( impl_isDisposed() ) throw lang::DisposedException(); + if ( !i_rFrame.is() ) + throw css::lang::IllegalArgumentException( ::rtl::OUString(), *this, 3 ); + // find the proper SFX view factory SfxViewFactory* pViewFactory = GetObjectShell()->GetFactory().GetViewFactoryByViewName( i_rViewName ); if ( !pViewFactory ) throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); // determine previous shell (used in some special cases) - ::comphelper::NamedValueCollection aCreationArgs( i_rArguments ); - Reference< XController > xPreviousController = aCreationArgs.getOrDefault( "PreviousViewController", Reference< XController >() ); + Reference< XController > xPreviousController( i_rFrame->getController() ); + const Reference< XModel > xMe( this ); + if ( ( xPreviousController.is() ) + && ( xMe != xPreviousController->getModel() ) + ) + { + xPreviousController.clear(); + } SfxViewShell* pOldViewShell = SfxViewShell::Get( xPreviousController ); OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell != NULL ), "SfxBaseModel::createViewController: invalid old controller!" ); - // now that we used that arg, remove it, so the controller will not remember it below - aCreationArgs.remove( "PreviousViewController" ); // determine the ViewFrame belonging to the given XFrame SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame ); OSL_POSTCOND( pViewFrame, "SfxBaseModel::createViewController: no frame?" ); + // TODO: if we created the SfxFrame, and something of the below goes wrong, then we need to properly close the + // Sfx(View)Frame // delegate to SFX' view factory pViewFrame->GetBindings().ENTERREGISTRATIONS(); @@ -4035,7 +4076,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie // pass the creation arguments to the controller SfxBaseController* pBaseController = pViewShell->GetBaseController_Impl(); ENSURE_OR_THROW( pBaseController, "invalid controller implementation!" ); - pBaseController->SetCreationArguments_Impl( aCreationArgs.getPropertyValues() ); + pBaseController->SetCreationArguments_Impl( i_rArguments ); // some initial view settings, coming from our most recent attachResource call ::comphelper::NamedValueCollection aDocumentLoadArgs( getArgs() ); diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 2ee95ed768..daeefe3264 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -375,7 +375,7 @@ void SfxFrame::SetFrameType_Impl( sal_uInt32 n ) void SfxFrame::GetViewData_Impl() { // Alle zwischen Laden und Entfernen "anderbaren Daten aktualisieren; die - // festen Daten werden nur einmal ( nach InsertDocument_Impl in UpdateDescriptor ) + // festen Daten werden nur einmal ( nach PrepareForDoc_Impl in UpdateDescriptor ) // geholt, um Zeit zu sparen. SfxViewFrame* pViewFrame = GetCurrentViewFrame(); if( pViewFrame && pViewFrame->GetViewShell() ) @@ -412,7 +412,7 @@ void SfxFrame::GetViewData_Impl() void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) { - // Beim InsertDocument_Impl wird der Descriptor des Frames aktualisiert + // Beim PrepareForDoc_Impl wird der Descriptor des Frames aktualisiert // und sein ItemSet neu initialisiert. Alle Daten, die f"ur ein sp"ateres // Restaurieren der View n"otig sind, sind damit festgehalten. // Soll das Dokument ersetzt werden, wird durch GetViewData_Impl (s.o.) diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 7093fb7392..7e71e3a48c 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -465,17 +465,19 @@ void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const } } -void SfxFrame::PrepareForDoc_Impl( SfxObjectShell& i_rDoc, const ::comphelper::NamedValueCollection& i_rArgs ) +void SfxFrame::PrepareForDoc_Impl( SfxObjectShell& i_rDoc ) { + const ::comphelper::NamedValueCollection aDocumentArgs( i_rDoc.GetModel()->getArgs() ); + // hidden? OSL_ENSURE( !pImp->bHidden, "when does this happen?" ); - pImp->bHidden = i_rArgs.getOrDefault( "Hidden", pImp->bHidden ); + pImp->bHidden = aDocumentArgs.getOrDefault( "Hidden", pImp->bHidden ); // update our descriptor UpdateDescriptor( &i_rDoc ); // plugin mode - sal_Int16 nPluginMode = i_rArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) ); + sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) ); if ( nPluginMode && ( nPluginMode != 2 ) ) SetInPlace_Impl( TRUE ); } diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index d6f3ded262..eec98261e7 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -644,15 +644,11 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } sal_Bool bLoadSuccess = sal_False; - SfxFrameWeak wFrame; try { // extract view releant arguments from the loader args ::comphelper::NamedValueCollection aViewCreationArgs( impl_extractViewCreationArgs( aDescriptor ) ); - // it's allowed to to an "in-place replace" of a view/controller in a frame - Reference< XController > xReplacedViewController; - // no model passed from outside? => create one from scratch if ( !xModel.is() ) { @@ -684,14 +680,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA { // if the existent model is to be loaded into a frame where already another view to the same model // exists, then preserve this info for the view factory - Reference< XController > xPreviousController( _rTargetFrame->getController() ); - if ( ( xPreviousController.is() ) - && ( xModel == xPreviousController->getModel() ) - ) - { - aViewCreationArgs.put( "PreviousViewController", xPreviousController ); - xReplacedViewController = xPreviousController; - } // tell the doc its (current) load args. impl_removeLoaderArguments( aDescriptor ); @@ -722,38 +710,12 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // code at the very end of this method cares for closing the XModel, which should also close the // ObjectShell. - // obtain/create a frame - SfxFrame* pTargetFrame = NULL; - if ( xReplacedViewController.is() ) - { - SfxViewFrame* pReplacedViewFrame = SfxViewFrame::GetFirst( xDoc, false ); - ENSURE_OR_THROW( pReplacedViewFrame, "replacing a non-SFX view of a SFX-document should is impossible" ); - pTargetFrame = pReplacedViewFrame->GetFrame(); - ENSURE_OR_THROW( pTargetFrame, "invalid existing view - could not obtain an SfxFrame" ); - } - else - { - pTargetFrame = impl_getOrCreateEmptySfxFrame( _rTargetFrame ); - wFrame = pTargetFrame; - - // prepare it - pTargetFrame->PrepareForDoc_Impl( *xDoc, aDescriptor ); - } - // plug the document into the frame - const Reference< XController2 > xController = impl_createDocumentView( xModel, pTargetFrame->GetFrameInterface(), + const Reference< XController2 > xController = impl_createDocumentView( xModel, _rTargetFrame, aViewCreationArgs, sViewName ); ENSURE_OR_THROW( xController.is(), "invalid controller" ); // this is expected to throw in case of a failure ... - if ( !bExternalModel ) - { - pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); - const String sDocumentURL = xDoc->GetMedium()->GetName(); - if ( sDocumentURL.Len() ) - SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) ); - } - bLoadSuccess = sal_True; } catch ( Exception& ) @@ -763,9 +725,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA impl_handleCaughtError_nothrow( aError, aDescriptor ); } - // clean up, if necessary - impl_cleanUp( bLoadSuccess, wFrame ); - // if loading was not successful, also close the document (the SfxFrame was already closed by impl_cleanUp) if ( !bLoadSuccess && !bExternalModel ) { -- cgit v1.2.3 From 544e9391f09ec87c6fc82917fb1a60c59b717cbc Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Dec 2009 22:07:36 +0100 Subject: autorecovery: SfxBaseModel::createViewController: ensure the created SfxFrame (if any) is closed in case of a failure --- sfx2/inc/sfx2/sfxbasemodel.hxx | 8 ++++- sfx2/source/doc/sfxbasemodel.cxx | 64 ++++++++++++++++++++++++++++++++++++---- sfx2/source/view/frmload.cxx | 11 ++----- 3 files changed, 68 insertions(+), 15 deletions(-) diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index 2694865e2f..8b2dd1b17f 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -203,6 +203,9 @@ class SfxEventHint; class SfxViewFrame; struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of class SfxBaseModel +namespace sfx { namespace intern { + class ViewCreationGuard; +} } //________________________________________________________________________________________________________ // class declarations //________________________________________________________________________________________________________ @@ -1522,7 +1525,10 @@ private: SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper (); SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper (); - SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ) const; + SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, + ::sfx::intern::ViewCreationGuard& i_rGuard + ) const; //________________________________________________________________________________________________________ // private variables and methods diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 7eba0e5b12..2fca3774b0 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3969,7 +3969,55 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef } //============================================================================= -SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ) const +namespace sfx { namespace intern { + + /** a class which, in its dtor, cleans up variuos objects (well, at the moment only the frame) collected during + the creation of a document view, unless the creation was successful. + */ + class SAL_DLLPRIVATE ViewCreationGuard + { + public: + ViewCreationGuard() + :m_bSuccess( false ) + { + } + + ~ViewCreationGuard() + { + if ( !m_bSuccess ) + impl_closeAll(); + } + + void takeFrameOwnership( SfxFrame* i_pFrame ) + { + OSL_PRECOND( !m_aWeakFrame, "ViewCreationGuard::takeFrameOwnership: already have a frame!" ); + OSL_PRECOND( i_pFrame != NULL, "ViewCreationGuard::takeFrameOwnership: invalid frame!" ); + m_aWeakFrame = i_pFrame; + } + + void releaseAll() + { + m_bSuccess = true; + } + + private: + void impl_closeAll() + { + if ( m_aWeakFrame && !m_aWeakFrame->GetCurrentDocument() ) + { + m_aWeakFrame->SetFrameInterface_Impl( NULL ); + m_aWeakFrame->DoClose(); + } + } + + private: + bool m_bSuccess; + SfxFrameWeak m_aWeakFrame; + }; +} } + +//============================================================================= +SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const Reference< XFrame >& i_rFrame, ::sfx::intern::ViewCreationGuard& i_rGuard ) const { SfxViewFrame* pViewFrame = NULL; for ( pViewFrame = SfxViewFrame::GetFirst( GetObjectShell(), FALSE ); @@ -4007,6 +4055,7 @@ SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const ::com::sun::star:: SfxFrame* pTargetFrame = SfxFrame::Create( i_rFrame ); ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" ); + i_rGuard.takeFrameOwnership( pTargetFrame ); // prepare it pTargetFrame->PrepareForDoc_Impl( *GetObjectShell() ); @@ -4050,11 +4099,12 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell != NULL ), "SfxBaseModel::createViewController: invalid old controller!" ); + // a guard which will clean up in case of failure + ::sfx::intern::ViewCreationGuard aViewCreationGuard; + // determine the ViewFrame belonging to the given XFrame - SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame ); + SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame, aViewCreationGuard ); OSL_POSTCOND( pViewFrame, "SfxBaseModel::createViewController: no frame?" ); - // TODO: if we created the SfxFrame, and something of the below goes wrong, then we need to properly close the - // Sfx(View)Frame // delegate to SFX' view factory pViewFrame->GetBindings().ENTERREGISTRATIONS(); @@ -4098,7 +4148,11 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); } - return Reference< XController2 >( pViewShell->GetController(), UNO_QUERY_THROW ); + // tell the guard we were successful + aViewCreationGuard.releaseAll(); + + // outta gere + return pBaseController; } //============================================================================= diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index eec98261e7..1a69b5e68e 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -678,9 +678,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA } else { - // if the existent model is to be loaded into a frame where already another view to the same model - // exists, then preserve this info for the view factory - // tell the doc its (current) load args. impl_removeLoaderArguments( aDescriptor ); xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() ); @@ -711,11 +708,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // ObjectShell. // plug the document into the frame - const Reference< XController2 > xController = impl_createDocumentView( xModel, _rTargetFrame, - aViewCreationArgs, sViewName ); - ENSURE_OR_THROW( xController.is(), "invalid controller" ); - // this is expected to throw in case of a failure ... - + impl_createDocumentView( xModel, _rTargetFrame, aViewCreationArgs, sViewName ); bLoadSuccess = sal_True; } catch ( Exception& ) @@ -725,7 +718,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA impl_handleCaughtError_nothrow( aError, aDescriptor ); } - // if loading was not successful, also close the document (the SfxFrame was already closed by impl_cleanUp) + // if loading was not successful, close the document if ( !bLoadSuccess && !bExternalModel ) { try -- cgit v1.2.3 From 196183e204a771e749ab9075d1e6ea5d61b2a73e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Dec 2009 20:50:32 +0100 Subject: dba33b: #i10000# --- sfx2/source/doc/docfac.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 7679b72f7a..c0ef80aebb 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -335,7 +335,6 @@ sal_uInt16 SfxObjectFactory::GetViewNo_Impl( const sal_uInt16 i_nViewId, const s SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rViewName ) const { - SfxViewFactory* pViewFactory = NULL; for ( USHORT nViewNo = 0; nViewNo < GetViewFactoryCount(); ++nViewNo -- cgit v1.2.3 From 29b7b7711860ed520f7a49c0f3f19afc92a0a1cf Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 14 Dec 2009 12:55:05 +0100 Subject: autorecovery: replace some SfxFrameItem occurences by SfxUnoFrameItem As a consequence, replace some occurences of SfxFrame with XFrame. This allows getting rid of yet some more Sfx code in the (SFX) doc loader. Also, it prevents premature creations of SfxFrame instances during loading, since now the frame is really created when it is needed only. --- sfx2/inc/frmload.hxx | 9 -------- sfx2/inc/sfx2/frame.hxx | 22 ++++++++++++++++-- sfx2/inc/sfx2/viewfrm.hxx | 3 ++- sfx2/sdi/sfx.sdi | 10 ++++---- sfx2/sdi/sfxslots.sdi | 1 + sfx2/source/appl/appopen.cxx | 48 ++++++++++++++++++++++++++------------- sfx2/source/appl/appserv.cxx | 15 +++++++----- sfx2/source/appl/appuno.cxx | 22 ++++++++++++++---- sfx2/source/control/unoctitm.cxx | 2 +- sfx2/source/doc/objmisc.cxx | 8 +++---- sfx2/source/view/frame.cxx | 47 ++++++++++++++++++++++++++++++-------- sfx2/source/view/frmload.cxx | 49 ++-------------------------------------- sfx2/source/view/viewfrm.cxx | 20 ++++++++-------- 13 files changed, 141 insertions(+), 115 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 90b9bc09cf..768d0a1a4b 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -107,11 +107,6 @@ private: ::comphelper::NamedValueCollection& io_rDescriptor ) const; - sal_Bool impl_cleanUp( - const sal_Bool i_bSuccess, - const SfxFrameWeak& i_wFrame - ) const; - bool impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const; @@ -134,10 +129,6 @@ private: const ::comphelper::NamedValueCollection& i_rDescriptor ) const; - SfxFrame* impl_getOrCreateEmptySfxFrame( - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame - ) const; - void impl_removeLoaderArguments( ::comphelper::NamedValueCollection& io_rDescriptor ); diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index a5b8d81ff2..e051384e6e 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -157,7 +157,8 @@ public: static SfxFrame* GetFirst(); static SfxFrame* GetNext( SfxFrame& ); - const SfxPoolItem* LoadDocumentSynchron( SfxItemSet& aSet ); + static const SfxPoolItem* + OpenDocumentSynchron( SfxItemSet& aSet, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rTargetFrame ); SfxBroadcaster& GetBroadcaster() const; SfxObjectShell* GetCurrentDocument() const; @@ -286,7 +287,24 @@ public: ::com::sun::star::uno::Any GetValue() const { return aValue; } virtual int operator==( const SfxPoolItem& ) const; - virtual String GetValueText() const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); +}; + +class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem +{ + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + m_xFrame; + +public: + TYPEINFO(); + SfxUnoFrameItem(); + SfxUnoFrameItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ); + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& + GetFrame() const + { return m_xFrame; } + virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 1e8c8fd30a..39fccb29f6 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -168,8 +168,9 @@ public: static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); - static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId = 0 ); static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); + static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxUnoFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); + static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrameItem, const USHORT i_nViewId = 0 ); static SfxViewFrame* Current(); static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 7caf442758..aefed0f9e0 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -8038,7 +8038,7 @@ SfxVoidItem AutoPilotAddressDataSource SID_ADDRESS_DATA_SOURCE //-------------------------------------------------------------------------- SfxVoidItem InsertBusinessCard FN_BUSINESS_CARD -( SfxFrameItem Frame SID_DOCFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME ) [ /* flags: */ AutoUpdate = FALSE, @@ -8063,7 +8063,7 @@ SfxVoidItem InsertBusinessCard FN_BUSINESS_CARD //-------------------------------------------------------------------------- SfxVoidItem InsertLabels FN_LABEL -( SfxFrameItem Frame SID_DOCFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME ) [ /* flags: */ AutoUpdate = FALSE, @@ -8088,7 +8088,7 @@ SfxVoidItem InsertLabels FN_LABEL //-------------------------------------------------------------------------- SfxVoidItem NewXForms FN_XFORMS_INIT -( SfxFrameItem Frame SID_DOCFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME ) [ /* flags: */ AutoUpdate = FALSE, @@ -8113,7 +8113,7 @@ SfxVoidItem NewXForms FN_XFORMS_INIT //-------------------------------------------------------------------------- SfxVoidItem AutoPilotPresentations SID_SD_AUTOPILOT -( SfxFrameItem Frame SID_DOCFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME ) [ /* flags: */ AutoUpdate = FALSE, @@ -8138,7 +8138,7 @@ SfxVoidItem AutoPilotPresentations SID_SD_AUTOPILOT //-------------------------------------------------------------------------- SfxVoidItem NewPresentation SID_NEWSD -( SfxFrameItem Frame SID_DOCFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME ) [ /* flags: */ AutoUpdate = FALSE, diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi index 7da283228f..70b2a52340 100644 --- a/sfx2/sdi/sfxslots.sdi +++ b/sfx2/sdi/sfxslots.sdi @@ -59,6 +59,7 @@ TypeLibFile( "sfxslots.tlb" ) item String SfxFrameItem; //! Dummy item String SfxObjectShellItem //! Dummy item String SfxUsrAnyItem //! Dummy + item String SfxUnoFrameItem //! Dummy item String SvxClipboardFmtItem; //! Dummy struct Point diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index a2c3e09e19..9ad9545d15 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -1120,12 +1120,22 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) return; } - SFX_REQUEST_ARG(rReq, pFrmItem, SfxFrameItem, SID_DOCFRAME, FALSE); - SfxFrame *pFrame = NULL; - if ( pFrmItem ) - pFrame = pFrmItem->GetFrame(); - else if ( SfxViewFrame::Current() ) - pFrame = SfxViewFrame::Current()->GetFrame(); + SfxFrame* pTargetFrame = NULL; + Reference< XFrame > xTargetFrame; + + SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME, FALSE); + if ( pFrameItem ) + pTargetFrame = pFrameItem->GetFrame(); + + if ( !pTargetFrame ) + { + SFX_REQUEST_ARG(rReq, pUnoFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE); + if ( pUnoFrameItem ) + xTargetFrame = pUnoFrameItem->GetFrame(); + } + + if ( !pTargetFrame && !xTargetFrame.is() && SfxViewFrame::Current() ) + pTargetFrame = SfxViewFrame::Current()->GetFrame(); // check if caller has set a callback SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK, FALSE ); @@ -1202,18 +1212,24 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // { // if a frame is given, it must be used for the starting point of the targetting mechanism // this code is also used if asynchronous loading is possible, because loadComponent always is synchron - Reference < XFrame > xFrame; - if ( pFrame ) - xFrame = pFrame->GetFrameInterface(); - else - xFrame = Reference < XFrame >( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY ); + if ( !xTargetFrame.is() ) + { + if ( pTargetFrame ) + { + xTargetFrame = pTargetFrame->GetFrameInterface(); + } + else + { + xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY ); + } + } // make URL ready SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME, FALSE ); aFileName = pURLItem->GetValue(); if( aFileName.Len() && aFileName.GetChar(0) == '#' ) // Mark without URL { - SfxViewFrame *pView = pFrame ? pFrame->GetCurrentViewFrame() : 0; + SfxViewFrame *pView = pTargetFrame ? pTargetFrame->GetCurrentViewFrame() : 0; if ( !pView ) pView = SfxViewFrame::Current(); pView->GetViewShell()->JumpToMark( aFileName.Copy(1) ); @@ -1231,13 +1247,13 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // if loading must be done synchron, we must wait for completion to get a return value // find frame by myself; I must konw the exact frame to get the controller for the return value from it //if( aTarget.getLength() ) - // xFrame = xFrame->findFrame( aTarget, FrameSearchFlag::ALL ); + // xTargetFrame = xTargetFrame->findFrame( aTarget, FrameSearchFlag::ALL ); Reference < XComponent > xComp; try { - xComp = ::comphelper::SynchronousDispatch::dispatch( xFrame, aFileName, aTarget, 0, aArgs ); -// Reference < XComponentLoader > xLoader( xFrame, UNO_QUERY ); + xComp = ::comphelper::SynchronousDispatch::dispatch( xTargetFrame, aFileName, aTarget, 0, aArgs ); +// Reference < XComponentLoader > xLoader( xTargetFrame, UNO_QUERY ); // xComp = xLoader->loadComponentFromURL( aFileName, aTarget, 0, aArgs ); } catch(const RuntimeException&) @@ -1262,7 +1278,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); xTrans->parseStrict( aURL ); - Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); + Reference < XDispatchProvider > xProv( xTargetFrame, UNO_QUERY ); Reference < XDispatch > xDisp = xProv.is() ? xProv->queryDispatch( aURL, aTarget, FrameSearchFlag::ALL ) : Reference < XDispatch >();; RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, "PERFORMANCE - SfxApplication::OpenDocExec_Impl" ); if ( xDisp.is() ) diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 0eb45cd795..f45bec473d 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -266,9 +266,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Reference< XFrame > xFrame; const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl(); - SFX_ITEMSET_ARG( pIntSet, pFrame, SfxUnoAnyItem, SID_FILLFRAME, FALSE ); - if (pFrame) - pFrame->GetValue() >>= xFrame; + SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE ); + if ( pFrameItem ) + xFrame = pFrameItem->GetFrame(); SfxAbstractTabDialog* pDlg = pFact->CreateTabDialog( RID_SVXDLG_CUSTOMIZE, @@ -895,7 +895,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) const SfxPoolItem* pItem = NULL; Reference < XFrame > xFrame; if ( pArgs && pArgs->GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET ) - ( (SfxUnoAnyItem*)pItem )->GetValue() >>= xFrame; + { + OSL_ENSURE( pItem->ISA( SfxUnoFrameItem ), "SfxApplication::OfaExec_Impl: XFrames are to be transported via SfxUnoFrameItem by now!" ); + xFrame = static_cast< const SfxUnoFrameItem*>( pItem )->GetFrame(); + } SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if ( pFact ) { @@ -1063,9 +1066,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) Reference< XFrame > xFrame; const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl(); - SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, FALSE ); + SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE ); if ( pFrameItem ) - pFrameItem->GetValue() >>= xFrame; + xFrame = pFrameItem->GetFrame(); if ( !xFrame.is() ) { diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 1c61ee0423..e608da1069 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -470,7 +470,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n]; String aName = rProp.Name; if ( aName == sFrame ) - rSet.Put( SfxUnoAnyItem( SID_FILLFRAME, rProp.Value ) ); + { + Reference< XFrame > xFrame; + OSL_VERIFY( rProp.Value >>= xFrame ); + rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrame ) ); + } else if ( aName == sHidden ) { @@ -562,11 +566,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque } else if ( aName == sFrame ) { - Reference< XFrame > xVal; - sal_Bool bOK = (rProp.Value >>= xVal); + Reference< XFrame > xFrame; + sal_Bool bOK = (rProp.Value >>= xFrame); DBG_ASSERT( bOK, "invalid type for Frame" ); if (bOK) - rSet.Put( SfxUnoAnyItem( SID_FILLFRAME, rProp.Value ) ); + rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrame ) ); } else if ( aName == sAsTemplate ) { @@ -1380,7 +1384,15 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( rSet.GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = sFrame; - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + if ( pItem->ISA( SfxUsrAnyItem ) ) + { + OSL_ENSURE( false, "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" ); + pValue[nActProp++].Value = static_cast< const SfxUsrAnyItem* >( pItem )->GetValue(); + } + else if ( pItem->ISA( SfxUnoFrameItem ) ) + pValue[nActProp++].Value <<= static_cast< const SfxUnoFrameItem* >( pItem )->GetFrame(); + else + OSL_ENSURE( false, "TransformItems: invalid item type for SID_FILLFRAME!" ); } if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET ) { diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 11e9fd3d77..6580ddb1fe 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -759,7 +759,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util } SfxAllItemSet aInternalSet( SFX_APP()->GetPool() ); if (xFrameRef.is()) // an empty set is no problem ... but an empty frame reference can be a problem ! - aInternalSet.Put( SfxUnoAnyItem( SID_FILLFRAME, css::uno::makeAny(xFrameRef) ) ); + aInternalSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrameRef ) ); sal_Bool bSuccess = sal_False; sal_Bool bFailure = sal_False; diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 05af1b6205..e41352d54e 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -2137,13 +2137,11 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium ) { Window* pWindow = 0; SfxItemSet* pSet = pLoadingMedium ? pLoadingMedium->GetItemSet() : GetMedium()->GetItemSet(); - SFX_ITEMSET_ARG( pSet, pUnoItem, SfxUnoAnyItem, SID_FILLFRAME, FALSE ); + SFX_ITEMSET_ARG( pSet, pUnoItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE ); if ( pUnoItem ) { - uno::Reference < frame::XFrame > xFrame; - pUnoItem->GetValue() >>= xFrame; - if ( xFrame.is() ) - pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); + uno::Reference < frame::XFrame > xFrame( pUnoItem->GetFrame() ); + pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); } if ( !pWindow ) diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index daeefe3264..cb58131b6a 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -103,6 +103,7 @@ using namespace ::com::sun::star::container; TYPEINIT1(SfxFrame, SfxListener); TYPEINIT1_AUTOFACTORY(SfxFrameItem, SfxPoolItem); TYPEINIT1(SfxUsrAnyItem, SfxPoolItem); +TYPEINIT1_AUTOFACTORY(SfxUnoFrameItem, SfxPoolItem); SvCompatWeakHdl* SfxFrame::GetHdl() { @@ -640,11 +641,6 @@ int SfxUsrAnyItem::operator==( const SfxPoolItem& /*rItem*/ ) const return sal_False; } -String SfxUsrAnyItem::GetValueText() const -{ - return String(); -} - SfxPoolItem* SfxUsrAnyItem::Clone( SfxItemPool *) const { return new SfxUsrAnyItem( Which(), aValue ); @@ -662,6 +658,39 @@ sal_Bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*n return sal_True; } +SfxUnoFrameItem::SfxUnoFrameItem() + : SfxPoolItem() + , m_xFrame() +{ +} + +SfxUnoFrameItem::SfxUnoFrameItem( sal_uInt16 nWhichId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ) + : SfxPoolItem( nWhichId ) + , m_xFrame( i_rFrame ) +{ +} + +int SfxUnoFrameItem::operator==( const SfxPoolItem& i_rItem ) const +{ + return i_rItem.ISA( SfxUnoFrameItem ) && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame; +} + +SfxPoolItem* SfxUnoFrameItem::Clone( SfxItemPool* ) const +{ + return new SfxUnoFrameItem( Which(), m_xFrame ); +} + +sal_Bool SfxUnoFrameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +{ + rVal <<= m_xFrame; + return sal_True; +} + +sal_Bool SfxUnoFrameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) +{ + return ( rVal >>= m_xFrame ); +} + SfxFrameIterator::SfxFrameIterator( const SfxFrame& rFrame, sal_Bool bRecur ) : pFrame( &rFrame ) , bRecursive( bRecur ) @@ -959,10 +988,10 @@ SfxFrame* SfxFrame::GetNext( SfxFrame& rFrame ) return NULL; } -const SfxPoolItem* SfxFrame::LoadDocumentSynchron( SfxItemSet& aSet ) +const SfxPoolItem* SfxFrame::OpenDocumentSynchron( SfxItemSet& i_rSet, const Reference< XFrame >& i_rTargetFrame ) { - aSet.Put( SfxFrameItem( SID_DOCFRAME, this ) ); - aSet.ClearItem( SID_TARGETNAME ); - return SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, aSet ); + i_rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, i_rTargetFrame ) ); + i_rSet.ClearItem( SID_TARGETNAME ); + return SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, i_rSet ); } diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 1a69b5e68e..8466eacb02 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -255,45 +255,12 @@ namespace } } -// -------------------------------------------------------------------------------------------------------------------- -SfxFrame* SfxFrameLoader_Impl::impl_getOrCreateEmptySfxFrame( const Reference< XFrame >& i_rFrame ) const -{ - for ( SfxFrame* pFrame = SfxFrame::GetFirst(); - pFrame; - pFrame = SfxFrame::GetNext( *pFrame ) - ) - { - if ( pFrame->GetFrameInterface() == i_rFrame ) - { - if ( ( pFrame->GetCurrentViewFrame() != NULL ) - || ( pFrame->GetCurrentDocument() != NULL ) - ) - // an empty SfxFrame was requested, so we can't use this instance. - // Note that it is perfectly letgitimate that during loading into an XFrame which already contains - // a document, there exist two SfxFrame instances bound to this XFrame - the old one, which will be - // destroyed later, and the new one, which we're going to create - continue; - - return pFrame; - } - } - - SfxFrame* pFrame = SfxFrame::Create( i_rFrame ); - ENSURE_OR_THROW( pFrame, "could not create an SfxFrame" ); - return pFrame; -} - // -------------------------------------------------------------------------------------------------------------------- sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, const Reference< XFrame >& i_rxFrame ) { - SfxFrame* pTargetFrame = impl_getOrCreateEmptySfxFrame( i_rxFrame ); - SfxFrameWeak wFrame = pTargetFrame; - SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() ); - aRequest.AppendItem( SfxFrameItem ( SID_DOCFRAME, pTargetFrame ) ); - - sal_Bool bSuccess = lcl_getDispatchResult( SFX_APP()->ExecuteSlot( aRequest ) ); - return impl_cleanUp( bSuccess, wFrame ); + aRequest.AppendItem( SfxUnoFrameItem( SID_FILLFRAME, i_rxFrame ) ); + return lcl_getDispatchResult( SFX_APP()->ExecuteSlot( aRequest ) ); } // -------------------------------------------------------------------------------------------------------------------- @@ -379,18 +346,6 @@ SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< X return NULL; } -// -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_cleanUp( const sal_Bool i_bSuccess, const SfxFrameWeak& i_wFrame ) const -{ - if ( !i_bSuccess && i_wFrame && !i_wFrame->GetCurrentDocument() ) - { - i_wFrame->SetFrameInterface_Impl( NULL ); - i_wFrame->DoClose(); - } - - return i_bSuccess; -} - // -------------------------------------------------------------------------------------------------------------------- bool SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 02589258e1..ffba132e13 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2112,20 +2112,22 @@ SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const USHORT i //-------------------------------------------------------------------- -SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrame* i_pTargetFrame, const USHORT i_nViewId ) +SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rTargetFrame, const USHORT i_nViewId ) { - Reference< XFrame > xFrame; - if ( i_pTargetFrame ) - xFrame = i_pTargetFrame->GetFrameInterface(); - - return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, xFrame, i_nViewId, false ); + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_rTargetFrame, i_nViewId, false ); } //-------------------------------------------------------------------- SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId ) { - return LoadDocumentIntoFrame( i_rDoc, i_pFrameItem ? i_pFrameItem->GetFrame() : NULL, i_nViewId ); + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_pFrameItem && i_pFrameItem->GetFrame() ? i_pFrameItem->GetFrame()->GetFrameInterface() : NULL, i_nViewId, false ); +} + +//-------------------------------------------------------------------- +SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxUnoFrameItem* i_pFrameItem, const USHORT i_nViewId ) +{ + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_pFrameItem ? i_pFrameItem->GetFrame() : NULL, i_nViewId, false ); } //-------------------------------------------------------------------- @@ -2386,9 +2388,9 @@ void SfxViewFrame::ExecView_Impl Reference < XFrame > xFrame; // the frame (optional arg. TODO: this is currently not supported in the slot definition ...) - SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, sal_False ); + SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False ); if ( pFrameItem ) - pFrameItem->GetValue() >>= xFrame; + xFrame = pFrameItem->GetFrame(); LoadViewIntoFrame_Impl_NoThrow( *GetObjectShell(), xFrame, nViewId, false ); -- cgit v1.2.3 From cdf3da7ea96bab41481b80f64ec747a16212a23e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 14 Dec 2009 22:14:39 +0100 Subject: dba33e: #i107678# don't clone the source form when creating an forms environment, this nowadays (correctly) also copies all children --- svx/source/form/fmobj.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 9dbcbec8a4..3dba031b97 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -519,7 +519,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > while (nCurrentSourceIndex <= nIndex) { sal_Bool bEqualDSS = sal_False; - while (!bEqualDSS) // (we don't have to check nCurrentSourceIndex here : it's bounded by nIndex) + while (!bEqualDSS) // (we don't have to check nCurrentSourceIndex here : it's bound by nIndex) { xSourceContainer->getByIndex(nCurrentSourceIndex) >>= xCurrentSourceForm; DBG_ASSERT(xCurrentSourceForm.is(), "FmFormObj::ensureModelEnv : invalid form ancestor (2) !"); @@ -581,12 +581,11 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > // correct this ... try { - Reference< XPersistObject > xSourcePersist(xCurrentSourceForm, UNO_QUERY); - DBG_ASSERT(xSourcePersist.is(), "FmFormObj::ensureModelEnv : invalid form (no persist object) !"); - - // create and insert (into the destination) a clone of the form - Reference< XCloneable > xCloneable( xSourcePersist, UNO_QUERY_THROW ); - xCurrentDestForm.set( xCloneable->createClone(), UNO_QUERY_THROW ); + // create and insert (into the destination) a copy of the form + xCurrentDestForm.set( + ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.form.component.DataForm" ) ), + UNO_QUERY_THROW ); + ::comphelper::copyProperties( xCurrentSourceForm, xCurrentDestForm ); DBG_ASSERT(nCurrentDestIndex == xDestContainer->getCount(), "FmFormObj::ensureModelEnv : something went wrong with the numbers !"); xDestContainer->insertByIndex(nCurrentDestIndex, makeAny(xCurrentDestForm)); @@ -604,7 +603,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > } } - // now xCurrentDestForm is a form aequivalent to xSourceForm (which means they have the same DSS and the same number + // now xCurrentDestForm is a form equivalent to xSourceForm (which means they have the same DSS and the same number // of left siblings with the same DSS, which counts for all their ancestors, too) // go down -- cgit v1.2.3 From d56d052f7835c07b594c74f72ce47e8fc4462f39 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Dec 2009 10:31:37 +0100 Subject: autorecovery: SetDontCreateCancellable is dead --- sfx2/inc/sfx2/docfile.hxx | 1 - sfx2/source/doc/docfile.cxx | 7 ------- svx/source/svxlink/fileobj.cxx | 2 -- 3 files changed, 10 deletions(-) diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index 49a71c4ad7..eefea1e502 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -226,7 +226,6 @@ public: void SetUsesCache( sal_Bool ); sal_Bool IsExpired() const; void SetName( const String& rName, sal_Bool bSetOrigURL = sal_False ); - void SetDontCreateCancellable(); sal_Bool IsAllowedForExternalBrowser() const; long GetFileVersion() const; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 9b6f3f15f6..e0679ea842 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3083,13 +3083,6 @@ sal_Bool SfxMedium::IsDownloadDone_Impl() return pImp->bDownloadDone; } -//---------------------------------------------------------------- - -void SfxMedium::SetDontCreateCancellable( ) -{ - OSL_ENSURE( false, "SfxMedium::SetDontCreateCancellable: dead code!" ); -} - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SfxMedium::GetInputStream() { if ( !pImp->xInputStream.is() ) diff --git a/svx/source/svxlink/fileobj.cxx b/svx/source/svxlink/fileobj.cxx index ea1d1b7043..6b84bed65a 100644 --- a/svx/source/svxlink/fileobj.cxx +++ b/svx/source/svxlink/fileobj.cxx @@ -299,8 +299,6 @@ BOOL SvFileObject::LoadFile_Impl() aStreamToLoadFrom.m_xInputStreamToLoadFrom, aStreamToLoadFrom.m_bIsReadOnly); // setStreamToLoadFrom(0,0); - // Keinen Eintrag im Roter Button Menu - xMed->SetDontCreateCancellable(); if( sReferer.Len() ) xMed->SetReferer( sReferer ); -- cgit v1.2.3 From ec2e4641809e938a8a4ead64cd3732d709e43fdf Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Dec 2009 23:07:57 +0100 Subject: autorecovery: SfxViewFrame's SfxFrame is a reference now, no pointer (it can never be NULL) --- sfx2/inc/sfx2/viewfrm.hxx | 13 ++- sfx2/source/appl/app.cxx | 10 +-- sfx2/source/appl/appchild.cxx | 4 +- sfx2/source/appl/appopen.cxx | 4 +- sfx2/source/appl/appserv.cxx | 7 +- sfx2/source/appl/workwin.cxx | 4 +- sfx2/source/control/bindings.cxx | 16 ++-- sfx2/source/control/dispatch.cxx | 52 ++++++------ sfx2/source/control/request.cxx | 2 +- sfx2/source/control/statcach.cxx | 2 +- sfx2/source/control/unoctitm.cxx | 10 +-- sfx2/source/dialog/basedlgs.cxx | 4 +- sfx2/source/dialog/dockwin.cxx | 4 +- sfx2/source/dialog/partwnd.cxx | 2 +- sfx2/source/dialog/tabdlg.cxx | 2 +- sfx2/source/doc/objmisc.cxx | 12 +-- sfx2/source/doc/objserv.cxx | 25 +++--- sfx2/source/doc/objxtor.cxx | 6 +- sfx2/source/doc/sfxbasemodel.cxx | 67 ++++++++-------- sfx2/source/menu/mnuitem.cxx | 2 +- sfx2/source/menu/virtmenu.cxx | 10 +-- sfx2/source/notify/eventsupplier.cxx | 2 +- sfx2/source/view/frame.cxx | 8 +- sfx2/source/view/impviewframe.hxx | 8 +- sfx2/source/view/ipclient.cxx | 6 +- sfx2/source/view/prnmon.cxx | 2 +- sfx2/source/view/sfxbasecontroller.cxx | 50 ++++++------ sfx2/source/view/viewfrm.cxx | 142 ++++++++++++++++----------------- sfx2/source/view/viewfrm2.cxx | 8 +- sfx2/source/view/viewsh.cxx | 24 +++--- svx/source/cui/cfg.cxx | 2 +- svx/source/cui/hlmailtp.cxx | 2 +- svx/source/dialog/hyprlink.cxx | 2 +- svx/source/dialog/rubydialog.cxx | 2 +- svx/source/editeng/svxacorr.cxx | 5 +- svx/source/form/datanavi.cxx | 2 +- svx/source/form/fmPropBrw.cxx | 38 ++++----- svx/source/form/fmshimp.cxx | 5 +- svx/source/tbxctrls/tbxcolor.cxx | 2 +- 39 files changed, 277 insertions(+), 291 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 39fccb29f6..dbbad619d0 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -159,7 +159,7 @@ protected: virtual ~SfxViewFrame(); public: - SfxViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc = NULL ); + SfxViewFrame( SfxFrame& rFrame, SfxObjectShell *pDoc = NULL ); TYPEINFO(); SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM) @@ -238,18 +238,18 @@ public: virtual SfxObjectShell* GetObjectShell(); USHORT GetCurViewId() const; - SfxFrame* GetFrame() const; + SfxFrame& GetFrame() const; SfxViewFrame* GetTopViewFrame() const; BOOL DoClose(); ULONG GetFrameType() const - { return GetFrame()->GetFrameType(); } + { return GetFrame().GetFrameType(); } SfxFrame* GetTopFrame() const - { return GetFrame()->GetTopFrame(); } + { return GetFrame().GetTopFrame(); } void GetTargetList( TargetList& rList ) const - { GetFrame()->GetTargetList( rList ); } + { GetFrame().GetTargetList( rList ); } void CancelTransfers() - { GetFrame()->CancelTransfers(); } + { GetFrame().CancelTransfers(); } void SetModalMode( BOOL ); BOOL IsInModalMode() const; @@ -266,7 +266,6 @@ public: void ChildWindowState(SfxItemSet&); //#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE void SetFrame_Impl( SfxFrame* ); SAL_DLLPRIVATE void SetDowning_Impl(); SAL_DLLPRIVATE void GetDocNumber_Impl(); SAL_DLLPRIVATE BOOL IsDowning_Impl() const; diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 8e26f1dbd0..6412e81cf8 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -560,11 +560,11 @@ short SfxApplication::QuerySave_Impl( SfxObjectShell& rDoc, sal_Bool /*bAutoSave String aMsg( SfxResId( STR_ISMODIFIED ) ); aMsg.SearchAndReplaceAscii( "%1", rDoc.GetTitle() ); - SfxFrame *pFrame = SfxViewFrame::GetFirst(&rDoc)->GetFrame(); - pFrame->Appear(); + SfxFrame& rFrame = SfxViewFrame::GetFirst(&rDoc)->GetFrame(); + rFrame.Appear(); WinBits nBits = WB_YES_NO_CANCEL | WB_DEF_NO; - QueryBox aBox( &pFrame->GetWindow(), nBits, aMsg ); + QueryBox aBox( &rFrame.GetWindow(), nBits, aMsg ); return aBox.Execute(); } @@ -688,7 +688,7 @@ uno::Reference< task::XStatusIndicator > SfxApplication::GetStatusIndicator() co while ( pTop->GetParentViewFrame_Impl() ) pTop = pTop->GetParentViewFrame_Impl(); - return pTop->GetFrame()->GetWorkWindow_Impl()->GetStatusIndicator(); + return pTop->GetFrame().GetWorkWindow_Impl()->GetStatusIndicator(); } SfxTbxCtrlFactArr_Impl& SfxApplication::GetTbxCtrlFactories_Impl() const @@ -805,7 +805,7 @@ SfxApplication::ChooseScript() OSL_TRACE("create selector dialog"); const SfxViewFrame* pViewFrame = SfxViewFrame::Current(); - const SfxFrame* pFrame = pViewFrame ? pViewFrame->GetFrame() : NULL; + const SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetFrame() : NULL; uno::Reference< frame::XFrame > xFrame( pFrame ? pFrame->GetFrameInterface() : uno::Reference< frame::XFrame >() ); AbstractScriptSelectorDialog* pDlg = diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index dec26b4f0c..1b37cb1a25 100644 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -170,9 +170,9 @@ SfxTemplateDialog* SfxApplication::GetTemplateDialog() SfxWorkWindow* SfxApplication::GetWorkWindow_Impl(const SfxViewFrame *pFrame) const { if ( pFrame ) - return pFrame->GetFrame()->GetWorkWindow_Impl(); + return pFrame->GetFrame().GetWorkWindow_Impl(); else if ( pAppData_Impl->pViewFrame ) - return pAppData_Impl->pViewFrame->GetFrame()->GetWorkWindow_Impl(); + return pAppData_Impl->pViewFrame->GetFrame().GetWorkWindow_Impl(); else return NULL; } diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 9ad9545d15..a4cd3fc62e 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -1135,7 +1135,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } if ( !pTargetFrame && !xTargetFrame.is() && SfxViewFrame::Current() ) - pTargetFrame = SfxViewFrame::Current()->GetFrame(); + pTargetFrame = &SfxViewFrame::Current()->GetFrame(); // check if caller has set a callback SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK, FALSE ); @@ -1324,7 +1324,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { if ( pShell->GetController() == xController ) { - pCntrFrame = pShell->GetViewFrame()->GetFrame(); + pCntrFrame = &pShell->GetViewFrame()->GetFrame(); break; } } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index f45bec473d..8a0def2fd9 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -999,7 +999,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) } if ( pView ) - pView->GetFrame()->Appear(); + pView->GetFrame().Appear(); const SfxItemSet* pArgs = rReq.GetArgs(); if ( pArgs && pView ) @@ -1073,9 +1073,8 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if ( !xFrame.is() ) { const SfxViewFrame* pViewFrame = SfxViewFrame::Current(); - const SfxFrame* pFrame = pViewFrame ? pViewFrame->GetFrame() : NULL; - if ( pFrame ) - xFrame = pFrame->GetFrameInterface(); + if ( pViewFrame ) + xFrame = pViewFrame->GetFrame().GetFrameInterface(); } do // artificial loop for flow control diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 6cce817694..92f6be125c 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1434,8 +1434,8 @@ sal_Bool SfxWorkWindow::IsPluginMode( SfxObjectShell* pObjShell ) if ( pDispatcher ) { SfxViewFrame* pFrame = pDispatcher->GetFrame(); - if ( pFrame && pFrame->GetFrame() ) - xFrame = pFrame->GetFrame()->GetFrameInterface(); + if ( pFrame ) + xFrame = pFrame->GetFrame().GetFrameInterface(); } return xFrame; diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 5a525884e5..ac964e3468 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -722,7 +722,7 @@ void SfxBindings::InvalidateAll pImp->pCaches->GetObject(n)->Invalidate(bWithMsg); /* ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame - ( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY ); + ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); if ( bWithMsg && xFrame.is() ) xFrame->contextChanged(); @@ -1384,7 +1384,7 @@ void SfxBindings::UpdateSlotServer_Impl() if ( !nRegLevel ) { ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame - ( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY ); + ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); //if ( xFrame.is() ) // xFrame->contextChanged(); pImp->bContextChanged = FALSE; @@ -1923,7 +1923,7 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int pImp->bContextChanged = FALSE; /* ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame - ( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY ); + ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); if ( xFrame.is() ) xFrame->contextChanged();*/ } @@ -2030,7 +2030,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp ) ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > xProv; if ( pDisp ) xProv = ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > - ( pDisp->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY ); + ( pDisp->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); SetDispatchProvider_Impl( xProv ); InvalidateAll( sal_True ); @@ -2313,7 +2313,7 @@ void SfxBindings::SetActiveFrame( const ::com::sun::star::uno::Reference< ::com: SetDispatchProvider_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > ( rFrame, ::com::sun::star::uno::UNO_QUERY ) ); else SetDispatchProvider_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > ( - pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ) ); + pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ) ); } const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SfxBindings::GetActiveFrame() const @@ -2322,7 +2322,7 @@ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SfxBin if ( xFrame.is() || !pDispatcher ) return xFrame; else - return pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(); + return pDispatcher->GetFrame()->GetFrame().GetFrameInterface(); } void SfxBindings::SetDispatchProvider_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & rProv ) @@ -2350,7 +2350,7 @@ SystemWindow* SfxBindings::GetSystemWindow() const while ( pFrame->GetParentViewFrame_Impl() ) pFrame = pFrame->GetParentViewFrame_Impl(); SfxViewFrame* pTop = pFrame->GetTopViewFrame(); - return pTop->GetFrame()->GetTopWindow_Impl(); + return pTop->GetFrame().GetTopWindow_Impl(); } BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) @@ -2374,7 +2374,7 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) xServiceManager->createInstance(our_aModuleManagerName) , ::com::sun::star::uno::UNO_QUERY_THROW); ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame( - pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY_THROW); + pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY_THROW); sAppName = xModuleManager->identify(xFrame); } catch(::com::sun::star::uno::Exception&) {} Sequence source; diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 88806e4368..3744fd03fb 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -249,7 +249,7 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest { // ggf. Recording anwerfen com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( - GetFrame()->GetFrame()->GetFrameInterface(), + GetFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( @@ -298,7 +298,7 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest if ( !pView ) pView = SfxViewFrame::Current(); if ( pView ) - SfxHelp::OpenHelpAgent( pView->GetFrame(), rReq.GetSlot() ); + SfxHelp::OpenHelpAgent( &pView->GetFrame(), rReq.GetSlot() ); SfxExecFunc pFunc = rSlot.GetExecFnc(); rShell.CallExec( pFunc, rReq ); @@ -801,7 +801,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) if ( pBindings ) { pBindings->SetDispatcher(this); - pBindings->SetActiveFrame( pImp->pFrame->GetFrame()->GetFrameInterface() ); + pBindings->SetActiveFrame( pImp->pFrame->GetFrame().GetFrameInterface() ); } } else @@ -821,7 +821,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) if ( bMDI && pImp->pFrame ) { - //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl(); + //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); SfxBindings *pBind = GetBindings(); while ( pBind ) { @@ -829,7 +829,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) pBind = pBind->GetSubBindings_Impl(); } - pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->HidePopups_Impl( FALSE, FALSE, 1 ); + pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( FALSE, FALSE, 1 ); } if ( pImp->aToDoStack.Count() ) @@ -887,7 +887,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) if ( pImp->pFrame && !(pImp->pFrame->GetObjectShell()->IsInPlaceActive() ) ) { - SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); if ( pWorkWin ) { for (sal_uInt16 n=0; naChildWins.Count();) @@ -915,10 +915,10 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) if ( pNew && pImp->pFrame ) { com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xOldFrame( - pNew->GetFrame()->GetFrameInterface()->getCreator(), com::sun::star::uno::UNO_QUERY ); + pNew->GetFrame().GetFrameInterface()->getCreator(), com::sun::star::uno::UNO_QUERY ); com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xMyFrame( - GetFrame()->GetFrame()->GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); + GetFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); if ( xOldFrame == xMyFrame ) bHidePopups = FALSE; @@ -926,7 +926,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) if ( bHidePopups ) { - //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl(); + //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); SfxBindings *pBind = GetBindings(); while ( pBind ) { @@ -934,7 +934,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) pBind = pBind->GetSubBindings_Impl(); } - pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->HidePopups_Impl( TRUE, FALSE, 1 ); + pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( TRUE, FALSE, 1 ); } Flush(); @@ -1680,10 +1680,10 @@ void SfxDispatcher::SetMenu_Impl() SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame(); if ( pTop && pTop->GetBindings().GetDispatcher() == this ) { - SfxFrame* pFrm = pTop->GetFrame(); - if ( pFrm->IsMenuBarOn_Impl() ) + SfxFrame& rFrame = pTop->GetFrame(); + if ( rFrame.IsMenuBarOn_Impl() ) { - com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( pFrm->GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); + com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( rFrame.GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); if ( xPropSet.is() ) { com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; @@ -1716,7 +1716,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce ) sal_Bool bUpdate = bForce; while ( pDisp && pDisp->pImp->pFrame ) { - SfxWorkWindow *pWork = pDisp->pImp->pFrame->GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pWork = pDisp->pImp->pFrame->GetFrame().GetWorkWindow_Impl(); SfxDispatcher *pAct = pWork->GetBindings().GetDispatcher_Impl(); if ( pAct == pDisp || pAct == this ) { @@ -1730,7 +1730,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce ) pDisp = pDisp->pImp->pParent; } - if ( !bUpdate || pImp->pFrame->GetFrame()->IsClosing_Impl() ) + if ( !bUpdate || pImp->pFrame->GetFrame().IsClosing_Impl() ) return 0; SfxViewFrame* pTop = pImp->pFrame ? pImp->pFrame->GetTopViewFrame() : NULL; @@ -1767,14 +1767,14 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce ) if ( bUIActive && /* !bIsIPActive && */ ( !pClient || !pClient->IsObjectUIActive() ) ) SetMenu_Impl(); - SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); SfxWorkWindow *pTaskWin = pImp->pFrame->GetTopFrame()->GetWorkWindow_Impl(); pTaskWin->ResetStatusBar_Impl(); SfxDispatcher *pDispat = this; while ( pDispat ) { - SfxWorkWindow *pWork = pDispat->pImp->pFrame->GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pWork = pDispat->pImp->pFrame->GetFrame().GetWorkWindow_Impl(); SfxDispatcher *pAct = pWork->GetBindings().GetDispatcher_Impl(); if ( pAct == pDispat || pAct == this ) { @@ -1812,7 +1812,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, { sal_uInt32 nHelpId = 0; SFX_APP(); - SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); sal_Bool bIsActive = sal_False; sal_Bool bIsTaskActive = sal_False; SfxDispatcher *pActDispat = pWorkWin->GetBindings().GetDispatcher_Impl(); @@ -1974,7 +1974,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, { // internal frames also may control statusbar SfxBindings& rBindings = pImp->pFrame->GetBindings(); - pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->SetStatusBar_Impl( nStatBarId, pStatusBarShell, rBindings ); + pImp->pFrame->GetFrame().GetWorkWindow_Impl()->SetStatusBar_Impl( nStatBarId, pStatusBarShell, rBindings ); } } @@ -2251,7 +2251,7 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl sal_uInt16 nLevels = pImp->aStack.Count(); while ( pParent && pParent->pImp->pFrame ) { - if ( pParent->pImp->pFrame->GetFrame()->HasComponent() ) + if ( pParent->pImp->pFrame->GetFrame().HasComponent() ) { // Components d"urfen intercepten if ( pParent->_TryIntercept_Impl( nSlot, rServer, sal_True ) ) @@ -2745,7 +2745,7 @@ SfxPopupMenuManager* SfxDispatcher::Popup( sal_uInt16 nConfigId,Window *pWin, co nShLevel = rDisp.pImp->aStack.Count(); } - Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->GetWindow(); + Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow(); for ( pSh = rDisp.GetShell(nShLevel); pSh; ++nShLevel, pSh = rDisp.GetShell(nShLevel) ) { const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId(); @@ -2785,7 +2785,7 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin nShLevel = rDisp.pImp->aStack.Count(); } - Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->GetWindow(); + Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow(); for ( pSh = rDisp.GetShell(nShLevel); pSh; ++nShLevel, pSh = rDisp.GetShell(nShLevel) ) { const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId(); @@ -2808,7 +2808,7 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin //---------------------------------------------------------------------- void SfxDispatcher::ExecutePopup( const ResId &rId, Window *pWin, const Point *pPos ) { - Window *pWindow = pWin ? pWin : pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->GetWindow(); + Window *pWindow = pWin ? pWin : pImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow(); /* SfxPopupMenuManager aPop( rId, *GetBindings() ); aPop.AddClipboardFunctions(); @@ -2915,10 +2915,10 @@ void SfxDispatcher::HideUI( sal_Bool bHide ) SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame(); if ( pTop && pTop->GetBindings().GetDispatcher() == this ) { - SfxFrame* pFrm = pTop->GetFrame(); - if ( pFrm->IsMenuBarOn_Impl() ) + SfxFrame& rFrame = pTop->GetFrame(); + if ( rFrame.IsMenuBarOn_Impl() ) { - com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( pFrm->GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); + com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( rFrame.GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); if ( xPropSet.is() ) { com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 80de021867..0458439169 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -869,7 +869,7 @@ com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > SfxRe com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder; com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( - (pView ? pView : SfxViewFrame::Current())->GetFrame()->GetFrameInterface(), + (pView ? pView : SfxViewFrame::Current())->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); if(xSet.is()) diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index 795fb5e9be..9636d069c5 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -345,7 +345,7 @@ const SfxSlotServer* SfxStateCache::GetSlotServer( SfxDispatcher &rDispat , cons else if ( rDispat.GetFrame() ) { ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > xFrameProv( - rDispat.GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); + rDispat.GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); if ( xFrameProv != xProv ) return GetSlotServer( rDispat, xFrameProv ); } diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 6580ddb1fe..5e92d0d487 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -220,8 +220,8 @@ void SfxUnoControllerItem::GetNewDispatch() if ( !pBindings->GetDispatcher_Impl() || !pBindings->GetDispatcher_Impl()->GetFrame() ) return; - SfxFrame *pFrame = pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(); - SfxFrame *pParent = pFrame->GetParentFrame(); + SfxFrame& rFrame = pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(); + SfxFrame *pParent = rFrame.GetParentFrame(); if ( pParent ) // parent may intercept xDispatch = TryGetDispatch( pParent ); @@ -229,7 +229,7 @@ void SfxUnoControllerItem::GetNewDispatch() if ( !xDispatch.is() ) { // no interception - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface(); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = rFrame.GetFrameInterface(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY ); if ( xProv.is() ) xDispatch = xProv->queryDispatch( aCommand, ::rtl::OUString(), 0 ); @@ -253,7 +253,7 @@ void SfxUnoControllerItem::GetNewDispatch() if ( !xDisp.is() && pFrame->HasComponent() ) { // no interception - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface(); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY ); if ( xProv.is() ) xDisp = xProv->queryDispatch( aCommand, ::rtl::OUString(), 0 ); @@ -755,7 +755,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util { SfxViewFrame* pViewFrame = pDispatcher->GetFrame(); if (pViewFrame) - xFrameRef = pViewFrame->GetFrame()->GetFrameInterface(); + xFrameRef = pViewFrame->GetFrame().GetFrameInterface(); } SfxAllItemSet aInternalSet( SFX_APP()->GetPool() ); if (xFrameRef.is()) // an empty set is no problem ... but an empty frame reference can be a problem ! diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index d93a4884c1..cf7be0e86a 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -429,7 +429,7 @@ long SfxModelessDialog::Notify( NotifyEvent& rEvt ) } if ( nHelpId ) - SfxHelp::OpenHelpAgent( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); + SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); } else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() ) { @@ -531,7 +531,7 @@ long SfxFloatingWindow::Notify( NotifyEvent& rEvt ) } if ( nHelpId ) - SfxHelp::OpenHelpAgent( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); + SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); } else if ( rEvt.GetType() == EVENT_LOSEFOCUS ) { diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 89aaf2a240..a954525c6a 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -164,7 +164,7 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd , if (xFactoryMgr.is()) { SfxDispatcher* pDispatcher = pBindings->GetDispatcher(); - uno::Reference< frame::XFrame > xFrame( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), uno::UNO_QUERY ); + uno::Reference< frame::XFrame > xFrame( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY ); uno::Sequence< uno::Any > aArgs(2); beans::PropertyValue aPropValue; aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" )); @@ -1855,7 +1855,7 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt ) } if ( nHelpId ) - SfxHelp::OpenHelpAgent( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); + SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); // In VCL geht Notify zun"achst an das Fenster selbst, // also base class rufen, sonst erf"ahrt der parent nichts diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx index 7625e78167..3a454d45f4 100644 --- a/sfx2/source/dialog/partwnd.cxx +++ b/sfx2/source/dialog/partwnd.cxx @@ -181,7 +181,7 @@ SfxPartDockWnd_Impl::SfxPartDockWnd_Impl if ( pBind->GetDispatcher() ) { ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFramesSupplier > - xSupp ( pBind->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); + xSupp ( pBind->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); if ( xSupp.is() ) xSupp->getFrames()->append( xFrame ); } diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 6e52807a5c..81754af89e 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -1791,7 +1791,7 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt ) } if ( nHelpId ) - SfxHelp::OpenHelpAgent( pViewFrame->GetFrame(), nHelpId ); + SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), nHelpId ); } } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index e41352d54e..9832d0efa1 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1130,7 +1130,7 @@ void SfxObjectShell::SetProgress_Impl void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame ) { SfxApplication* pSfxApp = SFX_APP(); - if ( !pSfxApp->IsDowning() && !IsLoading() && pFrame && !pFrame->GetFrame()->IsClosing_Impl() ) + if ( !pSfxApp->IsDowning() && !IsLoading() && pFrame && !pFrame->GetFrame().IsClosing_Impl() ) { SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False ); if ( !pHiddenItem || !pHiddenItem->GetValue() ) @@ -2097,9 +2097,9 @@ void SfxObjectShell::SetWaitCursor( BOOL bSet ) const for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, this ) ) { if ( bSet ) - pFrame->GetFrame()->GetWindow().EnterWait(); + pFrame->GetFrame().GetWindow().EnterWait(); else - pFrame->GetFrame()->GetWindow().LeaveWait(); + pFrame->GetFrame().GetWindow().LeaveWait(); } } @@ -2159,7 +2159,7 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium ) // get any visible frame pView = SfxViewFrame::GetFirst(this); if ( pView ) - pFrame = pView->GetFrame(); + pFrame = &pView->GetFrame(); } if ( pFrame ) @@ -2228,7 +2228,7 @@ BOOL SfxObjectShell::IsInPlaceActive() return FALSE; SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); - return pFrame && pFrame->GetFrame()->IsInPlace(); + return pFrame && pFrame->GetFrame().IsInPlace(); } BOOL SfxObjectShell::IsUIActive() @@ -2237,7 +2237,7 @@ BOOL SfxObjectShell::IsUIActive() return FALSE; SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); - return pFrame && pFrame->GetFrame()->IsInPlace() && pFrame->GetFrame()->GetWorkWindow_Impl()->IsVisible_Impl(); + return pFrame && pFrame->GetFrame().IsInPlace() && pFrame->GetFrame().GetWorkWindow_Impl()->IsVisible_Impl(); } void SfxObjectShell::UIActivate( BOOL ) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 314d9fccff..8870cbeab3 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -389,7 +389,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) if ( !pFrame ) return; - if ( pFrame->GetFrame()->GetParentFrame() ) + if ( pFrame->GetFrame().GetParentFrame() ) { pFrame->GetTopViewFrame()->GetObjectShell()->ExecuteSlot( rReq ); return; @@ -527,10 +527,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) // get statusindicator uno::Reference< task::XStatusIndicator > xStatusIndicator; SfxViewFrame *pFrame = GetFrame(); - if ( pFrame && pFrame->GetFrame() ) + if ( pFrame ) { uno::Reference< task::XStatusIndicatorFactory > xStatFactory( - pFrame->GetFrame()->GetFrameInterface(), + pFrame->GetFrame().GetFrameInterface(), uno::UNO_QUERY ); if( xStatFactory.is() ) xStatusIndicator = xStatFactory->createStatusIndicator(); @@ -650,9 +650,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) && pFilt->GetVersion() >= SOFFICE_FILEFORMAT_60 ) { SfxViewFrame* pDocViewFrame = SfxViewFrame::GetFirst( this ); - SfxFrame* pDocFrame = pDocViewFrame ? pDocViewFrame->GetFrame() : NULL; - if ( pDocFrame ) - SfxHelp::OpenHelpAgent( pDocFrame, HID_DID_SAVE_PACKED_XML ); + if ( pDocViewFrame ) + SfxHelp::OpenHelpAgent( &pDocViewFrame->GetFrame(), HID_DID_SAVE_PACKED_XML ); } // the StoreAsURL/StoreToURL method have called this method with false @@ -716,7 +715,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_CLOSEDOC: { SfxViewFrame *pFrame = GetFrame(); - if ( pFrame && pFrame->GetFrame()->GetParentFrame() ) + if ( pFrame && pFrame->GetFrame().GetParentFrame() ) { // Wenn SID_CLOSEDOC "uber Menue etc. ausgef"uhrt wird, das // aktuelle Dokument aber in einem Frame liegt, soll eigentlich @@ -731,7 +730,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) pFrame = SfxViewFrame::GetFirst( this ); while ( pFrame ) { - if ( pFrame->GetFrame()->GetParentFrame() ) + if ( pFrame->GetFrame().GetParentFrame() ) { // Auf dieses Dokument existiert noch eine Sicht, die // in einem FrameSet liegt; diese darf nat"urlich nicht @@ -750,8 +749,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) pFrame = SfxViewFrame::GetFirst( this ); while ( pFrame ) { - if ( !pFrame->GetFrame()->GetParentFrame() ) - pFrame->GetFrame()->DoClose(); + if ( !pFrame->GetFrame().GetParentFrame() ) + pFrame->GetFrame().DoClose(); pFrame = SfxViewFrame::GetNext( *pFrame, this ); } } @@ -925,7 +924,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) pFrame = SfxViewFrame::GetFirst( this ); if ( pFrame ) { - if ( pFrame->GetFrame()->GetParentFrame() ) + if ( pFrame->GetFrame().GetParentFrame() ) { pFrame = pFrame->GetTopViewFrame(); pDoc = pFrame->GetObjectShell(); @@ -958,7 +957,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) { SfxObjectShell *pDoc = this; SfxViewFrame *pFrame = GetFrame(); - if ( pFrame && pFrame->GetFrame()->GetParentFrame() ) + if ( pFrame && pFrame->GetFrame().GetParentFrame() ) { // Wenn SID_CLOSEDOC "uber Menue etc. ausgef"uhrt wird, das // aktuelle Dokument aber in einem Frame liegt, soll eigentlich @@ -1205,7 +1204,7 @@ void SfxObjectShell::ExecView_Impl(SfxRequest &rReq) { SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, TRUE ); if ( pFrame ) - pFrame->GetFrame()->Appear(); + pFrame->GetFrame().Appear(); rReq.SetReturnValue( SfxObjectItem( 0, pFrame ) ); rReq.Done(); break; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index a26b81f19b..f03fa49a4c 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -539,7 +539,7 @@ sal_uInt16 SfxObjectShell::PrepareClose return sal_False; SfxViewFrame* pFirst = SfxViewFrame::GetFirst( this ); - if( pFirst && !pFirst->GetFrame()->PrepareClose_Impl( bUI, bForBrowsing ) ) + if( pFirst && !pFirst->GetFrame().PrepareClose_Impl( bUI, bForBrowsing ) ) return sal_False; // prepare views for closing @@ -575,7 +575,7 @@ sal_uInt16 SfxObjectShell::PrepareClose // minimierte restoren SfxFrame* pTop = pFrame->GetTopFrame(); SfxViewFrame::SetViewFrame( pTop->GetCurrentViewFrame() ); - pFrame->GetFrame()->Appear(); + pFrame->GetFrame().Appear(); // fragen, ob gespeichert werden soll short nRet = RET_YES; @@ -588,7 +588,7 @@ sal_uInt16 SfxObjectShell::PrepareClose if (aPrintOptions.IsModifyDocumentOnPrintingAllowed() && HasName() && getDocProperties()->getPrintDate().Month > 0) { - SfxHelp::OpenHelpAgent(pFirst->GetFrame(), HID_CLOSE_WARNING); + SfxHelp::OpenHelpAgent( &pFirst->GetFrame(), HID_CLOSE_WARNING ); } const Reference< XTitle > xTitle(pImp->xModel, UNO_QUERY_THROW); const ::rtl::OUString sTitle = xTitle->getTitle (); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 2fca3774b0..3c75a7d089 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -374,38 +374,35 @@ SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell* pObjectShell ) pFrame = SfxViewFrame::GetNext( *pFrame, pObjectShell ) ) { - SfxFrame* pSfxFrame = pFrame->GetFrame(); - if ( pSfxFrame ) + SfxFrame& rSfxFrame = pFrame->GetFrame(); + try { - try + // get vcl window related to the frame and lock it if it is still not locked + uno::Reference< frame::XFrame > xFrame = rSfxFrame.GetFrameInterface(); + Window* pWindow = GetVCLWindow( xFrame ); + if ( !pWindow ) + throw uno::RuntimeException(); + + if ( pWindow->IsEnabled() ) { - // get vcl window related to the frame and lock it if it is still not locked - uno::Reference< frame::XFrame > xFrame = pSfxFrame->GetFrameInterface(); - Window* pWindow = GetVCLWindow( xFrame ); - if ( !pWindow ) - throw uno::RuntimeException(); + pWindow->Disable(); - if ( pWindow->IsEnabled() ) + try { - pWindow->Disable(); - - try - { - sal_Int32 nLen = m_aLockedFrames.getLength(); - m_aLockedFrames.realloc( nLen + 1 ); - m_aLockedFrames[nLen] = xFrame; - } - catch( uno::Exception& ) - { - pWindow->Enable(); - throw; - } + sal_Int32 nLen = m_aLockedFrames.getLength(); + m_aLockedFrames.realloc( nLen + 1 ); + m_aLockedFrames[nLen] = xFrame; + } + catch( uno::Exception& ) + { + pWindow->Enable(); + throw; } } - catch( uno::Exception& ) - { - OSL_ENSURE( sal_False, "Not possible to lock the frame window!\n" ); - } + } + catch( uno::Exception& ) + { + OSL_ENSURE( sal_False, "Not possible to lock the frame window!\n" ); } } } @@ -3416,9 +3413,9 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz throw uno::Exception(); // TODO: error handling SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ); - if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame()->IsInPlace() ) + if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame().IsInPlace() ) { - Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame()->GetFrameInterface()->getContainerWindow() ); + Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame().GetFrameInterface()->getContainerWindow() ); Size aWinSize = pWindow->GetSizePixel(); awt::Size aCurrent = getVisualAreaSize( nAspect ); Size aDiff( aSize.Width-aCurrent.Width, aSize.Height-aCurrent.Height ); @@ -4025,7 +4022,7 @@ SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const Reference< XFrame pViewFrame= SfxViewFrame::GetNext( *pViewFrame, GetObjectShell(), FALSE ) ) { - if ( pViewFrame->GetFrame()->GetFrameInterface() == i_rFrame ) + if ( pViewFrame->GetFrame().GetFrameInterface() == i_rFrame ) break; } if ( !pViewFrame ) @@ -4061,7 +4058,7 @@ SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const Reference< XFrame pTargetFrame->PrepareForDoc_Impl( *GetObjectShell() ); // create view frame - pViewFrame = new SfxViewFrame( pTargetFrame, GetObjectShell() ); + pViewFrame = new SfxViewFrame( *pTargetFrame, GetObjectShell() ); } return pViewFrame; } @@ -4131,7 +4128,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie // some initial view settings, coming from our most recent attachResource call ::comphelper::NamedValueCollection aDocumentLoadArgs( getArgs() ); if ( aDocumentLoadArgs.getOrDefault( "ViewOnly", false ) ) - pViewFrame->GetFrame()->SetMenuBarOn_Impl( FALSE ); + pViewFrame->GetFrame().SetMenuBarOn_Impl( FALSE ); const sal_Int16 nPluginMode = aDocumentLoadArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) ); if ( nPluginMode == 1 ) @@ -4139,12 +4136,12 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie pViewFrame->ForceOuterResize_Impl( FALSE ); pViewFrame->GetBindings().HidePopups( TRUE ); - SfxFrame* pFrame = pViewFrame->GetFrame(); + SfxFrame& rFrame = pViewFrame->GetFrame(); // MBA: layoutmanager of inplace frame starts locked and invisible - pFrame->GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); - pFrame->GetWorkWindow_Impl()->Lock_Impl( TRUE ); + rFrame.GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); + rFrame.GetWorkWindow_Impl()->Lock_Impl( TRUE ); - pFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + rFrame.GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); } diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 50eaf3d549..b85664d886 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -456,7 +456,7 @@ SfxAppMenuControl_Impl::SfxAppMenuControl_Impl( Reference aXMultiServiceFactory(::comphelper::getProcessServiceFactory()); ::framework::MenuConfiguration aConf( aXMultiServiceFactory ); - Reference aXFrame( GetBindings().GetDispatcher_Impl()->GetFrame()->GetFrame()->GetFrameInterface() ); + Reference aXFrame( GetBindings().GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() ); pMenu = aConf.CreateBookmarkMenu( aXFrame, GetId() == SID_NEWDOCDIRECT ? BOOKMARK_NEWMENU : BOOKMARK_WIZARDMENU ); if( pMenu ) { diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 9c251c0456..d83953f97d 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -348,7 +348,7 @@ void SfxVirtualMenu::CreateFromSVMenu() DBG_CHKTHIS(SfxVirtualMenu, 0); // Merge Addon popup menus into the SV Menu - Reference< com::sun::star::frame::XFrame > xFrame( pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface() ); + Reference< com::sun::star::frame::XFrame > xFrame( pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface() ); if ( pSVMenu->IsMenuBar() ) { @@ -611,7 +611,7 @@ IMPL_LINK( SfxVirtualMenu, SettingsChanged, void*, EMPTYARG ) SfxViewFrame *pViewFrame = pBindings->GetDispatcher()->GetFrame(); BOOL bIcons = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus(); BOOL bIsHiContrastMode = IsHiContrastMode(); - Reference xFrame( pViewFrame->GetFrame()->GetFrameInterface() ); + Reference xFrame( pViewFrame->GetFrame().GetFrameInterface() ); if ( !bIsAddonPopupMenu ) { @@ -683,7 +683,7 @@ void SfxVirtualMenu::UpdateImages() BOOL bIsHiContrastMode = IsHiContrastMode(); USHORT nItemCount = pSVMenu->GetItemCount(); SfxViewFrame * pViewFrame = pBindings->GetDispatcher()->GetFrame(); - Reference xFrame( pViewFrame->GetFrame()->GetFrameInterface() ); + Reference xFrame( pViewFrame->GetFrame().GetFrameInterface() ); for ( USHORT nSVPos=0; nSVPos < nItemCount; ++nSVPos ) { @@ -732,7 +732,7 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu ) { BOOL bIsHiContrastMode = IsHiContrastMode(); USHORT nItemCount = pMenu->GetItemCount(); - Reference aXFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame()->GetFrameInterface() ); + Reference aXFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() ); for ( USHORT nPos=0; nPos < nItemCount; ++nPos ) { @@ -901,7 +901,7 @@ void SfxVirtualMenu::InsertAddOnsMenuItem( Menu* pMenu ) // Create special popup menu that is filled with the 3rd party components popup menu items Reference aXMultiServiceFactory(::comphelper::getProcessServiceFactory()); ::framework::MenuConfiguration aConf( aXMultiServiceFactory ); - Reference xFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame()->GetFrameInterface() ); + Reference xFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() ); PopupMenu* pAddonMenu = NULL; try diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 933581c7fd..aec7ac7dc3 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -269,7 +269,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg { xProv = ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > ( - pView->GetFrame()->GetFrameInterface(), UNO_QUERY ); + pView->GetFrame().GetFrameInterface(), UNO_QUERY ); } else { diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index cb58131b6a..bb5ca6ada8 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -234,7 +234,7 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing ) for ( const SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pCur ); !bOther && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pCur ) ) { - bOther = ( pFrame->GetFrame() != this ); + bOther = ( &pFrame->GetFrame() != this ); } SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur) ); @@ -317,7 +317,7 @@ void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ ) { SfxViewFrame* pFrm; for( pFrm = SfxViewFrame::GetFirst( pObj ); - pFrm && pFrm->GetFrame() == this; + pFrm && &pFrm->GetFrame() == this; pFrm = SfxViewFrame::GetNext( *pFrm, pObj ) ) ; // Keine anderer Frame mehr auf Doc -> Cancel if( !pFrm ) @@ -558,7 +558,7 @@ void SfxFrame::RemoveTopFrame_Impl( SfxFrame* pFrame ) } SfxFrameItem::SfxFrameItem( sal_uInt16 nWhichId, SfxViewFrame *p ) - : SfxPoolItem( nWhichId ), pFrame( p ? p->GetFrame() : NULL ) + : SfxPoolItem( nWhichId ), pFrame( p ? &p->GetFrame() : NULL ) { wFrame = pFrame; } @@ -948,7 +948,7 @@ void SfxFrame::Resize() if ( nHandle ) { SfxObjectShell* pDoc = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle )); - pWork = SfxViewFrame::GetFirst( pDoc )->GetFrame()->GetWorkWindow_Impl(); + pWork = SfxViewFrame::GetFirst( pDoc )->GetFrame().GetWorkWindow_Impl(); } } diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx index 932eb49f1f..6d5326f887 100644 --- a/sfx2/source/view/impviewframe.hxx +++ b/sfx2/source/view/impviewframe.hxx @@ -39,7 +39,7 @@ struct SfxViewFrame_Impl String aFrameTitle; TypeId aLastType; String aActualURL; - SfxFrame* pFrame; + SfxFrame& rFrame; svtools::AsynchronLink* pReloader; Window* pWindow; SfxViewFrame* pActiveChild; @@ -57,8 +57,8 @@ struct SfxViewFrame_Impl sal_Bool bActive; String aFactoryName; - SfxViewFrame_Impl( SfxFrame* i_pFrame ) - : pFrame( i_pFrame ) + SfxViewFrame_Impl( SfxFrame& i_rFrame ) + : rFrame( i_rFrame ) , pReloader(0 ) , pWindow( 0 ) , bWindowWasEnabled(sal_True) @@ -83,7 +83,7 @@ public: bActive( FALSE ), pFrame( p ) { - p->GetFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); + p->GetFrame().GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); } virtual void Resize(); diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 663c182fee..93a7f09df3 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -204,7 +204,7 @@ throw (::com::sun::star::uno::RuntimeException) // currently needs SFX code SfxObjectShell* pDoc = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle )); SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDoc ); - SfxWorkWindow *pWorkWin = pFrame->GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pWorkWin = pFrame->GetFrame().GetWorkWindow_Impl(); pWorkWin->UpdateObjectBars_Impl(); } */ @@ -234,7 +234,7 @@ uno::Reference < frame::XFrame > SfxInPlaceClient_Impl::GetFrame() const { if ( !m_pClient ) throw uno::RuntimeException(); - return m_pClient->GetViewShell()->GetViewFrame()->GetFrame()->GetFrameInterface(); + return m_pClient->GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(); } void SAL_CALL SfxInPlaceClient_Impl::saveObject() @@ -736,7 +736,7 @@ void SfxInPlaceClient::SetObject( const uno::Reference < embed::XEmbeddedObject } } - if ( !m_pViewSh || m_pViewSh->GetViewFrame()->GetFrame()->IsClosing_Impl() ) + if ( !m_pViewSh || m_pViewSh->GetViewFrame()->GetFrame().IsClosing_Impl() ) // sometimes applications reconnect clients on shutting down because it happens in their Paint methods return; diff --git a/sfx2/source/view/prnmon.cxx b/sfx2/source/view/prnmon.cxx index 899b082c89..561395496f 100644 --- a/sfx2/source/view/prnmon.cxx +++ b/sfx2/source/view/prnmon.cxx @@ -320,7 +320,7 @@ SfxPrintProgress::~SfxPrintProgress() pImp->pViewShell->GetPrinter()->EnablePrintFile( pImp->bOldEnablePrintFile ); // EndPrint-Notification an Frame - //pImp->pViewShell->GetViewFrame()->GetFrame()->Lock_Impl(FALSE); + //pImp->pViewShell->GetViewFrame()->GetFrame().Lock_Impl(FALSE); pImp->EndListening( *(pImp->pViewShell->GetObjectShell()) ); // the following call might destroy the view or even the document diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 67c8a3df34..9f07c42d5c 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -566,7 +566,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run if ( !m_pData->m_pViewShell ) throw DisposedException(); - return Reference< XWindow >( GetViewFrame_Impl().GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY_THROW ); + return Reference< XWindow >( GetViewFrame_Impl().GetFrame().GetWindow().GetComponentInterface(), UNO_QUERY_THROW ); } ::rtl::OUString SAL_CALL SfxBaseController::getViewControllerName() throw (RuntimeException) @@ -822,13 +822,13 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& pSlot = rSlotPool.GetUnoSlot( aMasterCommand ); else pSlot = rSlotPool.GetUnoSlot( aURL.Path ); - if ( pSlot && ( !pAct->GetFrame()->IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) ) + if ( pSlot && ( !pAct->GetFrame().IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) ) return pAct->GetBindings().GetDispatch( pSlot, aURL, bMasterCommand ); else { // try to find parent SfxViewFrame uno::Reference< frame::XFrame > xParentFrame; - uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame()->GetFrameInterface(); + uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface(); if ( xOwnFrame.is() ) xParentFrame = uno::Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY ); @@ -843,7 +843,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& pFrame; pFrame = SfxViewFrame::GetNext( *pFrame ) ) { - if ( pFrame->GetFrame()->GetFrameInterface() == xParentFrame ) + if ( pFrame->GetFrame().GetFrameInterface() == xParentFrame ) { pParentFrame = pFrame; break; @@ -879,13 +879,13 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( pAct ); const SfxSlot* pSlot = rSlotPool.GetSlot( nId ); - if ( pSlot && ( !pAct->GetFrame()->IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) ) + if ( pSlot && ( !pAct->GetFrame().IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) ) return pAct->GetBindings().GetDispatch( pSlot, aURL, sal_False ); else { // try to find parent SfxViewFrame uno::Reference< frame::XFrame > xParentFrame; - uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame()->GetFrameInterface(); + uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface(); if ( xOwnFrame.is() ) xParentFrame = uno::Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY ); @@ -900,7 +900,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& pFrame; pFrame = SfxViewFrame::GetNext( *pFrame ) ) { - if ( pFrame->GetFrame()->GetFrameInterface() == xParentFrame ) + if ( pFrame->GetFrame().GetFrameInterface() == xParentFrame ) { pParentFrame = pFrame; break; @@ -1051,7 +1051,7 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime { SfxViewFrame* pFrame = m_pData->m_pViewShell->GetViewFrame() ; if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell ) - pFrame->GetFrame()->SetIsClosing_Impl(); + pFrame->GetFrame().SetIsClosing_Impl(); m_pData->m_pViewShell->DiscardClients_Impl(); m_pData->m_pViewShell->pImp->bControllerSet = sal_False ; @@ -1092,10 +1092,10 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime if ( pFrame->GetViewShell() == pShell ) { // Enter registrations only allowed if we are the owner! - if ( pFrame->GetFrame()->OwnsBindings_Impl() ) + if ( pFrame->GetFrame().OwnsBindings_Impl() ) pFrame->GetBindings().ENTERREGISTRATIONS(); - pFrame->GetFrame()->SetFrameInterface_Impl( aXFrame ); - pFrame->GetFrame()->DoClose_Impl(); + pFrame->GetFrame().SetFrameInterface_Impl( aXFrame ); + pFrame->GetFrame().DoClose_Impl(); } } } @@ -1149,7 +1149,7 @@ SfxViewShell* SfxBaseController::GetViewShell_Impl() const { ::vos::OGuard aGuard( Application::GetSolarMutex() ); if ( m_pData->m_pViewShell && !m_pData->m_xIndicator.is() ) - m_pData->m_xIndicator = new SfxStatusIndicator( this, m_pData->m_pViewShell->GetViewFrame()->GetFrame()->GetWorkWindow_Impl() ); + m_pData->m_xIndicator = new SfxStatusIndicator( this, m_pData->m_pViewShell->GetViewFrame()->GetFrame().GetWorkWindow_Impl() ); return m_pData->m_xIndicator; } @@ -1327,7 +1327,7 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) pViewFrame->GetDispatcher()->Update_Impl( sal_True ); Window* pFrameWin = &pViewFrame->GetWindow(); - if ( pFrameWin != &pViewFrame->GetFrame()->GetWindow() ) + if ( pFrameWin != &pViewFrame->GetFrame().GetWindow() ) pFrameWin->Show(); if ( i_eConnect == E_CONNECT ) @@ -1337,29 +1337,29 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) const sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) ); const bool bHasPluginMode = ( nPluginMode != 0 ); - SfxFrame* pFrame = pViewFrame->GetFrame(); + SfxFrame& rFrame = pViewFrame->GetFrame(); SfxObjectShell& rDoc = *m_pData->m_pViewShell->GetObjectShell(); - if ( !pFrame->IsMarkedHidden_Impl() ) + if ( !rFrame.IsMarkedHidden_Impl() ) { if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) ) pViewFrame->GetDispatcher()->HideUI( TRUE ); else pViewFrame->GetDispatcher()->HideUI( FALSE ); - if ( pFrame->IsInPlace() ) + if ( rFrame.IsInPlace() ) pViewFrame->LockAdjustPosSizePixel(); if ( nPluginMode == 3 ) - pFrame->GetWorkWindow_Impl()->SetInternalDockingAllowed( FALSE ); + rFrame.GetWorkWindow_Impl()->SetInternalDockingAllowed( FALSE ); - if ( !pFrame->IsInPlace() ) + if ( !rFrame.IsInPlace() ) pViewFrame->GetDispatcher()->Update_Impl(); pViewFrame->Show(); - pFrame->GetWindow().Show(); - if ( !pFrame->IsInPlace() || ( nPluginMode == 3 ) ) - pViewFrame->MakeActive_Impl( pFrame->GetFrameInterface()->isActive() ); + rFrame.GetWindow().Show(); + if ( !rFrame.IsInPlace() || ( nPluginMode == 3 ) ) + pViewFrame->MakeActive_Impl( rFrame.GetFrameInterface()->isActive() ); - if ( pFrame->IsInPlace() ) + if ( rFrame.IsInPlace() ) { pViewFrame->UnlockAdjustPosSizePixel(); // force resize for OLE server to fix layout problems of writer and math @@ -1370,14 +1370,14 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) } else { - DBG_ASSERT( !pFrame->IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" ); - pFrame->GetWindow().Show(); + DBG_ASSERT( !rFrame.IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" ); + rFrame.GetWindow().Show(); } // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen! pViewFrame->UpdateTitle(); - if ( !pFrame->IsInPlace() ) + if ( !rFrame.IsInPlace() ) pViewFrame->Resize( TRUE ); // if there's a JumpMark given, then, well, jump to it diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ffba132e13..6f9abef29e 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -240,7 +240,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq, sal_Bool bAsync ) void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { - SfxFrame *pParent = GetFrame()->GetParentFrame(); + SfxFrame *pParent = GetFrame().GetParentFrame(); if ( rReq.GetSlot() == SID_RELOAD ) { // Bei CTRL-Reload den aktiven Frame reloaden @@ -260,11 +260,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // Wenn nur ein Reload der Graphiken eines oder mehrerer ChildFrames // gemacht werden soll - SfxFrame *pFrame = GetFrame(); - if ( pParent == pFrame && pFrame->GetChildFrameCount() ) + SfxFrame& rFrame = GetFrame(); + if ( pParent == &rFrame && rFrame.GetChildFrameCount() ) { sal_Bool bReloadAvailable = sal_False; - SfxFrameIterator aIter( *pFrame, sal_False ); + SfxFrameIterator aIter( rFrame, sal_False ); SfxFrame *pChild = aIter.FirstFrame(); while ( pChild ) { @@ -303,7 +303,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { case SID_EDITDOC: { - if ( GetFrame()->HasComponent() ) + if ( GetFrame().HasComponent() ) break; // Wg. Doppeltbelegung in Toolboxen (mit/ohne Ctrl) ist es auch @@ -488,7 +488,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // ReloadForEdit bei Framesets schaltet auch FramesetEditmode sal_Bool bIsReadonly = GetObjectShell()->IsReadOnly(); - if ( bIsReadonly != bWasReadonly && !GetFrame()->GetParentFrame() ) + if ( bIsReadonly != bWasReadonly && !GetFrame().GetParentFrame() ) { SfxBoolItem aItem( SID_EDIT_FRAMESET, !bIsReadonly ); GetDispatcher()->Execute( SID_EDIT_FRAMESET, @@ -537,7 +537,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // AutoLoad ist ggf. verboten SFX_REQUEST_ARG(rReq, pAutoLoadItem, SfxBoolItem, SID_AUTOLOAD, sal_False); if ( pAutoLoadItem && pAutoLoadItem->GetValue() && - GetFrame()->IsAutoLoadLocked_Impl() ) + GetFrame().IsAutoLoadLocked_Impl() ) return; SfxObjectShellLock xOldObj( pSh ); @@ -552,7 +552,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // ggf. beim User nachfragen sal_Bool bDo = ( GetViewShell()->PrepareClose() != FALSE ); SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False); - if ( bDo && GetFrame()->DocIsModified_Impl() && + if ( bDo && GetFrame().DocIsModified_Impl() && !rReq.IsAPI() && ( !pSilentItem || !pSilentItem->GetValue() ) ) { QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_LASTVERSION) ); @@ -582,7 +582,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) SfxViewFrame *pView = GetFirst( xOldObj ); while ( pView ) { - Reference< XFrame > xFrame( pView->GetFrame()->GetFrameInterface() ); + Reference< XFrame > xFrame( pView->GetFrame().GetFrameInterface() ); OSL_ENSURE( xFrame.is(), "SfxViewFrame::ExecReload_Impl: no XFrame?!" ); aViewFrames.push_back( ViewDescriptor( xFrame, pView->GetCurViewId() ) ); @@ -812,11 +812,11 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) // Ich bin gerade am Reloaden und Yielde so vor mich hin ... return; - GetFrame()->GetParentFrame(); + GetFrame().GetParentFrame(); SfxWhichIter aIter( rSet ); for ( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich; nWhich = aIter.NextWhich() ) { - if ( GetFrame()->HasComponent() ) + if ( GetFrame().HasComponent() ) { // Wenn die Komponente es nicht selbst dispatched, dann // macht es auch keinen Sinn! @@ -1027,7 +1027,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl() DBG_CHKTHIS(SfxViewFrame, 0); DBG_ASSERT( xObjSh.Is(), "no SfxObjectShell to release!" ); - GetFrame()->ReleasingComponent_Impl( sal_True ); + GetFrame().ReleasingComponent_Impl( sal_True ); if ( GetWindow().HasChildPathFocus( sal_True ) ) { DBG_ASSERT( !GetActiveChildFrame_Impl(), "Wrong active child frame!" ); @@ -1081,7 +1081,7 @@ sal_Bool SfxViewFrame::Close() { DBG_CHKTHIS(SfxViewFrame, 0); - DBG_ASSERT( GetFrame()->IsClosing_Impl() || !GetFrame()->GetFrameInterface().is(), "ViewFrame closed too early!" ); + DBG_ASSERT( GetFrame().IsClosing_Impl() || !GetFrame().GetFrameInterface().is(), "ViewFrame closed too early!" ); // Wenn bis jetzt noch nicht gespeichert wurde, sollen eingebettete Objekte // auch nicht mehr automatisch gespeichert werden! @@ -1136,7 +1136,7 @@ void SfxViewFrame::DoActivate( sal_Bool bUI, SfxViewFrame* pOldFrame ) SfxViewFrame *pFrame = GetParentViewFrame(); while ( pFrame ) { - if ( !pOldFrame || !pOldFrame->GetFrame()->IsParent( pFrame->GetFrame() ) ) + if ( !pOldFrame || !pOldFrame->GetFrame().IsParent( &pFrame->GetFrame() ) ) pFrame->pDispatcher->DoParentActivate_Impl(); pFrame = pFrame->GetParentViewFrame(); } @@ -1154,8 +1154,8 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame ) // ViewFrames, erh"alt er ein ParentDeactivate if ( bUI ) { -// if ( GetFrame()->GetWorkWindow_Impl() ) -// GetFrame()->GetWorkWindow_Impl()->SaveStatus_Impl(); +// if ( GetFrame().GetWorkWindow_Impl() ) +// GetFrame().GetWorkWindow_Impl()->SaveStatus_Impl(); /* SfxMedium* pMed = GetObjectShell() ? GetObjectShell()->GetMedium() : NULL; if( pMed ) @@ -1170,7 +1170,7 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame ) SfxViewFrame *pFrame = GetParentViewFrame(); while ( pFrame ) { - if ( !pNewFrame || !pNewFrame->GetFrame()->IsParent( pFrame->GetFrame() ) ) + if ( !pNewFrame || !pNewFrame->GetFrame().IsParent( &pFrame->GetFrame() ) ) pFrame->pDispatcher->DoParentDeactivate_Impl(); pFrame = pFrame->GetParentViewFrame(); } @@ -1187,7 +1187,7 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh ) { if ( GetViewShell() && GetWindow().IsVisible() ) { - if ( GetFrame()->IsInPlace() ) + if ( GetFrame().IsInPlace() ) { /* Size aSize( GetViewShell()->GetWindow()->GetSizePixel() ); @@ -1215,7 +1215,7 @@ sal_Bool SfxViewFrame::SetBorderPixelImpl { pImp->aBorder = rBorder; - if ( IsResizeInToOut_Impl() && !GetFrame()->IsInPlace() ) + if ( IsResizeInToOut_Impl() && !GetFrame().IsInPlace() ) { Size aSize = pVSh->GetWindow()->GetOutputSizePixel(); if ( aSize.Width() && aSize.Height() ) @@ -1320,14 +1320,14 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } case SFX_HINT_DEINITIALIZING: - GetFrame()->DoClose(); + GetFrame().DoClose(); break; case SFX_HINT_DYING: // when the Object is being deleted, destroy the view too if ( xObjSh.Is() ) ReleaseObjectShell_Impl(); else - GetFrame()->DoClose(); + GetFrame().DoClose(); break; } @@ -1378,7 +1378,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) case SFX_EVENT_TOGGLEFULLSCREENMODE: { - if ( GetFrame()->OwnsBindings_Impl() ) + if ( GetFrame().OwnsBindings_Impl() ) GetBindings().GetDispatcher_Impl()->Update_Impl( sal_True ); break; } @@ -1441,7 +1441,7 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) SfxViewFrame::SfxViewFrame ( - SfxFrame* pFrame, + SfxFrame& rFrame, SfxObjectShell* pObjShell ) @@ -1452,21 +1452,21 @@ SfxViewFrame::SfxViewFrame (default ist die zuerst registrierte SfxViewShell-Subklasse). */ - : pImp( new SfxViewFrame_Impl( pFrame ) ) + : pImp( new SfxViewFrame_Impl( rFrame ) ) , pDispatcher(0) , pBindings( new SfxBindings ) , nAdjustPosPixelLock( 0 ) { DBG_CTOR( SfxViewFrame, NULL ); - pFrame->SetCurrentViewFrame_Impl( this ); - pFrame->SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE ); + rFrame.SetCurrentViewFrame_Impl( this ); + rFrame.SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE ); Construct_Impl( pObjShell ); - pImp->pWindow = new SfxFrameViewWindow_Impl( this, pFrame->GetWindow() ); - pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() ); - pFrame->SetOwnsBindings_Impl( sal_True ); - pFrame->CreateWorkWindow_Impl(); + pImp->pWindow = new SfxFrameViewWindow_Impl( this, rFrame.GetWindow() ); + pImp->pWindow->SetSizePixel( rFrame.GetWindow().GetOutputSizePixel() ); + rFrame.SetOwnsBindings_Impl( sal_True ); + rFrame.CreateWorkWindow_Impl(); } //------------------------------------------------------------------------ @@ -1481,14 +1481,14 @@ SfxViewFrame::~SfxViewFrame() ReleaseObjectShell_Impl(); - if ( GetFrame()->OwnsBindings_Impl() ) + if ( GetFrame().OwnsBindings_Impl() ) // Die Bindings l"oscht der Frame! KillDispatcher_Impl(); delete pImp->pWindow; - if ( GetFrame() && GetFrame()->GetCurrentViewFrame() == this ) - GetFrame()->SetCurrentViewFrame_Impl( NULL ); + if ( GetFrame().GetCurrentViewFrame() == this ) + GetFrame().SetCurrentViewFrame_Impl( NULL ); // von Frame-Liste abmelden SfxApplication *pSfxApp = SFX_APP(); @@ -1632,7 +1632,7 @@ void SfxViewFrame::ShowStatusText( const String& /*rText*/) /* OBSOLETE: If this is used, framework/uielement/progressbarwrapper.[h|c]xx & framework/uielement/statusindicatorinterfacewrapper.[h|c]xx must be extended to support a new interface to support ShowStatusText/HideStatusText - SfxWorkWindow* pWorkWin = GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow* pWorkWin = GetFrame().GetWorkWindow_Impl(); SfxStatusBarManager *pMgr = pWorkWin->GetStatusBarManager_Impl(); if ( pMgr ) { @@ -1648,7 +1648,7 @@ void SfxViewFrame::HideStatusText() /* OBSOLETE: If this is used, framework/uielement/progressbarwrapper.[h|c]xx & framework/uielement/statusindicatorinterfacewrapper.[h|c]xx must be extended to support a new interface to support ShowStatusText/HideStatusText - SfxWorkWindow* pWorkWin = GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow* pWorkWin = GetFrame().GetWorkWindow_Impl(); SfxStatusBarManager *pMgr = pWorkWin->GetStatusBarManager_Impl(); if ( pMgr ) pMgr->GetStatusBar()->ShowItems(); @@ -1794,7 +1794,7 @@ void SfxViewFrame::Enable( sal_Bool bEnable ) } else { - Window *pWindow = &GetFrame()->GetTopFrame()->GetWindow(); + Window *pWindow = &GetFrame().GetTopFrame()->GetWindow(); if ( !bEnable ) pImp->bWindowWasEnabled = pWindow->IsInputEnabled(); if ( !bEnable || pImp->bWindowWasEnabled ) @@ -1855,12 +1855,12 @@ void SfxViewFrame::Show() // Frame-Window anzeigen, aber nur wenn der ViewFrame kein eigenes Window // hat oder wenn er keine Component enth"alt - if ( &GetWindow() == &GetFrame()->GetWindow() || !GetFrame()->HasComponent() ) + if ( &GetWindow() == &GetFrame().GetWindow() || !GetFrame().HasComponent() ) GetWindow().Show(); - GetFrame()->GetWindow().Show(); + GetFrame().GetWindow().Show(); /* SfxViewFrame* pCurrent = SfxViewFrame::Current(); - if ( GetFrame()->GetFrameInterface()->isActive() && + if ( GetFrame().GetFrameInterface()->isActive() && pCurrent != this && ( !pCurrent || pCurrent->GetParentViewFrame_Impl() != this ) && !GetActiveChildFrame_Impl() ) @@ -1899,7 +1899,7 @@ void SfxViewFrame::LockObjectShell_Impl( sal_Bool bLock ) //-------------------------------------------------------------------- void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus ) { - if ( GetViewShell() && !GetFrame()->IsClosing_Impl() ) + if ( GetViewShell() && !GetFrame().IsClosing_Impl() ) { if ( IsVisible_Impl() ) { @@ -1918,7 +1918,7 @@ void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus ) } SfxViewFrame* pCurrent = SfxViewFrame::Current(); - css::uno::Reference< css::frame::XFrame > xFrame = GetFrame()->GetFrameInterface(); + css::uno::Reference< css::frame::XFrame > xFrame = GetFrame().GetFrameInterface(); if ( !bPreview ) { SetViewFrame( this ); @@ -1934,7 +1934,7 @@ void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus ) SfxInPlaceClient *pCli = GetViewShell()->GetUIActiveClient(); if ( ( !pCli || !pCli->IsObjectUIActive() ) && ( !pCurrent || pCurrent->GetParentViewFrame_Impl() != this ) ) - GetFrame()->GrabFocusOnComponent_Impl(); + GetFrame().GrabFocusOnComponent_Impl(); } } else @@ -1976,10 +1976,10 @@ void SfxViewFrame::SetActiveChildFrame_Impl( SfxViewFrame *pViewFrame ) pImp->pActiveChild = pViewFrame; - Reference< XFramesSupplier > xFrame( GetFrame()->GetFrameInterface(), UNO_QUERY ); + Reference< XFramesSupplier > xFrame( GetFrame().GetFrameInterface(), UNO_QUERY ); Reference< XFrame > xActive; if ( pViewFrame ) - xActive = pViewFrame->GetFrame()->GetFrameInterface(); + xActive = pViewFrame->GetFrame().GetFrameInterface(); if ( xFrame.is() ) // PB: #74432# xFrame cann be NULL xFrame->setActiveFrame( xActive ); @@ -2232,7 +2232,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl // create and load new ViewShell SfxViewShell* pNewSh = LoadViewIntoFrame_Impl( *GetObjectShell(), - GetFrame()->GetFrameInterface(), + GetFrame().GetFrameInterface(), Sequence< PropertyValue >(), // means "reuse existing model's args" nViewId, false @@ -2313,7 +2313,7 @@ void SfxViewFrame::ExecView_Impl if ( nFrame == 0 ) nFrame = USHRT_MAX; - SfxFrameIterator aIter( *GetFrame(), sal_False ); + SfxFrameIterator aIter( GetFrame(), sal_False ); SfxFrame *pFrame = aIter.FirstFrame(); sal_uInt16 nActFrame = 1; while ( pFrame ) @@ -2376,7 +2376,7 @@ void SfxViewFrame::ExecView_Impl } // ViewData bei FrameSets rekursiv holen - GetFrame()->GetViewData_Impl(); + GetFrame().GetViewData_Impl(); SfxMedium* pMed = GetObjectShell()->GetMedium(); // do not open the new window hidden @@ -2571,7 +2571,7 @@ void SfxViewFrame::StateView_Impl //------------------------------------------------------------------------- void SfxViewFrame::ToTop() { - GetFrame()->Appear(); + GetFrame().Appear(); } //------------------------------------------------------------------------- @@ -2581,40 +2581,34 @@ SfxViewFrame* SfxViewFrame::GetParentViewFrame() const Der ParentViewFrame ist der ViewFrame des ParentFrames */ { - SfxFrame *pFrame = GetFrame()->GetParentFrame(); + SfxFrame *pFrame = GetFrame().GetParentFrame(); return pFrame ? pFrame->GetCurrentViewFrame() : NULL; } //------------------------------------------------------------------------- -SfxFrame* SfxViewFrame::GetFrame() const +SfxFrame& SfxViewFrame::GetFrame() const /* Beschreibung: GetFrame liefert den Frame, in dem sich der ViewFrame befindet */ { - return pImp->pFrame; -} - -//------------------------------------------------------------------------- -void SfxViewFrame::SetFrame_Impl( SfxFrame *pFrame ) -{ - pImp->pFrame = pFrame; + return pImp->rFrame; } //------------------------------------------------------------------------- SfxViewFrame* SfxViewFrame::GetTopViewFrame() const { - return GetFrame()->GetTopFrame()->GetCurrentViewFrame(); + return GetFrame().GetTopFrame()->GetCurrentViewFrame(); } Window& SfxViewFrame::GetWindow() const { - return pImp->pWindow ? *pImp->pWindow : GetFrame()->GetWindow(); + return pImp->pWindow ? *pImp->pWindow : GetFrame().GetWindow(); } sal_Bool SfxViewFrame::DoClose() { - return GetFrame()->DoClose(); + return GetFrame().DoClose(); } String SfxViewFrame::GetActualPresentationURL_Impl() const @@ -2638,7 +2632,7 @@ void SfxViewFrame::SetModalMode( sal_Bool bModal ) BOOL SfxViewFrame::IsInModalMode() const { - return pImp->bModal || GetFrame()->GetWindow().IsInModalMode(); + return pImp->bModal || GetFrame().GetWindow().IsInModalMode(); } void SfxViewFrame::Resize( BOOL bForce ) @@ -2650,7 +2644,7 @@ void SfxViewFrame::Resize( BOOL bForce ) SfxViewShell *pShell = GetViewShell(); if ( pShell ) { - if ( GetFrame()->IsInPlace() ) + if ( GetFrame().IsInPlace() ) { Point aPoint = GetWindow().GetPosPixel(); DoAdjustPosSizePixel( pShell, aPoint, aSize ); @@ -2930,7 +2924,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) // try to find any active recorder on this frame ::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier"); com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( - GetFrame()->GetFrameInterface(), + GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet(xFrame,com::sun::star::uno::UNO_QUERY); @@ -2995,7 +2989,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) case SID_TOGGLESTATUSBAR: { com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( - GetFrame()->GetFrameInterface(), + GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY ); @@ -3045,11 +3039,11 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) SfxViewFrame *pTop = GetTopViewFrame(); if ( pTop ) { - WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl(); + WorkWindow* pWork = (WorkWindow*) pTop->GetFrame().GetTopWindow_Impl(); if ( pWork ) { com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( - GetFrame()->GetFrameInterface(), + GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); Reference< ::com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY ); @@ -3084,7 +3078,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) } pWork->ShowFullScreenMode( bNewFullScreenMode ); pWork->SetMenuBarMode( bNewFullScreenMode ? MENUBAR_MODE_HIDE : MENUBAR_MODE_NORMAL ); - GetFrame()->GetWorkWindow_Impl()->SetFullScreen_Impl( bNewFullScreenMode ); + GetFrame().GetWorkWindow_Impl()->SetFullScreen_Impl( bNewFullScreenMode ); if ( !pItem ) rReq.AppendItem( SfxBoolItem( SID_WIN_FULLSCREEN, bNewFullScreenMode ) ); rReq.Done(); @@ -3138,7 +3132,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) ::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier"); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( - GetFrame()->GetFrameInterface(), + GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); com::sun::star::uno::Any aProp = xSet->getPropertyValue(sProperty); @@ -3161,7 +3155,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) ::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier"); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( - GetFrame()->GetFrameInterface(), + GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); com::sun::star::uno::Any aProp = xSet->getPropertyValue(sProperty); @@ -3175,7 +3169,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) { com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( - GetFrame()->GetFrameInterface(), + GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); com::sun::star::uno::Any aProp = xSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )) ); @@ -3196,7 +3190,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) SfxViewFrame* pTop = GetTopViewFrame(); if ( pTop ) { - WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl(); + WorkWindow* pWork = (WorkWindow*) pTop->GetFrame().GetTopWindow_Impl(); if ( pWork ) { rSet.Put( SfxBoolItem( nWhich, pWork->IsFullScreenMode() ) ); @@ -3245,7 +3239,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq ) { if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SDATABASE)) return; - Reference < XFrame > xFrame = GetFrame()->GetTopFrame()->GetFrameInterface(); + Reference < XFrame > xFrame = GetFrame().GetTopFrame()->GetFrameInterface(); Reference < XFrame > xBeamer( xFrame->findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN ) ); BOOL bShow = FALSE; BOOL bHasChild = xBeamer.is(); @@ -3346,7 +3340,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState ) } else if ( nSID == SID_BROWSER ) { - Reference < XFrame > xFrame = GetFrame()->GetTopFrame()->GetFrameInterface()-> + Reference < XFrame > xFrame = GetFrame().GetTopFrame()->GetFrameInterface()-> findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN ); if ( !xFrame.is() ) rState.DisableItem( nSID ); @@ -3364,7 +3358,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState ) SfxWorkWindow* SfxViewFrame::GetWorkWindow_Impl( USHORT /*nId*/ ) { SfxWorkWindow* pWork = 0; - pWork = GetFrame()->GetWorkWindow_Impl(); + pWork = GetFrame().GetWorkWindow_Impl(); return pWork; } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 9d11d21d13..7c89299246 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -287,7 +287,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) USHORT nId = pIdItem ? pIdItem->GetValue() : 0; // ausfuehren - SfxWorkWindow *pWorkWin = GetFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pWorkWin = GetFrame().GetWorkWindow_Impl(); if ( bShow ) { // Zuerst die Floats auch anzeigbar machen @@ -341,7 +341,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) String aFact = String::CreateFromAscii("private:factory/"); aFact += aFactName; aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) ); - aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) ); + aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, &GetFrame() ) ); aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_blank" ) ) ); SFX_APP()->ExecuteSlot( aReq ); const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() ); @@ -353,7 +353,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) case SID_CLOSEWIN: { // disable CloseWin, if frame is not a task - Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY ); + Reference < XCloseable > xTask( GetFrame().GetFrameInterface(), UNO_QUERY ); if ( !xTask.is() ) break; @@ -429,7 +429,7 @@ void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) case SID_CLOSEWIN: { // disable CloseWin, if frame is not a task - Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY ); + Reference < XCloseable > xTask( GetFrame().GetFrameInterface(), UNO_QUERY ); if ( !xTask.is() ) rSet.DisableItem(nWhich); break; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 23ee7f381e..008980fe15 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -392,7 +392,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) case SID_ACTIVATE_STYLE_APPLY: { com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( - GetViewFrame()->GetFrame()->GetFrameInterface(), + GetViewFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY ); @@ -488,7 +488,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) if ( pMailDocType ) aDocType = pMailDocType->GetValue(); - uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame()->GetFrameInterface() ); + uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); SfxMailModel::SendMailResult eResult = SfxMailModel::SEND_MAIL_ERROR; if ( nId == SID_MAIL_SENDDOC ) @@ -532,7 +532,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) const sal_Int32 FILTERFLAG_EXPORT = 0x00000002; css::uno::Reference< lang::XMultiServiceFactory > xSMGR(::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW); - css::uno::Reference < css::frame::XFrame > xFrame( pFrame->GetFrame()->GetFrameInterface() ); + css::uno::Reference < css::frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); css::uno::Reference< css::frame::XModel > xModel; const rtl::OUString aModuleManager( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" )); @@ -690,7 +690,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) if ( !pShowItem || bActive != pImp->bPlugInsActive ) { SfxFrame* pTopFrame = GetFrame()->GetTopFrame(); - if ( pTopFrame != GetFrame()->GetFrame() ) + if ( pTopFrame != &GetFrame()->GetFrame() ) { // FramesetDocument SfxViewShell *pShell = pTopFrame->GetCurrentViewFrame()->GetViewShell(); @@ -776,7 +776,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) aPrinterName = Printer::GetDefaultPrinterName(); if ( aPrinterName.getLength() > 0 ) { - uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame()->GetFrameInterface() ); + uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); ::rtl::OUStringBuffer aBuffer( 60 ); aBuffer.append( RetrieveLabelFromCommand( @@ -874,7 +874,7 @@ ErrCode SfxViewShell::DoVerb(long /*nVerb*/) void SfxViewShell::OutplaceActivated( sal_Bool bActive, SfxInPlaceClient* /*pClient*/ ) { if ( !bActive ) - GetFrame()->GetFrame()->Appear(); + GetFrame()->GetFrame().Appear(); } //-------------------------------------------------------------------- @@ -896,7 +896,7 @@ void SfxViewShell::InplaceDeactivated( SfxInPlaceClient* /*pClient*/ ) void SfxViewShell::UIActivating( SfxInPlaceClient* /*pClient*/ ) { - uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame()->GetFrameInterface() ); + uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame().GetFrameInterface() ); uno::Reference < frame::XFramesSupplier > xParentFrame( xOwnFrame->getCreator(), uno::UNO_QUERY ); if ( xParentFrame.is() ) xParentFrame->setActiveFrame( xOwnFrame ); @@ -909,12 +909,12 @@ void SfxViewShell::UIActivating( SfxInPlaceClient* /*pClient*/ ) void SfxViewShell::UIDeactivated( SfxInPlaceClient* /*pClient*/ ) { - if ( !pFrame->GetFrame()->IsClosing_Impl() || + if ( !pFrame->GetFrame().IsClosing_Impl() || SfxViewFrame::Current() != pFrame ) pFrame->GetDispatcher()->Update_Impl( TRUE ); pFrame->GetBindings().HidePopups(FALSE); - // uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame()->GetFrameInterface() ); + // uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame().GetFrameInterface() ); // uno::Reference < frame::XFramesSupplier > xParentFrame( xOwnFrame->getCreator(), uno::UNO_QUERY ); // if ( xParentFrame.is() ) // xParentFrame->setActiveFrame( uno::Reference < frame::XFrame >() ); @@ -995,7 +995,7 @@ void SfxViewShell::Activate( BOOL bMDI ) { SfxObjectShell *pSh = GetViewFrame()->GetObjectShell(); if ( pSh->GetModel().is() ) - pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame()->GetController() ); + pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame().GetController() ); SetCurrentDocument(); } @@ -1685,7 +1685,7 @@ BOOL SfxViewShell::ExecKey_Impl(const KeyEvent& aKey) if (!pImp->pAccExec) { pImp->pAccExec = ::svt::AcceleratorExecute::createAcceleratorHelper(); - pImp->pAccExec->init(::comphelper::getProcessServiceFactory(), pFrame->GetFrame()->GetFrameInterface()); + pImp->pAccExec->init(::comphelper::getProcessServiceFactory(), pFrame->GetFrame().GetFrameInterface()); } return pImp->pAccExec->execute(aKey.GetKeyCode()); @@ -2169,7 +2169,7 @@ void SfxViewShell::CheckOwnerShip_Impl() { // document couldn't be closed or it shouldn't, now try at least to close the frame com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xFrame( - GetViewFrame()->GetFrame()->GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); + GetViewFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); if ( xFrame.is() ) { try diff --git a/svx/source/cui/cfg.cxx b/svx/source/cui/cfg.cxx index d172735208..ec8a54e056 100644 --- a/svx/source/cui/cfg.cxx +++ b/svx/source/cui/cfg.cxx @@ -1967,7 +1967,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) } if ( !_inout_rxFrame.is() && SfxViewFrame::Current() ) - _inout_rxFrame = SfxViewFrame::Current()->GetFrame()->GetFrameInterface(); + _inout_rxFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface(); if ( !_inout_rxFrame.is() ) { diff --git a/svx/source/cui/hlmailtp.cxx b/svx/source/cui/hlmailtp.cxx index 283d9d243a..eb4eafaabf 100644 --- a/svx/source/cui/hlmailtp.cxx +++ b/svx/source/cui/hlmailtp.cxx @@ -316,7 +316,7 @@ IMPL_LINK ( SvxHyperlinkMailTp, ClickAdrBookHdl_Impl, void *, EMPTYARG ) } -/* uno::Reference< frame::XDispatchProvider > xProv( pViewFrame->GetFrame()->GetFrameInterface(), uno::UNO_QUERY ); +/* uno::Reference< frame::XDispatchProvider > xProv( pViewFrame->GetFrame().GetFrameInterface(), uno::UNO_QUERY ); if ( xProv.is() ) { !!! (pb) we need a new config item here diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx index c1be60ebe3..9ee2a7ad81 100644 --- a/svx/source/dialog/hyprlink.cxx +++ b/svx/source/dialog/hyprlink.cxx @@ -953,7 +953,7 @@ void SvxHyperlinkDlg::OpenDoc( const String& rURL, SfxViewFrame* pViewFrame ) if ( pViewFrame ) { - SfxFrameItem aView( SID_DOCFRAME, pViewFrame ? pViewFrame->GetFrame() : NULL ); + SfxFrameItem aView( SID_DOCFRAME, pViewFrame ? &pViewFrame->GetFrame() : NULL ); if ( pDisp ) pDisp->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aName, &aView, &aNewView, &aSilent, &aReadOnly, &aReferer, &aExternal, 0L ); diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 5e67d87e28..d368ab5d21 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -324,7 +324,7 @@ void SvxRubyDialog::Activate() aStylistPB.Enable(bEnable); //get selection from current view frame SfxViewFrame* pCurFrm = SfxViewFrame::Current(); - Reference< XController > xCtrl = pCurFrm->GetFrame()->GetController(); + Reference< XController > xCtrl = pCurFrm->GetFrame().GetController(); pImpl->SetController(xCtrl); if(pImpl->HasSelectionChanged()) { diff --git a/svx/source/editeng/svxacorr.cxx b/svx/source/editeng/svxacorr.cxx index b7861e9154..56a2bc465d 100644 --- a/svx/source/editeng/svxacorr.cxx +++ b/svx/source/editeng/svxacorr.cxx @@ -1327,8 +1327,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, } while( FALSE ); SfxViewFrame* pVFrame; - if( nRet && 0 != (pVFrame = SfxViewFrame::Current()) && - pVFrame->GetFrame() ) + if( nRet && 0 != (pVFrame = SfxViewFrame::Current()) ) { ULONG nHelpId = 0; if( nRet & ( Autocorrect|CptlSttSntnc|CptlSttWrd|ChgToEnEmDash ) ) @@ -1361,7 +1360,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, if( nHelpId ) { nHelpId += HID_AUTOCORR_HELP_START - 1; - SfxHelp::OpenHelpAgent( pVFrame->GetFrame(), nHelpId ); + SfxHelp::OpenHelpAgent( &pVFrame->GetFrame(), nHelpId ); } } diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index c56b4b77f6..e29348be88 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -1611,7 +1611,7 @@ namespace svxform DBG_ASSERT( pBindings != NULL, "DataNavigatorWindow::LoadModels(): no SfxBindings; can't get frame" ); m_xFrame = Reference( - pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(), + pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" ); // add frameaction listener diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index d1f77a84cc..152853801b 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -31,20 +31,20 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include "fmhelp.hrc" -#include "fmprop.hrc" +#include "fmhelp.hrc" +#include "fmprop.hrc" #include "fmPropBrw.hxx" #include "fmresids.hrc" #include "fmservs.hxx" -#include "fmshimp.hxx" -#include "fmpgeimp.hxx" +#include "fmshimp.hxx" +#include "fmpgeimp.hxx" -#include "svx/dialmgr.hxx" -#include "svx/fmpage.hxx" -#include "svx/fmshell.hxx" -#include "svx/sdrpagewindow.hxx" -#include "svx/svdpagv.hxx" -#include "svx/svxids.hrc" +#include "svx/dialmgr.hxx" +#include "svx/fmpage.hxx" +#include "svx/fmshell.hxx" +#include "svx/sdrpagewindow.hxx" +#include "svx/svdpagv.hxx" +#include "svx/svxids.hrc" /** === begin UNO includes === **/ #include @@ -63,20 +63,20 @@ /** === end UNO includes === **/ #include -#include +#include #include #include #include -#include +#include #include -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include @@ -248,7 +248,7 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding if ( _pBindings->GetDispatcher() ) { ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFramesSupplier > - xSupp ( _pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); + xSupp ( _pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ); // if ( xSupp.is() ) // xSupp->getFrames()->append( m_xMeAsFrame ); // Don't append frame to frame hierachy to prevent UI_DEACTIVATE messages diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index d07c4195ba..73fe5715da 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -518,9 +518,8 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame ) m_aMarkTimer.SetTimeout(100); m_aMarkTimer.SetTimeoutHdl(LINK(this,FmXFormShell,OnTimeOut)); - SfxFrame* pFrame = _pViewFrame ? _pViewFrame->GetFrame() : NULL; - if ( pFrame ) - m_xAttachedFrame = pFrame->GetFrameInterface(); + if ( _pViewFrame ) + m_xAttachedFrame = _pViewFrame->GetFrame().GetFrameInterface(); // to prevent deletion of this we acquire our refcounter once ::comphelper::increment(FmXFormShell_BASE::m_refCount); diff --git a/svx/source/tbxctrls/tbxcolor.cxx b/svx/source/tbxctrls/tbxcolor.cxx index fd4c11e639..eb698e1c7d 100644 --- a/svx/source/tbxctrls/tbxcolor.cxx +++ b/svx/source/tbxctrls/tbxcolor.cxx @@ -65,7 +65,7 @@ namespace svx { try { - Reference< XFrame > xFrame = SfxViewFrame::Current()->GetFrame()->GetFrameInterface(); + Reference< XFrame > xFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface(); Reference< XPropertySet > xFrameProps( xFrame, UNO_QUERY ); if ( xFrameProps.is() ) xFrameProps->getPropertyValue( PROPNAME_LAYOUTMANAGER ) >>= m_xLayouter; -- cgit v1.2.3 From 544d85cc9cf529c7411f5b23642434006cfa6440 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Dec 2009 23:31:21 +0100 Subject: autorecovery: Sfx(View)Frame::GetTopFrame now also returning a SfxFrame& instead of an SfxFrame* --- sfx2/inc/sfx2/frame.hxx | 2 +- sfx2/inc/sfx2/viewfrm.hxx | 2 +- sfx2/source/appl/sfxhelp.cxx | 2 +- sfx2/source/control/dispatch.cxx | 2 +- sfx2/source/doc/objxtor.cxx | 4 ++-- sfx2/source/view/frame.cxx | 4 ++-- sfx2/source/view/ipclient.cxx | 12 ++++++------ sfx2/source/view/viewfrm.cxx | 10 +++++----- sfx2/source/view/viewsh.cxx | 2 +- svx/source/cui/hltpbase.cxx | 2 +- svx/source/dialog/hyprlink.cxx | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index e051384e6e..17715577ac 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -163,7 +163,7 @@ public: SfxBroadcaster& GetBroadcaster() const; SfxObjectShell* GetCurrentDocument() const; SfxViewFrame* GetCurrentViewFrame() const; - SfxFrame* GetTopFrame() const; + SfxFrame& GetTopFrame() const; sal_Bool IsParent( SfxFrame* ) const; sal_uInt32 GetFrameType() const; diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index dbbad619d0..e6b6f4f3aa 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -244,7 +244,7 @@ public: BOOL DoClose(); ULONG GetFrameType() const { return GetFrame().GetFrameType(); } - SfxFrame* GetTopFrame() const + SfxFrame& GetTopFrame() const { return GetFrame().GetTopFrame(); } void GetTargetList( TargetList& rList ) const { GetFrame().GetTargetList( rList ); } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index f9b2777852..106df5fd21 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -975,7 +975,7 @@ void SfxHelp::OpenHelpAgent( SfxFrame *pFrame, ULONG nHelpId ) ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" ) ), UNO_QUERY ); xTrans->parseStrict(aURL); - Reference< XDispatchProvider > xDispProv( pFrame->GetTopFrame()->GetFrameInterface(), UNO_QUERY ); + Reference< XDispatchProvider > xDispProv( pFrame->GetTopFrame().GetFrameInterface(), UNO_QUERY ); Reference< XDispatch > xHelpDispatch; if ( xDispProv.is() ) xHelpDispatch = xDispProv->queryDispatch( diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 3744fd03fb..9a1456c66e 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1768,7 +1768,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce ) SetMenu_Impl(); SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); - SfxWorkWindow *pTaskWin = pImp->pFrame->GetTopFrame()->GetWorkWindow_Impl(); + SfxWorkWindow *pTaskWin = pImp->pFrame->GetTopFrame().GetWorkWindow_Impl(); pTaskWin->ResetStatusBar_Impl(); SfxDispatcher *pDispat = this; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index f03fa49a4c..5313b8ee67 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -573,8 +573,8 @@ sal_uInt16 SfxObjectShell::PrepareClose if ( bUI && IsModified() && pFrame ) { // minimierte restoren - SfxFrame* pTop = pFrame->GetTopFrame(); - SfxViewFrame::SetViewFrame( pTop->GetCurrentViewFrame() ); + SfxFrame& rTop = pFrame->GetTopFrame(); + SfxViewFrame::SetViewFrame( rTop.GetCurrentViewFrame() ); pFrame->GetFrame().Appear(); // fragen, ob gespeichert werden soll diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index bb5ca6ada8..cd3e59513c 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -284,12 +284,12 @@ void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame ) pChildArr->Remove( nPos ); }; -SfxFrame* SfxFrame::GetTopFrame() const +SfxFrame& SfxFrame::GetTopFrame() const { const SfxFrame* pParent = this; while ( pParent->pParentFrame ) pParent = pParent->pParentFrame; - return const_cast< SfxFrame* >( pParent ); + return *const_cast< SfxFrame* >( pParent ); } sal_Bool SfxFrame::IsClosing_Impl() const diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 93a7f09df3..279298a636 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -986,7 +986,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) { if ( m_pViewSh ) - m_pViewSh->GetViewFrame()->GetTopFrame()->LockResize_Impl(TRUE); + m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(TRUE); try { m_pImp->m_xObject->setClientSite( m_pImp->m_xClient ); @@ -1036,8 +1036,8 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) if ( m_pViewSh ) { SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); - pFrame->GetTopFrame()->LockResize_Impl(FALSE); - pFrame->GetTopFrame()->Resize(); + pFrame->GetTopFrame().LockResize_Impl(FALSE); + pFrame->GetTopFrame().Resize(); } } } @@ -1097,7 +1097,7 @@ void SfxInPlaceClient::DeactivateObject() } if ( m_pViewSh ) - m_pViewSh->GetViewFrame()->GetTopFrame()->LockResize_Impl(TRUE); + m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(TRUE); if ( m_pImp->m_xObject->getStatus( m_pImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) { @@ -1119,8 +1119,8 @@ void SfxInPlaceClient::DeactivateObject() { SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); SfxViewFrame::SetViewFrame( pFrame ); - pFrame->GetTopFrame()->LockResize_Impl(FALSE); - pFrame->GetTopFrame()->Resize(); + pFrame->GetTopFrame().LockResize_Impl(FALSE); + pFrame->GetTopFrame().Resize(); } } catch (com::sun::star::uno::Exception& ) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 6f9abef29e..1201375e54 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -844,7 +844,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) case SID_RELOAD: { - SfxFrame* pFrame = GetTopFrame(); + SfxFrame* pFrame = &GetTopFrame(); if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) rSet.DisableItem(nWhich); @@ -1794,7 +1794,7 @@ void SfxViewFrame::Enable( sal_Bool bEnable ) } else { - Window *pWindow = &GetFrame().GetTopFrame()->GetWindow(); + Window *pWindow = &GetFrame().GetTopFrame().GetWindow(); if ( !bEnable ) pImp->bWindowWasEnabled = pWindow->IsInputEnabled(); if ( !bEnable || pImp->bWindowWasEnabled ) @@ -2598,7 +2598,7 @@ SfxFrame& SfxViewFrame::GetFrame() const //------------------------------------------------------------------------- SfxViewFrame* SfxViewFrame::GetTopViewFrame() const { - return GetFrame().GetTopFrame()->GetCurrentViewFrame(); + return GetFrame().GetTopFrame().GetCurrentViewFrame(); } Window& SfxViewFrame::GetWindow() const @@ -3239,7 +3239,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq ) { if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SDATABASE)) return; - Reference < XFrame > xFrame = GetFrame().GetTopFrame()->GetFrameInterface(); + Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface(); Reference < XFrame > xBeamer( xFrame->findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN ) ); BOOL bShow = FALSE; BOOL bHasChild = xBeamer.is(); @@ -3340,7 +3340,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState ) } else if ( nSID == SID_BROWSER ) { - Reference < XFrame > xFrame = GetFrame().GetTopFrame()->GetFrameInterface()-> + Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface()-> findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN ); if ( !xFrame.is() ) rState.DisableItem( nSID ); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 008980fe15..d3fbd33959 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -689,7 +689,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) // ausfuehren if ( !pShowItem || bActive != pImp->bPlugInsActive ) { - SfxFrame* pTopFrame = GetFrame()->GetTopFrame(); + SfxFrame* pTopFrame = &GetFrame()->GetTopFrame(); if ( pTopFrame != &GetFrame()->GetFrame() ) { // FramesetDocument diff --git a/svx/source/cui/hltpbase.cxx b/svx/source/cui/hltpbase.cxx index 2e76c5be4a..873457603c 100644 --- a/svx/source/cui/hltpbase.cxx +++ b/svx/source/cui/hltpbase.cxx @@ -72,7 +72,7 @@ SvxFramesComboBox::SvxFramesComboBox ( Window* pParent, const ResId& rResId, { TargetList* pList = new TargetList; SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0; - SfxFrame* pFrame = pViewFrame ? pViewFrame->GetTopFrame() : 0; + SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetTopFrame() : 0; if ( pFrame ) { pFrame->GetTargetList(*pList); diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx index 9ee2a7ad81..288d698c38 100644 --- a/svx/source/dialog/hyprlink.cxx +++ b/svx/source/dialog/hyprlink.cxx @@ -475,7 +475,7 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute) if (pVwFrm) // Alle moeglichen Target Frames zusammensammeln und anzeigen { TargetList aList; - pVwFrm->GetTopFrame()->GetTargetList(aList); + pVwFrm->GetTopFrame().GetTargetList(aList); USHORT nCount = (USHORT)aList.Count(); if( nCount ) -- cgit v1.2.3 From 2ac2055bc301e94d09a32ab22c8407a13c85e829 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 16 Dec 2009 12:46:33 +0100 Subject: dba33e: #i107717# impl first entry points for db extensions --- connectivity/inc/connectivity/TTableHelper.hxx | 9 ++ connectivity/inc/connectivity/dbtools.hxx | 27 ++++ connectivity/source/commontools/TIndexes.cxx | 164 ++++++++++++----------- connectivity/source/commontools/TKeys.cxx | 154 +++++++++++---------- connectivity/source/commontools/TTableHelper.cxx | 111 ++++++++++----- connectivity/source/commontools/dbtools2.cxx | 32 +++++ 6 files changed, 319 insertions(+), 178 deletions(-) diff --git a/connectivity/inc/connectivity/TTableHelper.hxx b/connectivity/inc/connectivity/TTableHelper.hxx index ea9d4a57d4..bef9ce7240 100644 --- a/connectivity/inc/connectivity/TTableHelper.hxx +++ b/connectivity/inc/connectivity/TTableHelper.hxx @@ -36,6 +36,10 @@ #include "connectivity/sdbcx/VKey.hxx" #include "connectivity/StdTypeDefs.hxx" #include +#include +#include +#include +#include namespace connectivity { @@ -158,6 +162,11 @@ namespace connectivity void addKey(const ::rtl::OUString& _sName,const sdbcx::TKeyProperties& _aKeyProperties); virtual ::rtl::OUString getTypeCreatePattern() const; + + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableRename> getRenameService() const; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableAlteration> getAlterService() const; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XKeyAlteration> getKeyService() const; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XIndexAlteration> getIndexService() const; }; } #endif // CONNECTIVITY_TABLEHELPER_HXX diff --git a/connectivity/inc/connectivity/dbtools.hxx b/connectivity/inc/connectivity/dbtools.hxx index b0b7550611..2f3b808089 100644 --- a/connectivity/inc/connectivity/dbtools.hxx +++ b/connectivity/inc/connectivity/dbtools.hxx @@ -353,6 +353,33 @@ namespace dbtools ,const ::rtl::OUString& _sProperty, sal_Bool _bDefault = sal_False); + /** retrieves a particular indirect data source setting + + @param _rxDataSource + a data source component + @param _pAsciiSettingsName + the ASCII name of the setting to obtain + @param _rSettingsValue + the value of the setting, upon successfull return + + @return + if the setting is not present in the DataSource::Info + member of the data source + otherwise + */ + OOO_DLLPUBLIC_DBTOOLS + bool getDataSourceSetting( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource, + const sal_Char* _pAsciiSettingsName, + ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue + ); + OOO_DLLPUBLIC_DBTOOLS + bool getDataSourceSetting( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource, + const ::rtl::OUString& _sSettingsName, + ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue + ); + OOO_DLLPUBLIC_DBTOOLS ::rtl::OUString getDefaultReportEngineServiceName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); /** quote the given name with the given quote string. diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index b4ae00b603..d0fb9289ac 100644 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx @@ -143,73 +143,80 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const ::rtl::OUString& _rForName if ( m_pTable->isNew() ) return cloneDescriptor( descriptor ); - ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); - ::rtl::OUStringBuffer aSql( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE "))); - ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( ); - ::rtl::OUString aDot = ::rtl::OUString::createFromAscii("."); + if ( m_pTable->getIndexService().is() ) + { + m_pTable->getIndexService()->addIndex(m_pTable,descriptor); + } + else + { + ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); + ::rtl::OUStringBuffer aSql( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE "))); + ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( ); + ::rtl::OUString aDot = ::rtl::OUString::createFromAscii("."); - if(comphelper::getBOOL(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISUNIQUE)))) - aSql.appendAscii("UNIQUE "); - aSql.appendAscii("INDEX "); + if(comphelper::getBOOL(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISUNIQUE)))) + aSql.appendAscii("UNIQUE "); + aSql.appendAscii("INDEX "); - - ::rtl::OUString aCatalog,aSchema,aTable; - dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation); - ::rtl::OUString aComposedName; - - aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions); - if ( _rForName.getLength() ) - { - aSql.append( ::dbtools::quoteName( aQuote, _rForName ) ); - aSql.appendAscii(" ON "); - aSql.append(aComposedName); - aSql.appendAscii(" ( "); - - Reference xColumnSup(descriptor,UNO_QUERY); - Reference xColumns(xColumnSup->getColumns(),UNO_QUERY); - Reference< XPropertySet > xColProp; - sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" ); - sal_Int32 nCount = xColumns->getCount(); - for(sal_Int32 i = 0 ; i < nCount; ++i) + + ::rtl::OUString aCatalog,aSchema,aTable; + dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation); + ::rtl::OUString aComposedName; + + aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions); + if ( _rForName.getLength() ) { - xColProp.set(xColumns->getByIndex(i),UNO_QUERY); - aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); - - if ( bAddIndexAppendix ) - { - - aSql.appendAscii(any2bool(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISASCENDING))) - ? - " ASC" - : - " DESC"); + aSql.append( ::dbtools::quoteName( aQuote, _rForName ) ); + aSql.appendAscii(" ON "); + aSql.append(aComposedName); + aSql.appendAscii(" ( "); + + Reference xColumnSup(descriptor,UNO_QUERY); + Reference xColumns(xColumnSup->getColumns(),UNO_QUERY); + Reference< XPropertySet > xColProp; + sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" ); + sal_Int32 nCount = xColumns->getCount(); + for(sal_Int32 i = 0 ; i < nCount; ++i) + { + xColProp.set(xColumns->getByIndex(i),UNO_QUERY); + aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); + + if ( bAddIndexAppendix ) + { + + aSql.appendAscii(any2bool(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISASCENDING))) + ? + " ASC" + : + " DESC"); + } + aSql.appendAscii(","); } - aSql.appendAscii(","); + aSql.setCharAt(aSql.getLength()-1,')'); } - aSql.setCharAt(aSql.getLength()-1,')'); - } - else - { - aSql.append(aComposedName); + else + { + aSql.append(aComposedName); - Reference xColumnSup(descriptor,UNO_QUERY); - Reference xColumns(xColumnSup->getColumns(),UNO_QUERY); - Reference< XPropertySet > xColProp; - if(xColumns->getCount() != 1) - throw SQLException(); + Reference xColumnSup(descriptor,UNO_QUERY); + Reference xColumns(xColumnSup->getColumns(),UNO_QUERY); + Reference< XPropertySet > xColProp; + if(xColumns->getCount() != 1) + throw SQLException(); - xColumns->getByIndex(0) >>= xColProp; + xColumns->getByIndex(0) >>= xColProp; - aSql.append(aDot); - aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); - } + aSql.append(aDot); + aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); + } - Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); - if ( xStmt.is() ) - { - ::rtl::OUString sSql = aSql.makeStringAndClear(); - xStmt->execute(sSql); - ::comphelper::disposeComponent(xStmt); + Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); + if ( xStmt.is() ) + { + ::rtl::OUString sSql = aSql.makeStringAndClear(); + xStmt->execute(sSql); + ::comphelper::disposeComponent(xStmt); + } } return createObject( _rForName ); @@ -221,27 +228,34 @@ void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElem Reference< XConnection> xConnection = m_pTable->getConnection(); if( xConnection.is() && !m_pTable->isNew()) { - ::rtl::OUString aName,aSchema; - sal_Int32 nLen = _sElementName.indexOf('.'); - if(nLen != -1) - aSchema = _sElementName.copy(0,nLen); - aName = _sElementName.copy(nLen+1); + if ( m_pTable->getIndexService().is() ) + { + m_pTable->getIndexService()->dropIndex(m_pTable,_sElementName); + } + else + { + ::rtl::OUString aName,aSchema; + sal_Int32 nLen = _sElementName.indexOf('.'); + if(nLen != -1) + aSchema = _sElementName.copy(0,nLen); + aName = _sElementName.copy(nLen+1); - ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP INDEX "); + ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP INDEX "); - ::rtl::OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true ); - ::rtl::OUString sIndexName,sTemp; - sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions ); + ::rtl::OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true ); + ::rtl::OUString sIndexName,sTemp; + sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions ); - aSql += sIndexName - + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON ")) - + aComposedName; + aSql += sIndexName + + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON ")) + + aComposedName; - Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); - if ( xStmt.is() ) - { - xStmt->execute(aSql); - ::comphelper::disposeComponent(xStmt); + Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); + if ( xStmt.is() ) + { + xStmt->execute(aSql); + ::comphelper::disposeComponent(xStmt); + } } } } diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx index 1875c3e283..ae7e8d6df9 100644 --- a/connectivity/source/commontools/TKeys.cxx +++ b/connectivity/source/commontools/TKeys.cxx @@ -150,69 +150,80 @@ sdbcx::ObjectType OKeysHelper::appendObject( const ::rtl::OUString& _rForName, c return xNewDescriptor; } - // if we're here, we belong to a table which is not new, i.e. already exists in the database. - // In this case, really append the new index. - const ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); sal_Int32 nKeyType = getINT32(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE))); + sal_Int32 nUpdateRule = 0, nDeleteRule = 0; + ::rtl::OUString sReferencedName; - ::rtl::OUString aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE ")); - ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( ); - ::rtl::OUString aDot = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")); - - aSql += composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true ); - aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD ")); - - if ( nKeyType == KeyType::PRIMARY ) + if ( nKeyType == KeyType::FOREIGN ) { - aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PRIMARY KEY (")); + descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)) >>= sReferencedName; + descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_UPDATERULE)) >>= nUpdateRule; + descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)) >>= nDeleteRule; } - else if ( nKeyType == KeyType::FOREIGN ) + + if ( m_pTable->getKeyService().is() ) { - aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FOREIGN KEY (")); + m_pTable->getKeyService()->addKey(m_pTable,descriptor); } else - throw SQLException(); - - Reference xColumnSup(descriptor,UNO_QUERY); - Reference xColumns(xColumnSup->getColumns(),UNO_QUERY); - Reference< XPropertySet > xColProp; - for(sal_Int32 i=0;igetCount();++i) { - ::cppu::extractInterface(xColProp,xColumns->getByIndex(i)); - aSql += ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) - + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")); - } - aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"))); + // if we're here, we belong to a table which is not new, i.e. already exists in the database. + // In this case, really append the new index. + ::rtl::OUStringBuffer aSql; + aSql.appendAscii("ALTER TABLE "); + ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( ); + ::rtl::OUString aDot = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")); - sal_Int32 nUpdateRule = 0, nDeleteRule = 0; - ::rtl::OUString sReferencedName; + aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true )); + aSql.appendAscii(" ADD "); - if ( nKeyType == KeyType::FOREIGN ) - { - descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)) >>= sReferencedName; - - aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" REFERENCES ")) - + ::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions); - aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")); + if ( nKeyType == KeyType::PRIMARY ) + { + aSql.appendAscii(" PRIMARY KEY ("); + } + else if ( nKeyType == KeyType::FOREIGN ) + { + aSql.appendAscii(" FOREIGN KEY ("); + } + else + throw SQLException(); - for(sal_Int32 i=0;igetCount();++i) + Reference xColumnSup(descriptor,UNO_QUERY); + Reference xColumns(xColumnSup->getColumns(),UNO_QUERY); + Reference< XPropertySet > xColProp; + for(sal_Int32 i = 0 ; i < xColumns->getCount() ; ++i) { - xColumns->getByIndex(i) >>= xColProp; - aSql += ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN)))) - + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")); + if ( i > 0 ) + aSql.appendAscii(","); + ::cppu::extractInterface(xColProp,xColumns->getByIndex(i)); + aSql.append( ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) ); + } - aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"))); + aSql.appendAscii(")"); - descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_UPDATERULE)) >>= nUpdateRule; - descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)) >>= nDeleteRule; + if ( nKeyType == KeyType::FOREIGN ) + { + aSql.appendAscii(" REFERENCES "); + aSql.append(::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions)); + aSql.appendAscii(" ("); - aSql += getKeyRuleString(sal_True ,nUpdateRule); - aSql += getKeyRuleString(sal_False ,nDeleteRule); - } + for(sal_Int32 i=0;igetCount();++i) + { + if ( i > 0 ) + aSql.appendAscii(","); + xColumns->getByIndex(i) >>= xColProp; + aSql.append(::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN))))); + + } + aSql.appendAscii(")"); + aSql.append(getKeyRuleString(sal_True ,nUpdateRule)); + aSql.append(getKeyRuleString(sal_False ,nDeleteRule)); + } - Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); - xStmt->execute(aSql); + Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); + xStmt->execute(aSql.makeStringAndClear()); + } // find the name which the database gave the new key ::rtl::OUString sNewName( _rForName ); try @@ -269,34 +280,41 @@ void OKeysHelper::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName Reference< XConnection> xConnection = m_pTable->getConnection(); if ( xConnection.is() && !m_pTable->isNew() ) { - ::rtl::OUString aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE ")); - - aSql += composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true ); - Reference xKey(getObject(_nPos),UNO_QUERY); - - sal_Int32 nKeyType = KeyType::PRIMARY; - if ( xKey.is() ) + if ( m_pTable->getKeyService().is() ) { - ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); - xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nKeyType; - } - if ( KeyType::PRIMARY == nKeyType ) - { - aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP PRIMARY KEY")); + m_pTable->getKeyService()->dropKey(m_pTable,xKey); } else { - aSql += getDropForeignKey(); - const ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString(); - aSql += ::dbtools::quoteName( aQuote,_sElementName); - } + ::rtl::OUStringBuffer aSql; + aSql.appendAscii("ALTER TABLE "); - Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); - if ( xStmt.is() ) - { - xStmt->execute(aSql); - ::comphelper::disposeComponent(xStmt); + aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true )); + + sal_Int32 nKeyType = KeyType::PRIMARY; + if ( xKey.is() ) + { + ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); + xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nKeyType; + } + if ( KeyType::PRIMARY == nKeyType ) + { + aSql.appendAscii(" DROP PRIMARY KEY"); + } + else + { + aSql.append(getDropForeignKey()); + const ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString(); + aSql.append( ::dbtools::quoteName( aQuote,_sElementName) ); + } + + Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); + if ( xStmt.is() ) + { + xStmt->execute(aSql.makeStringAndClear()); + ::comphelper::disposeComponent(xStmt); + } } } } diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 9a150d4694..f8a43fd237 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -101,11 +101,40 @@ namespace connectivity struct OTableHelperImpl { TKeyMap m_aKeys; - Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; + // helper services which can be provided by extensions + Reference< ::com::sun::star::sdb::tools::XTableRename> m_xRename; + Reference< ::com::sun::star::sdb::tools::XTableAlteration> m_xAlter; + Reference< ::com::sun::star::sdb::tools::XKeyAlteration> m_xKeyAlter; + Reference< ::com::sun::star::sdb::tools::XIndexAlteration> m_xIndexAlter; + + Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; ::comphelper::ImplementationReference< OTableContainerListener,XContainerListener> m_xTablePropertyListener; ::std::vector< ColumnDesc > m_aColumnDesc; + OTableHelperImpl(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection) + : m_xConnection(_xConnection) + { + try + { + m_xMetaData = m_xConnection->getMetaData(); + Reference xFac(_xConnection,UNO_QUERY); + if ( xFac.is() ) + { + static const ::rtl::OUString s_sTableRename(RTL_CONSTASCII_USTRINGPARAM("TableRenameServiceName")); + m_xRename.set(xFac->createInstance(s_sTableRename),UNO_QUERY); + static const ::rtl::OUString s_sTableAlteration(RTL_CONSTASCII_USTRINGPARAM("TableAlterationServiceName")); + m_xAlter.set(xFac->createInstance(s_sTableAlteration),UNO_QUERY); + static const ::rtl::OUString s_sKeyAlteration(RTL_CONSTASCII_USTRINGPARAM("KeyAlterationServiceName")); + m_xKeyAlter.set(xFac->createInstance(s_sKeyAlteration),UNO_QUERY); + static const ::rtl::OUString s_sIndexAlteration(RTL_CONSTASCII_USTRINGPARAM("IndexAlterationServiceName")); + m_xIndexAlter.set(xFac->createInstance(s_sIndexAlteration),UNO_QUERY); + } + } + catch(const Exception&) + { + } + } }; } @@ -113,16 +142,8 @@ OTableHelper::OTableHelper( sdbcx::OCollection* _pTables, const Reference< XConnection >& _xConnection, sal_Bool _bCase) :OTable_TYPEDEF(_pTables,_bCase) - ,m_pImpl(new OTableHelperImpl) -{ - try - { - m_pImpl->m_xConnection = _xConnection; - m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData(); - } - catch(const Exception&) - { - } + ,m_pImpl(new OTableHelperImpl(_xConnection)) +{ } // ------------------------------------------------------------------------- OTableHelper::OTableHelper( sdbcx::OCollection* _pTables, @@ -140,16 +161,8 @@ OTableHelper::OTableHelper( sdbcx::OCollection* _pTables, _Description, _SchemaName, _CatalogName) - ,m_pImpl(new OTableHelperImpl) + ,m_pImpl(new OTableHelperImpl(_xConnection)) { - try - { - m_pImpl->m_xConnection = _xConnection; - m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData(); - } - catch(const Exception&) - { - } } // ----------------------------------------------------------------------------- OTableHelper::~OTableHelper() @@ -483,24 +496,31 @@ void SAL_CALL OTableHelper::rename( const ::rtl::OUString& newName ) throw(SQLEx if(!isNew()) { - ::rtl::OUString sSql = getRenameStart(); - ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( ); + if ( m_pImpl->m_xRename.is() ) + { + m_pImpl->m_xRename->rename(this,newName); + } + else + { + ::rtl::OUString sSql = getRenameStart(); + ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( ); - ::rtl::OUString sCatalog,sSchema,sTable; - ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); + ::rtl::OUString sCatalog,sSchema,sTable; + ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); - ::rtl::OUString sComposedName; - sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation); - sSql += sComposedName - + ::rtl::OUString::createFromAscii(" TO "); - sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation); - sSql += sComposedName; + ::rtl::OUString sComposedName; + sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation); + sSql += sComposedName + + ::rtl::OUString::createFromAscii(" TO "); + sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation); + sSql += sComposedName; - Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( ); - if ( xStmt.is() ) - { - xStmt->execute(sSql); - ::comphelper::disposeComponent(xStmt); + Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( ); + if ( xStmt.is() ) + { + xStmt->execute(sSql); + ::comphelper::disposeComponent(xStmt); + } } OTable_TYPEDEF::rename(newName); @@ -579,3 +599,24 @@ Reference< XConnection> OTableHelper::getConnection() const { return m_pImpl->m_xConnection; } +// ----------------------------------------------------------------------------- +Reference< ::com::sun::star::sdb::tools::XTableRename> OTableHelper::getRenameService() const +{ + return m_pImpl->m_xRename; +} +// ----------------------------------------------------------------------------- +Reference< ::com::sun::star::sdb::tools::XTableAlteration> OTableHelper::getAlterService() const +{ + return m_pImpl->m_xAlter; +} +// ----------------------------------------------------------------------------- +Reference< ::com::sun::star::sdb::tools::XKeyAlteration> OTableHelper::getKeyService() const +{ + return m_pImpl->m_xKeyAlter; +} +// ----------------------------------------------------------------------------- +Reference< ::com::sun::star::sdb::tools::XIndexAlteration> OTableHelper::getIndexService() const +{ + return m_pImpl->m_xIndexAlter; +} +// ----------------------------------------------------------------------------- diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 86a7f1e601..6c798efdf6 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -596,7 +596,39 @@ bool getBooleanDataSourceSetting( const Reference< XConnection >& _rxConnection, } return bValue; } +// ------------------------------------------------------------------------- +bool getDataSourceSetting( const Reference< XInterface >& _xChild, const ::rtl::OUString& _sAsciiSettingsName, + Any& /* [out] */ _rSettingsValue ) +{ + bool bIsPresent = false; + try + { + const Reference< XPropertySet> xDataSourceProperties( findDataSource( _xChild ), UNO_QUERY ); + OSL_ENSURE( xDataSourceProperties.is(), "getDataSourceSetting: invalid data source object!" ); + if ( !xDataSourceProperties.is() ) + return false; + + const Reference< XPropertySet > xSettings( + xDataSourceProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings") ) ), + UNO_QUERY_THROW + ); + _rSettingsValue = xSettings->getPropertyValue( _sAsciiSettingsName ); + bIsPresent = true; + } + catch( const Exception& ) + { + bIsPresent = false; + } + return bIsPresent; +} +// ------------------------------------------------------------------------- +bool getDataSourceSetting( const Reference< XInterface >& _rxDataSource, const sal_Char* _pAsciiSettingsName, + Any& /* [out] */ _rSettingsValue ) +{ + ::rtl::OUString sAsciiSettingsName = ::rtl::OUString::createFromAscii(_pAsciiSettingsName); + return getDataSourceSetting( _rxDataSource, sAsciiSettingsName,_rSettingsValue ); +} // ----------------------------------------------------------------------------- sal_Bool isDataSourcePropertyEnabled(const Reference& _xProp,const ::rtl::OUString& _sProperty,sal_Bool _bDefault) { -- cgit v1.2.3 From 30294eb4e252264bb9017337dd7ff6de1ced6407 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 17 Dec 2009 10:48:18 +0100 Subject: dba33e: #i107251#: allow to work with an external number formatter --- .../inc/connectivity/formattedcolumnvalue.hxx | 14 ++++ .../source/commontools/formattedcolumnvalue.cxx | 90 +++++++++++++--------- 2 files changed, 68 insertions(+), 36 deletions(-) diff --git a/connectivity/inc/connectivity/formattedcolumnvalue.hxx b/connectivity/inc/connectivity/formattedcolumnvalue.hxx index adaf558b98..1b3ef1060b 100644 --- a/connectivity/inc/connectivity/formattedcolumnvalue.hxx +++ b/connectivity/inc/connectivity/formattedcolumnvalue.hxx @@ -36,6 +36,7 @@ #include #include #include +#include /** === end UNO includes === **/ #include @@ -77,6 +78,19 @@ namespace dbtools const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn ); + /** constructs an instance + + The format key for the string value exchange is taken from the given column object. + If it has a non- property value FormatKey, this key is taken. + Otherwise, a default format matching the column type is determined. + + The locale of this fallback format is the current system locale. + */ + FormattedColumnValue( + const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& i_rNumberFormatter, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_rColumn + ); + // note that all methods of this class need to be virtual, since it's // used in a load-on-demand context in module SVX diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx index c809892cc4..bb74667f69 100644 --- a/connectivity/source/commontools/formattedcolumnvalue.cxx +++ b/connectivity/source/commontools/formattedcolumnvalue.cxx @@ -45,13 +45,11 @@ /** === end UNO includes === **/ #include - #include - #include - #include #include +#include //........................................................................ namespace dbtools @@ -62,6 +60,7 @@ namespace dbtools using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; @@ -116,21 +115,7 @@ namespace dbtools //................................................................ void lcl_clear_nothrow( FormattedColumnValue_Data& _rData ) { - if ( _rData.m_xFormatter.is() ) - { - try - { - Reference< XComponent > xFormatterComp( _rData.m_xFormatter, UNO_QUERY ); - if ( xFormatterComp.is() ) - xFormatterComp->dispose(); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - _rData.m_xFormatter.clear(); - } - + _rData.m_xFormatter.clear(); _rData.m_nFormatKey = 0; _rData.m_nFieldType = DataType::OTHER; _rData.m_nKeyType = NumberFormat::UNDEFINED; @@ -141,21 +126,24 @@ namespace dbtools } //................................................................ - void lcl_initColumnDataValue_nothrow( const ::comphelper::ComponentContext& _rContext, FormattedColumnValue_Data& _rData, - const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& _rxColumn ) + void lcl_initColumnDataValue_nothrow( FormattedColumnValue_Data& _rData, + const Reference< XNumberFormatter >& i_rNumberFormatter, const Reference< XPropertySet >& _rxColumn ) { lcl_clear_nothrow( _rData ); - OSL_PRECOND( _rxRowSet.is(), "lcl_initColumnDataValue_nothrow: no row set!" ); - OSL_PRECOND( _rxColumn.is(), "lcl_initColumnDataValue_nothrow: no column!" ); - if ( !_rxRowSet.is() || !_rxColumn.is() ) + OSL_PRECOND( i_rNumberFormatter.is(), "lcl_initColumnDataValue_nothrow: no number formats -> no formatted values!" ); + if ( !i_rNumberFormatter.is() ) return; try { + Reference< XNumberFormatsSupplier > xNumberFormatsSupp( i_rNumberFormatter->getNumberFormatsSupplier(), UNO_SET_THROW ); + + // remember the column _rData.m_xColumn.set( _rxColumn, UNO_QUERY_THROW ); _rData.m_xColumnUpdate.set( _rxColumn, UNO_QUERY ); + // determine the field type, and whether it's a numeric field OSL_VERIFY( _rxColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) >>= _rData.m_nFieldType ); switch ( _rData.m_nFieldType ) @@ -180,10 +168,6 @@ namespace dbtools break; } - // get the number formats supplier of the connection of the form - Reference< XConnection > xConnection( getConnection( _rxRowSet ), UNO_QUERY_THROW ); - Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_False, _rContext.getLegacyServiceFactory() ), UNO_QUERY_THROW ); - // get the format key of our bound field Reference< XPropertySetInfo > xPSI( _rxColumn->getPropertySetInfo(), UNO_QUERY_THROW ); bool bHaveFieldFormat = false; @@ -197,23 +181,49 @@ namespace dbtools // fall back to a format key as indicated by the field type Locale aSystemLocale; MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage(), aSystemLocale ); - Reference< XNumberFormatTypes > xNumTypes( xSupplier->getNumberFormats(), UNO_QUERY_THROW ); + Reference< XNumberFormatTypes > xNumTypes( xNumberFormatsSupp->getNumberFormats(), UNO_QUERY_THROW ); _rData.m_nFormatKey = getDefaultNumberFormat( _rxColumn, xNumTypes, aSystemLocale ); } // some more formatter settings - _rData.m_nKeyType = ::comphelper::getNumberFormatType( xSupplier->getNumberFormats(), _rData.m_nFormatKey ); - Reference< XPropertySet > xFormatSettings( xSupplier->getNumberFormatSettings(), UNO_QUERY_THROW ); + _rData.m_nKeyType = ::comphelper::getNumberFormatType( xNumberFormatsSupp->getNumberFormats(), _rData.m_nFormatKey ); + Reference< XPropertySet > xFormatSettings( xNumberFormatsSupp->getNumberFormatSettings(), UNO_QUERY_THROW ); OSL_VERIFY( xFormatSettings->getPropertyValue( ::rtl::OUString::createFromAscii( "NullDate" ) ) >>= _rData.m_aNullDate ); - // create a formatter working with the connection's number format supplier - _rData.m_xFormatter.set( _rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW ); - _rData.m_xFormatter->attachNumberFormatsSupplier( xSupplier ); + // remember the formatter + _rData.m_xFormatter = i_rNumberFormatter; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //................................................................ + void lcl_initColumnDataValue_nothrow( const ::comphelper::ComponentContext& i_rContext, FormattedColumnValue_Data& i_rData, + const Reference< XRowSet >& i_rRowSet, const Reference< XPropertySet >& i_rColumn ) + { + OSL_PRECOND( i_rRowSet.is(), "lcl_initColumnDataValue_nothrow: no row set!" ); + if ( !i_rRowSet.is() ) + return; + + Reference< XNumberFormatter > xNumberFormatter; + try + { + // get the number formats supplier of the connection of the form + Reference< XConnection > xConnection( getConnection( i_rRowSet ), UNO_QUERY_THROW ); + Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_True, i_rContext.getLegacyServiceFactory() ), UNO_SET_THROW ); + + // create a number formatter for it + xNumberFormatter.set( i_rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW ); + xNumberFormatter->attachNumberFormatsSupplier( xSupplier ); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } + + lcl_initColumnDataValue_nothrow( i_rData, xNumberFormatter, i_rColumn ); } } @@ -221,11 +231,19 @@ namespace dbtools //= FormattedColumnValue //==================================================================== //-------------------------------------------------------------------- - FormattedColumnValue::FormattedColumnValue( const ::comphelper::ComponentContext& _rContext, - const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& _rxColumn ) + FormattedColumnValue::FormattedColumnValue( const ::comphelper::ComponentContext& i_rContext, + const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& i_rColumn ) + :m_pData( new FormattedColumnValue_Data ) + { + lcl_initColumnDataValue_nothrow( i_rContext, *m_pData, _rxRowSet, i_rColumn ); + } + + //-------------------------------------------------------------------- + FormattedColumnValue::FormattedColumnValue( const Reference< XNumberFormatter >& i_rNumberFormatter, + const Reference< XPropertySet >& _rxColumn ) :m_pData( new FormattedColumnValue_Data ) { - lcl_initColumnDataValue_nothrow( _rContext, *m_pData, _rxRowSet, _rxColumn ); + lcl_initColumnDataValue_nothrow( *m_pData, i_rNumberFormatter, _rxColumn ); } //-------------------------------------------------------------------- -- cgit v1.2.3 From 89e664cb1eb422f55ce6abe23fdd6e68abc730e3 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 17 Dec 2009 13:44:23 +0100 Subject: autorecovery: do not create SfxFrame instances for an XFrame outside the loader --- sfx2/inc/sfx2/frame.hxx | 5 +++-- sfx2/source/appl/appserv.cxx | 9 +++++---- sfx2/source/view/frame2.cxx | 17 ++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 17715577ac..bce04e5953 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -138,8 +138,9 @@ protected: public: TYPEINFO(); - static SfxFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); - static SfxFrame* CreateBlank(); + static SfxFrame* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); + static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + CreateBlankFrame(); static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ); SvCompatWeakHdl* GetHdl(); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 8a0def2fd9..1cc6a8ed53 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -982,11 +982,12 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) aLoadArgs.put( "Model", pBasicIDE->GetModel() ); aLoadArgs.put( "URL", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sbasic" ) ) ); - Reference< XFrame > xStartModuleFrame( lcl_findStartModuleFrame( aContext ) ); - SfxFrame* pFrame = xStartModuleFrame.is() ? SfxFrame::Create( xStartModuleFrame ) : SfxFrame::CreateBlank(); - ENSURE_OR_THROW( pFrame, "could not create a SfxFrame to load the Basic IDE into!" ); + Reference< XFrame > xTargetFrame( lcl_findStartModuleFrame( aContext ) ); + if ( !xTargetFrame.is() ) + xTargetFrame = SfxFrame::CreateBlankFrame(); + ENSURE_OR_THROW( xTargetFrame.is(), "could not obtain a frameto load the Basic IDE into!" ); - xLoader->load( aLoadArgs.getPropertyValues(), pFrame->GetFrameInterface() ); + xLoader->load( aLoadArgs.getPropertyValues(), xTargetFrame ); } catch( const Exception& ) { diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 7e71e3a48c..0983e74ca5 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -237,21 +237,20 @@ void SfxFrameWindow_Impl::DoResize() pFrame->Resize(); } -SfxFrame* SfxFrame::CreateBlank() +Reference < XFrame > SfxFrame::CreateBlankFrame() { - SfxFrame* pFrame = NULL; + Reference < XFrame > xFrame; try { ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); - Reference < XFrame > xFrame = xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ); - pFrame = Create( xFrame ); + xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - return pFrame; + return xFrame; } SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ) @@ -315,15 +314,15 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI return pFrame; } -SfxFrame* SfxFrame::Create( Reference < XFrame > xFrame ) +SfxFrame* SfxFrame::Create( const Reference < XFrame >& i_rFrame ) { // create a new TopFrame to an external XFrame object ( wrap controller ) - ENSURE_OR_THROW( xFrame.is(), "NULL frame not allowed" ); - Window* pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); + ENSURE_OR_THROW( i_rFrame.is(), "NULL frame not allowed" ); + Window* pWindow = VCLUnoHelper::GetWindow( i_rFrame->getContainerWindow() ); ENSURE_OR_THROW( pWindow, "frame without container window not allowed" ); SfxFrame* pFrame = new SfxFrame( *pWindow, false ); - pFrame->SetFrameInterface_Impl( xFrame ); + pFrame->SetFrameInterface_Impl( i_rFrame ); return pFrame; } -- cgit v1.2.3 From 882ba251d83682f61bf98be23f6993e75e1ec425 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Dec 2009 09:48:23 +0100 Subject: autorecovery: removed a few unused slot IDs --- sfx2/inc/sfx2/sfxsids.hrc | 202 +------------ sfx2/sdi/sfx.sdi | 589 ++---------------------------------- sfx2/source/appl/appbas.cxx | 5 - sfx2/source/control/dispatch.cxx | 24 -- sfx2/source/dialog/mailmodelapi.cxx | 16 - sfx2/source/doc/objstor.cxx | 1 - sfx2/source/doc/objxtor.cxx | 9 - sfx2/source/view/viewfrm.cxx | 55 +--- sfx2/util/hidother.src | 30 -- svx/sdi/svx.sdi | 25 -- 10 files changed, 23 insertions(+), 933 deletions(-) diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index e23eec3931..92ee6f095d 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -123,7 +123,6 @@ #define SID_NONE 0 #define SID_UNKNOWN SID_SFX_START -#define SID_SUBREQUEST (SID_SFX_START+90) //------------------------------------------------------------------------- @@ -153,79 +152,28 @@ #define SID_PRINTER_CHANGESTODOC (SID_SFX_START + 324) #define SID_PRINTPREVIEW (SID_SFX_START + 325) -#define SID_MAIL_DATE (SID_SFX_START + 326) -#define SID_MAIL_FROM (SID_SFX_START + 327) #define SID_MAIL_SUBJECT (SID_SFX_START + 328) -#define SID_MAIL_OPEN (SID_SFX_START + 329) #define SID_MAIL_NOTIFY (SID_SFX_START + 330) #define SID_MAIL_SENDDOC (SID_SFX_START + 331) #define SID_MAIL_SENDDOCASPDF (SID_SFX_START + 1672) - #define SID_MAIL_RECIPIENT (SID_SFX_START + 334) #define SID_MAIL_TEXT (SID_SFX_START + 335) #define SID_MAIL_ATTACH (SID_SFX_START + 336) #define SID_MAIL_PRIORITY (SID_SFX_START + 337) -#define SID_MAIL_DELETE (SID_SFX_START + 338) -#define SID_MAIL_NEW (SID_SFX_START + 339) - -#define SID_MAIL_NEWWITHSERVER (SID_SFX_START + 360) -#define SID_MAIL_REPLY (SID_SFX_START + 361) -#define SID_MAIL_FOLLOWUP (SID_SFX_START + 362) -#define SID_MAIL_FORWARD (SID_SFX_START + 363) -#define SID_MAIL_SEND (SID_SFX_START + 364) -#define SID_MAIL_FILE (SID_SFX_START + 365) -#define SID_MAIL_MARKASREAD (SID_SFX_START + 366) -#define SID_MAIL_MARKASUNREAD (SID_SFX_START + 367) -#define SID_MAIL_NEXT (SID_SFX_START + 368) -#define SID_MAIL_PREV (SID_SFX_START + 369) -#define SID_MAIL_NEXTDELETE (SID_SFX_START + 370) -#define SID_MAIL_PREVDELETE (SID_SFX_START + 371) -#define SID_MAIL_OPEN_NEWS (SID_SFX_START + 372) -#define SID_MAIL_THREAD_MARKASREAD (SID_SFX_START + 373) -#define SID_MAIL_THREAD_MARKASUNREAD (SID_SFX_START + 374) + #define SID_MAIL_ATTACH_FILE (SID_SFX_START + 375) -#define SID_MAIL_DETACH_FILE (SID_SFX_START + 376) -#define SID_MAIL_MARK (SID_SFX_START + 377) -#define SID_MAIL_TXTFORMAT (SID_SFX_START + 378) -#define SID_MAIL_UPDATETOOLBOX (SID_SFX_START + 379) - -#define SID_OPEN_ANCHOR (SID_SFX_START + 380) -#define SID_MAIL_ADDRESSBOOK (SID_SFX_START + 1644) -#define SID_MAIL_ALLNEWSGROUPS (SID_SFX_START + 382) -#define SID_MAIL_GROUPREPLY (SID_SFX_START + 383) -#define SID_MAIL_SIGNATURE (SID_SFX_START + 384) -#define SID_MAIL_PREPAREEXPORT (SID_SFX_START + 385) -#define SID_MAIL_NEXTUNREAD (SID_SFX_START + 386) -#define SID_MAIL_PREVUNREAD (SID_SFX_START + 387) + #define SID_MAIL_EXPORT_FINISHED (SID_SFX_START + 388) -#define SID_NEWSSERVER_NAME (SID_SFX_START + 389) -#define SID_NEWS_GROUP_CHANGED (SID_SFX_START + 390) -#define SID_MAILBROWSER_CTRL (SID_SFX_START + 391) -#define SID_NEWSGROUP_NAME (SID_SFX_START + 392) #define SID_WEBHTML (SID_SFX_START + 393) #define SID_MAIL_SCROLLBODY_PAGEDOWN (SID_SFX_START + 1588) -#define SID_MAIL_REPLY_FOLLOWUP (SID_SFX_START + 1635) -#define SID_PHONE_STATUSBAR_CONTROL (SID_SFX_START + 398) -#define SID_RECOGNIZER_STATUSBAR_CONTROL (SID_SFX_START + 399) #define SID_PROGRESS_STATUSBAR_CONTROL (SID_SFX_START + 1597) -#define SID_RESOURCE_WARNING (SID_SFX_START + 333) - #define SID_APPLICATION (SID_SFX_START + 340) #define SID_PROGNAME (SID_SFX_START + 341) #define SID_PROGFILENAME (SID_SFX_START + 342) -#define SID_PROGPATH (SID_SFX_START + 343) -#define SID_INTERACTIVEMODE (SID_SFX_START + 344) -#define SID_PARENTOBJECT (SID_SFX_START + 345) #define SID_SELECTION (SID_SFX_START + 346) -#define SID_CREATOR (SID_SFX_START + 347) - -#define SID_COLL_COUNT (SID_SFX_START + 350) -#define SID_COLL_ITEM (SID_SFX_START + 351) -#define SID_COLL_REMOVE (SID_SFX_START + 352) -#define SID_COLL_ADD (SID_SFX_START + 353) // 360-400 siehe SID_MAIL_... @@ -277,26 +225,14 @@ #define SID_RELOAD (SID_SFX_START + 508) #define SID_PRINTDOCDIRECT (SID_SFX_START + 509) #define SID_PICKLIST (SID_SFX_START + 510) -#define SID_EDIT_FRAMESET (SID_SFX_START + 646) -#define SID_SPLIT_HORIZONTAL (SID_SFX_START + 647) -#define SID_SPLIT_VERTICAL (SID_SFX_START + 648) -#define SID_SPLIT_PARENT_HORIZONTAL (SID_SFX_START + 649) -#define SID_SPLIT_PARENT_VERTICAL (SID_SFX_START + 650) -#define SID_MODIFY_FRAME (SID_SFX_START + 651) -#define SID_DELETE_FRAME (SID_SFX_START + 652) -#define SID_FRAME_NAME (SID_SFX_START + 825) -#define SID_FRAME_CONTENT (SID_SFX_START + 826) #define SID_PLUGIN_MODE (SID_SFX_START + 827) -#define SID_LOCKBYTES_FACTORY (SID_SFX_START + 828) #define SID_EXPORTDOC (SID_SFX_START + 829) #define SID_EXPORTDOCASPDF (SID_SFX_START + 1673) #define SID_DIRECTEXPORTDOCASPDF (SID_SFX_START + 1674) #define SID_UPDATEDOCMODE (SID_SFX_START + 1668) -#define SID_NOCACHE (SID_SFX_START + 653) #define SID_FORCERELOAD (SID_SFX_START + 1502) #define SID_FILE_DIALOG (SID_SFX_START + 304) -#define SID_GRAFIC_DIALOG (SID_SFX_START + 305) #define SID_PATH (SID_SFX_START + 308) #define SID_SAVEDOCS (SID_SFX_START + 309) #define SID_STANDARD_DIR (SID_SFX_START + 450) @@ -305,88 +241,20 @@ // browse-ids #define SID_BROWSE_FORWARD (SID_SFX_START + 1300) #define SID_BROWSE_BACKWARD (SID_SFX_START + 1301) - // FREE, formerly SID_BROWSE_STOP #define SID_BROWSE_HOME (SID_SFX_START + 1303) -#define SID_AUTOBROWSE (SID_SFX_START + 1304) -#define SID_AUTOMAIL (SID_SFX_START + 1305) -#define SID_BROWSING (SID_SFX_START + 1306) -#define SID_ADDR_BOOK (SID_SFX_START + 1307) -#define SID_EXPLORER (SID_SFX_START + 1308) #define SID_CREATELINK (SID_SFX_START + 1309) #define SID_BOOKMARK_TITLE (SID_SFX_START + 1310) #define SID_BOOKMARK_URL (SID_SFX_START + 1311) #define SID_EDITDOC (SID_SFX_START + 1312) #define SID_BROWSER_MODE (SID_SFX_START + 1313) #define SID_PLUGINS_ACTIVE (SID_SFX_START + 1314) -#define SID_SAVEDOCTOBOOKMARK (SID_SFX_START + 1315) -#define SID_CLEARMEMCACHE (SID_SFX_START + 1316) #define SID_BROWSER (SID_SFX_START + 1318) #define SID_MACROEXECMODE (SID_SFX_START + 1319) -#define SID_EXPLORERCONTENT_OPEN (SID_SFX_START + 1322) -#define SID_EXPLORERCONTENT_OPEN_DOCUMENT (SID_SFX_START + 1321) -#define SID_EXPLORERCONTENT_OPEN_TEMPLATE (SID_SFX_START + 1362) -#define SID_EXPLORERCONTENT_OPEN_FOLDER (SID_SFX_START + 1542) -#define SID_EXPLORERCONTENT_OPEN_OBJECT (SID_SFX_START + 1543) -#define SID_EXPLORERCONTENT_NEW (SID_SFX_START + 1323) -#define SID_EXPLORERCONTENT_DESTROY (SID_SFX_START + 1324) -#define SID_EXPLORERCONTENT_MAKEROOT (SID_SFX_START + 1325) -#define SID_EXPLORERCONTENT_RENAME (SID_SFX_START + 1326) -#define SID_EXPLORERCONTENT_COPY (SID_SFX_START + 1327) -#define SID_EXPLORERCONTENT_PASTE (SID_SFX_START + 1328) -#define SID_EXPLORERCONTENT_CREATELINK (SID_SFX_START + 1329) -#define SID_EXPLORERCONTENT_DEFAULTTEMPLATE (SID_SFX_START + 1330) -#define SID_EXPLORER_CREATEFOLDER (SID_SFX_START + 1331) -#define SID_EXPLORER_CREATEBOOKMARK (SID_SFX_START + 1332) -#define SID_EXPLORER_CREATEWORKPLACE (SID_SFX_START + 1333) -#define SID_EXPLORER_CREATELINK (SID_SFX_START + 1334) -#define SID_EXPLORER_CREATEMAILINTRAY (SID_SFX_START + 1335) -#define SID_EXPLORER_CREATENEWSSERVER (SID_SFX_START + 1336) -#define SID_EXPLORER_CREATEFTPSERVER (SID_SFX_START + 1337) -#define SID_EXPLORER_CREATEDATABASE (SID_SFX_START + 1338) -#define SID_EXPLORER_CREATEGALLERY (SID_SFX_START + 1339) -#define SID_PROPERTIES (SID_SFX_START + 1350) -#define SID_EXPLORER_MAKEROOT (SID_SFX_START + 1351) -#define SID_EXPLORER_MAKEBMKDIR (SID_SFX_START + 1352) -#define SID_EXPLORER_PREVLEVEL (SID_SFX_START + 1353) -#define SID_EXPLORER_IMPORTBOOKMARKS (SID_SFX_START + 1354) -#define SID_EXPLORER_SEARCHORIGINAL (SID_SFX_START + 1355) -#define SID_EXPLORER_DETAILS (SID_SFX_START + 1356) -#define SID_EXPLORER_ICONS (SID_SFX_START + 1357) -#define SID_VIEWTYPE_DETAILS (SID_SFX_START + 1358) -#define SID_EXPLORER_MSGROUP_FSYS (SID_SFX_START + 1359) -#define SID_EXPLORER_MSGROUP_NEWSARTICLE (SID_SFX_START + 1360) -#define SID_EXPLORER_MSGROUP_NEWSGROUP (SID_SFX_START + 1361) -#define SID_EXPLORER_RESETURL (SID_SFX_START + 1520) - -#define SID_EXPLORER_DOCINFO (SID_SFX_START + 1363) -#define SID_EXPLORER_PREVIEW (SID_SFX_START + 1364) -#define SID_EXPLORER_MSGROUP_FTPFILE (SID_SFX_START + 1365) -#define SID_SEARCHORIGINAL (SID_SFX_START + 1366) -#define SID_EXPLORER_MSGROUP_MAILS (SID_SFX_START + 1367) -#define SID_EXPLORER_MSGROUP_CHAOS (SID_SFX_START + 1368) // die Id steht mit diesem Wert in chaos/cntids.hrc!! //#define SID_INTERNET_ONLINE (SID_SFX_START + 1370) -#define SID_INTERNET_UPDATE (SID_SFX_START + 1371) -#define SID_INTERNET_1 (SID_SFX_START + 1372) -#define SID_INTERNET_2 (SID_SFX_START + 1373) -#define SID_INTERNET_3 (SID_SFX_START + 1374) - #define SID_FILTER_DATA (SID_SFX_START + 1375) -#define SID_EXPLORER_SEARCH_DLG (SID_SFX_START + 1380) -#define SID_EXPLORER_MULTIQUICKSEARCH (SID_SFX_START + 1522) -#define SID_EXPLORER_SHOWEXTENSION (SID_SFX_START + 1594) -#define SID_EXPLORER_MAIL_HEADER (SID_SFX_START + 1595) -#define SID_EXPLORER_MAIL_BODY (SID_SFX_START + 1596) - -#define SID_TABPAGE (SID_SFX_START + 1383) -//#define SID_EXPLORER_CREATESEARCHFOLDER (SID_SFX_START + 1384) -#define SID_EMPTY_TRASH (SID_SFX_START + 1385) -#define SID_AFTEROPENEVENT (SID_SFX_START + 1386) -#define SID_QUERYICON (SID_SFX_START + 1387) -#define SID_SYNCEXPLORER (SID_SFX_START + 1388) -#define SID_EXPLORER_PASTE_ASLINK (SID_SFX_START + 1389) #define SID_EXPLORER_FILEPROPS_START (SID_SFX_START + 1390) #define SID_EXPLORER_FILEPROPS_END (SID_SFX_START + 1399) @@ -394,73 +262,23 @@ #define ID_FILETP_START SID_EXPLORER_FILEPROPS_START #define ID_FILETP_READONLY (ID_FILETP_START + 0) #define ID_FILETP_TITLE (ID_FILETP_START + 1) -#define ID_FILETP_SIZE (ID_FILETP_START + 2) -#define ID_FILETP_TYPE (ID_FILETP_START + 3) -#define ID_FILETP_PATH (ID_FILETP_START + 4) -#define ID_FILETP_CREATED (ID_FILETP_START + 5) -#define ID_FILETP_CHANGED (ID_FILETP_START + 6) -#define ID_FILETP_EDIT (ID_FILETP_START + 7) -#define ID_FILETP_IMAGE (ID_FILETP_START + 8) -#define ID_FILETP_LINK (ID_FILETP_START + 9) -#define ID_FILETP_END (ID_FILETP_START + 9) - -#define SID_NEWFRAMESET (SID_SFX_START + 1400) #define SID_EXPLORER_PROPS_START (SID_SFX_START + 1410) #define SID_EXPLORER_PROPS_END (SID_SFX_START + 1499) - - -#define SID_TRASH_RECOVER (SID_SFX_START + 1502) -#define SID_TRASH_AUTOEMPTY (SID_SFX_START + 1503) -#define SID_TRASH_EMPTY (SID_SFX_START + 1504) -#define SID_EXPLORER_BOOKMARKDIR (SID_SFX_START + 1505) -#define SID_EXPLORER_SEARCHORIG (SID_SFX_START + 1506) -#define SID_FRAMESPACING (SID_SFX_START + 1507) -#define SID_LATEINIT_DONE (SID_SFX_START + 1508) #define SID_AUTOLOAD (SID_SFX_START + 1509) -#define SID_FRAMECOUNT (SID_SFX_START + 1510) -#define SID_ISTOP (SID_SFX_START + 1511) #define SID_VIEW (SID_SFX_START + 1512) -#define SID_ORIG_PROPERTIES (SID_SFX_START + 1513) -#define SID_MAIL_NOTIFY_RESET (SID_SFX_START + 1514) #define SID_FILLFRAME (SID_SFX_START + 1516) -#define SID_LOAD_LIBRARY (SID_SFX_START + 1517) #define SID_BASEURL (SID_SFX_START + 1518) #define SID_TEMPLATE (SID_SFX_START + 1519) -#define SID_UNLOAD_LIBRARY (SID_SFX_START + 1523) -#define SID_ADD_LIBRARY (SID_SFX_START + 1524) -#define SID_REMOVE_LIBRARY (SID_SFX_START + 1525) -#define SID_CLASSNAME (SID_SFX_START + 1526) -#define SID_INTERCEPTOR (SID_SFX_START + 1527) -#define SID_TARGETPATH (SID_SFX_START + 1528) - -#define SID_START (SID_SFX_START + 1529) -#define SID_STOP (SID_SFX_START + 1530) -#define SID_VALUE (SID_SFX_START + 1531) -#define SID_SUSPEND (SID_SFX_START + 1532) -#define SID_RESUME (SID_SFX_START + 1533) -#define SID_LOCKALL (SID_SFX_START + 1534) -#define SID_WAITPOINTER (SID_SFX_START + 1535) - #define SID_ONLINE_REGISTRATION (SID_SFX_START + 1537) #define SID_ONLINE_REGISTRATION_DLG (SID_SFX_START + 1540) #define SID_CONTENTTYPE (SID_SFX_START + 1541) -#define SID_DOC_IGNOREINFORMATIONLOST (SID_SFX_START + 1544) -#define SID_EXPLORER_SELECTIONSIZE (SID_SFX_START + 1545) #define SID_SAVETO (SID_SFX_START + 1546) -#define SID_ADJUSTICONS (SID_SFX_START + 1547) -#define SID_AUTO_ADJUSTICONS (SID_SFX_START + 1548) -#define SID_ICONGRID (SID_SFX_START + 1549) -#define SID_BINDING (SID_SFX_START + 1550) - -#define SID_ISCHILDFRAMELOAD (SID_SFX_START + 1552) -#define SID_PARENTFRAME (SID_SFX_START + 1554) - #define SID_CREATE_BASICOBJECT (SID_SFX_START + 1555) #define SID_DELETE_BASICOBJECT (SID_SFX_START + 1556) @@ -469,27 +287,11 @@ #define SID_UPDATE_VERSION (SID_SFX_START + 1568) #define SID_BUILD_VERSION (SID_SFX_START + 1569) -#define SID_INSERT_TASKFRAME (SID_SFX_START + 1572) -#define SID_TASK (SID_SFX_START + 1573) -#define SID_ACTIVETASK (SID_SFX_START + 1574) -#define SID_EXPLORER_ISDESKTOP (SID_SFX_START + 1576) - -#define SID_CHAOSDOC_LAYOUT1 (SID_SFX_START + 1578) -#define SID_CHAOSDOC_LAYOUT2 (SID_SFX_START + 1579) -#define SID_CHAOSDOC_LAYOUT3 (SID_SFX_START + 1580) -#define SID_CHAOSDOC_LAYOUT4 (SID_SFX_START + 1581) - #define SID_VERSION (SID_SFX_START + 1583) -#define SID_UNO (SID_SFX_START + 1584) #define SID_DOCUMENT_COMPARE (SID_SFX_START + 1586) #define SID_DOCUMENT_MERGE (SID_SFX_START + 1587) -#define SID_EXECUTE (SID_SFX_START + 1593) -#define SID_OWNS_FRAME (SID_SFX_START + 1598) - -#define SID_OFFICE_VERSION_ID (SID_SFX_START + 1599) -#define SID_USE_FILTEROPTIONS (SID_SFX_START + 1600) #define SID_OFFICE_PLK (SID_SFX_START + 1601) #define SID_OFFICE_PALK (SID_SFX_START + 1604) #define SID_CHECK_KEY (SID_SFX_START + 1605) diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index aefed0f9e0..e415c4d728 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -980,31 +980,6 @@ SfxVoidItem ClearHistory SID_CLEARHISTORY GroupId = GID_OPTIONS; ] -//-------------------------------------------------------------------------- -SfxVoidItem ClearMemCache SID_CLEARMEMCACHE -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_OPTIONS; -] - //-------------------------------------------------------------------------- SfxBoolItem CloseWins SID_CLOSEWINS () @@ -1599,31 +1574,6 @@ SfxVoidItem DeleteCurrent SID_BASICIDE_DELETECURRENT GroupId = GID_MACRO; ] -//-------------------------------------------------------------------------- -SfxVoidItem DeleteFrame SID_DELETE_FRAME -(SfxStringItem Frame SID_FRAMETITLE) -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_EDIT; -] - //-------------------------------------------------------------------------- SfxUInt16Item DeleteStyle SID_STYLE_DELETE (SfxStringItem Param SID_STYLE_DELETE,SfxUInt16Item Family SID_STYLE_FAMILY) @@ -1727,33 +1677,6 @@ SfxBoolItem EditDoc SID_EDITDOC GroupId = GID_DOCUMENT; ] -//-------------------------------------------------------------------------- -SfxBoolItem EditFrameSet SID_EDIT_FRAMESET - -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - Readonly = FALSE, - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_EDIT; -] - //-------------------------------------------------------------------------- SfxVoidItem EditMacro SID_BASICIDE_EDITMACRO (SfxMacroInfoItem aMacroInfo SID_BASICIDE_ARG_MACROINFO) @@ -1857,31 +1780,6 @@ SfxBoolItem ExtendedHelp SID_EXTENDEDHELP GroupId = GID_APPLICATION; ] -//-------------------------------------------------------------------------- -SfxVoidItem FileDocument SID_SAVEDOCTOBOOKMARK -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DOCUMENT; -] - //-------------------------------------------------------------------------- SfxStringItem FileName SID_FILE_NAME @@ -1962,114 +1860,6 @@ SfxVoidItem FormatMenu SID_FORMATMENU GroupId = GID_EDIT; ] -//-------------------------------------------------------------------------- -SfxStringItem FrameContent SID_FRAME_CONTENT - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = TRUE, - RecordPerSet; - Synchron; - - Readonly = FALSE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- -SfxUInt16Item FrameCount SID_FRAMECOUNT - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = TRUE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = ; -] - -//-------------------------------------------------------------------------- -SfxStringItem FrameName SID_FRAME_NAME - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = TRUE, - RecordPerSet; - Synchron; - - Readonly = FALSE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- -SfxUInt16Item FrameSpacing SID_FRAMESPACING - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = FALSE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - //-------------------------------------------------------------------------- SfxTemplateItem FrameStyle SID_STYLE_FAMILY3 @@ -3224,33 +3014,6 @@ SfxVoidItem InsertObjectFloatingFrame SID_INSERT_FLOATINGFRAME GroupId = GID_INSERT; ] -//-------------------------------------------------------------------------- -SfxBoolItem Interactive SID_INTERACTIVEMODE - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = FALSE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = ; -] - //-------------------------------------------------------------------------- SfxBoolItem InternetOnline SID_INTERNET_ONLINE @@ -3303,31 +3066,6 @@ SfxVoidItem InternetSearch SID_INTERNET_SEARCH GroupId = ; ] -//-------------------------------------------------------------------------- -SfxVoidItem InternetUpdate SID_INTERNET_UPDATE -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = TRUE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_EXPLORER; -] - //-------------------------------------------------------------------------- SfxBoolItem IsLoading SID_DOC_LOADING @@ -3356,62 +3094,7 @@ SfxBoolItem IsLoading SID_DOC_LOADING ] //-------------------------------------------------------------------------- -SfxBoolItem IsLoadingImages SID_IMG_LOADING - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = TRUE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = TRUE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- -SfxBoolItem IsPrinting SID_PRINTOUT -[ - SfxVoidItem PrintOut(SfxInt16Item from SID_PRINT_FIRST_PAGE,SfxInt16Item to SID_PRINT_LAST_PAGE,SfxInt16Item copies SID_PRINT_COPIES,SfxBoolItem silent SID_SILENT); - - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = TRUE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = TRUE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_DOCUMENT; -] - -//-------------------------------------------------------------------------- -SfxBoolItem IsTopWindow SID_ISTOP +SfxBoolItem IsLoadingImages SID_IMG_LOADING [ /* flags: */ @@ -3419,8 +3102,8 @@ SfxBoolItem IsTopWindow SID_ISTOP Cachable = Cachable, FastCall = FALSE, HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, Toggle = FALSE, Container = TRUE, RecordAbsolute = FALSE, @@ -3434,37 +3117,40 @@ SfxBoolItem IsTopWindow SID_ISTOP MenuConfig = FALSE, StatusBarConfig = FALSE, ToolBoxConfig = FALSE, - GroupId = ; + GroupId = GID_VIEW; ] //-------------------------------------------------------------------------- -SfxVoidItem JumpToMark SID_JUMPTOMARK -(SfxStringItem Bookmark SID_JUMPTOMARK) +SfxBoolItem IsPrinting SID_PRINTOUT [ + SfxVoidItem PrintOut(SfxInt16Item from SID_PRINT_FIRST_PAGE,SfxInt16Item to SID_PRINT_LAST_PAGE,SfxInt16Item copies SID_PRINT_COPIES,SfxBoolItem silent SID_SILENT); + /* flags: */ AutoUpdate = FALSE, Cachable = Cachable, FastCall = FALSE, HasCoreId = FALSE, - HasDialog = FALSE, + HasDialog = TRUE, ReadOnlyDoc = TRUE, Toggle = FALSE, - Container = FALSE, + Container = TRUE, RecordAbsolute = FALSE, RecordPerSet; Synchron; + Readonly = TRUE, + /* config: */ AccelConfig = FALSE, MenuConfig = FALSE, StatusBarConfig = FALSE, ToolBoxConfig = FALSE, - GroupId = GID_NAVIGATOR; + GroupId = GID_DOCUMENT; ] //-------------------------------------------------------------------------- -SfxStringItem Keywords SID_DOCINFO_KEYWORDS - +SfxVoidItem JumpToMark SID_JUMPTOMARK +(SfxStringItem Bookmark SID_JUMPTOMARK) [ /* flags: */ AutoUpdate = FALSE, @@ -3479,18 +3165,16 @@ SfxStringItem Keywords SID_DOCINFO_KEYWORDS RecordPerSet; Synchron; - Readonly = FALSE, - /* config: */ AccelConfig = FALSE, MenuConfig = FALSE, StatusBarConfig = FALSE, ToolBoxConfig = FALSE, - GroupId = ; + GroupId = GID_NAVIGATOR; ] //-------------------------------------------------------------------------- -SfxBoolItem LateInitDone SID_LATEINIT_DONE +SfxStringItem Keywords SID_DOCINFO_KEYWORDS [ /* flags: */ @@ -3499,21 +3183,21 @@ SfxBoolItem LateInitDone SID_LATEINIT_DONE FastCall = FALSE, HasCoreId = FALSE, HasDialog = FALSE, - ReadOnlyDoc = FALSE, + ReadOnlyDoc = TRUE, Toggle = FALSE, - Container = TRUE, + Container = FALSE, RecordAbsolute = FALSE, RecordPerSet; Synchron; - Readonly = TRUE, + Readonly = FALSE, /* config: */ AccelConfig = FALSE, MenuConfig = FALSE, StatusBarConfig = FALSE, ToolBoxConfig = FALSE, - GroupId = GID_APPLICATION; + GroupId = ; ] //-------------------------------------------------------------------------- @@ -3963,32 +3647,6 @@ SfxVoidItem MacroDialog SID_BASICCHOOSER GroupId = GID_MACRO; ] -//-------------------------------------------------------------------------- -SfxVoidItem MailNotifyReset SID_MAIL_NOTIFY_RESET -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = TRUE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_EXPLORER; -] - - //-------------------------------------------------------------------------- SfxUInt16Item MailReceipt SID_MAIL_NOTIFY @@ -4201,31 +3859,6 @@ SfxStringItem ModifiedStatus SID_DOC_MODIFIED GroupId = GID_VIEW; ] -//-------------------------------------------------------------------------- -SfxVoidItem ModifyFrame SID_MODIFY_FRAME -() -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = TRUE, - RecordPerItem; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_EDIT; -] - //-------------------------------------------------------------------------- SfxVoidItem ModuleDialog SID_BASICIDE_MODULEDLG () @@ -4354,34 +3987,6 @@ SfxVoidItem NewDialog SID_BASICIDE_NEWDIALOG GroupId = GID_MACRO; ] -//-------------------------------------------------------------------------- -SfxObjectItem NewFrameSet SID_NEWFRAMESET -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - /* status: */ - SlotType = SfxStringItem - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_APPLICATION; -] - //-------------------------------------------------------------------------- SfxVoidItem NewModule SID_BASICIDE_NEWMODULE () @@ -4534,33 +4139,6 @@ SfxStringItem ObjectMenue SID_OBJECT GroupId = GID_EDIT; ] -//-------------------------------------------------------------------------- -SfxStringItem OfficeVersionId SID_OFFICE_VERSION_ID - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = TRUE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_SPECIAL; -] - //-------------------------------------------------------------------------- SfxStringItem OldPALK SID_OLD_PALK @@ -4980,33 +4558,6 @@ SfxStringItem DocPath SID_DOCPATH GroupId = ; ] -//-------------------------------------------------------------------------- -SfxStringItem Path SID_PROGPATH - -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = TRUE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = TRUE, - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = ; -] - //-------------------------------------------------------------------------- SfxVoidItem PickList SID_PICKLIST () @@ -6414,106 +5965,6 @@ SfxBoolItem SourceView SID_SOURCEVIEW GroupId = GID_OPTIONS; ] -//-------------------------------------------------------------------------- -SfxObjectItem SplitHorizontal SID_SPLIT_HORIZONTAL -(SfxStringItem Frame SID_FRAMETITLE) -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_EDIT; -] - -//-------------------------------------------------------------------------- -SfxObjectItem SplitParentHorizontal SID_SPLIT_PARENT_HORIZONTAL -(SfxStringItem Frame SID_FRAMETITLE) -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_EDIT; -] - -//-------------------------------------------------------------------------- -SfxObjectItem SplitParentVertical SID_SPLIT_PARENT_VERTICAL -(SfxStringItem Frame SID_FRAMETITLE) -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_EDIT; -] - -//-------------------------------------------------------------------------- -SfxObjectItem SplitVertical SID_SPLIT_VERTICAL -(SfxStringItem Frame SID_FRAMETITLE) -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_EDIT; -] - //-------------------------------------------------------------------------- SfxVoidItem StartRegistrationDialog SID_ONLINE_REGISTRATION_DLG () diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index a7a663a128..160ce5c266 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -425,11 +425,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) break; } - case SID_INTERACTIVEMODE: - { - break; - } - case SID_ATTR_UNDO_COUNT: { SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID, sal_False); diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 9a1456c66e..b88434c623 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -242,7 +242,6 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest SFX_STACK(SfxDispatcher::Call_Impl); // darf der Slot gerufen werden (i.S.v. enabled) - SfxApplication *pSfxApp = SFX_APP(); if ( rSlot.IsMode(SFX_SLOT_FASTCALL) || rShell.CanExecuteSlot_Impl(rSlot) ) { if ( GetFrame() ) @@ -273,19 +272,6 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest // Alles holen, was gebraucht wird, da der Slot den Execute evtl. nicht // "uberlebt, falls es ein 'Pseudoslot' f"ur Macros oder Verben ist sal_Bool bAutoUpdate = rSlot.IsMode(SFX_SLOT_AUTOUPDATE); - SFX_REQUEST_ARG(rReq, pOrigItem, SfxExecuteItem, SID_SUBREQUEST, sal_False); - SfxExecuteItem *pExecuteItem = pOrigItem - ? (SfxExecuteItem*)pOrigItem->Clone() - : 0; - - // ggf. TabPage-ID setzen - SfxAppData_Impl *pAppData = pSfxApp->Get_Impl(); - SFX_REQUEST_ARG(rReq, pTabPageItem, SfxUInt16Item, SID_TABPAGE, sal_False); - if ( pTabPageItem ) - { - pAppData->nAutoTabPageId = pTabPageItem->GetValue(); - rReq.RemoveItem( SID_TABPAGE ); // sonst ArgCount > 0 => Seiteneff. - } // API-Call-Klammerung und Document-Lock w"ahrend des Calls { @@ -319,16 +305,6 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest } } - // TabPage-ID und Executing-SID zurueck setzen - if ( pTabPageItem ) - pAppData->nAutoTabPageId = 0; - - if( pExecuteItem ) - { - Execute( *pExecuteItem ); - delete pExecuteItem; - } - if ( rReq.IsDone() ) { SfxBindings *pBindings = GetBindings(); diff --git a/sfx2/source/dialog/mailmodelapi.cxx b/sfx2/source/dialog/mailmodelapi.cxx index d2158c3dad..d26bb14b43 100644 --- a/sfx2/source/dialog/mailmodelapi.cxx +++ b/sfx2/source/dialog/mailmodelapi.cxx @@ -331,14 +331,6 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocument( const ::rtl::OUString& _sAt // save the document if ( xMod.is() ) { - // save old settings -/* - BOOL bModified = xMod->isModified(); - // prepare for mail export - TODO - SfxDispatcher* pDisp = pTopViewFrm->GetDispatcher(); - pDisp->Execute( SID_MAIL_PREPAREEXPORT, SFX_CALLMODE_SYNCHRON ); -*/ // detect filter const SfxFilter* pFilter = SfxFilter::GetDefaultFilter(lcl_getFactoryName(_xModel)); // sal_Bool bHasFilter = pFilter != NULL; @@ -435,14 +427,6 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocAsPDF( const ::rtl::OUString& _sAt // save the document if ( xMod.is() ) { - /* TODO - // save old settings - BOOL bModified = xMod->isModified(); - // prepare for mail export - SfxDispatcher* pDisp = pTopViewFrm->GetDispatcher(); - pDisp->Execute( SID_MAIL_PREPAREEXPORT, SFX_CALLMODE_SYNCHRON ); - */ - // Get PDF Filter from document ::rtl::OUString sPDFMediaType(RTL_CONSTASCII_USTRINGPARAM("application/pdf")); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 06c228d71b..ec2b3af2b8 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2765,7 +2765,6 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl pSet->ClearItem( SID_OPTIONS ); //pSet->ClearItem( SID_FILE_FILTEROPTIONS ); pSet->ClearItem( SID_VERSION ); - //pSet->ClearItem( SID_USE_FILTEROPTIONS ); pSet->ClearItem( SID_EDITDOC ); pSet->ClearItem( SID_OVERWRITE ); pSet->ClearItem( SID_DEFAULTFILEPATH ); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 5313b8ee67..50b8542ccc 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -633,15 +633,6 @@ sal_uInt16 SfxObjectShell::PrepareClose } } - // ggf. hinweisen, da\s unter Fremdformat gespeichert - if( pMedium ) - { - SFX_ITEMSET_ARG( pMedium->GetItemSet(), pIgnoreInformationLost, - SfxBoolItem, SID_DOC_IGNOREINFORMATIONLOST, sal_False); - if( pIgnoreInformationLost && pIgnoreInformationLost->GetValue() ) - bUI = sal_False; - } - pImp->bPreparedForClose = sal_True; return sal_True; } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 1201375e54..b286756fec 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -297,8 +297,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } SfxObjectShell* pSh = GetObjectShell(); - sal_Bool bWasReadonly = pSh->IsReadOnly(); - switch ( rReq.GetSlot() ) { case SID_EDITDOC: @@ -439,12 +437,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // r/o-Doc kann nicht in Editmode geschaltet werden? rReq.Done( sal_False ); - SFX_REQUEST_ARG( rReq, pFSetItem, SfxBoolItem, SID_EDIT_FRAMESET, sal_False); if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() ) { // dem ::com::sun::star::sdbcx::User anbieten, als Vorlage zu oeffnen QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_OPENASTEMPLATE) ); - if ( !pFSetItem && RET_YES == aBox.Execute() ) + if ( RET_YES == aBox.Execute() ) { SfxApplication* pApp = SFX_APP(); SfxAllItemSet aSet( pApp->GetPool() ); @@ -485,16 +482,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) rReq.Done( sal_True ); // if( nOpenMode == SFX_STREAM_READONLY ) // pMed->Close(); - - // ReloadForEdit bei Framesets schaltet auch FramesetEditmode - sal_Bool bIsReadonly = GetObjectShell()->IsReadOnly(); - if ( bIsReadonly != bWasReadonly && !GetFrame().GetParentFrame() ) - { - SfxBoolItem aItem( SID_EDIT_FRAMESET, !bIsReadonly ); - GetDispatcher()->Execute( SID_EDIT_FRAMESET, - SFX_CALLMODE_RECORD, &aItem, 0L ); - pSh->Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) ); - } return; } } @@ -2300,46 +2287,6 @@ void SfxViewFrame::ExecView_Impl break; } - case SID_FILLFRAME: - { - // Bei Mail etc. k"onnen die Frames nicht angesprochen werden - SfxViewFrame *pRet = NULL; - SFX_REQUEST_ARG( - rReq, pItem, SfxStringItem, SID_FILLFRAME, sal_False ); - if ( pItem ) - { - String aName( pItem->GetValue() ); - sal_uInt16 nFrame = (sal_uInt16) aName.ToInt32(); - if ( nFrame == 0 ) - nFrame = USHRT_MAX; - - SfxFrameIterator aIter( GetFrame(), sal_False ); - SfxFrame *pFrame = aIter.FirstFrame(); - sal_uInt16 nActFrame = 1; - while ( pFrame ) - { - SfxViewFrame *pView = pFrame->GetCurrentViewFrame(); - if ( - nActFrame == nFrame || - ( - pView && - aName.CompareIgnoreCaseToAscii( pView->SfxShell::GetName() ) == COMPARE_EQUAL - ) - ) - { - pRet = pView; - break; - } - - pFrame = aIter.NextFrame( *pFrame ); - nActFrame++; - } - } - - rReq.SetReturnValue( SfxObjectItem( SID_DOCFRAME, pRet ) ); - break; - } - case SID_VIEWSHELL: { const SfxPoolItem *pItem = 0; diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src index 004221203a..2486b6da66 100644 --- a/sfx2/util/hidother.src +++ b/sfx2/util/hidother.src @@ -60,35 +60,12 @@ hidspecial SID_STYLE_FAMILY4 { HelpID = SID_STYLE_FAMILY4; }; hidspecial SID_STYLE_FAMILY5 { HelpID = SID_STYLE_FAMILY5; }; hidspecial SID_FILTER_NAME { HelpID = SID_FILTER_NAME; }; hidspecial HID_NAVIGATOR_WINDOW { HelpID = HID_NAVIGATOR_WINDOW; }; -hidspecial SID_EXPLORERCONTENT_OPEN { HelpId = SID_EXPLORERCONTENT_OPEN; }; -hidspecial SID_EXPLORERCONTENT_OPEN_FOLDER { HelpId = SID_EXPLORERCONTENT_OPEN_FOLDER; }; -hidspecial SID_EXPLORERCONTENT_OPEN_TEMPLATE { HelpId = SID_EXPLORERCONTENT_OPEN_TEMPLATE; }; -hidspecial SID_EXPLORERCONTENT_OPEN_DOCUMENT { HelpId = SID_EXPLORERCONTENT_OPEN_DOCUMENT; }; -hidspecial SID_EXPLORERCONTENT_OPEN_OBJECT { HelpId = SID_EXPLORERCONTENT_OPEN_OBJECT; }; hidspecial HID_HELPAGENT_TIP_BOX { HelpId = HID_HELPAGENT_TIP_BOX; }; -hidspecial SID_EXPLORER_SEARCH_DLG { HelpId = SID_EXPLORER_SEARCH_DLG; }; -hidspecial SID_TRASH_RECOVER { HelpId = SID_TRASH_RECOVER; }; -hidspecial SID_TRASH_AUTOEMPTY { HelpId = SID_TRASH_AUTOEMPTY; }; -hidspecial SID_TRASH_EMPTY { HelpId = SID_TRASH_EMPTY; }; -hidspecial SID_EXPLORERCONTENT_NEW { HelpId = SID_EXPLORERCONTENT_NEW; }; -hidspecial SID_EXPLORERCONTENT_DESTROY { HelpId = SID_EXPLORERCONTENT_DESTROY; }; -hidspecial SID_EXPLORERCONTENT_RENAME { HelpId = SID_EXPLORERCONTENT_RENAME; }; -hidspecial SID_EXPLORERCONTENT_COPY { HelpId = SID_EXPLORERCONTENT_COPY; }; -hidspecial SID_EXPLORERCONTENT_PASTE { HelpId = SID_EXPLORERCONTENT_PASTE; }; -hidspecial SID_EXPLORERCONTENT_CREATELINK { HelpId = SID_EXPLORERCONTENT_CREATELINK; }; -hidspecial SID_EXPLORERCONTENT_MAKEROOT { HelpId = SID_EXPLORERCONTENT_MAKEROOT; }; -hidspecial SID_EXPLORERCONTENT_DEFAULTTEMPLATE { HelpId = SID_EXPLORERCONTENT_DEFAULTTEMPLATE; }; -hidspecial SID_PROPERTIES { HelpId = SID_PROPERTIES; }; -hidspecial SID_EXPLORER_BOOKMARKDIR { HelpId = SID_EXPLORER_BOOKMARKDIR; }; -hidspecial SID_EXPLORER_SEARCHORIG { HelpId = SID_EXPLORER_SEARCHORIG; }; hidspecial HID_TEMPLDLG_TOOLBOX_LEFT { HelpId = HID_TEMPLDLG_TOOLBOX_LEFT;}; hidspecial HID_EXPLORER_SRCH_COUNT { HelpId = HID_EXPLORER_SRCH_COUNT;}; -hidspecial SID_EXPLORER_PASTE_ASLINK { HelpId = SID_EXPLORER_PASTE_ASLINK;}; hidspecial HID_INTERFACE_SFXPLUGINVIEW { HelpID = HID_INTERFACE_SFXPLUGINVIEW; }; hidspecial HID_TABDLG_RESET_BTN { HelpID = HID_TABDLG_RESET_BTN; }; hidspecial HID_TABDLG_STANDARD_BTN { HelpID = HID_TABDLG_STANDARD_BTN; }; -hidspecial SID_EXPLORER_RESETURL { HelpID = SID_EXPLORER_RESETURL; }; -hidspecial SID_ORIG_PROPERTIES { HelpID = SID_ORIG_PROPERTIES; }; hidspecial HID_CONFIG_EVENT_OFFICE_BASED { HelpID = HID_CONFIG_EVENT_OFFICE_BASED; }; hidspecial HID_CONFIG_EVENT_DOCUMENT_BASED { HelpID = HID_CONFIG_EVENT_DOCUMENT_BASED; }; hidspecial HID_EXPLORER_SRCH_LATEST_COUNT { HelpID = HID_EXPLORER_SRCH_LATEST_COUNT; }; @@ -100,10 +77,6 @@ hidspecial HID_CHAOSDOC_WIN { HelpID = HID_CHAOSDOC_WIN; }; hidspecial HID_CHAOSDOC_WIN_HEADER { HelpID = HID_CHAOSDOC_WIN_HEADER; }; hidspecial HID_CHAOSDOC_WIN_PARTS { HelpID = HID_CHAOSDOC_WIN_PARTS; }; hidspecial HID_CHAOSDOC_WIN_BODY { HelpID = HID_CHAOSDOC_WIN_BODY; }; -hidspecial SID_CHAOSDOC_LAYOUT1 { HelpID = SID_CHAOSDOC_LAYOUT1; }; -hidspecial SID_CHAOSDOC_LAYOUT2 { HelpID = SID_CHAOSDOC_LAYOUT2; }; -hidspecial SID_CHAOSDOC_LAYOUT3 { HelpID = SID_CHAOSDOC_LAYOUT3; }; -hidspecial SID_CHAOSDOC_LAYOUT4 { HelpID = SID_CHAOSDOC_LAYOUT4; }; hidspecial HID_BRWBOX_HEADERBAR { HelpID = HID_BRWBOX_HEADERBAR; }; hidspecial HID_TASKBAR { HelpID = HID_TASKBAR; }; hidspecial HID_TASKBUTTONBAR { HelpID = HID_TASKBUTTONBAR; }; @@ -129,9 +102,6 @@ hidspecial HID_CHAOS_NEW_SUBSCR_BOX { HelpID = HID_CHAOS_NEW_SUBSCR_BOX; }; hidspecial HID_CHAOS_NEW_BOOKMARK { HelpID = HID_CHAOS_NEW_BOOKMARK; }; hidspecial HID_CHAOS_NEW_PUB_BOX { HelpID = HID_CHAOS_NEW_PUB_BOX; }; hidspecial HID_UUI_END { HelpID = HID_UUI_END; }; // aka HID_CHAOS_NEW_DATABASE -hidspecial SID_EXPLORER_SHOWEXTENSION { HelpID = SID_EXPLORER_SHOWEXTENSION; }; -hidspecial SID_EXPLORER_MAIL_HEADER { HelpID = SID_EXPLORER_MAIL_HEADER; }; -hidspecial SID_EXPLORER_MAIL_BODY { HelpID = SID_EXPLORER_MAIL_BODY; }; hidspecial HID_CNT_DLG_SEARCH_BT_SHOW { HelpID = HID_CNT_DLG_SEARCH_BT_SHOW; }; hidspecial HID_CNT_DLG_SEARCH_BT_UPDATE { HelpID = HID_CNT_DLG_SEARCH_BT_UPDATE; }; hidspecial HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE { HelpID = HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE; }; diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index e3826708c1..c4a82a436c 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -13192,31 +13192,6 @@ SfxVoidItem SpellCheckerChanged SID_SPELLCHECKER_CHANGED GroupId = GID_SPECIAL; ] -//-------------------------------------------------------------------------- -SfxVoidItem PrepareMailExport SID_MAIL_PREPAREEXPORT -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_EXPLORER; -] - //-------------------------------------------------------------------------- SfxUInt16Item Year2000 SID_ATTR_YEAR2000 () -- cgit v1.2.3 From 3f1e151486cd267ddee98c6e1311642705b2184f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Dec 2009 12:32:21 +0100 Subject: autorecovery: explicitly specify 'Hidden' when recovering documents, and remove the hack of not showing a frame when there is a 'SalvagedFile' item in the load args --- framework/source/loadenv/loadenv.cxx | 19 +++++++++---------- framework/source/services/autorecovery.cxx | 3 +++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index d131a3b6e8..5265e5b484 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1629,7 +1629,6 @@ void LoadEnv::impl_reactForLoadingState() // We dont hide already visible frames here ... css::uno::Reference< css::awt::XWindow > xWindow = m_xTargetFrame->getContainerWindow(); sal_Bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_HIDDEN(), sal_False); - sal_Bool bRecovered = (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_SALVAGEDFILE()) != m_lMediaDescriptor.end()); sal_Bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_MINIMIZED(), sal_False); if (bMinimized) @@ -1641,7 +1640,7 @@ void LoadEnv::impl_reactForLoadingState() ((WorkWindow*)pWindow)->Minimize(); } else - if (!bHidden && !bRecovered) + if (!bHidden) { // show frame ... if it's not still visible ... // But do nothing if it's already visible! @@ -1750,18 +1749,18 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X Window* pWindow = VCLUnoHelper::GetWindow(xWindow); if ( pWindow ) { - bool bForceFrontAndFocus(false); - css::uno::Any a = ::comphelper::ConfigurationHelper::readDirectKey( - xSMGR, - ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/View"), - ::rtl::OUString::createFromAscii("NewDocumentHandling"), - ::rtl::OUString::createFromAscii("ForceFocusAndToFront"), - ::comphelper::ConfigurationHelper::E_READONLY); + bool bForceFrontAndFocus(false); + css::uno::Any a = ::comphelper::ConfigurationHelper::readDirectKey( + xSMGR, + ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/View"), + ::rtl::OUString::createFromAscii("NewDocumentHandling"), + ::rtl::OUString::createFromAscii("ForceFocusAndToFront"), + ::comphelper::ConfigurationHelper::E_READONLY); a >>= bForceFrontAndFocus; pWindow->Show(sal_True, (bForceFrontAndFocus || bForceToFront) ? SHOW_FOREGROUNDTASK : 0 ); } - + /* #i19976# We tried to prevent a toFront() call in case the user putted the loading document into the background .. diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index ca7b94f2c5..f843f5a39e 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2448,6 +2448,9 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa lDescriptor[::comphelper::MediaDescriptor::PROP_REFERRER()] <<= REFERRER_USER; lDescriptor[::comphelper::MediaDescriptor::PROP_SALVAGEDFILE()] <<= ::rtl::OUString(); + // recovered documents are loaded hidden, and shown all at once, later + lDescriptor[::comphelper::MediaDescriptor::PROP_HIDDEN()] <<= true; + if (aParams.m_xProgress.is()) lDescriptor[::comphelper::MediaDescriptor::PROP_STATUSINDICATOR()] <<= aParams.m_xProgress; -- cgit v1.2.3 From f48a6a1c94a06b7fb0fa377e2c9804f23402ab9e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Dec 2009 12:34:33 +0100 Subject: autorecovery: ensure that unsaved XML forms are properly recovered, by properly respecting the 'Hidden' load parameter --- sfx2/inc/frmload.hxx | 3 ++- sfx2/inc/sfx2/viewfrm.hxx | 2 +- sfx2/sdi/sfx.sdi | 10 +++++----- sfx2/source/view/frmload.cxx | 7 +++++-- sfx2/source/view/viewfrm.cxx | 16 ++++++++++------ 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 768d0a1a4b..a5ecdc95f7 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -100,7 +100,8 @@ private: sal_Bool impl_createNewDocWithSlotParam( const USHORT _nSlotID, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame, + const bool i_bHidden ); void impl_determineFilter( diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index e6b6f4f3aa..0ccd769c46 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -169,8 +169,8 @@ public: static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId ); static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); - static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxUnoFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 ); static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrameItem, const USHORT i_nViewId = 0 ); + static SfxViewFrame* DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const USHORT i_nViewId = 0 ); static SfxViewFrame* Current(); static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE ); diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index e415c4d728..643389259e 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -7489,7 +7489,7 @@ SfxVoidItem AutoPilotAddressDataSource SID_ADDRESS_DATA_SOURCE //-------------------------------------------------------------------------- SfxVoidItem InsertBusinessCard FN_BUSINESS_CARD -( SfxUnoFrameItem Frame SID_FILLFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN ) [ /* flags: */ AutoUpdate = FALSE, @@ -7514,7 +7514,7 @@ SfxVoidItem InsertBusinessCard FN_BUSINESS_CARD //-------------------------------------------------------------------------- SfxVoidItem InsertLabels FN_LABEL -( SfxUnoFrameItem Frame SID_FILLFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN ) [ /* flags: */ AutoUpdate = FALSE, @@ -7539,7 +7539,7 @@ SfxVoidItem InsertLabels FN_LABEL //-------------------------------------------------------------------------- SfxVoidItem NewXForms FN_XFORMS_INIT -( SfxUnoFrameItem Frame SID_FILLFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN ) [ /* flags: */ AutoUpdate = FALSE, @@ -7564,7 +7564,7 @@ SfxVoidItem NewXForms FN_XFORMS_INIT //-------------------------------------------------------------------------- SfxVoidItem AutoPilotPresentations SID_SD_AUTOPILOT -( SfxUnoFrameItem Frame SID_FILLFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN ) [ /* flags: */ AutoUpdate = FALSE, @@ -7589,7 +7589,7 @@ SfxVoidItem AutoPilotPresentations SID_SD_AUTOPILOT //-------------------------------------------------------------------------- SfxVoidItem NewPresentation SID_NEWSD -( SfxUnoFrameItem Frame SID_FILLFRAME ) +( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN ) [ /* flags: */ AutoUpdate = FALSE, diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 8466eacb02..10c65773a9 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -256,10 +256,13 @@ namespace } // -------------------------------------------------------------------------------------------------------------------- -sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, const Reference< XFrame >& i_rxFrame ) +sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, const Reference< XFrame >& i_rxFrame, + const bool i_bHidden ) { SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() ); aRequest.AppendItem( SfxUnoFrameItem( SID_FILLFRAME, i_rxFrame ) ); + if ( i_bHidden ) + aRequest.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); return lcl_getDispatchResult( SFX_APP()->ExecuteSlot( aRequest ) ); } @@ -575,7 +578,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA const USHORT nSlotParam = impl_findSlotParam( sFactory ); if ( nSlotParam != 0 ) { - return impl_createNewDocWithSlotParam( nSlotParam, _rTargetFrame ); + return impl_createNewDocWithSlotParam( nSlotParam, _rTargetFrame, aDescriptor.getOrDefault( "Hidden", false ) ); } const bool bDescribesValidTemplate = impl_determineTemplateDocument( aDescriptor ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index b286756fec..636ca95581 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1998,10 +1998,6 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame, const USHORT i_nViewId, const bool i_bHidden ) { - OSL_PRECOND( !i_bHidden || !i_rFrame.is(), - "SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow: loading *hidden* into an *existing* frame is not supported!" ); - // Care for this frame's visibility yourself, please - Reference< XFrame > xFrame( i_rFrame ); bool bOwnFrame = false; SfxViewShell* pSuccessView = NULL; @@ -2112,9 +2108,17 @@ SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const } //-------------------------------------------------------------------- -SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxUnoFrameItem* i_pFrameItem, const USHORT i_nViewId ) +SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const USHORT i_nViewId ) { - return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_pFrameItem ? i_pFrameItem->GetFrame() : NULL, i_nViewId, false ); + SFX_REQUEST_ARG( i_rCreateDocRequest, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE ); + SFX_REQUEST_ARG( i_rCreateDocRequest, pHiddenItem, SfxBoolItem, SID_HIDDEN, FALSE ); + + return LoadViewIntoFrame_Impl_NoThrow( + i_rDoc, + pFrameItem ? pFrameItem->GetFrame() : NULL, + i_nViewId, + pHiddenItem ? pHiddenItem->GetValue() : false + ); } //-------------------------------------------------------------------- -- cgit v1.2.3 From 091322cdf55f4a3c490b5da02296362612792566 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Dec 2009 12:52:31 +0100 Subject: autorecovery: corrected GetViewName --- sfx2/source/view/viewfac.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index a8a201e170..594273aa51 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -56,7 +56,7 @@ String SfxViewFactory::GetViewName() const { ::rtl::OUStringBuffer aViewName; aViewName.appendAscii( "view" ); - aViewName.append( GetOrdinal() ); + aViewName.append( sal_Int32( GetOrdinal() ) ); return aViewName.makeStringAndClear(); } -- cgit v1.2.3 From c01814186ee0b6436b1c0a254d59e8c278abfdf1 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 21 Dec 2009 07:40:17 +0100 Subject: dba33e: #93000# fix locale --- officecfg/registry/data/org/openoffice/Setup.xcu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu index 75d67f0a01..3664843292 100644 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -598,7 +598,7 @@ GenericCategories - Table Data View + Base: Table Data View @@ -620,7 +620,7 @@ GenericCategories - Bibliography + Bibliography -- cgit v1.2.3 From 37c5ec8f70f1127224d321e183833648a64ed43c Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 29 Dec 2009 10:28:54 +0100 Subject: sw33bf02: #i104889# method - no empty value export for style:default-outline-level for ODF version < 1.2 --- xmloff/source/style/styleexp.cxx | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 4317107268..4f7dbc61d4 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -190,7 +190,7 @@ sal_Bool XMLStyleExport::exportStyle( sal_Int32 nOutlineLevel = 0; if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) ) { - Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY ); + Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY ); if( PropertyState_DIRECT_VALUE == xPropState->getPropertyState( sOutlineLevel ) ) { aAny = xPropSet->getPropertyValue( sOutlineLevel ); @@ -200,13 +200,22 @@ sal_Bool XMLStyleExport::exportStyle( OUStringBuffer sTmp; sTmp.append( static_cast(nOutlineLevel)); GetExport().AddAttribute( XML_NAMESPACE_STYLE, - XML_DEFAULT_OUTLINE_LEVEL, - sTmp.makeStringAndClear() ); + XML_DEFAULT_OUTLINE_LEVEL, + sTmp.makeStringAndClear() ); } else { - GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DEFAULT_OUTLINE_LEVEL, - OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); + // --> OD 2009-12-29 #i104889# + // empty value for style:default-outline-level does exist + // since ODF 1.2. Thus, suppress its export for former versions. + if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 && + GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) + // <-- + { + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DEFAULT_OUTLINE_LEVEL, + OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); + } } } }//<-end,zhaojianwei @@ -274,11 +283,11 @@ sal_Bool XMLStyleExport::exportStyle( } // <-- } - } + } //#outline level, add by zhaojianwei.0802 else if( nOutlineLevel > 0 ) { - + bool bNoInheritedListStyle( true ); ///////////////////////////////////////////////// @@ -311,8 +320,9 @@ sal_Bool XMLStyleExport::exportStyle( } ///////////////////////////////////////////////// if ( bNoInheritedListStyle ) - GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, - OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_LIST_STYLE_NAME, + OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); } //<-end,zhaojianwei } @@ -330,7 +340,7 @@ sal_Bool XMLStyleExport::exportStyle( // SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_STYLE, sal_True, sal_True ); - + rPropMapper->SetStyleName( sName ); // -- cgit v1.2.3 From 502e0900447f2eab00ead2e2703fe0395ac92baa Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 5 Jan 2010 22:32:38 +0100 Subject: autorecovery: define a new css.document.XDocumentRecovery interface, implement it in both SFX and DBACCESS, and use it in the autorecovery In this course, the auto recovery learned to restore multiple views of a document. Also, in the course of the change, the LoadDispatchListener became superfluous, and was removed. Also, the loader code in dbaccess was slightly adjusted, since now the connectController call is in the responsibility of the loader, and must not happen inside the XController::attachModel call anymore. This change made the ModelControllerConnector class superfluous, so it has been removed, too. --- framework/inc/services/autorecovery.hxx | 17 +- .../source/inc/loadenv/loaddispatchlistener.hxx | 168 ------ framework/source/loadenv/loaddispatchlistener.cxx | 144 ----- framework/source/loadenv/makefile.mk | 1 - framework/source/services/autorecovery.cxx | 302 +++++++---- .../schema/org/openoffice/Office/Recovery.xcs | 39 +- sfx2/inc/sfx2/sfxbasemodel.hxx | 58 +- sfx2/source/doc/sfxbasemodel.cxx | 584 +++++++-------------- 8 files changed, 487 insertions(+), 826 deletions(-) delete mode 100644 framework/source/inc/loadenv/loaddispatchlistener.hxx delete mode 100644 framework/source/loadenv/loaddispatchlistener.cxx diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx index ab249fc5ba..1a53ef4592 100644 --- a/framework/inc/services/autorecovery.hxx +++ b/framework/inc/services/autorecovery.hxx @@ -170,7 +170,7 @@ class AutoRecovery : public css::lang::XTypeProvider E_UNKNOWN = 0, /// modified against the original file E_MODIFIED = 1, - /** We differe between the states: "modified in general" and "modified after last AutoSave". + /** We differ between the states: "modified in general" and "modified after last AutoSave". The first state will be interesting in case the crashed document will be restored. Then we have set the right modify state after loading the document. But the second state let us optimize the AutoSave itself. see member ListenForModify too ... @@ -308,10 +308,13 @@ class AutoRecovery : public css::lang::XTypeProvider ::rtl::OUString NewTempURL; ::rtl::OUString AppModule; // e.g. com.sun.star.text.TextDocument - used to identify app module + ::rtl::OUString FactoryService; // the service to create a document of the module ::rtl::OUString RealFilter; // real filter, which was used at loading time ::rtl::OUString DefaultFilter; // supports saving of the default format without loosing data ::rtl::OUString Extension; // file extension of the default filter ::rtl::OUString Title; // can be used as "DisplayName" on every recovery UI! + ::com::sun::star::uno::Sequence< ::rtl::OUString > + ViewNames; // names of the view which were active at emergency-save time sal_Int32 ID; }; @@ -864,7 +867,17 @@ class AutoRecovery : public css::lang::XTypeProvider //--------------------------------------- // TODO document me - void implts_specifyAppModuleAndFactoryURL(AutoRecovery::TDocumentInfo& rInfo); + void implts_specifyAppModuleAndFactory(AutoRecovery::TDocumentInfo& rInfo); + + /** retrieves the names of all active views of the given document + @param rInfo + the document info, whose Document member must not be . + */ + void implts_collectActiveViewNames( AutoRecovery::TDocumentInfo& rInfo ); + + /** updates the configuration so that for all documents, their current view/names are stored + */ + void implts_persistAllActiveViewNames(); //--------------------------------------- // TODO document me diff --git a/framework/source/inc/loadenv/loaddispatchlistener.hxx b/framework/source/inc/loadenv/loaddispatchlistener.hxx deleted file mode 100644 index fea3dab621..0000000000 --- a/framework/source/inc/loadenv/loaddispatchlistener.hxx +++ /dev/null @@ -1,168 +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: loaddispatchlistener.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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __FRAMEWORK_LOADENV_LOADDISPATCHLISTENER_HXX_ -#define __FRAMEWORK_LOADENV_LOADDISPATCHLISTENER_HXX_ - -//_______________________________________________ -// includes of own project - -#include -#include -#include - -//_______________________________________________ -// includes of uno interface -#include - -/* -#include -*/ - -//_______________________________________________ -// includes of an other project - -#ifndef _OSL_CONDITN_HXX_ -#include -#endif -#include - -//_______________________________________________ -// namespace - -namespace framework{ - -namespace css = ::com::sun::star; - -//_______________________________________________ -// definitions - -/** @short listen for finished dispatches, where document will be loaded. - - @descr This listener can be bound to an URL - so its well known - for which load request this event was triggered. - Thats needed - but not supported by the XDispatchResultListener - notification. - Further a condition can be used to synchronize any outside code - against the occurence of this event. - - @author as96863 - */ -class LoadDispatchListener : public css::frame::XDispatchResultListener // => css.lang.XEventListener - , private ThreadHelpBase - , public ::cppu::OWeakObject -{ - //___________________________________________ - // member - - private: - - /** @short the URL which is bound to this callback. */ - ::rtl::OUString m_sURL; - - /** @short the original event, which was notified to this object. */ - css::frame::DispatchResultEvent m_aResult; - - /** @short used to let the user of this instance wait, till an - event occures. - */ - ::osl::Condition m_aUserWait; - - //___________________________________________ - // native interface - - public: - - //_______________________________________ - /** @short initialize a new instance of this class. */ - LoadDispatchListener(); - - //_______________________________________ - /** @short deinitialize an instance of this class. */ - virtual ~LoadDispatchListener(); - - //_______________________________________ - /** @short bind this listenerr to a new URL. - - @param sURL - the new URL bound to this instance. - */ - void setURL(const ::rtl::OUString & sURL); - - //_______________________________________ - /** @short let the user of this instance wait. - - @descr If the call timed out - false is returned. - Otherwise it returns true. - Then the method getResult() has to be called, - to get the origianl event. - - @param nWait_ms - the time for wait in [ms]. - If its set to 0 this call is blocked till - an event occures! - - @return TRUE if an event occured in time - FALSE otherwhise. - */ - sal_Bool wait(sal_Int32 nWait_ms); - - //_______________________________________ - /** @short returns the result of this listener operation. - - @descr If wait() (which must be called before!) returns FALSE - the return of getResult() is undefined! - - @return The result of the got listener notification. - */ - css::frame::DispatchResultEvent getResult() const; - - //___________________________________________ - // uno interface - - public: - - //_______________________________________ - // css.uno.XInterface - FWK_DECLARE_XINTERFACE - - //_______________________________________ - // css.frame.XDispatchResultListener - virtual void SAL_CALL dispatchFinished(const css::frame::DispatchResultEvent& aEvent) - throw(css::uno::RuntimeException); - - //_______________________________________ - // css.lang.XEventListener - virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) - throw(css::uno::RuntimeException); -}; - -} // namespace framework - -#endif // __FRAMEWORK_LOADENV_LOADDISPATCHLISTENER_HXX_ diff --git a/framework/source/loadenv/loaddispatchlistener.cxx b/framework/source/loadenv/loaddispatchlistener.cxx deleted file mode 100644 index eb1859b048..0000000000 --- a/framework/source/loadenv/loaddispatchlistener.cxx +++ /dev/null @@ -1,144 +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: loaddispatchlistener.cxx,v $ - * $Revision: 1.6 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_framework.hxx" - -//_______________________________________________ -// includes of own project -#include -#include -#include - -//_______________________________________________ -// includes of uno interface -#include - -//_______________________________________________ -// includes of an other project -#include - -//_______________________________________________ -// namespace - -namespace framework{ - -// may there exist already a define .-( -#ifndef css -namespace css = ::com::sun::star; -#endif - -//_______________________________________________ -// declarations - -//----------------------------------------------- -DEFINE_XINTERFACE_2(LoadDispatchListener , - OWeakObject , - DIRECT_INTERFACE (css::frame::XDispatchResultListener ), - DERIVED_INTERFACE(css::lang::XEventListener, css::frame::XDispatchResultListener)) - -//----------------------------------------------- -LoadDispatchListener::LoadDispatchListener() - : ThreadHelpBase(&Application::GetSolarMutex()) -{ - // reset the condition object - so our user can wait there. - m_aUserWait.reset(); - // set defined state for our result value - m_aResult.State = css::frame::DispatchResultState::DONTKNOW; - m_aResult.Result.clear(); -} - -//----------------------------------------------- -LoadDispatchListener::~LoadDispatchListener() -{ -} - -//----------------------------------------------- -void SAL_CALL LoadDispatchListener::dispatchFinished(const css::frame::DispatchResultEvent& aEvent) - throw(css::uno::RuntimeException) -{ - // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); - m_aResult = aEvent; - aWriteLock.unlock(); - // <- SAFE ---------------------------------- - - // inform user about this arrived event - m_aUserWait.set(); -} - -//----------------------------------------------- -void SAL_CALL LoadDispatchListener::disposing(const css::lang::EventObject&) - throw(css::uno::RuntimeException) -{ - // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); - m_aResult.State = css::frame::DispatchResultState::DONTKNOW; - m_aResult.Result.clear(); - aWriteLock.unlock(); - // <- SAFE ---------------------------------- - - // inform user about this arrived event - m_aUserWait.set(); -} - -//----------------------------------------------- -void LoadDispatchListener::setURL(const ::rtl::OUString & sURL) -{ - // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); - m_sURL = sURL; - aWriteLock.unlock(); - // <- SAFE ---------------------------------- -} - -//----------------------------------------------- -sal_Bool LoadDispatchListener::wait(sal_Int32 /*nWait_ms*/) -{ - // Wait till an event occures - m_aUserWait.wait(0); - // reset the condition, so this method can be called again. - // Of course a new action has to be started outside too! - m_aUserWait.reset(); - - // TODO implement real timeout :-) - return sal_True; -} - -//----------------------------------------------- -css::frame::DispatchResultEvent LoadDispatchListener::getResult() const -{ - // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); - return m_aResult; - // <- SAFE ---------------------------------- -} - -} // namespace framework diff --git a/framework/source/loadenv/makefile.mk b/framework/source/loadenv/makefile.mk index e0fa0940f5..105cc92c78 100644 --- a/framework/source/loadenv/makefile.mk +++ b/framework/source/loadenv/makefile.mk @@ -42,7 +42,6 @@ ENABLE_EXCEPTIONS= TRUE SLOFILES= \ $(SLO)$/loadenv.obj \ - $(SLO)$/loaddispatchlistener.obj \ $(SLO)$/targethelper.obj # --- Targets ------------------------------------------------------ diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index f843f5a39e..82ac8bf4d0 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -35,7 +35,6 @@ //_______________________________________________ // own includes -#include #include #include #include @@ -51,6 +50,8 @@ // interface includes #include #include +#include +#include #include #include #include @@ -71,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -79,10 +81,12 @@ // other includes #include #include +#include #include #include #include #include +#include #include #include @@ -102,6 +106,23 @@ namespace css = ::com::sun::star; #endif +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::UNO_SET_THROW; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::container::XEnumeration; +using ::com::sun::star::document::XDocumentRecovery; +using ::com::sun::star::frame::XModel2; +using ::com::sun::star::frame::XModel; +using ::com::sun::star::frame::XFrame; +using ::com::sun::star::frame::XController2; +using ::com::sun::star::frame::XLoadable; +using ::com::sun::star::frame::XStorable; +using ::com::sun::star::lang::XComponent; + namespace fpf = ::framework::pattern::frame; namespace framework @@ -135,6 +156,7 @@ static const ::rtl::OUString CFG_ENTRY_PROP_DOCUMENTSTATE = ::rtl::OUString: static const ::rtl::OUString CFG_ENTRY_PROP_FILTER = ::rtl::OUString::createFromAscii("Filter" ); static const ::rtl::OUString CFG_ENTRY_PROP_TITLE = ::rtl::OUString::createFromAscii("Title" ); static const ::rtl::OUString CFG_ENTRY_PROP_ID = ::rtl::OUString::createFromAscii("ID" ); +static const ::rtl::OUString CFG_ENTRY_PROP_VIEWNAMES = ::rtl::OUString::createFromAscii("ViewNames" ); static const ::rtl::OUString FILTER_PROP_TYPE = ::rtl::OUString::createFromAscii("Type" ); static const ::rtl::OUString FILTER_PROP_NAME = ::rtl::OUString::createFromAscii("Name" ); @@ -144,6 +166,7 @@ static const ::rtl::OUString DOCINFO_PROP_TEMPLATE = ::rtl::OUString:: // setup.xcu static const ::rtl::OUString CFG_ENTRY_PROP_EMPTYDOCUMENTURL = ::rtl::OUString::createFromAscii("ooSetupFactoryEmptyDocumentURL"); static const ::rtl::OUString CFG_ENTRY_PROP_DEFAULTFILTER = ::rtl::OUString::createFromAscii("ooSetupFactoryDefaultFilter" ); +static const ::rtl::OUString CFG_ENTRY_PROP_FACTORYSERVICE = ::rtl::OUString::createFromAscii("ooSetupFactoryDocumentService" ); static const ::rtl::OUString EVENT_ON_NEW = ::rtl::OUString::createFromAscii("OnNew" ); static const ::rtl::OUString EVENT_ON_LOAD = ::rtl::OUString::createFromAscii("OnLoad" ); @@ -784,7 +807,7 @@ void SAL_CALL AutoRecovery::addStatusListener(const css::uno::Reference< css::fr // container is threadsafe by using a shared mutex! m_lListener.addInterface(aURL.Complete, xListener); - // REINTRANT !? -> -------------------------------- + // REENTRANT !? -> -------------------------------- CacheLockGuard aCacheLock(this, m_aLock, m_nDocCacheLock, LOCK_FOR_CACHE_USE); // THREAD SAFE -> ---------------------------------- @@ -1089,7 +1112,7 @@ void AutoRecovery::implts_readConfig() css::uno::Reference< css::container::XHierarchicalNameAccess > xCommonRegistry(implts_openConfig(), css::uno::UNO_QUERY); - // REINTRANT -> -------------------------------- + // REENTRANT -> -------------------------------- CacheLockGuard aCacheLock(this, m_aLock, m_nDocCacheLock, LOCK_FOR_CACHE_ADD_REMOVE); // THREADSAFE -> ------------------------------- @@ -1101,7 +1124,7 @@ void AutoRecovery::implts_readConfig() // <- THREADSAFE ------------------------------- aCacheLock.unlock(); - // <- REINTRANT -------------------------------- + // <- REENTRANT -------------------------------- css::uno::Any aValue; @@ -1116,7 +1139,7 @@ void AutoRecovery::implts_readConfig() sal_Int32 c = lItems.getLength(); sal_Int32 i = 0; - // REINTRANT -> -------------------------- + // REENTRANT -> -------------------------- aCacheLock.lock(LOCK_FOR_CACHE_ADD_REMOVE); for (i=0; igetPropertyValue(CFG_ENTRY_PROP_DOCUMENTSTATE) >>= aInfo.DocumentState; xItem->getPropertyValue(CFG_ENTRY_PROP_MODULE ) >>= aInfo.AppModule ; xItem->getPropertyValue(CFG_ENTRY_PROP_TITLE ) >>= aInfo.Title ; - implts_specifyAppModuleAndFactoryURL(aInfo); + xItem->getPropertyValue(CFG_ENTRY_PROP_VIEWNAMES ) >>= aInfo.ViewNames ; + implts_specifyAppModuleAndFactory(aInfo); implts_specifyDefaultFilterAndExtension(aInfo); if (pItems[i].indexOf(RECOVERY_ITEM_BASE_IDENTIFIER)==0) @@ -1166,7 +1190,7 @@ void AutoRecovery::implts_readConfig() } aCacheLock.unlock(); - // <- REINTRANT -------------------------- + // <- REENTRANT -------------------------- } implts_actualizeTimer(); @@ -1234,17 +1258,12 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume } //----------------------------------------------- -void AutoRecovery::implts_specifyAppModuleAndFactoryURL(AutoRecovery::TDocumentInfo& rInfo) +void AutoRecovery::implts_specifyAppModuleAndFactory(AutoRecovery::TDocumentInfo& rInfo) { - if ( - (!rInfo.AppModule.getLength()) && - (!rInfo.Document.is() ) - ) - { - throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii("Cant find out the application module nor its factory URL, if no application module (or a suitable) document is known!"), - static_cast< css::frame::XDispatch* >(this)); - } + ENSURE_OR_THROW2( + rInfo.AppModule.getLength() || rInfo.Document.is(), + "Cant find out the application module nor its factory URL, if no application module (or a suitable) document is known!", + *this ); // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); @@ -1260,6 +1279,70 @@ void AutoRecovery::implts_specifyAppModuleAndFactoryURL(AutoRecovery::TDocumentI ::comphelper::SequenceAsHashMap lModuleDescription(xModuleConfig->getByName(rInfo.AppModule)); lModuleDescription[CFG_ENTRY_PROP_EMPTYDOCUMENTURL] >>= rInfo.FactoryURL; + lModuleDescription[CFG_ENTRY_PROP_FACTORYSERVICE] >>= rInfo.FactoryService; +} + +//----------------------------------------------- +void AutoRecovery::implts_collectActiveViewNames( AutoRecovery::TDocumentInfo& i_rInfo ) +{ + ENSURE_OR_THROW2( i_rInfo.Document.is(), "need at document, at the very least", *this ); + + i_rInfo.ViewNames.realloc(0); + + // obtain list of controllers of this document + ::std::vector< ::rtl::OUString > aViewNames; + const Reference< XModel2 > xModel( i_rInfo.Document, UNO_QUERY ); + if ( xModel.is() ) + { + const Reference< XEnumeration > xEnumControllers( xModel->getControllers() ); + while ( xEnumControllers->hasMoreElements() ) + { + const Reference< XController2 > xController( xEnumControllers->nextElement(), UNO_QUERY ); + ::rtl::OUString sViewName; + if ( xController.is() ) + sViewName = xController->getViewControllerName(); + OSL_ENSURE( sViewName.getLength(), "AutoRecovery::implts_collectActiveViewNames: (no XController2 ->) no view name -> no recovery of this view!" ); + + if ( sViewName.getLength() ) + aViewNames.push_back( sViewName ); + } + } + else + { + const Reference< XController2 > xController( xModel->getCurrentController(), UNO_QUERY ); + ::rtl::OUString sViewName; + if ( xController.is() ) + sViewName = xController->getViewControllerName(); + OSL_ENSURE( sViewName.getLength(), "AutoRecovery::implts_collectActiveViewNames: (no XController2 ->) no view name -> no recovery of this view!" ); + + if ( sViewName.getLength() ) + aViewNames.push_back( sViewName ); + } + + i_rInfo.ViewNames.realloc( aViewNames.size() ); + ::std::copy( aViewNames.begin(), aViewNames.end(), i_rInfo.ViewNames.getArray() ); +} + +//----------------------------------------------- +void AutoRecovery::implts_persistAllActiveViewNames() +{ + // SAFE -> ---------------------------------- + WriteGuard aWriteLock(m_aLock); + + // This list will be filled with every document + // which should be saved as last one. E.g. if it was used + // already for an UI save operation => crashed ... and + // now we try to save it again ... which can fail again ( of course .-) ). + ::std::vector< AutoRecovery::TDocumentList::iterator > lDangerousDocs; + + AutoRecovery::TDocumentList::iterator pIt; + for ( pIt = m_lDocCache.begin(); + pIt != m_lDocCache.end() ; + ++pIt ) + { + implts_collectActiveViewNames( *pIt ); + implts_flushConfigItem( *pIt ); + } } //----------------------------------------------- @@ -1312,6 +1395,7 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn xSet->setPropertyValue(CFG_ENTRY_PROP_DOCUMENTSTATE, css::uno::makeAny(rInfo.DocumentState)); xSet->setPropertyValue(CFG_ENTRY_PROP_MODULE , css::uno::makeAny(rInfo.AppModule )); xSet->setPropertyValue(CFG_ENTRY_PROP_TITLE , css::uno::makeAny(rInfo.Title )); + xSet->setPropertyValue(CFG_ENTRY_PROP_VIEWNAMES , css::uno::makeAny(rInfo.ViewNames )); if (bNew) xModify->insertByName(sID, css::uno::makeAny(xSet)); @@ -1707,7 +1791,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame // <- SAFE ---------------------------------- // classify the used application module, which is used by this document. - implts_specifyAppModuleAndFactoryURL(aNew); + implts_specifyAppModuleAndFactory(aNew); // Hack! Check for "illegal office documents" ... as e.g. the Basic IDE // Its not realy a full featured office document. It doesnt provide an URL, any filter, a factory URL etcpp. @@ -2162,7 +2246,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( sal_Bool bAl continue; // already auto saved during this session :-) - // This state must be reseted for all documents + // This state must be reset for all documents // if timer is started with normnal AutoSaveTimerIntervall! if ((aInfo.DocumentState & AutoRecovery::E_HANDLED) == AutoRecovery::E_HANDLED) continue; @@ -2315,7 +2399,8 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& // try to save this document as a new temp file everytimes. // Mark AutoSave state as "INCOMPLETE" if it failed. // Because the last temp file is to old and does not include all changes. - css::uno::Reference< css::frame::XStorable > xStore(rInfo.Document, css::uno::UNO_QUERY_THROW); + Reference< XDocumentRecovery > xDocRecover(rInfo.Document, css::uno::UNO_QUERY); + ENSURE_OR_THROW( xDocRecover.is(), "invalid document" ); // safe the state about "trying to save" // ... we need it for recovery if e.g. a crash occures inside next line! @@ -2328,7 +2413,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& { try { - xStore->storeToURL(rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList()); + xDocRecover->doEmergencySave( rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList() ); #ifdef TRIGGER_FULL_DISC_CHECK throw css::uno::Exception(); @@ -2603,60 +2688,110 @@ void AutoRecovery::implts_openOneDoc(const ::rtl::OUString& sURL aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::util::XURLTransformer > xParser(xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY_THROW); - css::util::URL aURL; - aURL.Complete = sURL; - xParser->parseStrict(aURL); - - LoadDispatchListener* pLoadListener = new LoadDispatchListener(); - css::uno::Reference< css::frame::XDispatchResultListener > xLoadListener (static_cast< css::frame::XDispatchResultListener* >(pLoadListener), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XFrame > xDesktop( xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW ); - css::uno::Reference< css::frame::XFrame > xDesktop (xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::frame::XFrame > xNewTarget = xDesktop->findFrame(SPECIALTARGET_BLANK, 0); - css::uno::Reference< css::frame::XDispatchProvider > xProvider (xNewTarget, css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::frame::XNotifyingDispatch > xDispatcher( - xProvider->queryDispatch(aURL, SPECIALTARGET_SELF, 0), - css::uno::UNO_QUERY_THROW); + ::std::vector< Reference< XComponent > > aCleanup; + try + { + // create a new document of the desired type + Reference< XModel2 > xModel( xSMGR->createInstance( rInfo.FactoryService ), UNO_QUERY_THROW ); + aCleanup.push_back( xModel.get() ); - // load the document and listen for the state of this operation. - pLoadListener->setURL(aURL.Complete); + // put the filter name into the descriptor - we're not going to involve any type detection, so + // the document might be lost without the FilterName property + lDescriptor[ ::comphelper::MediaDescriptor::PROP_FILTERNAME() ] <<= rInfo.RealFilter; - // make sure the right progress is used always. - impl_establishProgress(rInfo, lDescriptor, xNewTarget); + if ( sURL == rInfo.FactoryURL ) + { + // if the document was a new, unmodified document, then there's nothing to recover, just to init + ENSURE_OR_THROW( ( rInfo.DocumentState & AutoRecovery::E_MODIFIED ) == 0, + "unexpected document state" ); + Reference< XLoadable > xModelLoad( xModel, UNO_QUERY_THROW ); + xModelLoad->initNew(); + } + else + { + // let it recover itself + Reference< XDocumentRecovery > xDocRecover( xModel, UNO_QUERY_THROW ); + xDocRecover->recoverDocument( + sURL, + lDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_SALVAGEDFILE(), ::rtl::OUString() ), + lDescriptor.getAsConstPropertyValueList() + ); + } - try - { - xDispatcher->dispatchWithNotification( - aURL, - lDescriptor.getAsConstPropertyValueList(), - xLoadListener); + xModel->attachResource( sURL, lDescriptor.getAsConstPropertyValueList() ); + // TODO: remove load-process specific arguments from the descriptor, e.g. the status indicator - pLoadListener->wait(0); // wait for ever! + // re-create all the views + ::std::vector< ::rtl::OUString > aViewsToRestore( rInfo.ViewNames.getLength() ); + if ( rInfo.ViewNames.getLength() ) + ::std::copy( rInfo.ViewNames.getConstArray(), rInfo.ViewNames.getConstArray() + rInfo.ViewNames.getLength(), aViewsToRestore.begin() ); + // if we don't have views for whatever reason, then create a default-view, at least + if ( aViewsToRestore.empty() ) + aViewsToRestore.push_back( ::rtl::OUString() ); - css::frame::DispatchResultEvent aResult = pLoadListener->getResult(); - if (aResult.State != css::frame::DispatchResultState::SUCCESS) + for ( ::std::vector< ::rtl::OUString >::const_iterator viewName = aViewsToRestore.begin(); + viewName != aViewsToRestore.end(); + ++viewName + ) { - ::rtl::OUStringBuffer sMsg(256); - sMsg.appendAscii("Recovery of \""); - sMsg.append (aURL.Complete ); - sMsg.appendAscii("\" failed." ); - throw css::uno::Exception(sMsg.makeStringAndClear(), static_cast< css::frame::XDispatch* >(this)); + // create a frame + Reference< XFrame > xTargetFrame = xDesktop->findFrame( SPECIALTARGET_BLANK, 0 ); + aCleanup.push_back( xTargetFrame.get() ); + + // create a view to the document + Reference< XController2 > xController; + if ( viewName->getLength() ) + { + xController.set( xModel->createViewController( *viewName, Sequence< PropertyValue >(), xTargetFrame ), UNO_SET_THROW ); + } + else + { + xController.set( xModel->createDefaultViewController( xTargetFrame ), UNO_SET_THROW ); + } + + // introduce model/view/controller to each other + xController->attachModel( xModel.get() ); + xModel->connectController( xController.get() ); + xTargetFrame->setComponent( xController->getComponentWindow(), xController.get() ); + xController->attachFrame( xTargetFrame ); + xModel->setCurrentController( xController.get() ); } - rInfo.Document = fpf::extractFrameModel(xNewTarget); + rInfo.Document = xModel.get(); } catch(const css::uno::RuntimeException&) { throw; } catch(const css::uno::Exception&) { - css::uno::Reference< css::util::XCloseable > xClose(xNewTarget, css::uno::UNO_QUERY); - xClose->close(sal_True); - xNewTarget.clear(); - throw; - } + Any aCaughtException( ::cppu::getCaughtException() ); + + // clean up + for ( ::std::vector< Reference< XComponent > >::const_iterator component = aCleanup.begin(); + component != aCleanup.end(); + ++component + ) + { + css::uno::Reference< css::util::XCloseable > xClose( *component, css::uno::UNO_QUERY ); + if ( xClose.is() ) + xClose->close( sal_True ); + else + (*component)->dispose(); + } + + // re-throw + ::rtl::OUStringBuffer sMsg(256); + sMsg.appendAscii("Recovery of \""); + sMsg.append (sURL ); + sMsg.appendAscii("\" failed." ); - // of course we must forget all references to this temp(!) progress - impl_forgetProgress(rInfo, lDescriptor, xNewTarget); + throw css::lang::WrappedTargetException( + sMsg.makeStringAndClear(), + static_cast< css::frame::XDispatch* >(this), + aCaughtException + ); + } } //----------------------------------------------- @@ -2765,7 +2900,7 @@ void AutoRecovery::implts_informListener( sal_Int32 eJ if ((eJob & AutoRecovery::E_AUTO_SAVE) == AutoRecovery::E_AUTO_SAVE) sFeature.append(CMD_DO_AUTO_SAVE); #ifdef ENABLE_WARNINGS - else + else if ( eJob != AutoRecovery::E_NO_JOB ) LOG_WARNING("AutoRecovery::implst_getJobDescription()", "Invalid job identifier detected.") #endif @@ -2821,35 +2956,18 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent( if (sEventType.equals(OPERATION_UPDATE) && pInfo) { // pack rInfo for transport via UNO - css::uno::Sequence< css::beans::NamedValue > lInfo(8); - lInfo[0].Name = CFG_ENTRY_PROP_ID; - lInfo[0].Value <<= pInfo->ID; - - lInfo[1].Name = CFG_ENTRY_PROP_ORIGINALURL; - lInfo[1].Value <<= pInfo->OrgURL; + ::comphelper::NamedValueCollection aInfo; + aInfo.put( CFG_ENTRY_PROP_ID, pInfo->ID ); + aInfo.put( CFG_ENTRY_PROP_ORIGINALURL, pInfo->OrgURL ); + aInfo.put( CFG_ENTRY_PROP_FACTORYURL, pInfo->FactoryURL ); + aInfo.put( CFG_ENTRY_PROP_TEMPLATEURL, pInfo->TemplateURL ); + aInfo.put( CFG_ENTRY_PROP_TEMPURL, pInfo->OldTempURL.getLength() ? pInfo->OldTempURL : pInfo->NewTempURL ); + aInfo.put( CFG_ENTRY_PROP_MODULE, pInfo->AppModule ); + aInfo.put( CFG_ENTRY_PROP_TITLE, pInfo->Title ); + aInfo.put( CFG_ENTRY_PROP_VIEWNAMES, pInfo->ViewNames ); + aInfo.put( CFG_ENTRY_PROP_DOCUMENTSTATE, pInfo->DocumentState ); - lInfo[2].Name = CFG_ENTRY_PROP_FACTORYURL; - lInfo[2].Value <<= pInfo->FactoryURL; - - lInfo[3].Name = CFG_ENTRY_PROP_TEMPLATEURL; - lInfo[3].Value <<= pInfo->TemplateURL; - - lInfo[4].Name = CFG_ENTRY_PROP_TEMPURL; - if (pInfo->OldTempURL.getLength()) - lInfo[4].Value <<= pInfo->OldTempURL; - else - lInfo[4].Value <<= pInfo->NewTempURL; - - lInfo[5].Name = CFG_ENTRY_PROP_MODULE; - lInfo[5].Value <<= pInfo->AppModule; - - lInfo[6].Name = CFG_ENTRY_PROP_TITLE; - lInfo[6].Value <<= pInfo->Title; - - lInfo[7].Name = CFG_ENTRY_PROP_DOCUMENTSTATE; - lInfo[7].Value <<= pInfo->DocumentState; - - aEvent.State <<= lInfo; + aEvent.State <<= aInfo.getPropertyValues(); } return aEvent; @@ -2907,6 +3025,9 @@ void AutoRecovery::implts_doEmergencySave(const DispatchParams& aParams) css::uno::makeAny(sal_True), ::comphelper::ConfigurationHelper::E_STANDARD); + // for all docs, store their current view/names in the configurtion + implts_persistAllActiveViewNames(); + // The called method for saving documents runs // during normal AutoSave more then once. Because // it postpone active documents and save it later. @@ -2982,6 +3103,9 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams) // Be sure to know all open documents realy .-) implts_verifyCacheAgainstDesktopDocumentList(); + // for all docs, store their current view/names in the configurtion + implts_persistAllActiveViewNames(); + // The called method for saving documents runs // during normal AutoSave more then once. Because // it postpone active documents and save it later. diff --git a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs index 41ceb993f8..975d2b2a99 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs @@ -31,59 +31,64 @@ - TODO + - TODO + - TODO + - TODO + - TODO + - TODO + - TODO + - TODO + - TODO + - + + + + + +
- TODO + - TODO + @@ -93,13 +98,13 @@ - TODO + false - TODO + false @@ -117,17 +122,17 @@ - TODO + - TODO + true - TODO + 15 diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index 8b2dd1b17f..8c7b391083 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -59,6 +60,8 @@ #include #include #include +#include +#include #include #include #include @@ -86,6 +89,8 @@ #include #include #include +#include +#include #include @@ -95,9 +100,9 @@ #include //________________________________________________________________________________________________________ -#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_29) -#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_29 -#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 29 +#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_30) +#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_30 +#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 30 #include #endif @@ -236,10 +241,11 @@ namespace sfx { namespace intern { SfxListener */ -typedef ::comphelper::WeakImplHelper29 < XCHILD +typedef ::comphelper::WeakImplHelper30 < XCHILD , XDOCUMENTINFOSUPPLIER , ::com::sun::star::document::XDocumentPropertiesSupplier , ::com::sun::star::rdf::XDocumentMetadataAccess + , ::com::sun::star::document::XDocumentRecovery , XEVENTBROADCASTER , XEVENTLISTENER , XEVENTSSUPPLIER @@ -1292,6 +1298,16 @@ public: virtual ::rtl::OUString SAL_CALL getUntitledPrefix() throw (css::uno::RuntimeException); + // css.document.XDocumentRecovery + virtual void SAL_CALL doEmergencySave( const ::rtl::OUString& i_TargetLocation, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) + throw ( ::com::sun::star::uno::RuntimeException, + ::com::sun::star::io::IOException, + ::com::sun::star::lang::WrappedTargetException ); + virtual void SAL_CALL recoverDocument( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) + throw ( ::com::sun::star::uno::RuntimeException, + ::com::sun::star::io::IOException, + ::com::sun::star::lang::WrappedTargetException ); + //____________________________________________________________________________________________________ // ::com::sun::star::rdf::XNode: @@ -1471,6 +1487,7 @@ public: SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ; sal_Bool IsDisposed() const ; + sal_Bool IsInitialized() const; ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException); void SAL_CALL setViewData( const ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess >& aData ) throw (::com::sun::star::uno::RuntimeException); @@ -1481,7 +1498,6 @@ public: /** returns true if someone added a XEventListener to this XEventBroadcaster */ sal_Bool hasEventListeners() const; - protected: /* returns a unique id for the model that is valid as long as the document @@ -1542,6 +1558,38 @@ private: } ; // class SfxBaseModel +class SFX2_DLLPUBLIC SfxModelGuard +{ +public: + enum AllowedModelState + { + // not yet initialized + E_INITIALIZING, + // fully alive, i.e. initialized, and not yet disposed + E_FULLY_ALIVE + }; + + SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE ) + :m_aGuard( Application::GetSolarMutex() ) + { + if ( i_rModel.IsDisposed() ) + throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *&i_rModel ); + if ( ( i_eState != E_INITIALIZING ) && !i_rModel.IsInitialized() ) + throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *&i_rModel ); + } + ~SfxModelGuard() + { + } + + void clear() + { + m_aGuard.clear(); + } + +private: + ::vos::OClearableGuard m_aGuard; +}; + #undef css #endif // _SFX_SFXBASEMODEL_HXX_ diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 3c75a7d089..223dc13a97 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -149,6 +149,8 @@ using ::com::sun::star::frame::XFrame; using ::com::sun::star::frame::XController; using ::com::sun::star::frame::XController2; using ::com::sun::star::lang::IllegalArgumentException; +using ::com::sun::star::io::IOException; +using ::com::sun::star::lang::WrappedTargetException; /** This Listener is used to get notified when the XDocumentProperties of the XModel change. @@ -224,6 +226,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument sal_Bool m_bClosing ; sal_Bool m_bSaving ; sal_Bool m_bSuicide ; + sal_Bool m_bInitialized ; uno::Reference< com::sun::star::view::XPrintable> m_xPrintable ; uno::Reference< script::provider::XScriptProvider > m_xScriptProvider; uno::Reference< ui::XUIConfigurationManager > m_xUIConfigurationManager; @@ -242,6 +245,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument , m_bClosing ( sal_False ) , m_bSaving ( sal_False ) , m_bSuicide ( sal_False ) + , m_bInitialized ( sal_False ) , m_pStorageModifyListen ( NULL ) , m_xTitleHelper () , m_xNumberedControllers () @@ -659,9 +663,7 @@ uno::Reference< script::XStarBasicAccess > implGetStarBasicAccess( SfxObjectShel uno::Reference< XNAMECONTAINER > SAL_CALL SfxBaseModel::getLibraryContainer() throw( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess; if( !rxAccess.is() && m_pData->m_pObjectShell.Is() ) @@ -680,9 +682,7 @@ void SAL_CALL SfxBaseModel::createLibrary( const ::rtl::OUString& LibName, const const ::rtl::OUString& ExternalSourceURL, const ::rtl::OUString& LinkTargetURL ) throw(ELEMENTEXISTEXCEPTION, uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess; if( !rxAccess.is() && m_pData->m_pObjectShell.Is() ) @@ -699,9 +699,7 @@ void SAL_CALL SfxBaseModel::addModule( const ::rtl::OUString& LibraryName, const const ::rtl::OUString& Language, const ::rtl::OUString& Source ) throw( NOSUCHELEMENTEXCEPTION, uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess; if( !rxAccess.is() && m_pData->m_pObjectShell.Is() ) @@ -718,9 +716,7 @@ void SAL_CALL SfxBaseModel::addDialog( const ::rtl::OUString& LibraryName, const const ::com::sun::star::uno::Sequence< sal_Int8 >& Data ) throw(NOSUCHELEMENTEXCEPTION, uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess; if( !rxAccess.is() && m_pData->m_pObjectShell.Is() ) @@ -737,9 +733,7 @@ void SAL_CALL SfxBaseModel::addDialog( const ::rtl::OUString& LibraryName, const uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getParent() throw( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); return m_pData->m_xParent; } @@ -750,7 +744,7 @@ uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getParent() throw( uno: void SAL_CALL SfxBaseModel::setParent(const uno::Reference< uno::XInterface >& Parent) throw(NOSUPPORTEXCEPTION, uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); m_pData->m_xParent = Parent; } @@ -760,11 +754,7 @@ void SAL_CALL SfxBaseModel::setParent(const uno::Reference< uno::XInterface >& P void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - // object already disposed? - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_bClosed ) { @@ -823,10 +813,7 @@ void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeExcept void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XEVENTLISTENER >& aListener ) throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XEVENTLISTENER >*)0), aListener ); } @@ -838,11 +825,7 @@ void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XEVENTLISTEN void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XEVENTLISTENER >& aListener ) throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; - + SfxModelGuard aGuard( *this ); m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XEVENTLISTENER >*)0), aListener ); } @@ -852,11 +835,7 @@ void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XEVENTLIS uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); - + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( !m_pData->m_xDocumentInfo.is() ) { // WARNING: this will only work if (when loading a document) the @@ -902,11 +881,7 @@ uno::Reference< document::XDocumentProperties > SAL_CALL SfxBaseModel::getDocumentProperties() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); - + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( !m_pData->m_xDocumentProperties.is() ) { uno::Reference< lang::XInitialization > xDocProps( @@ -954,10 +929,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& const uno::Sequence< beans::PropertyValue >& rArgs ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); - + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( rURL.getLength() == 0 && rArgs.getLength() == 1 && rArgs[0].Name.equalsAscii( "SetEmbedded" ) ) { // allows to set a windowless document to EMBEDDED state @@ -1034,10 +1006,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& ::rtl::OUString SAL_CALL SfxBaseModel::getURL() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); - + SfxModelGuard aGuard( *this ); return m_pData->m_sURL ; } @@ -1047,10 +1016,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); - + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell.Is() ) { uno::Sequence< beans::PropertyValue > seqArgsNew; @@ -1150,10 +1116,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); - + SfxModelGuard aGuard( *this ); OSL_PRECOND( xController.is(), "SfxBaseModel::connectController: invalid controller!" ); if ( !xController.is() ) return; @@ -1182,9 +1145,7 @@ void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XCon void SAL_CALL SfxBaseModel::disconnectController( const uno::Reference< frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); sal_uInt32 nOldCount = m_pData->m_seqControllers.getLength(); if ( !nOldCount ) @@ -1212,9 +1173,8 @@ void SAL_CALL SfxBaseModel::disconnectController( const uno::Reference< frame::X void SAL_CALL SfxBaseModel::lockControllers() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); + ++m_pData->m_nControllerLockCount ; } @@ -1224,9 +1184,8 @@ void SAL_CALL SfxBaseModel::lockControllers() throw(::com::sun::star::uno::Runti void SAL_CALL SfxBaseModel::unlockControllers() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); + --m_pData->m_nControllerLockCount ; } @@ -1236,9 +1195,7 @@ void SAL_CALL SfxBaseModel::unlockControllers() throw(::com::sun::star::uno::Run sal_Bool SAL_CALL SfxBaseModel::hasControllersLocked() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); return ( m_pData->m_nControllerLockCount != 0 ) ; } @@ -1248,10 +1205,7 @@ sal_Bool SAL_CALL SfxBaseModel::hasControllersLocked() throw(::com::sun::star::u uno::Reference< frame::XController > SAL_CALL SfxBaseModel::getCurrentController() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); // get the last active controller of this model if ( m_pData->m_xCurrent.is() ) @@ -1268,10 +1222,7 @@ uno::Reference< frame::XController > SAL_CALL SfxBaseModel::getCurrentController void SAL_CALL SfxBaseModel::setCurrentController( const uno::Reference< frame::XController >& xCurrentController ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); m_pData->m_xCurrent = xCurrentController; } @@ -1282,10 +1233,7 @@ void SAL_CALL SfxBaseModel::setCurrentController( const uno::Reference< frame::X uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getCurrentSelection() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< uno::XInterface > xReturn; uno::Reference< frame::XController > xController = getCurrentController() ; @@ -1309,9 +1257,7 @@ uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getCurrentSelection() t sal_Bool SAL_CALL SfxBaseModel::disableSetModified() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw DISPOSEDEXCEPTION(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_pObjectShell.Is() ) throw uno::RuntimeException(); @@ -1324,9 +1270,7 @@ sal_Bool SAL_CALL SfxBaseModel::disableSetModified() throw (::com::sun::star::un sal_Bool SAL_CALL SfxBaseModel::enableSetModified() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw DISPOSEDEXCEPTION(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_pObjectShell.Is() ) throw uno::RuntimeException(); @@ -1339,9 +1283,7 @@ sal_Bool SAL_CALL SfxBaseModel::enableSetModified() throw (::com::sun::star::uno sal_Bool SAL_CALL SfxBaseModel::isSetModifiedEnabled() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw DISPOSEDEXCEPTION(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_pObjectShell.Is() ) throw uno::RuntimeException(); @@ -1355,10 +1297,7 @@ sal_Bool SAL_CALL SfxBaseModel::isSetModifiedEnabled() throw (::com::sun::star:: sal_Bool SAL_CALL SfxBaseModel::isModified() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); return m_pData->m_pObjectShell.Is() ? m_pData->m_pObjectShell->IsModified() : sal_False; } @@ -1370,10 +1309,7 @@ sal_Bool SAL_CALL SfxBaseModel::isModified() throw(::com::sun::star::uno::Runtim void SAL_CALL SfxBaseModel::setModified( sal_Bool bModified ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell.Is() ) m_pData->m_pObjectShell->SetModified(bModified); @@ -1385,10 +1321,7 @@ void SAL_CALL SfxBaseModel::setModified( sal_Bool bModified ) void SAL_CALL SfxBaseModel::addModifyListener(const uno::Reference< XMODIFYLISTENER >& xListener) throw( uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0),xListener ); } @@ -1399,10 +1332,7 @@ void SAL_CALL SfxBaseModel::addModifyListener(const uno::Reference< XMODIFYLISTE void SAL_CALL SfxBaseModel::removeModifyListener(const uno::Reference< XMODIFYLISTENER >& xListener) throw( uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0), xListener ); } @@ -1415,8 +1345,9 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo { static ::rtl::OUString MSG_1 = ::rtl::OUString::createFromAscii("Cant close while saving."); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( !m_pData || m_pData->m_bClosed || m_pData->m_bClosing ) + SfxModelGuard aGuard( *this ); + + if ( m_pData->m_bClosed || m_pData->m_bClosing ) return; uno::Reference< uno::XInterface > xSelfHold( static_cast< ::cppu::OWeakObject* >(this) ); @@ -1478,10 +1409,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo void SAL_CALL SfxBaseModel::addCloseListener( const uno::Reference< XCLOSELISTENER >& xListener ) throw (uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XCLOSELISTENER >*)0), xListener ); } @@ -1492,10 +1420,7 @@ void SAL_CALL SfxBaseModel::addCloseListener( const uno::Reference< XCLOSELISTEN void SAL_CALL SfxBaseModel::removeCloseListener( const uno::Reference< XCLOSELISTENER >& xListener ) throw (uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XCLOSELISTENER >*)0), xListener ); } @@ -1506,10 +1431,7 @@ void SAL_CALL SfxBaseModel::removeCloseListener( const uno::Reference< XCLOSELIS uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getPrinter() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( impl_getPrintHelper() ) return m_pData->m_xPrintable->getPrinter(); @@ -1520,10 +1442,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getPrinter() throw( void SAL_CALL SfxBaseModel::setPrinter(const uno::Sequence< beans::PropertyValue >& rPrinter) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( impl_getPrintHelper() ) m_pData->m_xPrintable->setPrinter( rPrinter ); @@ -1532,10 +1451,7 @@ void SAL_CALL SfxBaseModel::setPrinter(const uno::Sequence< beans::PropertyValue void SAL_CALL SfxBaseModel::print(const uno::Sequence< beans::PropertyValue >& rOptions) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( impl_getPrintHelper() ) m_pData->m_xPrintable->print( rOptions ); @@ -1547,10 +1463,7 @@ void SAL_CALL SfxBaseModel::print(const uno::Sequence< beans::PropertyValue >& r sal_Bool SAL_CALL SfxBaseModel::hasLocation() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); return m_pData->m_pObjectShell.Is() ? m_pData->m_pObjectShell->HasName() : sal_False; } @@ -1561,10 +1474,7 @@ sal_Bool SAL_CALL SfxBaseModel::hasLocation() throw(::com::sun::star::uno::Runti ::rtl::OUString SAL_CALL SfxBaseModel::getLocation() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell.Is() ) { @@ -1584,10 +1494,7 @@ sal_Bool SAL_CALL SfxBaseModel::hasLocation() throw(::com::sun::star::uno::Runti sal_Bool SAL_CALL SfxBaseModel::isReadonly() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); return m_pData->m_pObjectShell.Is() ? m_pData->m_pObjectShell->IsReadOnly() : sal_True; } @@ -1603,10 +1510,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa { RTL_LOGFILE_PRODUCT_CONTEXT( aPerfLog, "PERFORMANCE - SfxBaseModel::storeSelf" ); - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell.Is() ) { @@ -1704,10 +1608,7 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString& { RTL_LOGFILE_PRODUCT_CONTEXT( aPerfLog, "PERFORMANCE - SfxBaseModel::storeAsURL" ); - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell.Is() ) { @@ -1730,10 +1631,7 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString& const uno::Sequence< beans::PropertyValue >& rArgs ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell.Is() ) { @@ -1743,6 +1641,30 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString& } } +void SAL_CALL SfxBaseModel::doEmergencySave( const ::rtl::OUString& i_TargetLocation, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) +{ + // just delegate this to storeToURL + storeToURL( i_TargetLocation, i_MediaDescriptor ); +} + +void SAL_CALL SfxBaseModel::recoverDocument( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) +{ + // delegate to our "load" method + ::comphelper::NamedValueCollection aMediaDescriptor( i_MediaDescriptor ); + + // our load implementation expects the SalvagedFile to be in the media descriptor + OSL_ENSURE( !aMediaDescriptor.has( "SalvagedFile" ) || ( aMediaDescriptor.getOrDefault( "SalvagedFile", ::rtl::OUString() ) == i_SalvagedFile ), + "SfxBaseModel::recoverDocument: inconsistent information!" ); + aMediaDescriptor.put( "SalvagedFile", i_SalvagedFile ); + + // similar for the to-be-loaded file + OSL_ENSURE( !aMediaDescriptor.has( "URL" ) || ( aMediaDescriptor.getOrDefault( "URL", ::rtl::OUString() ) == i_SourceLocation ), + "SfxBaseModel::recoverDocument: inconsistent information!" ); + aMediaDescriptor.put( "URL", i_SourceLocation ); + + load( aMediaDescriptor.getPropertyValues() ); +} + //________________________________________________________________________________________________________ // XLoadable //________________________________________________________________________________________________________ @@ -1753,10 +1675,12 @@ void SAL_CALL SfxBaseModel::initNew() ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception) { - // object already disposed? ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + // do not use the SfxModelGuard, it would throw, since we're not yet initialized + if ( IsDisposed() ) + throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *this ); + if ( IsInitialized() ) + throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this ); // the object shell should exist always DBG_ASSERT( m_pData->m_pObjectShell.Is(), "Model is useless without an ObjectShell" ); @@ -1785,10 +1709,12 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >& ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception) { - // object already disposed? ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + // do not use the SfxModelGuard, it would throw, since we're not yet initialized + if ( IsDisposed() ) + throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *this ); + if ( IsInitialized() ) + throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this ); // the object shell should exist always DBG_ASSERT( m_pData->m_pObjectShell.Is(), "Model is useless without an ObjectShell" ); @@ -1951,10 +1877,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Any aAny; @@ -2193,10 +2116,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) uno::Sequence< DATAFLAVOR > SAL_CALL SfxBaseModel::getTransferDataFlavors() throw (::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); sal_Int32 nSuppFlavors = GraphicHelper::supportsMetaFileHandle_Impl() ? 10 : 8; uno::Sequence< DATAFLAVOR > aFlavorSeq( nSuppFlavors ); @@ -2265,10 +2185,7 @@ uno::Sequence< DATAFLAVOR > SAL_CALL SfxBaseModel::getTransferDataFlavors() sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor ) throw (::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) ) { @@ -2327,10 +2244,7 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor uno::Reference< container::XNameReplace > SAL_CALL SfxBaseModel::getEvents() throw( uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( ! m_pData->m_xEvents.is() ) { @@ -2346,9 +2260,7 @@ uno::Reference< container::XNameReplace > SAL_CALL SfxBaseModel::getEvents() thr uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::getBasicLibraries() throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries; if ( m_pData->m_pObjectShell ) @@ -2358,9 +2270,7 @@ uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::g uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::getDialogLibraries() throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries; if ( m_pData->m_pObjectShell ) @@ -2370,9 +2280,7 @@ uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::g ::sal_Bool SAL_CALL SfxBaseModel::getAllowMacroExecution() throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell ) return m_pData->m_pObjectShell->AdjustMacroMode( String(), false ); @@ -2385,9 +2293,7 @@ uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::g Reference< document::XEmbeddedScripts > SAL_CALL SfxBaseModel::getScriptContainer() throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); Reference< document::XEmbeddedScripts > xDocumentScripts; @@ -2423,10 +2329,7 @@ Reference< document::XEmbeddedScripts > SAL_CALL SfxBaseModel::getScriptContaine void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XDOCEVENTLISTENER >& aListener ) throw( uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XDOCEVENTLISTENER >*)0), aListener ); } @@ -2437,10 +2340,7 @@ void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XDOCEVENTLIS void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XDOCEVENTLISTENER >& aListener ) throw( uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XDOCEVENTLISTENER >*)0), aListener ); } @@ -2603,11 +2503,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , void SfxBaseModel::changing() { - // object already disposed? - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); // the notification should not be sent if the document can not be modified if ( !m_pData->m_pObjectShell.Is() || !m_pData->m_pObjectShell->IsEnableSetModified() ) @@ -2682,6 +2578,17 @@ sal_Bool SfxBaseModel::IsDisposed() const return ( m_pData == NULL ) ; } +sal_Bool SfxBaseModel::IsInitialized() const +{ + if ( !m_pData || !m_pData->m_pObjectShell ) + { + OSL_ENSURE( false, "SfxBaseModel::IsInitialized: this should have been caught earlier!" ); + return sal_False; + } + + return m_pData->m_pObjectShell->GetMedium() != NULL; +} + sal_Bool SfxBaseModel::impl_isDisposed() const { return ( m_pData == NULL ) ; @@ -2949,10 +2856,7 @@ void SfxBaseModel::postEvent_Impl( ::rtl::OUString aName ) uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell.Is() && !m_pData->m_contViewData.is() ) { @@ -2995,10 +2899,7 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() void SAL_CALL SfxBaseModel::setViewData( const uno::Reference < container::XIndexAccess >& aData ) throw(::com::sun::star::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); m_pData->m_contViewData = aData; } @@ -3038,10 +2939,7 @@ sal_Bool SfxBaseModel::hasEventListeners() const void SAL_CALL SfxBaseModel::addPrintJobListener( const uno::Reference< view::XPrintJobListener >& xListener ) throw (uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( impl_getPrintHelper() ) { @@ -3055,10 +2953,7 @@ void SAL_CALL SfxBaseModel::addPrintJobListener( const uno::Reference< view::XPr void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view::XPrintJobListener >& xListener ) throw (uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); if ( impl_getPrintHelper() ) { @@ -3076,8 +2971,8 @@ void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view:: class SvObject; sal_Int64 SAL_CALL SfxBaseModel::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( !impl_isDisposed() && GetObjectShell() ) + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); + if ( GetObjectShell() ) { SvGlobalName aName( aIdentifier ); if ( aName == SvGlobalName( SO3_GLOBAL_CLASSID ) ) @@ -3111,9 +3006,7 @@ void SfxBaseModel::ListenForStorage_Impl( const uno::Reference< embed::XStorage uno::Reference< XSTORAGE > SAL_CALL SfxBaseModel::getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ) throw ( uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< XSTORAGE > xResult; if ( m_pData->m_pObjectShell.Is() ) @@ -3138,9 +3031,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames() throw ( io::IOException, RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); Sequence< ::rtl::OUString > aResult; sal_Int32 nResultSize = 0; @@ -3179,9 +3070,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames() uno::Reference< script::provider::XScriptProvider > SAL_CALL SfxBaseModel::getScriptProvider() throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< script::provider::XScriptProvider > xScriptProvider; @@ -3287,9 +3176,7 @@ static void ConvertSlotsToCommands( SfxObjectShell* pDoc, uno::Reference< contai uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfigurationManager() throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_xUIConfigurationManager.is() ) { @@ -3405,9 +3292,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz uno::Exception, uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_pObjectShell.Is() ) throw uno::Exception(); // TODO: error handling @@ -3439,9 +3324,7 @@ awt::Size SAL_CALL SfxBaseModel::getVisualAreaSize( sal_Int64 /*nAspect*/ ) uno::Exception, uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_pObjectShell.Is() ) throw uno::Exception(); // TODO: error handling @@ -3470,9 +3353,7 @@ sal_Int32 SAL_CALL SfxBaseModel::getMapUnit( sal_Int64 /*nAspect*/ ) throw ( uno::Exception, uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( !m_pData->m_pObjectShell.Is() ) throw uno::Exception(); // TODO: error handling @@ -3486,9 +3367,7 @@ embed::VisualRepresentation SAL_CALL SfxBaseModel::getPreferredVisualRepresentat uno::Exception, uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); datatransfer::DataFlavor aDataFlavor( ::rtl::OUString::createFromAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ), @@ -3515,43 +3394,36 @@ void SAL_CALL SfxBaseModel::loadFromStorage( const uno::Reference< XSTORAGE >& x uno::RuntimeException ) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); - - if ( !m_pData->m_pObjectShell.Is() ) - throw IOEXCEPTION(); // TODO: + // do not use the SfxModelGuard, it would throw, since we're not yet initialized + if ( IsDisposed() ) + throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *this ); + if ( IsInitialized() ) + throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this ); + + // after i36090 is fixed the pool from object shell can be used + // SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() ); + SfxAllItemSet aSet( SFX_APP()->GetPool() ); + + // the BaseURL is part of the ItemSet + SfxMedium* pMedium = new SfxMedium( xStorage, String() ); + TransformParameters( SID_OPENDOC, aMediaDescriptor, aSet ); + pMedium->GetItemSet()->Put( aSet ); + + // allow to use an interactionhandler (if there is one) + pMedium->UseInteractionHandler( TRUE ); + + SFX_ITEMSET_ARG( &aSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False); + BOOL bTemplate = pTemplateItem && pTemplateItem->GetValue(); + m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC ); + m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = FALSE; - if ( m_pData->m_pObjectShell.Is() ) + // load document + if ( !m_pData->m_pObjectShell->DoLoad(pMedium) ) { - if( m_pData->m_pObjectShell->GetMedium() ) - // if a Medium is present, the document is already initialized - throw DOUBLEINITIALIZATIONEXCEPTION(); - - // after i36090 is fixed the pool from object shell can be used - // SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() ); - SfxAllItemSet aSet( SFX_APP()->GetPool() ); - - // the BaseURL is part of the ItemSet - SfxMedium* pMedium = new SfxMedium( xStorage, String() ); - TransformParameters( SID_OPENDOC, aMediaDescriptor, aSet ); - pMedium->GetItemSet()->Put( aSet ); - - // allow to use an interactionhandler (if there is one) - pMedium->UseInteractionHandler( TRUE ); - - SFX_ITEMSET_ARG( &aSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False); - BOOL bTemplate = pTemplateItem && pTemplateItem->GetValue(); - m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC ); - m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = FALSE; - - // load document - if ( !m_pData->m_pObjectShell->DoLoad(pMedium) ) - { - sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode(); - throw task::ErrorCodeIOException( ::rtl::OUString(), - uno::Reference< uno::XInterface >(), - nError ? nError : ERRCODE_IO_CANTREAD ); - } + sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode(); + throw task::ErrorCodeIOException( ::rtl::OUString(), + uno::Reference< uno::XInterface >(), + nError ? nError : ERRCODE_IO_CANTREAD ); } } @@ -3562,9 +3434,7 @@ void SAL_CALL SfxBaseModel::storeToStorage( const uno::Reference< XSTORAGE >& xS EXCEPTION, uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< XSTORAGE > xResult; if ( !m_pData->m_pObjectShell.Is() ) @@ -3625,9 +3495,7 @@ void SAL_CALL SfxBaseModel::switchToStorage( const uno::Reference< XSTORAGE >& x EXCEPTION, uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< XSTORAGE > xResult; if ( !m_pData->m_pObjectShell.Is() ) @@ -3651,9 +3519,7 @@ uno::Reference< XSTORAGE > SAL_CALL SfxBaseModel::getDocumentStorage() EXCEPTION, uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); uno::Reference< XSTORAGE > xResult; if ( !m_pData->m_pObjectShell.Is() ) @@ -3666,9 +3532,7 @@ void SAL_CALL SfxBaseModel::addStorageChangeListener( const uno::Reference< document::XStorageChangeListener >& xListener ) throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< document::XStorageChangeListener >*)0), xListener ); @@ -3678,9 +3542,7 @@ void SAL_CALL SfxBaseModel::removeStorageChangeListener( const uno::Reference< document::XStorageChangeListener >& xListener ) throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< document::XStorageChangeListener >*)0), xListener ); @@ -3706,9 +3568,7 @@ bool SfxBaseModel::impl_getPrintHelper() void SAL_CALL SfxBaseModel::setIdentifier(const ::rtl::OUString& Identifier) throw (css::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); m_pData->m_sModuleIdentifier = Identifier; } @@ -3717,9 +3577,7 @@ bool SfxBaseModel::impl_getPrintHelper() ::rtl::OUString SAL_CALL SfxBaseModel::getIdentifier() throw (css::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return ::rtl::OUString(); + SfxModelGuard aGuard( *this ); if (m_pData->m_sModuleIdentifier.getLength() > 0) return m_pData->m_sModuleIdentifier; if (m_pData->m_pObjectShell) @@ -3730,10 +3588,7 @@ bool SfxBaseModel::impl_getPrintHelper() //============================================================================= css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper () { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - if ( impl_isDisposed() ) - return css::uno::Reference< css::frame::XTitle >(); + SfxModelGuard aGuard( *this ); if ( ! m_pData->m_xTitleHelper.is ()) { @@ -3753,10 +3608,7 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper () //============================================================================= css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitledHelper () { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - if ( impl_isDisposed() ) - return css::uno::Reference< css::frame::XUntitledNumbers >(); + SfxModelGuard aGuard( *this ); if ( ! m_pData->m_xNumberedControllers.is ()) { @@ -3778,10 +3630,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl throw (css::uno::RuntimeException) { // SYNCHRONIZED -> - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - if ( impl_isDisposed() ) - return ::rtl::OUString(); + SfxModelGuard aGuard( *this ); ::rtl::OUString aResult = impl_getTitleHelper()->getTitle (); if ( m_pData->m_pObjectShell ) @@ -3812,10 +3661,7 @@ void SAL_CALL SfxBaseModel::setTitle( const ::rtl::OUString& sTitle ) throw (css::uno::RuntimeException) { // SYNCHRONIZED -> - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); impl_getTitleHelper()->setTitle (sTitle); } @@ -3826,10 +3672,7 @@ void SAL_CALL SfxBaseModel::addTitleChangeListener( const css::uno::Reference< c throw (css::uno::RuntimeException) { // SYNCHRONIZED -> - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); css::uno::Reference< css::frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), css::uno::UNO_QUERY); if (xBroadcaster.is ()) @@ -3842,10 +3685,7 @@ void SAL_CALL SfxBaseModel::removeTitleChangeListener( const css::uno::Reference throw (css::uno::RuntimeException) { // SYNCHRONIZED -> - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - if ( impl_isDisposed() ) - return; + SfxModelGuard aGuard( *this ); css::uno::Reference< css::frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), css::uno::UNO_QUERY); if (xBroadcaster.is ()) @@ -3858,10 +3698,7 @@ void SAL_CALL SfxBaseModel::removeTitleChangeListener( const css::uno::Reference throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return css::frame::UntitledNumbersConst::INVALID_NUMBER; + SfxModelGuard aGuard( *this ); return impl_getUntitledHelper ()->leaseNumber (xComponent); } @@ -3872,11 +3709,7 @@ void SAL_CALL SfxBaseModel::releaseNumber( ::sal_Int32 nNumber ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; - + SfxModelGuard aGuard( *this ); impl_getUntitledHelper ()->releaseNumber (nNumber); } @@ -3886,11 +3719,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return; - + SfxModelGuard aGuard( *this ); impl_getUntitledHelper ()->releaseNumberForComponent (xComponent); } @@ -3899,11 +3728,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference ::rtl::OUString SAL_CALL SfxBaseModel::getUntitledPrefix() throw (css::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return ::rtl::OUString (); - + SfxModelGuard aGuard( *this ); return impl_getUntitledHelper ()->getUntitledPrefix (); } @@ -3912,10 +3737,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference css::uno::Reference< css::container::XEnumeration > SAL_CALL SfxBaseModel::getControllers() throw (css::uno::RuntimeException) { - // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - return css::uno::Reference< css::container::XEnumeration >(); + SfxModelGuard aGuard( *this ); sal_Int32 c = m_pData->m_seqControllers.getLength(); sal_Int32 i = 0; @@ -3933,9 +3755,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL SfxBaseModel::getCo css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewControllerNames() throw (css::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); const sal_Int32 nViewFactoryCount = rDocumentFactory.GetViewFactoryCount(); @@ -3953,9 +3773,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef css::lang::IllegalArgumentException, css::uno::Exception ) { - ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName(); @@ -4071,9 +3889,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie css::lang::IllegalArgumentException, css::uno::Exception ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); if ( !i_rFrame.is() ) throw css::lang::IllegalArgumentException( ::rtl::OUString(), *this, 3 ); @@ -4159,9 +3975,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie uno::Reference< rdf::XRepository > SAL_CALL SfxBaseModel::getRDFRepository() throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4176,9 +3990,7 @@ SfxBaseModel::getRDFRepository() throw (uno::RuntimeException) ::rtl::OUString SAL_CALL SfxBaseModel::getStringValue() throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4193,9 +4005,7 @@ SfxBaseModel::getStringValue() throw (uno::RuntimeException) ::rtl::OUString SAL_CALL SfxBaseModel::getNamespace() throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4209,9 +4019,7 @@ SfxBaseModel::getNamespace() throw (uno::RuntimeException) ::rtl::OUString SAL_CALL SfxBaseModel::getLocalName() throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4228,9 +4036,7 @@ SfxBaseModel::getElementByMetadataReference( const ::com::sun::star::beans::StringPair & i_rReference) throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4245,9 +4051,7 @@ uno::Reference< rdf::XMetadatable > SAL_CALL SfxBaseModel::getElementByURI(const uno::Reference< rdf::XURI > & i_xURI) throw (uno::RuntimeException, lang::IllegalArgumentException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4263,9 +4067,7 @@ SfxBaseModel::getMetadataGraphsWithType( const uno::Reference & i_xType) throw (uno::RuntimeException, lang::IllegalArgumentException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4282,9 +4084,7 @@ SfxBaseModel::addMetadataFile(const ::rtl::OUString & i_rFileName, throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4305,9 +4105,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, datatransfer::UnsupportedFlavorException, container::ElementExistException, rdf::ParseException, io::IOException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4325,9 +4123,7 @@ SfxBaseModel::removeMetadataFile( throw (uno::RuntimeException, lang::IllegalArgumentException, container::NoSuchElementException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4343,9 +4139,7 @@ SfxBaseModel::addContentOrStylesFile(const ::rtl::OUString & i_rFileName) throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4361,9 +4155,7 @@ SfxBaseModel::removeContentOrStylesFile(const ::rtl::OUString & i_rFileName) throw (uno::RuntimeException, lang::IllegalArgumentException, container::NoSuchElementException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4382,9 +4174,7 @@ SfxBaseModel::loadMetadataFromStorage( throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA( m_pData->CreateDMAUninitialized()); @@ -4412,9 +4202,7 @@ SfxBaseModel::storeMetadataToStorage( throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { @@ -4431,9 +4219,7 @@ SfxBaseModel::loadMetadataFromMedium( throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA( m_pData->CreateDMAUninitialized()); @@ -4460,9 +4246,7 @@ SfxBaseModel::storeMetadataToMedium( throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - if ( impl_isDisposed() ) - throw lang::DisposedException(); + SfxModelGuard aGuard( *this ); const uno::Reference xDMA(m_pData->GetDMA()); if (!xDMA.is()) { -- cgit v1.2.3 From 4a4bb1f2b316f123612e2acb18bab02505f5a59c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 6 Jan 2010 11:11:09 +0100 Subject: dba33e: #i106303# when saving to the storage we're already based on, then don't do this in-place, use a temporary target instead This ensures that password protected libraries, which are not yet unprotected, and thus cannot be loaded, are properly stored, too. --- basic/source/uno/namecont.cxx | 151 ++++++++++++++++++++++++++++-------------- 1 file changed, 102 insertions(+), 49 deletions(-) diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index c15d937f9b..2928db3607 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1737,7 +1737,7 @@ void SfxLibraryContainer::implImportLibDescriptor // Methods of new XLibraryStorage interface? -void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XStorage >& xStorage, sal_Bool bComplete ) +void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XStorage >& i_rStorage, sal_Bool bComplete ) { const Sequence< OUString > aNames = maNameContainer.getElementNames(); sal_Int32 nNameCount = aNames.getLength(); @@ -1758,35 +1758,13 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto ::xmlscript::LibDescriptorArray* pLibArray = new ::xmlscript::LibDescriptorArray( nLibsToSave ); // Write to storage? - sal_Bool bStorage = xStorage.is(); - uno::Reference< embed::XStorage > xLibrariesStor; + sal_Bool bStorage = i_rStorage.is(); uno::Reference< embed::XStorage > xSourceLibrariesStor; - if( bStorage ) + uno::Reference< embed::XStorage > xTargetLibrariesStor; + ::rtl::OUString sTempTargetStorName; + const bool bInplaceStorage = bStorage && ( i_rStorage == mxStorage ); + if ( bStorage ) { - // when we save to our root storage, ensure the libs are all loaded. Else the below cleaning - // of the target storage will loose them. - if ( xStorage == mxStorage ) - { - pName = aNames.getConstArray(); - for ( ; pName != pNamesEnd; ++pName ) - { - if ( !isLibraryLoaded( *pName ) ) - loadLibrary( *pName ); - } - } - - // first of all, clean the target library storage, since the storing procedure must do overwrite - try - { - if ( xStorage->hasByName( maLibrariesDir ) ) - xStorage->removeElement( maLibrariesDir ); - } - catch( const uno::Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - return; - } - // Don't write if only empty standard lib exists if ( ( nNameCount == 1 ) && ( aNames[0].equalsAscii( "Standard" ) ) ) { @@ -1797,29 +1775,52 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto return; } - try { - xLibrariesStor.set( xStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READWRITE ), UNO_QUERY_THROW ); + // create the empty target storage + try + { + ::rtl::OUString sTargetLibrariesStoreName; + if ( bInplaceStorage ) + { + // create a temporary target storage + const ::rtl::OUStringBuffer aTempTargetNameBase = maLibrariesDir + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_temp_" ) ); + do + { + ::rtl::OUStringBuffer aTempTargetName( aTempTargetNameBase ); + sal_Int32 index = 0; + aTempTargetName.append( index ); + + sTargetLibrariesStoreName = aTempTargetName.makeStringAndClear(); + if ( !i_rStorage->hasByName( sTargetLibrariesStoreName ) ) + break; + } + while ( true ); + sTempTargetStorName = sTargetLibrariesStoreName; + } + else + { + sTargetLibrariesStoreName = maLibrariesDir; + if ( i_rStorage->hasByName( sTargetLibrariesStoreName ) ) + i_rStorage->removeElement( sTargetLibrariesStoreName ); + } + + xTargetLibrariesStor.set( i_rStorage->openStorageElement( sTargetLibrariesStoreName, embed::ElementModes::READWRITE ), UNO_QUERY_THROW ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { - #if OSL_DEBUG_LEVEL > 0 - Any aError( ::cppu::getCaughtException() ); - ::rtl::OStringBuffer aMessage; - aMessage.append( "couln't open source library storage.\n\nException:" ); - aMessage.append( ::rtl::OUStringToOString( ::comphelper::anyToString( aError ), osl_getThreadTextEncoding() ) ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); - #endif + DBG_UNHANDLED_EXCEPTION(); return; } + // open the source storage which might be used to copy yet-unmodified libraries try { - if ( ( mxStorage != xStorage ) && ( mxStorage->hasByName( maLibrariesDir ) ) ) - xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READ ); + if ( mxStorage->hasByName( maLibrariesDir ) ) + xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, bInplaceStorage ? embed::ElementModes::READWRITE : embed::ElementModes::READ ); } catch( const uno::Exception& ) { DBG_UNHANDLED_EXCEPTION(); + return; } } @@ -1831,7 +1832,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto SfxLibrary* pImplLib = getImplLib( *pName ); if( pImplLib->mbSharedIndexFile ) continue; - bool bExtensionLib = pImplLib->mbExtension; + const bool bExtensionLib = pImplLib->mbExtension; ::xmlscript::LibDescriptor& rLib = bExtensionLib ? aLibDescriptorForExtensionLibs : pLibArray->mpLibs[iArray]; if( !bExtensionLib ) @@ -1851,12 +1852,14 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto if( pImplLib->implIsModified() || bComplete ) { - // Can we copy the storage? + // Can we simply copy the storage? if( !mbOldInfoFormat && !pImplLib->implIsModified() && !mbOasis2OOoFormat && xSourceLibrariesStor.is() ) { - try { - xSourceLibrariesStor->copyElementTo( rLib.aName, xLibrariesStor, rLib.aName ); - } catch( uno::Exception& ) + try + { + xSourceLibrariesStor->copyElementTo( rLib.aName, xTargetLibrariesStor, rLib.aName ); + } + catch( const uno::Exception& ) { DBG_UNHANDLED_EXCEPTION(); // TODO: error handling? @@ -1869,7 +1872,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto { try { - xLibraryStor = xLibrariesStor->openStorageElement( + xLibraryStor = xTargetLibrariesStor->openStorageElement( rLib.aName, embed::ElementModes::READWRITE ); } @@ -1901,7 +1904,8 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto implStoreLibraryIndexFile( pImplLib, rLib, xLibraryStor ); if( bStorage ) { - try { + try + { uno::Reference< embed::XTransactedObject > xTransact( xLibraryStor, uno::UNO_QUERY_THROW ); xTransact->commit(); } @@ -1921,6 +1925,55 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto rLib.bReadOnly = pImplLib->mbReadOnlyLink; } + // if we did an in-place save into a storage (i.e. a save into the storage we were already based on), + // then we need to clean up the temporary storage we used for this + if ( bInplaceStorage && sTempTargetStorName.getLength() ) + { + try + { + // for this, we first remove everything from the source storage, then copy the complete content + // from the temporary target storage. From then on, what used to be the "source storage" becomes + // the "targt storage" for all subsequent operations. + + // (We cannot simply remove the storage, denoted by maLibrariesDir, from i_rStorage - there might be + // open references to it.) + + // remove + const Sequence< ::rtl::OUString > aRemoveNames( xTargetLibrariesStor->getElementNames() ); + for ( const ::rtl::OUString* pRemoveName = aRemoveNames.getConstArray(); + pRemoveName != aRemoveNames.getConstArray() + aRemoveNames.getLength(); + ++pRemoveName + ) + { + xSourceLibrariesStor->removeElement( *pRemoveName ); + } + + // copy + const Sequence< ::rtl::OUString > aCopyNames( xTargetLibrariesStor->getElementNames() ); + for ( const ::rtl::OUString* pCopyName = aCopyNames.getConstArray(); + pCopyName != aCopyNames.getConstArray() + aCopyNames.getLength(); + ++pCopyName + ) + { + xTargetLibrariesStor->copyElementTo( *pCopyName, xSourceLibrariesStor, *pCopyName ); + } + + // close and remove temp target + xTargetLibrariesStor->dispose(); + i_rStorage->removeElement( sTempTargetStorName ); + xTargetLibrariesStor.clear(); + sTempTargetStorName = ::rtl::OUString(); + + // adjust target + xTargetLibrariesStor = xSourceLibrariesStor; + xSourceLibrariesStor.clear(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + if( !mbOldInfoFormat && !maModifiable.isModified() ) return; maModifiable.setModified( sal_False ); @@ -1946,7 +1999,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto aStreamName += String( RTL_CONSTASCII_USTRINGPARAM("-lc.xml") ); try { - xInfoStream = xLibrariesStor->openStreamElement( aStreamName, embed::ElementModes::READWRITE ); + xInfoStream = xTargetLibrariesStor->openStreamElement( aStreamName, embed::ElementModes::READWRITE ); uno::Reference< beans::XPropertySet > xProps( xInfoStream, uno::UNO_QUERY ); OSL_ENSURE ( xProps.is(), "The stream must implement XPropertySet!\n" ); if ( !xProps.is() ) @@ -2005,7 +2058,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto xmlscript::exportLibraryContainer( xHandler, pLibArray ); if ( bStorage ) { - uno::Reference< embed::XTransactedObject > xTransact( xLibrariesStor, uno::UNO_QUERY ); + uno::Reference< embed::XTransactedObject > xTransact( xTargetLibrariesStor, uno::UNO_QUERY ); OSL_ENSURE( xTransact.is(), "The storage must implement XTransactedObject!\n" ); if ( !xTransact.is() ) throw uno::RuntimeException(); -- cgit v1.2.3 From 8cf4c0b7722345bc94eb968842d67f7ebd84fa6e Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 6 Jan 2010 11:29:46 +0100 Subject: aw079: #i107500# changed 3D renderer to be able to render overlapping transparent parts from back to front (Z-sorted) --- .../processor3d/defaultprocessor3d.hxx | 13 +- .../processor3d/zbufferprocessor3d.hxx | 20 +- .../source/primitive2d/sceneprimitive2d.cxx | 5 +- drawinglayer/source/processor2d/vclprocessor2d.cxx | 72 ++++- .../source/processor3d/defaultprocessor3d.cxx | 54 ++-- .../source/processor3d/zbufferprocessor3d.cxx | 333 ++++++++++++++------- 6 files changed, 320 insertions(+), 177 deletions(-) diff --git a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx index a91238435d..e1dde72111 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx @@ -41,6 +41,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// // predefines @@ -90,14 +91,17 @@ namespace drawinglayer basegfx::BColorModifierStack maBColorModifierStack; // the current active texture - texture::GeoTexSvx* mpGeoTexSvx; + boost::shared_ptr< texture::GeoTexSvx > mpGeoTexSvx; // the current active transparence texture - texture::GeoTexSvx* mpTransparenceGeoTexSvx; + boost::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx; // SvtOptionsDrawinglayer incarnation to react on diverse settings const SvtOptionsDrawinglayer maDrawinglayerOpt; + // counter for entered transparence textures + sal_uInt32 mnTransparenceCounter; + // bitfield unsigned mbModulate : 1; unsigned mbFilter : 1; @@ -135,8 +139,9 @@ namespace drawinglayer // data read access renderer stuff const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; } - const texture::GeoTexSvx* getGeoTexSvx() const { return mpGeoTexSvx; } - const texture::GeoTexSvx* getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; } + const boost::shared_ptr< texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; } + const boost::shared_ptr< texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; } + sal_uInt32 getTransparenceCounter() const { return mnTransparenceCounter; } bool getModulate() const { return mbModulate; } bool getFilter() const { return mbFilter; } bool getSimpleTextureActive() const { return mbSimpleTextureActive; } diff --git a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx index 0f57556549..d741dabde9 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx @@ -58,6 +58,7 @@ namespace drawinglayer { } class ZBufferRasterConverter3D; +class RasterPrimitive3D; ////////////////////////////////////////////////////////////////////////////// @@ -81,21 +82,15 @@ namespace drawinglayer // will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create sal_uInt16 mnAntiAlialize; - // bitfield - // a combination of bools to allow two-pass rendering to render - // the transparent parts in the 2nd run (if any) as needed for Z-Buffer - unsigned mbProcessTransparent : 1; - unsigned mbContainsTransparent : 1; - + // remembered RasterPrimitive3D's which need to be painted back to front + // for transparent 3D parts + std::vector< RasterPrimitive3D >* mpRasterPrimitive3Ds; ////////////////////////////////////////////////////////////////////////////// // rasterconversions for filled and non-filled polygons virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const; virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const; - // the processing method for a single, known primitive - virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive); - public: ZBufferProcessor3D( const geometry::ViewInformation3D& rViewInformation3D, @@ -108,12 +103,7 @@ namespace drawinglayer sal_uInt16 nAntiAlialize); virtual ~ZBufferProcessor3D(); - // helpers for drawing transparent parts in 2nd run. To use this - // processor, call processNonTransparent and then processTransparent - // with the same primitives. The 2nd call will only do something, - // when transparent parts are contained - void processNonTransparent(const primitive3d::Primitive3DSequence& rSource); - void processTransparent(const primitive3d::Primitive3DSequence& rSource); + void finish(); // get the result as bitmapEx BitmapEx getBitmapEx() const; diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index acf3307bbf..0db498b34e 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -235,8 +235,9 @@ namespace drawinglayer aUnitVisibleRange, nOversampleValue); - aZBufferProcessor3D.processNonTransparent(getChildren3D()); - aZBufferProcessor3D.processTransparent(getChildren3D()); + aZBufferProcessor3D.process(getChildren3D()); + aZBufferProcessor3D.finish(); + const_cast< ScenePrimitive2D* >(this)->maOldRenderedBitmap = aZBufferProcessor3D.getBitmapEx(); const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel()); diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 625a26797e..fddde4d692 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -337,17 +337,69 @@ namespace drawinglayer basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon()); aLocalPolygon.transform(maCurrentTransformation); - if(bPixelBased && getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete()) + static bool bCheckTrapezoidDecomposition(false); + static bool bShowOutlinesThere(false); + if(bCheckTrapezoidDecomposition) { - // #i98289# - // when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete - // allows to suppress AntiAliasing for pure horizontal or vertical lines. This is done since - // not-AntiAliased such lines look more pleasing to the eye (e.g. 2D chart content). This - // NEEDS to be done in discrete coordinates, so only useful for pixel based rendering. - aLocalPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aLocalPolygon); + // clip against discrete ViewPort + const basegfx::B2DRange& rDiscreteViewport = getViewInformation2D().getDiscreteViewport(); + basegfx::B2DPolyPolygon aLocalPolyPolygon(basegfx::tools::clipPolygonOnRange( + aLocalPolygon, rDiscreteViewport, true, false)); + + if(aLocalPolyPolygon.count()) + { + // subdivide + aLocalPolyPolygon = basegfx::tools::adaptiveSubdivideByDistance( + aLocalPolyPolygon, 0.5); + + // trapezoidize + static double fLineWidth(2.0); + basegfx::B2DTrapezoidVector aB2DTrapezoidVector; + basegfx::tools::createLineTrapezoidFromB2DPolyPolygon(aB2DTrapezoidVector, aLocalPolyPolygon, fLineWidth); + + const sal_uInt32 nCount(aB2DTrapezoidVector.size()); + + if(nCount) + { + basegfx::BColor aInvPolygonColor(aHairlineColor); + aInvPolygonColor.invert(); + + for(sal_uInt32 a(0); a < nCount; a++) + { + const basegfx::B2DPolygon aTempPolygon(aB2DTrapezoidVector[a].getB2DPolygon()); + + if(bShowOutlinesThere) + { + mpOutputDevice->SetFillColor(Color(aHairlineColor)); + mpOutputDevice->SetLineColor(); + } + + mpOutputDevice->DrawPolygon(aTempPolygon); + + if(bShowOutlinesThere) + { + mpOutputDevice->SetFillColor(); + mpOutputDevice->SetLineColor(Color(aInvPolygonColor)); + mpOutputDevice->DrawPolyLine(aTempPolygon, 0.0); + } + } + } + } } + else + { + if(bPixelBased && getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete()) + { + // #i98289# + // when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete + // allows to suppress AntiAliasing for pure horizontal or vertical lines. This is done since + // not-AntiAliased such lines look more pleasing to the eye (e.g. 2D chart content). This + // NEEDS to be done in discrete coordinates, so only useful for pixel based rendering. + aLocalPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aLocalPolygon); + } - mpOutputDevice->DrawPolyLine(aLocalPolygon, 0.0); + mpOutputDevice->DrawPolyLine(aLocalPolygon, 0.0); + } } // direct draw of transformed BitmapEx primitive @@ -684,8 +736,8 @@ namespace drawinglayer aLocalPolyPolygon, 0.5); // trapezoidize - const basegfx::B2DTrapezoidVector aB2DTrapezoidVector(basegfx::tools::trapezoidSubdivide( - aLocalPolyPolygon)); + basegfx::B2DTrapezoidVector aB2DTrapezoidVector; + basegfx::tools::trapezoidSubdivide(aB2DTrapezoidVector, aLocalPolyPolygon); const sal_uInt32 nCount(aB2DTrapezoidVector.size()); diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index 33a2e1639f..a6fef12176 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -71,8 +71,8 @@ namespace drawinglayer // rescue values const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate(); const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter(); - const bool bOldSimpleTextureActive(mbSimpleTextureActive); - texture::GeoTexSvx* pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx; + const bool bOldSimpleTextureActive(getSimpleTextureActive()); + boost::shared_ptr< texture::GeoTexSvx > pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx; // create texture const attribute::FillGradientAttribute& rFillGradient = rPrimitive.getGradient(); @@ -82,7 +82,7 @@ namespace drawinglayer const basegfx::BColor aStart(rFillGradient.getStartColor()); const basegfx::BColor aEnd(rFillGradient.getEndColor()); const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5)); - texture::GeoTexSvx* pNewTex = 0L; + boost::shared_ptr< texture::GeoTexSvx > pNewTex; if(nMaxSteps) { @@ -106,32 +106,32 @@ namespace drawinglayer { case attribute::GRADIENTSTYLE_LINEAR: { - pNewTex = new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle()); + pNewTex.reset(new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle())); break; } case attribute::GRADIENTSTYLE_AXIAL: { - pNewTex = new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle()); + pNewTex.reset(new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle())); break; } case attribute::GRADIENTSTYLE_RADIAL: { - pNewTex = new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY()); + pNewTex.reset(new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY())); break; } case attribute::GRADIENTSTYLE_ELLIPTICAL: { - pNewTex = new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()); + pNewTex.reset(new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle())); break; } case attribute::GRADIENTSTYLE_SQUARE: { - pNewTex = new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()); + pNewTex.reset(new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle())); break; } case attribute::GRADIENTSTYLE_RECT: { - pNewTex = new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()); + pNewTex.reset(new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle())); break; } } @@ -141,7 +141,7 @@ namespace drawinglayer else { // no color distance -> same color, use simple texture - pNewTex = new texture::GeoTexSvxMono(aStart, 1.0 - aStart.luminance()); + pNewTex.reset(new texture::GeoTexSvxMono(aStart, 1.0 - aStart.luminance())); mbSimpleTextureActive = true; } @@ -158,9 +158,6 @@ namespace drawinglayer // process sub-list process(rSubSequence); - // delete texture - delete pNewTex; - // restore values mbModulate = bOldModulate; mbFilter = bOldFilter; @@ -186,7 +183,7 @@ namespace drawinglayer // rescue values const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate(); const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter(); - texture::GeoTexSvx* pOldTex = mpGeoTexSvx; + boost::shared_ptr< texture::GeoTexSvx > pOldTex = mpGeoTexSvx; // calculate logic pixel size in object coordinates. Create transformation view // to object by inverting ObjectToView @@ -206,15 +203,11 @@ namespace drawinglayer const double fLogicTexSize(fLogicTexSizeX > fLogicTexSizeY ? fLogicTexSizeX : fLogicTexSizeY); // create texture and set - texture::GeoTexSvxMultiHatch* pNewTex = new texture::GeoTexSvxMultiHatch(rPrimitive, fLogicTexSize); - mpGeoTexSvx = pNewTex; + mpGeoTexSvx.reset(new texture::GeoTexSvxMultiHatch(rPrimitive, fLogicTexSize)); // process sub-list process(rSubSequence); - // delete texture - delete mpGeoTexSvx; - // restore values mbModulate = bOldModulate; mbFilter = bOldFilter; @@ -231,32 +224,29 @@ namespace drawinglayer // rescue values const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate(); const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter(); - texture::GeoTexSvx* pOldTex = mpGeoTexSvx; + boost::shared_ptr< texture::GeoTexSvx > pOldTex = mpGeoTexSvx; // create texture const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPrimitive.getBitmap(); if(rFillBitmapAttribute.getTiling()) { - mpGeoTexSvx = new texture::GeoTexSvxBitmapTiled( + mpGeoTexSvx.reset(new texture::GeoTexSvxBitmapTiled( rFillBitmapAttribute.getBitmap(), rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(), - rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()); + rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize())); } else { - mpGeoTexSvx = new texture::GeoTexSvxBitmap( + mpGeoTexSvx.reset(new texture::GeoTexSvxBitmap( rFillBitmapAttribute.getBitmap(), rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(), - rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()); + rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize())); } // process sub-list process(rSubSequence); - // delete texture - delete mpGeoTexSvx; - // restore values mbModulate = bOldModulate; mbFilter = bOldFilter; @@ -320,7 +310,7 @@ namespace drawinglayer if(bPaintIt) { // get rid of texture coordinates if there is no texture - if(aFill.areTextureCoordinatesUsed() && !getGeoTexSvx() && !getTransparenceGeoTexSvx()) + if(aFill.areTextureCoordinatesUsed() && !getGeoTexSvx().get() && !getTransparenceGeoTexSvx().get()) { aFill.clearTextureCoordinates(); } @@ -507,7 +497,9 @@ namespace drawinglayer { // AlphaTexturePrimitive3D const primitive3d::AlphaTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::AlphaTexturePrimitive3D& >(rBasePrimitive); + mnTransparenceCounter++; impRenderGradientTexturePrimitive3D(rPrimitive, true); + mnTransparenceCounter--; break; } case PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D : @@ -556,8 +548,10 @@ namespace drawinglayer mrSdrLightingAttribute(rSdrLightingAttribute), maRasterRange(), maBColorModifierStack(), - mpGeoTexSvx(0), - mpTransparenceGeoTexSvx(0), + mpGeoTexSvx(), + mpTransparenceGeoTexSvx(), + maDrawinglayerOpt(), + mnTransparenceCounter(0), mbModulate(false), mbFilter(false), mbSimpleTextureActive(false) diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index 3fd02a4a49..90ea9ecfc9 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -50,6 +50,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -233,14 +234,14 @@ private: basegfx::B2DPoint aTexCoor(0.0, 0.0); getTextureCoor(aTexCoor); - if(mrProcessor.getGeoTexSvx()) + if(mrProcessor.getGeoTexSvx().get()) { // calc color in spot. This may also set to invisible already when // e.g. bitmap textures have transparent parts mrProcessor.getGeoTexSvx()->modifyBColor(aTexCoor, rColor, fOpacity); } - if(basegfx::fTools::more(fOpacity, 0.0) && mrProcessor.getTransparenceGeoTexSvx()) + if(basegfx::fTools::more(fOpacity, 0.0) && mrProcessor.getTransparenceGeoTexSvx().get()) { // calc opacity. Object has a 2nd texture, a transparence texture mrProcessor.getTransparenceGeoTexSvx()->modifyOpacity(aTexCoor, fOpacity); @@ -249,7 +250,7 @@ private: if(basegfx::fTools::more(fOpacity, 0.0)) { - if(mrProcessor.getGeoTexSvx()) + if(mrProcessor.getGeoTexSvx().get()) { if(mbUseNrm) { @@ -317,9 +318,9 @@ private: mbModifyColor = mrProcessor.getBColorModifierStack().count(); mbHasTexCoor = SCANLINE_EMPTY_INDEX != rA.getTextureIndex() && SCANLINE_EMPTY_INDEX != rB.getTextureIndex(); mbHasInvTexCoor = SCANLINE_EMPTY_INDEX != rA.getInverseTextureIndex() && SCANLINE_EMPTY_INDEX != rB.getInverseTextureIndex(); - const bool bTextureActive(mrProcessor.getGeoTexSvx() || mrProcessor.getTransparenceGeoTexSvx()); + const bool bTextureActive(mrProcessor.getGeoTexSvx().get() || mrProcessor.getTransparenceGeoTexSvx().get()); mbUseTex = bTextureActive && (mbHasTexCoor || mbHasInvTexCoor || mrProcessor.getSimpleTextureActive()); - const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx()); + const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx().get()); const bool bNeedNrmOrCol(!bUseColorTex || (bUseColorTex && mrProcessor.getModulate())); mbUseNrm = bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getNormalIndex() && SCANLINE_EMPTY_INDEX != rB.getNormalIndex(); mbUseCol = !mbUseNrm && bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getColorIndex() && SCANLINE_EMPTY_INDEX != rB.getColorIndex(); @@ -434,7 +435,7 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi if(nOpacity >= 0x00ff) { - // full opacity, set z and color + // full opacity (not transparent), set z and color rOldZ = nNewZ; mrBuffer.getBPixel(nScanlineIndex) = basegfx::BPixel(aNewColor, 0xff); } @@ -444,23 +445,23 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi if(rDest.getOpacity()) { - // both transparent, mix color based on front pixel's opacity - // (the new one) + // mix new color by using + // color' = color * (1 - opacity) + newcolor * opacity const sal_uInt16 nTransparence(0x0100 - nOpacity); rDest.setRed((sal_uInt8)(((rDest.getRed() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getRed()) * nOpacity)) >> 8)); rDest.setGreen((sal_uInt8)(((rDest.getGreen() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getGreen()) * nOpacity)) >> 8)); rDest.setBlue((sal_uInt8)(((rDest.getBlue() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getBlue()) * nOpacity)) >> 8)); - + if(0xff != rDest.getOpacity()) { - // destination is also transparent, mix opacities by weighting - // old opacity with new pixel's transparence and adding new opacity - rDest.setOpacity((sal_uInt8)(((rDest.getOpacity() * nTransparence) >> 8) + nOpacity)); + // both are transparent, mix new opacity by using + // opacity = newopacity * (1 - oldopacity) + oldopacity + rDest.setOpacity(((sal_uInt8)((nOpacity * (0x0100 - rDest.getOpacity())) >> 8)) + rDest.getOpacity()); } } else { - // dest is not visible. Set color. + // dest is unused, set color rDest = basegfx::BPixel(aNewColor, (sal_uInt8)nOpacity); } } @@ -477,135 +478,162 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi } } +////////////////////////////////////////////////////////////////////////////// +// helper class to buffer output for transparent rasterprimitives (filled areas +// and lines) until the end of processing. To ensure correct transparent +// visualisation, ZBuffers require to not set Z and to mix with the transparent +// color. If transparent rasterprimitives overlap, it gets necessary to +// paint transparent rasterprimitives from back to front to ensure that the +// mixing happens from back to front. For that purpose, transparent +// rasterprimitives are held in this class during the processing run, remember +// all data and will be rendered + +class RasterPrimitive3D +{ +private: + boost::shared_ptr< drawinglayer::texture::GeoTexSvx > mpGeoTexSvx; + boost::shared_ptr< drawinglayer::texture::GeoTexSvx > mpTransparenceGeoTexSvx; + drawinglayer::attribute::MaterialAttribute3D maMaterial; + basegfx::B3DPolyPolygon maPolyPolygon; + sal_uInt32 mfCenterZ; + + // bitfield + bool mbModulate : 1; + bool mbFilter : 1; + bool mbSimpleTextureActive : 1; + bool mbIsLine : 1; + +public: + RasterPrimitive3D( + const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& pGeoTexSvx, + const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& pTransparenceGeoTexSvx, + const drawinglayer::attribute::MaterialAttribute3D& rMaterial, + const basegfx::B3DPolyPolygon& rPolyPolygon, + bool bModulate, + bool bFilter, + bool bSimpleTextureActive, + bool bIsLine) + : mpGeoTexSvx(pGeoTexSvx), + mpTransparenceGeoTexSvx(pTransparenceGeoTexSvx), + maMaterial(rMaterial), + maPolyPolygon(rPolyPolygon), + mfCenterZ(basegfx::tools::getRange(rPolyPolygon).getCenter().getZ()), + mbModulate(bModulate), + mbFilter(bFilter), + mbSimpleTextureActive(bSimpleTextureActive), + mbIsLine(bIsLine) + { + } + + RasterPrimitive3D& operator=(const RasterPrimitive3D& rComp) + { + mpGeoTexSvx = rComp.mpGeoTexSvx; + mpTransparenceGeoTexSvx = rComp.mpTransparenceGeoTexSvx; + maMaterial = rComp.maMaterial; + maPolyPolygon = rComp.maPolyPolygon; + mfCenterZ = rComp.mfCenterZ; + mbModulate = rComp.mbModulate; + mbFilter = rComp.mbFilter; + mbSimpleTextureActive = rComp.mbSimpleTextureActive; + mbIsLine = rComp.mbIsLine; + + return *this; + } + + bool operator<(const RasterPrimitive3D& rComp) const + { + return mfCenterZ < rComp.mfCenterZ; + } + + const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; } + const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; } + const drawinglayer::attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; } + const basegfx::B3DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; } + bool getModulate() const { return mbModulate; } + bool getFilter() const { return mbFilter; } + bool getSimpleTextureActive() const { return mbSimpleTextureActive; } + bool getIsLine() const { return mbIsLine; } +}; + ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace processor3d { - // the processing method for a single, known primitive - void ZBufferProcessor3D::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive) + void ZBufferProcessor3D::rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rBasePrimitive.getPrimitiveID()) + if(mpBZPixelRaster) { - case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D : + if(getTransparenceCounter()) { - // AlphaTexturePrimitive3D - const primitive3d::AlphaTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::AlphaTexturePrimitive3D& >(rBasePrimitive); - - if(mbProcessTransparent) + // transparent output; record for later sorting and painting from + // back to front + if(!mpRasterPrimitive3Ds) { - impRenderGradientTexturePrimitive3D(rPrimitive, true); + const_cast< ZBufferProcessor3D* >(this)->mpRasterPrimitive3Ds = new std::vector< RasterPrimitive3D >; } - else - { - mbContainsTransparent = true; - } - break; - } - case PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D : - { - // directdraw of PolygonHairlinePrimitive3D - const primitive3d::PolygonHairlinePrimitive3D& rPrimitive = static_cast< const primitive3d::PolygonHairlinePrimitive3D& >(rBasePrimitive); - // do something when either not transparent and no transMap, or transparent and a TransMap - if((bool)mbProcessTransparent == (0 != getTransparenceGeoTexSvx())) - { - impRenderPolygonHairlinePrimitive3D(rPrimitive); - } - break; + mpRasterPrimitive3Ds->push_back(RasterPrimitive3D( + getGeoTexSvx(), + getTransparenceGeoTexSvx(), + rMaterial, + basegfx::B3DPolyPolygon(rHairline), + getModulate(), + getFilter(), + getSimpleTextureActive(), + true)); } - case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D : + else { - // directdraw of PolyPolygonMaterialPrimitive3D - const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(rBasePrimitive); + // do rasterconversion + mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial); - // do something when either not transparent and no transMap, or transparent and a TransMap - if((bool)mbProcessTransparent == (0 != getTransparenceGeoTexSvx())) + if(mnAntiAlialize > 1) { - impRenderPolyPolygonMaterialPrimitive3D(rPrimitive); - } - break; - } - default: - { - // use the DefaultProcessor3D::processBasePrimitive3D() - DefaultProcessor3D::processBasePrimitive3D(rBasePrimitive); - break; - } - } - } - - void ZBufferProcessor3D::processNonTransparent(const primitive3d::Primitive3DSequence& rSource) - { - if(mpBZPixelRaster) - { - mbProcessTransparent = false; - mbContainsTransparent = false; - process(rSource); - } - } - - void ZBufferProcessor3D::processTransparent(const primitive3d::Primitive3DSequence& rSource) - { - if(mpBZPixelRaster && mbContainsTransparent) - { - mbProcessTransparent = true; - process(rSource); - } - } + const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete()); - void ZBufferProcessor3D::rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const - { - if(mpBZPixelRaster) - { - mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial); + if(bForceLineSnap) + { + basegfx::B3DHomMatrix aTransform; + basegfx::B3DPolygon aSnappedHairline(rHairline); + const double fScaleDown(1.0 / mnAntiAlialize); + const double fScaleUp(mnAntiAlialize); - if(mnAntiAlialize > 1) - { - const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete()); + // take oversampling out + aTransform.scale(fScaleDown, fScaleDown, 1.0); + aSnappedHairline.transform(aTransform); - if(bForceLineSnap) - { - basegfx::B3DHomMatrix aTransform; - basegfx::B3DPolygon aSnappedHairline(rHairline); - const double fScaleDown(1.0 / mnAntiAlialize); - const double fScaleUp(mnAntiAlialize); + // snap to integer + aSnappedHairline = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aSnappedHairline); - // take oversampling out - aTransform.scale(fScaleDown, fScaleDown, 1.0); - aSnappedHairline.transform(aTransform); + // add oversampling again + aTransform.identity(); + aTransform.scale(fScaleUp, fScaleUp, 1.0); - // snap to integer - aSnappedHairline = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aSnappedHairline); + if(false) + { + // when really want to go to single pixel lines, move to center. + // Without this translation, all hor/ver hairlines will be centered exactly + // between two pixel lines (which looks best) + const double fTranslateToCenter(mnAntiAlialize * 0.5); + aTransform.translate(fTranslateToCenter, fTranslateToCenter, 0.0); + } - // add oversampling again - aTransform.identity(); - aTransform.scale(fScaleUp, fScaleUp, 1.0); + aSnappedHairline.transform(aTransform); - if(false) + mpZBufferRasterConverter3D->rasterconvertB3DPolygon(aSnappedHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize); + } + else { - // when really want to go to single pixel lines, move to center. - // Without this translation, all hor/ver hairlines will be centered exactly - // between two pixel lines (which looks best) - const double fTranslateToCenter(mnAntiAlialize * 0.5); - aTransform.translate(fTranslateToCenter, fTranslateToCenter, 0.0); + mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize); } - - aSnappedHairline.transform(aTransform); - - mpZBufferRasterConverter3D->rasterconvertB3DPolygon(aSnappedHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize); } else { - mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize); + mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), 1); } } - else - { - mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), 1); - } } } @@ -613,8 +641,30 @@ namespace drawinglayer { if(mpBZPixelRaster) { - mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial); - mpZBufferRasterConverter3D->rasterconvertB3DPolyPolygon(rFill, &maInvEyeToView, 0, mpBZPixelRaster->getHeight()); + if(getTransparenceCounter()) + { + // transparent output; record for later sorting and painting from + // back to front + if(!mpRasterPrimitive3Ds) + { + const_cast< ZBufferProcessor3D* >(this)->mpRasterPrimitive3Ds = new std::vector< RasterPrimitive3D >; + } + + mpRasterPrimitive3Ds->push_back(RasterPrimitive3D( + getGeoTexSvx(), + getTransparenceGeoTexSvx(), + rMaterial, + rFill, + getModulate(), + getFilter(), + getSimpleTextureActive(), + false)); + } + else + { + mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial); + mpZBufferRasterConverter3D->rasterconvertB3DPolyPolygon(rFill, &maInvEyeToView, 0, mpBZPixelRaster->getHeight()); + } } } @@ -632,8 +682,7 @@ namespace drawinglayer maInvEyeToView(), mpZBufferRasterConverter3D(0), mnAntiAlialize(nAntiAlialize), - mbProcessTransparent(false), - mbContainsTransparent(false) + mpRasterPrimitive3Ds(0) { // generate ViewSizes const double fFullViewSizeX((rViewInformation2D.getObjectToViewTransformation() * basegfx::B2DVector(fSizeX, 0.0)).getLength()); @@ -729,6 +778,58 @@ namespace drawinglayer delete mpZBufferRasterConverter3D; delete mpBZPixelRaster; } + + if(mpRasterPrimitive3Ds) + { + OSL_ASSERT("ZBufferProcessor3D: destructed, but there are unrendered transparent geometries. Use ZBufferProcessor3D::finish() to render these (!)"); + delete mpRasterPrimitive3Ds; + } + } + + void ZBufferProcessor3D::finish() + { + if(mpRasterPrimitive3Ds) + { + // there are transparent rasterprimitives + const sal_uInt32 nSize(mpRasterPrimitive3Ds->size()); + + if(nSize > 1) + { + // sort them from back to front + std::sort(mpRasterPrimitive3Ds->begin(), mpRasterPrimitive3Ds->end()); + } + + for(sal_uInt32 a(0); a < nSize; a++) + { + // paint each one by setting the remembered data and calling + // the render method + const RasterPrimitive3D& rCandidate = (*mpRasterPrimitive3Ds)[a]; + + mpGeoTexSvx = rCandidate.getGeoTexSvx(); + mpTransparenceGeoTexSvx = rCandidate.getTransparenceGeoTexSvx(); + mbModulate = rCandidate.getModulate(); + mbFilter = rCandidate.getFilter(); + mbSimpleTextureActive = rCandidate.getSimpleTextureActive(); + + if(rCandidate.getIsLine()) + { + rasterconvertB3DPolygon( + rCandidate.getMaterial(), + rCandidate.getPolyPolygon().getB3DPolygon(0)); + } + else + { + rasterconvertB3DPolyPolygon( + rCandidate.getMaterial(), + rCandidate.getPolyPolygon()); + } + } + + // delete them to signal the destructor that all is done and + // to allow asserting there + delete mpRasterPrimitive3Ds; + mpRasterPrimitive3Ds = 0; + } } BitmapEx ZBufferProcessor3D::getBitmapEx() const -- cgit v1.2.3 From 55ab032ef590899045011e9d76b7e43cf5c04692 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 6 Jan 2010 13:58:00 +0100 Subject: autorecovery: we're hidden when we're hidden, *not* when our associated model has been loaded hidden --- framework/source/services/frame.cxx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 1d63a503b2..ce674a1717 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -2705,21 +2705,7 @@ css::uno::Any SAL_CALL Frame::impl_getPropertyValue(const ::rtl::OUString& /*sPr break; case FRAME_PROPHANDLE_ISHIDDEN : -// aValue <<= m_bIsHidden; - { - sal_Bool bLoadedHidden = m_bIsHidden; - css::uno::Reference< css::frame::XModel > xModel; - if (m_xController.is()) - xModel = m_xController->getModel(); - if (xModel.is()) - { - ::comphelper::MediaDescriptor lDesc(xModel->getArgs()); - bLoadedHidden = lDesc.getUnpackedValueOrDefault( - ::comphelper::MediaDescriptor::PROP_HIDDEN(), - (sal_Bool)sal_False); - } - aValue <<= bLoadedHidden; - } + aValue <<= m_bIsHidden; break; case FRAME_PROPHANDLE_LAYOUTMANAGER : -- cgit v1.2.3 From d612ef47621e97d7cf1b3bea2d9ee3e842d0fde4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 6 Jan 2010 14:14:21 +0100 Subject: autorecovery: only include documents in the autorecovery which support the XDocumentRecovery interface --- framework/inc/classes/checkediterator.hxx | 2 +- framework/inc/jobs/jobdata.hxx | 2 +- framework/inc/services/autorecovery.hxx | 4 +-- framework/source/inc/loadenv/loadenv.hxx | 2 +- framework/source/jobs/jobdata.cxx | 8 +++--- framework/source/jobs/jobresult.cxx | 4 +-- framework/source/loadenv/loadenv.cxx | 2 +- framework/source/services/autorecovery.cxx | 41 +++++++++++++++++------------- 8 files changed, 35 insertions(+), 30 deletions(-) diff --git a/framework/inc/classes/checkediterator.hxx b/framework/inc/classes/checkediterator.hxx index 2b860350c7..e29119e6f3 100644 --- a/framework/inc/classes/checkediterator.hxx +++ b/framework/inc/classes/checkediterator.hxx @@ -141,7 +141,7 @@ class CheckedIterator if( m_eEndState == E_UNKNOWN ) { - // Set new container and actualize other member. + // Set new container and update other member. m_pContainer = &rContainer ; m_eEndState = E_BEFOREEND ; m_pPosition = m_pContainer->begin(); diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx index 73dfbbf5fe..7680e942fc 100644 --- a/framework/inc/jobs/jobdata.hxx +++ b/framework/inc/jobs/jobdata.hxx @@ -233,7 +233,7 @@ class JobData : private ThreadHelpBase after a job was sucessfully executed (by any outside code using our informations) it can return a result. This member make it part of this container too. So it can be used for further things. - We use it also to actualize our internal state and the configuration + We use it also to update our internal state and the configuration of the job. But note: only the last result will be saved here! */ JobResult m_aLastExecutionResult; diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx index 1a53ef4592..be97db68c0 100644 --- a/framework/inc/services/autorecovery.hxx +++ b/framework/inc/services/autorecovery.hxx @@ -610,7 +610,7 @@ class AutoRecovery : public css::lang::XTypeProvider @threadsafe */ - void implts_actualizeTimer(); + void implts_updateTimer(); //--------------------------------------- /** @short stop the timer. @@ -678,7 +678,7 @@ class AutoRecovery : public css::lang::XTypeProvider //--------------------------------------- // TODO document me - void implts_actualizeModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument); + void implts_updateModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument); //--------------------------------------- // TODO document me diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx index ed73c0a859..2bdd42cfb7 100644 --- a/framework/source/inc/loadenv/loadenv.hxx +++ b/framework/source/inc/loadenv/loadenv.hxx @@ -487,7 +487,7 @@ class LoadEnv : private ThreadHelpBase /** @short tries to detect the type and the filter of the specified content. - @descr This method actualize the available media descriptor of this instance, + @descr This method update the available media descriptor of this instance, so it contains the right type, a corresponding filter, may a valid frame loader etc. In case detection failed, this descriptor is corrected first, before a suitable exception will be thrown. diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx index bb04f4f09f..4d8371877f 100644 --- a/framework/source/jobs/jobdata.cxx +++ b/framework/source/jobs/jobdata.cxx @@ -305,10 +305,10 @@ void JobData::setJobConfig( const css::uno::Sequence< css::beans::NamedValue >& /* SAFE { */ WriteGuard aWriteLock(m_aLock); - // actualize member + // update member m_lArguments = lArguments; - // actualize the configuration ... if possible! + // update the configuration ... if possible! if (m_eMode==E_ALIAS) { // It doesn't matter if this config object was already opened before. @@ -366,7 +366,7 @@ void JobData::setResult( const JobResult& aResult ) // overwrite the last saved result m_aLastExecutionResult = aResult; - // Don't use his informations to actualize + // Don't use his informations to update // e.g. the arguments of this job. It must be done // from outside! Here we save this information only. @@ -536,7 +536,7 @@ void JobData::disableJob() if (m_eMode!=E_EVENT) return; - // actualize the configuration + // update the configuration // It doesn't matter if this config object was already opened before. // It doesn nothing here then ... or it change the mode automaticly, if // it was opened using another one before. diff --git a/framework/source/jobs/jobresult.cxx b/framework/source/jobs/jobresult.cxx index 98a0821180..2ad90b4e7b 100644 --- a/framework/source/jobs/jobresult.cxx +++ b/framework/source/jobs/jobresult.cxx @@ -84,7 +84,7 @@ JobResult::JobResult() /** @short special ctor @descr It initialize this new instance with a pure job execution result - and analyze it. Doing so, we actualize our other members. + and analyze it. Doing so, we update our other members.

It's a list of named values, packed inside this any. @@ -136,7 +136,7 @@ JobResult::JobResult( /*IN*/ const css::uno::Any& aResult ) // That can be usefull if something will fail here ... m_eParts = E_NOPART; - // analyze the result and actualize our other members + // analyze the result and update our other members ::comphelper::SequenceAsHashMap aProtocol(aResult); if ( aProtocol.empty() ) return; diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 5265e5b484..700619f245 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -821,7 +821,7 @@ void LoadEnv::impl_detectTypeAndFilter() // Attention: Because our stl media descriptor is a copy of an uno sequence // we cant use as an in/out parameter here. Copy it before and dont forget to - // actualize structure afterwards again! + // update structure afterwards again! css::uno::Sequence< css::beans::PropertyValue > lDescriptor = m_lMediaDescriptor.getAsConstPropertyValueList(); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 82ac8bf4d0..6468d5eb64 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -645,7 +645,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL& // dont enable AutoSave hardly ! // reload configuration to know the current state. implts_readAutoSaveConfig(); - implts_actualizeTimer(); + implts_updateTimer(); // can it happen that might be the listener was stopped ? .-) // make sure it runs always ... even if AutoSave itself was disabled temporarly. implts_startListening(); @@ -791,7 +791,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams) // <- SAFE ---------------------------------- // depends on bAllowAutoSaveReactivation implicitly by looking on m_eJob=E_AUTO_SAVE! see before ... - implts_actualizeTimer(); + implts_updateTimer(); if (bAllowAutoSaveReactivation) implts_startListening(); @@ -861,7 +861,7 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent else if (aEvent.EventName.equals(EVENT_ON_MODIFYCHANGED)) { - implts_actualizeModifiedState(xDocument); + implts_updateModifiedState(xDocument); } /* at least one document starts saving process => Our application code isnt ready for multiple save requests @@ -970,7 +970,7 @@ void SAL_CALL AutoRecovery::changesOccurred(const css::util::ChangesEvent& aEven // Note: This call stops the timer and starts it again. // But it checks the different timer states internaly and // may be supress the restart! - implts_actualizeTimer(); + implts_updateTimer(); } //----------------------------------------------- @@ -1193,7 +1193,7 @@ void AutoRecovery::implts_readConfig() // <- REENTRANT -------------------------- } - implts_actualizeTimer(); + implts_updateTimer(); } //----------------------------------------------- @@ -1330,11 +1330,6 @@ void AutoRecovery::implts_persistAllActiveViewNames() WriteGuard aWriteLock(m_aLock); // This list will be filled with every document - // which should be saved as last one. E.g. if it was used - // already for an UI save operation => crashed ... and - // now we try to save it again ... which can fail again ( of course .-) ). - ::std::vector< AutoRecovery::TDocumentList::iterator > lDangerousDocs; - AutoRecovery::TDocumentList::iterator pIt; for ( pIt = m_lDocCache.begin(); pIt != m_lDocCache.end() ; @@ -1555,7 +1550,7 @@ void AutoRecovery::implts_stopModifyListeningOnDoc(AutoRecovery::TDocumentInfo& } //----------------------------------------------- -void AutoRecovery::implts_actualizeTimer() +void AutoRecovery::implts_updateTimer() { implts_stopTimer(); @@ -1646,7 +1641,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG) m_eTimerType = AutoRecovery::E_POLL_TILL_AUTOSAVE_IS_ALLOWED; aWriteLock.unlock(); // <- SAFE ------------------------------ - implts_actualizeTimer(); + implts_updateTimer(); return 0; } @@ -1661,7 +1656,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG) sal_Bool bUserIdle = (Application::GetLastInputInterval()>MIN_TIME_FOR_USER_IDLE); if (!bUserIdle) { - implts_actualizeTimer(); + implts_updateTimer(); return 0; } } @@ -1702,7 +1697,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG) aWriteLock.unlock(); // <- SAFE ---------------------------------- - implts_actualizeTimer(); + implts_updateTimer(); } catch(const css::uno::Exception&) { @@ -1739,7 +1734,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame // notification for already existing document ! // Can happen if events came in asynchronous on recovery time. // Then our cache was filled from the configuration ... but now we get some - // asynchronous events from the global event broadcaster. We must be shure that + // asynchronous events from the global event broadcaster. We must be sure that // we dont add the same document more then once. AutoRecovery::TDocumentList::iterator pIt = AutoRecovery::impl_searchDocument(m_lDocCache, xDocument); if (pIt != m_lDocCache.end()) @@ -1747,7 +1742,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame // Normaly nothing must be done for this "late" notification. // But may be the modified state was changed inbetween. // Check it ... - implts_actualizeModifiedState(xDocument); + implts_updateModifiedState(xDocument); return; } @@ -1772,6 +1767,11 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame if (!xDesktop.is()) return; + // if the document doesn't support the XDocumentRecovery interface, we're not interested in it. + Reference< XDocumentRecovery > xDocRecovery( xDocument, UNO_QUERY ); + if ( !xDocRecovery.is() ) + return; + // get all needed informations of this document // We need it to update our cache or to locate already existing elements there! AutoRecovery::TDocumentInfo aNew; @@ -1800,7 +1800,12 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame (!aNew.OrgURL.getLength() ) && (!aNew.FactoryURL.getLength()) ) - return; + { + OSL_ENSURE( false, "AutoRecovery::implts_registerDocument: this should not happen anymore!" ); + // nowadays, the Basic IDE should already die on the "supports XDocumentRecovery" check. And no other known + // document type fits in here ... + return; + } // By the way - get some information about the default format for saving! // and save an information about the real used filter by this document. @@ -1923,7 +1928,7 @@ void AutoRecovery::implts_markDocumentModifiedAgainstLastBackup(const css::uno:: } //----------------------------------------------- -void AutoRecovery::implts_actualizeModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument) +void AutoRecovery::implts_updateModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument) { CacheLockGuard aCacheLock(this, m_aLock, m_nDocCacheLock, LOCK_FOR_CACHE_USE); -- cgit v1.2.3 From 7ae6c7efe33a5ac1464c0c2916d20884721008d8 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 6 Jan 2010 16:34:35 +0100 Subject: aw079: #i107987# corrected selection and rotation for 3D light control --- svx/source/dialog/dlgctl3d.cxx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index fe75592b6e..91b0e34261 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -514,8 +514,17 @@ void Svx3DLightControl::TrySelection(Point aPosPixel) if(aResult.size()) { - // take the frontmost one - const E3dCompoundObject* pResult = aResult[0]; + // exclude expansion object which will be part of + // the hits. It's invisible, but for HitTest, it's included + const E3dCompoundObject* pResult = 0; + + for(sal_uInt32 b(0); !pResult && b < aResult.size(); b++) + { + if(aResult[b] && aResult[b] != mpExpansionObject) + { + pResult = aResult[b]; + } + } if(pResult == mp3DObj) { @@ -780,8 +789,8 @@ void Svx3DLightControl::GetPosition(double& rHor, double& rVer) } if(IsGeometrySelected()) { - rHor = mfRotateY; - rVer = mfRotateX; + rHor = mfRotateY / F_PI180; // 0..360.0 + rVer = mfRotateX / F_PI180; // -90.0..90.0 } } @@ -824,8 +833,8 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer) { if(mfRotateX != fVer || mfRotateY != fHor) { - mfRotateX = fVer; - mfRotateY = fHor; + mfRotateX = fVer * F_PI180; + mfRotateY = fHor * F_PI180; if(mp3DObj) { -- cgit v1.2.3 From bf68aaecf5f482636157aee407921644feb57255 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 6 Jan 2010 18:33:15 +0100 Subject: aw079: #i107557# Re-added the edge rounding control handle to text frame visualisations --- svx/source/svdraw/svdorect.cxx | 79 +++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index f6c0fbc6ea..f7d42549b2 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -319,50 +319,67 @@ void SdrRectObj::NbcSetLogicRect(const Rectangle& rRect) sal_uInt32 SdrRectObj::GetHdlCount() const { - return 9L; + return IsTextFrame() ? 10 : 9; } SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const { - SdrHdl* pH=NULL; + SdrHdl* pH = NULL; Point aPnt; - SdrHdlKind eKind=HDL_MOVE; - if( IsTextFrame() && !nHdlNum ) + SdrHdlKind eKind = HDL_MOVE; + + if(!IsTextFrame()) { - pH=new ImpTextframeHdl(aRect); - pH->SetObj((SdrObject*)this); - pH->SetDrehWink(aGeo.nDrehWink); - return pH; + nHdlNum++; } - else + + switch(nHdlNum) { - switch (nHdlNum) { - case 0: { - long a=GetEckenradius(); - long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert - if (a>b) a=b; - if (a<0) a=0; - aPnt=aRect.TopLeft(); - aPnt.X()+=a; - eKind=HDL_CIRC; - } break; // Eckenradius - case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links - case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben - case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts - case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links - case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts - case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links - case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten - case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts + case 0: + { + pH = new ImpTextframeHdl(aRect); + pH->SetObj((SdrObject*)this); + pH->SetDrehWink(aGeo.nDrehWink); + break; + } + case 1: + { + long a = GetEckenradius(); + long b = Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert + if (a>b) a=b; + if (a<0) a=0; + aPnt=aRect.TopLeft(); + aPnt.X()+=a; + eKind = HDL_CIRC; + break; } + case 2: aPnt=aRect.TopLeft(); eKind = HDL_UPLFT; break; // Oben links + case 3: aPnt=aRect.TopCenter(); eKind = HDL_UPPER; break; // Oben + case 4: aPnt=aRect.TopRight(); eKind = HDL_UPRGT; break; // Oben rechts + case 5: aPnt=aRect.LeftCenter(); eKind = HDL_LEFT ; break; // Links + case 6: aPnt=aRect.RightCenter(); eKind = HDL_RIGHT; break; // Rechts + case 7: aPnt=aRect.BottomLeft(); eKind = HDL_LWLFT; break; // Unten links + case 8: aPnt=aRect.BottomCenter(); eKind = HDL_LOWER; break; // Unten + case 9: aPnt=aRect.BottomRight(); eKind = HDL_LWRGT; break; // Unten rechts } - if (aGeo.nShearWink!=0) ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan); - if (aGeo.nDrehWink!=0) RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); - if (eKind!=HDL_MOVE) { - pH=new SdrHdl(aPnt,eKind); + + if(!pH) + { + if(aGeo.nShearWink) + { + ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan); + } + + if(aGeo.nDrehWink) + { + RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); + } + + pH = new SdrHdl(aPnt,eKind); pH->SetObj((SdrObject*)this); pH->SetDrehWink(aGeo.nDrehWink); } + return pH; } -- cgit v1.2.3 From f9d800c29105a4d65807bac046c2a5b79e5c1810 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 6 Jan 2010 21:34:53 +0100 Subject: autorecovery: allow creating SFX-based documents which do not support the XDocumentRecovery interface For this purpose, the SFX document factory methods got an additional parameter respectively flag ("DocumentRecoverySupport" resp. SFXMODEL_DISABLE_DOCUMENT_RECOVERY). This flag is used by database documents to remove the interface from sub documents (aka forms/reports). In this course, some of the functionality around those SFXMODELL_* flags, previously duplicated in all applications, has been consolidated into a new SfxObjectShell constructor. --- embeddedobj/source/commonembedding/miscobj.cxx | 2 + embeddedobj/source/commonembedding/persistence.cxx | 30 ++++++------- embeddedobj/source/inc/commonembobj.hxx | 1 + sfx2/inc/sfx2/objsh.hxx | 1 + sfx2/inc/sfx2/sfxbasemodel.hxx | 1 + sfx2/inc/sfx2/sfxmodelfactory.hxx | 2 + sfx2/source/doc/objxtor.cxx | 51 ++++++++++++++-------- sfx2/source/doc/sfxbasemodel.cxx | 41 +++++++++++------ sfx2/source/doc/sfxmodelfactory.cxx | 9 ++-- sfx2/source/inc/objshimp.hxx | 1 + 10 files changed, 89 insertions(+), 50 deletions(-) diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index c99f47722d..884116978c 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -66,6 +66,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< lang::XMulti , m_xFactory( xFactory ) , m_nMiscStatus( 0 ) , m_bEmbeddedScriptSupport( sal_True ) +, m_bDocumentRecoverySupport( sal_True ) , m_bWaitSaveCompleted( sal_False ) , m_bIsLink( sal_False ) , m_bLinkHasPassword( sal_False ) @@ -92,6 +93,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject( , m_xFactory( xFactory ) , m_nMiscStatus( 0 ) , m_bEmbeddedScriptSupport( sal_True ) +, m_bDocumentRecoverySupport( sal_True ) , m_bWaitSaveCompleted( sal_False ) , m_bIsLink( sal_True ) , m_bLinkHasPassword( sal_False ) diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index bd2ffcf042..dd0c84915b 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -63,6 +63,7 @@ #include #include #include +#include #include @@ -199,22 +200,17 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor( //------------------------------------------------------ static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference< lang::XMultiServiceFactory >& _rxFactory, - const ::rtl::OUString& _rDocumentServiceName, bool _bEmbeddedScriptSupport ) + const ::rtl::OUString& _rDocumentServiceName, bool _bEmbeddedScriptSupport, const bool i_bDocumentRecoverySupport ) { - uno::Sequence< uno::Any > aArguments(2); - aArguments[0] <<= beans::NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EmbeddedObject" ) ), - uno::makeAny( (sal_Bool)sal_True ) - ); - aArguments[1] <<= beans::NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EmbeddedScriptSupport" ) ), - uno::makeAny( (sal_Bool)_bEmbeddedScriptSupport ) - ); + ::comphelper::NamedValueCollection aArguments; + aArguments.put( "EmbeddedObject", (sal_Bool)sal_True ); + aArguments.put( "EmbeddedScriptSupport", (sal_Bool)_bEmbeddedScriptSupport ); + aArguments.put( "DocumentRecoverySupport", (sal_Bool)i_bDocumentRecoverySupport ); uno::Reference< uno::XInterface > xDocument; try { - xDocument = _rxFactory->createInstanceWithArguments( _rDocumentServiceName, aArguments ); + xDocument = _rxFactory->createInstanceWithArguments( _rDocumentServiceName, aArguments.getWrappedPropertyValues() ); } catch( const uno::Exception& ) { @@ -308,7 +304,7 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() { uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(), - m_bEmbeddedScriptSupport ) ); + m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY ); uno::Reference< frame::XLoadable > xLoadable( xModel, uno::UNO_QUERY ); @@ -359,7 +355,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() { uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(), - m_bEmbeddedScriptSupport ) ); + m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY ); if ( !xLoadable.is() ) @@ -462,7 +458,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag OSL_ENSURE( xStorage.is(), "The storage can not be empty!" ); uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(), - m_bEmbeddedScriptSupport ) ); + m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); //#i103460# ODF: take the size given from the parent frame as default uno::Reference< chart2::XChartDocument > xChart( xDocument, uno::UNO_QUERY ); @@ -804,7 +800,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateDocFromMediaDesc const uno::Sequence< beans::PropertyValue >& aMedDescr ) { uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(), - m_bEmbeddedScriptSupport ) ); + m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY ); if ( !xLoadable.is() ) @@ -1063,6 +1059,10 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( { OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_bEmbeddedScriptSupport ); } + else if ( lObjArgs[nObjInd].Name.equalsAscii( "DocumentRecoverySupport" ) ) + { + OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_bDocumentRecoverySupport ); + } sal_Int32 nStorageMode = m_bReadOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE; diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index 9139409c09..310a4e72f2 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -129,6 +129,7 @@ protected: ::rtl::OUString m_aDefaultParentBaseURL; ::rtl::OUString m_aModuleName; sal_Bool m_bEmbeddedScriptSupport; + sal_Bool m_bDocumentRecoverySupport; Interceptor* m_pInterceptor; diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index c6183fe7cc..b1b9a1650b 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -236,6 +236,7 @@ private: protected: SfxObjectShell(SfxObjectCreateMode); + SfxObjectShell( const sal_uInt64 i_nCreationFlags ); // see sfxmodelfactory.hxx virtual ~SfxObjectShell(); virtual void ModifyChanged(); diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index 8c7b391083..2fd12b407d 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -1555,6 +1555,7 @@ private: IMPL_SfxBaseModel_DataContainer* m_pData ; // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context const bool m_bSupportEmbeddedScripts; + const bool m_bSupportDocRecovery; } ; // class SfxBaseModel diff --git a/sfx2/inc/sfx2/sfxmodelfactory.hxx b/sfx2/inc/sfx2/sfxmodelfactory.hxx index 7cb105e62d..a0cc08ce78 100644 --- a/sfx2/inc/sfx2/sfxmodelfactory.hxx +++ b/sfx2/inc/sfx2/sfxmodelfactory.hxx @@ -43,8 +43,10 @@ namespace sfx2 { //........................................................................ + #define SFXMODEL_STANDARD (sal_uInt64)(0x0000) #define SFXMODEL_EMBEDDED_OBJECT (sal_uInt64)(0x0001) #define SFXMODEL_DISABLE_EMBEDDED_SCRIPTS (sal_uInt64)(0x0002) + #define SFXMODEL_DISABLE_DOCUMENT_RECOVERY (sal_uInt64)(0x0004) typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ( SAL_CALL * SfxModelFactoryFunc ) ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory, diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 50b8542ccc..3b6674d339 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -65,6 +65,7 @@ #include #include +#include #ifndef _BASIC_SBUNO_HXX #include @@ -188,7 +189,7 @@ TYPEINIT1(SfxObjectShell, SfxShell); //-------------------------------------------------------------------- SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) -:mpObjectContainer(0) + :mpObjectContainer(0) ,pBasicManager( new SfxBasicManagerHolder ) ,rDocShell( _rDocShell ) ,aMacroMode( *this ) @@ -208,7 +209,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,bImportDone ( sal_False) ,bInPrepareClose( sal_False ) ,bPreparedForClose( sal_False ) - ,bWaitingForPicklist( sal_False ) + ,bWaitingForPicklist( sal_True ) ,bForbidReload( sal_False ) ,bBasicInitialized( sal_False ) ,bIsPrintJobCancelable( sal_True ) @@ -220,6 +221,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,bPreserveVersions( sal_True ) ,m_bMacroSignBroken( sal_False ) ,m_bNoBasicCapabilities( sal_False ) + ,m_bDocRecoverySupport( sal_True ) ,bQueryLoadTemplate( sal_True ) ,bLoadReadonly( sal_False ) ,bUseUserData( sal_True ) @@ -230,7 +232,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,nEventId ( 0) ,pReloadTimer ( 0) ,pMarkData( 0 ) - ,nLoadedFlags ( SFX_LOADED_MAINDOCUMENT ) + ,nLoadedFlags ( SFX_LOADED_ALL ) ,nFlagsInProgress( 0 ) ,bModalMode( sal_False ) ,bRunningMacro( sal_False ) @@ -249,6 +251,10 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,m_bIsInit( sal_False ) ,m_bIncomplEncrWarnShown( sal_False ) { + SfxObjectShell* pDoc = &_rDocShell; + SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl(); + rArr.C40_INSERT( SfxObjectShell, pDoc, rArr.Count() ); + bInList = sal_True; } //-------------------------------------------------------------------- @@ -258,6 +264,28 @@ SfxObjectShell_Impl::~SfxObjectShell_Impl() delete pBasicManager; } +//-------------------------------------------------------------------- + +SfxObjectShell::SfxObjectShell( const sal_uInt64 i_nCreationFlags ) + : pImp( new SfxObjectShell_Impl( *this ) ) + , pMedium(0) + , pStyleSheetPool(0) + , eCreateMode( ( i_nCreationFlags & SFXMODEL_EMBEDDED_OBJECT ) ? SFX_CREATE_MODE_EMBEDDED : SFX_CREATE_MODE_STANDARD ) + , bHasName( sal_False ) +{ + DBG_CTOR(SfxObjectShell, 0); + + const bool bScriptSupport = ( i_nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0; + if ( !bScriptSupport ) + SetHasNoBasic(); + + const bool bDocRecovery = ( i_nCreationFlags & SFXMODEL_DISABLE_DOCUMENT_RECOVERY ) == 0; + if ( !bDocRecovery ) + pImp->m_bDocRecoverySupport = sal_False; +} + +//-------------------------------------------------------------------- + // initializes a document from a file-description SfxObjectShell::SfxObjectShell @@ -291,23 +319,10 @@ SfxObjectShell::SfxObjectShell : pImp( new SfxObjectShell_Impl( *this ) ), pMedium(0), pStyleSheetPool(0), - eCreateMode(eMode) + eCreateMode(eMode), + bHasName( sal_False ) { DBG_CTOR(SfxObjectShell, 0); - - bHasName = sal_False; - - pImp->bWaitingForPicklist = sal_True; - - // Aggregation InPlaceObject+Automation -//(mba) AddInterface( SvDispatch::ClassFactory() ); - - SfxObjectShell *pThis = this; - SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl(); - rArr.C40_INSERT( SfxObjectShell, pThis, rArr.Count() ); - pImp->bInList = sal_True; - pImp->nLoadedFlags = SFX_LOADED_ALL; -//REMOVE SetObjectShell( TRUE ); } //-------------------------------------------------------------------- diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 223dc13a97..c069400fc8 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -151,6 +151,9 @@ using ::com::sun::star::frame::XController2; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::io::IOException; using ::com::sun::star::lang::WrappedTargetException; +using ::com::sun::star::uno::Type; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::document::XDocumentRecovery; /** This Listener is used to get notified when the XDocumentProperties of the XModel change. @@ -537,6 +540,7 @@ SfxBaseModel::SfxBaseModel( SfxObjectShell *pObjectShell ) : BaseMutex() , m_pData( new IMPL_SfxBaseModel_DataContainer( m_aMutex, pObjectShell ) ) , m_bSupportEmbeddedScripts( pObjectShell && pObjectShell->Get_Impl() ? !pObjectShell->Get_Impl()->m_bNoBasicCapabilities : false ) +, m_bSupportDocRecovery( pObjectShell && pObjectShell->Get_Impl() ? pObjectShell->Get_Impl()->m_bDocRecoverySupport : false ) { DBG_CTOR(sfx2_SfxBaseModel,NULL); if ( pObjectShell != NULL ) @@ -560,7 +564,9 @@ SfxBaseModel::~SfxBaseModel() uno::Any SAL_CALL SfxBaseModel::queryInterface( const UNOTYPE& rType ) throw( uno::RuntimeException ) { - if ( !m_bSupportEmbeddedScripts && rType.equals( XEMBEDDEDSCRIPTS::static_type() ) ) + if ( ( !m_bSupportEmbeddedScripts && rType.equals( XEMBEDDEDSCRIPTS::static_type() ) ) + || ( !m_bSupportDocRecovery && rType.equals( XDocumentRecovery::static_type() ) ) + ) return Any(); return SfxBaseModel_Base::queryInterface( rType ); @@ -596,21 +602,31 @@ void SAL_CALL SfxBaseModel::release() throw( ) // XTypeProvider //________________________________________________________________________________________________________ -uno::Sequence< UNOTYPE > SAL_CALL SfxBaseModel::getTypes() throw( uno::RuntimeException ) +namespace { - uno::Sequence< UNOTYPE > aTypes( SfxBaseModel_Base::getTypes() ); - if ( !m_bSupportEmbeddedScripts ) + void lcl_stripType( Sequence< Type >& io_rTypes, const Type& i_rTypeToStrip ) { - // remove XEmbeddedScripts type from the sequence - Sequence< UNOTYPE > aStrippedTypes( aTypes.getLength() - 1 ); + Sequence< UNOTYPE > aStrippedTypes( io_rTypes.getLength() - 1 ); ::std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), + io_rTypes.getConstArray(), + io_rTypes.getConstArray() + io_rTypes.getLength(), aStrippedTypes.getArray(), - ::std::bind2nd( ::std::equal_to< UNOTYPE >(), XEMBEDDEDSCRIPTS::static_type() ) + ::std::bind2nd( ::std::equal_to< Type >(), i_rTypeToStrip ) ); - aTypes = aStrippedTypes; + io_rTypes = aStrippedTypes; } +} + +uno::Sequence< UNOTYPE > SAL_CALL SfxBaseModel::getTypes() throw( uno::RuntimeException ) +{ + uno::Sequence< UNOTYPE > aTypes( SfxBaseModel_Base::getTypes() ); + + if ( !m_bSupportEmbeddedScripts ) + lcl_stripType( aTypes, XEMBEDDEDSCRIPTS::static_type() ); + + if ( !m_bSupportDocRecovery ) + lcl_stripType( aTypes, XDocumentRecovery::static_type() ); + return aTypes; } @@ -1709,10 +1725,7 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >& ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // do not use the SfxModelGuard, it would throw, since we're not yet initialized - if ( IsDisposed() ) - throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *this ); + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( IsInitialized() ) throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this ); diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx index 99355c4f62..ac7af73a8f 100644 --- a/sfx2/source/doc/sfxmodelfactory.cxx +++ b/sfx2/source/doc/sfxmodelfactory.cxx @@ -152,7 +152,8 @@ namespace sfx2 static bool isSpecialArgumentName( const ::rtl::OUString& _rValueName ) { return _rValueName.equalsAscii( "EmbeddedObject" ) - || _rValueName.equalsAscii( "EmbeddedScriptSupport" ); + || _rValueName.equalsAscii( "EmbeddedScriptSupport" ) + || _rValueName.equalsAscii( "DocumentRecoverySupport" ); } bool operator()( const Any& _rArgument ) const @@ -174,15 +175,17 @@ namespace sfx2 ::comphelper::NamedValueCollection aArgs( _rArguments ); const sal_Bool bEmbeddedObject = aArgs.getOrDefault( "EmbeddedObject", sal_False ); const sal_Bool bScriptSupport = aArgs.getOrDefault( "EmbeddedScriptSupport", sal_True ); + const sal_Bool bDocRecoverySupport = aArgs.getOrDefault( "DocumentRecoverySupport", sal_True ); sal_uInt64 nCreationFlags = ( bEmbeddedObject ? SFXMODEL_EMBEDDED_OBJECT : 0 ) - | ( bScriptSupport ? 0 : SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ); + | ( bScriptSupport ? 0 : SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) + | ( bDocRecoverySupport ? 0 : SFXMODEL_DISABLE_DOCUMENT_RECOVERY ); Reference< XInterface > xInstance( impl_createInstance( nCreationFlags ) ); // to mimic the bahaviour of the default factory's createInstanceWithArguments, we initialize - // the object with the given arguments, stripped by the two special ones + // the object with the given arguments, stripped by the three special ones Sequence< Any > aStrippedArguments( _rArguments.getLength() ); Any* pStrippedArgs = aStrippedArguments.getArray(); Any* pStrippedArgsEnd = ::std::remove_copy_if( diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index b3faaef409..abd4c5745c 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -105,6 +105,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess bPreserveVersions:1, m_bMacroSignBroken:1, // whether the macro signature was explicitly broken m_bNoBasicCapabilities:1, + m_bDocRecoverySupport:1, bQueryLoadTemplate:1, bLoadReadonly:1, bUseUserData:1, -- cgit v1.2.3 From aaaacb6746a4f3035362a58018dfe5651bfe5c57 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 7 Jan 2010 09:08:11 +0100 Subject: check for correct type and some refactoring --- .../odbcbase/ODatabaseMetaDataResultSet.cxx | 16 +++++++++---- .../source/drivers/odbcbase/OResultSet.cxx | 28 ++++++++++++---------- .../source/inc/odbc/ODatabaseMetaDataResultSet.hxx | 1 + connectivity/source/inc/odbc/OResultSet.hxx | 1 + 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx index 773b9c0293..20e705ba0e 100644 --- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx @@ -283,7 +283,7 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co aDate.day = 0; aDate.month = 0; aDate.year = 0; - OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_DATE,m_bWasNull,**this,&aDate,sizeof aDate); + OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_DATE : SQL_C_TYPE_DATE,m_bWasNull,**this,&aDate,sizeof aDate); return Date(aDate.day,aDate.month,aDate.year); } else @@ -434,7 +434,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) columnIndex = mapColumn(columnIndex); ::rtl::OUString aVal; if(columnIndex <= m_nDriverColumnCount) - aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,(SWORD)SQL_C_WCHAR,m_bWasNull,**this,m_nTextEncoding); + aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,impl_getColumnType_nothrow(columnIndex),m_bWasNull,**this,m_nTextEncoding); else m_bWasNull = sal_True; @@ -454,7 +454,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) columnIndex = mapColumn(columnIndex); TIME_STRUCT aTime={0,0,0}; if(columnIndex <= m_nDriverColumnCount) - OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TIME,m_bWasNull,**this,&aTime,sizeof aTime); + OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIME : SQL_C_TYPE_TIME,m_bWasNull,**this,&aTime,sizeof aTime); else m_bWasNull = sal_True; return Time(0,aTime.second,aTime.minute,aTime.hour); @@ -472,7 +472,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) columnIndex = mapColumn(columnIndex); TIMESTAMP_STRUCT aTime={0,0,0,0,0,0,0}; if(columnIndex <= m_nDriverColumnCount) - OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime); + OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIMESTAMP : SQL_C_TYPE_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime); else m_bWasNull = sal_True; return DateTime((sal_uInt16)aTime.fraction*1000,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year); @@ -1316,5 +1316,11 @@ void ODatabaseMetaDataResultSet::checkColumnCount() } // ----------------------------------------------------------------------------- - +SWORD ODatabaseMetaDataResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex) +{ + ::std::map::iterator aFind = m_aODBCColumnTypes.find(columnIndex); + if ( aFind == m_aODBCColumnTypes.end() ) + aFind = m_aODBCColumnTypes.insert(::std::map::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pConnection,m_aStatementHandle,*this,columnIndex))).first; + return aFind->second; +} diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index 8e2254fa28..2544d08b8f 100644 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -469,11 +469,9 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro return nRet; } - ::std::map::iterator aFind = m_aODBCColumnTypes.find(columnIndex); - if ( aFind == m_aODBCColumnTypes.end() ) - aFind = m_aODBCColumnTypes.insert(::std::map::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first; + const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex); - switch(aFind->second) + switch(nColumnType) { case SQL_WVARCHAR: case SQL_WCHAR: @@ -482,7 +480,7 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro case SQL_CHAR: case SQL_LONGVARCHAR: { - ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,aFind->second,m_bWasNull,**this,m_nTextEncoding); + ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding); return Sequence(reinterpret_cast(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength()); } default: @@ -627,10 +625,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept else { checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - ::std::map::iterator aFind = m_aODBCColumnTypes.find(columnIndex); - if ( aFind == m_aODBCColumnTypes.end() ) - aFind = m_aODBCColumnTypes.insert(::std::map::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first; - nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,aFind->second,m_bWasNull,**this,m_nTextEncoding); + const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex); + nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding); } return nRet; } @@ -1505,10 +1501,8 @@ void OResultSet::fillRow(sal_Int32 _nToColumn) case DataType::LONGVARCHAR: case DataType::CLOB: { - ::std::map::iterator aFind = m_aODBCColumnTypes.find(nColumn); - if ( aFind == m_aODBCColumnTypes.end() ) - aFind = m_aODBCColumnTypes.insert(::std::map::value_type(nColumn,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,nColumn))).first; - *pColumn = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,nColumn,aFind->second,m_bWasNull,**this,m_nTextEncoding); + const SWORD nColumnType = impl_getColumnType_nothrow(nColumn); + *pColumn = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,nColumn,nColumnType,m_bWasNull,**this,m_nTextEncoding); } break; case DataType::BIGINT: @@ -1753,4 +1747,12 @@ void OResultSet::fillNeededData(SQLRETURN _nRet) while (nRet == SQL_NEED_DATA); } } +// ----------------------------------------------------------------------------- +SWORD OResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex) +{ + ::std::map::iterator aFind = m_aODBCColumnTypes.find(columnIndex); + if ( aFind == m_aODBCColumnTypes.end() ) + aFind = m_aODBCColumnTypes.insert(::std::map::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first; + return aFind->second; +} diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx index 5078eb3ac5..596ebaad9d 100644 --- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx +++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx @@ -100,6 +100,7 @@ namespace connectivity sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); ::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex); sal_Int32 mapColumn (sal_Int32 column); diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx index 194bb50987..b5b41aeb14 100644 --- a/connectivity/source/inc/odbc/OResultSet.hxx +++ b/connectivity/source/inc/odbc/OResultSet.hxx @@ -176,6 +176,7 @@ namespace connectivity sal_Bool moveImpl(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData); TVoidPtr allocBindColumn(sal_Int32 _nType,sal_Int32 _nColumnIndex); SQLRETURN unbind(sal_Bool _bUnbindHandle = sal_True); + SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex); // OPropertyArrayUsageHelper virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; -- cgit v1.2.3 From 76d80a085464494175053ae5c8597fa0ad1d331a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 7 Jan 2010 09:40:12 +0100 Subject: autorecovery: do not throw in getSomething when we're already disposed - there are some strange clients of this ... --- sfx2/source/doc/sfxbasemodel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index c069400fc8..4324805d7c 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2984,7 +2984,7 @@ void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view:: class SvObject; sal_Int64 SAL_CALL SfxBaseModel::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException) { - SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); + ::vos::OGuard aGuard( Application::GetSolarMutex() ); if ( GetObjectShell() ) { SvGlobalName aName( aIdentifier ); -- cgit v1.2.3 From 4916d223d4045b6e608d67e17fbf990c1ef6b0f8 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 7 Jan 2010 12:25:46 +0100 Subject: dba33e: #i107461# care for case of column name --- connectivity/source/drivers/hsqldb/HTable.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx index 8e6fc34b2c..baed33e43c 100644 --- a/connectivity/source/drivers/hsqldb/HTable.cxx +++ b/connectivity/source/drivers/hsqldb/HTable.cxx @@ -214,7 +214,7 @@ void SAL_CALL OHSQLTable::alterColumnByName( const ::rtl::OUString& colName, con // now we should look if the name of the column changed ::rtl::OUString sNewColumnName; descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_NAME)) >>= sNewColumnName; - if ( !sNewColumnName.equalsIgnoreAsciiCase(colName) ) + if ( !sNewColumnName.equals(colName) ) { const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( ); -- cgit v1.2.3 From 2817098be334d7b0e33085c0f5640aee8b73e729 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 8 Jan 2010 08:12:03 +0100 Subject: dba33e: #i107315# convert SQL statement to MySQL notation --- connectivity/source/drivers/mysql/YTable.cxx | 4 ++-- connectivity/source/drivers/mysql/YTables.cxx | 19 +++++++++++++++++-- connectivity/source/inc/mysql/YTables.hxx | 5 +++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx index 8680ac2079..5e4cff3459 100644 --- a/connectivity/source/drivers/mysql/YTable.cxx +++ b/connectivity/source/drivers/mysql/YTable.cxx @@ -284,7 +284,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( ); sSql += ::dbtools::quoteName(sQuote,colName); sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); - sSql += ::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern()); + sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern())); executeStatement(sSql); } m_pColumns->refresh(); @@ -313,7 +313,7 @@ void OMySQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rCo ::comphelper::copyProperties(_xDescriptor,xProp); xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType)); - sSql += ::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern()); + sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern())); executeStatement(sSql); } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx index 8b2626d612..9af4b9f630 100644 --- a/connectivity/source/drivers/mysql/YTables.cxx +++ b/connectivity/source/drivers/mysql/YTables.cxx @@ -187,12 +187,27 @@ void OTables::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName) } } // ------------------------------------------------------------------------- +::rtl::OUString OTables::adjustSQL(const ::rtl::OUString& _sSql) +{ + ::rtl::OUString sSQL = _sSql; + static const ::rtl::OUString s_sUNSIGNED(RTL_CONSTASCII_USTRINGPARAM("UNSIGNED")); + sal_Int32 nIndex = sSQL.indexOf(s_sUNSIGNED); + while(nIndex != -1 ) + { + sal_Int32 nParen = sSQL.indexOf(')',nIndex); + sal_Int32 nPos = nIndex + s_sUNSIGNED.getLength(); + ::rtl::OUString sNewUnsigned( sSQL.copy(nPos,nParen - nPos + 1)); + sSQL = sSQL.replaceAt(nIndex,s_sUNSIGNED.getLength()+sNewUnsigned.getLength(),sNewUnsigned + s_sUNSIGNED); + nIndex = sSQL.indexOf(s_sUNSIGNED,nIndex + s_sUNSIGNED.getLength()+sNewUnsigned.getLength()); + } + return sSQL; +} +// ------------------------------------------------------------------------- void OTables::createTable( const Reference< XPropertySet >& descriptor ) { const Reference< XConnection > xConnection = static_cast(m_rParent).getConnection(); static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)")); - const ::rtl::OUString aSql = ::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern); - + const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern)); Reference< XStatement > xStmt = xConnection->createStatement( ); if ( xStmt.is() ) { diff --git a/connectivity/source/inc/mysql/YTables.hxx b/connectivity/source/inc/mysql/YTables.hxx index 981dcccc1f..c17358dd4a 100644 --- a/connectivity/source/inc/mysql/YTables.hxx +++ b/connectivity/source/inc/mysql/YTables.hxx @@ -74,6 +74,11 @@ namespace connectivity can contain () which have to filled with values */ static ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp); + + /** convert the sql statement to fit MySQL notation + @param _sSql in/out + */ + static ::rtl::OUString adjustSQL(const ::rtl::OUString& _sSql); }; } } -- cgit v1.2.3 From e5a8a63bbbced1fc052976c17cb211d6859b63d5 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 8 Jan 2010 09:22:40 +0100 Subject: dba33e: #i107472# catch exception --- connectivity/source/drivers/jdbc/JStatement.cxx | 68 ++++++++++++++----------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx index 7aa1750bb6..049274c489 100644 --- a/connectivity/source/drivers/jdbc/JStatement.cxx +++ b/connectivity/source/drivers/jdbc/JStatement.cxx @@ -712,38 +712,44 @@ void java_sql_Statement_Base::getFastPropertyValue( ) const { java_sql_Statement_Base* THIS = const_cast(this); - switch(nHandle) + try + { + switch(nHandle) + { + case PROPERTY_ID_QUERYTIMEOUT: + rValue <<= THIS->getQueryTimeOut(); + break; + case PROPERTY_ID_MAXFIELDSIZE: + rValue <<= THIS->getMaxFieldSize(); + break; + case PROPERTY_ID_MAXROWS: + rValue <<= THIS->getMaxRows(); + break; + case PROPERTY_ID_CURSORNAME: + rValue <<= THIS->getCursorName(); + break; + case PROPERTY_ID_RESULTSETCONCURRENCY: + rValue <<= THIS->getResultSetConcurrency(); + break; + case PROPERTY_ID_RESULTSETTYPE: + rValue <<= THIS->getResultSetType(); + break; + case PROPERTY_ID_FETCHDIRECTION: + rValue <<= THIS->getFetchDirection(); + break; + case PROPERTY_ID_FETCHSIZE: + rValue <<= THIS->getFetchSize(); + break; + case PROPERTY_ID_ESCAPEPROCESSING: + rValue <<= (sal_Bool)m_bEscapeProcessing; + break; + case PROPERTY_ID_USEBOOKMARKS: + default: + ; + } + } + catch(const Exception&) { - case PROPERTY_ID_QUERYTIMEOUT: - rValue <<= THIS->getQueryTimeOut(); - break; - case PROPERTY_ID_MAXFIELDSIZE: - rValue <<= THIS->getMaxFieldSize(); - break; - case PROPERTY_ID_MAXROWS: - rValue <<= THIS->getMaxRows(); - break; - case PROPERTY_ID_CURSORNAME: - rValue <<= THIS->getCursorName(); - break; - case PROPERTY_ID_RESULTSETCONCURRENCY: - rValue <<= THIS->getResultSetConcurrency(); - break; - case PROPERTY_ID_RESULTSETTYPE: - rValue <<= THIS->getResultSetType(); - break; - case PROPERTY_ID_FETCHDIRECTION: - rValue <<= THIS->getFetchDirection(); - break; - case PROPERTY_ID_FETCHSIZE: - rValue <<= THIS->getFetchSize(); - break; - case PROPERTY_ID_ESCAPEPROCESSING: - rValue <<= (sal_Bool)m_bEscapeProcessing; - break; - case PROPERTY_ID_USEBOOKMARKS: - default: - ; } } // ------------------------------------------------------------------------- -- cgit v1.2.3 From 37fa38a905396b868c1250659077cdb4d4d68f54 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 11 Jan 2010 09:53:12 +0100 Subject: autorecovery: fix post-rebase build problems --- framework/util/makefile.mk | 1 - sfx2/source/view/frame2.cxx | 2 +- sfx2/source/view/viewfrm2.cxx | 2 +- svx/source/form/datanavi.cxx | 2 +- vbahelper/source/vbahelper/vbahelper.cxx | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 0a07f3cf13..b0b074da8b 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -282,7 +282,6 @@ SHL4OBJS= \ $(SLO)$/langselectionstatusbarcontroller.obj \ $(SLO)$/layoutmanager.obj \ $(SLO)$/loaddispatcher.obj \ - $(SLO)$/loaddispatchlistener.obj \ $(SLO)$/loadenv.obj \ $(SLO)$/menubarfactory.obj \ $(SLO)$/menubarmanager.obj \ diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 83cc68e85d..0015b27983 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index bbbcfc2ec1..1d198e88d8 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 414fbeec5c..b4f5d62bb0 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -1611,7 +1611,7 @@ namespace svxform DBG_ASSERT( pBindings != NULL, "DataNavigatorWindow::LoadModels(): no SfxBindings; can't get frame" ); m_xFrame = Reference( - pBindings->GetDispatcher().GetFrame()->GetFrame()->GetFrameInterface(), + pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" ); // add frameaction listener diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 0b5456781a..d6b927f5a0 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -611,7 +611,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: { if ( bPreview ) { - if ( !pViewFrame->GetFrame()->IsInPlace() ) + if ( !pViewFrame->GetFrame().IsInPlace() ) { // #TODO is this necessary ( calc specific ) // SC_MOD()->InputEnterHandler(); -- cgit v1.2.3 From 08426a4ef3ac14e42eef413a87077425f710adef Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 12 Jan 2010 23:30:34 +0100 Subject: autorecovery: remove SID_VIEW, it is used only once, and mapped to SID_HIDDEN, anyway --- sfx2/inc/sfx2/sfxsids.hrc | 1 - sfx2/source/appl/appdde.cxx | 2 -- sfx2/source/appl/appopen.cxx | 22 ++-------------------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 08fabfab8e..fd150e7cc4 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -267,7 +267,6 @@ #define SID_EXPLORER_PROPS_END (SID_SFX_START + 1499) #define SID_AUTOLOAD (SID_SFX_START + 1509) -#define SID_VIEW (SID_SFX_START + 1512) #define SID_FILLFRAME (SID_SFX_START + 1516) #define SID_BASEURL (SID_SFX_START + 1518) #define SID_TEMPLATE (SID_SFX_START + 1519) diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 7f0ce9fffb..26a76218f0 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -596,14 +596,12 @@ BOOL ImplDdeService::MakeTopic( const String& rNm ) // dann versuche die Datei zu laden: SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) ); SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, TRUE); -// SfxBoolItem aHidden(SID_HIDDEN, TRUE); SfxBoolItem aSilent(SID_SILENT, TRUE); SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl(); const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aName, &aNewView, - /*aHidden,*/ &aSilent, 0L ); if( pRet && pRet->ISA( SfxViewFrameItem ) && diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 395100c9a7..cf8d3106b9 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -1146,21 +1146,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) rReq.RemoveItem( SID_DONELINK ); - // check if caller wants to create a view - BOOL bCreateView = TRUE; - SFX_REQUEST_ARG( rReq, pCreateViewItem, SfxBoolItem, SID_VIEW, FALSE ); - if ( pCreateViewItem ) - { - if ( !pCreateViewItem->GetValue() ) - bCreateView = FALSE; - // this is an "SFX only" parameter - rReq.RemoveItem( SID_VIEW ); - } - - // we can't load without a view - switch to hidden view - if ( !bCreateView ) - rReq.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); - // check if the view must be hidden BOOL bHidden = FALSE; SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN, FALSE); @@ -1334,12 +1319,9 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) SfxObjectShell* pSh = pCntrFrame->GetCurrentDocument(); DBG_ASSERT( pSh, "Controller without ObjectShell ?!" ); - if ( bCreateView ) - rReq.SetReturnValue( SfxViewFrameItem( 0, pCntrFrame->GetCurrentViewFrame() ) ); - else - rReq.SetReturnValue( SfxObjectItem( 0, pSh ) ); + rReq.SetReturnValue( SfxViewFrameItem( 0, pCntrFrame->GetCurrentViewFrame() ) ); - if( ( bHidden || !bCreateView ) ) + if ( bHidden ) pSh->RestoreNoDelete(); } } -- cgit v1.2.3 From eabb9a42dbcbc5aabdf0080493dc5d87e243b7da Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 12 Jan 2010 23:32:12 +0100 Subject: autorecovery: initial implementation of a new save/recovery for database documents For the moment, the document only stores and loads itself, as before. In this course, the AutoRecovery service now delegates the decision whether or not a document needs to be stored (to the "salvage location") to the document itself, using the new method XDocumentRecovery::wasModifiedSinceLastSave, superseded the previous E_MODIFIED_SINCE_LAST_AUTOSAVE flag. XDocumentRecovery::wasModifiedSinceLastSave has been implemented for SfxBaseModel, yielding the same behavior as before. It has also been implemented for database documents, where the implementation is somewhat "sloppy", in that it returns always when any of the opened sub components of the document is modified. --- framework/inc/services/autorecovery.hxx | 6 -- framework/source/services/autorecovery.cxx | 29 ++++---- sfx2/inc/sfx2/objsh.hxx | 6 +- sfx2/inc/sfx2/sfxbasemodel.hxx | 8 +- sfx2/source/doc/objembed.cxx | 2 +- sfx2/source/doc/objmisc.cxx | 9 +-- sfx2/source/doc/objstor.cxx | 4 +- sfx2/source/doc/objxtor.cxx | 47 ++++++------ sfx2/source/doc/sfxbasemodel.cxx | 114 +++++++++++++++-------------- sfx2/source/inc/objshimp.hxx | 4 +- 10 files changed, 113 insertions(+), 116 deletions(-) diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx index ece0099f18..358d13e966 100644 --- a/framework/inc/services/autorecovery.hxx +++ b/framework/inc/services/autorecovery.hxx @@ -170,12 +170,6 @@ class AutoRecovery : public css::lang::XTypeProvider E_UNKNOWN = 0, /// modified against the original file E_MODIFIED = 1, - /** We differ between the states: "modified in general" and "modified after last AutoSave". - The first state will be interesting in case the crashed document will be restored. Then we have - set the right modify state after loading the document. But the second state let us optimize the - AutoSave itself. see member ListenForModify too ... - */ - E_MODIFIED_SINCE_LAST_AUTOSAVE = 1024, /// an active document can be postponed to be saved later. E_POSTPONED = 2, /// was already handled during one AutoSave/Recovery session. diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 52334eeaba..11b332c3b1 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1837,7 +1837,6 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame if (xModifyCheck->isModified()) { aNew.DocumentState |= AutoRecovery::E_MODIFIED; - aNew.DocumentState |= AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE; } aCacheLock.lock(LOCK_FOR_CACHE_ADD_REMOVE); @@ -1845,7 +1844,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame // SAFE -> ---------------------------------- WriteGuard aWriteLock(m_aLock); - // create a new cache entry ... this document isnt well known. + // create a new cache entry ... this document isn't known. ++m_nIdPool; aNew.ID = m_nIdPool; LOG_ASSERT(m_nIdPool>=0, "AutoRecovery::implts_registerDocument()\nOverflow of ID pool detected.") @@ -1924,7 +1923,6 @@ void AutoRecovery::implts_markDocumentModifiedAgainstLastBackup(const css::uno:: if (pIt != m_lDocCache.end()) { AutoRecovery::TDocumentInfo& rInfo = *pIt; - rInfo.DocumentState |= AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE; /* Now we know, that this document was modified again and must be saved next time. But we dont need this information for every e.g. key input of the user. @@ -1959,12 +1957,10 @@ void AutoRecovery::implts_updateModifiedState(const css::uno::Reference< css::fr if (bModified) { rInfo.DocumentState |= AutoRecovery::E_MODIFIED; - rInfo.DocumentState |= AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE; } else { rInfo.DocumentState &= ~AutoRecovery::E_MODIFIED; - rInfo.DocumentState &= ~AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE; } } @@ -2280,8 +2276,8 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( sal_Bool bAl // Not modified documents are not saved. // We safe an information about the URL only! - sal_Bool bModified = ((aInfo.DocumentState & AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE ) == AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE); - if (! bModified) + Reference< XDocumentRecovery > xDocRecover( aInfo.Document, UNO_QUERY_THROW ); + if ( !xDocRecover->wasModifiedSinceLastSave() ) { aInfo.DocumentState |= AutoRecovery::E_HANDLED; continue; @@ -2426,8 +2422,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& // try to save this document as a new temp file everytimes. // Mark AutoSave state as "INCOMPLETE" if it failed. // Because the last temp file is to old and does not include all changes. - Reference< XDocumentRecovery > xDocRecover(rInfo.Document, css::uno::UNO_QUERY); - ENSURE_OR_THROW( xDocRecover.is(), "invalid document" ); + Reference< XDocumentRecovery > xDocRecover(rInfo.Document, css::uno::UNO_QUERY_THROW); // safe the state about "trying to save" // ... we need it for recovery if e.g. a crash occures inside next line! @@ -2440,7 +2435,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& { try { - xDocRecover->doEmergencySave( rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList() ); + xDocRecover->saveToRecoveryFile( rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList() ); #ifdef TRIGGER_FULL_DISC_CHECK throw css::uno::Exception(); @@ -2484,7 +2479,6 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& rInfo.DocumentState &= ~AutoRecovery::E_TRY_SAVE; rInfo.DocumentState |= AutoRecovery::E_HANDLED; rInfo.DocumentState |= AutoRecovery::E_SUCCEDED; - rInfo.DocumentState &= ~AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE; } else { @@ -2672,8 +2666,11 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa } css::uno::Reference< css::util::XModifiable > xModify(rInfo.Document, css::uno::UNO_QUERY); - sal_Bool bModified = ((rInfo.DocumentState & AutoRecovery::E_MODIFIED) == AutoRecovery::E_MODIFIED); - xModify->setModified(bModified); + if ( xModify.is() ) + { + sal_Bool bModified = ((rInfo.DocumentState & AutoRecovery::E_MODIFIED) == AutoRecovery::E_MODIFIED); + xModify->setModified(bModified); + } rInfo.DocumentState &= ~AutoRecovery::E_TRY_LOAD_BACKUP; rInfo.DocumentState &= ~AutoRecovery::E_TRY_LOAD_ORIGINAL; @@ -2686,8 +2683,8 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa /* Normaly we listen as XModifyListener on a document to know if a document was changed since our last AutoSave. And we deregister us in case we know this state. - But directly after one documentw as recovered ... we must start listening. - Otherwhise the first "modify" dont reach us. Because weself called setModified() + But directly after one document as recovered ... we must start listening. + Otherwhise the first "modify" doesnt reach us. Because we ourself called setModified() on the document via API. And currently we dont listen for any events (not at the GlobalEventBroadcaster nor at any document!). */ @@ -2740,7 +2737,7 @@ void AutoRecovery::implts_openOneDoc(const ::rtl::OUString& sURL { // let it recover itself Reference< XDocumentRecovery > xDocRecover( xModel, UNO_QUERY_THROW ); - xDocRecover->recoverDocument( + xDocRecover->recoverFromFile( sURL, lDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_SALVAGEDFILE(), ::rtl::OUString() ), lDescriptor.getAsConstPropertyValueList() diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index fee3570a1a..18b0eea34e 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -600,12 +600,11 @@ public: virtual SfxFrame* GetSmartSelf( SfxFrame* pSelf, SfxMedium& rMedium ); - void SetModel( SfxBaseModel* pModel ); - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModel() const; // Nur uebergangsweise fuer die Applikationen !!! void SetBaseModel( SfxBaseModel* pModel ); - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetBaseModel(); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetBaseModel() const; // Nur uebergangsweise fuer die Applikationen !!! virtual SEQUENCE< OUSTRING > GetEventNames(); @@ -761,6 +760,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, sal_Bool bTypeMustBeSetAlready ); SAL_DLLPRIVATE void PrepareSecondTryLoad_Impl(); + SAL_DLLPRIVATE void SetInitialized_Impl( const bool i_fromInitNew ); // public-internals SAL_DLLPRIVATE IndexBitSet& GetNoSet_Impl(); diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index 0501c6868f..c6b9b71c06 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -1299,11 +1299,13 @@ public: throw (css::uno::RuntimeException); // css.document.XDocumentRecovery - virtual void SAL_CALL doEmergencySave( const ::rtl::OUString& i_TargetLocation, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) + virtual ::sal_Bool SAL_CALL wasModifiedSinceLastSave() + throw ( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL saveToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) throw ( ::com::sun::star::uno::RuntimeException, ::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException ); - virtual void SAL_CALL recoverDocument( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) + virtual void SAL_CALL recoverFromFile( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) throw ( ::com::sun::star::uno::RuntimeException, ::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException ); @@ -1546,6 +1548,8 @@ private: ::sfx::intern::ViewCreationGuard& i_rGuard ) const; + SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const; + //________________________________________________________________________________________________________ // private variables and methods //________________________________________________________________________________________________________ diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index c50539a0bd..530fc144d9 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -308,7 +308,7 @@ void SfxObjectShell::DoDraw_Impl( OutputDevice* pDev, comphelper::EmbeddedObjectContainer& SfxObjectShell::GetEmbeddedObjectContainer() const { if ( !pImp->mpObjectContainer ) - pImp->mpObjectContainer = new comphelper::EmbeddedObjectContainer( ((SfxObjectShell*)this)->GetStorage(), pImp->xModel ); + pImp->mpObjectContainer = new comphelper::EmbeddedObjectContainer( ((SfxObjectShell*)this)->GetStorage(), GetModel() ); return *pImp->mpObjectContainer; } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 4860f99b33..49c3491e77 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -408,17 +408,11 @@ void SfxObjectShell::ModifyChanged() return; {DBG_CHKTHIS(SfxObjectShell, 0);} - SfxObjectShell *pDoc; - for ( pDoc = SfxObjectShell::GetFirst(); pDoc; - pDoc = SfxObjectShell::GetNext(*pDoc) ) - if( pDoc->IsModified() ) - break; SfxViewFrame* pViewFrame = SfxViewFrame::Current(); if ( pViewFrame ) pViewFrame->GetBindings().Invalidate( SID_SAVEDOCS ); - Invalidate( SID_SIGNATURE ); Invalidate( SID_MACRO_SIGNATURE ); Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) ); // xmlsec05, signed state might change in title... @@ -1439,8 +1433,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags ) } } - pImp->bInitialized = sal_True; - SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) ); + SetInitialized_Impl( false ); // Title is not available until loading has finished Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) ); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 6f7e78b849..dc14beb929 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -476,9 +476,7 @@ sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed ) impl_addToModelCollection(xModel); } - pImp->bInitialized = sal_True; - SetActivateEvent_Impl( SFX_EVENT_CREATEDOC ); - SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) ); + SetInitialized_Impl( true ); return sal_True; } diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 4b49792c57..8ad08f7118 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -340,7 +340,7 @@ SfxObjectShell::~SfxObjectShell() // Ableitungszweig SfxInternObject ist wegen eines Compiler Bugs nicht // erlaubt SfxObjectShell::Close(); - pImp->xModel = NULL; + pImp->pBaseModel.set( NULL ); DELETEX(pImp->pReloadTimer ); @@ -354,8 +354,7 @@ SfxObjectShell::~SfxObjectShell() if ( pSfxApp->GetDdeService() ) pSfxApp->RemoveDdeTopic( this ); - if ( pImp->xModel.is() ) - pImp->xModel = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > (); + pImp->pBaseModel.set( NULL ); // don't call GetStorage() here, in case of Load Failure it's possible that a storage was never assigned! if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage( sal_False ) == pImp->m_xDocStorage ) @@ -605,7 +604,7 @@ sal_uInt16 SfxObjectShell::PrepareClose { SfxHelp::OpenHelpAgent( &pFirst->GetFrame(), HID_CLOSE_WARNING ); } - const Reference< XTitle > xTitle(pImp->xModel, UNO_QUERY_THROW); + const Reference< XTitle > xTitle( *pImp->pBaseModel.get(), UNO_QUERY_THROW ); const ::rtl::OUString sTitle = xTitle->getTitle (); nRet = ExecuteQuerySaveDocument(&pFrame->GetWindow(),sTitle); } @@ -865,33 +864,26 @@ SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames() //-------------------------------------------------------------------- -void SfxObjectShell::SetModel( SfxBaseModel* pModel ) +::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetModel() const { - OSL_ENSURE( !pImp->xModel.is() || pModel == NULL, "Model already set!" ); - pImp->xModel = pModel; - if ( pModel ) - { - pModel->addCloseListener( new SfxModelListener_Impl(this) ); - } -} - -//-------------------------------------------------------------------- - -const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& SfxObjectShell::GetModel() const -{ - return pImp->xModel; + return GetBaseModel(); } void SfxObjectShell::SetBaseModel( SfxBaseModel* pModel ) { - SetModel(pModel); + OSL_ENSURE( !pImp->pBaseModel.is() || pModel == NULL, "Model already set!" ); + pImp->pBaseModel.set( pModel ); + if ( pImp->pBaseModel.is() ) + { + pImp->pBaseModel->addCloseListener( new SfxModelListener_Impl(this) ); + } } //-------------------------------------------------------------------- -::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetBaseModel() +::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetBaseModel() const { - return pImp->xModel; + return pImp->pBaseModel.get(); } /* -----------------------------10.09.2001 15:56------------------------------ @@ -1072,3 +1064,16 @@ SfxObjectShell* SfxObjectShell::CreateAndLoadObject( const SfxItemSet& rSet, Sfx return NULL; } +void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew ) +{ + pImp->bInitialized = sal_True; + if ( i_fromInitNew ) + { + SetActivateEvent_Impl( SFX_EVENT_CREATEDOC ); + SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) ); + } + else + { + SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) ); + } +} diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 4314abd872..12ffcf8883 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -157,8 +157,6 @@ using ::com::sun::star::document::XDocumentRecovery; /** This Listener is used to get notified when the XDocumentProperties of the XModel change. - If several changes are done the "bQuiet" member can be used to - temporarily suppress notifications. */ class SfxDocInfoListener_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XModifyListener > @@ -166,12 +164,9 @@ class SfxDocInfoListener_Impl : public ::cppu::WeakImplHelper1< public: SfxObjectShell& m_rShell; - bool bQuiet; - bool bGotModified; SfxDocInfoListener_Impl( SfxObjectShell& i_rDoc ) : m_rShell(i_rDoc) - , bQuiet(false) { }; ~SfxDocInfoListener_Impl(); @@ -188,12 +183,9 @@ void SAL_CALL SfxDocInfoListener_Impl::modified( const lang::EventObject& ) throw ( uno::RuntimeException ) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - bGotModified = true; // notify changes to the SfxObjectShell - if ( !bQuiet ) { - m_rShell.FlushDocInfo(); - } + m_rShell.FlushDocInfo(); } void SAL_CALL SfxDocInfoListener_Impl::disposing( const lang::EventObject& ) @@ -230,6 +222,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument sal_Bool m_bSaving ; sal_Bool m_bSuicide ; sal_Bool m_bInitialized ; + sal_Bool m_bModifiedSinceLastSave; uno::Reference< com::sun::star::view::XPrintable> m_xPrintable ; uno::Reference< script::provider::XScriptProvider > m_xScriptProvider; uno::Reference< ui::XUIConfigurationManager > m_xUIConfigurationManager; @@ -249,6 +242,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument , m_bSaving ( sal_False ) , m_bSuicide ( sal_False ) , m_bInitialized ( sal_False ) + , m_bModifiedSinceLastSave( sal_False ) , m_pStorageModifyListen ( NULL ) , m_xTitleHelper () , m_xNumberedControllers () @@ -1657,25 +1651,39 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString& } } -void SAL_CALL SfxBaseModel::doEmergencySave( const ::rtl::OUString& i_TargetLocation, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) +::sal_Bool SAL_CALL SfxBaseModel::wasModifiedSinceLastSave() throw ( RuntimeException ) { - // just delegate this to storeToURL - storeToURL( i_TargetLocation, i_MediaDescriptor ); + SfxModelGuard aGuard( *this ); + return m_pData->m_bModifiedSinceLastSave; } -void SAL_CALL SfxBaseModel::recoverDocument( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) +void SAL_CALL SfxBaseModel::saveToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) { + SfxModelGuard aGuard( *this ); + + // delegate + SfxSaveGuard aSaveGuard( this, m_pData, sal_False ); + impl_store( i_TargetLocation, i_MediaDescriptor, sal_True ); + + // no need for subsequent calls to saveToRecoveryFile, unless we're modified, again + m_pData->m_bModifiedSinceLastSave = sal_False; +} + +void SAL_CALL SfxBaseModel::recoverFromFile( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) +{ + SfxModelGuard aGuard( *this ); + // delegate to our "load" method ::comphelper::NamedValueCollection aMediaDescriptor( i_MediaDescriptor ); // our load implementation expects the SalvagedFile to be in the media descriptor OSL_ENSURE( !aMediaDescriptor.has( "SalvagedFile" ) || ( aMediaDescriptor.getOrDefault( "SalvagedFile", ::rtl::OUString() ) == i_SalvagedFile ), - "SfxBaseModel::recoverDocument: inconsistent information!" ); + "SfxBaseModel::recoverFromFile: inconsistent information!" ); aMediaDescriptor.put( "SalvagedFile", i_SalvagedFile ); // similar for the to-be-loaded file OSL_ENSURE( !aMediaDescriptor.has( "URL" ) || ( aMediaDescriptor.getOrDefault( "URL", ::rtl::OUString() ) == i_SourceLocation ), - "SfxBaseModel::recoverDocument: inconsistent information!" ); + "SfxBaseModel::recoverFromFile: inconsistent information!" ); aMediaDescriptor.put( "URL", i_SourceLocation ); load( aMediaDescriptor.getPropertyValues() ); @@ -2431,7 +2439,9 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , if ( pNamedHint ) { - if ( SFX_EVENT_STORAGECHANGED == pNamedHint->GetEventId() ) + switch ( pNamedHint->GetEventId() ) + { + case SFX_EVENT_STORAGECHANGED: { // for now this event is sent only on creation of a new storage for new document // and in case of reload of medium without document reload @@ -2462,12 +2472,17 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , ListenForStorage_Impl( m_pData->m_pObjectShell->GetStorage() ); } - else if ( SFX_EVENT_LOADFINISHED == pNamedHint->GetEventId() ) + break; + + case SFX_EVENT_LOADFINISHED: { impl_getPrintHelper(); ListenForStorage_Impl( m_pData->m_pObjectShell->GetStorage() ); + m_pData->m_bModifiedSinceLastSave = sal_False; } - else if ( SFX_EVENT_SAVEASDOCDONE == pNamedHint->GetEventId() ) + break; + + case SFX_EVENT_SAVEASDOCDONE: { m_pData->m_sURL = m_pData->m_pObjectShell->GetMedium()->GetName(); @@ -2478,9 +2493,20 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , addTitle_Impl( aArgs, aTitle ); attachResource( m_pData->m_pObjectShell->GetMedium()->GetName(), aArgs ); } - else if ( SFX_EVENT_DOCCREATED == pNamedHint->GetEventId() ) + break; + + case SFX_EVENT_DOCCREATED: { impl_getPrintHelper(); + m_pData->m_bModifiedSinceLastSave = sal_False; + } + break; + + case SFX_EVENT_MODIFYCHANGED: + { + m_pData->m_bModifiedSinceLastSave = isModified(); + } + break; } postEvent_Impl( pNamedHint->GetEventName() ); @@ -2514,6 +2540,18 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , // public impl. //________________________________________________________________________________________________________ +void SfxBaseModel::NotifyModifyListeners_Impl() const +{ + ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0) ); + if ( pIC ) + { + lang::EventObject aEvent( (frame::XModel *)this ); + pIC->notifyEach( &util::XModifyListener::modified, aEvent ); + } + + m_pData->m_bModifiedSinceLastSave = sal_True; +} + void SfxBaseModel::changing() { SfxModelGuard aGuard( *this ); @@ -2522,24 +2560,7 @@ void SfxBaseModel::changing() if ( !m_pData->m_pObjectShell.Is() || !m_pData->m_pObjectShell->IsEnableSetModified() ) return; - ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0) ); - if( pIC ) - - { - lang::EventObject aEvent( (frame::XModel *)this ); - ::cppu::OInterfaceIteratorHelper aIt( *pIC ); - while( aIt.hasMoreElements() ) - { - try - { - ((XMODIFYLISTENER *)aIt.next())->modified( aEvent ); - } - catch( uno::RuntimeException& ) - { - aIt.remove(); - } - } - } + NotifyModifyListeners_Impl(); } void SfxBaseModel::impl_change() @@ -2548,24 +2569,7 @@ void SfxBaseModel::impl_change() if ( impl_isDisposed() ) return; - ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0) ); - if( pIC ) - - { - lang::EventObject aEvent( (frame::XModel *)this ); - ::cppu::OInterfaceIteratorHelper aIt( *pIC ); - while( aIt.hasMoreElements() ) - { - try - { - ((XMODIFYLISTENER *)aIt.next())->modified( aEvent ); - } - catch( uno::RuntimeException& ) - { - aIt.remove(); - } - } - } + NotifyModifyListeners_Impl(); } //________________________________________________________________________________________________________ diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index 059f25a919..f55e8479a0 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -130,7 +131,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess sal_Bool bReadOnlyUI; SvRefBaseRef xHeaderAttributes; sal_Bool bHiddenLockedByAPI; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel; + ::rtl::Reference< SfxBaseModel > + pBaseModel; sal_uInt16 nStyleFilter; sal_Bool bDisposing; -- cgit v1.2.3 From 46f6a9943ed207e7ab975bd8dc955daa77fd3829 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 13 Jan 2010 15:46:51 +0100 Subject: autorecovery: save open/modified (Writer-based) reports and forms, when doing a session/emergency save Still, the documents are stored only, and not loaded. For storing, there's at least one known issue: The controller is unable to deliver the proper object name for a form which has been newly created, and then saved. In this case, an empty name (from the time where the form was created) will be returned, and used in the save process. --- svx/inc/svx/unomodel.hxx | 12 +++---- svx/source/xml/xmlexport.cxx | 84 +++++++++++++------------------------------- 2 files changed, 30 insertions(+), 66 deletions(-) diff --git a/svx/inc/svx/unomodel.hxx b/svx/inc/svx/unomodel.hxx index c67daef254..9cb6376eef 100644 --- a/svx/inc/svx/unomodel.hxx +++ b/svx/inc/svx/unomodel.hxx @@ -102,12 +102,12 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > SAL_CALL createAnyCompareByName( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); }; -SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, com::sun::star::uno::Reference xOut ); -SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, com::sun::star::uno::Reference xOut, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent ); -SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, com::sun::star::uno::Reference xOut, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent, const char* pExportService ); -SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, com::sun::star::uno::Reference xInputStream ); -SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, com::sun::star::uno::Reference xInputStream, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent ); -SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, com::sun::star::uno::Reference xInputStream, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent, const char* pImportService ); +SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference& xOut ); +SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent ); +SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent, const char* pExportService ); +SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference& xInputStream ); +SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference& xInputStream, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent ); +SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference& xInputStream, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent, const char* pImportService ); #endif diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx index 0caab98da9..87815791f2 100644 --- a/svx/source/xml/xmlexport.cxx +++ b/svx/source/xml/xmlexport.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" #include +#include #include #include #include @@ -55,12 +56,12 @@ using ::rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference xOut, Reference< lang::XComponent > xComponent ) +sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference& xOut, const Reference< lang::XComponent >& xComponent ) { return SvxDrawingLayerExport( pModel, xOut, xComponent, "com.sun.star.comp.DrawingLayer.XMLExporter" ); } -sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference xOut, Reference< lang::XComponent > xComponent, const char* pExportService ) +sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference& xOut, const Reference< lang::XComponent >& xComponent, const char* pExportService ) { sal_Bool bDocRet = xOut.is(); @@ -70,12 +71,13 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference xObjectResolver; SvXMLEmbeddedObjectHelper *pObjectHelper = 0; + Reference< lang::XComponent > xSourceDoc( xComponent ); try { - if( !xComponent.is() ) + if( !xSourceDoc.is() ) { - xComponent = new SvxUnoDrawingModel( pModel ); - pModel->setUnoModel( Reference< XInterface >::query( xComponent ) ); + xSourceDoc = new SvxUnoDrawingModel( pModel ); + pModel->setUnoModel( Reference< XInterface >::query( xSourceDoc ) ); } uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() ); @@ -130,7 +132,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference xExporter( xFilter, uno::UNO_QUERY ); if( xExporter.is() ) { - xExporter->setSourceDocument( xComponent ); + xExporter->setSourceDocument( xSourceDoc ); uno::Sequence< beans::PropertyValue > aDescriptor( 0 ); bDocRet = xFilter->filter( aDescriptor ); @@ -141,11 +143,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference 1 - ByteString aError( "uno Exception caught while exporting:\n" ); - aError += ByteString( String( e.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); -#endif + DBG_UNHANDLED_EXCEPTION(); bDocRet = sal_False; } @@ -160,7 +158,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference xOut ) +sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference& xOut ) { Reference< lang::XComponent > xComponent; return SvxDrawingLayerExport( pModel, xOut, xComponent ); @@ -168,12 +166,12 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference xInputStream, Reference< lang::XComponent > xComponent ) +sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference& xInputStream, const Reference< lang::XComponent >& xComponent ) { return SvxDrawingLayerImport( pModel, xInputStream, xComponent, "com.sun.star.comp.Draw.XMLOasisImporter" ); } -sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference xInputStream, Reference< lang::XComponent > xComponent, const char* pImportService ) +sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference& xInputStream, const Reference< lang::XComponent >& xComponent, const char* pImportService ) { sal_uInt32 nRet = 0; @@ -183,13 +181,14 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference xObjectResolver; SvXMLEmbeddedObjectHelper *pObjectHelper = 0; - if( !xComponent.is() ) + Reference< lang::XComponent > xTargetDocument( xComponent ); + if( !xTargetDocument.is() ) { - xComponent = new SvxUnoDrawingModel( pModel ); - pModel->setUnoModel( Reference< XInterface >::query( xComponent ) ); + xTargetDocument = new SvxUnoDrawingModel( pModel ); + pModel->setUnoModel( Reference< XInterface >::query( xTargetDocument ) ); } - Reference< frame::XModel > xModel( xComponent, UNO_QUERY ); + Reference< frame::XModel > xTargetModel( xTargetDocument, UNO_QUERY ); try { @@ -202,7 +201,8 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::ReferencelockControllers(); + if ( xTargetModel.is() ) + xTargetModel->lockControllers(); // ------------------------------------- @@ -251,7 +251,7 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference xImporter( xFilter, UNO_QUERY ); - xImporter->setTargetDocument( xComponent ); + xImporter->setTargetDocument( xTargetDocument ); // finally, parser the stream xParser->parseStream( aParserInput ); @@ -260,45 +260,9 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference 1 - ByteString aError( "SAX parse exception catched while importing:\n" ); - aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); -#else - (void) r; // avoid warnings -#endif - } - catch( xml::sax::SAXException& r ) - { -#if OSL_DEBUG_LEVEL > 1 - ByteString aError( "SAX exception catched while importing:\n" ); - aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); -#else - (void) r; // avoid warnings -#endif - } - catch( io::IOException& r ) - { -#if OSL_DEBUG_LEVEL > 1 - ByteString aError( "IO exception catched while importing:\n" ); - aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); -#else - (void) r; // avoid warnings -#endif - } catch( uno::Exception& r ) { -#if OSL_DEBUG_LEVEL > 1 - ByteString aError( "uno exception catched while importing:\n" ); - aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); -#else - (void) r; // avoid warnings -#endif + DBG_UNHANDLED_EXCEPTION(); } if( pGraphicHelper ) @@ -309,13 +273,13 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::ReferenceunlockControllers(); + if ( xTargetModel.is() ) + xTargetModel->unlockControllers(); return nRet == 0; } -sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference xInputStream ) +sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference& xInputStream ) { Reference< lang::XComponent > xComponent; return SvxDrawingLayerImport( pModel, xInputStream, xComponent ); -- cgit v1.2.3 From 0adddfc7fe8e49b8317efe9723fb3dcaea9120bd Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 13 Jan 2010 15:53:07 +0100 Subject: vcl109: #i108290# KDE4 integration updates from shtylman --- fpicker/source/unx/kde4/KDE4FilePicker.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx index bea4617e8b..2c5086992f 100644 --- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx +++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx @@ -166,8 +166,6 @@ KDE4FilePicker::KDE4FilePicker( const uno::Reference //default mode _dialog->setOperationMode(KFileDialog::Opening); - - _dialog->setStyleSheet("color: black;"); } KDE4FilePicker::~KDE4FilePicker() @@ -212,6 +210,7 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute() _dialog->clearFilter(); _dialog->setFilter(_filter); + _dialog->filterWidget()->setEditable(false); //block and wait for user input if (_dialog->exec() == KFileDialog::Accepted) @@ -263,7 +262,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles() QCheckBox *cb = dynamic_cast ( _customWidgets[ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION ]); - if (cb->isChecked()) + if (cb && cb->isChecked()) { extension = _dialog->currentFilter(); // assuming filter value is like this *.ext extension.replace("*",""); @@ -658,13 +657,13 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence &args ) case FILESAVE_AUTOEXTENSION: operationMode = KFileDialog::Saving; - addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION ); + //addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION ); break; case FILESAVE_AUTOEXTENSION_PASSWORD: { operationMode = KFileDialog::Saving; - addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION ); + //addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION ); addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD ); break; } @@ -715,6 +714,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence &args ) } _dialog->setOperationMode(operationMode); + _dialog->setConfirmOverwrite(true); } void SAL_CALL KDE4FilePicker::cancel() -- cgit v1.2.3 From 61cb367e201b4acd481bfd471b92a32f1b47b777 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 13 Jan 2010 15:58:25 +0100 Subject: sw33bf02: #b6912256# method - handle unexpected list level value --- xmloff/source/text/XMLTextNumRuleInfo.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx index 30895a5edc..36f882838c 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.cxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx @@ -123,6 +123,15 @@ void XMLTextNumRuleInfo::Set( } // <-- + // --> OD 2010-01-13 #b6912256# + if ( mnListLevel < 0 ) + { + DBG_ASSERT( false, + " - unexpected numbering level" ); + Reset(); + return; + } + // --> OD 2006-09-27 #i69627# bool bSuppressListStyle( false ); if ( mxNumRules.is() ) -- cgit v1.2.3 From 4bc9a4c398db83c8f9550bc58de52a8b813ed344 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 14 Jan 2010 19:16:10 +0100 Subject: sw33bf02: #i107372#: handle year/month in editing duration SfxDocumentMetaData: approximate conversion of year/month to seconds. SfxObjectShell::UpdateTime_Impl(): handle larger edit duration values. --- sfx2/source/doc/SfxDocumentMetaData.cxx | 4 +++- sfx2/source/doc/objcont.cxx | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index b3e446a34c..dda31cc341 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -588,7 +588,9 @@ sal_Int32 textToDuration(::rtl::OUString const& i_rText) throw () { css::util::Duration d; if (textToDuration(d, i_rText)) { - return (d.Days * (24*3600)) + // #i107372#: approximate years/months + const sal_Int32 days( (d.Years * 365) + (d.Months * 30) + d.Days ); + return (days * (24*3600)) + (d.Hours * 3600) + (d.Minutes * 60) + d.Seconds; } else { return 0; // default diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index c8253f687e..a76aa3d8fd 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -481,13 +481,24 @@ void SfxObjectShell::UpdateDocInfoForSave() //-------------------------------------------------------------------- +static void +lcl_add(util::Duration & rDur, Time const& rTime) +{ + // here we don't care about overflow: rDur is converted back to seconds + // anyway, and Time cannot store more than ~4000 hours + rDur.Hours += rTime.GetHour(); + rDur.Minutes += rTime.GetMin(); + rDur.Seconds += rTime.GetSec(); +} + // Bearbeitungszeit aktualisieren void SfxObjectShell::UpdateTime_Impl( const uno::Reference & i_xDocProps) { // Get old time from documentinfo - sal_Int32 secs = i_xDocProps->getEditingDuration(); - Time aOldTime(secs/3600, (secs%3600)/60, secs%60); + const sal_Int32 secs = i_xDocProps->getEditingDuration(); + util::Duration editDuration(sal_False, 0, 0, 0, + secs/3600, (secs%3600)/60, secs%60, 0); // Initialize some local member! Its neccessary for wollow operations! DateTime aNow ; // Date and time at current moment @@ -524,13 +535,14 @@ void SfxObjectShell::UpdateTime_Impl( nAddTime += aNow ; } - aOldTime += nAddTime; + lcl_add(editDuration, nAddTime); } pImp->nTime = aNow; try { - i_xDocProps->setEditingDuration( - aOldTime.GetHour()*3600+aOldTime.GetMin()*60+aOldTime.GetSec()); + const sal_Int32 newSecs( (editDuration.Hours*3600) + + (editDuration.Minutes*60) + editDuration.Seconds); + i_xDocProps->setEditingDuration(newSecs); i_xDocProps->setEditingCycles(i_xDocProps->getEditingCycles() + 1); } catch (lang::IllegalArgumentException &) -- cgit v1.2.3 From 98955e2af1901eeb341686d7d5ae7c39a3e3c781 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 15 Jan 2010 15:21:15 +0100 Subject: autorecovery: save/recover forms and reports Still some lose ends. Most notably, the current code contains cases for other sub component types, but has no real implementation - attempting to save/recover those other types will yield multiple assertions only. Also, recovery of SRB-reports has not been tested, yet, chances are good there's some work ahead here. Other known open issues: - recovering sub components immediately shows them, instead of initially hiding them, and showing only when the main document window is shown - the implementation currently is no real session save, which would require saving information about *unmodified* open sub components (though not their actual content), and restoring them upon recovery. - doing an implicit "connect" at the controller of the to-be-recovered database document is a requirement to actually load the sub components, but might yield problems in case this requires interaction (e.g. a login). Need to investigate - the "recovery" storage is not removed from the database document storage after un/successful recovery - cancelling the recovery of a "modified" database document always suggests to store this doc somewhere --- embeddedobj/source/commonembedding/embedobj.cxx | 2 +- embeddedobj/source/commonembedding/miscobj.cxx | 3 +- embeddedobj/source/commonembedding/persistence.cxx | 44 +++++++++++++++------- embeddedobj/source/inc/commonembobj.hxx | 9 ++++- 4 files changed, 41 insertions(+), 17 deletions(-) diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx index 799e8654e9..62aa5aa7c9 100644 --- a/embeddedobj/source/commonembedding/embedobj.cxx +++ b/embeddedobj/source/commonembedding/embedobj.cxx @@ -192,7 +192,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState ) if ( !m_xObjectStorage.is() ) throw io::IOException(); //TODO: access denied - m_pDocHolder->SetComponent( LoadDocumentFromStorage_Impl( m_xObjectStorage ), m_bReadOnly ); + m_pDocHolder->SetComponent( LoadDocumentFromStorage_Impl(), m_bReadOnly ); } else { diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index 884116978c..5b4b96e3be 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -646,7 +646,8 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership ) } catch ( uno::Exception& ) {} } - m_xObjectStorage = uno::Reference< embed::XStorage >(); + m_xObjectStorage.clear(); + m_xObjectLoadStorage.clear(); } m_bClosed = sal_True; // the closing succeeded diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index dd0c84915b..d8dac0e093 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -272,7 +272,7 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X { uno::Reference< document::XStorageBasedDocument > xDoc( m_pDocHolder->GetComponent(), uno::UNO_QUERY ); if ( xDoc.is() ) - xDoc->switchToStorage( m_xObjectStorage ); + SwitchDocToStorage_Impl( xDoc, m_xObjectStorage ); } #endif @@ -452,10 +452,9 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() } //------------------------------------------------------ -uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorage_Impl( - const uno::Reference< embed::XStorage >& xStorage ) +uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorage_Impl() { - OSL_ENSURE( xStorage.is(), "The storage can not be empty!" ); + OSL_ENSURE( m_xObjectStorage.is(), "The storage can not be empty!" ); uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(), m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); @@ -478,7 +477,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag if ( !xDoc.is() && !xLoadable.is() ) ///BUG: This should be || instead of && ? throw uno::RuntimeException(); - ::rtl::OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( xStorage ) ); + ::rtl::OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( m_xObjectStorage ) ); OSL_ENSURE( aFilterName.getLength(), "Wrong document service name!" ); if ( !aFilterName.getLength() ) @@ -499,7 +498,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag uno::Reference< io::XInputStream > xTempInpStream; if ( !xDoc.is() ) { - xTempInpStream = createTempInpStreamFromStor( xStorage, m_xFactory ); + xTempInpStream = createTempInpStreamFromStor( m_xObjectStorage, m_xFactory ); if ( !xTempInpStream.is() ) throw uno::RuntimeException(); @@ -550,7 +549,15 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag } if ( xDoc.is() ) - xDoc->loadFromStorage( xStorage, aArgs ); + { + if ( m_xObjectLoadStorage.is() ) + { + xDoc->loadFromStorage( m_xObjectLoadStorage, aArgs ); + SwitchDocToStorage_Impl( xDoc, m_xObjectStorage ); + } + else + xDoc->loadFromStorage( m_xObjectStorage, aArgs ); + } else xLoadable->load( aArgs ); } @@ -725,6 +732,18 @@ void OCommonEmbeddedObject::SaveObject_Impl() } +//------------------------------------------------------ +void OCommonEmbeddedObject::SwitchDocToStorage_Impl( const uno::Reference< document::XStorageBasedDocument >& xDoc, const uno::Reference< embed::XStorage >& xStorage ) +{ + xDoc->switchToStorage( xStorage ); + uno::Reference< util::XModifiable > xModif( xDoc, uno::UNO_QUERY ); + if ( xModif.is() ) + xModif->setModified( sal_False ); + + if ( m_xObjectLoadStorage.is() ) + m_xObjectLoadStorage.clear(); +} + //------------------------------------------------------ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed::XStorage >& xStorage, sal_Int32 nStorageFormat, @@ -763,12 +782,7 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed: xDoc->storeToStorage( xStorage, aArgs ); if ( bAttachToTheStorage ) - { - xDoc->switchToStorage( xStorage ); - uno::Reference< util::XModifiable > xModif( m_pDocHolder->GetComponent(), uno::UNO_QUERY ); - if ( xModif.is() ) - xModif->setModified( sal_False ); - } + SwitchDocToStorage_Impl( xDoc, xStorage ); } else #endif @@ -1063,6 +1077,10 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( { OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_bDocumentRecoverySupport ); } + else if ( lObjArgs[nObjInd].Name.equalsAscii( "RecoverFromStorage" ) ) + { + OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_xObjectLoadStorage ); + } sal_Int32 nStorageMode = m_bReadOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE; diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index 310a4e72f2..a610dfcfa8 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -150,6 +151,7 @@ protected: ::rtl::OUString m_aEntryName; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xObjectStorage; + ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xObjectLoadStorage; // link related stuff ::rtl::OUString m_aLinkURL; @@ -200,8 +202,7 @@ private: ::com::sun::star::uno::Sequence< sal_Int32 > GetIntermediateStatesSequence_Impl( sal_Int32 nNewState ); ::rtl::OUString GetFilterName( sal_Int32 nVersion ); - ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadDocumentFromStorage_Impl( - const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadDocumentFromStorage_Impl(); ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadLink_Impl(); @@ -213,6 +214,10 @@ private: const ::rtl::OUString& aHierarchName, sal_Bool bAttachToStorage ); + void SwitchDocToStorage_Impl( + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageBasedDocument >& xDoc, + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateDocFromMediaDescr_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMedDescr ); -- cgit v1.2.3 From e488b045f8dae1daed3442f3bdfc2368262a8c59 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 19 Jan 2010 16:48:52 +0100 Subject: sw33bf02: #i108347#: change util::Duration to support MilliSeconds: SfxDocumentMetaData: adapt. dinfdlg.src: adapt dialog to milliseconds. sax::Converter: adapt. sax::Converter::convertDuration(): fix a bug in parsing fractional seconds. --- sfx2/qa/complex/DocumentMetaData.java | 10 +++++++--- sfx2/source/dialog/dinfdlg.cxx | 21 +++++++++++---------- sfx2/source/dialog/dinfdlg.hrc | 4 ++-- sfx2/source/dialog/dinfdlg.src | 8 ++++---- sfx2/source/doc/SfxDocumentMetaData.cxx | 4 ++-- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/sfx2/qa/complex/DocumentMetaData.java b/sfx2/qa/complex/DocumentMetaData.java index c08531a697..0e65e8c873 100644 --- a/sfx2/qa/complex/DocumentMetaData.java +++ b/sfx2/qa/complex/DocumentMetaData.java @@ -370,7 +370,7 @@ public class DocumentMetaData extends ComplexTestCase dur.Hours = 777; dur.Minutes = 666; dur.Seconds = 555; - dur.HundredthSeconds = 444; + dur.MilliSeconds = 444; udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE, new Boolean(b)); @@ -447,7 +447,11 @@ public class DocumentMetaData extends ComplexTestCase udps.getPropertyValue("Frobnicate"))); assure ("UserDefined duration", eqDuration(dur, (Duration) udps.getPropertyValue("FrobDuration"))); - assure ("UserDefined time", eqTime(t, (Time) + // this is now a Duration! + Duration t_dur = new Duration(false, (short)0, (short)0, (short)0, + t.Hours, t.Minutes, t.Seconds, + (short)(10 * t.HundredthSeconds)); + assure ("UserDefined time", eqDuration(t_dur, (Duration) udps.getPropertyValue("FrobDuration2"))); assure ("UserDefined date", eqDate(date, (Date) udps.getPropertyValue("FrobEndDate"))); @@ -514,7 +518,7 @@ public class DocumentMetaData extends ComplexTestCase return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days && a.Hours == b.Hours && a.Minutes == b.Minutes && a.Seconds == b.Seconds - && a.HundredthSeconds == b.HundredthSeconds + && a.MilliSeconds == b.MilliSeconds && a.Negative == b.Negative; } diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index e5b555d977..2ebca02936 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1603,8 +1603,8 @@ class DurationDialog_Impl : public ModalDialog NumericField aMinuteNF; FixedText aSecondFT; NumericField aSecondNF; - FixedText aHSecondFT; - NumericField aHSecondNF; + FixedText aMSecondFT; + NumericField aMSecondNF; public: @@ -1616,8 +1616,9 @@ public: /*-- 20.11.2009 15:40:46--------------------------------------------------- -----------------------------------------------------------------------*/ -DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration& rDuration ) : - ModalDialog( pParent, SfxResId( RID_EDIT_DURATIONS ) ), +DurationDialog_Impl::DurationDialog_Impl( + Window* pParent, const util::Duration& rDuration) + : ModalDialog( pParent, SfxResId( RID_EDIT_DURATIONS ) ), aDurationFL(this, SfxResId( FL_DURATION )), aOKPB( this, SfxResId( PB_OK )), aCancelPB( this, SfxResId( PB_CANCEL )), @@ -1635,8 +1636,8 @@ DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration& aMinuteNF( this, SfxResId( ED_MINUTE )), aSecondFT( this, SfxResId( FT_SECOND )), aSecondNF( this, SfxResId( ED_SECOND )), - aHSecondFT( this, SfxResId( FT_HSECOND )), - aHSecondNF( this, SfxResId( ED_HSECOND )) + aMSecondFT( this, SfxResId( FT_MSECOND )), + aMSecondNF( this, SfxResId( ED_MSECOND )) { FreeResource(); aNegativeCB.Check(rDuration.Negative); @@ -1646,7 +1647,7 @@ DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration& aHourNF.SetValue(rDuration.Hours ); aMinuteNF.SetValue(rDuration.Minutes); aSecondNF.SetValue(rDuration.Seconds); - aHSecondNF.SetValue(rDuration.HundredthSeconds); + aMSecondNF.SetValue(rDuration.MilliSeconds); } /*-- 20.11.2009 16:08:55--------------------------------------------------- @@ -1667,7 +1668,7 @@ util::Duration DurationDialog_Impl::GetDuration() const aRet.Hours = aHourNF.GetValue( ); aRet.Minutes = aMinuteNF.GetValue(); aRet.Seconds = aSecondNF.GetValue(); - aRet.HundredthSeconds = aHSecondNF.GetValue(); + aRet.MilliSeconds = aMSecondNF.GetValue(); return aRet; } @@ -2129,12 +2130,12 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) nType = CUSTOM_TYPE_DATE; pNewLine->m_aDateField.SetDate( Date( aTmpDate.Day, aTmpDate.Month, aTmpDate.Year ) ); - } + } else if ( rAny >>= aTmpDuration ) { nType = CUSTOM_TYPE_DURATION; pNewLine->m_aDurationField.SetDuration( aTmpDuration ); - } + } else if ( rAny >>= aTmpDateTime ) { pNewLine->m_aDateField.SetDate( Date( aTmpDateTime.Day, aTmpDateTime.Month, aTmpDateTime.Year ) ); diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc index 6f3be56b59..18d39ed9b3 100644 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc @@ -172,8 +172,8 @@ #define ED_MINUTE 113 #define FT_SECOND 114 #define ED_SECOND 115 -#define FT_HSECOND 116 -#define ED_HSECOND 117 +#define FT_MSECOND 116 +#define ED_MSECOND 117 #define FL_DURATION 118 #endif diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index 429124b9bf..cbf77178a5 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -880,14 +880,14 @@ ModalDialog RID_EDIT_DURATIONS SpinSize = 1 ; Value = 0 ; }; - FixedText FT_HSECOND + FixedText FT_MSECOND { Pos = MAP_APPFONT ( 6 , 122 ) ; Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; Left = TRUE ; - Text [ en-US ] = "1/100 se~conds" ; + Text [ en-US ] = "Millise~conds" ; }; - NumericField ED_HSECOND + NumericField ED_MSECOND { Border = TRUE ; Pos = MAP_APPFONT ( 70 , 120 ) ; @@ -896,7 +896,7 @@ ModalDialog RID_EDIT_DURATIONS Spin = TRUE ; Minimum = 0 ; First = 1 ; - Last = 100 ; + Last = 1000 ; SpinSize = 1 ; Value = 0 ; }; diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index dda31cc341..4dd5479ee1 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -613,7 +613,7 @@ sal_Int32 textToDuration(::rtl::OUString const& i_rText) throw () ud.Hours = static_cast((i_value % (24 * 3600)) / 3600); ud.Minutes = static_cast((i_value % 3600) / 60); ud.Seconds = static_cast(i_value % 60); - ud.HundredthSeconds = 0; + ud.MilliSeconds = 0; return durationToText(ud); } @@ -953,7 +953,7 @@ propsToStrings(css::uno::Reference const & i_xPropSet) ud.Hours = ut.Hours; ud.Minutes = ut.Minutes; ud.Seconds = ut.Seconds; - ud.HundredthSeconds = ut.HundredthSeconds; + ud.MilliSeconds = 10 * ut.HundredthSeconds; values.push_back(durationToText(ud)); as.push_back(std::make_pair(vt, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time")))); -- cgit v1.2.3 From efa6ca00d524866bf1b03611c18e422b47cb00c0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 19 Jan 2010 17:39:27 +0100 Subject: sw33bf02: #i107502#: more workarounds for OOo 2.x broken user-defined props --- sfx2/source/doc/SfxDocumentMetaData.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 4dd5479ee1..f9f3bb0ccd 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -930,8 +930,13 @@ propsToStrings(css::uno::Reference const & i_xPropSet) values.push_back(s); // #i90847# OOo 2.x does stupid things if value-type="string"; // fortunately string is default anyway, so we can just omit it -// as.push_back(std::make_pair(vt, -// ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string")))); +// #i107502#: however, OOo 2.x only reads 4 user-defined without @value-type +// => best backward compatibility: first 4 without @value-type, rest with + if (4 <= i) + { + as.push_back(std::make_pair(vt, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string")))); + } } else if (type == ::cppu::UnoType::get()) { css::util::DateTime dt; any >>= dt; -- cgit v1.2.3 From 9a3a67aaa85a6f2a3d7f8c6ed17794e8d2b9ead7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 22 Jan 2010 15:58:17 +0100 Subject: recoverFromFile is allowed (required, strictly) in the initialization phase --- sfx2/source/doc/sfxbasemodel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 12ffcf8883..75963a11bb 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1671,7 +1671,7 @@ void SAL_CALL SfxBaseModel::saveToRecoveryFile( const ::rtl::OUString& i_TargetL void SAL_CALL SfxBaseModel::recoverFromFile( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) { - SfxModelGuard aGuard( *this ); + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); // delegate to our "load" method ::comphelper::NamedValueCollection aMediaDescriptor( i_MediaDescriptor ); -- cgit v1.2.3 From 25cd32d17441667bf0a4861029efac893e236503 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 22 Jan 2010 22:22:41 +0100 Subject: autorecovery: preserve the complete exception when throwing the LoadEnvException, not only the css.uno.Exception base info --- framework/source/inc/loadenv/loadenvexception.hxx | 8 ++++---- framework/source/loadenv/loadenv.cxx | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/framework/source/inc/loadenv/loadenvexception.hxx b/framework/source/inc/loadenv/loadenvexception.hxx index 4ba70befcb..8ff9f9fbe2 100644 --- a/framework/source/inc/loadenv/loadenvexception.hxx +++ b/framework/source/inc/loadenv/loadenvexception.hxx @@ -175,11 +175,11 @@ class LoadEnvException @param exUno the original catched uno exception. */ - LoadEnvException( sal_Int32 nID , - const css::uno::Exception& exUno) + LoadEnvException( sal_Int32 nID , + const css::uno::Any& exUno) { - m_nID = nID ; - m_exOriginal <<= exUno; + m_nID = nID ; + m_exOriginal = exUno; } //_______________________________________ diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index deed3a1269..286d00d3bd 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1725,9 +1725,8 @@ void LoadEnv::impl_reactForLoadingState() if (bThrow) { - css::uno::Exception aEx; - if ( aRequest >>= aEx ) - throw LoadEnvException( LoadEnvException::ID_GENERAL_ERROR, aEx ); + if ( aRequest.isExtractableTo( ::cppu::UnoType< css::uno::Exception >::get() ) ) + throw LoadEnvException( LoadEnvException::ID_GENERAL_ERROR, aRequest ); } // <- SAFE ---------------------------------- -- cgit v1.2.3 From 8b25a0308c4006d9ebd3fc8a6df616885171c8ac Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 22 Jan 2010 22:46:39 +0100 Subject: autorecovery: since the AR service does not use the LoadEnv anymore, it needs to care for some media descriptor defaults (like for MacroExecutionMode) itself --- framework/source/inc/loadenv/loadenv.hxx | 9 +++++ framework/source/loadenv/loadenv.cxx | 60 ++++++++++++++++++++---------- framework/source/services/autorecovery.cxx | 5 ++- 3 files changed, 53 insertions(+), 21 deletions(-) diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx index 2bdd42cfb7..d96643a380 100644 --- a/framework/source/inc/loadenv/loadenv.hxx +++ b/framework/source/inc/loadenv/loadenv.hxx @@ -420,6 +420,7 @@ class LoadEnv : private ThreadHelpBase virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) throw(css::uno::RuntimeException); */ + //___________________________________________ // static interface @@ -457,6 +458,14 @@ class LoadEnv : private ThreadHelpBase static EContentType classifyContent(const ::rtl::OUString& sURL , const css::uno::Sequence< css::beans::PropertyValue >& lMediaDescriptor); + /** TODO document me ... */ + static void initializeUIDefaults( + const css::uno::Reference< css::lang::XMultiServiceFactory >& i_rSMGR, + ::comphelper::MediaDescriptor& io_lMediaDescriptor, + const bool _bUIMode, + QuietInteraction** o_ppQuiteInteraction + ); + /** TODO document me ... */ void impl_setResult(sal_Bool bResult); diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 286d00d3bd..4123932556 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -324,22 +324,41 @@ void LoadEnv::initializeLoading(const ::rtl::OUString& /*TODO progress is bound to a frame ... How can we set it here? */ + // UI mode + const bool bUIMode = + ( ( m_eFeature & E_WORK_WITH_UI ) == E_WORK_WITH_UI ) && + ( m_lMediaDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_HIDDEN() , sal_False ) == sal_False ) && + ( m_lMediaDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_PREVIEW(), sal_False ) == sal_False ); + + initializeUIDefaults( + m_xSMGR, + m_lMediaDescriptor, + bUIMode, + &m_pQuietInteraction + ); + + aWriteLock.unlock(); + // <- SAFE ---------------------------------- +} + +/*----------------------------------------------- + 22.01.2010 +-----------------------------------------------*/ +void LoadEnv::initializeUIDefaults( const css::uno::Reference< css::lang::XMultiServiceFactory >& i_rSMGR, + ::comphelper::MediaDescriptor& io_lMediaDescriptor, const bool i_bUIMode, + QuietInteraction** o_ppQuietInteraction ) +{ css::uno::Reference< css::task::XInteractionHandler > xInteractionHandler; sal_Int16 nMacroMode ; sal_Int16 nUpdateMode ; - // UI mode - if ( - ((m_eFeature & E_WORK_WITH_UI) == E_WORK_WITH_UI) && - (m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_HIDDEN() , sal_False) == sal_False ) && - (m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_PREVIEW(), sal_False) == sal_False ) - ) + if ( i_bUIMode ) { nMacroMode = css::document::MacroExecMode::USE_CONFIG; nUpdateMode = css::document::UpdateDocMode::ACCORDING_TO_CONFIG; try { - xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(m_xSMGR->createInstance(IMPLEMENTATIONNAME_UIINTERACTIONHANDLER), css::uno::UNO_QUERY); + xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(i_rSMGR->createInstance(IMPLEMENTATIONNAME_UIINTERACTIONHANDLER), css::uno::UNO_QUERY); } catch(const css::uno::RuntimeException&) {throw;} catch(const css::uno::Exception& ) { } @@ -349,27 +368,28 @@ void LoadEnv::initializeLoading(const ::rtl::OUString& { nMacroMode = css::document::MacroExecMode::NEVER_EXECUTE; nUpdateMode = css::document::UpdateDocMode::NO_UPDATE; - m_pQuietInteraction = new QuietInteraction(); - m_pQuietInteraction->acquire(); - xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(static_cast< css::task::XInteractionHandler* >(m_pQuietInteraction), css::uno::UNO_QUERY); + QuietInteraction* pQuietInteraction = new QuietInteraction(); + xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(static_cast< css::task::XInteractionHandler* >(pQuietInteraction), css::uno::UNO_QUERY); + if ( o_ppQuietInteraction != NULL ) + { + *o_ppQuietInteraction = pQuietInteraction; + (*o_ppQuietInteraction)->acquire(); + } } if ( - (xInteractionHandler.is() ) && - (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()) == m_lMediaDescriptor.end()) + (xInteractionHandler.is() ) && + (io_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()) == io_lMediaDescriptor.end()) ) { - m_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteractionHandler; + io_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteractionHandler; } - if (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()) == m_lMediaDescriptor.end()) - m_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()] <<= nMacroMode; - - if (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()) == m_lMediaDescriptor.end()) - m_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()] <<= nUpdateMode; + if (io_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()) == io_lMediaDescriptor.end()) + io_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()] <<= nMacroMode; - aWriteLock.unlock(); - // <- SAFE ---------------------------------- + if (io_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()) == io_lMediaDescriptor.end()) + io_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()] <<= nUpdateMode; } /*----------------------------------------------- diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 11b332c3b1..4fe3b6a138 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -32,6 +32,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_framework.hxx" #include "services/autorecovery.hxx" +#include //_______________________________________________ // own includes @@ -2622,6 +2623,8 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa else continue; // TODO ERROR! + LoadEnv::initializeUIDefaults( m_xSMGR, lDescriptor, true, NULL ); + // <- SAFE ------------------------------ aWriteLock.unlock(); @@ -2662,7 +2665,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa { ::comphelper::MediaDescriptor lPatchDescriptor(rInfo.Document->getArgs()); lPatchDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= rInfo.RealFilter; - rInfo.Document->attachResource(sURL, lPatchDescriptor.getAsConstPropertyValueList()); + rInfo.Document->attachResource(rInfo.Document->getURL(), lPatchDescriptor.getAsConstPropertyValueList()); } css::uno::Reference< css::util::XModifiable > xModify(rInfo.Document, css::uno::UNO_QUERY); -- cgit v1.2.3 From f3eb391bfb4e242240bd4f07969c9bcabf9cbb09 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 25 Jan 2010 09:56:57 +0100 Subject: autorecovery: do not remove SalvagedFile from DBDoc's args if it still carries information --- framework/source/services/autorecovery.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 4fe3b6a138..bb23f201e5 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2665,7 +2665,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa { ::comphelper::MediaDescriptor lPatchDescriptor(rInfo.Document->getArgs()); lPatchDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= rInfo.RealFilter; - rInfo.Document->attachResource(rInfo.Document->getURL(), lPatchDescriptor.getAsConstPropertyValueList()); + rInfo.Document->attachResource(sURL, lPatchDescriptor.getAsConstPropertyValueList()); } css::uno::Reference< css::util::XModifiable > xModify(rInfo.Document, css::uno::UNO_QUERY); -- cgit v1.2.3 From 91b4b64e02de6e465970ca212c38e9979ac8159c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 26 Jan 2010 13:19:11 +0100 Subject: autorecovery: mav sanctioned the approach of the (now so-called) RecoveryStorage --- embeddedobj/source/commonembedding/miscobj.cxx | 2 +- embeddedobj/source/commonembedding/persistence.cxx | 13 +++++++------ embeddedobj/source/inc/commonembobj.hxx | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index 5b4b96e3be..4dc01d6554 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -647,7 +647,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership ) } m_xObjectStorage.clear(); - m_xObjectLoadStorage.clear(); + m_xRecoveryStorage.clear(); } m_bClosed = sal_True; // the closing succeeded diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index d8dac0e093..c320ecaaed 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -550,9 +550,9 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag if ( xDoc.is() ) { - if ( m_xObjectLoadStorage.is() ) + if ( m_xRecoveryStorage.is() ) { - xDoc->loadFromStorage( m_xObjectLoadStorage, aArgs ); + xDoc->loadFromStorage( m_xRecoveryStorage, aArgs ); SwitchDocToStorage_Impl( xDoc, m_xObjectStorage ); } else @@ -736,12 +736,13 @@ void OCommonEmbeddedObject::SaveObject_Impl() void OCommonEmbeddedObject::SwitchDocToStorage_Impl( const uno::Reference< document::XStorageBasedDocument >& xDoc, const uno::Reference< embed::XStorage >& xStorage ) { xDoc->switchToStorage( xStorage ); + uno::Reference< util::XModifiable > xModif( xDoc, uno::UNO_QUERY ); if ( xModif.is() ) xModif->setModified( sal_False ); - if ( m_xObjectLoadStorage.is() ) - m_xObjectLoadStorage.clear(); + if ( m_xRecoveryStorage.is() ) + m_xRecoveryStorage.clear(); } //------------------------------------------------------ @@ -1077,9 +1078,9 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( { OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_bDocumentRecoverySupport ); } - else if ( lObjArgs[nObjInd].Name.equalsAscii( "RecoverFromStorage" ) ) + else if ( lObjArgs[nObjInd].Name.equalsAscii( "RecoveryStorage" ) ) { - OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_xObjectLoadStorage ); + OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_xRecoveryStorage ); } diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index a610dfcfa8..f968279fd3 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -151,7 +151,7 @@ protected: ::rtl::OUString m_aEntryName; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xObjectStorage; - ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xObjectLoadStorage; + ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRecoveryStorage; // link related stuff ::rtl::OUString m_aLinkURL; -- cgit v1.2.3 From 9e4db908b46b0c7f71f17d278cf96d59db9cddc4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 27 Jan 2010 10:53:30 +0100 Subject: autorecovery: when creating a new document, also respect the RecoveryStorage parameter --- embeddedobj/source/commonembedding/persistence.cxx | 180 +++++++++++---------- embeddedobj/source/inc/commonembobj.hxx | 21 ++- 2 files changed, 110 insertions(+), 91 deletions(-) diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index c320ecaaed..433a74f1f3 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -67,6 +67,8 @@ #include +#include + #define USE_STORAGEBASED_DOCUMENT using namespace ::com::sun::star; @@ -198,6 +200,22 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor( } +//------------------------------------------------------ +static void TransferMediaType( const uno::Reference< embed::XStorage >& i_rSource, const uno::Reference< embed::XStorage >& i_rTarget ) +{ + try + { + const uno::Reference< beans::XPropertySet > xSourceProps( i_rSource, uno::UNO_QUERY_THROW ); + const uno::Reference< beans::XPropertySet > xTargetProps( i_rTarget, uno::UNO_QUERY_THROW ); + const ::rtl::OUString sMediaTypePropName( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); + xTargetProps->setPropertyValue( sMediaTypePropName, xSourceProps->getPropertyValue( sMediaTypePropName ) ); + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + //------------------------------------------------------ static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference< lang::XMultiServiceFactory >& _rxFactory, const ::rtl::OUString& _rDocumentServiceName, bool _bEmbeddedScriptSupport, const bool i_bDocumentRecoverySupport ) @@ -300,6 +318,23 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X SwitchOwnPersistence( xNewParentStorage, xNewOwnStorage, aNewName ); } +//------------------------------------------------------ +void OCommonEmbeddedObject::EmbedAndReparentDoc_Impl( const uno::Reference< util::XCloseable >& i_rxDocument ) const +{ + SetDocToEmbedded( uno::Reference< frame::XModel >( i_rxDocument, uno::UNO_QUERY ), m_aModuleName ); + + try + { + uno::Reference < container::XChild > xChild( i_rxDocument, uno::UNO_QUERY ); + if ( xChild.is() ) + xChild->setParent( m_xParent ); + } + catch( const lang::NoSupportException & ) + { + OSL_ENSURE( false, "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set parent at document!" ); + } +} + //------------------------------------------------------ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() { @@ -314,22 +349,31 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() try { // set the document mode to embedded as the first action on document!!! - SetDocToEmbedded( xModel, m_aModuleName ); + EmbedAndReparentDoc_Impl( xDocument ); - try + // if we have a storage to recover the document from, do not use initNew, but instead load from that storage + bool bInitNew = true; + if ( m_xRecoveryStorage.is() ) { - uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY ); - if ( xChild.is() ) - xChild->setParent( m_xParent ); + uno::Reference< document::XStorageBasedDocument > xDoc( xLoadable, uno::UNO_QUERY ); + OSL_ENSURE( xDoc.is(), "OCommonEmbeddedObject::InitNewDocument_Impl: cannot recover from a storage when the document is not storage based!" ); + if ( xDoc.is() ) + { + ::comphelper::NamedValueCollection aLoadArgs; + FillDefaultLoadArgs_Impl( m_xRecoveryStorage, aLoadArgs ); + + xDoc->loadFromStorage( m_xRecoveryStorage, aLoadArgs.getPropertyValues() ); + SwitchDocToStorage_Impl( xDoc, m_xObjectStorage ); + bInitNew = false; + } } - catch( const lang::NoSupportException & ) + + if ( bInitNew ) { - OSL_ENSURE( false, "Cannot set parent at document" ); + // init document as a new + xLoadable->initNew(); + xModel->attachResource( xModel->getURL(), m_aDocMediaDescriptor ); } - - // init document as a new - xLoadable->initNew(); - xModel->attachResource( xModel->getURL(),m_aDocMediaDescriptor); } catch( uno::Exception& ) { @@ -384,18 +428,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() try { // the document is not really an embedded one, it is a link - SetDocToEmbedded( uno::Reference < frame::XModel >( xDocument, uno::UNO_QUERY ), m_aModuleName ); - - try - { - uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY ); - if ( xChild.is() ) - xChild->setParent( m_xParent ); - } - catch( const lang::NoSupportException & ) - { - OSL_ENSURE( false, "Cannot set parent at document" ); - } + EmbedAndReparentDoc_Impl( xDocument ); // load the document xLoadable->load( aArgs ); @@ -436,7 +469,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() } //------------------------------------------------------ -::rtl::OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion ) +::rtl::OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion ) const { ::rtl::OUString aFilterName = GetPresetFilterName(); if ( !aFilterName.getLength() ) @@ -451,10 +484,28 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() return aFilterName; } +//------------------------------------------------------ +void OCommonEmbeddedObject::FillDefaultLoadArgs_Impl( const uno::Reference< embed::XStorage >& i_rxStorage, + ::comphelper::NamedValueCollection& o_rLoadArgs ) const +{ + o_rLoadArgs.put( "DocumentBaseURL", GetBaseURL_Impl() ); + o_rLoadArgs.put( "HierarchicalDocumentName", m_aEntryName ); + o_rLoadArgs.put( "ReadOnly", m_bReadOnly ); + + ::rtl::OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( i_rxStorage ) ); + OSL_ENSURE( aFilterName.getLength(), "OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong document service name!" ); + if ( !aFilterName.getLength() ) + throw io::IOException(); // TODO: error message/code + + o_rLoadArgs.put( "FilterName", aFilterName ); +} + //------------------------------------------------------ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorage_Impl() { - OSL_ENSURE( m_xObjectStorage.is(), "The storage can not be empty!" ); + ENSURE_OR_THROW( m_xObjectStorage.is(), "no object storage" ); + + const uno::Reference< embed::XStorage > xSourceStorage( m_xRecoveryStorage.is() ? m_xRecoveryStorage : m_xObjectStorage ); uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(), m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); @@ -477,28 +528,13 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag if ( !xDoc.is() && !xLoadable.is() ) ///BUG: This should be || instead of && ? throw uno::RuntimeException(); - ::rtl::OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( m_xObjectStorage ) ); - - OSL_ENSURE( aFilterName.getLength(), "Wrong document service name!" ); - if ( !aFilterName.getLength() ) - throw io::IOException(); - - sal_Int32 nLen = xDoc.is() ? 4 : 6; - uno::Sequence< beans::PropertyValue > aArgs( nLen ); - - aArgs[0].Name = ::rtl::OUString::createFromAscii( "DocumentBaseURL" ); - aArgs[0].Value <<= GetBaseURL_Impl(); - aArgs[1].Name = ::rtl::OUString::createFromAscii( "HierarchicalDocumentName" ); - aArgs[1].Value <<= m_aEntryName; - aArgs[2].Name = ::rtl::OUString::createFromAscii( "ReadOnly" ); - aArgs[2].Value <<= m_bReadOnly; - aArgs[3].Name = ::rtl::OUString::createFromAscii( "FilterName" ); - aArgs[3].Value <<= aFilterName; + ::comphelper::NamedValueCollection aLoadArgs; + FillDefaultLoadArgs_Impl( xSourceStorage, aLoadArgs ); uno::Reference< io::XInputStream > xTempInpStream; if ( !xDoc.is() ) { - xTempInpStream = createTempInpStreamFromStor( m_xObjectStorage, m_xFactory ); + xTempInpStream = createTempInpStreamFromStor( xSourceStorage, m_xFactory ); if ( !xTempInpStream.is() ) throw uno::RuntimeException(); @@ -516,50 +552,27 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag OSL_ENSURE( aTempFileURL.getLength(), "Coudn't retrieve temporary file URL!\n" ); - aArgs[4].Name = ::rtl::OUString::createFromAscii( "URL" ); - aArgs[4].Value <<= aTempFileURL; // ::rtl::OUString::createFromAscii( "private:stream" ); - aArgs[5].Name = ::rtl::OUString::createFromAscii( "InputStream" ); - aArgs[5].Value <<= xTempInpStream; + aLoadArgs.put( "URL", aTempFileURL ); + aLoadArgs.put( "InputStream", xTempInpStream ); } - // aArgs[4].Name = ::rtl::OUString::createFromAscii( "AsTemplate" ); - // aArgs[4].Value <<= sal_True; + // aLoadArgs.put( "AsTemplate", sal_True ); - aArgs.realloc( m_aDocMediaDescriptor.getLength() + nLen ); - for ( sal_Int32 nInd = 0; nInd < m_aDocMediaDescriptor.getLength(); nInd++ ) - { - aArgs[nInd+nLen].Name = m_aDocMediaDescriptor[nInd].Name; - aArgs[nInd+nLen].Value = m_aDocMediaDescriptor[nInd].Value; - } + aLoadArgs.merge( m_aDocMediaDescriptor, true ); try { // set the document mode to embedded as the first step!!! - SetDocToEmbedded( uno::Reference < frame::XModel >( xDocument, uno::UNO_QUERY ), m_aModuleName ); - - try - { - uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY ); - if ( xChild.is() ) - xChild->setParent( m_xParent ); - } - catch( const lang::NoSupportException & ) - { - OSL_ENSURE( false, "Cannot set parent at document" ); - } + EmbedAndReparentDoc_Impl( xDocument ); if ( xDoc.is() ) { - if ( m_xRecoveryStorage.is() ) - { - xDoc->loadFromStorage( m_xRecoveryStorage, aArgs ); + xDoc->loadFromStorage( xSourceStorage, aLoadArgs.getPropertyValues() ); + if ( xSourceStorage != m_xObjectStorage ) SwitchDocToStorage_Impl( xDoc, m_xObjectStorage ); - } - else - xDoc->loadFromStorage( m_xObjectStorage, aArgs ); } else - xLoadable->load( aArgs ); + xLoadable->load( aLoadArgs.getPropertyValues() ); } catch( uno::Exception& ) { @@ -572,6 +585,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag } catch( uno::Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } @@ -661,7 +675,7 @@ void OCommonEmbeddedObject::SaveObject_Impl() } //------------------------------------------------------ -::rtl::OUString OCommonEmbeddedObject::GetBaseURL_Impl() +::rtl::OUString OCommonEmbeddedObject::GetBaseURL_Impl() const { ::rtl::OUString aBaseURL; sal_Int32 nInd = 0; @@ -824,18 +838,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateDocFromMediaDesc try { // set the document mode to embedded as the first action on the document!!! - SetDocToEmbedded( uno::Reference < frame::XModel >( xDocument, uno::UNO_QUERY ), m_aModuleName ); - - try - { - uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY ); - if ( xChild.is() ) - xChild->setParent( m_xParent ); - } - catch( const lang::NoSupportException & ) - { - OSL_ENSURE( false, "Cannot set parent at document" ); - } + EmbedAndReparentDoc_Impl( xDocument ); xLoadable->load( addAsTemplate( aMedDescr ) ); } @@ -1117,6 +1120,9 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( } else if ( nEntryConnectionMode == embed::EntryInitModes::TRUNCATE_INIT ) { + if ( m_xRecoveryStorage.is() ) + TransferMediaType( m_xRecoveryStorage, m_xObjectStorage ); + // TODO: m_pDocHolder->SetComponent( InitNewDocument_Impl(), m_bReadOnly ); diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index f968279fd3..b81b736abe 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -75,6 +75,10 @@ namespace cppu { class OMultiTypeInterfaceContainerHelper; } +namespace comphelper { + class NamedValueCollection; +} + #define NUM_SUPPORTED_STATES 5 // #define NUM_SUPPORTED_VERBS 5 @@ -183,8 +187,8 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage, const ::rtl::OUString& aNewName ); - ::rtl::OUString GetDocumentServiceName() { return m_aDocServiceName; } - ::rtl::OUString GetPresetFilterName() { return m_aPresetFilterName; } + ::rtl::OUString GetDocumentServiceName() const { return m_aDocServiceName; } + ::rtl::OUString GetPresetFilterName() const { return m_aPresetFilterName; } ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > StoreDocumentToTempStream_Impl( sal_Int32 nStorageFormat, @@ -201,7 +205,7 @@ private: ::com::sun::star::uno::Sequence< sal_Int32 > GetIntermediateStatesSequence_Impl( sal_Int32 nNewState ); - ::rtl::OUString GetFilterName( sal_Int32 nVersion ); + ::rtl::OUString GetFilterName( sal_Int32 nVersion ) const; ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadDocumentFromStorage_Impl(); ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadLink_Impl(); @@ -218,12 +222,21 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageBasedDocument >& xDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); + void FillDefaultLoadArgs_Impl( + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rxStorage, + ::comphelper::NamedValueCollection& o_rLoadArgs + ) const; + + void EmbedAndReparentDoc_Impl( + const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable >& i_rxDocument + ) const; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateDocFromMediaDescr_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMedDescr ); ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateTempDocFromLink_Impl(); - ::rtl::OUString GetBaseURL_Impl(); + ::rtl::OUString GetBaseURL_Impl() const; ::rtl::OUString GetBaseURLFrom_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ); -- cgit v1.2.3 From 071d3a90f8cc2a2248caf51aaab6075c33a13b45 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 27 Jan 2010 11:51:56 +0100 Subject: aw079: #i99147# attribute rework and others --- .../inc/drawinglayer/attribute/fillattribute.hxx | 138 ------ .../drawinglayer/attribute/fillbitmapattribute.hxx | 42 +- .../attribute/fillgradientattribute.hxx | 121 ++++++ .../drawinglayer/attribute/fillhatchattribute.hxx | 112 +++++ .../inc/drawinglayer/attribute/fontattribute.hxx | 81 ++-- .../inc/drawinglayer/attribute/lineattribute.hxx | 61 +-- .../attribute/linestartendattribute.hxx | 47 +- .../drawinglayer/attribute/materialattribute3d.hxx | 12 +- .../drawinglayer/attribute/sdrallattribute3d.hxx | 66 ++- .../inc/drawinglayer/attribute/sdrattribute.hxx | 223 ---------- .../inc/drawinglayer/attribute/sdrattribute3d.hxx | 217 ---------- .../drawinglayer/attribute/sdrfillattribute.hxx | 99 +++++ .../attribute/sdrfillbitmapattribute.hxx | 61 ++- .../drawinglayer/attribute/sdrlightattribute3d.hxx | 96 +++++ .../attribute/sdrlightingattribute3d.hxx | 99 +++++ .../drawinglayer/attribute/sdrlineattribute.hxx | 104 +++++ .../attribute/sdrlinestartendattribute.hxx | 102 +++++ .../attribute/sdrobjectattribute3d.hxx | 111 +++++ .../drawinglayer/attribute/sdrsceneattribute3d.hxx | 94 ++++ .../drawinglayer/attribute/sdrshadowattribute.hxx | 93 ++++ .../inc/drawinglayer/attribute/strokeattribute.hxx | 54 +-- .../drawinglayer/geometry/viewinformation2d.hxx | 6 + .../drawinglayer/geometry/viewinformation3d.hxx | 6 + .../drawinglayer/primitive2d/alphaprimitive2d.hxx | 103 ----- .../drawinglayer/primitive2d/baseprimitive2d.hxx | 8 +- .../primitive2d/drawinglayer_primitivetypes2d.hxx | 20 +- .../primitive2d/fillgradientprimitive2d.hxx | 2 +- .../primitive2d/fillhatchprimitive2d.hxx | 3 +- .../drawinglayer/primitive2d/gridprimitive2d.hxx | 2 +- .../drawinglayer/primitive2d/groupprimitive2d.hxx | 2 +- .../primitive2d/hiddengeometryprimitive2d.hxx | 79 ++++ .../primitive2d/hittestprimitive2d.hxx | 86 ---- .../drawinglayer/primitive2d/invertprimitive2d.hxx | 2 +- .../primitive2d/markerarrayprimitive2d.hxx | 2 +- .../primitive2d/metafileprimitive2d.hxx | 2 +- .../primitive2d/polygonprimitive2d.hxx | 2 + .../primitive2d/polypolygonprimitive2d.hxx | 6 +- .../drawinglayer/primitive2d/sceneprimitive2d.hxx | 4 +- .../primitive2d/sdrdecompositiontools2d.hxx | 85 ++++ .../primitive2d/transparenceprimitive2d.hxx | 103 +++++ .../primitive2d/unifiedalphaprimitive2d.hxx | 88 ---- .../primitive2d/unifiedtransparenceprimitive2d.hxx | 91 ++++ .../primitive3d/drawinglayer_primitivetypes3d.hxx | 38 +- .../drawinglayer/primitive3d/groupprimitive3d.hxx | 2 +- .../primitive3d/hatchtextureprimitive3d.hxx | 1 + .../primitive3d/hiddengeometryprimitive3d.hxx | 81 ++++ .../primitive3d/hittestprimitive3d.hxx | 88 ---- .../primitive3d/sdrcubeprimitive3d.hxx | 2 +- .../primitive3d/sdrdecompositiontools3d.hxx | 11 +- .../primitive3d/sdrextrudeprimitive3d.hxx | 2 +- .../primitive3d/sdrlatheprimitive3d.hxx | 2 +- .../primitive3d/sdrpolypolygonprimitive3d.hxx | 2 +- .../drawinglayer/primitive3d/sdrprimitive3d.hxx | 8 +- .../primitive3d/sdrsphereprimitive3d.hxx | 2 +- .../primitive3d/textureprimitive3d.hxx | 26 +- .../drawinglayer/processor2d/baseprocessor2d.hxx | 177 +++++++- .../drawinglayer/processor2d/canvasprocessor.hxx | 13 +- .../processor2d/contourextractor2d.hxx | 9 +- .../processor2d/hittestprocessor2d.hxx | 37 +- .../processor2d/linegeometryextractor2d.hxx | 9 +- .../processor2d/textaspolygonextractor2d.hxx | 8 +- .../processor2d/vclmetafileprocessor2d.hxx | 56 ++- .../processor2d/vclpixelprocessor2d.hxx | 23 +- .../drawinglayer/processor2d/vclprocessor2d.hxx | 13 +- .../drawinglayer/processor3d/baseprocessor3d.hxx | 27 +- .../processor3d/cutfindprocessor3d.hxx | 37 +- .../processor3d/defaultprocessor3d.hxx | 41 +- .../processor3d/geometry2dextractor.hxx | 19 +- .../drawinglayer/processor3d/shadow3dextractor.hxx | 35 +- .../processor3d/zbufferprocessor3d.hxx | 25 +- drawinglayer/prj/d.lst | 22 +- drawinglayer/source/attribute/fillattribute.cxx | 102 ----- .../source/attribute/fillbitmapattribute.cxx | 153 ++++++- .../source/attribute/fillgradientattribute.cxx | 250 +++++++++++ .../source/attribute/fillhatchattribute.cxx | 219 ++++++++++ drawinglayer/source/attribute/fontattribute.cxx | 220 +++++++++- drawinglayer/source/attribute/lineattribute.cxx | 142 ++++++ .../source/attribute/linestartendattribute.cxx | 148 ++++++- drawinglayer/source/attribute/makefile.mk | 27 +- .../source/attribute/materialattribute3d.cxx | 93 ++-- .../source/attribute/sdrallattribute3d.cxx | 169 ++------ drawinglayer/source/attribute/sdrattribute.cxx | 293 ------------- drawinglayer/source/attribute/sdrattribute3d.cxx | 219 ---------- drawinglayer/source/attribute/sdrfillattribute.cxx | 221 ++++++++++ .../source/attribute/sdrfillbitmapattribute.cxx | 259 +++++++++-- .../source/attribute/sdrlightattribute3d.cxx | 196 +++++++++ .../source/attribute/sdrlightingattribute3d.cxx | 235 ++++++++++ drawinglayer/source/attribute/sdrlineattribute.cxx | 250 +++++++++++ .../source/attribute/sdrlinestartendattribute.cxx | 254 +++++++++++ .../source/attribute/sdrobjectattribute3d.cxx | 292 +++++++++++++ .../source/attribute/sdrsceneattribute3d.cxx | 218 ++++++++++ .../source/attribute/sdrshadowattribute.cxx | 193 +++++++++ drawinglayer/source/attribute/strokeattribute.cxx | 139 +++++- drawinglayer/source/geometry/viewinformation2d.cxx | 47 ++ drawinglayer/source/geometry/viewinformation3d.cxx | 47 +- .../source/primitive2d/alphaprimitive2d.cxx | 78 ---- .../source/primitive2d/fillbitmapprimitive2d.cxx | 78 ++-- .../source/primitive2d/fillgradientprimitive2d.cxx | 38 +- .../source/primitive2d/fillhatchprimitive2d.cxx | 108 ++--- .../source/primitive2d/graphicprimitive2d.cxx | 6 +- .../primitive2d/hiddengeometryprimitive2d.cxx | 75 ++++ .../source/primitive2d/hittestprimitive2d.cxx | 76 ---- .../source/primitive2d/invertprimitive2d.cxx | 2 +- drawinglayer/source/primitive2d/makefile.mk | 89 ++-- .../source/primitive2d/mediaprimitive2d.cxx | 17 +- .../source/primitive2d/metafileprimitive2d.cxx | 31 +- .../source/primitive2d/pagepreviewprimitive2d.cxx | 5 +- .../source/primitive2d/polygonprimitive2d.cxx | 31 +- .../source/primitive2d/polypolygonprimitive2d.cxx | 105 +++-- .../source/primitive2d/sceneprimitive2d.cxx | 9 +- .../source/primitive2d/sdrdecompositiontools2d.cxx | 130 ++++++ .../source/primitive2d/shadowprimitive2d.cxx | 4 +- .../source/primitive2d/transparenceprimitive2d.cxx | 78 ++++ .../source/primitive2d/unifiedalphaprimitive2d.cxx | 129 ------ .../primitive2d/unifiedtransparenceprimitive2d.cxx | 136 ++++++ .../source/primitive2d/wallpaperprimitive2d.cxx | 3 +- .../primitive3d/hiddengeometryprimitive3d.cxx | 76 ++++ .../source/primitive3d/hittestprimitive3d.cxx | 76 ---- drawinglayer/source/primitive3d/makefile.mk | 2 +- .../source/primitive3d/polygontubeprimitive3d.cxx | 4 +- .../source/primitive3d/sdrcubeprimitive3d.cxx | 37 +- .../source/primitive3d/sdrdecompositiontools3d.cxx | 88 +++- .../source/primitive3d/sdrextrudeprimitive3d.cxx | 45 +- .../source/primitive3d/sdrlatheprimitive3d.cxx | 47 +- .../primitive3d/sdrpolypolygonprimitive3d.cxx | 44 +- drawinglayer/source/primitive3d/sdrprimitive3d.cxx | 16 +- .../source/primitive3d/sdrsphereprimitive3d.cxx | 38 +- .../source/primitive3d/textureprimitive3d.cxx | 28 +- .../source/processor2d/canvasprocessor.cxx | 141 +++--- .../source/processor2d/contourextractor2d.cxx | 10 +- .../source/processor2d/hittestprocessor2d.cxx | 29 +- .../source/processor2d/vclhelperbufferdevice.cxx | 4 +- .../source/processor2d/vclhelperbufferdevice.hxx | 2 +- .../source/processor2d/vclhelpergradient.cxx | 2 +- .../source/processor2d/vclhelpergradient.hxx | 3 +- .../source/processor2d/vclmetafileprocessor2d.cxx | 262 ++++++------ .../source/processor2d/vclpixelprocessor2d.cxx | 76 ++-- drawinglayer/source/processor2d/vclprocessor2d.cxx | 41 +- .../source/processor3d/cutfindprocessor3d.cxx | 50 ++- .../source/processor3d/defaultprocessor3d.cxx | 10 +- .../source/processor3d/geometry2dextractor.cxx | 4 +- .../source/processor3d/shadow3dextractor.cxx | 4 +- .../source/processor3d/zbufferprocessor3d.cxx | 2 +- drawinglayer/source/texture/texture3d.cxx | 1 - svx/inc/svx/scene3d.hxx | 2 + svx/inc/svx/sdr/attribute/sdrallattribute.hxx | 202 --------- svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx | 80 ++++ svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx | 66 ++- .../sdr/attribute/sdrformtextoutlineattribute.hxx | 30 +- .../attribute/sdrlinefillshadowtextattribute.hxx | 81 ++++ .../sdr/attribute/sdrlineshadowtextattribute.hxx | 79 ++++ .../svx/sdr/attribute/sdrshadowtextattribute.hxx | 76 ++++ svx/inc/svx/sdr/attribute/sdrtextattribute.hxx | 107 +++-- svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx | 23 +- .../svx/sdr/contact/viewobjectcontactofgroup.hxx | 3 - .../svx/sdr/primitive2d/sdrattributecreator.hxx | 63 ++- .../svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx | 4 +- .../sdr/primitive2d/sdrconnectorprimitive2d.hxx | 4 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.hxx | 6 +- .../svx/sdr/primitive2d/sdrdecompositiontools.hxx | 18 +- .../svx/sdr/primitive2d/sdrellipseprimitive2d.hxx | 2 +- svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx | 3 +- .../svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx | 3 +- svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx | 3 +- svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx | 4 +- svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx | 5 - .../sdr/primitive2d/sdrrectangleprimitive2d.hxx | 4 +- svx/inc/svx/sdr/properties/oleproperties.hxx | 69 +++ svx/inc/svx/svdogrp.hxx | 1 + svx/prj/d.lst | 3 + svx/source/engine3d/dragmt3d.cxx | 27 +- svx/source/engine3d/scene3d.cxx | 6 + svx/source/engine3d/view3d.cxx | 6 +- svx/source/sdr/attribute/makefile.mk | 5 +- svx/source/sdr/attribute/sdrallattribute.cxx | 412 ------------------ svx/source/sdr/attribute/sdrfilltextattribute.cxx | 92 ++++ svx/source/sdr/attribute/sdrformtextattribute.cxx | 339 ++++++++++----- .../sdr/attribute/sdrformtextoutlineattribute.cxx | 143 ++++++- .../attribute/sdrlinefillshadowtextattribute.cxx | 95 +++++ .../sdr/attribute/sdrlineshadowtextattribute.cxx | 93 ++++ .../sdr/attribute/sdrshadowtextattribute.cxx | 85 ++++ svx/source/sdr/attribute/sdrtextattribute.cxx | 475 +++++++++++++++------ svx/source/sdr/contact/viewcontact.cxx | 3 +- svx/source/sdr/contact/viewcontactofe3d.cxx | 30 +- svx/source/sdr/contact/viewcontactofe3dcube.cxx | 19 +- svx/source/sdr/contact/viewcontactofe3dextrude.cxx | 22 +- svx/source/sdr/contact/viewcontactofe3dlathe.cxx | 24 +- svx/source/sdr/contact/viewcontactofe3dpolygon.cxx | 22 +- svx/source/sdr/contact/viewcontactofe3dscene.cxx | 117 ++--- svx/source/sdr/contact/viewcontactofe3dsphere.cxx | 20 +- svx/source/sdr/contact/viewcontactofgraphic.cxx | 236 +++++----- svx/source/sdr/contact/viewcontactofgroup.cxx | 26 +- .../contact/viewcontactofmasterpagedescriptor.cxx | 41 +- .../sdr/contact/viewcontactofsdrcaptionobj.cxx | 194 ++++----- svx/source/sdr/contact/viewcontactofsdrcircobj.cxx | 93 ++-- svx/source/sdr/contact/viewcontactofsdredgeobj.cxx | 43 +- .../sdr/contact/viewcontactofsdrmeasureobj.cxx | 149 +++---- .../sdr/contact/viewcontactofsdrmediaobj.cxx | 13 +- .../sdr/contact/viewcontactofsdrobjcustomshape.cxx | 181 ++++---- svx/source/sdr/contact/viewcontactofsdrole2obj.cxx | 93 ++-- svx/source/sdr/contact/viewcontactofsdrpage.cxx | 39 +- svx/source/sdr/contact/viewcontactofsdrpathobj.cxx | 163 ++++--- svx/source/sdr/contact/viewcontactofsdrrectobj.cxx | 97 ++--- svx/source/sdr/contact/viewcontactofunocontrol.cxx | 45 +- svx/source/sdr/contact/viewcontactofvirtobj.cxx | 41 +- svx/source/sdr/contact/viewobjectcontactofe3d.cxx | 1 - .../sdr/contact/viewobjectcontactofe3dscene.cxx | 11 - .../sdr/contact/viewobjectcontactofgroup.cxx | 14 - .../sdr/contact/viewobjectcontactofpageobj.cxx | 25 +- .../sdr/contact/viewobjectcontactofsdrole2obj.cxx | 8 +- svx/source/sdr/overlay/overlayobjectcell.cxx | 8 +- svx/source/sdr/overlay/overlayselection.cxx | 10 +- svx/source/sdr/primitive2d/sdrattributecreator.cxx | 407 +++++++----------- .../sdr/primitive2d/sdrcaptionprimitive2d.cxx | 67 ++- .../sdr/primitive2d/sdrconnectorprimitive2d.cxx | 44 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.cxx | 27 +- .../sdr/primitive2d/sdrdecompositiontools.cxx | 58 +-- .../sdr/primitive2d/sdrellipseprimitive2d.cxx | 116 +++-- svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 66 ++- .../sdr/primitive2d/sdrmeasureprimitive2d.cxx | 130 +++--- svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 64 ++- .../sdr/primitive2d/sdrolecontentprimitive2d.cxx | 2 +- svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx | 67 +-- svx/source/sdr/primitive2d/sdrprimitivetools.cxx | 17 - .../sdr/primitive2d/sdrrectangleprimitive2d.cxx | 59 +-- .../sdr/primitive3d/sdrattributecreator3d.cxx | 5 +- svx/source/sdr/properties/oleproperties.cxx | 80 ++++ svx/source/svdraw/svddrgmt.cxx | 44 +- svx/source/svdraw/svdedtv.cxx | 97 ++++- svx/source/svdraw/svdocapt.cxx | 2 +- svx/source/svdraw/svdogrp.cxx | 6 + svx/source/svdraw/svdopath.cxx | 12 +- svx/source/svdraw/svdotextpathdecomposition.cxx | 78 ++-- svx/source/table/tablehandles.cxx | 7 +- svx/source/table/viewcontactoftableobj.cxx | 124 ++++-- 235 files changed, 10486 insertions(+), 5907 deletions(-) delete mode 100644 drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx delete mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx delete mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx create mode 100644 drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx delete mode 100644 drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx create mode 100644 drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx delete mode 100644 drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx create mode 100644 drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx create mode 100644 drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx delete mode 100644 drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx create mode 100644 drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx create mode 100644 drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx delete mode 100644 drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx delete mode 100644 drawinglayer/source/attribute/fillattribute.cxx create mode 100644 drawinglayer/source/attribute/fillgradientattribute.cxx create mode 100644 drawinglayer/source/attribute/fillhatchattribute.cxx delete mode 100644 drawinglayer/source/attribute/sdrattribute.cxx delete mode 100644 drawinglayer/source/attribute/sdrattribute3d.cxx create mode 100644 drawinglayer/source/attribute/sdrfillattribute.cxx create mode 100644 drawinglayer/source/attribute/sdrlightattribute3d.cxx create mode 100644 drawinglayer/source/attribute/sdrlightingattribute3d.cxx create mode 100644 drawinglayer/source/attribute/sdrlineattribute.cxx create mode 100644 drawinglayer/source/attribute/sdrlinestartendattribute.cxx create mode 100644 drawinglayer/source/attribute/sdrobjectattribute3d.cxx create mode 100644 drawinglayer/source/attribute/sdrsceneattribute3d.cxx create mode 100644 drawinglayer/source/attribute/sdrshadowattribute.cxx delete mode 100644 drawinglayer/source/primitive2d/alphaprimitive2d.cxx create mode 100644 drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx delete mode 100644 drawinglayer/source/primitive2d/hittestprimitive2d.cxx create mode 100644 drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx create mode 100644 drawinglayer/source/primitive2d/transparenceprimitive2d.cxx delete mode 100644 drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx create mode 100644 drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx create mode 100644 drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx delete mode 100644 drawinglayer/source/primitive3d/hittestprimitive3d.cxx delete mode 100644 svx/inc/svx/sdr/attribute/sdrallattribute.hxx create mode 100644 svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx create mode 100644 svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx create mode 100644 svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx create mode 100644 svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx create mode 100644 svx/inc/svx/sdr/properties/oleproperties.hxx delete mode 100644 svx/source/sdr/attribute/sdrallattribute.cxx create mode 100644 svx/source/sdr/attribute/sdrfilltextattribute.cxx create mode 100644 svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx create mode 100644 svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx create mode 100644 svx/source/sdr/attribute/sdrshadowtextattribute.cxx create mode 100644 svx/source/sdr/properties/oleproperties.cxx diff --git a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx deleted file mode 100644 index c5c884c312..0000000000 --- a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx +++ /dev/null @@ -1,138 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: fillattribute.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_ATTRIBUTE_FILLATTRIBUTE_HXX -#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX - -#include - -////////////////////////////////////////////////////////////////////////////// -// predefines -class XHatch; - -namespace drawinglayer -{ - namespace attribute - { - enum GradientStyle - { - GRADIENTSTYLE_LINEAR, - GRADIENTSTYLE_AXIAL, - GRADIENTSTYLE_RADIAL, - GRADIENTSTYLE_ELLIPTICAL, - GRADIENTSTYLE_SQUARE, - GRADIENTSTYLE_RECT - }; - - enum HatchStyle - { - HATCHSTYLE_SINGLE, - HATCHSTYLE_DOUBLE, - HATCHSTYLE_TRIPLE - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class FillGradientAttribute - { - basegfx::BColor maStartColor; - basegfx::BColor maEndColor; - double mfBorder; - double mfOffsetX; - double mfOffsetY; - double mfAngle; - GradientStyle meStyle; - sal_uInt16 mnSteps; - - public: - FillGradientAttribute( - GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY, double fAngle, - const basegfx::BColor& rStartColor, const basegfx::BColor& rEndColor, sal_uInt16 nSteps); - bool operator==(const FillGradientAttribute& rCandidate) const; - - // data access - const basegfx::BColor& getStartColor() const { return maStartColor; } - const basegfx::BColor& getEndColor() const { return maEndColor; } - double getBorder() const { return mfBorder; } - double getOffsetX() const { return mfOffsetX; } - double getOffsetY() const { return mfOffsetY; } - double getAngle() const { return mfAngle; } - GradientStyle getStyle() const { return meStyle; } - sal_uInt16 getSteps() const { return mnSteps; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class FillHatchAttribute - { - double mfDistance; - double mfAngle; - basegfx::BColor maColor; - HatchStyle meStyle; - - // bitfield - unsigned mbFillBackground : 1; - - public: - FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground); - bool operator==(const FillHatchAttribute& rCandidate) const; - - // data access - double getDistance() const { return mfDistance; } - double getAngle() const { return mfAngle; } - const basegfx::BColor& getColor() const { return maColor; } - HatchStyle getStyle() const { return meStyle; } - bool isFillBackground() const { return mbFillBackground; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX - -// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx index f0b36d4501..42a89d3d48 100644 --- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx @@ -36,18 +36,22 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX -#include -#include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines +class BitmapEx; + namespace basegfx { - class B2DRange; - class BColor; + class B2DPoint; + class B2DVector; } +namespace drawinglayer { namespace attribute { + class ImpFillBitmapAttribute; +}} + ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer @@ -56,26 +60,32 @@ namespace drawinglayer { class FillBitmapAttribute { - BitmapEx maBitmapEx; - basegfx::B2DPoint maTopLeft; - basegfx::B2DVector maSize; - - // bitfield - unsigned mbTiling : 1; + private: + ImpFillBitmapAttribute* mpFillBitmapAttribute; public: + /// constructors/assignmentoperator/destructor FillBitmapAttribute( const BitmapEx& rBitmapEx, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling); + FillBitmapAttribute(); + FillBitmapAttribute(const FillBitmapAttribute& rCandidate); + FillBitmapAttribute& operator=(const FillBitmapAttribute& rCandidate); + ~FillBitmapAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator bool operator==(const FillBitmapAttribute& rCandidate) const; - // data access - 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; } + // data read access + const BitmapEx& getBitmapEx() const; + const basegfx::B2DPoint& getTopLeft() const; + const basegfx::B2DVector& getSize() const; + bool getTiling() const; }; } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx new file mode 100644 index 0000000000..7b1faf3da8 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: fillattribute.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_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; +} + +namespace drawinglayer { namespace attribute { + class ImpFillGradientAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// +// declarations + +namespace drawinglayer +{ + namespace attribute + { + enum GradientStyle + { + GRADIENTSTYLE_LINEAR, + GRADIENTSTYLE_AXIAL, + GRADIENTSTYLE_RADIAL, + GRADIENTSTYLE_ELLIPTICAL, + GRADIENTSTYLE_SQUARE, + GRADIENTSTYLE_RECT + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class FillGradientAttribute + { + private: + ImpFillGradientAttribute* mpFillGradientAttribute; + + public: + /// constructors/assignmentoperator/destructor + FillGradientAttribute( + GradientStyle eStyle, + double fBorder, + double fOffsetX, + double fOffsetY, + double fAngle, + const basegfx::BColor& rStartColor, + const basegfx::BColor& rEndColor, + sal_uInt16 nSteps); + FillGradientAttribute(); + FillGradientAttribute(const FillGradientAttribute& rCandidate); + FillGradientAttribute& operator=(const FillGradientAttribute& rCandidate); + ~FillGradientAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const FillGradientAttribute& rCandidate) const; + + // data read access + GradientStyle getStyle() const; + double getBorder() const; + double getOffsetX() const; + double getOffsetY() const; + double getAngle() const; + const basegfx::BColor& getStartColor() const; + const basegfx::BColor& getEndColor() const; + sal_uInt16 getSteps() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx new file mode 100644 index 0000000000..7356092ca2 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: fillattribute.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_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; +} + +namespace drawinglayer { namespace attribute { + class ImpFillHatchAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// +// declarations + +namespace drawinglayer +{ + namespace attribute + { + enum HatchStyle + { + HATCHSTYLE_SINGLE, + HATCHSTYLE_DOUBLE, + HATCHSTYLE_TRIPLE + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class FillHatchAttribute + { + private: + ImpFillHatchAttribute* mpFillHatchAttribute; + + public: + /// constructors/assignmentoperator/destructor + FillHatchAttribute( + HatchStyle eStyle, + double fDistance, + double fAngle, + const basegfx::BColor& rColor, + bool bFillBackground); + FillHatchAttribute(); + FillHatchAttribute(const FillHatchAttribute& rCandidate); + FillHatchAttribute& operator=(const FillHatchAttribute& rCandidate); + ~FillHatchAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const FillHatchAttribute& rCandidate) const; + + // data read access + HatchStyle getStyle() const; + double getDistance() const; + double getAngle() const; + const basegfx::BColor& getColor() const; + bool isFillBackground() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx index f4c438eaa1..6a6cbe26be 100644 --- a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx @@ -36,9 +36,16 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX -#include #include -#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +class String; + +namespace drawinglayer { namespace attribute { + class ImpFontAttribute; +}} ////////////////////////////////////////////////////////////////////////////// @@ -54,22 +61,11 @@ namespace drawinglayer 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 + ImpFontAttribute* mpFontAttribute; public: - /// constructor + /// constructors/assignmentoperator/destructor + /// TODO: pair kerning and CJK kerning FontAttribute( const String& rFamilyName, const String& rStyleName, @@ -79,45 +75,28 @@ namespace drawinglayer 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) - { - } + bool bBiDiStrong = false); + FontAttribute(); + FontAttribute(const FontAttribute& rCandidate); + FontAttribute& operator=(const FontAttribute& rCandidate); + ~FontAttribute(); - FontAttribute() - : maFamilyName(), - maStyleName(), - mnWeight(0), - mbSymbol(false), - mbVertical(false), - mbItalic(false), - mbOutline(false), - mbRTL(false), - mbBiDiStrong(false) - { - } + // checks if the incarnation is default constructed + bool isDefault() const; - /// compare operator - bool operator==(const FontAttribute& rCompare) const; + // compare operator + bool operator==(const FontAttribute& rCandidate) 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; } + const String& getFamilyName() const; + const String& getStyleName() const; + sal_uInt16 getWeight() const; + bool getSymbol() const; + bool getVertical() const; + bool getItalic() const; + bool getOutline() const; + bool getRTL() const; + bool getBiDiStrong() const; }; } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx index 1b98f7c18c..3ef055355b 100644 --- a/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx @@ -36,13 +36,19 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX -#include -#include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines +namespace basegfx { + class BColor; +} + +namespace drawinglayer { namespace attribute { + class ImpLineAttribute; +}} + ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer @@ -52,50 +58,29 @@ namespace drawinglayer class LineAttribute { private: - basegfx::BColor maColor; // color - double mfWidth; // absolute line width - basegfx::B2DLineJoin meLineJoin; // type of LineJoin + ImpLineAttribute* mpLineAttribute; public: + /// constructors/assignmentoperator/destructor LineAttribute( const basegfx::BColor& rColor, double fWidth = 0.0, - basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND) - : maColor(rColor), - mfWidth(fWidth), - meLineJoin(aB2DLineJoin) - { - } - - LineAttribute(const LineAttribute& rCandidate) - { - *this = rCandidate; - } - - LineAttribute& operator=(const LineAttribute& rCandidate) - { - maColor = rCandidate.maColor; - mfWidth = rCandidate.mfWidth; - meLineJoin = rCandidate.meLineJoin; - return *this; - } + basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND); + LineAttribute(); + LineAttribute(const LineAttribute& rCandidate); + LineAttribute& operator=(const LineAttribute& rCandidate); + ~LineAttribute(); - ~LineAttribute() - { - } + // checks if the incarnation is default constructed + bool isDefault() const; // compare operator - bool operator==(const LineAttribute& rCandidate) const - { - return (maColor == rCandidate.maColor - && mfWidth == rCandidate.mfWidth - && meLineJoin == rCandidate.meLineJoin); - } + bool operator==(const LineAttribute& rCandidate) const; - // data access - const basegfx::BColor& getColor() const { return maColor; } - double getWidth() const { return mfWidth; } - basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; } + // data read access + const basegfx::BColor& getColor() const; + double getWidth() const; + basegfx::B2DLineJoin getLineJoin() const; }; } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx index 6cf75bdd76..559d4f179a 100644 --- a/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx @@ -36,12 +36,19 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX -#include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines +namespace basegfx { + class B2DPolyPolygon; +} + +namespace drawinglayer { namespace attribute { + class ImpLineStartEndAttribute; +}} + ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer @@ -51,35 +58,29 @@ namespace drawinglayer class LineStartEndAttribute { private: - double mfWidth; // absolute line StartEndGeometry base width - basegfx::B2DPolyPolygon maPolyPolygon; // the StartEndGeometry PolyPolygon - - // bitfield - unsigned mbCentered : 1; // use centered to ineStart/End point? + ImpLineStartEndAttribute* mpLineStartEndAttribute; public: + /// constructors/assignmentoperator/destructor LineStartEndAttribute( double fWidth, const basegfx::B2DPolyPolygon& rPolyPolygon, - bool bCentered) - : mfWidth(fWidth), - maPolyPolygon(rPolyPolygon), - mbCentered(bCentered) - { - } + bool bCentered); + LineStartEndAttribute(); + LineStartEndAttribute(const LineStartEndAttribute& rCandidate); + LineStartEndAttribute& operator=(const LineStartEndAttribute& rCandidate); + ~LineStartEndAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; // compare operator - bool operator==(const LineStartEndAttribute& rCandidate) const - { - return (basegfx::fTools::equal(mfWidth, rCandidate.mfWidth) - && maPolyPolygon == rCandidate.maPolyPolygon - && mbCentered == rCandidate.mbCentered); - } + bool operator==(const LineStartEndAttribute& rCandidate) const; - // data access - double getWidth() const { return mfWidth; } - const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } - bool isCentered() const { return mbCentered; } + // data read access + double getWidth() const; + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const; + bool isCentered() const; bool isActive() const; }; } // end of namespace attribute diff --git a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx index 0d226dbd88..756b0a42f5 100644 --- a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx @@ -62,7 +62,11 @@ namespace drawinglayer public: // constructors/destructor - MaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity); + MaterialAttribute3D( + const basegfx::BColor& rColor, + const basegfx::BColor& rSpecular, + const basegfx::BColor& rEmission, + sal_uInt16 nSpecularIntensity); MaterialAttribute3D(const basegfx::BColor& rColor); MaterialAttribute3D(); MaterialAttribute3D(const MaterialAttribute3D& rCandidate); @@ -71,11 +75,13 @@ namespace drawinglayer // assignment operator MaterialAttribute3D& operator=(const MaterialAttribute3D& rCandidate); + // checks if the incarnation is default constructed + bool isDefault() const; + // compare operator bool operator==(const MaterialAttribute3D& rCandidate) const; - bool operator!=(const MaterialAttribute3D& rCandidate) const { return !operator==(rCandidate); } - // data access + // data read access const basegfx::BColor& getColor() const; const basegfx::BColor& getSpecular() const; const basegfx::BColor& getEmission() const; diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx index d56d16438b..e9797ba828 100644 --- a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx @@ -36,57 +36,53 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX +#include +#include +#include +#include +#include +#include + ////////////////////////////////////////////////////////////////////////////// // predefines -namespace drawinglayer { namespace attribute { - class SdrLineAttribute; - class SdrFillAttribute; - class SdrLineStartEndAttribute; - class SdrShadowAttribute; - class FillGradientAttribute; -}} - ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace attribute { - class SdrLineFillShadowAttribute + class SdrLineFillShadowAttribute3D { - // shadow, line, lineStartEnd, fill, transGradient and compound3D attributes - SdrShadowAttribute* mpShadow; // shadow attributes (if used) - SdrLineAttribute* mpLine; // line attributes (if used) - SdrLineStartEndAttribute* mpLineStartEnd; // line start end (if used) - SdrFillAttribute* mpFill; // fill attributes (if used) - FillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used) + private: + const SdrLineAttribute maLine; + const SdrFillAttribute maFill; + const SdrLineStartEndAttribute maLineStartEnd; + const SdrShadowAttribute maShadow; + const FillGradientAttribute maFillFloatTransGradient; public: - SdrLineFillShadowAttribute( - SdrLineAttribute* pLine = 0, - SdrFillAttribute* pFill = 0, - SdrLineStartEndAttribute* pLineStartEnd = 0, - SdrShadowAttribute* pShadow = 0, - FillGradientAttribute* pFillFloatTransGradient = 0); - ~SdrLineFillShadowAttribute(); + /// constructors/assignmentoperator/destructor + SdrLineFillShadowAttribute3D( + const SdrLineAttribute& rLine, + const SdrFillAttribute& rFill, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const FillGradientAttribute& rFillFloatTransGradient); + SdrLineFillShadowAttribute3D(); - // copy constructor and assigment operator - SdrLineFillShadowAttribute(const SdrLineFillShadowAttribute& rCandidate); - SdrLineFillShadowAttribute& operator=(const SdrLineFillShadowAttribute& rCandidate); + // checks if the incarnation is default constructed + bool isDefault() const; // compare operator - bool operator==(const SdrLineFillShadowAttribute& rCandidate) const; - - // bool access - bool isVisible() const { return (mpFill || mpLine); } + bool operator==(const SdrLineFillShadowAttribute3D& rCandidate) const; - // data access - const SdrShadowAttribute* getShadow() const { return mpShadow; } - const SdrLineAttribute* getLine() const { return mpLine; } - const SdrLineStartEndAttribute* getLineStartEnd() const { return mpLineStartEnd; } - const SdrFillAttribute* getFill() const { return mpFill; } - const FillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; } + // data read access + const SdrLineAttribute& getLine() const { return maLine; } + const SdrFillAttribute& getFill() const { return maFill; } + const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; } + const SdrShadowAttribute& getShadow() const { return maShadow; } + const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; } }; } // end of namespace overlay } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx deleted file mode 100644 index dbbd116775..0000000000 --- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx +++ /dev/null @@ -1,223 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: sdrattribute.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_ATTRIBUTE_SDRATTRIBUTE_HXX -#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX - -#include -#include -#include -#include - -////////////////////////////////////////////////////////////////////////////// -// predefines -class SdrTextObj; - -namespace drawinglayer { namespace attribute { - class SdrFillBitmapAttribute; - class FillHatchAttribute; - class FillGradientAttribute; -}} - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrLineAttribute - { - // line definitions - basegfx::B2DLineJoin meJoin; // B2DLINEJOIN_* defines - double mfWidth; // 1/100th mm, 0.0==hair - double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. - basegfx::BColor maColor; // color of line - ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern - double mfFullDotDashLen; // sum of maDotDashArray (for convenience) - - public: - SdrLineAttribute( - basegfx::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor, - const ::std::vector< double >& rDotDashArray, double fFullDotDashLen); - ~SdrLineAttribute(); - - // constructor to create a line attribute for a colored hairline - SdrLineAttribute(const basegfx::BColor& rColor); - - // compare operator - bool operator==(const SdrLineAttribute& rCandidate) const; - - // bool access - bool isVisible() const { return (1.0 != mfTransparence); } - bool isDashed() const { return (0L != maDotDashArray.size()); } - - // data access - basegfx::B2DLineJoin getJoin() const { return meJoin; } - double getWidth() const { return mfWidth; } - double getTransparence() const { return mfTransparence; } - const basegfx::BColor& getColor() const { return maColor; } - const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; } - double getFullDotDashLen() const { return mfFullDotDashLen; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrLineStartEndAttribute - { - // line arrow definitions - basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon - basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon - double mfStartWidth; // 1/100th mm - double mfEndWidth; // 1/100th mm - - // bitfield - unsigned mbStartActive : 1L; // start of Line is active - unsigned mbEndActive : 1L; // end of Line is active - unsigned mbStartCentered : 1L; // Line is centered on line start point - unsigned mbEndCentered : 1L; // Line is centered on line end point - - public: - SdrLineStartEndAttribute( - const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon, - double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered); - ~SdrLineStartEndAttribute(); - - // compare operator - bool operator==(const SdrLineStartEndAttribute& rCandidate) const; - - // bool access - bool isStartActive() const { return mbStartActive; } - bool isEndActive() const { return mbEndActive; } - bool isStartCentered() const { return mbStartCentered; } - bool isEndCentered() const { return mbEndCentered; } - bool isVisible() const { return (isStartActive() || isEndActive()); } - - // data access - const basegfx::B2DPolyPolygon& getStartPolyPolygon() const { return maStartPolyPolygon; } - const basegfx::B2DPolyPolygon& getEndPolyPolygon() const { return maEndPolyPolygon; } - double getStartWidth() const { return mfStartWidth; } - double getEndWidth() const { return mfEndWidth; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrShadowAttribute - { - // shadow definitions - basegfx::B2DVector maOffset; // shadow offset 1/100th mm - double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. - basegfx::BColor maColor; // color of shadow - - public: - SdrShadowAttribute( - const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor); - ~SdrShadowAttribute(); - - // compare operator - bool operator==(const SdrShadowAttribute& rCandidate) const; - - // bool access - bool isVisible() const { return (1.0 != mfTransparence); } - - // data access - const basegfx::B2DVector& getOffset() const { return maOffset; } - double getTransparence() const { return mfTransparence; } - const basegfx::BColor& getColor() const { return maColor; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrFillAttribute - { - // fill definitions - double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. - basegfx::BColor maColor; // fill color - FillGradientAttribute* mpGradient; // fill gradient (if used) - FillHatchAttribute* mpHatch; // fill hatch (if used) - SdrFillBitmapAttribute* mpBitmap; // fill bitmap (if used) - - public: - SdrFillAttribute( - double fTransparence, const basegfx::BColor& rColor, FillGradientAttribute* pGradient = 0L, - FillHatchAttribute* pHatch = 0L, SdrFillBitmapAttribute* pBitmap = 0L); - ~SdrFillAttribute(); - - // copy constructor and assigment operator - SdrFillAttribute(const SdrFillAttribute& rCandidate); - SdrFillAttribute& operator=(const SdrFillAttribute& rCandidate); - - // compare operator - bool operator==(const SdrFillAttribute& rCandidate) const; - - // bool access - bool isGradient() const { return (0L != mpGradient); } - bool isHatch() const { return (0L != mpHatch); } - bool isBitmap() const { return (0L != mpBitmap); } - bool isColor() const { return (!mpGradient && !mpHatch && !mpBitmap); } - bool isVisible() const { return (1.0 != mfTransparence); } - - // data access - double getTransparence() const { return mfTransparence; } - const basegfx::BColor& getColor() const { return maColor; } - const FillGradientAttribute* getGradient() const { return mpGradient; } - const FillHatchAttribute* getHatch() const { return mpHatch; } - const SdrFillBitmapAttribute* getBitmap() const { return mpBitmap; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX - -// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx deleted file mode 100644 index d4693aa778..0000000000 --- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx +++ /dev/null @@ -1,217 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: sdrattribute3d.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_ATTRIBUTE_SDRATTRIBUTE3D_HXX -#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -////////////////////////////////////////////////////////////////////////////// -// predefines - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class Sdr3DObjectAttribute - { - // 3D object attribute definitions - ::com::sun::star::drawing::NormalsKind maNormalsKind; // normals type (0..2) - ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionX; // texture projection type X (0..2) - ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionY; // texture projection type Y (0..2) - ::com::sun::star::drawing::TextureKind2 maTextureKind; // texture kind (see uno API) - ::com::sun::star::drawing::TextureMode maTextureMode; // texture kind (see uno API) - MaterialAttribute3D maMaterial; // object, specular and emissive colors, SpecularIntensity - - // bitfield - unsigned mbNormalsInvert : 1; // invert normals - unsigned mbDoubleSided : 1; // surfaces are double sided - unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene - unsigned mbTextureFilter : 1; // filter texture to make more smooth - unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific) - - public: - Sdr3DObjectAttribute( - ::com::sun::star::drawing::NormalsKind aNormalsKind, - ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX, - ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY, - ::com::sun::star::drawing::TextureKind2 aTextureKind, - ::com::sun::star::drawing::TextureMode aTextureMode, - const MaterialAttribute3D& rMaterial, - bool bNormalsInvert, - bool bDoubleSided, - bool bShadow3D, - bool bTextureFilter, - bool bReducedLineGeometry); - - // compare operator - bool operator==(const Sdr3DObjectAttribute& rCandidate) const; - - // data access - ::com::sun::star::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; } - ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const { return maTextureProjectionX; } - ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const { return maTextureProjectionY; } - ::com::sun::star::drawing::TextureKind2 getTextureKind() const { return maTextureKind; } - ::com::sun::star::drawing::TextureMode getTextureMode() const { return maTextureMode; } - const MaterialAttribute3D& getMaterial() const { return maMaterial; } - bool getNormalsInvert() const { return mbNormalsInvert; } - bool getDoubleSided() const { return mbDoubleSided; } - bool getShadow3D() const { return mbShadow3D; } - bool getTextureFilter() const { return mbTextureFilter; } - bool getReducedLineGeometry() const { return mbReducedLineGeometry; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class Sdr3DLightAttribute - { - // 3D light attribute definitions - basegfx::BColor maColor; - basegfx::B3DVector maDirection; - - // bitfield - unsigned mbSpecular : 1; - - public: - Sdr3DLightAttribute( - const basegfx::BColor& rColor, - const basegfx::B3DVector& rDirection, - bool bSpecular); - - // compare operator - bool operator==(const Sdr3DLightAttribute& rCandidate) const; - - // data access - const basegfx::BColor& getColor() const { return maColor; } - const basegfx::B3DVector& getDirection() const { return maDirection; } - bool getSpecular() const { return mbSpecular; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrLightingAttribute - { - // 3D light attribute definitions - basegfx::BColor maAmbientLight; - ::std::vector< Sdr3DLightAttribute > maLightVector; - - public: - SdrLightingAttribute( - const basegfx::BColor& rAmbientLight, - const ::std::vector< Sdr3DLightAttribute >& rLightVector); - - // compare operator - bool operator==(const SdrLightingAttribute& rCandidate) const; - - // data access - const basegfx::BColor& getAmbientLight() const { return maAmbientLight; } - const ::std::vector< Sdr3DLightAttribute >& getLightVector() const { return maLightVector; } - - // color model solver - basegfx::BColor solveColorModel( - const basegfx::B3DVector& rNormalInEyeCoordinates, - const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, - const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const; - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrSceneAttribute - { - // 3D scene attribute definitions - double mfDistance; - double mfShadowSlant; - ::com::sun::star::drawing::ProjectionMode maProjectionMode; - ::com::sun::star::drawing::ShadeMode maShadeMode; - - // bitfield - unsigned mbTwoSidedLighting : 1; - - public: - SdrSceneAttribute( - double fDistance, - double fShadowSlant, - ::com::sun::star::drawing::ProjectionMode aProjectionMode, - ::com::sun::star::drawing::ShadeMode aShadeMode, - bool bTwoSidedLighting); - - // compare operator - bool operator==(const SdrSceneAttribute& rCandidate) const; - - // data access - double getDistance() const { return mfDistance; } - double getShadowSlant() const { return mfShadowSlant; } - ::com::sun::star::drawing::ProjectionMode getProjectionMode() const { return maProjectionMode; } - ::com::sun::star::drawing::ShadeMode getShadeMode() const { return maShadeMode; } - bool getTwoSidedLighting() const { return mbTwoSidedLighting; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX - -// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx new file mode 100644 index 0000000000..c0eef0e57e --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.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_ATTRIBUTE_SDRFILLATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; +} + +namespace drawinglayer { namespace attribute { + class ImpSdrFillAttribute; + class FillGradientAttribute; + class FillHatchAttribute; + class SdrFillBitmapAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrFillAttribute + { + private: + ImpSdrFillAttribute* mpSdrFillAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrFillAttribute( + double fTransparence, + const basegfx::BColor& rColor, + const FillGradientAttribute& rGradient, + const FillHatchAttribute& rHatch, + const SdrFillBitmapAttribute& rBitmap); + SdrFillAttribute(); + SdrFillAttribute(const SdrFillAttribute& rCandidate); + SdrFillAttribute& operator=(const SdrFillAttribute& rCandidate); + ~SdrFillAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrFillAttribute& rCandidate) const; + + // data read access + double getTransparence() const; + const basegfx::BColor& getColor() const; + const FillGradientAttribute& getGradient() const; + const FillHatchAttribute& getHatch() const; + const SdrFillBitmapAttribute& getBitmap() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx index b6214cda46..d04f233110 100644 --- a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx @@ -36,21 +36,23 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX -#include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines -class SfxItemSet; -namespace drawinglayer { namespace attribute { - class FillBitmapAttribute; -}} +class Bitmap; namespace basegfx { class B2DRange; + class B2DVector; } +namespace drawinglayer { namespace attribute { + class FillBitmapAttribute; + class ImpSdrFillBitmapAttribute; +}} + ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer @@ -59,27 +61,42 @@ namespace drawinglayer { class SdrFillBitmapAttribute { - Bitmap maBitmap; - basegfx::B2DVector maSize; - basegfx::B2DVector maOffset; - basegfx::B2DVector maOffsetPosition; - basegfx::B2DVector maRectPoint; - - // bitfield - unsigned mbTiling : 1; - unsigned mbStretch : 1; - unsigned mbLogSize : 1; + private: + ImpSdrFillBitmapAttribute* mpSdrFillBitmapAttribute; public: + /// constructors/assignmentoperator/destructor SdrFillBitmapAttribute( - const Bitmap& rBitmap, const basegfx::B2DVector& rSize, const basegfx::B2DVector& rOffset, - const basegfx::B2DVector& rOffsetPosition, const basegfx::B2DVector& rRectPoint, - bool bTiling, bool bStretch, bool bLogSize); + const Bitmap& rBitmap, + const basegfx::B2DVector& rSize, + const basegfx::B2DVector& rOffset, + const basegfx::B2DVector& rOffsetPosition, + const basegfx::B2DVector& rRectPoint, + bool bTiling, + bool bStretch, + bool bLogSize); + SdrFillBitmapAttribute(); + SdrFillBitmapAttribute(const SdrFillBitmapAttribute& rCandidate); + SdrFillBitmapAttribute& operator=(const SdrFillBitmapAttribute& rCandidate); + ~SdrFillBitmapAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator bool operator==(const SdrFillBitmapAttribute& rCandidate) const; - // data access - const Bitmap& getBitmap() const { return maBitmap; } - bool getTiling() const { return mbTiling; } + // data read access + const Bitmap& getBitmap() const; + const basegfx::B2DVector& getSize() const; + const basegfx::B2DVector& getOffset() const; + const basegfx::B2DVector& getOffsetPosition() const; + const basegfx::B2DVector& getRectPoint() const; + bool getTiling() const; + bool getStretch() const; + bool getLogSize() const; + + // FillBitmapAttribute generator FillBitmapAttribute getFillBitmapAttribute(const basegfx::B2DRange& rRange) const; }; } // end of namespace attribute diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx new file mode 100644 index 0000000000..8fc5ff961d --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.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_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; + class B3DVector; +} + +namespace drawinglayer { namespace attribute { + class ImpSdr3DLightAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class Sdr3DLightAttribute + { + private: + ImpSdr3DLightAttribute* mpSdr3DLightAttribute; + + public: + // constructors/destructor + Sdr3DLightAttribute( + const basegfx::BColor& rColor, + const basegfx::B3DVector& rDirection, + bool bSpecular); + Sdr3DLightAttribute(const basegfx::BColor& rColor); + Sdr3DLightAttribute(); + Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate); + ~Sdr3DLightAttribute(); + + // assignment operator + Sdr3DLightAttribute& operator=(const Sdr3DLightAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const Sdr3DLightAttribute& rCandidate) const; + + // data read access + const basegfx::BColor& getColor() const; + const basegfx::B3DVector& getDirection() const; + bool getSpecular() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx new file mode 100644 index 0000000000..5c6ebb4cf5 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.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_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX + +#include +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; + class B3DVector; +} + +namespace drawinglayer { namespace attribute { + class ImpSdrLightingAttribute; + class Sdr3DLightAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrLightingAttribute + { + private: + ImpSdrLightingAttribute* mpSdrLightingAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrLightingAttribute( + const basegfx::BColor& rAmbientLight, + const ::std::vector< Sdr3DLightAttribute >& rLightVector); + SdrLightingAttribute(); + SdrLightingAttribute(const SdrLightingAttribute& rCandidate); + SdrLightingAttribute& operator=(const SdrLightingAttribute& rCandidate); + ~SdrLightingAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLightingAttribute& rCandidate) const; + + // data read access + const basegfx::BColor& getAmbientLight() const; + const ::std::vector< Sdr3DLightAttribute >& getLightVector() const; + + // color model solver + basegfx::BColor solveColorModel( + const basegfx::B3DVector& rNormalInEyeCoordinates, + const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, + const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx new file mode 100644 index 0000000000..aa21bf75ca --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.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_ATTRIBUTE_SDRLINEATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX + +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; +} + +namespace drawinglayer { namespace attribute { + class ImpSdrLineAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineAttribute + { + private: + ImpSdrLineAttribute* mpSdrLineAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrLineAttribute( + basegfx::B2DLineJoin eJoin, + double fWidth, + double fTransparence, + const basegfx::BColor& rColor, + const ::std::vector< double >& rDotDashArray, + double fFullDotDashLen); + SdrLineAttribute(const basegfx::BColor& rColor); + SdrLineAttribute(); + SdrLineAttribute(const SdrLineAttribute& rCandidate); + SdrLineAttribute& operator=(const SdrLineAttribute& rCandidate); + ~SdrLineAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineAttribute& rCandidate) const; + + // data access + basegfx::B2DLineJoin getJoin() const; + double getWidth() const; + double getTransparence() const; + const basegfx::BColor& getColor() const; + const ::std::vector< double >& getDotDashArray() const; + double getFullDotDashLen() const; + + // bool access + bool isDashed() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx new file mode 100644 index 0000000000..93b5046a44 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.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_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class B2DPolyPolygon; +} + +namespace drawinglayer { namespace attribute { + class ImpSdrLineStartEndAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineStartEndAttribute + { + private: + ImpSdrLineStartEndAttribute* mpSdrLineStartEndAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrLineStartEndAttribute( + const basegfx::B2DPolyPolygon& rStartPolyPolygon, + const basegfx::B2DPolyPolygon& rEndPolyPolygon, + double fStartWidth, + double fEndWidth, + bool bStartActive, + bool bEndActive, + bool bStartCentered, + bool bEndCentered); + SdrLineStartEndAttribute(); + SdrLineStartEndAttribute(const SdrLineStartEndAttribute& rCandidate); + SdrLineStartEndAttribute& operator=(const SdrLineStartEndAttribute& rCandidate); + ~SdrLineStartEndAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineStartEndAttribute& rCandidate) const; + + // data read access + const basegfx::B2DPolyPolygon& getStartPolyPolygon() const; + const basegfx::B2DPolyPolygon& getEndPolyPolygon() const; + double getStartWidth() const; + double getEndWidth() const; + bool isStartActive() const; + bool isEndActive() const; + bool isStartCentered() const; + bool isEndCentered() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx new file mode 100644 index 0000000000..0e89198b9b --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.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_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX + +#include +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace drawinglayer { namespace attribute { + class ImpSdr3DObjectAttribute; + class MaterialAttribute3D; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class Sdr3DObjectAttribute + { + private: + ImpSdr3DObjectAttribute* mpSdr3DObjectAttribute; + + public: + // constructors/destructor + Sdr3DObjectAttribute( + ::com::sun::star::drawing::NormalsKind aNormalsKind, + ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX, + ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY, + ::com::sun::star::drawing::TextureKind2 aTextureKind, + ::com::sun::star::drawing::TextureMode aTextureMode, + const MaterialAttribute3D& rMaterial, + bool bNormalsInvert, + bool bDoubleSided, + bool bShadow3D, + bool bTextureFilter, + bool bReducedLineGeometry); + Sdr3DObjectAttribute(); + Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate); + ~Sdr3DObjectAttribute(); + + // assignment operator + Sdr3DObjectAttribute& operator=(const Sdr3DObjectAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const Sdr3DObjectAttribute& rCandidate) const; + + // data read access + ::com::sun::star::drawing::NormalsKind getNormalsKind() const; + ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const; + ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const; + ::com::sun::star::drawing::TextureKind2 getTextureKind() const; + ::com::sun::star::drawing::TextureMode getTextureMode() const; + const MaterialAttribute3D& getMaterial() const; + bool getNormalsInvert() const; + bool getDoubleSided() const; + bool getShadow3D() const; + bool getTextureFilter() const; + bool getReducedLineGeometry() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx new file mode 100644 index 0000000000..7b25b6c486 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.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_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX + +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace drawinglayer { namespace attribute { + class ImpSdrSceneAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrSceneAttribute + { + private: + ImpSdrSceneAttribute* mpSdrSceneAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrSceneAttribute( + double fDistance, + double fShadowSlant, + ::com::sun::star::drawing::ProjectionMode aProjectionMode, + ::com::sun::star::drawing::ShadeMode aShadeMode, + bool bTwoSidedLighting); + SdrSceneAttribute(); + SdrSceneAttribute(const SdrSceneAttribute& rCandidate); + SdrSceneAttribute& operator=(const SdrSceneAttribute& rCandidate); + ~SdrSceneAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrSceneAttribute& rCandidate) const; + + // data read access + double getDistance() const; + double getShadowSlant() const; + ::com::sun::star::drawing::ProjectionMode getProjectionMode() const; + ::com::sun::star::drawing::ShadeMode getShadeMode() const; + bool getTwoSidedLighting() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx new file mode 100644 index 0000000000..65f4fefb30 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.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_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; + class B2DVector; +} + +namespace drawinglayer { namespace attribute { + class ImpSdrShadowAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrShadowAttribute + { + private: + ImpSdrShadowAttribute* mpSdrShadowAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrShadowAttribute( + const basegfx::B2DVector& rOffset, + double fTransparence, + const basegfx::BColor& rColor); + SdrShadowAttribute(); + SdrShadowAttribute(const SdrShadowAttribute& rCandidate); + SdrShadowAttribute& operator=(const SdrShadowAttribute& rCandidate); + ~SdrShadowAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrShadowAttribute& rCandidate) const; + + // data access + const basegfx::B2DVector& getOffset() const; + double getTransparence() const; + const basegfx::BColor& getColor() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx index aa7facd6c7..e24ad09d3d 100644 --- a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx @@ -36,13 +36,16 @@ #ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX -#include -#include +#include #include ////////////////////////////////////////////////////////////////////////////// // predefines +namespace drawinglayer { namespace attribute { + class ImpStrokeAttribute; +}} + ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer @@ -52,49 +55,26 @@ namespace drawinglayer class StrokeAttribute { private: - ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern - double mfFullDotDashLen; // sum of maDotDashArray (for convenience) + ImpStrokeAttribute* mpStrokeAttribute; public: + /// constructors/assignmentoperator/destructor StrokeAttribute( const ::std::vector< double >& rDotDashArray, - double fFullDotDashLen = 0.0) - : maDotDashArray(rDotDashArray), - mfFullDotDashLen(fFullDotDashLen) - { - } - - StrokeAttribute() - : maDotDashArray(), - mfFullDotDashLen(0.0) - { - } - - StrokeAttribute(const StrokeAttribute& rCandidate) - { - *this = rCandidate; - } - - StrokeAttribute& operator=(const StrokeAttribute& rCandidate) - { - maDotDashArray = rCandidate.maDotDashArray; - mfFullDotDashLen = rCandidate.mfFullDotDashLen; - return *this; - } + double fFullDotDashLen = 0.0); + StrokeAttribute(); + StrokeAttribute(const StrokeAttribute& rCandidate); + StrokeAttribute& operator=(const StrokeAttribute& rCandidate); + ~StrokeAttribute(); - ~StrokeAttribute() - { - } + // checks if the incarnation is default constructed + bool isDefault() const; // compare operator - bool operator==(const StrokeAttribute& rCandidate) const - { - return (mfFullDotDashLen == rCandidate.mfFullDotDashLen - && maDotDashArray == rCandidate.maDotDashArray); - } + bool operator==(const StrokeAttribute& rCandidate) const; - // data access - const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; } + // data read access + const ::std::vector< double >& getDotDashArray() const; double getFullDotDashLen() const; }; } // end of namespace attribute diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx index 46cee65b8a..c9e2a96a63 100644 --- a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx +++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx @@ -122,12 +122,18 @@ namespace drawinglayer */ ViewInformation2D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters); + /// default (empty) constructor + ViewInformation2D(); + /// copy constructor ViewInformation2D(const ViewInformation2D& rCandidate); /// destructor ~ViewInformation2D(); + // checks if the incarnation is default constructed + bool isDefault() const; + /// assignment operator ViewInformation2D& operator=(const ViewInformation2D& rCandidate); diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx index df26bee592..25417a5715 100644 --- a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx +++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx @@ -127,12 +127,18 @@ namespace drawinglayer */ ViewInformation3D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters); + /// default (empty) constructor + ViewInformation3D(); + /// copy constructor ViewInformation3D(const ViewInformation3D& rCandidate); /// destructor ~ViewInformation3D(); + // checks if the incarnation is default constructed + bool isDefault() const; + /// assignment operator ViewInformation3D& operator=(const ViewInformation3D& rCandidate); diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx deleted file mode 100644 index 89cbc8e076..0000000000 --- a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx +++ /dev/null @@ -1,103 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: alphaprimitive2d.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_ALPHAPRIMITIVE2D_HXX -#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX - -#include - -////////////////////////////////////////////////////////////////////////////// - -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: - /// 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); - - /// data read access - const Primitive2DSequence& getAlpha() const { return maAlpha; } - - /// 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_ALPHAPRIMITIVE2D_HXX - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx index ccb22f17ef..80f3563ad5 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -110,14 +110,16 @@ namespace drawinglayer Current Basic 2D Primitives are: - - BitmapPrimitive2D (bitmap data, evtl. with alpha) - - MetafilePrimitive2D (VCL Metafile, currently no decomposition, but planned, so may vanish) + - BitmapPrimitive2D (bitmap data, evtl. with transparence) - PointArrayPrimitive2D (single points) - PolygonHairlinePrimitive2D (hairline curves/polygons) - PolyPolygonColorPrimitive2D (colored polygons) + UPDATE: MetafilePrimitive2D (VCL Metafile) is taken off this list since + it is implemented with the integration of CWS aw078 into DV300m69. + All other implemented primitives have a defined decomposition and can thus be - decomposed downt to this small set. + decomposed down 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 diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 9df4816a70..77369a7e31 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -48,7 +48,7 @@ ////////////////////////////////////////////////////////////////////////////// // local primitives -#define PRIMITIVE2D_ID_ALPHAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 0) +#define PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 0) #define PRIMITIVE2D_ID_ANIMATEDSWITCHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 1) #define PRIMITIVE2D_ID_ANIMATEDBLINKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 2) #define PRIMITIVE2D_ID_ANIMATEDINTERPOLATEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 3) @@ -83,7 +83,7 @@ #define PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 32) #define PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 33) #define PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 34) -#define PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 35) +#define PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 35) #define PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 36) #define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 37) #define PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 38) @@ -101,14 +101,14 @@ #define PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50) #define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51) #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) +#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53) +#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54) +#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55) +#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56) +#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57) +#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58) +#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59) +#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60) ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx index 055946566e..b16a5173b2 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx @@ -37,7 +37,7 @@ #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX #include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx index dfebc869b9..57c3b58402 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx @@ -37,7 +37,8 @@ #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX #include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // FillHatchPrimitive2D class diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx index 8ea1b86f11..b335a257fa 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx @@ -74,7 +74,7 @@ namespace drawinglayer /// Grid color for single-pixel grid points basegfx::BColor maBColor; - /// The Bitmap (with alpha) for grid cross points + /// The Bitmap (with transparence) for grid cross points BitmapEx maCrossMarker; /** the last used object to view transformtion and the last Viewport, diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx index 27f79615dd..77a6792c58 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx @@ -71,7 +71,7 @@ namespace drawinglayer Current Basic 2D StatePrimitives are: - - AlphaPrimitive2D (objects with freely defined transparence) + - TransparencePrimitive2D (objects with freely defined transparence) - InvertPrimitive2D (for XOR) - MaskPrimitive2D (for masking) - ModifiedColorPrimitive2D (for a stack of color modifications) diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx new file mode 100644 index 0000000000..0a2cef926d --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx @@ -0,0 +1,79 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: hittestprimitive3d.hxx,v $ + * + * $Revision: 1.1.2.1 $ + * + * last change: $Author: aw $ $Date: 2008/09/24 14:27:39 $ + * + * 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_HIDDENGEOMETRYPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// + +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. + class HiddenGeometryPrimitive2D : public GroupPrimitive2D + { + public: + HiddenGeometryPrimitive2D(const Primitive2DSequence& rChildren); + + // despite returning an empty decomposition since it's no visualisation data, + // range calculation is intended to use hidden geometry, so + // the local implementation will return the children's range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + /// local decomposition. Implementation will return empty Primitive2DSequence + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx deleted file mode 100644 index f65eb6e883..0000000000 --- a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx +++ /dev/null @@ -1,86 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hittestprimitive3d.hxx,v $ - * - * $Revision: 1.1.2.1 $ - * - * last change: $Author: aw $ $Date: 2008/09/24 14:27:39 $ - * - * 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_HITTESTPRIMITIVE2D_HXX -#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX - -#include - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive2d - { - /** 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 - { - 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 - */ - virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; - - /** 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 -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx index 85f1c6510c..b7c47268dd 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx @@ -2,7 +2,7 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: unifiedalphaprimitive2d.hxx,v $ + * $RCSfile: UnifiedTransparencePrimitive2D.hxx,v $ * * $Revision: 1.3 $ * diff --git a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx index 3543957aeb..883bade7ea 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx @@ -55,7 +55,7 @@ namespace drawinglayer 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 + (with transparence) 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. diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx index 8a41324f55..cdf97aaba6 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx @@ -47,7 +47,7 @@ namespace drawinglayer { namespace primitive2d { - /** MediaPrimitive2D class + /** MetafilePrimitive2D class This is the MetaFile representing primitive. It's geometry is defined by MetaFileTransform. The content (defined by MetaFile) will be scaled diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx index 24785fcf71..488a1dac7d 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx @@ -41,6 +41,8 @@ #include #include #include +#include +#include ////////////////////////////////////////////////////////////////////////////// // PolygonHairlinePrimitive2D class diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx index 6f6f373c2f..7784f72f8d 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx @@ -37,12 +37,14 @@ #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX #include -#include #include #include #include #include #include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // PolyPolygonHairlinePrimitive2D class @@ -409,7 +411,7 @@ namespace drawinglayer /** PolyPolygonBitmapPrimitive2D class This primitive defines a PolyPolygon filled with bitmap data - (including alpha). The decomosition will create a MaskPrimitive2D + (including transparence). The decomosition will create a MaskPrimitive2D containing a FillBitmapPrimitive2D. */ class PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx index 1fafd3b2d1..11ed1d581d 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx @@ -38,10 +38,12 @@ #include #include -#include #include #include #include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx new file mode 100644 index 0000000000..a9aa6cb5b5 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrdecompositiontools3d.hxx,v $ + * + * $Revision: 1.5 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:18 $ + * + * 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_SDRDECOMPOSITIONTOOLS2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class B2DPolyPolygon; + class B2DHomMatrix; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + // helpers to create HitTestPrimitives Line + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DHomMatrix& rMatrix); + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DPolyPolygon& rPolygon); + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DRange& rRange); + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DRange& rRange, + const basegfx::B2DHomMatrix& rMatrix); + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DPolyPolygon& rPolygon, + const basegfx::B2DHomMatrix& rMatrix); + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx new file mode 100644 index 0000000000..e78bd64186 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: alphaprimitive2d.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_TRANSPARENCEPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** TransparencePrimitive2D 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 a transparence channel also defined as a sequence + of primitives and hold in the transparence member. + + The basic definition is to use the transparence content as transparence-Mask by + interpreting the transparence-content not as RGB, but as Luminance transparence 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 transparent one. The transparent one should/will be clipped + accordingly. + */ + class TransparencePrimitive2D : public GroupPrimitive2D + { + private: + /// The transparence-Mask who's RGB-Values are interpreted as Luminance + Primitive2DSequence maTransparence; + + public: + /** constructor + + @param rChildren + The content which is defined to have a transparency. The + range of this primitive is defined by this content + + @param rTransparence + The definition of the Transparence-channel for this primitive. It + will be interpreted as mask by interpreting as gray values + using the common RGB_to_luminance definitions + */ + TransparencePrimitive2D( + const Primitive2DSequence& rChildren, + const Primitive2DSequence& rTransparence); + + /// data read access + const Primitive2DSequence& getTransparence() const { return maTransparence; } + + /// 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_TRANSPARENCEPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx deleted file mode 100644 index 8f1385e0e4..0000000000 --- a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: unifiedalphaprimitive2d.hxx,v $ - * - * $Revision: 1.3 $ - * - * 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_UNIFIEDALPHAPRIMITIVE2D_HXX -#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX - -#include - -////////////////////////////////////////////////////////////////////////////// - -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: - /// the unified alpha transparence - double mfAlpha; - - public: - /// constructor - UnifiedAlphaPrimitive2D( - const Primitive2DSequence& rChildren, - double fAlpha); - - /// data read access - double getAlpha() const { return mfAlpha; } - - /// compare operator - virtual bool operator==(const BasePrimitive2D& rPrimitive) const; - - /// create decomposition - virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; - - /// provide unique ID - DeclPrimitrive2DIDBlock() - }; - } // end of namespace primitive2d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx new file mode 100644 index 0000000000..aee4042c6a --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: UnifiedTransparencePrimitive2D.hxx,v $ + * + * $Revision: 1.3 $ + * + * 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_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** UnifiedTransparencePrimitive2D 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 UnifiedTransparencePrimitive2D : public GroupPrimitive2D + { + private: + /// the unified transparence + double mfTransparence; + + public: + /// constructor + UnifiedTransparencePrimitive2D( + const Primitive2DSequence& rChildren, + double fTransparence); + + /// data read access + double getTransparence() const { return mfTransparence; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + /// own getB2DRange implementation to include transparent geometries to BoundRect calculations + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + /// create decomposition + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx index ec367665af..5b7720182a 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx @@ -45,25 +45,25 @@ ////////////////////////////////////////////////////////////////////////////// // local primitives -#define PRIMITIVE3D_ID_GROUPPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 0) -#define PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 1) -#define PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 2) -#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 3) -#define PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 4) -#define PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 5) -#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 6) -#define PRIMITIVE3D_ID_SDRCUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 7) -#define PRIMITIVE3D_ID_SDREXTRUDEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 8) -#define PRIMITIVE3D_ID_SDRLATHEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 9) -#define PRIMITIVE3D_ID_SDRPOLYPOLYGONPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 10) -#define PRIMITIVE3D_ID_SDRSPHEREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 11) -#define PRIMITIVE3D_ID_SHADOWPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 12) -#define PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 13) -#define PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 14) -#define PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 15) -#define PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 16) -#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 17) -#define PRIMITIVE3D_ID_HITTESTPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 18) +#define PRIMITIVE3D_ID_GROUPPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 0) +#define PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 1) +#define PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 2) +#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 3) +#define PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 4) +#define PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 5) +#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 6) +#define PRIMITIVE3D_ID_SDRCUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 7) +#define PRIMITIVE3D_ID_SDREXTRUDEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 8) +#define PRIMITIVE3D_ID_SDRLATHEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 9) +#define PRIMITIVE3D_ID_SDRPOLYPOLYGONPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 10) +#define PRIMITIVE3D_ID_SDRSPHEREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 11) +#define PRIMITIVE3D_ID_SHADOWPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 12) +#define PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 13) +#define PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 14) +#define PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 15) +#define PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 16) +#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 17) +#define PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 18) ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx index d06161dbf7..17f821e78d 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx @@ -59,7 +59,7 @@ namespace drawinglayer - TexturePrimitive3D (with the following variations) - GradientTexturePrimitive3D (for 3D gradient fill) - BitmapTexturePrimitive3D (for 3D Bitmap fill) - - AlphaTexturePrimitive3D (for 3D transparence) + - TransparenceTexturePrimitive3D (for 3D transparence) - HatchTexturePrimitive3D (for 3D hatch fill) - TransformPrimitive3D (for a transformation stack) */ diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx index daf4c2f1b0..0674435fb0 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx @@ -37,6 +37,7 @@ #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX #include +#include ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx new file mode 100644 index 0000000000..593242e764 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: hittestprimitive3d.hxx,v $ + * + * $Revision: 1.1.2.1 $ + * + * last change: $Author: aw $ $Date: 2008/09/24 14:27:39 $ + * + * 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_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// + +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. + class HiddenGeometryPrimitive3D : public GroupPrimitive3D + { + public: + HiddenGeometryPrimitive3D(const Primitive3DSequence& rChildren); + + // despite returning an empty decomposition since it's no visualisation data, + // range calculation is intended to use hidden geometry, so + // the local implementation will return the children's range + virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; + + /// The default implementation returns an empty sequence + virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; + + // provide unique ID + DeclPrimitrive3DIDBlock() + }; + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx deleted file mode 100644 index dd6698b6a5..0000000000 --- a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hittestprimitive3d.hxx,v $ - * - * $Revision: 1.1.2.1 $ - * - * last change: $Author: aw $ $Date: 2008/09/24 14:27:39 $ - * - * 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_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX -#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX - -#include - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive3d - { - /** 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 - { - 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 - */ - virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; - - /** 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 -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx index c7cf465dfe..9f40d6d563 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx @@ -61,7 +61,7 @@ namespace drawinglayer SdrCubePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); /// compare operator diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx index cee185f7d7..2f21506c5d 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx @@ -89,13 +89,20 @@ namespace drawinglayer const basegfx::B2DVector& rTextureSize, const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute, const attribute::SdrFillAttribute& rFill, - const attribute::FillGradientAttribute* pFillGradient = 0L); + const attribute::FillGradientAttribute& rFillGradient); Primitive3DSequence createShadowPrimitive3D( const Primitive3DSequence& rSource, const attribute::SdrShadowAttribute& rShadow, bool bShadow3D); - } // end of namespace overlay + + Primitive3DSequence createHiddenGeometryPrimitives3D( + const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector, + const basegfx::B3DHomMatrix& rObjectTransform, + const basegfx::B2DVector& rTextureSize, + const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute); + + } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx index 195de69961..9cf0c85523 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx @@ -95,7 +95,7 @@ namespace drawinglayer SdrExtrudePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, double fDepth, diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx index 1a3c82fff9..a5cec3aa1d 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx @@ -109,7 +109,7 @@ namespace drawinglayer SdrLathePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, sal_uInt32 nHorizontalSegments, diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx index 5e22c4940c..4f9f9738e9 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx @@ -70,7 +70,7 @@ namespace drawinglayer const basegfx::B3DPolyPolygon& rPolyPolygon3D, const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); /// data access diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx index 6b36a4e6c6..7702989d37 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx @@ -40,8 +40,8 @@ #include #include #include -#include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -61,7 +61,7 @@ namespace drawinglayer /// object surface attributes basegfx::B3DHomMatrix maTransform; basegfx::B2DVector maTextureSize; - attribute::SdrLineFillShadowAttribute maSdrLFSAttribute; + attribute::SdrLineFillShadowAttribute3D maSdrLFSAttribute; attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute; protected: @@ -80,13 +80,13 @@ namespace drawinglayer SdrPrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); /// 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::SdrLineFillShadowAttribute3D& getSdrLFSAttribute() const { return maSdrLFSAttribute; } const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; } /// compare operator diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx index 6ba1feb9c8..280d81a593 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx @@ -66,7 +66,7 @@ namespace drawinglayer SdrSpherePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, sal_uInt32 nHorizontalSegments, sal_uInt32 nVerticalSegments); diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx index b65fa0e8e5..04cc8c61ad 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx @@ -37,9 +37,10 @@ #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX #include -#include #include #include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -91,13 +92,13 @@ namespace drawinglayer { namespace primitive3d { - /** UnifiedAlphaTexturePrimitive3D class + /** UnifiedTransparenceTexturePrimitive3D class This 3D primitive expands TexturePrimitive3D to a unified - alpha (transparence) texture definition. All 3D primitives + transparence texture definition. All 3D primitives embedded here will be shown with the given transparency. */ - class UnifiedAlphaTexturePrimitive3D : public TexturePrimitive3D + class UnifiedTransparenceTexturePrimitive3D : public TexturePrimitive3D { private: /// transparency definition @@ -105,7 +106,7 @@ namespace drawinglayer public: /// constructor - UnifiedAlphaTexturePrimitive3D( + UnifiedTransparenceTexturePrimitive3D( double fTransparence, const Primitive3DSequence& rChildren); @@ -115,6 +116,9 @@ namespace drawinglayer /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const; + /// own getB3DRange implementation to include transparent geometries to BoundRect calculations + virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; + /// local decomposition. virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; @@ -208,18 +212,18 @@ namespace drawinglayer { namespace primitive3d { - /** AlphaTexturePrimitive3D class + /** TransparenceTexturePrimitive3D 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 + This 3D primitive expands TexturePrimitive3D to a transparence texture + definition. For transparence definition, a gradient is used. The values in + that gradient will be interpreted as luminance Transparence-Values. All 3D primitives embedded here will be shown with the defined transparence. */ - class AlphaTexturePrimitive3D : public GradientTexturePrimitive3D + class TransparenceTexturePrimitive3D : public GradientTexturePrimitive3D { public: /// constructor - AlphaTexturePrimitive3D( + TransparenceTexturePrimitive3D( const attribute::FillGradientAttribute& rGradient, const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize); diff --git a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx index d3961905d1..70499f896e 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx @@ -45,30 +45,159 @@ namespace drawinglayer { namespace processor2d { + /** BaseProcessor2D class + + Baseclass for all C++ implementations of instances which process + primitives. + + Instances which process primitives can be renderers, but also stuff + for HitTests, BoundRect calculations and/or animation processing. The + main usage are renderers, but they are supposed to handle any primitive + processing. + + The base implementation is constructed with a ViewInformation2D which + is accessible throughout the processor implementations. The idea is + to construct any processor with a given ViewInformation2D. To be able + to handle primitives which need to change the current transformation + (as e.g. TransformPrimitive2D) it is allowed for the processor implementation + to change tis local value using updateViewInformation. + + The basic processing method is process(..) which gets handed over the + sequence of primitives to process. For convenience of the C++ implementations, + the default implementation of process(..) maps all accesses to primitives to + single calls to processBasePrimitive2D(..) where the primitive in question is + already casted to the C++ implementation class. + + The process(..) implementation makes a complete iteration over the given + sequence of primitives. If the Primitive is not derived from BasePrimitive2D + and thus not part of the C++ implementations, it converts ViewInformation2D + to the corresponding API implementation (an uno::Sequence< beans::PropertyValue >) + and recursively calls the method process(..) at the primitive with the decomposition + derived from that primitive. This is the preparation to handle unknown implementations + of the com::sun::star::graphic::XPrimitive2D interface in the future. + + So, to implement a basic processor, it is necessary to overload and implement the + processBasePrimitive2D(..) method. A minimal renderer has to support the + Basic Primitives (see baseprimitive2d.hxx) and the Grouping Primitives (see + groupprimitive2d.hxx). These are (currently): + + Basic Primitives: + + - BitmapPrimitive2D (bitmap data, evtl. with transparence) + - PointArrayPrimitive2D (single points) + - PolygonHairlinePrimitive2D (hairline curves/polygons) + - PolyPolygonColorPrimitive2D (colored polygons) + + Grouping Primitives: + + - TransparencePrimitive2D (objects with freely defined transparence) + - InvertPrimitive2D (for XOR) + - MaskPrimitive2D (for masking) + - ModifiedColorPrimitive2D (for a stack of color modifications) + - TransformPrimitive2D (for a transformation stack) + + A processor doing so is a minimal processor. Of course a processor may + handle any higher-level prmitive (that has a decomposition implementation) + for more direct data access or performance reasons, too. + + The main part of a processBasePrimitive2D implementation is a switch..case + construct, looking like the following: + + void foo::processBasePrimitive2D(const BasePrimitive2D& rCandidate) + { + switch(rCandidate.getPrimitive2DID()) + { + case PRIMITIVE2D_ID_??? : + { + // process PRIMITIVE2D_ID_??? here... + + ... + + break; + } + + ... + + default : + { + // process recursively + process(rCandidate.get2DDecomposition(getViewInformation2D())); + break; + } + } + } + + The default case makes the processor work with all complex primitives + by recursively using their decomposition. + + You can also add a case for ignoring primitives by using: + + case PRIMITIVE2D_ID_...IGNORE.A.. : + case PRIMITIVE2D_ID_...IGNORE.B.. : + case PRIMITIVE2D_ID_...IGNORE.C.. : + { + // ignore these primitives by neither processing nor + // recursively processing their decomposition + break; + } + + Another useful case is embedding the processing of a complex primitive by + bracketing it with some actions: + + case PRIMITIVE2D_ID_SOME_TEXT : + { + // encapsulate e.g. with changing local varibles, e.g. + // sometimes it's good to know if a basic primitive is + // part of a text, especially when not handling the text + // self but by purpose want to handle the decomposed + // geometries in the processor + startText(); + process(rCandidate.get2DDecomposition(getViewInformation2D())); + endText(); + break; + } + + As an example a processor collecting the outlines of a sequence of primitives + only needs to handle some Basic Primitives and create outline and collect + outline polygons e.g. for primitives with area like BitmapPrimitive2D (a + rectangle) and PolyPolygonColorPrimitive2D. When also handling the Grouping + Primitives MaskPrimitive2D (e.g. ignoring it's content, using the mask polyPolygon) + and TransformPrimitive2D (to have the correct local transformation), a processor + creating the outline can be written using just four (4) primitives. As a tipp, it can + be helpful to add many for the purpose not interesting higher level primitives + to not force their decomposition to be created and/or parsed. + */ class BaseProcessor2D { private: + /// The ViewInformation2D itself. It's private to isolate accesses to it geometry::ViewInformation2D maViewInformation2D; protected: + /* access method to allow the implementations to change the current + ViewInformation2D if needed. This allows isolating these accesses + later if needed + */ void updateViewInformation(const geometry::ViewInformation2D& rViewInformation2D) { maViewInformation2D = rViewInformation2D; } - // as tooling, the process() implementation takes over API handling and calls this - // virtual render method when the primitive implementation is BasePrimitive2D-based. - // Default implementation does nothing + /* as tooling, the process() implementation takes over API handling and calls this + virtual render method when the primitive implementation is BasePrimitive2D-based. + Default implementation does nothing + */ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate); public: + /// constructor/destructor BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation); virtual ~BaseProcessor2D(); - // the central processing method + /// the central processing method virtual void process(const primitive2d::Primitive2DSequence& rSource); - // data access + /// data read access const geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; } }; } // end of namespace processor2d @@ -76,6 +205,44 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// +namespace drawinglayer +{ + namespace processor2d + { + /** CollectingProcessor2D class + + A processor which just collects all primitives given to it in + process(..) calls to maPrimitive2DSequence. This can e.g. be used to + hand around as instance over various methods where every called + method can add graphic content to it. + */ + class CollectingProcessor2D : public BaseProcessor2D + { + private: + primitive2d::Primitive2DSequence maPrimitive2DSequence; + + public: + CollectingProcessor2D(const geometry::ViewInformation2D& rViewInformation); + virtual ~CollectingProcessor2D(); + + /// the central processing method + virtual void process(const primitive2d::Primitive2DSequence& rSource); + + /// helpers for adding to local sequence + void appendPrimitive2DReference(const primitive2d::Primitive2DReference& rSource) + { + primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(maPrimitive2DSequence, rSource); + } + + /// data access and reset + const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } + void reset() { maPrimitive2DSequence = primitive2d::Primitive2DSequence(); } + }; + } // end of namespace processor2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + #endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx b/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx index 55760b13a7..0db336b86a 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx @@ -64,10 +64,10 @@ namespace drawinglayer { namespace primitive2d { class MetafilePrimitive2D; class TextSimplePortionPrimitive2D; class BitmapPrimitive2D; - class AlphaPrimitive2D; + class TransparencePrimitive2D; class PolygonStrokePrimitive2D; class FillBitmapPrimitive2D; - class UnifiedAlphaPrimitive2D; + class UnifiedTransparencePrimitive2D; }} ////////////////////////////////////////////////////////////////////////////// @@ -76,6 +76,11 @@ namespace drawinglayer { namespace processor2d { + /** canvasProcessor2D class + + A basic implementation of a renderer for com::sun::star::rendering::XCanvas + as a target + */ class canvasProcessor2D : public BaseProcessor2D { private: @@ -111,10 +116,10 @@ namespace drawinglayer void impRenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rMetaCandidate); void impRenderTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate); void impRenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate); - void impRenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rAlphaCandidate); + void impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate); void impRenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive); void impRenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapPrimitive2D); - void impRenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate); + void impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate); public: canvasProcessor2D( diff --git a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx index 7dc5181344..9a3d94ed3f 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx @@ -46,13 +46,18 @@ namespace drawinglayer { namespace processor2d { + /** ContourExtractor2D class + + A processor who extracts the contour of the primtives feeded to it + in the single local PolyPolygon + */ class ContourExtractor2D : public BaseProcessor2D { private: - // the extracted contour + /// the extracted contour std::vector< basegfx::B2DPolyPolygon > maExtractedContour; - // tooling methods + /// tooling methods void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate); public: diff --git a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx index 46dd1765da..a9882a16b9 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx @@ -51,29 +51,36 @@ namespace drawinglayer { namespace processor2d { + /** HitTestProcessor2D class + + This processor implements a HitTest with the feeded primitives, + given tolerance and extras + */ class HitTestProcessor2D : public BaseProcessor2D { private: - // discrete HitTest position + /// discrete HitTest position basegfx::B2DPoint maDiscreteHitPosition; - // discrete HitTolerance + /// discrete HitTolerance double mfDiscreteHitTolerance; - // bitfield + /// bitfield unsigned mbHit : 1; unsigned mbHitToleranceUsed : 1; - // this flag decides if primitives of type HitTestPrimitive2D - // will be taken into account for HitTesting or not. Those primitives - // are created for objects which are else completely invisible and normally - // their content exists of hairline primitives describing the object's contour - unsigned mbUseHitTestPrimitiveContent : 1; + /* this flag decides if primitives which are embedded to an + UnifiedTransparencePrimitive2D and are invisible will be taken into account for + HitTesting or not. Those primitives are created for objects which are else + completely invisible and normally their content exists of hairline + primitives describing the object's contour + */ + unsigned mbUseInvisiblePrimitiveContent : 1; - // flag to concentraze on text hits only + /// flag to concentraze on text hits only unsigned mbHitTextOnly : 1; - // tooling methods + /// tooling methods void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate); bool checkHairlineHitWithTolerance( const basegfx::B2DPolygon& rPolygon, @@ -91,18 +98,18 @@ namespace drawinglayer bool bHitTextOnly); virtual ~HitTestProcessor2D(); - // data write access - void setUseHitTestPrimitiveContent(bool bNew) + /// data write access + void setUseInvisiblePrimitiveContent(bool bNew) { - if((bool)mbUseHitTestPrimitiveContent != bNew) mbUseHitTestPrimitiveContent = bNew; + if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew; } - // data read access + /// data read access const basegfx::B2DPoint& getDiscreteHitPosition() const { return maDiscreteHitPosition; } double getDiscreteHitTolerance() const { return mfDiscreteHitTolerance; } bool getHit() const { return mbHit; } bool getHitToleranceUsed() const { return mbHitToleranceUsed; } - bool getUseHitTestPrimitiveContent() const { return mbUseHitTestPrimitiveContent;} + bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;} bool getHitTextOnly() const { return mbHitTextOnly; } }; } // end of namespace processor2d diff --git a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx index c3ed548333..45fcdc71cd 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx @@ -45,16 +45,21 @@ namespace drawinglayer { namespace processor2d { + /** LineGeometryExtractor2D class + + This processor can extract the line geometry from feeded primpitives. The + hairlines and the fille geometry from fat lines are separated. + */ class LineGeometryExtractor2D : public BaseProcessor2D { private: std::vector< basegfx::B2DPolygon > maExtractedHairlines; std::vector< basegfx::B2DPolyPolygon > maExtractedLineFills; - // bitfield + /// bitfield unsigned mbInLineGeometry : 1; - // tooling methods + /// tooling methods void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate); public: diff --git a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx index fda1f90cdd..f4b09a4983 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx @@ -48,7 +48,7 @@ namespace drawinglayer { namespace processor2d { - // helper data structure for returning the result + /// helper data structure for returning the result struct TextAsPolygonDataNode { private: @@ -73,9 +73,13 @@ namespace drawinglayer bool getIsFilled() const { return mbIsFilled; } }; - // typedef for a vector of that helper data + /// typedef for a vector of that helper data typedef ::std::vector< TextAsPolygonDataNode > TextAsPolygonDataNodeVector; + /** TextAsPolygonExtractor2D class + + This processor extracts text in the feeded primitives to filled polygons + */ class TextAsPolygonExtractor2D : public BaseProcessor2D { private: diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx index d1746902f3..8479de3c38 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx @@ -47,6 +47,7 @@ ////////////////////////////////////////////////////////////////////////////// // predefines + class GDIMetaFile; class Rectangle; class Gradient; @@ -70,10 +71,22 @@ namespace drawinglayer { namespace processor2d { + /** VclMetafileProcessor2D class + + This processor derived from VclProcessor2D is the base class for rendering + all feeded primitives to a classical VCL-Metafile, including all over the + time grown extra data in comments and PDF exception data creations. Also + printing needs some exception stuff. + + All in all it is needed to emulate the old ::paint output from the old + Drawinglayer as long as exporters and/or filters still use the Metafile + and the extra-data added to it (which can be seen mostly as 'extensions' + or simply as 'hacks'). + */ class VclMetafileProcessor2D : public VclProcessor2D { private: - // local helper(s) + /// local helper(s) Rectangle impDumpToMetaFile( const primitive2d::Primitive2DSequence& rContent, GDIMetaFile& o_rContentMetafile); @@ -93,42 +106,47 @@ namespace drawinglayer void impStartSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke); void impEndSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke); - // the current clipping PolyPolygon from MaskPrimitive2D + /// the current clipping PolyPolygon from MaskPrimitive2D basegfx::B2DPolyPolygon maClipPolyPolygon; - // the target MetaFile + /// the target MetaFile GDIMetaFile* mpMetaFile; - // do not allow embedding SvtGraphicFills into each other, - // use a counter to prevent that + /* do not allow embedding SvtGraphicFills into each other, + use a counter to prevent that + */ sal_uInt32 mnSvtGraphicFillCount; - // same for SvtGraphicStroke + /// same for SvtGraphicStroke sal_uInt32 mnSvtGraphicStrokeCount; - // hold the last unified transparence value to have it handy - // on SvtGraphicStroke creation + /* hold the last unified transparence value to have it handy + on SvtGraphicStroke creation + */ double mfCurrentUnifiedTransparence; - // break iterator support - // made static so it only needs to be fetched once, even with many single - // constructed VclMetafileProcessor2D. It's still incarnated on demand, - // but exists for OOo runtime now by purpose. + /* break iterator support + made static so it only needs to be fetched once, even with many single + constructed VclMetafileProcessor2D. It's still incarnated on demand, + but exists for OOo runtime now by purpose. + */ static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator; - // vcl::PDFExtOutDevData support - // For the first step, some extra actions at vcl::PDFExtOutDevData need to - // be emulated with the VclMetafileProcessor2D. These are potentially temporarily - // since PDF export may use PrimitiveSequences one day directly. + /* vcl::PDFExtOutDevData support + For the first step, some extra actions at vcl::PDFExtOutDevData need to + be emulated with the VclMetafileProcessor2D. These are potentially temporarily + since PDF export may use PrimitiveSequences one day directly. + */ vcl::PDFExtOutDevData* mpPDFExtOutDevData; protected: - // the local processor for BasePrinitive2D-Implementation based primitives, - // called from the common process()-implementation + /* the local processor for BasePrinitive2D-Implementation based primitives, + called from the common process()-implementation + */ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate); public: - // constructor/destructor + /// constructor/destructor VclMetafileProcessor2D( const geometry::ViewInformation2D& rViewInformation, OutputDevice& rOutDev); diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx index 2cc0f50047..a170a0f4b2 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx @@ -39,35 +39,40 @@ #include #include -////////////////////////////////////////////////////////////////////////////// -// predefines - ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace processor2d { + /** VclPixelProcessor2D class + + This processor derived from VclProcessor2D is the base class for rendering + all feeded primitives to a VCL Window. It is the currently used renderer + for all VCL editing output from the DrawingLayer. + */ class VclPixelProcessor2D : public VclProcessor2D { private: - // The Pixel renderer resets the original MapMode from the OutputDevice. - // For some situations it is necessary to get it again, so it is rescued here + /* The Pixel renderer resets the original MapMode from the OutputDevice. + For some situations it is necessary to get it again, so it is rescued here + */ MapMode maOriginalMapMode; protected: - // the local processor for BasePrinitive2D-Implementation based primitives, - // called from the common process()-implementation + /* the local processor for BasePrinitive2D-Implementation based primitives, + called from the common process()-implementation + */ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate); public: - // constructor/destructor + /// constructor/destructor VclPixelProcessor2D( const geometry::ViewInformation2D& rViewInformation, OutputDevice& rOutDev); virtual ~VclPixelProcessor2D(); - // data access + /// data read access const MapMode& getOriginalMapMode() const { return maOriginalMapMode; } }; } // end of namespace processor2d diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx index 6ac3d2abdd..63a9825d09 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx @@ -55,8 +55,8 @@ namespace drawinglayer { namespace primitive2d { class PolyPolygonColorPrimitive2D; class MetafilePrimitive2D; class MaskPrimitive2D; - class UnifiedAlphaPrimitive2D; - class AlphaPrimitive2D; + class UnifiedTransparencePrimitive2D; + class TransparencePrimitive2D; class TransformPrimitive2D; class MarkerArrayPrimitive2D; class PointArrayPrimitive2D; @@ -73,6 +73,11 @@ namespace drawinglayer { namespace processor2d { + /** VclProcessor2D class + + This processor is the base class for VCL-Based processors. It has no + processBasePrimitive2D implementation and thus is not usable directly. + */ class VclProcessor2D : public BaseProcessor2D { protected: @@ -107,8 +112,8 @@ namespace drawinglayer void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate); void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate); void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate); - void RenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rTransCandidate); - void RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate); + void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate); + void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate); void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate); void RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate); void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate); diff --git a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx index ad8048fa7e..c98cf66311 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx @@ -45,6 +45,13 @@ namespace drawinglayer { namespace processor3d { + /** BaseProcessor3D class + + Baseclass for all C++ implementations of instances which process + primitives. + + Please have a look at baseprocessor2d.hxx for more comments. + */ class BaseProcessor3D { private: @@ -56,9 +63,10 @@ namespace drawinglayer maViewInformation3D = rViewInformation3D; } - // as tooling, the process() implementation takes over API handling and calls this - // virtual render method when the primitive implementation is BasePrimitive3D-based. - // Default implementation does nothing + /* as tooling, the process() implementation takes over API handling and calls this + virtual render method when the primitive implementation is BasePrimitive3D-based. + Default implementation does nothing + */ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate); public: @@ -80,6 +88,13 @@ namespace drawinglayer { namespace processor3d { + /** CollectingProcessor3D class + + A processor which just collects all primitives given to it in + process(..) calls to maPrimitive3DSequence. This can e.g. be used to + hand around as instance over various methods where every called + method can add graphic content to it. + */ class CollectingProcessor3D : public BaseProcessor3D { private: @@ -89,16 +104,16 @@ namespace drawinglayer CollectingProcessor3D(const geometry::ViewInformation3D& rViewInformation); virtual ~CollectingProcessor3D(); - // the central processing method + /// the central processing method virtual void process(const primitive3d::Primitive3DSequence& rSource); - // helpers for adding to local sequence + /// helpers for adding to local sequence void appendPrimitive3DReference(const primitive3d::Primitive3DReference& rSource) { primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(maPrimitive3DSequence, rSource); } - // data access and reset + /// data access and reset const primitive3d::Primitive3DSequence& getPrimitive3DSequence() const { return maPrimitive3DSequence; } void reset() { maPrimitive3DSequence = primitive3d::Primitive3DSequence(); } }; diff --git a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx index de99d94f48..1c3ecbc813 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx @@ -44,26 +44,38 @@ namespace drawinglayer { namespace processor3d { + /** CutFindProcessor class + + This processor extracts all cuts of 3D plane geometries in the feeded primitives + with the given cut vector, based on the ViewInformation3D given. + */ class CutFindProcessor : public BaseProcessor3D { private: - // the start and stop point for the cut vector + /// the start and stop point for the cut vector basegfx::B3DPoint maFront; basegfx::B3DPoint maBack; - // the found cut points + /// the found cut points ::std::vector< basegfx::B3DPoint > maResult; - // #i102956# the transformation change from TransformPrimitive3D processings - // needs to be remembered to be able to transform found cuts to the - // basic coordinate system the processor starts with + /* #i102956# the transformation change from TransformPrimitive3D processings + needs to be remembered to be able to transform found cuts to the + basic coordinate system the processor starts with + */ basegfx::B3DHomMatrix maCombinedTransform; - // bitfield + /// bitfield bool mbAnyHit : 1; - // as tooling, the process() implementation takes over API handling and calls this - // virtual render method when the primitive implementation is BasePrimitive3D-based. + /* this flag decides if primitives which are invisible will be taken into account for + HitTesting or not. + */ + bool mbUseInvisiblePrimitiveContent : 1; + + /* as tooling, the process() implementation takes over API handling and calls this + virtual render method when the primitive implementation is BasePrimitive3D-based. + */ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate); public: @@ -72,9 +84,16 @@ namespace drawinglayer const basegfx::B3DPoint& rBack, bool bAnyHit); - // data access + /// data write access + void setUseInvisiblePrimitiveContent(bool bNew) + { + if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew; + } + + /// data read access const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; } bool getAnyHit() const { return mbAnyHit; } + bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;} }; } // end of namespace processor3d } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx index e1dde72111..894e0138f0 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx @@ -45,6 +45,7 @@ ////////////////////////////////////////////////////////////////////////////// // predefines + namespace basegfx { class BZPixelRaster; class B3DPolygon; @@ -77,38 +78,49 @@ namespace drawinglayer { namespace processor3d { + /** DefaultProcessor3D class + + This processor renders all feeded primitives to a 2D raster where for all + primitives the two basic methods rasterconvertB3DPolygon for hairlines and + rasterconvertB3DPolyPolygon for filled geometry is called. It is a beseclass to + e.g. base a Z-Buffer supported renderer on the 3D primitive processing. + */ class DefaultProcessor3D : public BaseProcessor3D { protected: - // render information - const attribute::SdrSceneAttribute& mrSdrSceneAttribute; // read-only scene infos (normal handling, etc...) - const attribute::SdrLightingAttribute& mrSdrLightingAttribute; // read-only light infos (lights, etc...) + /// read-only scene infos (normal handling, etc...) + const attribute::SdrSceneAttribute& mrSdrSceneAttribute; + + /// read-only light infos (lights, etc...) + const attribute::SdrLightingAttribute& mrSdrLightingAttribute; - // renderer range. Need to be correctly set by the derived implementations - basegfx::B2DRange maRasterRange; // the (0, 0, W, H) range from mpBZPixelRaster + /// renderer range. Need to be correctly set by the derived implementations + /// normally the (0, 0, W, H) range from mpBZPixelRaster + basegfx::B2DRange maRasterRange; - // the modifiedColorPrimitive stack + /// the modifiedColorPrimitive stack basegfx::BColorModifierStack maBColorModifierStack; - // the current active texture + /// the current active texture boost::shared_ptr< texture::GeoTexSvx > mpGeoTexSvx; - // the current active transparence texture + /// the current active transparence texture boost::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx; - // SvtOptionsDrawinglayer incarnation to react on diverse settings + /// SvtOptionsDrawinglayer incarnation to react on diverse settings const SvtOptionsDrawinglayer maDrawinglayerOpt; - // counter for entered transparence textures + /// counter for entered transparence textures sal_uInt32 mnTransparenceCounter; - // bitfield + /// bitfield unsigned mbModulate : 1; unsigned mbFilter : 1; unsigned mbSimpleTextureActive : 1; ////////////////////////////////////////////////////////////////////////////// // rendering support + void impRenderGradientTexturePrimitive3D(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence); void impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive); void impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive); @@ -120,6 +132,7 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // rasterconversions for filled and non-filled polygons. These NEED to be // implemented from derivations + virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const = 0; virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const = 0; @@ -133,11 +146,11 @@ namespace drawinglayer const attribute::SdrLightingAttribute& rSdrLightingAttribute); virtual ~DefaultProcessor3D(); - // data read access + /// data read access const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return mrSdrSceneAttribute; } const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return mrSdrLightingAttribute; } - // data read access renderer stuff + /// data read access renderer stuff const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; } const boost::shared_ptr< texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; } const boost::shared_ptr< texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; } @@ -146,7 +159,7 @@ namespace drawinglayer bool getFilter() const { return mbFilter; } bool getSimpleTextureActive() const { return mbSimpleTextureActive; } - // access to Drawinglayer configuration options + /// access to Drawinglayer configuration options const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; } }; } // end of namespace processor3d diff --git a/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx index 63f0753546..991917316f 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx @@ -48,20 +48,27 @@ namespace drawinglayer { namespace processor3d { + /** Geometry2DExtractingProcessor class + + This processor extracts the 2D geometry (projected geometry) of all feeded primitives. + It is e.g. used as sub-processor for contour extraction where 3D geometry is only + useful as 2D projected geometry. + */ class Geometry2DExtractingProcessor : public BaseProcessor3D { private: - // result holding vector (2D) + /// result holding vector (2D) primitive2d::Primitive2DSequence maPrimitive2DSequence; - // object transformation for scene for 2d definition + /// object transformation for scene for 2d definition basegfx::B2DHomMatrix maObjectTransformation; - // the modifiedColorPrimitive stack + /// the modifiedColorPrimitive stack basegfx::BColorModifierStack maBColorModifierStack; - // as tooling, the process() implementation takes over API handling and calls this - // virtual render method when the primitive implementation is BasePrimitive3D-based. + /* as tooling, the process() implementation takes over API handling and calls this + virtual render method when the primitive implementation is BasePrimitive3D-based. + */ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate); public: @@ -69,7 +76,7 @@ namespace drawinglayer const geometry::ViewInformation3D& rViewInformation, const basegfx::B2DHomMatrix& rObjectTransformation); - // data access + // data read access const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; } diff --git a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx index 9eb5521624..80886e365f 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx @@ -52,17 +52,24 @@ namespace drawinglayer { namespace processor3d { + /** Shadow3DExtractingProcessor class + + This processor extracts the 2D shadow geometry (projected geometry) of all feeded primitives. + It is used to create the shadow of 3D objects which consists of 2D geometry. It needs quite + some data to do so since we do not only offer flat projected 2D shadow, but also projections + dependent on the light source + */ class Shadow3DExtractingProcessor : public BaseProcessor3D { private: - // result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence) + /// result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence) primitive2d::Primitive2DSequence maPrimitive2DSequence; primitive2d::Primitive2DSequence* mpPrimitive2DSequence; - // object transformation for scene for 2d definition + /// object transformation for scene for 2d definition basegfx::B2DHomMatrix maObjectTransformation; - // prepared data (transformations) for 2D/3D shadow calculations + /// prepared data (transformations) for 2D/3D shadow calculations basegfx::B3DHomMatrix maWorldToEye; basegfx::B3DHomMatrix maEyeToView; basegfx::B3DVector maLightNormal; @@ -70,26 +77,28 @@ namespace drawinglayer basegfx::B3DPoint maPlanePoint; double mfLightPlaneScalar; - // the shadow color used for sub-primitives. Can stay at black since - // the encapsulating 2d shadow primitive will contain the color + /* the shadow color used for sub-primitives. Can stay at black since + the encapsulating 2d shadow primitive will contain the color + */ basegfx::BColor maPrimitiveColor; - // bitfield - // flag if shadow plane projection preparation leaded to valid results + /// bitfield + /// flag if shadow plane projection preparation leaded to valid results unsigned mbShadowProjectionIsValid : 1; - // flag if conversion is switched on + /// flag if conversion is switched on unsigned mbConvert : 1; - // flag if conversion shall use projection + /// flag if conversion shall use projection unsigned mbUseProjection : 1; - // helpers + /// local helpers basegfx::B2DPolygon impDoShadowProjection(const basegfx::B3DPolygon& rSource); basegfx::B2DPolyPolygon impDoShadowProjection(const basegfx::B3DPolyPolygon& rSource); - // as tooling, the process() implementation takes over API handling and calls this - // virtual render method when the primitive implementation is BasePrimitive3D-based. + /* as tooling, the process() implementation takes over API handling and calls this + virtual render method when the primitive implementation is BasePrimitive3D-based. + */ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate); public: @@ -100,7 +109,7 @@ namespace drawinglayer double fShadowSlant, const basegfx::B3DRange& rContained3DRange); - // data access + /// data read access const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } const basegfx::B3DHomMatrix& getWorldToEye() const { return maWorldToEye; } diff --git a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx index d741dabde9..0fee9ba089 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx @@ -66,28 +66,37 @@ namespace drawinglayer { namespace processor3d { + /** ZBufferProcessor3D class + + This 3D renderer derived from DefaultProcessor3D renders all feeded primitives to a 2D + raster bitmap using a Z-Buffer based approach. It is able to supersample and to handle + transparent content. + */ class ZBufferProcessor3D : public DefaultProcessor3D { private: - // the raster target, a Z-Buffer + /// the raster target, a Z-Buffer basegfx::BZPixelRaster* mpBZPixelRaster; - // inverse of EyeToView for rasterconversion with evtl. Phong shading + /// inverse of EyeToView for rasterconversion with evtl. Phong shading basegfx::B3DHomMatrix maInvEyeToView; - // The raster converter for Z-Buffer + /// The raster converter for Z-Buffer ZBufferRasterConverter3D* mpZBufferRasterConverter3D; - // AA value. Defines how many oversámples will be used in X and Y. Values 0, 1 - // will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create + /* AA value. Defines how many oversámples will be used in X and Y. Values 0, 1 + will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create + */ sal_uInt16 mnAntiAlialize; - // remembered RasterPrimitive3D's which need to be painted back to front - // for transparent 3D parts + /* remembered RasterPrimitive3D's which need to be painted back to front + for transparent 3D parts + */ std::vector< RasterPrimitive3D >* mpRasterPrimitive3Ds; ////////////////////////////////////////////////////////////////////////////// // rasterconversions for filled and non-filled polygons + virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const; virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const; @@ -105,7 +114,7 @@ namespace drawinglayer void finish(); - // get the result as bitmapEx + /// get the result as bitmapEx BitmapEx getBitmapEx() const; }; } // end of namespace processor3d diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst index ee5b96d98a..7ae13f8ebe 100644 --- a/drawinglayer/prj/d.lst +++ b/drawinglayer/prj/d.lst @@ -8,7 +8,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\drawinglayer_primitivetypes2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\drawinglayer_primitivetypes2d.hxx -..\inc\drawinglayer\primitive2d\alphaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\alphaprimitive2d.hxx +..\inc\drawinglayer\primitive2d\transparenceprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\transparenceprimitive2d.hxx ..\inc\drawinglayer\primitive2d\animatedprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\animatedprimitive2d.hxx ..\inc\drawinglayer\primitive2d\backgroundcolorprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\backgroundcolorprimitive2d.hxx ..\inc\drawinglayer\primitive2d\baseprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\baseprimitive2d.hxx @@ -24,7 +24,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\gridprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\gridprimitive2d.hxx ..\inc\drawinglayer\primitive2d\groupprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\groupprimitive2d.hxx ..\inc\drawinglayer\primitive2d\helplineprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\helplineprimitive2d.hxx -..\inc\drawinglayer\primitive2d\hittestprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hittestprimitive2d.hxx +..\inc\drawinglayer\primitive2d\hiddengeometryprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hiddengeometryprimitive2d.hxx ..\inc\drawinglayer\primitive2d\invertprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\invertprimitive2d.hxx ..\inc\drawinglayer\primitive2d\markerarrayprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\markerarrayprimitive2d.hxx ..\inc\drawinglayer\primitive2d\maskprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\maskprimitive2d.hxx @@ -36,6 +36,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\polygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polygonprimitive2d.hxx ..\inc\drawinglayer\primitive2d\polypolygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polypolygonprimitive2d.hxx ..\inc\drawinglayer\primitive2d\primitivetools2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\primitivetools2d.hxx +..\inc\drawinglayer\primitive2d\sdrdecompositiontools2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sdrdecompositiontools2d.hxx ..\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 @@ -46,7 +47,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\textdecoratedprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textdecoratedprimitive2d.hxx ..\inc\drawinglayer\primitive2d\texthierarchyprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\texthierarchyprimitive2d.hxx ..\inc\drawinglayer\primitive2d\transformprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\transformprimitive2d.hxx -..\inc\drawinglayer\primitive2d\unifiedalphaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\unifiedalphaprimitive2d.hxx +..\inc\drawinglayer\primitive2d\unifiedtransparenceprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\unifiedtransparenceprimitive2d.hxx ..\inc\drawinglayer\primitive2d\wrongspellprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\wrongspellprimitive2d.hxx mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive3d @@ -54,7 +55,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive3d ..\inc\drawinglayer\primitive3d\baseprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\baseprimitive3d.hxx ..\inc\drawinglayer\primitive3d\groupprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\groupprimitive3d.hxx ..\inc\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx -..\inc\drawinglayer\primitive3d\hittestprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\hittestprimitive3d.hxx +..\inc\drawinglayer\primitive2d\hiddengeometryprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hiddengeometryprimitive3d.hxx ..\inc\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx ..\inc\drawinglayer\primitive3d\polygonprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygonprimitive3d.hxx ..\inc\drawinglayer\primitive3d\polygontubeprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygontubeprimitive3d.hxx @@ -97,13 +98,20 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d ..\inc\drawinglayer\processor3d\tbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\tbufferprocessor3d.hxx mkdir: %_DEST%\inc%_EXT%\drawinglayer\attribute -..\inc\drawinglayer\attribute\fillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillattribute.hxx +..\inc\drawinglayer\attribute\fillgradientattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillgradientattribute.hxx +..\inc\drawinglayer\attribute\fillhatchattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillhatchattribute.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 -..\inc\drawinglayer\attribute\sdrattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrattribute3d.hxx +..\inc\drawinglayer\attribute\sdrlineattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlineattribute.hxx +..\inc\drawinglayer\attribute\sdrlinestartendattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlinestartendattribute.hxx +..\inc\drawinglayer\attribute\sdrshadowattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrshadowattribute.hxx +..\inc\drawinglayer\attribute\sdrfillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrfillattribute.hxx +..\inc\drawinglayer\attribute\sdrobjectattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrobjectattribute3d.hxx +..\inc\drawinglayer\attribute\sdrlightattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlightattribute3d.hxx +..\inc\drawinglayer\attribute\sdrlightingattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlightingattribute3d.hxx +..\inc\drawinglayer\attribute\sdrsceneattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrsceneattribute3d.hxx ..\inc\drawinglayer\attribute\sdrfillbitmapattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrfillbitmapattribute.hxx ..\inc\drawinglayer\attribute\strokeattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\strokeattribute.hxx ..\inc\drawinglayer\attribute\lineattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\lineattribute.hxx diff --git a/drawinglayer/source/attribute/fillattribute.cxx b/drawinglayer/source/attribute/fillattribute.cxx deleted file mode 100644 index bba413c0b3..0000000000 --- a/drawinglayer/source/attribute/fillattribute.cxx +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: fillattribute.cxx,v $ - * - * $Revision: 1.4 $ - * - * 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 -#include - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - FillGradientAttribute::FillGradientAttribute(GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY, double fAngle, - const basegfx::BColor& rStartColor, const basegfx::BColor& rEndColor, sal_uInt16 nSteps) - : maStartColor(rStartColor), - maEndColor(rEndColor), - mfBorder(fBorder), - mfOffsetX(fOffsetX), - mfOffsetY(fOffsetY), - mfAngle(fAngle), - meStyle(eStyle), - mnSteps(nSteps) - { - } - - bool FillGradientAttribute::operator==(const FillGradientAttribute& rCandidate) const - { - return (meStyle == rCandidate.meStyle - && maStartColor == rCandidate.maStartColor - && maEndColor == rCandidate.maEndColor - && mfBorder == rCandidate.mfBorder - && mfOffsetX == rCandidate.mfOffsetX - && mfOffsetY == rCandidate.mfOffsetY - && mfAngle == rCandidate.mfAngle - && mnSteps == rCandidate.mnSteps); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - FillHatchAttribute::FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground) - : mfDistance(fDistance), - mfAngle(fAngle), - maColor(rColor), - meStyle(eStyle), - mbFillBackground(bFillBackground) - { - } - - bool FillHatchAttribute::operator==(const FillHatchAttribute& rCandidate) const - { - return (meStyle == rCandidate.meStyle - && mfDistance == rCandidate.mfDistance - && mfAngle == rCandidate.mfAngle - && maColor == rCandidate.maColor - && mbFillBackground == rCandidate.mbFillBackground); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/attribute/fillbitmapattribute.cxx b/drawinglayer/source/attribute/fillbitmapattribute.cxx index da93f5a7b7..e952f43170 100644 --- a/drawinglayer/source/attribute/fillbitmapattribute.cxx +++ b/drawinglayer/source/attribute/fillbitmapattribute.cxx @@ -37,6 +37,7 @@ #include "precompiled_drawinglayer.hxx" #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -44,25 +45,161 @@ namespace drawinglayer { namespace attribute { + class ImpFillBitmapAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // data definitions + BitmapEx maBitmapEx; + basegfx::B2DPoint maTopLeft; + basegfx::B2DVector maSize; + + // bitfield + unsigned mbTiling : 1; + + ImpFillBitmapAttribute( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rTopLeft, + const basegfx::B2DVector& rSize, + bool bTiling) + : mnRefCount(0), + maBitmapEx(rBitmapEx), + maTopLeft(rTopLeft), + maSize(rSize), + mbTiling(bTiling) + { + } + + bool operator==(const ImpFillBitmapAttribute& rCandidate) const + { + return (maBitmapEx == rCandidate.maBitmapEx + && maTopLeft == rCandidate.maTopLeft + && maSize == rCandidate.maSize + && mbTiling == rCandidate.mbTiling); + } + + // data read access + 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; } + + static ImpFillBitmapAttribute* get_global_default() + { + static ImpFillBitmapAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpFillBitmapAttribute( + BitmapEx(), + basegfx::B2DPoint(), + basegfx::B2DVector(), + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + FillBitmapAttribute::FillBitmapAttribute( const BitmapEx& rBitmapEx, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling) - : maBitmapEx(rBitmapEx), - maTopLeft(rTopLeft), - maSize(rSize), - mbTiling(bTiling) + : mpFillBitmapAttribute(new ImpFillBitmapAttribute( + rBitmapEx, rTopLeft, rSize, bTiling)) + { + } + + FillBitmapAttribute::FillBitmapAttribute() + : mpFillBitmapAttribute(ImpFillBitmapAttribute::get_global_default()) + { + mpFillBitmapAttribute->mnRefCount++; + } + + FillBitmapAttribute::FillBitmapAttribute(const FillBitmapAttribute& rCandidate) + : mpFillBitmapAttribute(rCandidate.mpFillBitmapAttribute) + { + mpFillBitmapAttribute->mnRefCount++; + } + + FillBitmapAttribute::~FillBitmapAttribute() + { + if(mpFillBitmapAttribute->mnRefCount) + { + mpFillBitmapAttribute->mnRefCount--; + } + else + { + delete mpFillBitmapAttribute; + } + } + + bool FillBitmapAttribute::isDefault() const + { + return mpFillBitmapAttribute == ImpFillBitmapAttribute::get_global_default(); + } + + FillBitmapAttribute& FillBitmapAttribute::operator=(const FillBitmapAttribute& rCandidate) { + if(rCandidate.mpFillBitmapAttribute != mpFillBitmapAttribute) + { + if(mpFillBitmapAttribute->mnRefCount) + { + mpFillBitmapAttribute->mnRefCount--; + } + else + { + delete mpFillBitmapAttribute; + } + + mpFillBitmapAttribute = rCandidate.mpFillBitmapAttribute; + mpFillBitmapAttribute->mnRefCount++; + } + + return *this; } bool FillBitmapAttribute::operator==(const FillBitmapAttribute& rCandidate) const { - return (getBitmapEx() == rCandidate.getBitmapEx() - && getTopLeft() == rCandidate.getTopLeft() - && getSize() == rCandidate.getSize() - && getTiling() == rCandidate.getTiling()); + if(rCandidate.mpFillBitmapAttribute == mpFillBitmapAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpFillBitmapAttribute == *mpFillBitmapAttribute); } + + const BitmapEx& FillBitmapAttribute::getBitmapEx() const + { + return mpFillBitmapAttribute->getBitmapEx(); + } + + const basegfx::B2DPoint& FillBitmapAttribute::getTopLeft() const + { + return mpFillBitmapAttribute->getTopLeft(); + } + + const basegfx::B2DVector& FillBitmapAttribute::getSize() const + { + return mpFillBitmapAttribute->getSize(); + } + + bool FillBitmapAttribute::getTiling() const + { + return mpFillBitmapAttribute->getTiling(); + } + } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/attribute/fillgradientattribute.cxx b/drawinglayer/source/attribute/fillgradientattribute.cxx new file mode 100644 index 0000000000..0d38b27c91 --- /dev/null +++ b/drawinglayer/source/attribute/fillgradientattribute.cxx @@ -0,0 +1,250 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: fillattribute.cxx,v $ + * + * $Revision: 1.4 $ + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpFillGradientAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // data definitions + GradientStyle meStyle; + double mfBorder; + double mfOffsetX; + double mfOffsetY; + double mfAngle; + basegfx::BColor maStartColor; + basegfx::BColor maEndColor; + sal_uInt16 mnSteps; + + ImpFillGradientAttribute( + GradientStyle eStyle, + double fBorder, + double fOffsetX, + double fOffsetY, + double fAngle, + const basegfx::BColor& rStartColor, + const basegfx::BColor& rEndColor, + sal_uInt16 nSteps) + : mnRefCount(0), + meStyle(eStyle), + mfBorder(fBorder), + mfOffsetX(fOffsetX), + mfOffsetY(fOffsetY), + mfAngle(fAngle), + maStartColor(rStartColor), + maEndColor(rEndColor), + mnSteps(nSteps) + { + } + + // data read access + GradientStyle getStyle() const { return meStyle; } + double getBorder() const { return mfBorder; } + double getOffsetX() const { return mfOffsetX; } + double getOffsetY() const { return mfOffsetY; } + double getAngle() const { return mfAngle; } + const basegfx::BColor& getStartColor() const { return maStartColor; } + const basegfx::BColor& getEndColor() const { return maEndColor; } + sal_uInt16 getSteps() const { return mnSteps; } + + bool operator==(const ImpFillGradientAttribute& rCandidate) const + { + return (getStyle() == rCandidate.getStyle() + && getBorder() == rCandidate.getBorder() + && getOffsetX() == rCandidate.getOffsetX() + && getOffsetY() == rCandidate.getOffsetY() + && getAngle() == rCandidate.getAngle() + && getStartColor() == rCandidate.getStartColor() + && getEndColor() == rCandidate.getEndColor() + && getSteps() == rCandidate.getSteps()); + } + + static ImpFillGradientAttribute* get_global_default() + { + static ImpFillGradientAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpFillGradientAttribute( + GRADIENTSTYLE_LINEAR, + 0.0, 0.0, 0.0, 0.0, + basegfx::BColor(), + basegfx::BColor(), + 0); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + FillGradientAttribute::FillGradientAttribute( + GradientStyle eStyle, + double fBorder, + double fOffsetX, + double fOffsetY, + double fAngle, + const basegfx::BColor& rStartColor, + const basegfx::BColor& rEndColor, + sal_uInt16 nSteps) + : mpFillGradientAttribute(new ImpFillGradientAttribute( + eStyle, fBorder, fOffsetX, fOffsetY, fAngle, rStartColor, rEndColor, nSteps)) + { + } + + FillGradientAttribute::FillGradientAttribute() + : mpFillGradientAttribute(ImpFillGradientAttribute::get_global_default()) + { + mpFillGradientAttribute->mnRefCount++; + } + + FillGradientAttribute::FillGradientAttribute(const FillGradientAttribute& rCandidate) + : mpFillGradientAttribute(rCandidate.mpFillGradientAttribute) + { + mpFillGradientAttribute->mnRefCount++; + } + + FillGradientAttribute::~FillGradientAttribute() + { + if(mpFillGradientAttribute->mnRefCount) + { + mpFillGradientAttribute->mnRefCount--; + } + else + { + delete mpFillGradientAttribute; + } + } + + bool FillGradientAttribute::isDefault() const + { + return mpFillGradientAttribute == ImpFillGradientAttribute::get_global_default(); + } + + FillGradientAttribute& FillGradientAttribute::operator=(const FillGradientAttribute& rCandidate) + { + if(rCandidate.mpFillGradientAttribute != mpFillGradientAttribute) + { + if(mpFillGradientAttribute->mnRefCount) + { + mpFillGradientAttribute->mnRefCount--; + } + else + { + delete mpFillGradientAttribute; + } + + mpFillGradientAttribute = rCandidate.mpFillGradientAttribute; + mpFillGradientAttribute->mnRefCount++; + } + + return *this; + } + + bool FillGradientAttribute::operator==(const FillGradientAttribute& rCandidate) const + { + if(rCandidate.mpFillGradientAttribute == mpFillGradientAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpFillGradientAttribute == *mpFillGradientAttribute); + } + + const basegfx::BColor& FillGradientAttribute::getStartColor() const + { + return mpFillGradientAttribute->getStartColor(); + } + + const basegfx::BColor& FillGradientAttribute::getEndColor() const + { + return mpFillGradientAttribute->getEndColor(); + } + + double FillGradientAttribute::getBorder() const + { + return mpFillGradientAttribute->getBorder(); + } + + double FillGradientAttribute::getOffsetX() const + { + return mpFillGradientAttribute->getOffsetX(); + } + + double FillGradientAttribute::getOffsetY() const + { + return mpFillGradientAttribute->getOffsetY(); + } + + double FillGradientAttribute::getAngle() const + { + return mpFillGradientAttribute->getAngle(); + } + + GradientStyle FillGradientAttribute::getStyle() const + { + return mpFillGradientAttribute->getStyle(); + } + + sal_uInt16 FillGradientAttribute::getSteps() const + { + return mpFillGradientAttribute->getSteps(); + } + + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/fillhatchattribute.cxx b/drawinglayer/source/attribute/fillhatchattribute.cxx new file mode 100644 index 0000000000..cc8b19edf0 --- /dev/null +++ b/drawinglayer/source/attribute/fillhatchattribute.cxx @@ -0,0 +1,219 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: fillattribute.cxx,v $ + * + * $Revision: 1.4 $ + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpFillHatchAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // data definitions + HatchStyle meStyle; + double mfDistance; + double mfAngle; + basegfx::BColor maColor; + + // bitfield + unsigned mbFillBackground : 1; + + ImpFillHatchAttribute( + HatchStyle eStyle, + double fDistance, + double fAngle, + const basegfx::BColor& rColor, + bool bFillBackground) + : mnRefCount(0), + meStyle(eStyle), + mfDistance(fDistance), + mfAngle(fAngle), + maColor(rColor), + mbFillBackground(bFillBackground) + { + } + + // data read access + HatchStyle getStyle() const { return meStyle; } + double getDistance() const { return mfDistance; } + double getAngle() const { return mfAngle; } + const basegfx::BColor& getColor() const { return maColor; } + bool isFillBackground() const { return mbFillBackground; } + + bool operator==(const ImpFillHatchAttribute& rCandidate) const + { + return (getStyle() == rCandidate.getStyle() + && getDistance() == rCandidate.getDistance() + && getAngle() == rCandidate.getAngle() + && getColor() == rCandidate.getColor() + && isFillBackground() == rCandidate.isFillBackground()); + } + + static ImpFillHatchAttribute* get_global_default() + { + static ImpFillHatchAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpFillHatchAttribute( + HATCHSTYLE_SINGLE, + 0.0, 0.0, + basegfx::BColor(), + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + FillHatchAttribute::FillHatchAttribute( + HatchStyle eStyle, + double fDistance, + double fAngle, + const basegfx::BColor& rColor, + bool bFillBackground) + : mpFillHatchAttribute(new ImpFillHatchAttribute( + eStyle, fDistance, fAngle, rColor, bFillBackground)) + { + } + + FillHatchAttribute::FillHatchAttribute() + : mpFillHatchAttribute(ImpFillHatchAttribute::get_global_default()) + { + mpFillHatchAttribute->mnRefCount++; + } + + FillHatchAttribute::FillHatchAttribute(const FillHatchAttribute& rCandidate) + : mpFillHatchAttribute(rCandidate.mpFillHatchAttribute) + { + mpFillHatchAttribute->mnRefCount++; + } + + FillHatchAttribute::~FillHatchAttribute() + { + if(mpFillHatchAttribute->mnRefCount) + { + mpFillHatchAttribute->mnRefCount--; + } + else + { + delete mpFillHatchAttribute; + } + } + + bool FillHatchAttribute::isDefault() const + { + return mpFillHatchAttribute == ImpFillHatchAttribute::get_global_default(); + } + + FillHatchAttribute& FillHatchAttribute::operator=(const FillHatchAttribute& rCandidate) + { + if(rCandidate.mpFillHatchAttribute != mpFillHatchAttribute) + { + if(mpFillHatchAttribute->mnRefCount) + { + mpFillHatchAttribute->mnRefCount--; + } + else + { + delete mpFillHatchAttribute; + } + + mpFillHatchAttribute = rCandidate.mpFillHatchAttribute; + mpFillHatchAttribute->mnRefCount++; + } + + return *this; + } + + bool FillHatchAttribute::operator==(const FillHatchAttribute& rCandidate) const + { + if(rCandidate.mpFillHatchAttribute == mpFillHatchAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpFillHatchAttribute == *mpFillHatchAttribute); + } + + // data read access + HatchStyle FillHatchAttribute::getStyle() const + { + return mpFillHatchAttribute->getStyle(); + } + + double FillHatchAttribute::getDistance() const + { + return mpFillHatchAttribute->getDistance(); + } + + double FillHatchAttribute::getAngle() const + { + return mpFillHatchAttribute->getAngle(); + } + + const basegfx::BColor& FillHatchAttribute::getColor() const + { + return mpFillHatchAttribute->getColor(); + } + + bool FillHatchAttribute::isFillBackground() const + { + return mpFillHatchAttribute->isFillBackground(); + } + + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx index 5163e2f6a5..060eacc6b8 100644 --- a/drawinglayer/source/attribute/fontattribute.cxx +++ b/drawinglayer/source/attribute/fontattribute.cxx @@ -37,6 +37,7 @@ #include "precompiled_drawinglayer.hxx" #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -44,18 +45,215 @@ 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()); + class ImpFontAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + /// 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 + + ImpFontAttribute( + const String& rFamilyName, + const String& rStyleName, + sal_uInt16 nWeight, + bool bSymbol, + bool bVertical, + bool bItalic, + bool bOutline, + bool bRTL, + bool bBiDiStrong) + : mnRefCount(0), + maFamilyName(rFamilyName), + maStyleName(rStyleName), + mnWeight(nWeight), + mbSymbol(bSymbol), + mbVertical(bVertical), + mbItalic(bItalic), + mbOutline(bOutline), + mbRTL(bRTL), + mbBiDiStrong(bBiDiStrong) + { + } + + // 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; } + + bool operator==(const ImpFontAttribute& 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()); + } + + static ImpFontAttribute* get_global_default() + { + static ImpFontAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpFontAttribute( + String(), String(), + 0, + false, false, false, false, false, false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + FontAttribute::FontAttribute( + const String& rFamilyName, + const String& rStyleName, + sal_uInt16 nWeight, + bool bSymbol, + bool bVertical, + bool bItalic, + bool bOutline, + bool bRTL, + bool bBiDiStrong) + : mpFontAttribute(new ImpFontAttribute( + rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bOutline, bRTL, bBiDiStrong)) + { + } + + FontAttribute::FontAttribute() + : mpFontAttribute(ImpFontAttribute::get_global_default()) + { + mpFontAttribute->mnRefCount++; + } + + FontAttribute::FontAttribute(const FontAttribute& rCandidate) + : mpFontAttribute(rCandidate.mpFontAttribute) + { + mpFontAttribute->mnRefCount++; + } + + FontAttribute::~FontAttribute() + { + if(mpFontAttribute->mnRefCount) + { + mpFontAttribute->mnRefCount--; + } + else + { + delete mpFontAttribute; + } + } + + bool FontAttribute::isDefault() const + { + return mpFontAttribute == ImpFontAttribute::get_global_default(); + } + + FontAttribute& FontAttribute::operator=(const FontAttribute& rCandidate) + { + if(rCandidate.mpFontAttribute != mpFontAttribute) + { + if(mpFontAttribute->mnRefCount) + { + mpFontAttribute->mnRefCount--; + } + else + { + delete mpFontAttribute; + } + + mpFontAttribute = rCandidate.mpFontAttribute; + mpFontAttribute->mnRefCount++; + } + + return *this; + } + + bool FontAttribute::operator==(const FontAttribute& rCandidate) const + { + if(rCandidate.mpFontAttribute == mpFontAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpFontAttribute == *mpFontAttribute); + } + + const String& FontAttribute::getFamilyName() const + { + return mpFontAttribute->getFamilyName(); + } + + const String& FontAttribute::getStyleName() const + { + return mpFontAttribute->getStyleName(); + } + + sal_uInt16 FontAttribute::getWeight() const + { + return mpFontAttribute->getWeight(); } + + bool FontAttribute::getSymbol() const + { + return mpFontAttribute->getSymbol(); + } + + bool FontAttribute::getVertical() const + { + return mpFontAttribute->getVertical(); + } + + bool FontAttribute::getItalic() const + { + return mpFontAttribute->getItalic(); + } + + bool FontAttribute::getOutline() const + { + return mpFontAttribute->getOutline(); + } + + bool FontAttribute::getRTL() const + { + return mpFontAttribute->getRTL(); + } + + bool FontAttribute::getBiDiStrong() const + { + return mpFontAttribute->getBiDiStrong(); + } + } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/attribute/lineattribute.cxx b/drawinglayer/source/attribute/lineattribute.cxx index 5ab44b73db..1b5e46ef6d 100644 --- a/drawinglayer/source/attribute/lineattribute.cxx +++ b/drawinglayer/source/attribute/lineattribute.cxx @@ -37,6 +37,7 @@ #include "precompiled_drawinglayer.hxx" #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -44,6 +45,147 @@ namespace drawinglayer { namespace attribute { + class ImpLineAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // data definitions + basegfx::BColor maColor; // color + double mfWidth; // absolute line width + basegfx::B2DLineJoin meLineJoin; // type of LineJoin + + ImpLineAttribute( + const basegfx::BColor& rColor, + double fWidth, + basegfx::B2DLineJoin aB2DLineJoin) + : mnRefCount(0), + maColor(rColor), + mfWidth(fWidth), + meLineJoin(aB2DLineJoin) + { + } + + // data read access + const basegfx::BColor& getColor() const { return maColor; } + double getWidth() const { return mfWidth; } + basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; } + + bool operator==(const ImpLineAttribute& rCandidate) const + { + return (getColor() == rCandidate.getColor() + && getWidth() == rCandidate.getWidth() + && getLineJoin() == rCandidate.getLineJoin()); + } + + static ImpLineAttribute* get_global_default() + { + static ImpLineAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpLineAttribute( + basegfx::BColor(), + 0.0, + basegfx::B2DLINEJOIN_ROUND); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + LineAttribute::LineAttribute( + const basegfx::BColor& rColor, + double fWidth, + basegfx::B2DLineJoin aB2DLineJoin) + : mpLineAttribute(new ImpLineAttribute( + rColor, fWidth, aB2DLineJoin)) + { + } + + LineAttribute::LineAttribute() + : mpLineAttribute(ImpLineAttribute::get_global_default()) + { + mpLineAttribute->mnRefCount++; + } + + LineAttribute::LineAttribute(const LineAttribute& rCandidate) + : mpLineAttribute(rCandidate.mpLineAttribute) + { + mpLineAttribute->mnRefCount++; + } + + LineAttribute::~LineAttribute() + { + if(mpLineAttribute->mnRefCount) + { + mpLineAttribute->mnRefCount--; + } + else + { + delete mpLineAttribute; + } + } + + bool LineAttribute::isDefault() const + { + return mpLineAttribute == ImpLineAttribute::get_global_default(); + } + + LineAttribute& LineAttribute::operator=(const LineAttribute& rCandidate) + { + if(rCandidate.mpLineAttribute != mpLineAttribute) + { + if(mpLineAttribute->mnRefCount) + { + mpLineAttribute->mnRefCount--; + } + else + { + delete mpLineAttribute; + } + + mpLineAttribute = rCandidate.mpLineAttribute; + mpLineAttribute->mnRefCount++; + } + + return *this; + } + + bool LineAttribute::operator==(const LineAttribute& rCandidate) const + { + if(rCandidate.mpLineAttribute == mpLineAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpLineAttribute == *mpLineAttribute); + } + + const basegfx::BColor& LineAttribute::getColor() const + { + return mpLineAttribute->getColor(); + } + + double LineAttribute::getWidth() const + { + return mpLineAttribute->getWidth(); + } + + basegfx::B2DLineJoin LineAttribute::getLineJoin() const + { + return mpLineAttribute->getLineJoin(); + } + } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/attribute/linestartendattribute.cxx b/drawinglayer/source/attribute/linestartendattribute.cxx index eafcc7e3f4..b253d3d492 100644 --- a/drawinglayer/source/attribute/linestartendattribute.cxx +++ b/drawinglayer/source/attribute/linestartendattribute.cxx @@ -38,6 +38,7 @@ #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -45,11 +46,154 @@ namespace drawinglayer { namespace attribute { + class ImpLineStartEndAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // data definitions + double mfWidth; // absolute line StartEndGeometry base width + basegfx::B2DPolyPolygon maPolyPolygon; // the StartEndGeometry PolyPolygon + + // bitfield + unsigned mbCentered : 1; // use centered to ineStart/End point? + + ImpLineStartEndAttribute( + double fWidth, + const basegfx::B2DPolyPolygon& rPolyPolygon, + bool bCentered) + : mnRefCount(0), + mfWidth(fWidth), + maPolyPolygon(rPolyPolygon), + mbCentered(bCentered) + { + } + + // data read access + double getWidth() const { return mfWidth; } + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } + bool isCentered() const { return mbCentered; } + + bool operator==(const ImpLineStartEndAttribute& rCandidate) const + { + return (basegfx::fTools::equal(getWidth(), rCandidate.getWidth()) + && getB2DPolyPolygon() == rCandidate.getB2DPolyPolygon() + && isCentered() == rCandidate.isCentered()); + } + + static ImpLineStartEndAttribute* get_global_default() + { + static ImpLineStartEndAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpLineStartEndAttribute( + 0.0, + basegfx::B2DPolyPolygon(), + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + LineStartEndAttribute::LineStartEndAttribute( + double fWidth, + const basegfx::B2DPolyPolygon& rPolyPolygon, + bool bCentered) + : mpLineStartEndAttribute(new ImpLineStartEndAttribute( + fWidth, rPolyPolygon, bCentered)) + { + } + + LineStartEndAttribute::LineStartEndAttribute() + : mpLineStartEndAttribute(ImpLineStartEndAttribute::get_global_default()) + { + mpLineStartEndAttribute->mnRefCount++; + } + + LineStartEndAttribute::LineStartEndAttribute(const LineStartEndAttribute& rCandidate) + : mpLineStartEndAttribute(rCandidate.mpLineStartEndAttribute) + { + mpLineStartEndAttribute->mnRefCount++; + } + + LineStartEndAttribute::~LineStartEndAttribute() + { + if(mpLineStartEndAttribute->mnRefCount) + { + mpLineStartEndAttribute->mnRefCount--; + } + else + { + delete mpLineStartEndAttribute; + } + } + + bool LineStartEndAttribute::isDefault() const + { + return mpLineStartEndAttribute == ImpLineStartEndAttribute::get_global_default(); + } + + LineStartEndAttribute& LineStartEndAttribute::operator=(const LineStartEndAttribute& rCandidate) + { + if(rCandidate.mpLineStartEndAttribute != mpLineStartEndAttribute) + { + if(mpLineStartEndAttribute->mnRefCount) + { + mpLineStartEndAttribute->mnRefCount--; + } + else + { + delete mpLineStartEndAttribute; + } + + mpLineStartEndAttribute = rCandidate.mpLineStartEndAttribute; + mpLineStartEndAttribute->mnRefCount++; + } + + return *this; + } + + bool LineStartEndAttribute::operator==(const LineStartEndAttribute& rCandidate) const + { + if(rCandidate.mpLineStartEndAttribute == mpLineStartEndAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpLineStartEndAttribute == *mpLineStartEndAttribute); + } + + double LineStartEndAttribute::getWidth() const + { + return mpLineStartEndAttribute->getWidth(); + } + + const basegfx::B2DPolyPolygon& LineStartEndAttribute::getB2DPolyPolygon() const + { + return mpLineStartEndAttribute->getB2DPolyPolygon(); + } + + bool LineStartEndAttribute::isCentered() const + { + return mpLineStartEndAttribute->isCentered(); + } + bool LineStartEndAttribute::isActive() const { return (0.0 != getWidth() - && 0.0 != getB2DPolyPolygon().count() - && 0.0 != getB2DPolyPolygon().getB2DPolygon(0L).count()); + && 0 != getB2DPolyPolygon().count() + && 0 != getB2DPolyPolygon().getB2DPolygon(0).count()); } } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/attribute/makefile.mk b/drawinglayer/source/attribute/makefile.mk index 65f899f671..83eaa193bb 100644 --- a/drawinglayer/source/attribute/makefile.mk +++ b/drawinglayer/source/attribute/makefile.mk @@ -45,16 +45,23 @@ ENABLE_EXCEPTIONS=TRUE # --- Files ------------------------------------- SLOFILES= \ - $(SLO)$/fillattribute.obj \ - $(SLO)$/fillbitmapattribute.obj \ - $(SLO)$/fontattribute.obj \ - $(SLO)$/materialattribute3d.obj \ - $(SLO)$/sdrallattribute3d.obj \ - $(SLO)$/sdrattribute.obj \ - $(SLO)$/sdrattribute3d.obj \ - $(SLO)$/sdrfillbitmapattribute.obj \ - $(SLO)$/lineattribute.obj \ - $(SLO)$/linestartendattribute.obj \ + $(SLO)$/fillgradientattribute.obj \ + $(SLO)$/fillhatchattribute.obj \ + $(SLO)$/fillbitmapattribute.obj \ + $(SLO)$/fontattribute.obj \ + $(SLO)$/materialattribute3d.obj \ + $(SLO)$/sdrallattribute3d.obj \ + $(SLO)$/sdrlineattribute.obj \ + $(SLO)$/sdrlinestartendattribute.obj \ + $(SLO)$/sdrshadowattribute.obj \ + $(SLO)$/sdrfillattribute.obj \ + $(SLO)$/sdrobjectattribute3d.obj \ + $(SLO)$/sdrlightattribute3d.obj \ + $(SLO)$/sdrlightingattribute3d.obj \ + $(SLO)$/sdrsceneattribute3d.obj \ + $(SLO)$/sdrfillbitmapattribute.obj \ + $(SLO)$/lineattribute.obj \ + $(SLO)$/linestartendattribute.obj \ $(SLO)$/strokeattribute.obj # --- Targets ---------------------------------- diff --git a/drawinglayer/source/attribute/materialattribute3d.cxx b/drawinglayer/source/attribute/materialattribute3d.cxx index b030017780..97e1fe2d78 100644 --- a/drawinglayer/source/attribute/materialattribute3d.cxx +++ b/drawinglayer/source/attribute/materialattribute3d.cxx @@ -48,74 +48,87 @@ namespace drawinglayer class ImpMaterialAttribute3D { public: + // refcounter + sal_uInt32 mnRefCount; + // materialAttribute3D definitions basegfx::BColor maColor; // object color basegfx::BColor maSpecular; // material specular color basegfx::BColor maEmission; // material emissive color - sal_uInt16 mnSpecularIntensity; // material specular intensity [0..128] - - // refcounter - sal_uInt32 mnRefCount; + sal_uInt16 mnSpecularIntensity; // material specular intensity [0..128] ImpMaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) - : maColor(rColor), + : mnRefCount(0), + maColor(rColor), maSpecular(rSpecular), maEmission(rEmission), - mnSpecularIntensity(nSpecularIntensity), - mnRefCount(0L) + mnSpecularIntensity(nSpecularIntensity) { } ImpMaterialAttribute3D(const basegfx::BColor& rColor) - : maColor(rColor), + : mnRefCount(0), + maColor(rColor), maSpecular(1.0, 1.0, 1.0), maEmission(), - mnSpecularIntensity(15), - mnRefCount(0L) + mnSpecularIntensity(15) { } - ImpMaterialAttribute3D() - : mnSpecularIntensity(0), - mnRefCount(0L) - { - } + // data read access + const basegfx::BColor& getColor() const { return maColor; } + const basegfx::BColor& getSpecular() const { return maSpecular; } + const basegfx::BColor& getEmission() const { return maEmission; } + sal_uInt16 getSpecularIntensity() const { return mnSpecularIntensity; } bool operator==(const ImpMaterialAttribute3D& rCandidate) const { - return (maColor == rCandidate.maColor - && maSpecular == rCandidate.maSpecular - && maEmission == rCandidate.maEmission - && mnSpecularIntensity == rCandidate.mnSpecularIntensity); + return (getColor() == rCandidate.getColor() + && getSpecular() == rCandidate.getSpecular() + && getEmission() == rCandidate.getEmission() + && getSpecularIntensity() == rCandidate.getSpecularIntensity()); } - const basegfx::BColor& getColor() const { return maColor; } - const basegfx::BColor& getSpecular() const { return maSpecular; } - const basegfx::BColor& getEmission() const { return maEmission; } - sal_uInt16 getSpecularIntensity() const { return mnSpecularIntensity; } - }; - } // end of anonymous namespace -} // end of namespace drawinglayer + static ImpMaterialAttribute3D* get_global_default() + { + static ImpMaterialAttribute3D* pDefault = 0; -////////////////////////////////////////////////////////////////////////////// + if(!pDefault) + { + pDefault = new ImpMaterialAttribute3D( + basegfx::BColor(), + basegfx::BColor(), + basegfx::BColor(), + 0); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } -namespace drawinglayer -{ - namespace attribute - { - MaterialAttribute3D::MaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) - : mpMaterialAttribute3D(new ImpMaterialAttribute3D(rColor, rSpecular, rEmission, nSpecularIntensity)) + return pDefault; + } + }; + + MaterialAttribute3D::MaterialAttribute3D( + const basegfx::BColor& rColor, + const basegfx::BColor& rSpecular, + const basegfx::BColor& rEmission, + sal_uInt16 nSpecularIntensity) + : mpMaterialAttribute3D(new ImpMaterialAttribute3D( + rColor, rSpecular, rEmission, nSpecularIntensity)) { } - MaterialAttribute3D::MaterialAttribute3D(const basegfx::BColor& rColor) + MaterialAttribute3D::MaterialAttribute3D( + const basegfx::BColor& rColor) : mpMaterialAttribute3D(new ImpMaterialAttribute3D(rColor)) { } MaterialAttribute3D::MaterialAttribute3D() - : mpMaterialAttribute3D(new ImpMaterialAttribute3D()) + : mpMaterialAttribute3D(ImpMaterialAttribute3D::get_global_default()) { + mpMaterialAttribute3D->mnRefCount++; } MaterialAttribute3D::MaterialAttribute3D(const MaterialAttribute3D& rCandidate) @@ -136,6 +149,11 @@ namespace drawinglayer } } + bool MaterialAttribute3D::isDefault() const + { + return mpMaterialAttribute3D == ImpMaterialAttribute3D::get_global_default(); + } + MaterialAttribute3D& MaterialAttribute3D::operator=(const MaterialAttribute3D& rCandidate) { if(rCandidate.mpMaterialAttribute3D != mpMaterialAttribute3D) @@ -163,6 +181,11 @@ namespace drawinglayer return true; } + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + return (*rCandidate.mpMaterialAttribute3D == *mpMaterialAttribute3D); } diff --git a/drawinglayer/source/attribute/sdrallattribute3d.cxx b/drawinglayer/source/attribute/sdrallattribute3d.cxx index 4bc4b642f9..34b627c4e6 100644 --- a/drawinglayer/source/attribute/sdrallattribute3d.cxx +++ b/drawinglayer/source/attribute/sdrallattribute3d.cxx @@ -37,12 +37,6 @@ #include "precompiled_drawinglayer.hxx" #include -#include -#include - -////////////////////////////////////////////////////////////////////////////// -// pointer compare define -#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) ////////////////////////////////////////////////////////////////////////////// @@ -50,150 +44,47 @@ namespace drawinglayer { namespace attribute { - SdrLineFillShadowAttribute::SdrLineFillShadowAttribute( - SdrLineAttribute* pLine, - SdrFillAttribute* pFill, - SdrLineStartEndAttribute* pLineStartEnd, - SdrShadowAttribute* pShadow, - FillGradientAttribute* pFillFloatTransGradient) - : mpShadow(pShadow), - mpLine(pLine), - mpLineStartEnd(pLineStartEnd), - mpFill(pFill), - mpFillFloatTransGradient(pFillFloatTransGradient) + SdrLineFillShadowAttribute3D::SdrLineFillShadowAttribute3D( + const SdrLineAttribute& rLine, + const SdrFillAttribute& rFill, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const FillGradientAttribute& rFillFloatTransGradient) + : maLine(rLine), + maFill(rFill), + maLineStartEnd(rLineStartEnd), + maShadow(rShadow), + maFillFloatTransGradient(rFillFloatTransGradient) { } - SdrLineFillShadowAttribute::SdrLineFillShadowAttribute( - const SdrLineFillShadowAttribute& rCandidate) - : mpShadow(0), - mpLine(0), - mpLineStartEnd(0), - mpFill(0), - mpFillFloatTransGradient(0) + SdrLineFillShadowAttribute3D::SdrLineFillShadowAttribute3D() + : maLine(), + maFill(), + maLineStartEnd(), + maShadow(), + maFillFloatTransGradient() { - *this = rCandidate; } - SdrLineFillShadowAttribute::~SdrLineFillShadowAttribute() + bool SdrLineFillShadowAttribute3D::isDefault() const { - delete mpShadow; - delete mpLine; - delete mpLineStartEnd; - delete mpFill; - delete mpFillFloatTransGradient; + return(getLine().isDefault() + && getFill().isDefault() + && getLineStartEnd().isDefault() + && getShadow().isDefault() + && getFillFloatTransGradient().isDefault()); } - SdrLineFillShadowAttribute& SdrLineFillShadowAttribute::operator=(const SdrLineFillShadowAttribute& rCandidate) + bool SdrLineFillShadowAttribute3D::operator==(const SdrLineFillShadowAttribute3D& rCandidate) const { - // handle mpShadow - { - // delete local mpShadow if necessary - if(mpShadow) - { - delete mpShadow; - mpShadow = 0; - } - - // copy mpShadow if necessary - if(rCandidate.mpShadow) - { - mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow); - } - } - - // handle mpLine - { - // delete local mpLine if necessary - if(mpLine) - { - delete mpLine; - mpLine = 0; - } - - // copy mpLine if necessary - if(rCandidate.mpLine) - { - mpLine = new SdrLineAttribute(*rCandidate.mpLine); - } - } - - // handle mpLineStartEnd - { - // delete local mpLineStartEnd if necessary - if(mpLineStartEnd) - { - delete mpLineStartEnd; - mpLineStartEnd = 0; - } - - // copy mpLineStartEnd if necessary - if(rCandidate.mpLineStartEnd) - { - mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd); - } - } - - // handle mpFill - { - // delete local mpFill if necessary - if(mpFill) - { - delete mpFill; - mpFill = 0; - } - - // copy mpFill if necessary - if(rCandidate.mpFill) - { - mpFill = new SdrFillAttribute(*rCandidate.mpFill); - } - } - - // handle mpFillFloatTransGradient - { - // delete local mpFillFloatTransGradient if necessary - if(mpFillFloatTransGradient) - { - delete mpFillFloatTransGradient; - mpFillFloatTransGradient = 0; - } - - // copy mpFillFloatTransGradient if necessary - if(rCandidate.mpFillFloatTransGradient) - { - mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient); - } - } - - return *this; - } - - bool SdrLineFillShadowAttribute::operator==(const SdrLineFillShadowAttribute& rCandidate) const - { - // handle mpShadow - if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow)) - return false; - - // handle mpLine - if(!pointerOrContentEqual(mpLine, rCandidate.mpLine)) - return false; - - // handle mpLineStartEnd - if(!pointerOrContentEqual(mpLineStartEnd, rCandidate.mpLineStartEnd)) - return false; - - // handle mpFill - if(!pointerOrContentEqual(mpFill, rCandidate.mpFill)) - return false; - - // handle mpFillFloatTransGradient - if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient)) - return false; - - return true; + return(getLine() == rCandidate.getLine() + && getFill() == rCandidate.getFill() + && getLineStartEnd() == rCandidate.getLineStartEnd() + && getShadow() == rCandidate.getShadow() + && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient()); } - } // end of namespace attribute + } // end of namespace overlay } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/source/attribute/sdrattribute.cxx b/drawinglayer/source/attribute/sdrattribute.cxx deleted file mode 100644 index 4955ceddc9..0000000000 --- a/drawinglayer/source/attribute/sdrattribute.cxx +++ /dev/null @@ -1,293 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: sdrattribute.cxx,v $ - * - * $Revision: 1.5 $ - * - * 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 -#include -#include - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrLineAttribute::SdrLineAttribute( - basegfx::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor, - const ::std::vector< double >& rDotDashArray, double fFullDotDashLen) - : meJoin(eJoin), - mfWidth(fWidth), - mfTransparence(fTransparence), - maColor(rColor), - maDotDashArray(rDotDashArray), - mfFullDotDashLen(fFullDotDashLen) - { - } - - SdrLineAttribute::SdrLineAttribute(const basegfx::BColor& rColor) - : meJoin(basegfx::B2DLINEJOIN_NONE), - mfWidth(0.0), - mfTransparence(0.0), - maColor(rColor), - maDotDashArray(), - mfFullDotDashLen(0.0) - { - } - - SdrLineAttribute::~SdrLineAttribute() - { - } - - bool SdrLineAttribute::operator==(const SdrLineAttribute& rCandidate) const - { - return (meJoin == rCandidate.meJoin - && mfWidth == rCandidate.mfWidth - && mfTransparence == rCandidate.mfTransparence - && maColor == rCandidate.maColor - && maDotDashArray == rCandidate.maDotDashArray); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrLineStartEndAttribute::SdrLineStartEndAttribute( - const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon, - double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered) - : maStartPolyPolygon(rStartPolyPolygon), - maEndPolyPolygon(rEndPolyPolygon), - mfStartWidth(fStartWidth), - mfEndWidth(fEndWidth), - mbStartActive(bStartActive), - mbEndActive(bEndActive), - mbStartCentered(bStartCentered), - mbEndCentered(bEndCentered) - { - } - - SdrLineStartEndAttribute::~SdrLineStartEndAttribute() - { - } - - bool SdrLineStartEndAttribute::operator==(const SdrLineStartEndAttribute& rCandidate) const - { - return (mbStartActive == rCandidate.mbStartActive - && mbEndActive == rCandidate.mbEndActive - && mbStartCentered == rCandidate.mbStartCentered - && mbEndCentered == rCandidate.mbEndCentered - && mfStartWidth == rCandidate.mfStartWidth - && mfEndWidth == rCandidate.mfEndWidth - && maStartPolyPolygon == rCandidate.maStartPolyPolygon - && maEndPolyPolygon == rCandidate.maEndPolyPolygon); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrShadowAttribute::SdrShadowAttribute(const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor) - : maOffset(rOffset), - mfTransparence(fTransparence), - maColor(rColor) - { - } - - SdrShadowAttribute::~SdrShadowAttribute() - { - } - - bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const - { - return (mfTransparence == rCandidate.mfTransparence - && maColor == rCandidate.maColor - && maOffset == rCandidate.maOffset); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrFillAttribute::SdrFillAttribute( - double fTransparence, - const basegfx::BColor& rColor, - FillGradientAttribute* pGradient, - FillHatchAttribute* pHatch, - SdrFillBitmapAttribute* pBitmap) - : mfTransparence(fTransparence), - maColor(rColor), - mpGradient(pGradient), - mpHatch(pHatch), - mpBitmap(pBitmap) - { - } - - SdrFillAttribute::SdrFillAttribute(const SdrFillAttribute& rCandidate) - : mfTransparence(1.0), - mpGradient(0L), - mpHatch(0L), - mpBitmap(0L) - { - if(!(*this == rCandidate)) - { - *this = rCandidate; - } - } - - SdrFillAttribute::~SdrFillAttribute() - { - delete mpGradient; - delete mpHatch; - delete mpBitmap; - } - - SdrFillAttribute& SdrFillAttribute::operator=(const SdrFillAttribute& rCandidate) - { - // copy data - mfTransparence = rCandidate.mfTransparence; - maColor = rCandidate.maColor; - - // handle mpGradient - { - // delete local mpGradient if necessary - if(mpGradient && ((!rCandidate.mpGradient) || (!(*mpGradient == *rCandidate.mpGradient)))) - { - delete mpGradient; - mpGradient = 0L; - } - - // copy mpGradient if necessary - if(!mpGradient && rCandidate.mpGradient) - { - mpGradient = new FillGradientAttribute(*rCandidate.mpGradient); - } - } - - // handle mpHatch - { - // delete local mpHatch if necessary - if(mpHatch && ((!rCandidate.mpHatch) || (!(*mpHatch == *rCandidate.mpHatch)))) - { - delete mpHatch; - mpHatch = 0L; - } - - // copy mpHatch if necessary - if(!mpHatch && rCandidate.mpHatch) - { - mpHatch = new FillHatchAttribute(*rCandidate.mpHatch); - } - } - - // handle mpBitmap - { - // delete local mpBitmap if necessary - if(mpBitmap && ((!rCandidate.mpBitmap) || (!(*mpBitmap == *rCandidate.mpBitmap)))) - { - delete mpBitmap; - mpBitmap = 0L; - } - - // copy mpBitmap if necessary - if(!mpBitmap && rCandidate.mpBitmap) - { - mpBitmap = new SdrFillBitmapAttribute(*rCandidate.mpBitmap); - } - } - - return *this; - } - - bool SdrFillAttribute::operator==(const SdrFillAttribute& rCandidate) const - { - if(mfTransparence != rCandidate.mfTransparence) - return false; - - if(mpGradient) - { - if(!rCandidate.mpGradient) - return false; - - if(!(*mpGradient == *rCandidate.mpGradient)) - return false; - } - else if(mpHatch) - { - if(!rCandidate.mpHatch) - return false; - - if(!(*mpHatch == *rCandidate.mpHatch)) - return false; - - if(mpHatch->isFillBackground() && !(maColor == rCandidate.maColor)) - return false; - } - else if(mpBitmap) - { - if(!rCandidate.mpBitmap) - return false; - - if(!(*mpBitmap == *rCandidate.mpBitmap)) - return false; - } - else - { - if(!rCandidate.isColor()) - return false; - - if(!(maColor == rCandidate.maColor)) - return false; - } - - return true; - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/attribute/sdrattribute3d.cxx b/drawinglayer/source/attribute/sdrattribute3d.cxx deleted file mode 100644 index fef84cf2eb..0000000000 --- a/drawinglayer/source/attribute/sdrattribute3d.cxx +++ /dev/null @@ -1,219 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: sdrattribute3d.cxx,v $ - * - * $Revision: 1.5 $ - * - * 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 - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - Sdr3DObjectAttribute::Sdr3DObjectAttribute( - ::com::sun::star::drawing::NormalsKind aNormalsKind, - ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX, - ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY, - ::com::sun::star::drawing::TextureKind2 aTextureKind, - ::com::sun::star::drawing::TextureMode aTextureMode, - const MaterialAttribute3D& rMaterial, - bool bNormalsInvert, - bool bDoubleSided, - bool bShadow3D, - bool bTextureFilter, - bool bReducedLineGeometry) - : maNormalsKind(aNormalsKind), - maTextureProjectionX(aTextureProjectionX), - maTextureProjectionY(aTextureProjectionY), - maTextureKind(aTextureKind), - maTextureMode(aTextureMode), - maMaterial(rMaterial), - mbNormalsInvert(bNormalsInvert), - mbDoubleSided(bDoubleSided), - mbShadow3D(bShadow3D), - mbTextureFilter(bTextureFilter), - mbReducedLineGeometry(bReducedLineGeometry) - { - } - - bool Sdr3DObjectAttribute::operator==(const Sdr3DObjectAttribute& rCandidate) const - { - return (maNormalsKind == rCandidate.maNormalsKind - && maTextureProjectionX == rCandidate.maTextureProjectionX - && maTextureProjectionY == rCandidate.maTextureProjectionY - && maTextureKind == rCandidate.maTextureKind - && maTextureMode == rCandidate.maTextureMode - && maMaterial == rCandidate.maMaterial - && mbNormalsInvert == rCandidate.mbNormalsInvert - && mbDoubleSided == rCandidate.mbDoubleSided - && mbShadow3D == rCandidate.mbShadow3D - && mbTextureFilter == rCandidate.mbTextureFilter - && mbReducedLineGeometry == rCandidate.mbReducedLineGeometry); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - Sdr3DLightAttribute::Sdr3DLightAttribute(const basegfx::BColor& rColor, const basegfx::B3DVector& rDirection, bool bSpecular) - : maColor(rColor), - maDirection(rDirection), - mbSpecular(bSpecular) - { - } - - bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const - { - return (maColor == rCandidate.maColor - && maDirection == rCandidate.maDirection - && mbSpecular == rCandidate.mbSpecular); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrLightingAttribute::SdrLightingAttribute( - const basegfx::BColor& rAmbientLight, - const ::std::vector< Sdr3DLightAttribute >& rLightVector) - : maAmbientLight(rAmbientLight), - maLightVector(rLightVector) - { - } - - bool SdrLightingAttribute::operator==(const SdrLightingAttribute& rCandidate) const - { - return (maAmbientLight == rCandidate.maAmbientLight - && maLightVector == rCandidate.maLightVector); - } - - // color model solver - basegfx::BColor SdrLightingAttribute::solveColorModel( - const basegfx::B3DVector& rNormalInEyeCoordinates, - const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, - const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const - { - // initialize with emissive color - basegfx::BColor aRetval(rEmission); - - // take care of global ambient light - aRetval += getAmbientLight() * rColor; - - // prepare light access. Is there a light? - const sal_uInt32 nLightCount(maLightVector.size()); - - if(nLightCount && !rNormalInEyeCoordinates.equalZero()) - { - // prepare normal - basegfx::B3DVector aEyeNormal(rNormalInEyeCoordinates); - aEyeNormal.normalize(); - - for(sal_uInt32 a(0L); a < nLightCount; a++) - { - const Sdr3DLightAttribute& rLight(maLightVector[a]); - const double fCosFac(rLight.getDirection().scalar(aEyeNormal)); - - if(basegfx::fTools::more(fCosFac, 0.0)) - { - aRetval += ((rLight.getColor() * rColor) * fCosFac); - - if(rLight.getSpecular()) - { - // expand by (0.0, 0.0, 1.0) in Z - basegfx::B3DVector aSpecularNormal(rLight.getDirection().getX(), rLight.getDirection().getY(), rLight.getDirection().getZ() + 1.0); - aSpecularNormal.normalize(); - double fCosFac2(aSpecularNormal.scalar(aEyeNormal)); - - if(basegfx::fTools::more(fCosFac2, 0.0)) - { - fCosFac2 = pow(fCosFac2, (double)nSpecularIntensity); - aRetval += (rSpecular * fCosFac2); - } - } - } - } - } - - // clamp to color space before usage - aRetval.clamp(); - - return aRetval; - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrSceneAttribute::SdrSceneAttribute( - double fDistance, - double fShadowSlant, - ::com::sun::star::drawing::ProjectionMode aProjectionMode, - ::com::sun::star::drawing::ShadeMode aShadeMode, - bool bTwoSidedLighting) - : mfDistance(fDistance), - mfShadowSlant(fShadowSlant), - maProjectionMode(aProjectionMode), - maShadeMode(aShadeMode), - mbTwoSidedLighting(bTwoSidedLighting) - { - } - - bool SdrSceneAttribute::operator==(const SdrSceneAttribute& rCandidate) const - { - return (mfDistance == rCandidate.mfDistance - && mfShadowSlant == rCandidate.mfShadowSlant - && maProjectionMode == rCandidate.maProjectionMode - && maShadeMode == rCandidate.maShadeMode - && mbTwoSidedLighting == rCandidate.mbTwoSidedLighting); - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/attribute/sdrfillattribute.cxx b/drawinglayer/source/attribute/sdrfillattribute.cxx new file mode 100644 index 0000000000..1953a1d292 --- /dev/null +++ b/drawinglayer/source/attribute/sdrfillattribute.cxx @@ -0,0 +1,221 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdrFillAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // fill definitions + double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. + basegfx::BColor maColor; // fill color + FillGradientAttribute maGradient; // fill gradient (if used) + FillHatchAttribute maHatch; // fill hatch (if used) + SdrFillBitmapAttribute maBitmap; // fill bitmap (if used) + + public: + ImpSdrFillAttribute( + double fTransparence, + const basegfx::BColor& rColor, + const FillGradientAttribute& rGradient, + const FillHatchAttribute& rHatch, + const SdrFillBitmapAttribute& rBitmap) + : mnRefCount(0), + mfTransparence(fTransparence), + maColor(rColor), + maGradient(rGradient), + maHatch(rHatch), + maBitmap(rBitmap) + { + } + + // data read access + double getTransparence() const { return mfTransparence; } + const basegfx::BColor& getColor() const { return maColor; } + const FillGradientAttribute& getGradient() const { return maGradient; } + const FillHatchAttribute& getHatch() const { return maHatch; } + const SdrFillBitmapAttribute& getBitmap() const { return maBitmap; } + + // compare operator + bool operator==(const ImpSdrFillAttribute& rCandidate) const + { + return(getTransparence() == rCandidate.getTransparence() + && getColor() == rCandidate.getColor() + && getGradient() == rCandidate.getGradient() + && getHatch() == rCandidate.getHatch() + && getBitmap() == rCandidate.getBitmap()); + } + + static ImpSdrFillAttribute* get_global_default() + { + static ImpSdrFillAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrFillAttribute( + 0.0, + basegfx::BColor(), + FillGradientAttribute(), + FillHatchAttribute(), + SdrFillBitmapAttribute()); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + SdrFillAttribute::SdrFillAttribute( + double fTransparence, + const basegfx::BColor& rColor, + const FillGradientAttribute& rGradient, + const FillHatchAttribute& rHatch, + const SdrFillBitmapAttribute& rBitmap) + : mpSdrFillAttribute(new ImpSdrFillAttribute( + fTransparence, rColor, rGradient, rHatch, rBitmap)) + { + } + + SdrFillAttribute::SdrFillAttribute() + : mpSdrFillAttribute(ImpSdrFillAttribute::get_global_default()) + { + mpSdrFillAttribute->mnRefCount++; + } + + SdrFillAttribute::SdrFillAttribute(const SdrFillAttribute& rCandidate) + : mpSdrFillAttribute(rCandidate.mpSdrFillAttribute) + { + mpSdrFillAttribute->mnRefCount++; + } + + SdrFillAttribute::~SdrFillAttribute() + { + if(mpSdrFillAttribute->mnRefCount) + { + mpSdrFillAttribute->mnRefCount--; + } + else + { + delete mpSdrFillAttribute; + } + } + + bool SdrFillAttribute::isDefault() const + { + return mpSdrFillAttribute == ImpSdrFillAttribute::get_global_default(); + } + + SdrFillAttribute& SdrFillAttribute::operator=(const SdrFillAttribute& rCandidate) + { + if(rCandidate.mpSdrFillAttribute != mpSdrFillAttribute) + { + if(mpSdrFillAttribute->mnRefCount) + { + mpSdrFillAttribute->mnRefCount--; + } + else + { + delete mpSdrFillAttribute; + } + + mpSdrFillAttribute = rCandidate.mpSdrFillAttribute; + mpSdrFillAttribute->mnRefCount++; + } + + return *this; + } + + bool SdrFillAttribute::operator==(const SdrFillAttribute& rCandidate) const + { + if(rCandidate.mpSdrFillAttribute == mpSdrFillAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrFillAttribute == *mpSdrFillAttribute); + } + + double SdrFillAttribute::getTransparence() const + { + return mpSdrFillAttribute->getTransparence(); + } + + const basegfx::BColor& SdrFillAttribute::getColor() const + { + return mpSdrFillAttribute->getColor(); + } + + const FillGradientAttribute& SdrFillAttribute::getGradient() const + { + return mpSdrFillAttribute->getGradient(); + } + + const FillHatchAttribute& SdrFillAttribute::getHatch() const + { + return mpSdrFillAttribute->getHatch(); + } + + const SdrFillBitmapAttribute& SdrFillAttribute::getBitmap() const + { + return mpSdrFillAttribute->getBitmap(); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx index c826aa5847..8e05a4c08f 100644 --- a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx +++ b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx @@ -38,8 +38,7 @@ #include #include -#include -#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -47,37 +46,213 @@ namespace drawinglayer { namespace attribute { + class ImpSdrFillBitmapAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // data definitions + Bitmap maBitmap; + basegfx::B2DVector maSize; + basegfx::B2DVector maOffset; + basegfx::B2DVector maOffsetPosition; + basegfx::B2DVector maRectPoint; + + // bitfield + unsigned mbTiling : 1; + unsigned mbStretch : 1; + unsigned mbLogSize : 1; + + ImpSdrFillBitmapAttribute( + const Bitmap& rBitmap, + const basegfx::B2DVector& rSize, + const basegfx::B2DVector& rOffset, + const basegfx::B2DVector& rOffsetPosition, + const basegfx::B2DVector& rRectPoint, + bool bTiling, + bool bStretch, + bool bLogSize) + : mnRefCount(0), + maBitmap(rBitmap), + maSize(rSize), + maOffset(rOffset), + maOffsetPosition(rOffsetPosition), + maRectPoint(rRectPoint), + mbTiling(bTiling), + mbStretch(bStretch), + mbLogSize(bLogSize) + { + } + + // data read access + const Bitmap& getBitmap() const { return maBitmap; } + const basegfx::B2DVector& getSize() const { return maSize; } + const basegfx::B2DVector& getOffset() const { return maOffset; } + const basegfx::B2DVector& getOffsetPosition() const { return maOffsetPosition; } + const basegfx::B2DVector& getRectPoint() const { return maRectPoint; } + bool getTiling() const { return mbTiling; } + bool getStretch() const { return mbStretch; } + bool getLogSize() const { return mbLogSize; } + + bool operator==(const ImpSdrFillBitmapAttribute& rCandidate) const + { + return (getBitmap() == rCandidate.getBitmap() + && getSize() == rCandidate.getSize() + && getOffset() == rCandidate.getOffset() + && getOffsetPosition() == rCandidate.getOffsetPosition() + && getRectPoint() == rCandidate.getRectPoint() + && getTiling() == rCandidate.getTiling() + && getStretch() == rCandidate.getStretch() + && getLogSize() == rCandidate.getLogSize()); + } + + static ImpSdrFillBitmapAttribute* get_global_default() + { + static ImpSdrFillBitmapAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrFillBitmapAttribute( + Bitmap(), + basegfx::B2DVector(), + basegfx::B2DVector(), + basegfx::B2DVector(), + basegfx::B2DVector(), + false, + false, + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + SdrFillBitmapAttribute::SdrFillBitmapAttribute( - const Bitmap& rBitmap, const basegfx::B2DVector& rSize, const basegfx::B2DVector& rOffset, - const basegfx::B2DVector& rOffsetPosition, const basegfx::B2DVector& rRectPoint, - bool bTiling, bool bStretch, bool bLogSize) - : maBitmap(rBitmap), - maSize(rSize), - maOffset(rOffset), - maOffsetPosition(rOffsetPosition), - maRectPoint(rRectPoint), - mbTiling(bTiling), - mbStretch(bStretch), - mbLogSize(bLogSize) + const Bitmap& rBitmap, + const basegfx::B2DVector& rSize, + const basegfx::B2DVector& rOffset, + const basegfx::B2DVector& rOffsetPosition, + const basegfx::B2DVector& rRectPoint, + bool bTiling, + bool bStretch, + bool bLogSize) + : mpSdrFillBitmapAttribute(new ImpSdrFillBitmapAttribute( + rBitmap, rSize, rOffset, rOffsetPosition, rRectPoint, bTiling, bStretch, bLogSize)) + { + } + + SdrFillBitmapAttribute::SdrFillBitmapAttribute() + : mpSdrFillBitmapAttribute(ImpSdrFillBitmapAttribute::get_global_default()) + { + mpSdrFillBitmapAttribute->mnRefCount++; + } + + SdrFillBitmapAttribute::SdrFillBitmapAttribute(const SdrFillBitmapAttribute& rCandidate) + : mpSdrFillBitmapAttribute(rCandidate.mpSdrFillBitmapAttribute) + { + mpSdrFillBitmapAttribute->mnRefCount++; + } + + SdrFillBitmapAttribute::~SdrFillBitmapAttribute() + { + if(mpSdrFillBitmapAttribute->mnRefCount) + { + mpSdrFillBitmapAttribute->mnRefCount--; + } + else + { + delete mpSdrFillBitmapAttribute; + } + } + + bool SdrFillBitmapAttribute::isDefault() const { + return mpSdrFillBitmapAttribute == ImpSdrFillBitmapAttribute::get_global_default(); + } + + SdrFillBitmapAttribute& SdrFillBitmapAttribute::operator=(const SdrFillBitmapAttribute& rCandidate) + { + if(rCandidate.mpSdrFillBitmapAttribute != mpSdrFillBitmapAttribute) + { + if(mpSdrFillBitmapAttribute->mnRefCount) + { + mpSdrFillBitmapAttribute->mnRefCount--; + } + else + { + delete mpSdrFillBitmapAttribute; + } + + mpSdrFillBitmapAttribute = rCandidate.mpSdrFillBitmapAttribute; + mpSdrFillBitmapAttribute->mnRefCount++; + } + + return *this; } bool SdrFillBitmapAttribute::operator==(const SdrFillBitmapAttribute& rCandidate) const { - return (maBitmap == rCandidate.maBitmap - && maSize == rCandidate.maSize - && maOffset == rCandidate.maOffset - && maOffsetPosition == rCandidate.maOffsetPosition - && maRectPoint == rCandidate.maRectPoint - && mbTiling == rCandidate.mbTiling - && mbStretch == rCandidate.mbStretch - && mbLogSize == rCandidate.mbLogSize); + if(rCandidate.mpSdrFillBitmapAttribute == mpSdrFillBitmapAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrFillBitmapAttribute == *mpSdrFillBitmapAttribute); + } + + const Bitmap& SdrFillBitmapAttribute::getBitmap() const + { + return mpSdrFillBitmapAttribute->getBitmap(); + } + + const basegfx::B2DVector& SdrFillBitmapAttribute::getSize() const + { + return mpSdrFillBitmapAttribute->getSize(); + } + + const basegfx::B2DVector& SdrFillBitmapAttribute::getOffset() const + { + return mpSdrFillBitmapAttribute->getOffset(); + } + + const basegfx::B2DVector& SdrFillBitmapAttribute::getOffsetPosition() const + { + return mpSdrFillBitmapAttribute->getOffsetPosition(); + } + + const basegfx::B2DVector& SdrFillBitmapAttribute::getRectPoint() const + { + return mpSdrFillBitmapAttribute->getRectPoint(); + } + + bool SdrFillBitmapAttribute::getTiling() const + { + return mpSdrFillBitmapAttribute->getTiling(); + } + + bool SdrFillBitmapAttribute::getStretch() const + { + return mpSdrFillBitmapAttribute->getStretch(); + } + + bool SdrFillBitmapAttribute::getLogSize() const + { + return mpSdrFillBitmapAttribute->getLogSize(); } FillBitmapAttribute SdrFillBitmapAttribute::getFillBitmapAttribute(const basegfx::B2DRange& rRange) const { // get logical size of bitmap (before expanding eventually) - Bitmap aBitmap(maBitmap); + Bitmap aBitmap(getBitmap()); const basegfx::B2DVector aLogicalSize(aBitmap.GetPrefSize().getWidth(), aBitmap.GetPrefSize().getHeight()); // get hor/ver shiftings and apply them eventually to the bitmap, but only @@ -85,17 +260,17 @@ namespace drawinglayer bool bExpandWidth(false); bool bExpandHeight(false); - if(mbTiling) + if(getTiling()) { - if(0.0 != maOffset.getX() || 0.0 != maOffset.getY()) + if(0.0 != getOffset().getX() || 0.0 != getOffset().getY()) { const sal_uInt32 nWidth(aBitmap.GetSizePixel().getWidth()); const sal_uInt32 nHeight(aBitmap.GetSizePixel().getHeight()); - if(0.0 != maOffset.getX()) + if(0.0 != getOffset().getX()) { bExpandHeight = true; - const sal_uInt32 nOffset(basegfx::fround(((double)nWidth * maOffset.getX()) / 100.0)); + const sal_uInt32 nOffset(basegfx::fround(((double)nWidth * getOffset().getX()) / 100.0)); aBitmap.Expand(0L, nHeight); const Size aSizeA(nOffset, nHeight); @@ -111,7 +286,7 @@ namespace drawinglayer else { bExpandWidth = true; - const sal_uInt32 nOffset(basegfx::fround(((double)nHeight * maOffset.getY()) / 100.0)); + const sal_uInt32 nOffset(basegfx::fround(((double)nHeight * getOffset().getY()) / 100.0)); aBitmap.Expand(nWidth, 0L); const Size aSize(nWidth, nHeight); @@ -137,7 +312,7 @@ namespace drawinglayer basegfx::B2DVector aBitmapTopLeft(0.0, 0.0); // are canges needed? - if(mbTiling || !mbStretch) + if(getTiling() || !getStretch()) { // init values with range sizes const double fRangeWidth(0.0 != rRange.getWidth() ? rRange.getWidth() : 1.0); @@ -145,15 +320,15 @@ namespace drawinglayer aBitmapSize = basegfx::B2DPoint(fRangeWidth, fRangeHeight); // size changes - if(0.0 != maSize.getX()) + if(0.0 != getSize().getX()) { - if(maSize.getX() < 0.0) + if(getSize().getX() < 0.0) { - aBitmapSize.setX(aBitmapSize.getX() * (maSize.getX() * -0.01)); + aBitmapSize.setX(aBitmapSize.getX() * (getSize().getX() * -0.01)); } else { - aBitmapSize.setX(maSize.getX()); + aBitmapSize.setX(getSize().getX()); } } else @@ -161,15 +336,15 @@ namespace drawinglayer aBitmapSize.setX(aLogicalSize.getX()); } - if(0.0 != maSize.getY()) + if(0.0 != getSize().getY()) { - if(maSize.getY() < 0.0) + if(getSize().getY() < 0.0) { - aBitmapSize.setY(aBitmapSize.getY() * (maSize.getY() * -0.01)); + aBitmapSize.setY(aBitmapSize.getY() * (getSize().getY() * -0.01)); } else { - aBitmapSize.setY(maSize.getY()); + aBitmapSize.setY(getSize().getY()); } } else @@ -178,7 +353,7 @@ namespace drawinglayer } // get values, force to centered if necessary - const basegfx::B2DVector aRectPoint(mbTiling ? maRectPoint : basegfx::B2DVector(0.0, 0.0)); + const basegfx::B2DVector aRectPoint(getTiling() ? getRectPoint() : basegfx::B2DVector(0.0, 0.0)); // position changes X if(0.0 == aRectPoint.getX()) @@ -190,9 +365,9 @@ namespace drawinglayer aBitmapTopLeft.setX(fRangeWidth - aBitmapSize.getX()); } - if(mbTiling && 0.0 != maOffsetPosition.getX()) + if(getTiling() && 0.0 != getOffsetPosition().getX()) { - aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (maOffsetPosition.getX() * 0.01))); + aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (getOffsetPosition().getX() * 0.01))); } // position changes Y @@ -205,9 +380,9 @@ namespace drawinglayer aBitmapTopLeft.setY(fRangeHeight - aBitmapSize.getY()); } - if(mbTiling && 0.0 != maOffsetPosition.getY()) + if(getTiling() && 0.0 != getOffsetPosition().getY()) { - aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (maOffsetPosition.getY() * 0.01))); + aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (getOffsetPosition().getY() * 0.01))); } // apply expand @@ -228,7 +403,7 @@ namespace drawinglayer aBitmapSize.setY(aBitmapSize.getY() / fRangeHeight); } - return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, mbTiling); + return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, getTiling()); } } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/attribute/sdrlightattribute3d.cxx b/drawinglayer/source/attribute/sdrlightattribute3d.cxx new file mode 100644 index 0000000000..c54f3490b1 --- /dev/null +++ b/drawinglayer/source/attribute/sdrlightattribute3d.cxx @@ -0,0 +1,196 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdr3DLightAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // 3D light attribute definitions + basegfx::BColor maColor; + basegfx::B3DVector maDirection; + + // bitfield + unsigned mbSpecular : 1; + + ImpSdr3DLightAttribute( + const basegfx::BColor& rColor, + const basegfx::B3DVector& rDirection, + bool bSpecular) + : mnRefCount(0), + maColor(rColor), + maDirection(rDirection), + mbSpecular(bSpecular) + { + } + + // data read access + const basegfx::BColor& getColor() const { return maColor; } + const basegfx::B3DVector& getDirection() const { return maDirection; } + bool getSpecular() const { return mbSpecular; } + + bool operator==(const ImpSdr3DLightAttribute& rCandidate) const + { + return (getColor() == rCandidate.getColor() + && getDirection() == rCandidate.getDirection() + && getSpecular() == rCandidate.getSpecular()); + } + + static ImpSdr3DLightAttribute* get_global_default() + { + static ImpSdr3DLightAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdr3DLightAttribute( + basegfx::BColor(), + basegfx::B3DVector(), + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + Sdr3DLightAttribute::Sdr3DLightAttribute( + const basegfx::BColor& rColor, + const basegfx::B3DVector& rDirection, + bool bSpecular) + : mpSdr3DLightAttribute(new ImpSdr3DLightAttribute( + rColor, rDirection, bSpecular)) + { + } + + Sdr3DLightAttribute::Sdr3DLightAttribute() + : mpSdr3DLightAttribute(ImpSdr3DLightAttribute::get_global_default()) + { + mpSdr3DLightAttribute->mnRefCount++; + } + + Sdr3DLightAttribute::Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate) + : mpSdr3DLightAttribute(rCandidate.mpSdr3DLightAttribute) + { + mpSdr3DLightAttribute->mnRefCount++; + } + + Sdr3DLightAttribute::~Sdr3DLightAttribute() + { + if(mpSdr3DLightAttribute->mnRefCount) + { + mpSdr3DLightAttribute->mnRefCount--; + } + else + { + delete mpSdr3DLightAttribute; + } + } + + bool Sdr3DLightAttribute::isDefault() const + { + return mpSdr3DLightAttribute == ImpSdr3DLightAttribute::get_global_default(); + } + + Sdr3DLightAttribute& Sdr3DLightAttribute::operator=(const Sdr3DLightAttribute& rCandidate) + { + if(rCandidate.mpSdr3DLightAttribute != mpSdr3DLightAttribute) + { + if(mpSdr3DLightAttribute->mnRefCount) + { + mpSdr3DLightAttribute->mnRefCount--; + } + else + { + delete mpSdr3DLightAttribute; + } + + mpSdr3DLightAttribute = rCandidate.mpSdr3DLightAttribute; + mpSdr3DLightAttribute->mnRefCount++; + } + + return *this; + } + + bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const + { + if(rCandidate.mpSdr3DLightAttribute == mpSdr3DLightAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdr3DLightAttribute == *mpSdr3DLightAttribute); + } + + const basegfx::BColor& Sdr3DLightAttribute::getColor() const + { + return mpSdr3DLightAttribute->getColor(); + } + + const basegfx::B3DVector& Sdr3DLightAttribute::getDirection() const + { + return mpSdr3DLightAttribute->getDirection(); + } + + bool Sdr3DLightAttribute::getSpecular() const + { + return mpSdr3DLightAttribute->getSpecular(); + } + + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx new file mode 100644 index 0000000000..e5002fd261 --- /dev/null +++ b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx @@ -0,0 +1,235 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdrLightingAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // 3D light attribute definitions + basegfx::BColor maAmbientLight; + ::std::vector< Sdr3DLightAttribute > maLightVector; + + ImpSdrLightingAttribute( + const basegfx::BColor& rAmbientLight, + const ::std::vector< Sdr3DLightAttribute >& rLightVector) + : mnRefCount(0), + maAmbientLight(rAmbientLight), + maLightVector(rLightVector) + { + } + + // data read access + const basegfx::BColor& getAmbientLight() const { return maAmbientLight; } + const ::std::vector< Sdr3DLightAttribute >& getLightVector() const { return maLightVector; } + + bool operator==(const ImpSdrLightingAttribute& rCandidate) const + { + return (getAmbientLight() == rCandidate.getAmbientLight() + && getLightVector() == rCandidate.getLightVector()); + } + + static ImpSdrLightingAttribute* get_global_default() + { + static ImpSdrLightingAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrLightingAttribute( + basegfx::BColor(), + std::vector< Sdr3DLightAttribute >()); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + SdrLightingAttribute::SdrLightingAttribute( + const basegfx::BColor& rAmbientLight, + const ::std::vector< Sdr3DLightAttribute >& rLightVector) + : mpSdrLightingAttribute(new ImpSdrLightingAttribute( + rAmbientLight, rLightVector)) + { + } + + SdrLightingAttribute::SdrLightingAttribute() + : mpSdrLightingAttribute(ImpSdrLightingAttribute::get_global_default()) + { + mpSdrLightingAttribute->mnRefCount++; + } + + SdrLightingAttribute::SdrLightingAttribute(const SdrLightingAttribute& rCandidate) + : mpSdrLightingAttribute(rCandidate.mpSdrLightingAttribute) + { + mpSdrLightingAttribute->mnRefCount++; + } + + SdrLightingAttribute::~SdrLightingAttribute() + { + if(mpSdrLightingAttribute->mnRefCount) + { + mpSdrLightingAttribute->mnRefCount--; + } + else + { + delete mpSdrLightingAttribute; + } + } + + bool SdrLightingAttribute::isDefault() const + { + return mpSdrLightingAttribute == ImpSdrLightingAttribute::get_global_default(); + } + + SdrLightingAttribute& SdrLightingAttribute::operator=(const SdrLightingAttribute& rCandidate) + { + if(rCandidate.mpSdrLightingAttribute != mpSdrLightingAttribute) + { + if(mpSdrLightingAttribute->mnRefCount) + { + mpSdrLightingAttribute->mnRefCount--; + } + else + { + delete mpSdrLightingAttribute; + } + + mpSdrLightingAttribute = rCandidate.mpSdrLightingAttribute; + mpSdrLightingAttribute->mnRefCount++; + } + + return *this; + } + + bool SdrLightingAttribute::operator==(const SdrLightingAttribute& rCandidate) const + { + if(rCandidate.mpSdrLightingAttribute == mpSdrLightingAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrLightingAttribute == *mpSdrLightingAttribute); + } + + const basegfx::BColor& SdrLightingAttribute::getAmbientLight() const + { + return mpSdrLightingAttribute->getAmbientLight(); + } + + const ::std::vector< Sdr3DLightAttribute >& SdrLightingAttribute::getLightVector() const + { + return mpSdrLightingAttribute->getLightVector(); + } + + // color model solver + basegfx::BColor SdrLightingAttribute::solveColorModel( + const basegfx::B3DVector& rNormalInEyeCoordinates, + const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, + const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const + { + // initialize with emissive color + basegfx::BColor aRetval(rEmission); + + // take care of global ambient light + aRetval += mpSdrLightingAttribute->getAmbientLight() * rColor; + + // prepare light access. Is there a light? + const sal_uInt32 nLightCount(mpSdrLightingAttribute->getLightVector().size()); + + if(nLightCount && !rNormalInEyeCoordinates.equalZero()) + { + // prepare normal + basegfx::B3DVector aEyeNormal(rNormalInEyeCoordinates); + aEyeNormal.normalize(); + + for(sal_uInt32 a(0L); a < nLightCount; a++) + { + const Sdr3DLightAttribute& rLight(mpSdrLightingAttribute->getLightVector()[a]); + const double fCosFac(rLight.getDirection().scalar(aEyeNormal)); + + if(basegfx::fTools::more(fCosFac, 0.0)) + { + aRetval += ((rLight.getColor() * rColor) * fCosFac); + + if(rLight.getSpecular()) + { + // expand by (0.0, 0.0, 1.0) in Z + basegfx::B3DVector aSpecularNormal(rLight.getDirection().getX(), rLight.getDirection().getY(), rLight.getDirection().getZ() + 1.0); + aSpecularNormal.normalize(); + double fCosFac2(aSpecularNormal.scalar(aEyeNormal)); + + if(basegfx::fTools::more(fCosFac2, 0.0)) + { + fCosFac2 = pow(fCosFac2, (double)nSpecularIntensity); + aRetval += (rSpecular * fCosFac2); + } + } + } + } + } + + // clamp to color space before usage + aRetval.clamp(); + + return aRetval; + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/sdrlineattribute.cxx b/drawinglayer/source/attribute/sdrlineattribute.cxx new file mode 100644 index 0000000000..4490176a3e --- /dev/null +++ b/drawinglayer/source/attribute/sdrlineattribute.cxx @@ -0,0 +1,250 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdrLineAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // line definitions + basegfx::B2DLineJoin meJoin; // B2DLINEJOIN_* defines + double mfWidth; // 1/100th mm, 0.0==hair + double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. + basegfx::BColor maColor; // color of line + ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern + double mfFullDotDashLen; // sum of maDotDashArray (for convenience) + + ImpSdrLineAttribute( + basegfx::B2DLineJoin eJoin, + double fWidth, + double fTransparence, + const basegfx::BColor& rColor, + const ::std::vector< double >& rDotDashArray, + double fFullDotDashLen) + : mnRefCount(0), + meJoin(eJoin), + mfWidth(fWidth), + mfTransparence(fTransparence), + maColor(rColor), + maDotDashArray(rDotDashArray), + mfFullDotDashLen(fFullDotDashLen) + { + } + + ImpSdrLineAttribute(const basegfx::BColor& rColor) + : mnRefCount(0), + meJoin(basegfx::B2DLINEJOIN_NONE), + mfWidth(0.0), + mfTransparence(0.0), + maColor(rColor), + maDotDashArray(), + mfFullDotDashLen(0.0) + { + } + + // data read access + basegfx::B2DLineJoin getJoin() const { return meJoin; } + double getWidth() const { return mfWidth; } + double getTransparence() const { return mfTransparence; } + const basegfx::BColor& getColor() const { return maColor; } + const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; } + double getFullDotDashLen() const { return mfFullDotDashLen; } + + bool operator==(const ImpSdrLineAttribute& rCandidate) const + { + return (getJoin() == rCandidate.getJoin() + && getWidth() == rCandidate.getWidth() + && getTransparence() == rCandidate.getTransparence() + && getColor() == rCandidate.getColor() + && getDotDashArray() == rCandidate.getDotDashArray()); + } + + static ImpSdrLineAttribute* get_global_default() + { + static ImpSdrLineAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrLineAttribute( + basegfx::B2DLINEJOIN_ROUND, + 0.0, + 0.0, + basegfx::BColor(), + std::vector< double >(), + 0.0); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + SdrLineAttribute::SdrLineAttribute( + basegfx::B2DLineJoin eJoin, + double fWidth, + double fTransparence, + const basegfx::BColor& rColor, + const ::std::vector< double >& rDotDashArray, + double fFullDotDashLen) + : mpSdrLineAttribute(new ImpSdrLineAttribute( + eJoin, fWidth, fTransparence, rColor, rDotDashArray, fFullDotDashLen)) + { + } + + SdrLineAttribute::SdrLineAttribute( + const basegfx::BColor& rColor) + : mpSdrLineAttribute(new ImpSdrLineAttribute(rColor)) + { + } + + SdrLineAttribute::SdrLineAttribute() + : mpSdrLineAttribute(ImpSdrLineAttribute::get_global_default()) + { + mpSdrLineAttribute->mnRefCount++; + } + + SdrLineAttribute::SdrLineAttribute(const SdrLineAttribute& rCandidate) + : mpSdrLineAttribute(rCandidate.mpSdrLineAttribute) + { + mpSdrLineAttribute->mnRefCount++; + } + + SdrLineAttribute::~SdrLineAttribute() + { + if(mpSdrLineAttribute->mnRefCount) + { + mpSdrLineAttribute->mnRefCount--; + } + else + { + delete mpSdrLineAttribute; + } + } + + bool SdrLineAttribute::isDefault() const + { + return mpSdrLineAttribute == ImpSdrLineAttribute::get_global_default(); + } + + SdrLineAttribute& SdrLineAttribute::operator=(const SdrLineAttribute& rCandidate) + { + if(rCandidate.mpSdrLineAttribute != mpSdrLineAttribute) + { + if(mpSdrLineAttribute->mnRefCount) + { + mpSdrLineAttribute->mnRefCount--; + } + else + { + delete mpSdrLineAttribute; + } + + mpSdrLineAttribute = rCandidate.mpSdrLineAttribute; + mpSdrLineAttribute->mnRefCount++; + } + + return *this; + } + + bool SdrLineAttribute::operator==(const SdrLineAttribute& rCandidate) const + { + if(rCandidate.mpSdrLineAttribute == mpSdrLineAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrLineAttribute == *mpSdrLineAttribute); + } + + basegfx::B2DLineJoin SdrLineAttribute::getJoin() const + { + return mpSdrLineAttribute->getJoin(); + } + + double SdrLineAttribute::getWidth() const + { + return mpSdrLineAttribute->getWidth(); + } + + double SdrLineAttribute::getTransparence() const + { + return mpSdrLineAttribute->getTransparence(); + } + + const basegfx::BColor& SdrLineAttribute::getColor() const + { + return mpSdrLineAttribute->getColor(); + } + + const ::std::vector< double >& SdrLineAttribute::getDotDashArray() const + { + return mpSdrLineAttribute->getDotDashArray(); + } + + double SdrLineAttribute::getFullDotDashLen() const + { + return mpSdrLineAttribute->getFullDotDashLen(); + } + + bool SdrLineAttribute::isDashed() const + { + return (0L != getDotDashArray().size()); + } + + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/sdrlinestartendattribute.cxx b/drawinglayer/source/attribute/sdrlinestartendattribute.cxx new file mode 100644 index 0000000000..4f73f8654d --- /dev/null +++ b/drawinglayer/source/attribute/sdrlinestartendattribute.cxx @@ -0,0 +1,254 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdrLineStartEndAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // line arrow definitions + basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon + basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon + double mfStartWidth; // 1/100th mm + double mfEndWidth; // 1/100th mm + + // bitfield + unsigned mbStartActive : 1L; // start of Line is active + unsigned mbEndActive : 1L; // end of Line is active + unsigned mbStartCentered : 1L; // Line is centered on line start point + unsigned mbEndCentered : 1L; // Line is centered on line end point + + ImpSdrLineStartEndAttribute( + const basegfx::B2DPolyPolygon& rStartPolyPolygon, + const basegfx::B2DPolyPolygon& rEndPolyPolygon, + double fStartWidth, + double fEndWidth, + bool bStartActive, + bool bEndActive, + bool bStartCentered, + bool bEndCentered) + : mnRefCount(0), + maStartPolyPolygon(rStartPolyPolygon), + maEndPolyPolygon(rEndPolyPolygon), + mfStartWidth(fStartWidth), + mfEndWidth(fEndWidth), + mbStartActive(bStartActive), + mbEndActive(bEndActive), + mbStartCentered(bStartCentered), + mbEndCentered(bEndCentered) + { + } + + // data read access + const basegfx::B2DPolyPolygon& getStartPolyPolygon() const { return maStartPolyPolygon; } + const basegfx::B2DPolyPolygon& getEndPolyPolygon() const { return maEndPolyPolygon; } + double getStartWidth() const { return mfStartWidth; } + double getEndWidth() const { return mfEndWidth; } + bool isStartActive() const { return mbStartActive; } + bool isEndActive() const { return mbEndActive; } + bool isStartCentered() const { return mbStartCentered; } + bool isEndCentered() const { return mbEndCentered; } + + bool operator==(const ImpSdrLineStartEndAttribute& rCandidate) const + { + return (getStartPolyPolygon() == rCandidate.getStartPolyPolygon() + && getEndPolyPolygon() == rCandidate.getEndPolyPolygon() + && getStartWidth() == rCandidate.getStartWidth() + && getEndWidth() == rCandidate.getEndWidth() + && isStartActive() == rCandidate.isStartActive() + && isEndActive() == rCandidate.isEndActive() + && isStartCentered() == rCandidate.isStartCentered() + && isEndCentered() == rCandidate.isEndCentered()); + } + + static ImpSdrLineStartEndAttribute* get_global_default() + { + static ImpSdrLineStartEndAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrLineStartEndAttribute( + basegfx::B2DPolyPolygon(), + basegfx::B2DPolyPolygon(), + 0.0, + 0.0, + false, + false, + false, + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + SdrLineStartEndAttribute::SdrLineStartEndAttribute( + const basegfx::B2DPolyPolygon& rStartPolyPolygon, + const basegfx::B2DPolyPolygon& rEndPolyPolygon, + double fStartWidth, + double fEndWidth, + bool bStartActive, + bool bEndActive, + bool bStartCentered, + bool bEndCentered) + : mpSdrLineStartEndAttribute(new ImpSdrLineStartEndAttribute( + rStartPolyPolygon, rEndPolyPolygon, fStartWidth, fEndWidth, bStartActive, bEndActive, bStartCentered, bEndCentered)) + { + } + + SdrLineStartEndAttribute::SdrLineStartEndAttribute() + : mpSdrLineStartEndAttribute(ImpSdrLineStartEndAttribute::get_global_default()) + { + mpSdrLineStartEndAttribute->mnRefCount++; + } + + SdrLineStartEndAttribute::SdrLineStartEndAttribute(const SdrLineStartEndAttribute& rCandidate) + : mpSdrLineStartEndAttribute(rCandidate.mpSdrLineStartEndAttribute) + { + mpSdrLineStartEndAttribute->mnRefCount++; + } + + SdrLineStartEndAttribute::~SdrLineStartEndAttribute() + { + if(mpSdrLineStartEndAttribute->mnRefCount) + { + mpSdrLineStartEndAttribute->mnRefCount--; + } + else + { + delete mpSdrLineStartEndAttribute; + } + } + + bool SdrLineStartEndAttribute::isDefault() const + { + return mpSdrLineStartEndAttribute == ImpSdrLineStartEndAttribute::get_global_default(); + } + + SdrLineStartEndAttribute& SdrLineStartEndAttribute::operator=(const SdrLineStartEndAttribute& rCandidate) + { + if(rCandidate.mpSdrLineStartEndAttribute != mpSdrLineStartEndAttribute) + { + if(mpSdrLineStartEndAttribute->mnRefCount) + { + mpSdrLineStartEndAttribute->mnRefCount--; + } + else + { + delete mpSdrLineStartEndAttribute; + } + + mpSdrLineStartEndAttribute = rCandidate.mpSdrLineStartEndAttribute; + mpSdrLineStartEndAttribute->mnRefCount++; + } + + return *this; + } + + bool SdrLineStartEndAttribute::operator==(const SdrLineStartEndAttribute& rCandidate) const + { + if(rCandidate.mpSdrLineStartEndAttribute == mpSdrLineStartEndAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrLineStartEndAttribute == *mpSdrLineStartEndAttribute); + } + + const basegfx::B2DPolyPolygon& SdrLineStartEndAttribute::getStartPolyPolygon() const + { + return mpSdrLineStartEndAttribute->getStartPolyPolygon(); + } + + const basegfx::B2DPolyPolygon& SdrLineStartEndAttribute::getEndPolyPolygon() const + { + return mpSdrLineStartEndAttribute->getEndPolyPolygon(); + } + + double SdrLineStartEndAttribute::getStartWidth() const + { + return mpSdrLineStartEndAttribute->getStartWidth(); + } + + double SdrLineStartEndAttribute::getEndWidth() const + { + return mpSdrLineStartEndAttribute->getEndWidth(); + } + + bool SdrLineStartEndAttribute::isStartActive() const + { + return mpSdrLineStartEndAttribute->isStartActive(); + } + + bool SdrLineStartEndAttribute::isEndActive() const + { + return mpSdrLineStartEndAttribute->isEndActive(); + } + + bool SdrLineStartEndAttribute::isStartCentered() const + { + return mpSdrLineStartEndAttribute->isStartCentered(); + } + + bool SdrLineStartEndAttribute::isEndCentered() const + { + return mpSdrLineStartEndAttribute->isEndCentered(); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx new file mode 100644 index 0000000000..09ec55cb0f --- /dev/null +++ b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx @@ -0,0 +1,292 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdr3DObjectAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // 3D object attribute definitions + ::com::sun::star::drawing::NormalsKind maNormalsKind; // normals type (0..2) + ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionX; // texture projection type X (0..2) + ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionY; // texture projection type Y (0..2) + ::com::sun::star::drawing::TextureKind2 maTextureKind; // texture kind (see uno API) + ::com::sun::star::drawing::TextureMode maTextureMode; // texture kind (see uno API) + MaterialAttribute3D maMaterial; // object, specular and emissive colors, SpecularIntensity + + // bitfield + unsigned mbNormalsInvert : 1; // invert normals + unsigned mbDoubleSided : 1; // surfaces are double sided + unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene + unsigned mbTextureFilter : 1; // filter texture to make more smooth + unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific) + + ImpSdr3DObjectAttribute( + ::com::sun::star::drawing::NormalsKind aNormalsKind, + ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX, + ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY, + ::com::sun::star::drawing::TextureKind2 aTextureKind, + ::com::sun::star::drawing::TextureMode aTextureMode, + const MaterialAttribute3D& rMaterial, + bool bNormalsInvert, + bool bDoubleSided, + bool bShadow3D, + bool bTextureFilter, + bool bReducedLineGeometry) + : mnRefCount(0), + maNormalsKind(aNormalsKind), + maTextureProjectionX(aTextureProjectionX), + maTextureProjectionY(aTextureProjectionY), + maTextureKind(aTextureKind), + maTextureMode(aTextureMode), + maMaterial(rMaterial), + mbNormalsInvert(bNormalsInvert), + mbDoubleSided(bDoubleSided), + mbShadow3D(bShadow3D), + mbTextureFilter(bTextureFilter), + mbReducedLineGeometry(bReducedLineGeometry) + { + } + + // data read access + ::com::sun::star::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; } + ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const { return maTextureProjectionX; } + ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const { return maTextureProjectionY; } + ::com::sun::star::drawing::TextureKind2 getTextureKind() const { return maTextureKind; } + ::com::sun::star::drawing::TextureMode getTextureMode() const { return maTextureMode; } + const MaterialAttribute3D& getMaterial() const { return maMaterial; } + bool getNormalsInvert() const { return mbNormalsInvert; } + bool getDoubleSided() const { return mbDoubleSided; } + bool getShadow3D() const { return mbShadow3D; } + bool getTextureFilter() const { return mbTextureFilter; } + bool getReducedLineGeometry() const { return mbReducedLineGeometry; } + + bool operator==(const ImpSdr3DObjectAttribute& rCandidate) const + { + return (getNormalsKind() == rCandidate.getNormalsKind() + && getTextureProjectionX() == rCandidate.getTextureProjectionX() + && getTextureProjectionY() == rCandidate.getTextureProjectionY() + && getTextureKind() == rCandidate.getTextureKind() + && getTextureMode() == rCandidate.getTextureMode() + && getMaterial() == rCandidate.getMaterial() + && getNormalsInvert() == rCandidate.getNormalsInvert() + && getDoubleSided() == rCandidate.getDoubleSided() + && getShadow3D() == rCandidate.getShadow3D() + && getTextureFilter() == rCandidate.getTextureFilter() + && getReducedLineGeometry() == rCandidate.getReducedLineGeometry()); + } + + static ImpSdr3DObjectAttribute* get_global_default() + { + static ImpSdr3DObjectAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdr3DObjectAttribute( + ::com::sun::star::drawing::NormalsKind_SPECIFIC, + ::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC, + ::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC, + ::com::sun::star::drawing::TextureKind2_LUMINANCE, + ::com::sun::star::drawing::TextureMode_REPLACE, + MaterialAttribute3D(), + false, + false, + false, + false, + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + Sdr3DObjectAttribute::Sdr3DObjectAttribute( + ::com::sun::star::drawing::NormalsKind aNormalsKind, + ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX, + ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY, + ::com::sun::star::drawing::TextureKind2 aTextureKind, + ::com::sun::star::drawing::TextureMode aTextureMode, + const MaterialAttribute3D& rMaterial, + bool bNormalsInvert, + bool bDoubleSided, + bool bShadow3D, + bool bTextureFilter, + bool bReducedLineGeometry) + : mpSdr3DObjectAttribute(new ImpSdr3DObjectAttribute( + aNormalsKind, aTextureProjectionX, aTextureProjectionY, aTextureKind, aTextureMode, + rMaterial, bNormalsInvert, bDoubleSided, bShadow3D, bTextureFilter, bReducedLineGeometry)) + { + } + + Sdr3DObjectAttribute::Sdr3DObjectAttribute() + : mpSdr3DObjectAttribute(ImpSdr3DObjectAttribute::get_global_default()) + { + mpSdr3DObjectAttribute->mnRefCount++; + } + + Sdr3DObjectAttribute::Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate) + : mpSdr3DObjectAttribute(rCandidate.mpSdr3DObjectAttribute) + { + mpSdr3DObjectAttribute->mnRefCount++; + } + + Sdr3DObjectAttribute::~Sdr3DObjectAttribute() + { + if(mpSdr3DObjectAttribute->mnRefCount) + { + mpSdr3DObjectAttribute->mnRefCount--; + } + else + { + delete mpSdr3DObjectAttribute; + } + } + + bool Sdr3DObjectAttribute::isDefault() const + { + return mpSdr3DObjectAttribute == ImpSdr3DObjectAttribute::get_global_default(); + } + + Sdr3DObjectAttribute& Sdr3DObjectAttribute::operator=(const Sdr3DObjectAttribute& rCandidate) + { + if(rCandidate.mpSdr3DObjectAttribute != mpSdr3DObjectAttribute) + { + if(mpSdr3DObjectAttribute->mnRefCount) + { + mpSdr3DObjectAttribute->mnRefCount--; + } + else + { + delete mpSdr3DObjectAttribute; + } + + mpSdr3DObjectAttribute = rCandidate.mpSdr3DObjectAttribute; + mpSdr3DObjectAttribute->mnRefCount++; + } + + return *this; + } + + bool Sdr3DObjectAttribute::operator==(const Sdr3DObjectAttribute& rCandidate) const + { + if(rCandidate.mpSdr3DObjectAttribute == mpSdr3DObjectAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdr3DObjectAttribute == *mpSdr3DObjectAttribute); + } + + ::com::sun::star::drawing::NormalsKind Sdr3DObjectAttribute::getNormalsKind() const + { + return mpSdr3DObjectAttribute->getNormalsKind(); + } + + ::com::sun::star::drawing::TextureProjectionMode Sdr3DObjectAttribute::getTextureProjectionX() const + { + return mpSdr3DObjectAttribute->getTextureProjectionX(); + } + + ::com::sun::star::drawing::TextureProjectionMode Sdr3DObjectAttribute::getTextureProjectionY() const + { + return mpSdr3DObjectAttribute->getTextureProjectionY(); + } + + ::com::sun::star::drawing::TextureKind2 Sdr3DObjectAttribute::getTextureKind() const + { + return mpSdr3DObjectAttribute->getTextureKind(); + } + + ::com::sun::star::drawing::TextureMode Sdr3DObjectAttribute::getTextureMode() const + { + return mpSdr3DObjectAttribute->getTextureMode(); + } + + const MaterialAttribute3D& Sdr3DObjectAttribute::getMaterial() const + { + return mpSdr3DObjectAttribute->getMaterial(); + } + + bool Sdr3DObjectAttribute::getNormalsInvert() const + { + return mpSdr3DObjectAttribute->getNormalsInvert(); + } + + bool Sdr3DObjectAttribute::getDoubleSided() const + { + return mpSdr3DObjectAttribute->getDoubleSided(); + } + + bool Sdr3DObjectAttribute::getShadow3D() const + { + return mpSdr3DObjectAttribute->getShadow3D(); + } + + bool Sdr3DObjectAttribute::getTextureFilter() const + { + return mpSdr3DObjectAttribute->getTextureFilter(); + } + + bool Sdr3DObjectAttribute::getReducedLineGeometry() const + { + return mpSdr3DObjectAttribute->getReducedLineGeometry(); + } + + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/sdrsceneattribute3d.cxx b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx new file mode 100644 index 0000000000..ffd774c89c --- /dev/null +++ b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx @@ -0,0 +1,218 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute3d.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdrSceneAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // 3D scene attribute definitions + double mfDistance; + double mfShadowSlant; + ::com::sun::star::drawing::ProjectionMode maProjectionMode; + ::com::sun::star::drawing::ShadeMode maShadeMode; + + // bitfield + unsigned mbTwoSidedLighting : 1; + + public: + ImpSdrSceneAttribute( + double fDistance, + double fShadowSlant, + ::com::sun::star::drawing::ProjectionMode aProjectionMode, + ::com::sun::star::drawing::ShadeMode aShadeMode, + bool bTwoSidedLighting) + : mnRefCount(0), + mfDistance(fDistance), + mfShadowSlant(fShadowSlant), + maProjectionMode(aProjectionMode), + maShadeMode(aShadeMode), + mbTwoSidedLighting(bTwoSidedLighting) + { + } + + // data read access + double getDistance() const { return mfDistance; } + double getShadowSlant() const { return mfShadowSlant; } + ::com::sun::star::drawing::ProjectionMode getProjectionMode() const { return maProjectionMode; } + ::com::sun::star::drawing::ShadeMode getShadeMode() const { return maShadeMode; } + bool getTwoSidedLighting() const { return mbTwoSidedLighting; } + + bool operator==(const ImpSdrSceneAttribute& rCandidate) const + { + return (getDistance() == rCandidate.getDistance() + && getShadowSlant() == rCandidate.getShadowSlant() + && getProjectionMode() == rCandidate.getProjectionMode() + && getShadeMode() == rCandidate.getShadeMode() + && getTwoSidedLighting() == rCandidate.getTwoSidedLighting()); + } + + static ImpSdrSceneAttribute* get_global_default() + { + static ImpSdrSceneAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrSceneAttribute( + 0.0, 0.0, + ::com::sun::star::drawing::ProjectionMode_PARALLEL, + ::com::sun::star::drawing::ShadeMode_FLAT, + false); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + SdrSceneAttribute::SdrSceneAttribute( + double fDistance, + double fShadowSlant, + ::com::sun::star::drawing::ProjectionMode aProjectionMode, + ::com::sun::star::drawing::ShadeMode aShadeMode, + bool bTwoSidedLighting) + : mpSdrSceneAttribute(new ImpSdrSceneAttribute( + fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting)) + { + } + + SdrSceneAttribute::SdrSceneAttribute() + : mpSdrSceneAttribute(ImpSdrSceneAttribute::get_global_default()) + { + mpSdrSceneAttribute->mnRefCount++; + } + + SdrSceneAttribute::SdrSceneAttribute(const SdrSceneAttribute& rCandidate) + : mpSdrSceneAttribute(rCandidate.mpSdrSceneAttribute) + { + mpSdrSceneAttribute->mnRefCount++; + } + + SdrSceneAttribute::~SdrSceneAttribute() + { + if(mpSdrSceneAttribute->mnRefCount) + { + mpSdrSceneAttribute->mnRefCount--; + } + else + { + delete mpSdrSceneAttribute; + } + } + + bool SdrSceneAttribute::isDefault() const + { + return mpSdrSceneAttribute == ImpSdrSceneAttribute::get_global_default(); + } + + SdrSceneAttribute& SdrSceneAttribute::operator=(const SdrSceneAttribute& rCandidate) + { + if(rCandidate.mpSdrSceneAttribute != mpSdrSceneAttribute) + { + if(mpSdrSceneAttribute->mnRefCount) + { + mpSdrSceneAttribute->mnRefCount--; + } + else + { + delete mpSdrSceneAttribute; + } + + mpSdrSceneAttribute = rCandidate.mpSdrSceneAttribute; + mpSdrSceneAttribute->mnRefCount++; + } + + return *this; + } + + bool SdrSceneAttribute::operator==(const SdrSceneAttribute& rCandidate) const + { + if(rCandidate.mpSdrSceneAttribute == mpSdrSceneAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrSceneAttribute == *mpSdrSceneAttribute); + } + + double SdrSceneAttribute::getDistance() const + { + return mpSdrSceneAttribute->getDistance(); + } + + double SdrSceneAttribute::getShadowSlant() const + { + return mpSdrSceneAttribute->getShadowSlant(); + } + + ::com::sun::star::drawing::ProjectionMode SdrSceneAttribute::getProjectionMode() const + { + return mpSdrSceneAttribute->getProjectionMode(); + } + + ::com::sun::star::drawing::ShadeMode SdrSceneAttribute::getShadeMode() const + { + return mpSdrSceneAttribute->getShadeMode(); + } + + bool SdrSceneAttribute::getTwoSidedLighting() const + { + return mpSdrSceneAttribute->getTwoSidedLighting(); + } + + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx new file mode 100644 index 0000000000..429d920030 --- /dev/null +++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx @@ -0,0 +1,193 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrattribute.cxx,v $ + * + * $Revision: 1.5 $ + * + * 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 +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class ImpSdrShadowAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // shadow definitions + basegfx::B2DVector maOffset; // shadow offset 1/100th mm + double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. + basegfx::BColor maColor; // color of shadow + + ImpSdrShadowAttribute( + const basegfx::B2DVector& rOffset, + double fTransparence, + const basegfx::BColor& rColor) + : mnRefCount(0), + maOffset(rOffset), + mfTransparence(fTransparence), + maColor(rColor) + { + } + + // data read access + const basegfx::B2DVector& getOffset() const { return maOffset; } + double getTransparence() const { return mfTransparence; } + const basegfx::BColor& getColor() const { return maColor; } + + bool operator==(const ImpSdrShadowAttribute& rCandidate) const + { + return (getOffset() == rCandidate.getOffset() + && getTransparence() == rCandidate.getTransparence() + && getColor() == rCandidate.getColor()); + } + + static ImpSdrShadowAttribute* get_global_default() + { + static ImpSdrShadowAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrShadowAttribute( + basegfx::B2DVector(), + 0.0, + basegfx::BColor()); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + SdrShadowAttribute::SdrShadowAttribute( + const basegfx::B2DVector& rOffset, + double fTransparence, + const basegfx::BColor& rColor) + : mpSdrShadowAttribute(new ImpSdrShadowAttribute( + rOffset, fTransparence, rColor)) + { + } + + SdrShadowAttribute::SdrShadowAttribute() + : mpSdrShadowAttribute(ImpSdrShadowAttribute::get_global_default()) + { + mpSdrShadowAttribute->mnRefCount++; + } + + SdrShadowAttribute::SdrShadowAttribute(const SdrShadowAttribute& rCandidate) + : mpSdrShadowAttribute(rCandidate.mpSdrShadowAttribute) + { + mpSdrShadowAttribute->mnRefCount++; + } + + SdrShadowAttribute::~SdrShadowAttribute() + { + if(mpSdrShadowAttribute->mnRefCount) + { + mpSdrShadowAttribute->mnRefCount--; + } + else + { + delete mpSdrShadowAttribute; + } + } + + bool SdrShadowAttribute::isDefault() const + { + return mpSdrShadowAttribute == ImpSdrShadowAttribute::get_global_default(); + } + + SdrShadowAttribute& SdrShadowAttribute::operator=(const SdrShadowAttribute& rCandidate) + { + if(rCandidate.mpSdrShadowAttribute != mpSdrShadowAttribute) + { + if(mpSdrShadowAttribute->mnRefCount) + { + mpSdrShadowAttribute->mnRefCount--; + } + else + { + delete mpSdrShadowAttribute; + } + + mpSdrShadowAttribute = rCandidate.mpSdrShadowAttribute; + mpSdrShadowAttribute->mnRefCount++; + } + + return *this; + } + + bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const + { + if(rCandidate.mpSdrShadowAttribute == mpSdrShadowAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrShadowAttribute == *mpSdrShadowAttribute); + } + + const basegfx::B2DVector& SdrShadowAttribute::getOffset() const + { + return mpSdrShadowAttribute->getOffset(); + } + + double SdrShadowAttribute::getTransparence() const + { + return mpSdrShadowAttribute->getTransparence(); + } + + const basegfx::BColor& SdrShadowAttribute::getColor() const + { + return mpSdrShadowAttribute->getColor(); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/attribute/strokeattribute.cxx b/drawinglayer/source/attribute/strokeattribute.cxx index 89fc5d8622..a9b80e0cfc 100644 --- a/drawinglayer/source/attribute/strokeattribute.cxx +++ b/drawinglayer/source/attribute/strokeattribute.cxx @@ -45,16 +45,143 @@ namespace drawinglayer { namespace attribute { - double StrokeAttribute::getFullDotDashLen() const + class ImpStrokeAttribute { - if(0.0 == mfFullDotDashLen && maDotDashArray.size()) + public: + // refcounter + sal_uInt32 mnRefCount; + + // data definitions + ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern + double mfFullDotDashLen; // sum of maDotDashArray (for convenience) + + ImpStrokeAttribute( + const ::std::vector< double >& rDotDashArray, + double fFullDotDashLen) + : mnRefCount(0), + maDotDashArray(rDotDashArray), + mfFullDotDashLen(fFullDotDashLen) + { + } + + // data read access + const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; } + double getFullDotDashLen() const + { + if(0.0 == mfFullDotDashLen && maDotDashArray.size()) + { + // calculate length on demand + const double fAccumulated(::std::accumulate(maDotDashArray.begin(), maDotDashArray.end(), 0.0)); + const_cast< ImpStrokeAttribute* >(this)->mfFullDotDashLen = fAccumulated; + } + + return mfFullDotDashLen; + } + + bool operator==(const ImpStrokeAttribute& rCandidate) const + { + return (getDotDashArray() == rCandidate.getDotDashArray() + && getFullDotDashLen() == rCandidate.getFullDotDashLen()); + } + + static ImpStrokeAttribute* get_global_default() + { + static ImpStrokeAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpStrokeAttribute( + std::vector< double >(), + 0.0); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + + StrokeAttribute::StrokeAttribute( + const ::std::vector< double >& rDotDashArray, + double fFullDotDashLen) + : mpStrokeAttribute(new ImpStrokeAttribute( + rDotDashArray, fFullDotDashLen)) + { + } + + StrokeAttribute::StrokeAttribute() + : mpStrokeAttribute(ImpStrokeAttribute::get_global_default()) + { + mpStrokeAttribute->mnRefCount++; + } + + StrokeAttribute::StrokeAttribute(const StrokeAttribute& rCandidate) + : mpStrokeAttribute(rCandidate.mpStrokeAttribute) + { + mpStrokeAttribute->mnRefCount++; + } + + StrokeAttribute::~StrokeAttribute() + { + if(mpStrokeAttribute->mnRefCount) + { + mpStrokeAttribute->mnRefCount--; + } + else { - // calculate length on demand - const double fAccumulated(::std::accumulate(maDotDashArray.begin(), maDotDashArray.end(), 0.0)); - const_cast< StrokeAttribute* >(this)->mfFullDotDashLen = fAccumulated; + delete mpStrokeAttribute; } + } + + bool StrokeAttribute::isDefault() const + { + return mpStrokeAttribute == ImpStrokeAttribute::get_global_default(); + } + + StrokeAttribute& StrokeAttribute::operator=(const StrokeAttribute& rCandidate) + { + if(rCandidate.mpStrokeAttribute != mpStrokeAttribute) + { + if(mpStrokeAttribute->mnRefCount) + { + mpStrokeAttribute->mnRefCount--; + } + else + { + delete mpStrokeAttribute; + } + + mpStrokeAttribute = rCandidate.mpStrokeAttribute; + mpStrokeAttribute->mnRefCount++; + } + + return *this; + } + + bool StrokeAttribute::operator==(const StrokeAttribute& rCandidate) const + { + if(rCandidate.mpStrokeAttribute == mpStrokeAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpStrokeAttribute == *mpStrokeAttribute); + } + + const ::std::vector< double >& StrokeAttribute::getDotDashArray() const + { + return mpStrokeAttribute->getDotDashArray(); + } - return mfFullDotDashLen; + double StrokeAttribute::getFullDotDashLen() const + { + return mpStrokeAttribute->getFullDotDashLen(); } } // end of namespace attribute } // end of namespace drawinglayer diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx index 4eba454ea5..a959884847 100644 --- a/drawinglayer/source/geometry/viewinformation2d.cxx +++ b/drawinglayer/source/geometry/viewinformation2d.cxx @@ -313,6 +313,22 @@ namespace drawinglayer impInterpretPropertyValues(rViewParameters); } + ImpViewInformation2D() + : mnRefCount(0), + maObjectTransformation(), + maViewTransformation(), + maObjectToViewTransformation(), + maInverseObjectToViewTransformation(), + maViewport(), + maDiscreteViewport(), + mxVisualizedPage(), + mfViewTime(), + mbReducedDisplayQuality(false), + mxViewInformation(), + mxExtendedInformation() + { + } + const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; @@ -410,6 +426,21 @@ namespace drawinglayer && mfViewTime == rCandidate.mfViewTime && mxExtendedInformation == rCandidate.mxExtendedInformation); } + + static ImpViewInformation2D* get_global_default() + { + static ImpViewInformation2D* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpViewInformation2D(); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } }; } // end of anonymous namespace } // end of namespace drawinglayer @@ -442,6 +473,12 @@ namespace drawinglayer { } + ViewInformation2D::ViewInformation2D() + : mpViewInformation2D(ImpViewInformation2D::get_global_default()) + { + mpViewInformation2D->mnRefCount++; + } + ViewInformation2D::ViewInformation2D(const ViewInformation2D& rCandidate) : mpViewInformation2D(rCandidate.mpViewInformation2D) { @@ -463,6 +500,11 @@ namespace drawinglayer } } + bool ViewInformation2D::isDefault() const + { + return mpViewInformation2D == ImpViewInformation2D::get_global_default(); + } + ViewInformation2D& ViewInformation2D::operator=(const ViewInformation2D& rCandidate) { ::osl::Mutex m_mutex; @@ -489,6 +531,11 @@ namespace drawinglayer return true; } + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + return (*rCandidate.mpViewInformation2D == *mpViewInformation2D); } diff --git a/drawinglayer/source/geometry/viewinformation3d.cxx b/drawinglayer/source/geometry/viewinformation3d.cxx index 8925fb3bb6..ac23b6b41e 100644 --- a/drawinglayer/source/geometry/viewinformation3d.cxx +++ b/drawinglayer/source/geometry/viewinformation3d.cxx @@ -395,6 +395,18 @@ namespace drawinglayer impInterpretPropertyValues(rViewParameters); } + ImpViewInformation3D() + : mnRefCount(0), + maObjectTransformation(), + maOrientation(), + maProjection(), + maDeviceToView(), + mfViewTime(), + mxViewInformation(), + mxExtendedInformation() + { + } + const basegfx::B3DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } const basegfx::B3DHomMatrix& getOrientation() const { return maOrientation; } const basegfx::B3DHomMatrix& getProjection() const { return maProjection; } @@ -440,6 +452,21 @@ namespace drawinglayer && mfViewTime == rCandidate.mfViewTime && mxExtendedInformation == rCandidate.mxExtendedInformation); } + + static ImpViewInformation3D* get_global_default() + { + static ImpViewInformation3D* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpViewInformation3D(); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } }; } // end of anonymous namespace } // end of namespace drawinglayer @@ -457,7 +484,9 @@ namespace drawinglayer const basegfx::B3DHomMatrix& rDeviceToView, double fViewTime, const uno::Sequence< beans::PropertyValue >& rExtendedParameters) - : mpViewInformation3D(new ImpViewInformation3D(rObjectObjectTransformation, rOrientation, rProjection, rDeviceToView, fViewTime, rExtendedParameters)) + : mpViewInformation3D(new ImpViewInformation3D( + rObjectObjectTransformation, rOrientation, rProjection, + rDeviceToView, fViewTime, rExtendedParameters)) { } @@ -466,6 +495,12 @@ namespace drawinglayer { } + ViewInformation3D::ViewInformation3D() + : mpViewInformation3D(ImpViewInformation3D::get_global_default()) + { + mpViewInformation3D->mnRefCount++; + } + ViewInformation3D::ViewInformation3D(const ViewInformation3D& rCandidate) : mpViewInformation3D(rCandidate.mpViewInformation3D) { @@ -487,6 +522,11 @@ namespace drawinglayer } } + bool ViewInformation3D::isDefault() const + { + return mpViewInformation3D == ImpViewInformation3D::get_global_default(); + } + ViewInformation3D& ViewInformation3D::operator=(const ViewInformation3D& rCandidate) { ::osl::Mutex m_mutex; @@ -513,6 +553,11 @@ namespace drawinglayer return true; } + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + return (*rCandidate.mpViewInformation3D == *mpViewInformation3D); } diff --git a/drawinglayer/source/primitive2d/alphaprimitive2d.cxx b/drawinglayer/source/primitive2d/alphaprimitive2d.cxx deleted file mode 100644 index 0f4fecc8b0..0000000000 --- a/drawinglayer/source/primitive2d/alphaprimitive2d.cxx +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: alphaprimitive2d.cxx,v $ - * - * $Revision: 1.5 $ - * - * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * 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 -#include - -////////////////////////////////////////////////////////////////////////////// - -using namespace com::sun::star; - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive2d - { - AlphaPrimitive2D::AlphaPrimitive2D( - const Primitive2DSequence& rChildren, - const Primitive2DSequence& rAlpha) - : GroupPrimitive2D(rChildren), - maAlpha(rAlpha) - { - } - - bool AlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const - { - if(GroupPrimitive2D::operator==(rPrimitive)) - { - const AlphaPrimitive2D& rCompare = (AlphaPrimitive2D&)rPrimitive; - - return (getAlpha() == rCompare.getAlpha()); - } - - return false; - } - - // provide unique ID - ImplPrimitrive2DIDBlock(AlphaPrimitive2D, PRIMITIVE2D_ID_ALPHAPRIMITIVE2D) - } // end of namespace primitive2d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx index 6b71b022f8..833b39aa39 100644 --- a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx @@ -56,46 +56,54 @@ namespace drawinglayer { Primitive2DSequence FillBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { - const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel()); Primitive2DSequence aRetval; - // is there a tile with some size at all? - if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight()) + if(!getFillBitmap().isDefault()) { - if(getFillBitmap().getTiling()) - { - // get object range and create tiling matrices - ::std::vector< basegfx::B2DHomMatrix > aMatrices; - texture::GeoTexSvxTiled aTiling(getFillBitmap().getTopLeft(), getFillBitmap().getSize()); - aTiling.appendTransformations(aMatrices); - - // resize result - aRetval.realloc(aMatrices.size()); + const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel()); - // create one primitive for each matrix - for(sal_uInt32 a(0L); a < aMatrices.size(); a++) + // is there a tile with some size at all? + if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight()) + { + if(getFillBitmap().getTiling()) { - basegfx::B2DHomMatrix aNewMatrix = aMatrices[a]; - aNewMatrix *= getTransformation(); - - // create bitmap primitive and add to result - const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix)); - aRetval[a] = xRef; + // get object range and create tiling matrices + ::std::vector< basegfx::B2DHomMatrix > aMatrices; + texture::GeoTexSvxTiled aTiling(getFillBitmap().getTopLeft(), getFillBitmap().getSize()); + aTiling.appendTransformations(aMatrices); + + // resize result + aRetval.realloc(aMatrices.size()); + + // create one primitive for each matrix + for(sal_uInt32 a(0L); a < aMatrices.size(); a++) + { + basegfx::B2DHomMatrix aNewMatrix = aMatrices[a]; + aNewMatrix *= getTransformation(); + + // create bitmap primitive and add to result + const Primitive2DReference xRef( + new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix)); + + aRetval[a] = xRef; + } + } + else + { + // create new object transform + basegfx::B2DHomMatrix aObjectTransform; + aObjectTransform.set(0L, 0L, getFillBitmap().getSize().getX()); + aObjectTransform.set(1L, 1L, getFillBitmap().getSize().getY()); + aObjectTransform.set(0L, 2L, getFillBitmap().getTopLeft().getX()); + aObjectTransform.set(1L, 2L, getFillBitmap().getTopLeft().getY()); + aObjectTransform *= getTransformation(); + + // create bitmap primitive and add exclusive to decomposition (hand over ownership) + const Primitive2DReference xRef( + new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform)); + + aRetval = Primitive2DSequence(&xRef, 1L); } - } - else - { - // create new object transform - basegfx::B2DHomMatrix aObjectTransform; - aObjectTransform.set(0L, 0L, getFillBitmap().getSize().getX()); - aObjectTransform.set(1L, 1L, getFillBitmap().getSize().getY()); - aObjectTransform.set(0L, 2L, getFillBitmap().getTopLeft().getX()); - aObjectTransform.set(1L, 2L, getFillBitmap().getTopLeft().getY()); - aObjectTransform *= getTransformation(); - - // create bitmap primitive and add exclusive to decomposition (hand over ownership) - const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform)); - aRetval = Primitive2DSequence(&xRef, 1L); } } @@ -127,7 +135,7 @@ namespace drawinglayer basegfx::B2DRange FillBitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const { // return range of it - basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon()); aPolygon.transform(getTransformation()); return basegfx::tools::getRange(aPolygon); } diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx index 5e609ebe15..6bf846f422 100644 --- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx @@ -62,10 +62,10 @@ namespace drawinglayer rColors.clear(); // make sure steps is not too high/low - const basegfx::BColor aStart(maFillGradient.getStartColor()); - const basegfx::BColor aEnd(maFillGradient.getEndColor()); + const basegfx::BColor aStart(getFillGradient().getStartColor()); + const basegfx::BColor aEnd(getFillGradient().getEndColor()); const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5)); - sal_uInt32 nSteps(maFillGradient.getSteps()); + sal_uInt32 nSteps(getFillGradient().getSteps()); if(nSteps == 0) { @@ -82,46 +82,46 @@ namespace drawinglayer nSteps = nMaxSteps; } - switch(maFillGradient.getStyle()) + switch(getFillGradient().getStyle()) { case attribute::GRADIENTSTYLE_LINEAR: { - texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle()); + texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), -getFillGradient().getAngle()); aGradient.appendTransformations(rMatrices); aGradient.appendColors(rColors); break; } case attribute::GRADIENTSTYLE_AXIAL: { - texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle()); + texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), -getFillGradient().getAngle()); aGradient.appendTransformations(rMatrices); aGradient.appendColors(rColors); break; } case attribute::GRADIENTSTYLE_RADIAL: { - texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY()); + texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY()); 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()); + texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle()); 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()); + texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle()); 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()); + texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle()); aGradient.appendTransformations(rMatrices); aGradient.appendColors(rColors); break; @@ -218,15 +218,15 @@ namespace drawinglayer // prepare shape of the Unit Polygon basegfx::B2DPolygon aUnitPolygon; - if(attribute::GRADIENTSTYLE_RADIAL == maFillGradient.getStyle() - || attribute::GRADIENTSTYLE_ELLIPTICAL == maFillGradient.getStyle()) + if(attribute::GRADIENTSTYLE_RADIAL == getFillGradient().getStyle() + || attribute::GRADIENTSTYLE_ELLIPTICAL == getFillGradient().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)); + aUnitPolygon = basegfx::tools::createUnitPolygon(); } // get the transform matrices and colors (where colors @@ -253,7 +253,15 @@ namespace drawinglayer // 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); + + if(!getFillGradient().isDefault()) + { + return createFill(true); + } + else + { + return Primitive2DSequence(); + } } FillGradientPrimitive2D::FillGradientPrimitive2D( @@ -272,7 +280,7 @@ namespace drawinglayer const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive; return (getObjectRange() == rCompare.getObjectRange() - && maFillGradient == rCompare.maFillGradient); + && getFillGradient() == rCompare.getFillGradient()); } return false; diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx index ed420f4f4d..3cd752940a 100644 --- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx @@ -57,65 +57,73 @@ namespace drawinglayer { Primitive2DSequence FillHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { - // create hatch - const basegfx::BColor aHatchColor(maFillHatch.getColor()); - const double fAngle(-maFillHatch.getAngle()); - ::std::vector< basegfx::B2DHomMatrix > aMatrices; + Primitive2DSequence aRetval; - // get hatch transformations - switch(maFillHatch.getStyle()) + if(!getFillHatch().isDefault()) { - case attribute::HATCHSTYLE_TRIPLE: - { - // rotated 45 degrees - texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI4); - aHatch.appendTransformations(aMatrices); + // create hatch + const basegfx::BColor aHatchColor(getFillHatch().getColor()); + const double fAngle(-getFillHatch().getAngle()); + ::std::vector< basegfx::B2DHomMatrix > aMatrices; - // fall-through by purpose - } - case attribute::HATCHSTYLE_DOUBLE: + // get hatch transformations + switch(getFillHatch().getStyle()) { - // rotated 90 degrees - texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI2); - aHatch.appendTransformations(aMatrices); - - // fall-through by purpose + case attribute::HATCHSTYLE_TRIPLE: + { + // rotated 45 degrees + texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle + F_PI4); + aHatch.appendTransformations(aMatrices); + + // fall-through by purpose + } + case attribute::HATCHSTYLE_DOUBLE: + { + // rotated 90 degrees + texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle + F_PI2); + aHatch.appendTransformations(aMatrices); + + // fall-through by purpose + } + case attribute::HATCHSTYLE_SINGLE: + { + // angle as given + texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle); + aHatch.appendTransformations(aMatrices); + } } - case attribute::HATCHSTYLE_SINGLE: - { - // angle as given - texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle); - aHatch.appendTransformations(aMatrices); - } - } - // prepare return value - const bool bFillBackground(maFillHatch.isFillBackground()); - Primitive2DSequence aRetval(bFillBackground ? aMatrices.size() + 1L : aMatrices.size()); + // prepare return value + const bool bFillBackground(getFillHatch().isFillBackground()); + aRetval.realloc(bFillBackground ? aMatrices.size() + 1L : aMatrices.size()); - // evtl. create filled background - if(bFillBackground) - { - // create primitive for background - const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())), maBColor)); - aRetval[0L] = xRef; - } + // evtl. create filled background + if(bFillBackground) + { + // create primitive for background + const Primitive2DReference xRef( + new PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon( + basegfx::tools::createPolygonFromRect(getObjectRange())), getBColor())); + aRetval[0] = xRef; + } - // create primitives - const basegfx::B2DPoint aStart(0.0, 0.0); - const basegfx::B2DPoint aEnd(1.0, 0.0); + // create primitives + const basegfx::B2DPoint aStart(0.0, 0.0); + const basegfx::B2DPoint aEnd(1.0, 0.0); - for(sal_uInt32 a(0L); a < aMatrices.size(); a++) - { - const basegfx::B2DHomMatrix& rMatrix = aMatrices[a]; - basegfx::B2DPolygon aNewLine; + for(sal_uInt32 a(0L); a < aMatrices.size(); a++) + { + const basegfx::B2DHomMatrix& rMatrix = aMatrices[a]; + basegfx::B2DPolygon aNewLine; - aNewLine.append(rMatrix * aStart); - aNewLine.append(rMatrix * aEnd); + aNewLine.append(rMatrix * aStart); + aNewLine.append(rMatrix * aEnd); - // create hairline - const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor)); - aRetval[bFillBackground ? (a + 1L) : a] = xRef; + // create hairline + const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor)); + aRetval[bFillBackground ? (a + 1) : a] = xRef; + } } return aRetval; @@ -139,8 +147,8 @@ namespace drawinglayer const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive; return (getObjectRange() == rCompare.getObjectRange() - && maFillHatch == rCompare.maFillHatch - && maBColor == rCompare.maBColor); + && getFillHatch() == rCompare.getFillHatch() + && getBColor() == rCompare.getBColor()); } return false; diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index f8a57a7389..ca0fb1d7f2 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -772,9 +772,7 @@ namespace drawinglayer { // 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))); + basegfx::B2DPolygon aMaskPolygon(basegfx::tools::createUnitPolygon()); aMaskPolygon.transform(aTransform); xPrimitive = Primitive2DReference( @@ -880,7 +878,7 @@ namespace drawinglayer else { // cropped got bigger, mask it with original object's bounds - basegfx::B2DPolyPolygon aMaskPolyPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolyPolygon aMaskPolyPolygon(basegfx::tools::createUnitPolygon()); aMaskPolyPolygon.transform(getTransform()); // create maskPrimitive with aMaskPolyPolygon and aMaskContentVector diff --git a/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx new file mode 100644 index 0000000000..6e913a07d3 --- /dev/null +++ b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: hittestprimitive3d.cxx,v $ + * + * $Revision: 1.1.2.1 $ + * + * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +using namespace com::sun::star; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + HiddenGeometryPrimitive2D::HiddenGeometryPrimitive2D( + const Primitive2DSequence& rChildren) + : GroupPrimitive2D(rChildren) + { + } + + basegfx::B2DRange HiddenGeometryPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const + { + return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation); + } + + Primitive2DSequence HiddenGeometryPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + return Primitive2DSequence(); + } + + // provide unique ID + ImplPrimitrive2DIDBlock(HiddenGeometryPrimitive2D, PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx b/drawinglayer/source/primitive2d/hittestprimitive2d.cxx deleted file mode 100644 index 78156cebbe..0000000000 --- a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hittestprimitive3d.cxx,v $ - * - * $Revision: 1.1.2.1 $ - * - * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * 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 -#include - -////////////////////////////////////////////////////////////////////////////// - -using namespace com::sun::star; - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive2d - { - HitTestPrimitive2D::HitTestPrimitive2D( - const Primitive2DSequence& rChildren) - : GroupPrimitive2D(rChildren) - { - } - - basegfx::B2DRange HitTestPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const - { - 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) - - } // end of namespace primitive2d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/primitive2d/invertprimitive2d.cxx b/drawinglayer/source/primitive2d/invertprimitive2d.cxx index e3292beeb7..fd98a834c6 100644 --- a/drawinglayer/source/primitive2d/invertprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/invertprimitive2d.cxx @@ -2,7 +2,7 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: unifiedalphaprimitive2d.cxx,v $ + * $RCSfile: UnifiedTransparencePrimitive2D.cxx,v $ * * $Revision: 1.5 $ * diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk index c9a3cc191a..078142b673 100644 --- a/drawinglayer/source/primitive2d/makefile.mk +++ b/drawinglayer/source/primitive2d/makefile.mk @@ -45,50 +45,51 @@ ENABLE_EXCEPTIONS=TRUE # --- Files ------------------------------------- SLOFILES= \ - $(SLO)$/alphaprimitive2d.obj \ - $(SLO)$/animatedprimitive2d.obj \ - $(SLO)$/baseprimitive2d.obj \ - $(SLO)$/backgroundcolorprimitive2d.obj \ - $(SLO)$/bitmapprimitive2d.obj \ - $(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 \ - $(SLO)$/graphicprimitive2d.obj \ - $(SLO)$/gridprimitive2d.obj \ - $(SLO)$/groupprimitive2d.obj \ - $(SLO)$/helplineprimitive2d.obj \ - $(SLO)$/hittestprimitive2d.obj \ - $(SLO)$/invertprimitive2d.obj \ - $(SLO)$/markerarrayprimitive2d.obj \ - $(SLO)$/pointarrayprimitive2d.obj \ - $(SLO)$/maskprimitive2d.obj \ - $(SLO)$/mediaprimitive2d.obj \ - $(SLO)$/metafileprimitive2d.obj \ - $(SLO)$/modifiedcolorprimitive2d.obj \ - $(SLO)$/pagepreviewprimitive2d.obj \ - $(SLO)$/polypolygonprimitive2d.obj \ - $(SLO)$/polygonprimitive2d.obj \ - $(SLO)$/primitivetools2d.obj \ - $(SLO)$/sceneprimitive2d.obj \ - $(SLO)$/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)$/transparenceprimitive2d.obj \ + $(SLO)$/animatedprimitive2d.obj \ + $(SLO)$/baseprimitive2d.obj \ + $(SLO)$/backgroundcolorprimitive2d.obj \ + $(SLO)$/bitmapprimitive2d.obj \ + $(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 \ + $(SLO)$/graphicprimitive2d.obj \ + $(SLO)$/gridprimitive2d.obj \ + $(SLO)$/groupprimitive2d.obj \ + $(SLO)$/helplineprimitive2d.obj \ + $(SLO)$/hiddengeometryprimitive2d.obj \ + $(SLO)$/invertprimitive2d.obj \ + $(SLO)$/markerarrayprimitive2d.obj \ + $(SLO)$/pointarrayprimitive2d.obj \ + $(SLO)$/maskprimitive2d.obj \ + $(SLO)$/mediaprimitive2d.obj \ + $(SLO)$/metafileprimitive2d.obj \ + $(SLO)$/modifiedcolorprimitive2d.obj \ + $(SLO)$/pagepreviewprimitive2d.obj \ + $(SLO)$/polypolygonprimitive2d.obj \ + $(SLO)$/polygonprimitive2d.obj \ + $(SLO)$/primitivetools2d.obj \ + $(SLO)$/sceneprimitive2d.obj \ + $(SLO)$/sdrdecompositiontools2d.obj \ + $(SLO)$/shadowprimitive2d.obj \ + $(SLO)$/structuretagprimitive2d.obj \ + $(SLO)$/texteffectprimitive2d.obj \ + $(SLO)$/textenumsprimitive2d.obj \ + $(SLO)$/textlayoutdevice.obj \ + $(SLO)$/textlineprimitive2d.obj \ + $(SLO)$/textprimitive2d.obj \ + $(SLO)$/textstrikeoutprimitive2d.obj \ + $(SLO)$/textdecoratedprimitive2d.obj \ + $(SLO)$/texthierarchyprimitive2d.obj \ + $(SLO)$/transformprimitive2d.obj \ + $(SLO)$/unifiedtransparenceprimitive2d.obj \ + $(SLO)$/wallpaperprimitive2d.obj \ $(SLO)$/wrongspellprimitive2d.obj # --- Targets ---------------------------------- diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx index f16e322ae6..3848aafc2e 100644 --- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx @@ -46,6 +46,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -58,9 +59,12 @@ namespace drawinglayer Primitive2DSequence xRetval(1); // create background object - basegfx::B2DPolygon aBackgroundPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aBackgroundPolygon(basegfx::tools::createUnitPolygon()); aBackgroundPolygon.transform(getTransform()); - const Primitive2DReference xRefBackground(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aBackgroundPolygon), getBackgroundColor())); + const Primitive2DReference xRefBackground( + new PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aBackgroundPolygon), + getBackgroundColor())); xRetval[0] = xRefBackground; // try to get graphic snapshot @@ -87,10 +91,13 @@ namespace drawinglayer basegfx::B2DRange aDestRange(aSourceRange); aDestRange.grow(-0.5 * fDiscreteSize); - if(::basegfx::fTools::equalZero(aDestRange.getWidth()) || ::basegfx::fTools::equalZero(aDestRange.getHeight())) + if(basegfx::fTools::equalZero(aDestRange.getWidth()) || basegfx::fTools::equalZero(aDestRange.getHeight())) { - // shrunk primitive has no content (zero size in X or Y), nothing to display, nothing to return - xRetval = Primitive2DSequence(); + // shrunk primitive has no content (zero size in X or Y), nothing to display. Still create + // invisible content for HitTest and BoundRect + const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(xRetval)); + + xRetval = Primitive2DSequence(&xHiddenLines, 1); } else { diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index c0f89b4dd0..b6496f085b 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -53,10 +53,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include @@ -589,7 +589,14 @@ namespace drawinglayer Primitive2DSequence NonOverlappingFillGradientPrimitive2D::create2DDecomposition( const geometry::ViewInformation2D& /*rViewInformation*/) const { - return createFill(false); + if(!getFillGradient().isDefault()) + { + return createFill(false); + } + else + { + return Primitive2DSequence(); + } } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -841,7 +848,7 @@ namespace } /** helper to create a regular BotmapEx from a MaskAction (definitions - which use a bitmap without alpha but define one of the colors as + which use a bitmap without transparence but define one of the colors as transparent) */ BitmapEx createMaskBmpEx(const Bitmap& rBitmap, const Color& rMaskColor) @@ -2728,7 +2735,7 @@ namespace if(aSubContent.hasElements()) { rTargetHolders.Current().append( - new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( aSubContent, nTransparence * 0.01)); } @@ -2839,9 +2846,9 @@ namespace if(aAttribute.getStartColor() == aAttribute.getEndColor()) { - // not really a gradient; create UnifiedAlphaPrimitive2D + // not really a gradient; create UnifiedTransparencePrimitive2D rTargetHolders.Current().append( - new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( xSubContent, aAttribute.getStartColor().luminance())); } @@ -2853,17 +2860,17 @@ namespace aTargetRectangle.Right(), aTargetRectangle.Bottom()); aRange.transform(rPropertyHolders.Current().getTransformation()); - // prepare gradient for alpha content - const drawinglayer::primitive2d::Primitive2DReference xAlpha( + // prepare gradient for transparent content + const drawinglayer::primitive2d::Primitive2DReference xTransparence( new drawinglayer::primitive2d::FillGradientPrimitive2D( aRange, aAttribute)); - // create alpha primitive + // create transparence primitive rTargetHolders.Current().append( - new drawinglayer::primitive2d::AlphaPrimitive2D( + new drawinglayer::primitive2d::TransparencePrimitive2D( xSubContent, - drawinglayer::primitive2d::Primitive2DSequence(&xAlpha, 1))); + drawinglayer::primitive2d::Primitive2DSequence(&xTransparence, 1))); } } } diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx index 83bbb58bde..bd35c017b8 100644 --- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx @@ -77,7 +77,10 @@ namespace drawinglayer if(!aAllowedContentRange.isInside(aRealContentRange)) { - const Primitive2DReference xReferenceA(new MaskPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(aAllowedContentRange)), aContent)); + const Primitive2DReference xReferenceA( + new MaskPrimitive2D( + basegfx::B2DPolyPolygon( + basegfx::tools::createPolygonFromRect(aAllowedContentRange)), aContent)); aContent = Primitive2DSequence(&xReferenceA, 1); } diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index a66cb4b2f5..42aa677d1b 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -43,6 +43,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -243,7 +244,7 @@ namespace drawinglayer const basegfx::B2DPolygon aB2DPolygon(basegfx::tools::simplifyCurveSegments(getB2DPolygon())); basegfx::B2DPolyPolygon aHairLinePolyPolygon; - if(0.0 == getStrokeAttribute().getFullDotDashLen()) + if(getStrokeAttribute().isDefault() || 0.0 == getStrokeAttribute().getFullDotDashLen()) { // no line dashing, just copy aHairLinePolyPolygon.append(aB2DPolygon); @@ -251,12 +252,14 @@ namespace drawinglayer else { // apply LineStyle - basegfx::tools::applyLineDashing(aB2DPolygon, getStrokeAttribute().getDotDashArray(), &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen()); + basegfx::tools::applyLineDashing( + aB2DPolygon, getStrokeAttribute().getDotDashArray(), + &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen()); } const sal_uInt32 nCount(aHairLinePolyPolygon.count()); - if(getLineAttribute().getWidth()) + if(!getLineAttribute().isDefault() && getLineAttribute().getWidth()) { // create fat line data const double fHalfLineWidth(getLineAttribute().getWidth() / 2.0); @@ -293,7 +296,11 @@ namespace drawinglayer else { // prepare return value - const Primitive2DReference xRef(new PolyPolygonHairlinePrimitive2D(aHairLinePolyPolygon, getLineAttribute().getColor())); + const Primitive2DReference xRef( + new PolyPolygonHairlinePrimitive2D( + aHairLinePolyPolygon, + getLineAttribute().getColor())); + return Primitive2DSequence(&xRef, 1); } } @@ -519,7 +526,7 @@ namespace drawinglayer double fStart(0.0); double fEnd(0.0); - if(getStart().isActive()) + if(!getStart().isDefault() && getStart().isActive()) { // create start arrow primitive and consume aArrowA = basegfx::tools::createAreaGeometryForLineStartEnd( @@ -530,7 +537,7 @@ namespace drawinglayer fStart *= 0.8; } - if(getEnd().isActive()) + if(!getEnd().isDefault() && getEnd().isActive()) { // create end arrow primitive and consume aArrowB = basegfx::tools::createAreaGeometryForLineStartEnd( @@ -553,18 +560,24 @@ namespace drawinglayer sal_uInt32 nInd(0L); // add shaft - const Primitive2DReference xRefShaft(new PolygonStrokePrimitive2D(aLocalPolygon, getLineAttribute(), getStrokeAttribute())); + const Primitive2DReference xRefShaft(new + PolygonStrokePrimitive2D( + aLocalPolygon, getLineAttribute(), getStrokeAttribute())); aRetval[nInd++] = xRefShaft; if(aArrowA.count()) { - const Primitive2DReference xRefA(new PolyPolygonColorPrimitive2D(aArrowA, getLineAttribute().getColor())); + const Primitive2DReference xRefA( + new PolyPolygonColorPrimitive2D( + aArrowA, getLineAttribute().getColor())); aRetval[nInd++] = xRefA; } if(aArrowB.count()) { - const Primitive2DReference xRefB(new PolyPolygonColorPrimitive2D(aArrowB, getLineAttribute().getColor())); + const Primitive2DReference xRefB( + new PolyPolygonColorPrimitive2D( + aArrowB, getLineAttribute().getColor())); aRetval[nInd++] = xRefB; } diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx index 092d572088..4df9fcdfac 100644 --- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx @@ -196,7 +196,9 @@ namespace drawinglayer for(sal_uInt32 a(0L); a < nCount; a++) { - aRetval[a] = Primitive2DReference(new PolygonStrokePrimitive2D(aPolyPolygon.getB2DPolygon(a), getLineAttribute(), getStrokeAttribute())); + aRetval[a] = Primitive2DReference( + new PolygonStrokePrimitive2D( + aPolyPolygon.getB2DPolygon(a), getLineAttribute(), getStrokeAttribute())); } return aRetval; @@ -284,11 +286,14 @@ namespace drawinglayer if(aPolygon.isClosed()) { // no need for PolygonStrokeArrowPrimitive2D when polygon is closed - aRetval[a] = Primitive2DReference(new PolygonStrokePrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute())); + aRetval[a] = Primitive2DReference( + new PolygonStrokePrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute())); } else { - aRetval[a] = Primitive2DReference(new PolygonStrokeArrowPrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute(), getStart(), getEnd())); + aRetval[a] = Primitive2DReference( + new PolygonStrokeArrowPrimitive2D(aPolygon, getLineAttribute(), + getStrokeAttribute(), getStart(), getEnd())); } } @@ -406,16 +411,24 @@ namespace drawinglayer { Primitive2DSequence PolyPolygonGradientPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { - // create SubSequence with FillGradientPrimitive2D - const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); - FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, getFillGradient()); - const Primitive2DReference xSubRef(pNewGradient); - const Primitive2DSequence aSubSequence(&xSubRef, 1L); - - // create mask primitive - MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence); - const Primitive2DReference xRef(pNewMask); - return Primitive2DSequence(&xRef, 1L); + if(!getFillGradient().isDefault()) + { + // create SubSequence with FillGradientPrimitive2D + const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); + FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, getFillGradient()); + const Primitive2DReference xSubRef(pNewGradient); + const Primitive2DSequence aSubSequence(&xSubRef, 1L); + + // create mask primitive + MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence); + const Primitive2DReference xRef(pNewMask); + + return Primitive2DSequence(&xRef, 1); + } + else + { + return Primitive2DSequence(); + } } PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D( @@ -453,16 +466,24 @@ namespace drawinglayer { Primitive2DSequence PolyPolygonHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { - // create SubSequence with FillHatchPrimitive2D - const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); - FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch()); - const Primitive2DReference xSubRef(pNewHatch); - const Primitive2DSequence aSubSequence(&xSubRef, 1L); - - // create mask primitive - MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence); - const Primitive2DReference xRef(pNewMask); - return Primitive2DSequence(&xRef, 1L); + if(!getFillHatch().isDefault()) + { + // create SubSequence with FillHatchPrimitive2D + const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); + FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch()); + const Primitive2DReference xSubRef(pNewHatch); + const Primitive2DSequence aSubSequence(&xSubRef, 1L); + + // create mask primitive + MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence); + const Primitive2DReference xRef(pNewMask); + + return Primitive2DSequence(&xRef, 1); + } + else + { + return Primitive2DSequence(); + } } PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D( @@ -503,21 +524,29 @@ namespace drawinglayer { Primitive2DSequence PolyPolygonBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { - // create SubSequence with FillBitmapPrimitive2D - const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); - basegfx::B2DHomMatrix aNewObjectTransform; - aNewObjectTransform.set(0, 0, aPolyPolygonRange.getWidth()); - aNewObjectTransform.set(1, 1, aPolyPolygonRange.getHeight()); - aNewObjectTransform.set(0, 2, aPolyPolygonRange.getMinX()); - aNewObjectTransform.set(1, 2, aPolyPolygonRange.getMinY()); - FillBitmapPrimitive2D* pNewBitmap = new FillBitmapPrimitive2D(aNewObjectTransform, getFillBitmap()); - const Primitive2DReference xSubRef(pNewBitmap); - const Primitive2DSequence aSubSequence(&xSubRef, 1L); - - // create mask primitive - MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence); - const Primitive2DReference xRef(pNewMask); - return Primitive2DSequence(&xRef, 1L); + if(!getFillBitmap().isDefault()) + { + // create SubSequence with FillBitmapPrimitive2D + const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange()); + basegfx::B2DHomMatrix aNewObjectTransform; + aNewObjectTransform.set(0, 0, aPolyPolygonRange.getWidth()); + aNewObjectTransform.set(1, 1, aPolyPolygonRange.getHeight()); + aNewObjectTransform.set(0, 2, aPolyPolygonRange.getMinX()); + aNewObjectTransform.set(1, 2, aPolyPolygonRange.getMinY()); + FillBitmapPrimitive2D* pNewBitmap = new FillBitmapPrimitive2D(aNewObjectTransform, getFillBitmap()); + const Primitive2DReference xSubRef(pNewBitmap); + const Primitive2DSequence aSubSequence(&xSubRef, 1L); + + // create mask primitive + MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence); + const Primitive2DReference xRef(pNewMask); + + return Primitive2DSequence(&xRef, 1); + } + else + { + return Primitive2DSequence(); + } } PolyPolygonBitmapPrimitive2D::PolyPolygonBitmapPrimitive2D( diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index a76c926b0c..d52b7c33d1 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -156,8 +156,10 @@ namespace drawinglayer if(impGetShadow3D(rViewInformation)) { // test visibility - const basegfx::B2DRange aShadow2DRange(getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation)); - const basegfx::B2DRange aViewRange(rViewInformation.getViewport()); + const basegfx::B2DRange aShadow2DRange( + getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation)); + const basegfx::B2DRange aViewRange( + rViewInformation.getViewport()); if(aViewRange.isEmpty() || aShadow2DRange.overlaps(aViewRange)) { @@ -170,6 +172,7 @@ namespace drawinglayer basegfx::B2DRange aDiscreteRange; basegfx::B2DRange aVisibleDiscreteRange; basegfx::B2DRange aUnitVisibleRange; + calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange); if(!aVisibleDiscreteRange.isEmpty()) @@ -263,7 +266,7 @@ namespace drawinglayer if(bAddOutlineToCreated3DSceneRepresentation) { - basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon()); aOutline.transform(aNew2DTransform); const Primitive2DReference xRef2(new PolygonHairlinePrimitive2D(aOutline, basegfx::BColor(1.0, 0.0, 0.0))); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xRef2); diff --git a/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx new file mode 100644 index 0000000000..e142deafdb --- /dev/null +++ b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx @@ -0,0 +1,130 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrdecompositiontools3d.cxx,v $ + * + * $Revision: 1.7 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:21 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * 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 +#include +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DHomMatrix& rMatrix) + { + const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon()); + + return createHiddenGeometryPrimitives2D( + bFilled, + basegfx::B2DPolyPolygon(aUnitOutline), + rMatrix); + } + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DPolyPolygon& rPolyPolygon) + { + return createHiddenGeometryPrimitives2D( + bFilled, + rPolyPolygon, + basegfx::B2DHomMatrix()); + } + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DRange& rRange) + { + return createHiddenGeometryPrimitives2D( + bFilled, + rRange, + basegfx::B2DHomMatrix()); + } + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DRange& rRange, + const basegfx::B2DHomMatrix& rMatrix) + { + const basegfx::B2DPolyPolygon aOutline(basegfx::tools::createPolygonFromRect(rRange)); + + return createHiddenGeometryPrimitives2D( + bFilled, + aOutline, + rMatrix); + } + + Primitive2DReference createHiddenGeometryPrimitives2D( + bool bFilled, + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::B2DHomMatrix& rMatrix) + { + // create fill or line primitive + Primitive2DReference xReference; + basegfx::B2DPolyPolygon aScaledOutline(rPolyPolygon); + aScaledOutline.transform(rMatrix); + + if(bFilled) + { + xReference = new PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aScaledOutline), + basegfx::BColor(0.0, 0.0, 0.0)); + } + else + { + const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0); + + xReference = new PolyPolygonHairlinePrimitive2D( + aScaledOutline, + aGrayTone); + } + + // create HiddenGeometryPrimitive2D + return Primitive2DReference( + new HiddenGeometryPrimitive2D(Primitive2DSequence(&xReference, 1))); + } + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index 5f7c20379c..046be5372c 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -41,8 +41,8 @@ #include #include #include -#include -#include +#include +#include #include ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx new file mode 100644 index 0000000000..0923234e67 --- /dev/null +++ b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: alphaprimitive2d.cxx,v $ + * + * $Revision: 1.5 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +using namespace com::sun::star; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + TransparencePrimitive2D::TransparencePrimitive2D( + const Primitive2DSequence& rChildren, + const Primitive2DSequence& rTransparence) + : GroupPrimitive2D(rChildren), + maTransparence(rTransparence) + { + } + + bool TransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(GroupPrimitive2D::operator==(rPrimitive)) + { + const TransparencePrimitive2D& rCompare = (TransparencePrimitive2D&)rPrimitive; + + return (getTransparence() == rCompare.getTransparence()); + } + + return false; + } + + // provide unique ID + ImplPrimitrive2DIDBlock(TransparencePrimitive2D, PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D) + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx deleted file mode 100644 index ec80034261..0000000000 --- a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx +++ /dev/null @@ -1,129 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: unifiedalphaprimitive2d.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 -#include -#include -#include -#include -#include -#include -#include - -////////////////////////////////////////////////////////////////////////////// - -using namespace com::sun::star; - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive2d - { - 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()) - { - // no transparence used, so just use the content - return getChildren(); - } - else if(getAlpha() > 0.0 && getAlpha() < 1.0) - { - // The idea is to create a AlphaPrimitive2D with alpha content using a fill color - // corresponding to the alpha value. Problem is that in most systems, the right - // and bottom pixel array is not filled when filling polygons, thus this would not - // always produce a complete alpha bitmap. There are some solutions: - // - // - Grow the used polygon range by one discrete unit in X and Y. This - // will make the decomposition view-dependent. - // - // - For all filled polygon renderings, dra wthe polygon outline extra. This - // would lead to unwanted side effects when using concatenated polygons. - // - // - At this decomposition, add a filled polygon and a hairline polygon. This - // solution stays view-independent. - // - // I will take the last one here. The small overhead of two primitives will only be - // used when UnifiedAlphaPrimitive2D is not handled directly. - const basegfx::B2DRange aPolygonRange(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation)); - const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aPolygonRange)); - const basegfx::BColor aGray(getAlpha(), getAlpha(), getAlpha()); - Primitive2DSequence aAlphaContent(2); - - aAlphaContent[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aGray)); - aAlphaContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray)); - - // create sub-transparence group with a gray-colored rectangular fill polygon - const Primitive2DReference xRefB(new AlphaPrimitive2D(getChildren(), aAlphaContent)); - return Primitive2DSequence(&xRefB, 1L); - } - else - { - // completely transparent or invalid definition, add nothing - return Primitive2DSequence(); - } - } - - // provide unique ID - ImplPrimitrive2DIDBlock(UnifiedAlphaPrimitive2D, PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D) - - } // end of namespace primitive2d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx new file mode 100644 index 0000000000..2d9c0f8c97 --- /dev/null +++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: UnifiedTransparencePrimitive2D.cxx,v $ + * + * $Revision: 1.5 $ + * + * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * 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 +#include +#include +#include +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +using namespace com::sun::star; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + UnifiedTransparencePrimitive2D::UnifiedTransparencePrimitive2D( + const Primitive2DSequence& rChildren, + double fTransparence) + : GroupPrimitive2D(rChildren), + mfTransparence(fTransparence) + { + } + + bool UnifiedTransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(GroupPrimitive2D::operator==(rPrimitive)) + { + const UnifiedTransparencePrimitive2D& rCompare = (UnifiedTransparencePrimitive2D&)rPrimitive; + + return (getTransparence() == rCompare.getTransparence()); + } + + return false; + } + + basegfx::B2DRange UnifiedTransparencePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const + { + // do not use the fallback to decomposition here since for a correct BoundRect we also + // need invisible (1.0 == getTransparence()) geometry; these would be deleted in the decomposition + return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation); + } + + Primitive2DSequence UnifiedTransparencePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const + { + if(0.0 == getTransparence()) + { + // no transparence used, so just use the content + return getChildren(); + } + else if(getTransparence() > 0.0 && getTransparence() < 1.0) + { + // The idea is to create a TransparencePrimitive2D with transparent content using a fill color + // corresponding to the transparence value. Problem is that in most systems, the right + // and bottom pixel array is not filled when filling polygons, thus this would not + // always produce a complete transparent bitmap. There are some solutions: + // + // - Grow the used polygon range by one discrete unit in X and Y. This + // will make the decomposition view-dependent. + // + // - For all filled polygon renderings, dra wthe polygon outline extra. This + // would lead to unwanted side effects when using concatenated polygons. + // + // - At this decomposition, add a filled polygon and a hairline polygon. This + // solution stays view-independent. + // + // I will take the last one here. The small overhead of two primitives will only be + // used when UnifiedTransparencePrimitive2D is not handled directly. + const basegfx::B2DRange aPolygonRange(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation)); + const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aPolygonRange)); + const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence()); + Primitive2DSequence aTransparenceContent(2); + + aTransparenceContent[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aGray)); + aTransparenceContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray)); + + // create sub-transparence group with a gray-colored rectangular fill polygon + const Primitive2DReference xRefB(new TransparencePrimitive2D(getChildren(), aTransparenceContent)); + return Primitive2DSequence(&xRefB, 1L); + } + else + { + // completely transparent or invalid definition, add nothing + return Primitive2DSequence(); + } + } + + // provide unique ID + ImplPrimitrive2DIDBlock(UnifiedTransparencePrimitive2D, PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx index 376fcac866..5dd418de3b 100644 --- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx @@ -223,7 +223,8 @@ namespace drawinglayer if(bNeedsClipping) { // embed to clipping; this is necessary for tiled fills - const basegfx::B2DPolyPolygon aPolyPolygon(basegfx::tools::createPolygonFromRect(getLocalObjectRange())); + const basegfx::B2DPolyPolygon aPolyPolygon( + basegfx::tools::createPolygonFromRect(getLocalObjectRange())); const drawinglayer::primitive2d::Primitive2DReference xClippedFill( new drawinglayer::primitive2d::MaskPrimitive2D( aPolyPolygon, diff --git a/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx new file mode 100644 index 0000000000..b0163afbfc --- /dev/null +++ b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: hittestprimitive3d.cxx,v $ + * + * $Revision: 1.1.2.1 $ + * + * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * 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 +#include + +////////////////////////////////////////////////////////////////////////////// + +using namespace com::sun::star; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive3d + { + HiddenGeometryPrimitive3D::HiddenGeometryPrimitive3D( + const Primitive3DSequence& rChildren) + : GroupPrimitive3D(rChildren) + { + } + + basegfx::B3DRange HiddenGeometryPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const + { + return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation); + } + + Primitive3DSequence HiddenGeometryPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + { + // return empty sequence + return Primitive3DSequence(); + } + + // provide unique ID + ImplPrimitrive3DIDBlock(HiddenGeometryPrimitive3D, PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D) + + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx b/drawinglayer/source/primitive3d/hittestprimitive3d.cxx deleted file mode 100644 index 62a30333ff..0000000000 --- a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hittestprimitive3d.cxx,v $ - * - * $Revision: 1.1.2.1 $ - * - * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * 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 -#include - -////////////////////////////////////////////////////////////////////////////// - -using namespace com::sun::star; - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive3d - { - HitTestPrimitive3D::HitTestPrimitive3D( - const Primitive3DSequence& rChildren) - : GroupPrimitive3D(rChildren) - { - } - - basegfx::B3DRange HitTestPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const - { - 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) - - } // end of namespace primitive3d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/primitive3d/makefile.mk b/drawinglayer/source/primitive3d/makefile.mk index fb160fb9bf..31c0c911bf 100644 --- a/drawinglayer/source/primitive3d/makefile.mk +++ b/drawinglayer/source/primitive3d/makefile.mk @@ -48,7 +48,7 @@ SLOFILES= \ $(SLO)$/baseprimitive3d.obj \ $(SLO)$/groupprimitive3d.obj \ $(SLO)$/hatchtextureprimitive3d.obj \ - $(SLO)$/hittestprimitive3d.obj \ + $(SLO)$/hiddengeometryprimitive3d.obj \ $(SLO)$/modifiedcolorprimitive3d.obj \ $(SLO)$/polypolygonprimitive3d.obj \ $(SLO)$/polygonprimitive3d.obj \ diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx index 219f05fab4..4fc667176b 100644 --- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx @@ -65,7 +65,7 @@ namespace drawinglayer // may exclusively change static data, use mutex ::osl::Mutex m_mutex; - if(nSegments != nLineTubeSegments || rMaterial != aLineMaterial) + if(nSegments != nLineTubeSegments || !(rMaterial == aLineMaterial)) { nLineTubeSegments = nSegments; aLineMaterial = rMaterial; @@ -126,7 +126,7 @@ namespace drawinglayer // may exclusively change static data, use mutex ::osl::Mutex m_mutex; - if(nSegments != nLineCapSegments || rMaterial != aLineMaterial) + if(nSegments != nLineCapSegments || !(rMaterial == aLineMaterial)) { nLineCapSegments = nSegments; aLineMaterial = rMaterial; diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx index ebe9e727da..0ad9806e97 100644 --- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx @@ -43,8 +43,9 @@ #include #include #include -#include -#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -63,7 +64,7 @@ namespace drawinglayer basegfx::B3DPolyPolygon aFill(basegfx::tools::createCubeFillPolyPolygonFromB3DRange(aUnitRange)); // normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPECIFIC == getSdr3DObjectAttribute().getNormalsKind() || ::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind()) @@ -81,7 +82,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // handle texture coordinates X const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX()); @@ -153,7 +154,7 @@ namespace drawinglayer a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a))); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -161,39 +162,33 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( a3DPolyPolygonVector, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(aUnitRange)); - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } @@ -203,7 +198,7 @@ namespace drawinglayer SdrCubePrimitive3D::SdrCubePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute) : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute) { diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx index df15cc8a3c..8e09535d58 100644 --- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx @@ -39,14 +39,11 @@ #include #include #include -#include #include #include #include #include -#include #include -#include #include #include #include @@ -55,8 +52,12 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -175,8 +176,8 @@ namespace drawinglayer if(0.0 != rLine.getTransparence()) { - // create UnifiedAlphaTexturePrimitive3D, add created primitives and exchange - const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rLine.getTransparence(), aRetval)); + // create UnifiedTransparenceTexturePrimitive3D, add created primitives and exchange + const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rLine.getTransparence(), aRetval)); aRetval = Primitive3DSequence(&xRef, 1L); } @@ -189,7 +190,7 @@ namespace drawinglayer const basegfx::B2DVector& rTextureSize, const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute, const attribute::SdrFillAttribute& rFill, - const attribute::FillGradientAttribute* pFillGradient) + const attribute::FillGradientAttribute& rFillGradient) { Primitive3DSequence aRetval; @@ -217,27 +218,45 @@ namespace drawinglayer } // look for and evtl. build texture sub-group primitive - if(rFill.isGradient() || rFill.isHatch() || rFill.isBitmap()) + if(!rFill.getGradient().isDefault() + || !rFill.getHatch().isDefault() + || !rFill.getBitmap().isDefault()) { bool bModulate(::com::sun::star::drawing::TextureMode_MODULATE == aSdr3DObjectAttribute.getTextureMode()); bool bFilter(aSdr3DObjectAttribute.getTextureFilter()); - BasePrimitive3D* pNewTexturePrimitive3D = 0L; + BasePrimitive3D* pNewTexturePrimitive3D = 0; - if(rFill.isGradient()) + if(!rFill.getGradient().isDefault()) { // create gradientTexture3D with sublist, add to local aRetval - pNewTexturePrimitive3D = new GradientTexturePrimitive3D(*rFill.getGradient(), aRetval, rTextureSize, bModulate, bFilter); + pNewTexturePrimitive3D = new GradientTexturePrimitive3D( + rFill.getGradient(), + aRetval, + rTextureSize, + bModulate, + bFilter); } - else if(rFill.isHatch()) + else if(!rFill.getHatch().isDefault()) { // create hatchTexture3D with sublist, add to local aRetval - pNewTexturePrimitive3D = new HatchTexturePrimitive3D(*rFill.getHatch(), aRetval, rTextureSize, bModulate, bFilter); + pNewTexturePrimitive3D = new HatchTexturePrimitive3D( + rFill.getHatch(), + aRetval, + rTextureSize, + bModulate, + bFilter); } - else // if(rFill.isBitmap()) + else // if(!rFill.getBitmap().isDefault()) { // create bitmapTexture3D with sublist, add to local aRetval basegfx::B2DRange aTexRange(0.0, 0.0, rTextureSize.getX(), rTextureSize.getY()); - pNewTexturePrimitive3D = new BitmapTexturePrimitive3D(rFill.getBitmap()->getFillBitmapAttribute(aTexRange), aRetval, rTextureSize, bModulate, bFilter); + + pNewTexturePrimitive3D = new BitmapTexturePrimitive3D( + rFill.getBitmap().getFillBitmapAttribute(aTexRange), + aRetval, + rTextureSize, + bModulate, + bFilter); } // exchange aRetval content with texture group @@ -255,14 +274,14 @@ namespace drawinglayer if(0.0 != rFill.getTransparence()) { - // create UnifiedAlphaTexturePrimitive3D with sublist and exchange - const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rFill.getTransparence(), aRetval)); + // create UnifiedTransparenceTexturePrimitive3D with sublist and exchange + const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rFill.getTransparence(), aRetval)); aRetval = Primitive3DSequence(&xRef, 1L); } - else if(pFillGradient) + else if(!rFillGradient.isDefault()) { - // create AlphaTexturePrimitive3D with sublist and exchange - const Primitive3DReference xRef(new AlphaTexturePrimitive3D(*pFillGradient, aRetval, rTextureSize)); + // create TransparenceTexturePrimitive3D with sublist and exchange + const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(rFillGradient, aRetval, rTextureSize)); aRetval = Primitive3DSequence(&xRef, 1L); } } @@ -292,6 +311,35 @@ namespace drawinglayer return Primitive3DSequence(); } } + + Primitive3DSequence createHiddenGeometryPrimitives3D( + const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector, + const basegfx::B3DHomMatrix& rObjectTransform, + const basegfx::B2DVector& rTextureSize, + const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute) + { + // create hidden sub-geometry which can be used for HitTest + // and BoundRect calculations, but will not be visualized + const attribute::SdrFillAttribute aSimplifiedFillAttribute( + 0.0, + basegfx::BColor(), + attribute::FillGradientAttribute(), + attribute::FillHatchAttribute(), + attribute::SdrFillBitmapAttribute()); + + const Primitive3DReference aHidden( + new HiddenGeometryPrimitive3D( + create3DPolyPolygonFillPrimitives( + r3DPolyPolygonVector, + rObjectTransform, + rTextureSize, + aSdr3DObjectAttribute, + aSimplifiedFillAttribute, + attribute::FillGradientAttribute()))); + + return Primitive3DSequence(&aHidden, 1); + } + } // end of namespace primitive3d } // end of namespace drawinglayer diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx index 5ebe15db3f..0d9b0ee5a2 100644 --- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx @@ -44,8 +44,9 @@ #include #include #include -#include -#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -76,7 +77,7 @@ namespace drawinglayer double fRelativeTextureWidth(1.0); basegfx::B2DHomMatrix aTexTransform; - if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) + if(!getSdrLFSAttribute().getFill().isDefault() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) { const basegfx::B2DPolygon aFirstPolygon(maCorrectedPolyPolygon.getB2DPolygon(0L)); const double fFrontLength(basegfx::tools::getLength(aFirstPolygon)); @@ -106,7 +107,7 @@ namespace drawinglayer const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill)); // normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind) { @@ -124,7 +125,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { applyTextureTo3DGeometry( getSdr3DObjectAttribute().getTextureProjectionX(), @@ -134,7 +135,7 @@ namespace drawinglayer getTextureSize()); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -142,29 +143,21 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( aFill, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { if(getSdr3DObjectAttribute().getReducedLineGeometry()) { @@ -349,7 +342,8 @@ namespace drawinglayer if(aNewLineGeometry.count()) { - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } } @@ -360,19 +354,22 @@ namespace drawinglayer const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector)); // add horizontal lines - const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives( + aHorLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines); // add vertical lines - const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives( + aVerLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines); } } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } } @@ -409,7 +406,7 @@ namespace drawinglayer SdrExtrudePrimitive3D::SdrExtrudePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, double fDepth, diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx index f9827ea627..27ebb3b611 100644 --- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx @@ -44,8 +44,9 @@ #include #include #include -#include -#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -77,7 +78,8 @@ namespace drawinglayer const bool bCreateTextureCoordiantesY(::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC == getSdr3DObjectAttribute().getTextureProjectionY()); basegfx::B2DHomMatrix aTexTransform; - if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) + if(!getSdrLFSAttribute().getFill().isDefault() + && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) { aTexTransform.set(0, 0, 0.0); aTexTransform.set(0, 1, 1.0); @@ -99,7 +101,7 @@ namespace drawinglayer const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill)); // normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind) { @@ -117,7 +119,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { applyTextureTo3DGeometry( getSdr3DObjectAttribute().getTextureProjectionX(), @@ -127,7 +129,7 @@ namespace drawinglayer getTextureSize()); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -135,29 +137,21 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( aFill, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { if(getSdr3DObjectAttribute().getReducedLineGeometry()) { @@ -191,7 +185,8 @@ namespace drawinglayer if(aNewLineGeometry.count()) { - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } } @@ -202,19 +197,23 @@ namespace drawinglayer const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector)); // add horizontal lines - const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives( + aHorLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines); // add vertical lines - const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives( + aVerLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines); } } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() + && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } } @@ -262,7 +261,7 @@ namespace drawinglayer SdrLathePrimitive3D::SdrLathePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, sal_uInt32 nHorizontalSegments, diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx index 38a3fea538..048bec319c 100644 --- a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx @@ -40,8 +40,9 @@ #include #include #include -#include -#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -66,7 +67,7 @@ namespace drawinglayer const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill)); // #i98295# normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind()) { @@ -84,7 +85,7 @@ namespace drawinglayer } // #i98314# texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { applyTextureTo3DGeometry( getSdr3DObjectAttribute().getTextureProjectionX(), @@ -94,7 +95,7 @@ namespace drawinglayer getTextureSize()); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -102,41 +103,36 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( aFill, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { basegfx::B3DPolyPolygon aLine(getPolyPolygon3D()); aLine.clearNormals(); aLine.clearTextureCoordinates(); - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() + && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } } @@ -148,7 +144,7 @@ namespace drawinglayer const basegfx::B3DPolyPolygon& rPolyPolygon3D, const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute) : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute), maPolyPolygon3D(rPolyPolygon3D) @@ -181,11 +177,11 @@ namespace drawinglayer aRetval = basegfx::tools::getRange(getPolyPolygon3D()); aRetval.transform(getTransform()); - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { - const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine(); + const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine(); - if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth())) + if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth())) { // expand by half LineWidth as tube radius aRetval.grow(rLine.getWidth() / 2.0); diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx index 58f4fee375..3732470e61 100644 --- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx @@ -37,9 +37,9 @@ #include "precompiled_drawinglayer.hxx" #include -#include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -56,11 +56,11 @@ namespace drawinglayer basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); aUnitRange.transform(getTransform()); - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { - const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine(); + const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine(); - if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth())) + if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth())) { // expand by hald LineWidth as tube radius aUnitRange.grow(rLine.getWidth() / 2.0); @@ -83,11 +83,11 @@ namespace drawinglayer aRetval.transform(getTransform()); - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { - const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine(); + const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine(); - if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth())) + if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth())) { // expand by half LineWidth as tube radius aRetval.grow(rLine.getWidth() / 2.0); @@ -101,7 +101,7 @@ namespace drawinglayer SdrPrimitive3D::SdrPrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute) : BufferedDecompositionPrimitive3D(), maTransform(rTransform), diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx index 80ad33e484..32537ae935 100644 --- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx @@ -43,8 +43,9 @@ #include #include #include -#include -#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -68,7 +69,7 @@ namespace drawinglayer getHorizontalSegments(), getVerticalSegments(), bCreateNormals)); // normal inversion - if(getSdrLFSAttribute().getFill() + if(!getSdrLFSAttribute().getFill().isDefault() && bCreateNormals && getSdr3DObjectAttribute().getNormalsInvert() && aFill.areNormalsUsed()) @@ -78,7 +79,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // handle texture coordinates X const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX()); @@ -142,7 +143,7 @@ namespace drawinglayer a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a))); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -150,39 +151,34 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( a3DPolyPolygonVector, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(aUnitRange, getHorizontalSegments(), getVerticalSegments())); - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aSphere, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aSphere, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() + && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } @@ -192,7 +188,7 @@ namespace drawinglayer SdrSpherePrimitive3D::SdrSpherePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, sal_uInt32 nHorizontalSegments, sal_uInt32 nVerticalSegments) diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx index ea3c9e72fa..92f05a8992 100644 --- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx @@ -38,6 +38,7 @@ #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -81,7 +82,7 @@ namespace drawinglayer { namespace primitive3d { - UnifiedAlphaTexturePrimitive3D::UnifiedAlphaTexturePrimitive3D( + UnifiedTransparenceTexturePrimitive3D::UnifiedTransparenceTexturePrimitive3D( double fTransparence, const Primitive3DSequence& rChildren) : TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false), @@ -89,11 +90,11 @@ namespace drawinglayer { } - bool UnifiedAlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const + bool UnifiedTransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const { if(TexturePrimitive3D::operator==(rPrimitive)) { - const UnifiedAlphaTexturePrimitive3D& rCompare = (UnifiedAlphaTexturePrimitive3D&)rPrimitive; + const UnifiedTransparenceTexturePrimitive3D& rCompare = (UnifiedTransparenceTexturePrimitive3D&)rPrimitive; return (getTransparence() == rCompare.getTransparence()); } @@ -101,7 +102,14 @@ namespace drawinglayer return false; } - Primitive3DSequence UnifiedAlphaTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + basegfx::B3DRange UnifiedTransparenceTexturePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const + { + // do not use the fallback to decomposition here since for a correct BoundRect we also + // need invisible (1.0 == getTransparence()) geometry; these would be deleted in the decomposition + return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation); + } + + Primitive3DSequence UnifiedTransparenceTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { if(0.0 == getTransparence()) { @@ -110,10 +118,10 @@ namespace drawinglayer } else if(getTransparence() > 0.0 && getTransparence() < 1.0) { - // create AlphaTexturePrimitive3D with fixed transparence as replacement + // create TransparenceTexturePrimitive3D with fixed transparence as replacement const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence()); const attribute::FillGradientAttribute aFillGradient(attribute::GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1); - const Primitive3DReference xRef(new AlphaTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize())); + const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize())); return Primitive3DSequence(&xRef, 1L); } else @@ -124,7 +132,7 @@ namespace drawinglayer } // provide unique ID - ImplPrimitrive3DIDBlock(UnifiedAlphaTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D) + ImplPrimitrive3DIDBlock(UnifiedTransparenceTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D) } // end of namespace primitive3d } // end of namespace drawinglayer @@ -204,7 +212,7 @@ namespace drawinglayer { namespace primitive3d { - AlphaTexturePrimitive3D::AlphaTexturePrimitive3D( + TransparenceTexturePrimitive3D::TransparenceTexturePrimitive3D( const attribute::FillGradientAttribute& rGradient, const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize) @@ -212,13 +220,13 @@ namespace drawinglayer { } - bool AlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const + bool TransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const { return (GradientTexturePrimitive3D::operator==(rPrimitive)); } // provide unique ID - ImplPrimitrive3DIDBlock(AlphaTexturePrimitive3D, PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D) + ImplPrimitrive3DIDBlock(TransparenceTexturePrimitive3D, PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D) } // end of namespace primitive3d } // end of namespace drawinglayer diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx index f3376e2abe..3e705c69c0 100644 --- a/drawinglayer/source/processor2d/canvasprocessor.cxx +++ b/drawinglayer/source/processor2d/canvasprocessor.cxx @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include #include @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include #include @@ -388,7 +388,7 @@ using namespace com::sun::star; // slightly inside), slightly enlarge the // gradient: // - // y/2 sin(alpha) + x/2 cos(alpha) + // y/2 sin(transparence) + x/2 cos(transparence) // // (values to change are not actual // gradient scales, but original bound @@ -603,8 +603,7 @@ using namespace com::sun::star; } else { - aUnitPolygon = basegfx::tools::createPolygonFromRect( - basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)); + aUnitPolygon = basegfx::tools::createUnitPolygon(); } // create geometries @@ -977,10 +976,10 @@ using namespace com::sun::star; // paint content to it process(rSubList); - // TODO(F3): render transparent list to alpha + // TODO(F3): render transparent list to transparence // channel. Note that the OutDev implementation has a // shortcoming, in that nested transparency groups - // don't work - alpha is not combined properly. + // don't work - transparence is not combined properly. // process(rTransCandidate.getTransparenceList()); @@ -988,7 +987,7 @@ using namespace com::sun::star; mxCanvas = xLastCanvas; setWorldToView(aLastWorldToView); - // DUMMY: add alpha modulation value to DeviceColor + // DUMMY: add transparence modulation value to DeviceColor // TODO(F3): color management canvas::tools::setDeviceColor( maRenderState, 1.0, 1.0, 1.0, 0.5 ); @@ -1307,7 +1306,7 @@ namespace drawinglayer { // there are principally two methods for implementing the mask primitive. One // is to set a clip polygon at the canvas, the other is to create and use a - // alpha-using XBitmap for content and draw the mask as alpha. Both have their + // transparence-using XBitmap for content and draw the mask as transparence. Both have their // advantages and disadvantages, so here are both with a bool allowing simple // change if(bUseMaskBitmapMethod) @@ -1380,8 +1379,8 @@ namespace drawinglayer if(getOptionsDrawinglayer().IsAntiAliasing()) { // with AA, use 8bit AlphaMask to get nice borders - VirtualDevice& rAlpha = aBufferDevice.getAlpha(); - rAlpha.GetCanvas()->fillPolyPolygon( + VirtualDevice& rTransparence = aBufferDevice.getTransparence(); + rTransparence.GetCanvas()->fillPolyPolygon( basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), aMask), maViewState, maRenderState); } @@ -1586,7 +1585,7 @@ namespace drawinglayer { // replace with color filled polygon const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor())); - const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + const basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon()); maRenderState.DeviceColor = aModifiedColor.colorToDoubleSequence(mxCanvas->getDevice()); canvas::tools::setRenderStateTransform(maRenderState, @@ -1619,12 +1618,12 @@ namespace drawinglayer } } - void canvasProcessor2D::impRenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rAlphaCandidate) + void canvasProcessor2D::impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate) { - const primitive2d::Primitive2DSequence& rChildren = rAlphaCandidate.getChildren(); - const primitive2d::Primitive2DSequence& rAlpha = rAlphaCandidate.getAlpha(); + const primitive2d::Primitive2DSequence& rChildren = rTransparenceCandidate.getChildren(); + const primitive2d::Primitive2DSequence& rTransparence = rTransparenceCandidate.getTransparence(); - if(rChildren.hasElements() && rAlpha.hasElements()) + if(rChildren.hasElements() && rTransparence.hasElements()) { // get logic range of transparent part and clip with ViewRange basegfx::B2DRange aLogicRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rChildren, getViewInformation2D())); @@ -1688,16 +1687,16 @@ namespace drawinglayer process(rChildren); // set to mask - mpOutputDevice = &aBufferDevice.getAlpha(); + mpOutputDevice = &aBufferDevice.getTransparence(); mxCanvas = mpOutputDevice->GetCanvas(); canvas::tools::setViewStateTransform(maViewState, getViewInformation2D().getViewTransformation()); - // when painting alpha masks, reset the color stack + // when painting transparence masks, reset the color stack basegfx::BColorModifierStack aLastBColorModifierStack(maBColorModifierStack); maBColorModifierStack = basegfx::BColorModifierStack(); - // paint mask to it (always with alpha intensities, evtl. with AA) - process(rAlpha); + // paint mask to it (always with transparence intensities, evtl. with AA) + process(rTransparence); // back to old color stack, OutDev, Canvas and ViewTransform maBColorModifierStack = aLastBColorModifierStack; @@ -1801,7 +1800,7 @@ namespace drawinglayer { // replace with color filled polygon const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor())); - const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + const basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon()); maRenderState.DeviceColor = aModifiedColor.colorToDoubleSequence(mxCanvas->getDevice()); canvas::tools::setRenderStateTransform(maRenderState, @@ -1832,7 +1831,7 @@ namespace drawinglayer aTexture.RepeatModeY = rendering::TexturingMode::REPEAT; // canvas needs a polygon to fill, create unit rectangle polygon - const basegfx::B2DPolygon aOutlineRectangle(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + const basegfx::B2DPolygon aOutlineRectangle(basegfx::tools::createUnitPolygon()); // set primitive's transformation as render state transform canvas::tools::setRenderStateTransform(maRenderState, @@ -1860,52 +1859,60 @@ namespace drawinglayer } } - void canvasProcessor2D::impRenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate) + void canvasProcessor2D::impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate) { - const primitive2d::Primitive2DSequence rChildren = rUniAlphaCandidate.getChildren(); - - if(rChildren.hasElements()) + if(0.0 == rUniTransparenceCandidate.getTransparence()) { - bool bOutputDone(false); + // not transparent at all, directly use content + process(rUniTransparenceCandidate.getChildren()); + } + else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0) + { + const primitive2d::Primitive2DSequence rChildren = rUniTransparenceCandidate.getChildren(); - // Detect if a single PolyPolygonColorPrimitive2D is contained; in that case, - // use the fillPolyPolygon method with correctly set alpha. This is a often used - // case, so detectiong it is valuable - if(1 == rChildren.getLength()) + if(rChildren.hasElements()) { - const primitive2d::Primitive2DReference xReference(rChildren[0]); - const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); + bool bOutputDone(false); - if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) + // Detect if a single PolyPolygonColorPrimitive2D is contained; in that case, + // use the fillPolyPolygon method with correctly set transparence. This is a often used + // case, so detectiong it is valuable + if(1 == rChildren.getLength()) { - // direct draw of PolyPolygon with color and transparence - const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); - - // add alpha modulation value to DeviceColor - uno::Sequence< double > aColor(4); - - aColor[0] = aPolygonColor.getRed(); - aColor[1] = aPolygonColor.getGreen(); - aColor[2] = aPolygonColor.getBlue(); - aColor[3] = 1.0 - rUniAlphaCandidate.getAlpha(); - maRenderState.DeviceColor = aColor; - - canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation()); - mxCanvas->fillPolyPolygon( - basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), pPoPoColor->getB2DPolyPolygon()), - maViewState, maRenderState); - bOutputDone = true; + const primitive2d::Primitive2DReference xReference(rChildren[0]); + const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); + + if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) + { + // direct draw of PolyPolygon with color and transparence + const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); + + // add transparence modulation value to DeviceColor + uno::Sequence< double > aColor(4); + + aColor[0] = aPolygonColor.getRed(); + aColor[1] = aPolygonColor.getGreen(); + aColor[2] = aPolygonColor.getBlue(); + aColor[3] = 1.0 - rUniTransparenceCandidate.getTransparence(); + maRenderState.DeviceColor = aColor; + + canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation()); + mxCanvas->fillPolyPolygon( + basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), pPoPoColor->getB2DPolyPolygon()), + maViewState, maRenderState); + bOutputDone = true; + } + } + + if(!bOutputDone) + { + // process decomposition. This will be decomposed to an TransparencePrimitive2D + // with the same child context and a single polygon for transparent context. This could be + // directly handled here with known VCL-buffer technology, but would only + // make a small difference compared to directly rendering the TransparencePrimitive2D + // using impRenderTransparencePrimitive2D above. + process(rUniTransparenceCandidate.get2DDecomposition(getViewInformation2D())); } - } - - if(!bOutputDone) - { - // process decomposition. This will be decomposed to an AlphaPrimitive2D - // with the same child context and a single polygon for alpha context. This could be - // directly handled here with known VCL-buffer technology, but would only - // make a small difference compared to directly rendering the AlphaPrimitive2D - // using impRenderAlphaPrimitive2D above. - process(rUniAlphaCandidate.get2DDecomposition(getViewInformation2D())); } } } @@ -2063,10 +2070,10 @@ namespace drawinglayer break; } - case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D : { - // Alpha primitive - impRenderAlphaPrimitive2D(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate)); + // Transparence primitive + impRenderTransparencePrimitive2D(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate)); break; } @@ -2084,10 +2091,10 @@ namespace drawinglayer break; } - case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D : { - // UnifiedAlphaPrimitive2D - impRenderUnifiedAlphaPrimitive2D(static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate)); + // UnifiedTransparencePrimitive2D + impRenderUnifiedTransparencePrimitive2D(static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate)); break; } diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx index a5bd6d380a..db6de8b921 100644 --- a/drawinglayer/source/processor2d/contourextractor2d.cxx +++ b/drawinglayer/source/processor2d/contourextractor2d.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -103,7 +103,7 @@ namespace drawinglayer // extract BoundRect from bitmaps in world coordinates const primitive2d::BitmapPrimitive2D& rBitmapCandidate(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate)); basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectTransformation() * rBitmapCandidate.getTransform()); - basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon()); aPolygon.transform(aLocalTransform); maExtractedContour.push_back(basegfx::B2DPolyPolygon(aPolygon)); break; @@ -113,15 +113,15 @@ namespace drawinglayer // extract BoundRect from MetaFiles in world coordinates const primitive2d::MetafilePrimitive2D& rMetaCandidate(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate)); basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectTransformation() * rMetaCandidate.getTransform()); - basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon()); aPolygon.transform(aLocalTransform); maExtractedContour.push_back(basegfx::B2DPolyPolygon(aPolygon)); break; } - case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D : { // sub-transparence group. Look at children - const primitive2d::AlphaPrimitive2D& rTransCandidate(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate)); + const primitive2d::TransparencePrimitive2D& rTransCandidate(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate)); process(rTransCandidate.getChildren()); break; } diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx index e7c9daabfa..81b37424dd 100644 --- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx +++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx @@ -43,13 +43,13 @@ #include #include #include -#include +#include #include #include -#include #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -66,7 +66,7 @@ namespace drawinglayer mfDiscreteHitTolerance(0.0), mbHit(false), mbHitToleranceUsed(false), - mbUseHitTestPrimitiveContent(true), + mbUseInvisiblePrimitiveContent(true), mbHitTextOnly(bHitTextOnly) { // init hit tolerance @@ -247,7 +247,7 @@ namespace drawinglayer if(!getHit()) { // empty 3D scene; Check for border hit - basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon()); aOutline.transform(rCandidate.getObjectTransformation()); mbHit = checkHairlineHitWithTolerance(aOutline, getDiscreteHitTolerance()); @@ -420,10 +420,10 @@ namespace drawinglayer break; } - case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D : { // sub-transparence group - const primitive2d::AlphaPrimitive2D& rTransCandidate(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate)); + const primitive2d::TransparencePrimitive2D& rTransCandidate(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate)); // Currently the transparence content is not taken into account; only // the children are recursively checked for hit. This may be refined for @@ -499,7 +499,7 @@ namespace drawinglayer // will be used for HitTest currently. // // This may be refined in the future, e.g: - // - For Bitamps, the mask and/or alpha information may be used + // - For Bitamps, the mask and/or transparence information may be used // - For MetaFiles, the MetaFile content may be used const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D())); @@ -512,15 +512,20 @@ namespace drawinglayer break; } - case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D : + case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D : { - // HitTest primitive; the default decomposition would return an empty seqence, + // HiddenGeometryPrimitive2D; the default decomposition would return an empty seqence, // so force this primitive to process it's children directly if the switch is set // (which is the default). Else, ignore invisible content - if(getUseHitTestPrimitiveContent()) + const primitive2d::HiddenGeometryPrimitive2D& rHiddenGeometry(static_cast< const primitive2d::HiddenGeometryPrimitive2D& >(rCandidate)); + const primitive2d::Primitive2DSequence& rChildren = rHiddenGeometry.getChildren(); + + if(rChildren.hasElements()) { - const primitive2d::HitTestPrimitive2D& rHitTestCandidate(static_cast< const primitive2d::HitTestPrimitive2D& >(rCandidate)); - process(rHitTestCandidate.getChildren()); + if(getUseInvisiblePrimitiveContent()) + { + process(rChildren); + } } break; diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx index 39db373b1c..b8e5c93827 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx @@ -123,7 +123,7 @@ namespace drawinglayer if(bDoSaveForVisualControl) { - SvFileStream aNew((const String&)String(ByteString( "c:\\alpha.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC); + SvFileStream aNew((const String&)String(ByteString( "c:\\transparence.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC); aNew << aAlphaMask.GetBitmap(); } @@ -170,7 +170,7 @@ namespace drawinglayer return *mpMask; } - VirtualDevice& impBufferDevice::getAlpha() + VirtualDevice& impBufferDevice::getTransparence() { if(!mpAlpha) { diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx index 4ffca76e4c..9eb1cc246c 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx @@ -67,7 +67,7 @@ namespace drawinglayer bool isVisible() const { return !maDestPixel.IsEmpty(); } VirtualDevice& getContent() { return maContent; } VirtualDevice& getMask(); - VirtualDevice& getAlpha(); + VirtualDevice& getTransparence(); }; } // end of namespace drawinglayer diff --git a/drawinglayer/source/processor2d/vclhelpergradient.cxx b/drawinglayer/source/processor2d/vclhelpergradient.cxx index c02845e9c6..fda746060a 100644 --- a/drawinglayer/source/processor2d/vclhelpergradient.cxx +++ b/drawinglayer/source/processor2d/vclhelpergradient.cxx @@ -225,7 +225,7 @@ namespace drawinglayer } else { - aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)); + aUnitPolygon = basegfx::tools::createUnitPolygon(); } // make sure steps is not too high/low diff --git a/drawinglayer/source/processor2d/vclhelpergradient.hxx b/drawinglayer/source/processor2d/vclhelpergradient.hxx index 8f2558a7b5..643fdc66af 100644 --- a/drawinglayer/source/processor2d/vclhelpergradient.hxx +++ b/drawinglayer/source/processor2d/vclhelpergradient.hxx @@ -36,7 +36,8 @@ #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLHELPERGRADIENT_HXX #define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLHELPERGRADIENT_HXX -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 59d111fffb..32481646de 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -52,8 +51,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -73,8 +72,8 @@ #include #include #include -#include #include +#include ////////////////////////////////////////////////////////////////////////////// // for PDFExtOutDevData Graphic support @@ -160,7 +159,7 @@ namespace drawinglayer { if(bIsTransparenceGradient) { - // it's about alpha channel intensities (black/white), do not use color modifier + // it's about transparence channel intensities (black/white), do not use color modifier o_rVCLGradient.SetStartColor(Color(rFiGrAtt.getStartColor())); o_rVCLGradient.SetEndColor(Color(rFiGrAtt.getEndColor())); } @@ -444,13 +443,13 @@ namespace drawinglayer fills. Thus, users have the choice to use the SvtGraphicFill info or the created output actions. Even for XFillTransparenceItem it is used, thus it may need to be supported in - UnifiedAlphaPrimitive2D, too, when interpreted as normally filled PolyPolygon. + UnifiedTransparencePrimitive2D, too, when interpreted as normally filled PolyPolygon. Implemented for: PRIMITIVE2D_ID_POLYPOLYGONBITMAPPRIMITIVE2D, PRIMITIVE2D_ID_POLYPOLYGONHATCHPRIMITIVE2D, PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D, PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D, - and for PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D when detected unified alpha + and for PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D when detected unified transparence XPATHSTROKE_SEQ_BEGIN, XPATHSTROKE_SEQ_END: @@ -1483,138 +1482,166 @@ namespace drawinglayer RenderModifiedColorPrimitive2D(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(rCandidate)); break; } - case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D : + { + // HiddenGeometryPrimitive2D; to rebuilt the old MetaFile creation, it is necessary to + // not ignore them (as it was thought), but to add a MetaFile entry for them. + basegfx::B2DRange aInvisibleRange(rCandidate.getB2DRange(getViewInformation2D())); + + if(!aInvisibleRange.isEmpty()) + { + aInvisibleRange.transform(maCurrentTransformation); + const Rectangle aRectLogic( + (sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()), + (sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY())); + + mpOutputDevice->SetFillColor(); + mpOutputDevice->SetLineColor(); + mpOutputDevice->DrawRect(aRectLogic); + } + + break; + } + case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D : { // for metafile: Need to examine what the pure vcl version is doing here actually // - uses DrawTransparent with metafile for content and a gradient // - uses DrawTransparent for single PolyPoylgons directly. Can be detected by // checking the content for single PolyPolygonColorPrimitive2D - const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate = static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate); - const primitive2d::Primitive2DSequence rContent = rUniAlphaCandidate.getChildren(); + const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate); + const primitive2d::Primitive2DSequence rContent = rUniTransparenceCandidate.getChildren(); if(rContent.hasElements()) { - // try to identify a single PolyPolygonColorPrimitive2D in the - // content part of the alpha primitive - const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = 0; - static bool bForceToMetafile(false); - - if(!bForceToMetafile && 1 == rContent.getLength()) + if(0.0 == rUniTransparenceCandidate.getTransparence()) { - const primitive2d::Primitive2DReference xReference(rContent[0]); - pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); + // not transparent at all, use content + process(rUniTransparenceCandidate.getChildren()); } - - // PolyPolygonGradientPrimitive2D, PolyPolygonHatchPrimitive2D and - // PolyPolygonBitmapPrimitive2D are derived from PolyPolygonColorPrimitive2D. - // Check also for correct ID to exclude derived implementations - if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) + else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0) { - // single transparent PolyPolygon identified, use directly - const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); - basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon()); - aLocalPolyPolygon.transform(maCurrentTransformation); - - // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support - SvtGraphicFill* pSvtGraphicFill = 0; + // try to identify a single PolyPolygonColorPrimitive2D in the + // content part of the transparence primitive + const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = 0; + static bool bForceToMetafile(false); - if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count()) + if(!bForceToMetafile && 1 == rContent.getLength()) { - // setup simple color with transparence fill stuff like in impgrfll - pSvtGraphicFill = new SvtGraphicFill( - PolyPolygon(aLocalPolyPolygon), - Color(aPolygonColor), - rUniAlphaCandidate.getAlpha(), - SvtGraphicFill::fillEvenOdd, - SvtGraphicFill::fillSolid, - SvtGraphicFill::Transform(), - false, - SvtGraphicFill::hatchSingle, - Color(), - SvtGraphicFill::gradientLinear, - Color(), - Color(), - 0, - Graphic()); + const primitive2d::Primitive2DReference xReference(rContent[0]); + pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); } - // set line and fill color - const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniAlphaCandidate.getAlpha() * 100.0)); - mpOutputDevice->SetFillColor(Color(aPolygonColor)); - mpOutputDevice->SetLineColor(); - - // call VCL directly; encapsulate with SvtGraphicFill - impStartSvtGraphicFill(pSvtGraphicFill); - mpOutputDevice->DrawTransparent( - PolyPolygon(aLocalPolyPolygon), - nTransPercentVcl); - impEndSvtGraphicFill(pSvtGraphicFill); - } - else - { - // svae old mfCurrentUnifiedTransparence and set new one - // so that contained SvtGraphicStroke may use the current one - const double fLastCurrentUnifiedTransparence(mfCurrentUnifiedTransparence); - // #i105377# paint the content metafile opaque as the transparency gets - // split of into the gradient below - // mfCurrentUnifiedTransparence = rUniAlphaCandidate.getAlpha(); - mfCurrentUnifiedTransparence = 0; + // PolyPolygonGradientPrimitive2D, PolyPolygonHatchPrimitive2D and + // PolyPolygonBitmapPrimitive2D are derived from PolyPolygonColorPrimitive2D. + // Check also for correct ID to exclude derived implementations + if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) + { + // single transparent PolyPolygon identified, use directly + const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); + basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon()); + aLocalPolyPolygon.transform(maCurrentTransformation); - // various content, create content-metafile - GDIMetaFile aContentMetafile; - const Rectangle aPrimitiveRectangle(impDumpToMetaFile(rContent, aContentMetafile)); + // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support + SvtGraphicFill* pSvtGraphicFill = 0; - // restore mfCurrentUnifiedTransparence; it may have been used - // while processing the sub-content in impDumpToMetaFile - mfCurrentUnifiedTransparence = fLastCurrentUnifiedTransparence; + if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count()) + { + // setup simple color with transparence fill stuff like in impgrfll + pSvtGraphicFill = new SvtGraphicFill( + PolyPolygon(aLocalPolyPolygon), + Color(aPolygonColor), + rUniTransparenceCandidate.getTransparence(), + SvtGraphicFill::fillEvenOdd, + SvtGraphicFill::fillSolid, + SvtGraphicFill::Transform(), + false, + SvtGraphicFill::hatchSingle, + Color(), + SvtGraphicFill::gradientLinear, + Color(), + Color(), + 0, + Graphic()); + } - // create uniform VCL gradient for uniform transparency - Gradient aVCLGradient; - const sal_uInt8 nTransPercentVcl((sal_uInt8)basegfx::fround(rUniAlphaCandidate.getAlpha() * 255.0)); - const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl); - - aVCLGradient.SetStyle(GRADIENT_LINEAR); - aVCLGradient.SetStartColor(aTransColor); - aVCLGradient.SetEndColor(aTransColor); - aVCLGradient.SetAngle(0); - aVCLGradient.SetBorder(0); - aVCLGradient.SetOfsX(0); - aVCLGradient.SetOfsY(0); - aVCLGradient.SetStartIntensity(100); - aVCLGradient.SetEndIntensity(100); - aVCLGradient.SetSteps(2); - - // render it to VCL - mpOutputDevice->DrawTransparent( - aContentMetafile, aPrimitiveRectangle.TopLeft(), - aPrimitiveRectangle.GetSize(), aVCLGradient); + // set line and fill color + const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 100.0)); + mpOutputDevice->SetFillColor(Color(aPolygonColor)); + mpOutputDevice->SetLineColor(); + + // call VCL directly; encapsulate with SvtGraphicFill + impStartSvtGraphicFill(pSvtGraphicFill); + mpOutputDevice->DrawTransparent( + PolyPolygon(aLocalPolyPolygon), + nTransPercentVcl); + impEndSvtGraphicFill(pSvtGraphicFill); + } + else + { + // svae old mfCurrentUnifiedTransparence and set new one + // so that contained SvtGraphicStroke may use the current one + const double fLastCurrentUnifiedTransparence(mfCurrentUnifiedTransparence); + // #i105377# paint the content metafile opaque as the transparency gets + // split of into the gradient below + // mfCurrentUnifiedTransparence = rUniTransparenceCandidate.getTransparence(); + mfCurrentUnifiedTransparence = 0; + + // various content, create content-metafile + GDIMetaFile aContentMetafile; + const Rectangle aPrimitiveRectangle(impDumpToMetaFile(rContent, aContentMetafile)); + + // restore mfCurrentUnifiedTransparence; it may have been used + // while processing the sub-content in impDumpToMetaFile + mfCurrentUnifiedTransparence = fLastCurrentUnifiedTransparence; + + // create uniform VCL gradient for uniform transparency + Gradient aVCLGradient; + const sal_uInt8 nTransPercentVcl((sal_uInt8)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 255.0)); + const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl); + + aVCLGradient.SetStyle(GRADIENT_LINEAR); + aVCLGradient.SetStartColor(aTransColor); + aVCLGradient.SetEndColor(aTransColor); + aVCLGradient.SetAngle(0); + aVCLGradient.SetBorder(0); + aVCLGradient.SetOfsX(0); + aVCLGradient.SetOfsY(0); + aVCLGradient.SetStartIntensity(100); + aVCLGradient.SetEndIntensity(100); + aVCLGradient.SetSteps(2); + + // render it to VCL + mpOutputDevice->DrawTransparent( + aContentMetafile, aPrimitiveRectangle.TopLeft(), + aPrimitiveRectangle.GetSize(), aVCLGradient); + } } } break; } - case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D : { // for metafile: Need to examine what the pure vcl version is doing here actually // - uses DrawTransparent with metafile for content and a gradient // i can detect this here with checking the gradient part for a single // FillGradientPrimitive2D and reconstruct the gradient. - // If that detection goes wrong, i have to create an alpha-blended bitmap. Eventually - // do that in stripes, else RenderAlphaPrimitive2D may just be used - const primitive2d::AlphaPrimitive2D& rAlphaCandidate = static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate); - const primitive2d::Primitive2DSequence rContent = rAlphaCandidate.getChildren(); - const primitive2d::Primitive2DSequence rAlpha = rAlphaCandidate.getAlpha(); + // If that detection goes wrong, i have to create an transparence-blended bitmap. Eventually + // do that in stripes, else RenderTransparencePrimitive2D may just be used + const primitive2d::TransparencePrimitive2D& rTransparenceCandidate = static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate); + const primitive2d::Primitive2DSequence rContent = rTransparenceCandidate.getChildren(); + const primitive2d::Primitive2DSequence rTransparence = rTransparenceCandidate.getTransparence(); - if(rContent.hasElements() && rAlpha.hasElements()) + if(rContent.hasElements() && rTransparence.hasElements()) { // try to identify a single FillGradientPrimitive2D in the - // alpha part of the primitive + // transparence part of the primitive const primitive2d::FillGradientPrimitive2D* pFiGradient = 0; static bool bForceToBigTransparentVDev(false); - if(!bForceToBigTransparentVDev && 1 == rAlpha.getLength()) + if(!bForceToBigTransparentVDev && 1 == rTransparence.getLength()) { - const primitive2d::Primitive2DReference xReference(rAlpha[0]); + const primitive2d::Primitive2DReference xReference(rTransparence[0]); pFiGradient = dynamic_cast< const primitive2d::FillGradientPrimitive2D* >(xReference.get()); } @@ -1646,7 +1673,7 @@ namespace drawinglayer // Okay, basic implementation finished and tested. The DPI stuff was hard // and not easy to find out that it's needed. // Since this will not yet happen normally (as long as noone constructs - // alpha primitives with non-trivial alpha content) i will for now not + // transparence primitives with non-trivial transparence content) i will for now not // refine to tiling here. basegfx::B2DRange aViewRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D())); @@ -1697,9 +1724,9 @@ namespace drawinglayer aBufferProcessor.process(rContent); const Bitmap aBmContent(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel)); - // draw alpha using pixel renderer + // draw transparence using pixel renderer aBufferDevice.Erase(); - aBufferProcessor.process(rAlpha); + aBufferProcessor.process(rTransparence); const AlphaMask aBmAlpha(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel)); #ifdef DBG_UTIL @@ -1785,27 +1812,6 @@ namespace drawinglayer break; } - case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D : - { - // #i99123# - // invisible primitive; to rebuilt the old MetaFile creation, it is necessary to - // not ignore them (as it was thought), but to add a MetaFile entry for them. - basegfx::B2DRange aInvisibleRange(rCandidate.getB2DRange(getViewInformation2D())); - - if(!aInvisibleRange.isEmpty()) - { - aInvisibleRange.transform(maCurrentTransformation); - const Rectangle aRectLogic( - (sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()), - (sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY())); - - mpOutputDevice->SetFillColor(); - mpOutputDevice->SetLineColor(); - mpOutputDevice->DrawRect(aRectLogic); - } - - break; - } case PRIMITIVE2D_ID_EPSPRIMITIVE2D : { RenderEpsPrimitive2D(static_cast< const primitive2d::EpsPrimitive2D& >(rCandidate)); diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index ec09bef696..6faf4f24db 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -47,14 +47,14 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include #include @@ -264,50 +264,62 @@ namespace drawinglayer RenderModifiedColorPrimitive2D(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(rCandidate)); break; } - case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D : { // Detect if a single PolyPolygonColorPrimitive2D is contained; in that case, // use the faster OutputDevice::DrawTransparent method - const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate = static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate); - const primitive2d::Primitive2DSequence rContent = rUniAlphaCandidate.getChildren(); - bool bDrawTransparentUsed(false); + const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate); + const primitive2d::Primitive2DSequence rContent = rUniTransparenceCandidate.getChildren(); - // since DEV300 m33 DrawTransparent is supported in VCL (for some targets - // natively), so i am now enabling this shortcut - static bool bAllowUsingDrawTransparent(true); - - if(bAllowUsingDrawTransparent && rContent.hasElements() && 1 == rContent.getLength()) + if(rContent.hasElements()) { - const primitive2d::Primitive2DReference xReference(rContent[0]); - const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); - - if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) + if(0.0 == rUniTransparenceCandidate.getTransparence()) { - // single transparent PolyPolygon identified, use directly - const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); - mpOutputDevice->SetFillColor(Color(aPolygonColor)); - mpOutputDevice->SetLineColor(); - - basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon()); - aLocalPolyPolygon.transform(maCurrentTransformation); - - mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniAlphaCandidate.getAlpha()); - bDrawTransparentUsed = true; + // not transparent at all, use content + process(rUniTransparenceCandidate.getChildren()); } - } + else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0) + { + bool bDrawTransparentUsed(false); - if(!bDrawTransparentUsed) - { - // unified sub-transparence. Draw to VDev first. - RenderUnifiedAlphaPrimitive2D(rUniAlphaCandidate); + // since DEV300 m33 DrawTransparent is supported in VCL (for some targets + // natively), so i am now enabling this shortcut + static bool bAllowUsingDrawTransparent(true); + + if(bAllowUsingDrawTransparent && 1 == rContent.getLength()) + { + const primitive2d::Primitive2DReference xReference(rContent[0]); + const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get()); + + if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID()) + { + // single transparent PolyPolygon identified, use directly + const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor())); + mpOutputDevice->SetFillColor(Color(aPolygonColor)); + mpOutputDevice->SetLineColor(); + + basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon()); + aLocalPolyPolygon.transform(maCurrentTransformation); + + mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniTransparenceCandidate.getTransparence()); + bDrawTransparentUsed = true; + } + } + + if(!bDrawTransparentUsed) + { + // unified sub-transparence. Draw to VDev first. + RenderUnifiedTransparencePrimitive2D(rUniTransparenceCandidate); + } + } } break; } - case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D : + case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D : { // sub-transparence group. Draw to VDev first. - RenderAlphaPrimitive2D(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate)); + RenderTransparencePrimitive2D(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate)); break; } case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D : diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index e256089ac3..f7732d9a61 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -52,8 +51,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -380,7 +379,7 @@ namespace drawinglayer { // color gets completely replaced, get it const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor())); - basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon()); aPolygon.transform(aLocalTransform); mpOutputDevice->SetFillColor(Color(aModifiedColor)); @@ -454,7 +453,7 @@ namespace drawinglayer { // color gets completely replaced, get it const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor())); - basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon()); aPolygon.transform(aLocalTransform); mpOutputDevice->SetFillColor(Color(aModifiedColor)); @@ -610,7 +609,7 @@ namespace drawinglayer else { // try to catch cases where the bitmap will be color-modified to a single - // color (e.g. shadow). This would NOT be optimizable with an alpha channel + // color (e.g. shadow). This would NOT be optimizable with an transparence channel // at the Bitmap which we do not have here. When this should change, this // optimization has to be reworked accordingly. const sal_uInt32 nBColorModifierStackCount(maBColorModifierStack.count()); @@ -883,10 +882,10 @@ namespace drawinglayer if(getOptionsDrawinglayer().IsAntiAliasing()) { // with AA, use 8bit AlphaMask to get nice borders - VirtualDevice& rAlpha = aBufferDevice.getAlpha(); - rAlpha.SetLineColor(); - rAlpha.SetFillColor(COL_BLACK); - rAlpha.DrawPolyPolygon(aMask); + VirtualDevice& rTransparence = aBufferDevice.getTransparence(); + rTransparence.SetLineColor(); + rTransparence.SetFillColor(COL_BLACK); + rTransparence.DrawPolyPolygon(aMask); // dump buffer to outdev aBufferDevice.paint(); @@ -919,7 +918,7 @@ namespace drawinglayer } // unified sub-transparence. Draw to VDev first. - void VclProcessor2D::RenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rTransCandidate) + void VclProcessor2D::RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate) { static bool bForceToDecomposition(false); @@ -932,14 +931,14 @@ namespace drawinglayer } else { - if(0.0 == rTransCandidate.getAlpha()) + if(0.0 == rTransCandidate.getTransparence()) { // no transparence used, so just use the content process(rTransCandidate.getChildren()); } - else if(rTransCandidate.getAlpha() > 0.0 && rTransCandidate.getAlpha() < 1.0) + else if(rTransCandidate.getTransparence() > 0.0 && rTransCandidate.getTransparence() < 1.0) { - // alpha is in visible range + // transparence is in visible range basegfx::B2DRange aRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rTransCandidate.getChildren(), getViewInformation2D())); aRange.transform(maCurrentTransformation); impBufferDevice aBufferDevice(*mpOutputDevice, aRange, true); @@ -956,8 +955,8 @@ namespace drawinglayer // back to old OutDev mpOutputDevice = pLastOutputDevice; - // dump buffer to outdev using given alpha - aBufferDevice.paint(rTransCandidate.getAlpha()); + // dump buffer to outdev using given transparence + aBufferDevice.paint(rTransCandidate.getTransparence()); } } } @@ -965,7 +964,7 @@ namespace drawinglayer } // sub-transparence group. Draw to VDev first. - void VclProcessor2D::RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate) + void VclProcessor2D::RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate) { if(rTransCandidate.getChildren().hasElements()) { @@ -983,14 +982,14 @@ namespace drawinglayer process(rTransCandidate.getChildren()); // set to mask - mpOutputDevice = &aBufferDevice.getAlpha(); + mpOutputDevice = &aBufferDevice.getTransparence(); - // when painting alpha masks, reset the color stack + // when painting transparence masks, reset the color stack basegfx::BColorModifierStack aLastBColorModifierStack(maBColorModifierStack); maBColorModifierStack = basegfx::BColorModifierStack(); - // paint mask to it (always with alpha intensities, evtl. with AA) - process(rTransCandidate.getAlpha()); + // paint mask to it (always with transparence intensities, evtl. with AA) + process(rTransCandidate.getTransparence()); // back to old color stack maBColorModifierStack = aLastBColorModifierStack; diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx index 789b9f375d..e454491a0b 100644 --- a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx +++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx @@ -40,11 +40,11 @@ #include #include #include -#include #include #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -61,7 +61,8 @@ namespace drawinglayer maBack(rBack), maResult(), maCombinedTransform(), - mbAnyHit(bAnyHit) + mbAnyHit(bAnyHit), + mbUseInvisiblePrimitiveContent(true) { } @@ -132,13 +133,46 @@ namespace drawinglayer process(rPrimitive.getChildren()); break; } - case PRIMITIVE3D_ID_HITTESTPRIMITIVE3D : + case PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D : { - // HitTestPrimitive3D, force usage due to we are doing a hit test and this - // primitive only gets generated on 3d objects without fill, exactly for this - // purpose - const primitive3d::HitTestPrimitive3D& rPrimitive = static_cast< const primitive3d::HitTestPrimitive3D& >(rCandidate); - process(rPrimitive.getChildren()); + // HiddenGeometryPrimitive3D; the default decomposition would return an empty seqence, + // so force this primitive to process it's children directly if the switch is set + // (which is the default). Else, ignore invisible content + const primitive3d::HiddenGeometryPrimitive3D& rHiddenGeometry(static_cast< const primitive3d::HiddenGeometryPrimitive3D& >(rCandidate)); + const primitive3d::Primitive3DSequence& rChildren = rHiddenGeometry.getChildren(); + + if(rChildren.hasElements()) + { + if(getUseInvisiblePrimitiveContent()) + { + process(rChildren); + } + } + + break; + } + case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D : + { + const primitive3d::UnifiedTransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::UnifiedTransparenceTexturePrimitive3D& >(rCandidate); + const primitive3d::Primitive3DSequence rChildren = rPrimitive.getChildren(); + + if(rChildren.getLength()) + { + if(1.0 <= rPrimitive.getTransparence()) + { + // not visible, but use for HitTest + if(getUseInvisiblePrimitiveContent()) + { + process(rChildren); + } + } + else if(rPrimitive.getTransparence() >= 0.0 && rPrimitive.getTransparence() < 1.0) + { + // visible; use content + process(rChildren); + } + } + break; } case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D : diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index 7ea322c691..79f94635bb 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -48,9 +48,11 @@ #include #include #include -#include #include #include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -493,10 +495,10 @@ namespace drawinglayer impRenderBitmapTexturePrimitive3D(rPrimitive); break; } - case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D : + case PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D : { - // AlphaTexturePrimitive3D - const primitive3d::AlphaTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::AlphaTexturePrimitive3D& >(rBasePrimitive); + // TransparenceTexturePrimitive3D + const primitive3d::TransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::TransparenceTexturePrimitive3D& >(rBasePrimitive); mnTransparenceCounter++; impRenderGradientTexturePrimitive3D(rPrimitive, true); mnTransparenceCounter--; diff --git a/drawinglayer/source/processor3d/geometry2dextractor.cxx b/drawinglayer/source/processor3d/geometry2dextractor.cxx index 9b44961896..067cae0322 100644 --- a/drawinglayer/source/processor3d/geometry2dextractor.cxx +++ b/drawinglayer/source/processor3d/geometry2dextractor.cxx @@ -135,8 +135,8 @@ namespace drawinglayer case PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D : case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D : case PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D : - case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D : - case PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D : + case PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D : + case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D : { // TexturePrimitive3D: Process children, do not try to decompose const primitive3d::TexturePrimitive3D& rTexturePrimitive = static_cast< const primitive3d::TexturePrimitive3D& >(rCandidate); diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx index d96880fcfb..78a672eee5 100644 --- a/drawinglayer/source/processor3d/shadow3dextractor.cxx +++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -99,7 +99,7 @@ namespace drawinglayer { // create simpleTransparencePrimitive, add created primitives const primitive2d::Primitive2DSequence aNewTransPrimitiveVector(&xRef, 1L); - const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedAlphaPrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence())); + const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedTransparencePrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence())); primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef2); } else diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index 90ea9ecfc9..e338246b99 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +50,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 062d7c67f0..d182b562fb 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -38,7 +38,6 @@ #include #include -#include #include ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/inc/svx/scene3d.hxx b/svx/inc/svx/scene3d.hxx index ccccf1ded4..5f6374c47d 100644 --- a/svx/inc/svx/scene3d.hxx +++ b/svx/inc/svx/scene3d.hxx @@ -111,6 +111,8 @@ public: E3dScene(E3dDefaultAttributes& rDefault); virtual ~E3dScene(); + virtual void SetBoundRectDirty(); + // access to cleanup of depth mapper void Cleanup3DDepthMapper() { ImpCleanup3DDepthMapper(); } diff --git a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx b/svx/inc/svx/sdr/attribute/sdrallattribute.hxx deleted file mode 100644 index 092c0e224a..0000000000 --- a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx +++ /dev/null @@ -1,202 +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: sdrallattribute.hxx,v $ - * - * $Revision: 1.2 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX -#define _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX - -#include - -////////////////////////////////////////////////////////////////////////////// -// predefines - -namespace drawinglayer { namespace attribute { - class SdrLineAttribute; - class SdrFillAttribute; - class SdrLineStartEndAttribute; - class SdrShadowAttribute; - class FillGradientAttribute; - class SdrTextAttribute; -}} - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrShadowTextAttribute - { - // shadow and text attributes - SdrShadowAttribute* mpShadow; // shadow attributes (if used) - SdrTextAttribute* mpTextAttribute; // text and text attributes (if used) - - public: - SdrShadowTextAttribute( - SdrShadowAttribute* pShadow = 0, - SdrTextAttribute* pTextAttribute = 0); - ~SdrShadowTextAttribute(); - - // copy constructor and assigment operator - SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate); - SdrShadowTextAttribute& operator=(const SdrShadowTextAttribute& rCandidate); - - // compare operator - bool operator==(const SdrShadowTextAttribute& rCandidate) const; - - // bool access - bool isVisible() const { return (0 != mpTextAttribute); } - - // data access - const SdrShadowAttribute* getShadow() const { return mpShadow; } - const SdrTextAttribute* getText() const { return mpTextAttribute; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrFillTextAttribute - { - // shadow and text attributes - SdrFillAttribute* mpFill; // fill attributes (if used) - FillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used) - SdrTextAttribute* mpTextAttribute; // text and text attributes (if used) - - public: - SdrFillTextAttribute( - SdrFillAttribute* pFill = 0, - FillGradientAttribute* pFillFloatTransGradient = 0, - SdrTextAttribute* pTextAttribute = 0); - ~SdrFillTextAttribute(); - - // copy constructor and assigment operator - SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate); - SdrFillTextAttribute& operator=(const SdrFillTextAttribute& rCandidate); - - // compare operator - bool operator==(const SdrFillTextAttribute& rCandidate) const; - - // bool access - bool isVisible() const { return ((mpTextAttribute) || (mpFill)); } - - // data access - const SdrFillAttribute* getFill() const { return mpFill; } - const FillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; } - const SdrTextAttribute* getText() const { return mpTextAttribute; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrLineShadowTextAttribute : public SdrShadowTextAttribute - { - // line, shadow, lineStartEnd and text attributes - SdrLineAttribute* mpLine; // line attributes (if used) - SdrLineStartEndAttribute* mpLineStartEnd; // line start end (if used) - - public: - SdrLineShadowTextAttribute( - SdrLineAttribute* pLine = 0, - SdrLineStartEndAttribute* pLineStartEnd = 0, - SdrShadowAttribute* pShadow = 0, - SdrTextAttribute* pTextAttribute = 0); - ~SdrLineShadowTextAttribute(); - - // copy constructor and assigment operator - SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate); - SdrLineShadowTextAttribute& operator=(const SdrLineShadowTextAttribute& rCandidate); - - // compare operator - bool operator==(const SdrLineShadowTextAttribute& rCandidate) const; - - // bool access - bool isVisible() const { return (mpLine || (SdrShadowTextAttribute::isVisible())); } - - // data access - const SdrLineAttribute* getLine() const { return mpLine; } - const SdrLineStartEndAttribute* getLineStartEnd() const { return mpLineStartEnd; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - class SdrLineFillShadowTextAttribute : public SdrLineShadowTextAttribute - { - // add fill and transGradient attributes - SdrFillAttribute* mpFill; // fill attributes (if used) - FillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used) - - public: - SdrLineFillShadowTextAttribute( - SdrLineAttribute* pLine = 0, - SdrFillAttribute* pFill = 0, - SdrLineStartEndAttribute* pLineStartEnd = 0, - SdrShadowAttribute* pShadow = 0, - FillGradientAttribute* pFillFloatTransGradient = 0, - SdrTextAttribute* pTextAttribute = 0); - ~SdrLineFillShadowTextAttribute(); - - // copy constructor and assigment operator - SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate); - SdrLineFillShadowTextAttribute& operator=(const SdrLineFillShadowTextAttribute& rCandidate); - - // compare operator - bool operator==(const SdrLineFillShadowTextAttribute& rCandidate) const; - - // bool access - bool isVisible() const { return (mpFill || (SdrLineShadowTextAttribute::isVisible())); } - - // data access - const SdrFillAttribute* getFill() const { return mpFill; } - const FillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; } - }; - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -#endif // _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX - -// eof diff --git a/svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx new file mode 100644 index 0000000000..ac4e4e96fc --- /dev/null +++ b/svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * 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: sdrallattribute.hxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX + +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrFillTextAttribute + { + // shadow and text attributes + SdrFillAttribute maFill; // fill attributes (if used) + FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used) + SdrTextAttribute maTextAttribute; // text and text attributes (if used) + + public: + SdrFillTextAttribute( + const SdrFillAttribute& rFill, + const FillGradientAttribute& rFillFloatTransGradient, + const SdrTextAttribute& rTextAttribute); + SdrFillTextAttribute(); + SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate); + SdrFillTextAttribute& operator=(const SdrFillTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrFillTextAttribute& rCandidate) const; + + // data access + const SdrFillAttribute& getFill() const { return maFill; } + const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; } + const SdrTextAttribute& getText() const { return maTextAttribute; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX + +// eof diff --git a/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx index aa417b4451..39728482a0 100644 --- a/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx @@ -38,8 +38,13 @@ ////////////////////////////////////////////////////////////////////////////// // predefines + class SfxItemSet; -namespace drawinglayer { namespace attribute { class SdrFormTextOutlineAttribute; }} + +namespace drawinglayer { namespace attribute { + class ImpSdrFormTextAttribute; + class SdrFormTextOutlineAttribute; +}} ////////////////////////////////////////////////////////////////////////////// @@ -50,53 +55,36 @@ namespace drawinglayer class SdrFormTextAttribute { private: - // FormText (FontWork) Attributes - sal_Int32 mnFormTextDistance; // distance from line in upright direction - sal_Int32 mnFormTextStart; // shift from polygon start - sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees - sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling - sal_uInt16 mnFormTextShdwTransp; // shadow transparence - XFormTextStyle meFormTextStyle; // on/off and char orientation - XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale - XFormTextShadow meFormTextShadow; // shadow mode - Color maFormTextShdwColor; // shadow color - - // outline attributes; used when getFormTextOutline() is true and (for - // shadow) when getFormTextShadow() != XFTSHADOW_NONE - SdrFormTextOutlineAttribute* mpOutline; - SdrFormTextOutlineAttribute* mpShadowOutline; - - // bitfield - unsigned mbFormTextMirror : 1; // change orientation - unsigned mbFormTextOutline : 1; // show contour of objects + ImpSdrFormTextAttribute* mpSdrFormTextAttribute; public: + /// constructors/assignmentoperator/destructor SdrFormTextAttribute(const SfxItemSet& rSet); - ~SdrFormTextAttribute(); - - // copy constructor and assigment operator + SdrFormTextAttribute(); SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate); SdrFormTextAttribute& operator=(const SdrFormTextAttribute& rCandidate); + ~SdrFormTextAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; // compare operator bool operator==(const SdrFormTextAttribute& rCandidate) const; - // data access - sal_Int32 getFormTextDistance() const { return mnFormTextDistance; } - sal_Int32 getFormTextStart() const { return mnFormTextStart; } - sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; } - sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; } - sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; } - XFormTextStyle getFormTextStyle() const { return meFormTextStyle; } - XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; } - XFormTextShadow getFormTextShadow() const { return meFormTextShadow; } - Color getFormTextShdwColor() const { return maFormTextShdwColor; } - - const SdrFormTextOutlineAttribute* getOutline() const { return mpOutline; } - const SdrFormTextOutlineAttribute* getShadowOutline() const { return mpShadowOutline; } - - bool getFormTextMirror() const { return mbFormTextMirror; } - bool getFormTextOutline() const { return mbFormTextOutline; } + // data read access + sal_Int32 getFormTextDistance() const; + sal_Int32 getFormTextStart() const; + sal_Int32 getFormTextShdwXVal() const; + sal_Int32 getFormTextShdwYVal() const; + sal_uInt16 getFormTextShdwTransp() const; + XFormTextStyle getFormTextStyle() const; + XFormTextAdjust getFormTextAdjust() const; + XFormTextShadow getFormTextShadow() const; + Color getFormTextShdwColor() const; + const SdrFormTextOutlineAttribute& getOutline() const; + const SdrFormTextOutlineAttribute& getShadowOutline() const; + bool getFormTextMirror() const; + bool getFormTextOutline() const; }; } // end of namespace attribute } // end of namespace drawinglayer diff --git a/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx index c8c80ceb02..dc9d69523b 100644 --- a/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx @@ -33,8 +33,15 @@ #define _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX #include -#include -#include + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace drawinglayer { namespace attribute { + class ImpSdrFormTextOutlineAttribute; + class LineAttribute; + class StrokeAttribute; +}} ////////////////////////////////////////////////////////////////////////////// @@ -45,24 +52,29 @@ namespace drawinglayer class SdrFormTextOutlineAttribute { private: - // one set of attributes for FormText (FontWork) outline visualisation - LineAttribute maLineAttribute; - StrokeAttribute maStrokeAttribute; - sal_uInt8 mnTransparence; + ImpSdrFormTextOutlineAttribute* mpSdrFormTextOutlineAttribute; public: + /// constructors/assignmentoperator/destructor SdrFormTextOutlineAttribute( const LineAttribute& rLineAttribute, const StrokeAttribute& rStrokeAttribute, sal_uInt8 nTransparence); + SdrFormTextOutlineAttribute(); + SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate); + SdrFormTextOutlineAttribute& operator=(const SdrFormTextOutlineAttribute& rCandidate); + ~SdrFormTextOutlineAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; // compare operator bool operator==(const SdrFormTextOutlineAttribute& rCandidate) const; // data read access - const LineAttribute& getLineAttribute() const { return maLineAttribute; } - const StrokeAttribute getStrokeAttribute() const { return maStrokeAttribute; } - sal_uInt8 getTransparence() const { return mnTransparence; } + const LineAttribute& getLineAttribute() const; + const StrokeAttribute& getStrokeAttribute() const; + sal_uInt8 getTransparence() const; }; } // end of namespace attribute } // end of namespace drawinglayer diff --git a/svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx new file mode 100644 index 0000000000..5c6674da6b --- /dev/null +++ b/svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * 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: sdrallattribute.hxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX + +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineFillShadowTextAttribute : public SdrLineShadowTextAttribute + { + // add fill and transGradient attributes + SdrFillAttribute maFill; // fill attributes (if used) + FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used) + + public: + SdrLineFillShadowTextAttribute( + const SdrLineAttribute& rLine, + const SdrFillAttribute& rFill, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const FillGradientAttribute& rFillFloatTransGradient, + const SdrTextAttribute& rTextAttribute); + SdrLineFillShadowTextAttribute(); + SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate); + SdrLineFillShadowTextAttribute& operator=(const SdrLineFillShadowTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineFillShadowTextAttribute& rCandidate) const; + + // data access + const SdrFillAttribute& getFill() const { return maFill; } + const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX + +// eof diff --git a/svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx new file mode 100644 index 0000000000..8c17cdec13 --- /dev/null +++ b/svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx @@ -0,0 +1,79 @@ +/************************************************************************* + * + * 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: sdrallattribute.hxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX + +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineShadowTextAttribute : public SdrShadowTextAttribute + { + // line, shadow, lineStartEnd and text attributes + SdrLineAttribute maLine; // line attributes (if used) + SdrLineStartEndAttribute maLineStartEnd; // line start end (if used) + + public: + SdrLineShadowTextAttribute( + const SdrLineAttribute& rLine, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute); + SdrLineShadowTextAttribute(); + SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate); + SdrLineShadowTextAttribute& operator=(const SdrLineShadowTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineShadowTextAttribute& rCandidate) const; + + // data access + const SdrLineAttribute& getLine() const { return maLine; } + const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX + +// eof diff --git a/svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx new file mode 100644 index 0000000000..453a398ee7 --- /dev/null +++ b/svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * 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: sdrallattribute.hxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX + +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrShadowTextAttribute + { + // shadow and text attributes + SdrShadowAttribute maShadow; // shadow attributes (if used) + SdrTextAttribute maTextAttribute; // text and text attributes (if used) + + public: + SdrShadowTextAttribute( + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute); + SdrShadowTextAttribute(); + SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate); + SdrShadowTextAttribute& operator=(const SdrShadowTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrShadowTextAttribute& rCandidate) const; + + // data access + const SdrShadowAttribute& getShadow() const { return maShadow; } + const SdrTextAttribute& getText() const { return maTextAttribute; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX + +// eof diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx index 3b84402676..81c265aa58 100644 --- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx @@ -39,9 +39,20 @@ ////////////////////////////////////////////////////////////////////////////// // predefines + class SdrText; -namespace drawinglayer { namespace animation { class AnimationEntryList; }} -namespace drawinglayer { namespace attribute { class SdrFormTextAttribute; }} + +namespace drawinglayer { namespace animation { + class AnimationEntryList; +}} + +namespace drawinglayer { namespace attribute { + class SdrFormTextAttribute; +}} + +namespace drawinglayer { namespace attribute { + class ImpSdrTextAttribute; +}} ////////////////////////////////////////////////////////////////////////////// @@ -52,41 +63,13 @@ namespace drawinglayer class SdrTextAttribute { private: - // all-text attributes. The SdrText itself and a copy - // of te OPO - const SdrText* mpSdrText; - OutlinerParaObject maOutlinerParaObject; - - // Set when it's a FormText; contains all FormText attributes - SdrFormTextAttribute* mpSdrFormTextAttribute; - - // text distances - sal_Int32 maTextLeftDistance; - sal_Int32 maTextUpperDistance; - sal_Int32 maTextRightDistance; - sal_Int32 maTextLowerDistance; - - // #i101556# use versioning from text attributes to detect changes - sal_uInt32 maPropertiesVersion; - - // text alignments - SdrTextHorzAdjust maSdrTextHorzAdjust; - SdrTextVertAdjust maSdrTextVertAdjust; - - // bitfield - unsigned mbContour : 1; - unsigned mbFitToSize : 1; - unsigned mbHideContour : 1; - unsigned mbBlink : 1; - unsigned mbScroll : 1; - unsigned mbInEditMode : 1; - unsigned mbFixedCellHeight : 1; - unsigned mbWrongSpell : 1; + ImpSdrTextAttribute* mpSdrTextAttribute; public: + /// constructors/assignmentoperator/destructor SdrTextAttribute( const SdrText& rSdrText, - const OutlinerParaObject& rOutlinerParaObjectPtr, + const OutlinerParaObject& rOutlinerParaObject, XFormTextStyle eFormTextStyle, sal_Int32 aTextLeftDistance, sal_Int32 aTextUpperDistance, @@ -102,38 +85,44 @@ namespace drawinglayer bool bInEditMode, bool bFixedCellHeight, bool bWrongSpell); - ~SdrTextAttribute(); - - // copy constructor and assigment operator + SdrTextAttribute(); SdrTextAttribute(const SdrTextAttribute& rCandidate); SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate); + ~SdrTextAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; // compare operator bool operator==(const SdrTextAttribute& rCandidate) const; - // data access - const SdrText& getSdrText() const { return *mpSdrText; } - const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; } - bool isContour() const { return mbContour; } - bool isFitToSize() const { return mbFitToSize; } - bool isHideContour() const { return mbHideContour; } - bool isBlink() const { return mbBlink; } - bool isScroll() const { return mbScroll; } - bool isInEditMode() const { return mbInEditMode; } - bool isFixedCellHeight() const { return mbFixedCellHeight; } - bool isWrongSpell() const { return mbWrongSpell; } - const SdrFormTextAttribute* getSdrFormTextAttribute() const { return mpSdrFormTextAttribute; } - sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; } - sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; } - sal_Int32 getTextRightDistance() const { return maTextRightDistance; } - sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; } - sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; } - SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; } - SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; } - - // animation timing generation - void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const; - void getScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const; + // data read access + const SdrText& getSdrText() const; + const OutlinerParaObject& getOutlinerParaObject() const; + bool isContour() const; + bool isFitToSize() const; + bool isHideContour() const; + bool isBlink() const; + bool isScroll() const; + bool isInEditMode() const; + bool isFixedCellHeight() const; + bool isWrongSpell() const; + const SdrFormTextAttribute& getSdrFormTextAttribute() const; + sal_Int32 getTextLeftDistance() const; + sal_Int32 getTextUpperDistance() const; + sal_Int32 getTextRightDistance() const; + sal_Int32 getTextLowerDistance() const; + sal_uInt32 getPropertiesVersion() const; + SdrTextHorzAdjust getSdrTextHorzAdjust() const; + SdrTextVertAdjust getSdrTextVertAdjust() const; + + // helpers: animation timing generators + void getBlinkTextTiming( + drawinglayer::animation::AnimationEntryList& rAnimList) const; + void getScrollTextTiming( + drawinglayer::animation::AnimationEntryList& rAnimList, + double fFrameLength, + double fTextLength) const; }; } // end of namespace attribute } // end of namespace drawinglayer diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx index aec9d8df54..7b334f76ec 100644 --- a/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx +++ b/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx @@ -33,22 +33,16 @@ #include #include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // predeclarations class E3dScene; -namespace drawinglayer { - namespace geometry { - class ViewInformation3D; - } - namespace attribute { - class SdrSceneAttribute; - class SdrLightingAttribute; - } -} - namespace basegfx { class B3DRange; } @@ -70,7 +64,6 @@ namespace sdr public: // basic constructor, used from SdrObject. ViewContactOfE3dScene(E3dScene& rScene); - virtual ~ViewContactOfE3dScene(); // access to SdrObject E3dScene& GetE3dScene() const @@ -101,14 +94,14 @@ namespace sdr protected: // the 3d transformation stack - drawinglayer::geometry::ViewInformation3D* mpViewInformation3D; + drawinglayer::geometry::ViewInformation3D maViewInformation3D; // the object transformation - basegfx::B2DHomMatrix* mpObjectTransformation; + basegfx::B2DHomMatrix maObjectTransformation; // attributes - drawinglayer::attribute::SdrSceneAttribute* mpSdrSceneAttribute; - drawinglayer::attribute::SdrLightingAttribute* mpSdrLightingAttribute; + drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute; + drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute; // create methods for ViewInformation3D and ObjectTransformation void createViewInformation3D(const ::basegfx::B3DRange& rContentRange); diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx index 7cf1f9876c..97f76d37b4 100644 --- a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx @@ -50,9 +50,6 @@ namespace sdr ViewObjectContactOfGroup(ObjectContact& rObjectContact, ViewContact& rViewContact); virtual ~ViewObjectContactOfGroup(); - // test this VOC for visibility concerning model-view stuff like e.g. Layer - virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; - // This method recursively paints the draw hierarchy. virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; }; diff --git a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx index 097eecb952..1cfb185316 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx @@ -50,7 +50,7 @@ namespace drawinglayer { namespace attribute { class SdrShadowTextAttribute; class SdrLineShadowTextAttribute; class SdrLineFillShadowTextAttribute; - class SdrLineFillShadowAttribute; + class SdrLineFillShadowAttribute3D; class SdrSceneAttribute; class SdrLightingAttribute; class SdrFillTextAttribute; @@ -67,13 +67,21 @@ namespace drawinglayer namespace primitive2d { // SdrAttribute creators - attribute::SdrLineAttribute* createNewSdrLineAttribute(const SfxItemSet& rSet); - attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth); - attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet); - attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet); + attribute::SdrLineAttribute createNewSdrLineAttribute( + const SfxItemSet& rSet); + + attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute( + const SfxItemSet& rSet, + double fWidth); + + attribute::SdrShadowAttribute createNewSdrShadowAttribute( + const SfxItemSet& rSet); + + attribute::SdrFillAttribute createNewSdrFillAttribute( + const SfxItemSet& rSet); // #i101508# Support handing over given text-to-border distances - attribute::SdrTextAttribute* createNewSdrTextAttribute( + attribute::SdrTextAttribute createNewSdrTextAttribute( const SfxItemSet& rSet, const SdrText& rText, const sal_Int32* pLeft = 0, @@ -81,20 +89,37 @@ namespace drawinglayer const sal_Int32* pRight = 0, const sal_Int32* pLower = 0); - attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet); - attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet); - attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute( + attribute::FillGradientAttribute createNewTransparenceGradientAttribute( + const SfxItemSet& rSet); + + attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute( + const SfxItemSet& rSet); + + attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute( const SfxItemSet& rSet, - const SdrText& rText, + const SdrText* pText, bool bSuppressText); // #i98072# added option to suppress text on demand - attribute::SdrLineShadowTextAttribute* createNewSdrLineShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText); - attribute::SdrLineFillShadowTextAttribute* createNewSdrLineFillShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText); - attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill); - attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet); - attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet); + + attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText); + + attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText); + + attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute( + const SfxItemSet& rSet, + bool bSuppressFill); + + attribute::SdrSceneAttribute createNewSdrSceneAttribute( + const SfxItemSet& rSet); + + attribute::SdrLightingAttribute createNewSdrLightingAttribute( + const SfxItemSet& rSet); // #i101508# Support handing over given text-to-border distances - attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute( + attribute::SdrFillTextAttribute createNewSdrFillTextAttribute( const SfxItemSet& rSet, const SdrText* pSdrText, const sal_Int32* pLeft = 0, @@ -103,7 +128,11 @@ namespace drawinglayer const sal_Int32* pLower = 0); // helpers - void calculateRelativeCornerRadius(sal_Int32 nRadius, const ::basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY); + void calculateRelativeCornerRadius( + sal_Int32 nRadius, + const ::basegfx::B2DRange& rObjectRange, + double& rfCornerRadiusX, + double& rfCornerRadiusY); } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx index 7ffc95344a..a048813f10 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx @@ -34,8 +34,8 @@ #include #include -#include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx index 3b73b09ca1..be99f7220f 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx @@ -33,8 +33,8 @@ #define INCLUDED_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX #include -#include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx index b6044df2b0..fdb34e749f 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx @@ -33,8 +33,8 @@ #define INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX #include -#include #include +#include ////////////////////////////////////////////////////////////////////////////// // predefines @@ -61,8 +61,8 @@ namespace drawinglayer // making exceptions with shadow generation unsigned mb3DShape : 1; - // #SJ# Allow text clipping against TextBox in special cases (used for SC) - unsigned mbForceTextClipToTextRange : 1; + // #SJ# Allow text clipping against TextBox in special cases (used for SC) + unsigned mbForceTextClipToTextRange : 1; protected: // local decomposition. diff --git a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx index d3bf028869..c50b9a77e6 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx @@ -58,22 +58,22 @@ namespace drawinglayer namespace primitive2d { Primitive2DReference createPolyPolygonFillPrimitive( - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrFillAttribute& rFill, - const attribute::FillGradientAttribute* pFillGradient = 0L); + const attribute::FillGradientAttribute& rFillGradient); Primitive2DReference createPolygonLinePrimitive( - const ::basegfx::B2DPolygon& rUnitPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolygon& rUnitPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrLineAttribute& rLine, - const attribute::SdrLineStartEndAttribute* pStroke = 0L); + const attribute::SdrLineStartEndAttribute& rStroke); Primitive2DReference createTextPrimitive( - const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon, - const ::basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrTextAttribute& rText, - const attribute::SdrLineAttribute* pStroke, + const attribute::SdrLineAttribute& rStroke, bool bCellText, bool bWordWrap, bool bClipOnBounds); diff --git a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx index c78e9e0655..62f34724ed 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx @@ -34,7 +34,7 @@ #include #include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx index 9c57c15911..495c27999b 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx @@ -34,9 +34,8 @@ #include #include -#include -#include #include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx index 559e914911..8dc58f4d70 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx @@ -33,8 +33,7 @@ #define INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX #include -#include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx index 54e8ce4d90..83f6623efd 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx @@ -34,8 +34,7 @@ #include #include -#include -#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx index 7c4bb21b73..82c9869fce 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx @@ -34,8 +34,8 @@ #include #include -#include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx b/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx index f8d8fb3880..59510f1233 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx @@ -40,7 +40,6 @@ namespace basegfx { class BColor; - class B2DHomMatrix; } ////////////////////////////////////////////////////////////////////////////// @@ -55,10 +54,6 @@ namespace drawinglayer // create a 7x7 gluepoint symbol in given colors as BitmapEx BitmapEx createDefaultGluepoint_7x7(const basegfx::BColor& rBColorA, const basegfx::BColor& rBColorB); - - // #i99123# - Primitive2DReference createFallbackHitTestPrimitive(const basegfx::B2DHomMatrix& rMatrix); - } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx index 54afa94a68..612f9da3c2 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx @@ -34,8 +34,8 @@ #include #include -#include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// // predefines diff --git a/svx/inc/svx/sdr/properties/oleproperties.hxx b/svx/inc/svx/sdr/properties/oleproperties.hxx new file mode 100644 index 0000000000..c2621b124f --- /dev/null +++ b/svx/inc/svx/sdr/properties/oleproperties.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * 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: graphicproperties.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_PROPERTIES_OLEPROPERTIES_HXX +#define _SDR_PROPERTIES_OLEPROPERTIES_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class OleProperties : public RectangleProperties + { + protected: + public: + // basic constructor + OleProperties(SdrObject& rObj); + + // constructor for copying, but using new object + OleProperties(const OleProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~OleProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_OLEPROPERTIES_HXX + +// eof diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx index 5e796b75c9..ab7b8b926b 100644 --- a/svx/inc/svx/svdogrp.hxx +++ b/svx/inc/svx/svdogrp.hxx @@ -69,6 +69,7 @@ public: SdrObjGroup(); virtual ~SdrObjGroup(); + virtual void SetBoundRectDirty(); virtual UINT16 GetObjIdentifier() const; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; virtual SdrLayerID GetLayer() const; diff --git a/svx/prj/d.lst b/svx/prj/d.lst index 8b4675feb3..7d2f508d9d 100644 --- a/svx/prj/d.lst +++ b/svx/prj/d.lst @@ -637,6 +637,9 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\overlay ..\inc\svx\sdr\overlay\overlayselection.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayselection.hxx ..\inc\svx\sdr\overlay\overlaytools.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaytools.hxx +mkdir: %_DEST%\inc%_EXT%\svx\sdr\primitive2d +..\inc\svx\sdr\primitive2d\sdrprimitivetools.hxx %_DEST%\inc%_EXT%\svx\sdr\primitive2d\sdrprimitivetools.hxx + mkdir: %_DEST%\inc%_EXT%\svx\sdr\animation ..\inc\svx\sdr\animation\ainfographic.hxx %_DEST%\inc%_EXT%\svx\sdr\animation\ainfographic.hxx ..\inc\svx\sdr\animation\ainfoscrolltext.hxx %_DEST%\inc%_EXT%\svx\sdr\animation\ainfoscrolltext.hxx diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index 7bbf9c6ca9..55a68c167b 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -70,8 +70,33 @@ E3dDragMethod::E3dDragMethod ( // eine Unit anlegen const long nCnt(rMark.GetMarkCount()); static bool bDoInvalidate(false); + long nObjs(0); - for(long nObjs = 0;nObjs < nCnt;nObjs++) + if(mbMoveFull) + { + // for non-visible 3D objects fallback to wireframe interaction + bool bInvisibleObjects(false); + + for(nObjs = 0;!bInvisibleObjects && nObjs < nCnt;nObjs++) + { + E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj()); + + if(pE3dObj) + { + if(!pE3dObj->HasFillStyle() && !pE3dObj->HasLineStyle()) + { + bInvisibleObjects = true; + } + } + } + + if(bInvisibleObjects) + { + mbMoveFull = false; + } + } + + for(nObjs = 0;nObjs < nCnt;nObjs++) { E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj()); diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 05de87c705..f4bbfa25b8 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -337,6 +337,12 @@ UINT16 E3dScene::GetObjIdentifier() const return E3D_SCENE_ID; } +void E3dScene::SetBoundRectDirty() +{ + // avoid resetting aOutRect which in case of this object is model data, + // not re-creatable view data +} + /************************************************************************* |* |* SetSnapRect diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 7f0e83108e..68d31687e7 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -74,7 +74,7 @@ #include #include #include -#include +#include #include #include #include @@ -208,8 +208,8 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr // if we have full overlay from selected objects, embed with 50% transparence, the // transformation is added to the OverlayPrimitive2DSequenceObject - drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aContent, 0.5)); - aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1); + drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aContent, 0.5)); + aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1); sdr::overlay::OverlayPrimitive2DSequenceObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent); diff --git a/svx/source/sdr/attribute/makefile.mk b/svx/source/sdr/attribute/makefile.mk index 44e161a3b5..33ef24169a 100644 --- a/svx/source/sdr/attribute/makefile.mk +++ b/svx/source/sdr/attribute/makefile.mk @@ -43,7 +43,10 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- SLOFILES=\ - $(SLO)$/sdrallattribute.obj \ + $(SLO)$/sdrfilltextattribute.obj \ + $(SLO)$/sdrlinefillshadowtextattribute.obj \ + $(SLO)$/sdrlineshadowtextattribute.obj \ + $(SLO)$/sdrshadowtextattribute.obj \ $(SLO)$/sdrtextattribute.obj \ $(SLO)$/sdrformtextattribute.obj \ $(SLO)$/sdrformtextoutlineattribute.obj diff --git a/svx/source/sdr/attribute/sdrallattribute.cxx b/svx/source/sdr/attribute/sdrallattribute.cxx deleted file mode 100644 index 1150f5a684..0000000000 --- a/svx/source/sdr/attribute/sdrallattribute.cxx +++ /dev/null @@ -1,412 +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: sdrallattribute.cxx,v $ - * - * $Revision: 1.2 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "precompiled_svx.hxx" - -#include -#include -#include -#include - -////////////////////////////////////////////////////////////////////////////// -// pointer compare define -#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrShadowTextAttribute::SdrShadowTextAttribute( - SdrShadowAttribute* pShadow, - SdrTextAttribute* pTextAttribute) - : mpShadow(pShadow), - mpTextAttribute(pTextAttribute) - { - } - - SdrShadowTextAttribute::SdrShadowTextAttribute( - const SdrShadowTextAttribute& rCandidate) - : mpShadow(0), - mpTextAttribute(0) - { - *this = rCandidate; - } - - SdrShadowTextAttribute::~SdrShadowTextAttribute() - { - delete mpShadow; - delete mpTextAttribute; - } - - SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate) - { - // handle mpShadow - { - // delete local mpShadow if necessary - if(mpShadow) - { - delete mpShadow; - mpShadow = 0; - } - - // copy mpShadow if necessary - if(rCandidate.mpShadow) - { - mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow); - } - } - - // handle mpTextAttribute - { - // delete local mpTextAttribute if necessary - if(mpTextAttribute) - { - delete mpTextAttribute; - mpTextAttribute = 0; - } - - // copy mpTextAttribute if necessary - if(rCandidate.mpTextAttribute) - { - mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute); - } - } - - return *this; - } - - bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const - { - // handle mpShadow - if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow)) - return false; - - // handle mpTextAttribute - if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute)) - return false; - - return true; - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrFillTextAttribute::SdrFillTextAttribute( - SdrFillAttribute* pFill, - FillGradientAttribute* pFillFloatTransGradient, - SdrTextAttribute* pTextAttribute) - : mpFill(pFill), - mpFillFloatTransGradient(pFillFloatTransGradient), - mpTextAttribute(pTextAttribute) - { - } - - SdrFillTextAttribute::SdrFillTextAttribute( - const SdrFillTextAttribute& rCandidate) - : mpFill(0), - mpFillFloatTransGradient(0), - mpTextAttribute(0) - { - *this = rCandidate; - } - - SdrFillTextAttribute::~SdrFillTextAttribute() - { - delete mpFill; - delete mpFillFloatTransGradient; - delete mpTextAttribute; - } - - SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate) - { - // handle mpFill - { - // delete local mpFill if necessary - if(mpFill) - { - delete mpFill; - mpFill = 0; - } - - // copy mpFill if necessary - if(rCandidate.mpFill) - { - mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill); - } - } - - // handle mpFillFloatTransGradient - { - // delete local mpFillFloatTransGradient if necessary - if(mpFillFloatTransGradient) - { - delete mpFillFloatTransGradient; - mpFillFloatTransGradient = 0; - } - - // copy mpFillFloatTransGradient if necessary - if(rCandidate.mpFillFloatTransGradient) - { - mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient); - } - } - - // handle mpTextAttribute - { - // delete local mpTextAttribute if necessary - if(mpTextAttribute) - { - delete mpTextAttribute; - mpTextAttribute = 0; - } - - // copy mpTextAttribute if necessary - if(rCandidate.mpTextAttribute) - { - mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute); - } - } - - return *this; - } - - bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const - { - // handle mpFill - if(!pointerOrContentEqual(mpFill, rCandidate.mpFill)) - return false; - - // handle mpFillFloatTransGradient - if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient)) - return false; - - // handle mpTextAttribute - if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute)) - return false; - - return true; - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrLineShadowTextAttribute::SdrLineShadowTextAttribute( - SdrLineAttribute* pLine, - SdrLineStartEndAttribute* pLineStartEnd, - SdrShadowAttribute* pShadow, - SdrTextAttribute* pTextAttribute) - : SdrShadowTextAttribute(pShadow, pTextAttribute), - mpLine(pLine), - mpLineStartEnd(pLineStartEnd) - { - } - - SdrLineShadowTextAttribute::SdrLineShadowTextAttribute( - const SdrLineShadowTextAttribute& rCandidate) - : SdrShadowTextAttribute(0, 0), - mpLine(0), - mpLineStartEnd(0) - { - *this = rCandidate; - } - - SdrLineShadowTextAttribute::~SdrLineShadowTextAttribute() - { - delete mpLine; - delete mpLineStartEnd; - } - - SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate) - { - // call parent - SdrShadowTextAttribute::operator=(rCandidate); - - // handle mpLine - { - // delete local mpLine if necessary - if(mpLine) - { - delete mpLine; - mpLine = 0; - } - - // copy mpLine if necessary - if(rCandidate.mpLine) - { - mpLine = new SdrLineAttribute(*rCandidate.mpLine); - } - } - - // handle mpLineStartEnd - { - // delete local mpLineStartEnd if necessary - if(mpLineStartEnd) - { - delete mpLineStartEnd; - mpLineStartEnd = 0; - } - - // copy mpLineStartEnd if necessary - if(rCandidate.mpLineStartEnd) - { - mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd); - } - } - - return *this; - } - - bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const - { - // call parent - if(!(SdrShadowTextAttribute::operator==(rCandidate))) - return false; - - // handle mpLine - if(!pointerOrContentEqual(mpLine, rCandidate.mpLine)) - return false; - - // handle mpLineStartEnd - if(!pointerOrContentEqual(mpLineStartEnd, rCandidate.mpLineStartEnd)) - return false; - - return true; - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace attribute - { - SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute( - SdrLineAttribute* pLine, - attribute::SdrFillAttribute* pFill, - SdrLineStartEndAttribute* pLineStartEnd, - SdrShadowAttribute* pShadow, - FillGradientAttribute* pFillFloatTransGradient, - SdrTextAttribute* pTextAttribute) - : SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pTextAttribute), - mpFill(pFill), - mpFillFloatTransGradient(pFillFloatTransGradient) - { - } - - SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute( - const SdrLineFillShadowTextAttribute& rCandidate) - : SdrLineShadowTextAttribute(0, 0, 0, 0), - mpFill(0), - mpFillFloatTransGradient(0) - { - *this = rCandidate; - } - - SdrLineFillShadowTextAttribute::~SdrLineFillShadowTextAttribute() - { - delete mpFill; - delete mpFillFloatTransGradient; - } - - SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate) - { - // call parent - SdrLineShadowTextAttribute::operator=(rCandidate); - - // handle mpFill - { - // delete local mpFill if necessary - if(mpFill) - { - delete mpFill; - mpFill = 0; - } - - // copy mpFill if necessary - if(rCandidate.mpFill) - { - mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill); - } - } - - // handle mpFillFloatTransGradient - { - // delete local mpFillFloatTransGradient if necessary - if(mpFillFloatTransGradient) - { - delete mpFillFloatTransGradient; - mpFillFloatTransGradient = 0; - } - - // copy mpFillFloatTransGradient if necessary - if(rCandidate.mpFillFloatTransGradient) - { - mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient); - } - } - - return *this; - } - - bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const - { - // call parent - if(!(SdrLineShadowTextAttribute::operator==(rCandidate))) - return false; - - // handle mpFill - if(!pointerOrContentEqual(mpFill, rCandidate.mpFill)) - return false; - - // handle mpFillFloatTransGradient - if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient)) - return false; - - return true; - } - } // end of namespace attribute -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/svx/source/sdr/attribute/sdrfilltextattribute.cxx b/svx/source/sdr/attribute/sdrfilltextattribute.cxx new file mode 100644 index 0000000000..f31622bfc8 --- /dev/null +++ b/svx/source/sdr/attribute/sdrfilltextattribute.cxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * 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: sdrallattribute.cxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_svx.hxx" + +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + SdrFillTextAttribute::SdrFillTextAttribute( + const SdrFillAttribute& rFill, + const FillGradientAttribute& rFillFloatTransGradient, + const SdrTextAttribute& rTextAttribute) + : maFill(rFill), + maFillFloatTransGradient(rFillFloatTransGradient), + maTextAttribute(rTextAttribute) + { + } + + SdrFillTextAttribute::SdrFillTextAttribute() + : maFill(), + maFillFloatTransGradient(), + maTextAttribute() + { + } + + SdrFillTextAttribute::SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate) + : maFill(rCandidate.getFill()), + maFillFloatTransGradient(rCandidate.getFillFloatTransGradient()), + maTextAttribute(rCandidate.getText()) + { + } + + SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate) + { + maFill = rCandidate.getFill(); + maFillFloatTransGradient = rCandidate.getFillFloatTransGradient(); + maTextAttribute = rCandidate.getText(); + + return *this; + } + + bool SdrFillTextAttribute::isDefault() const + { + return(getFill().isDefault() + && getFillFloatTransGradient().isDefault() + && getText().isDefault()); + } + + bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const + { + return(getFill() == rCandidate.getFill() + && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient() + && getText() == rCandidate.getText()); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx index 619c08ade9..507ecf06a4 100644 --- a/svx/source/sdr/attribute/sdrformtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx @@ -32,8 +32,8 @@ #include "precompiled_svx.hxx" #include +#include #include - #include #include #include @@ -44,11 +44,8 @@ #include #include #include - #include #include -#include -#include #include #include #include @@ -56,12 +53,10 @@ #include #include #include +#include +#include #include -////////////////////////////////////////////////////////////////////////////// -// pointer compare define -#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) - ////////////////////////////////////////////////////////////////////////////// // helper to get line, stroke and transparence attributes from SfxItemSet @@ -158,144 +153,272 @@ namespace drawinglayer { namespace attribute { - SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet) - : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()), - mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()), - mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()), - mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()), - mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()), - meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()), - meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()), - meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()), - maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()), - mpOutline(0), - mpShadowOutline(0), - mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()), - mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue()) + class ImpSdrFormTextAttribute { - if(getFormTextOutline()) + public: + // refcounter + sal_uInt32 mnRefCount; + + // FormText (FontWork) Attributes + sal_Int32 mnFormTextDistance; // distance from line in upright direction + sal_Int32 mnFormTextStart; // shift from polygon start + sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees + sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling + sal_uInt16 mnFormTextShdwTransp; // shadow transparence + XFormTextStyle meFormTextStyle; // on/off and char orientation + XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale + XFormTextShadow meFormTextShadow; // shadow mode + Color maFormTextShdwColor; // shadow color + + // outline attributes; used when getFormTextOutline() is true and (for + // shadow) when getFormTextShadow() != XFTSHADOW_NONE + SdrFormTextOutlineAttribute maOutline; + SdrFormTextOutlineAttribute maShadowOutline; + + // bitfield + unsigned mbFormTextMirror : 1; // change orientation + unsigned mbFormTextOutline : 1; // show contour of objects + + ImpSdrFormTextAttribute(const SfxItemSet& rSet) + : mnRefCount(0), + mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()), + mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()), + mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()), + mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()), + mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()), + meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()), + meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()), + meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()), + maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()), + maOutline(), + maShadowOutline(), + mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()), + mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue()) { - const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet)); - - // also need to prepare attributes for outlines + if(getFormTextOutline()) { - const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet)); - const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet)); - - mpOutline = new SdrFormTextOutlineAttribute( - aLineAttribute, aStrokeAttribute, nTransparence); + const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet)); + + // also need to prepare attributes for outlines + { + const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet)); + const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet)); + + maOutline = SdrFormTextOutlineAttribute( + aLineAttribute, aStrokeAttribute, nTransparence); + } + + if(XFTSHADOW_NONE != getFormTextShadow()) + { + // also need to prepare attributes for shadow outlines + const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet)); + const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet)); + + maShadowOutline = SdrFormTextOutlineAttribute( + aLineAttribute, aStrokeAttribute, nTransparence); + } } + } - if(XFTSHADOW_NONE != getFormTextShadow()) - { - // also need to prepare attributes for shadow outlines - const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet)); - const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet)); - - mpShadowOutline = new SdrFormTextOutlineAttribute( - aLineAttribute, aStrokeAttribute, nTransparence); - } + ImpSdrFormTextAttribute() + : mnRefCount(0), + mnFormTextDistance(0), + mnFormTextStart(0), + mnFormTextShdwXVal(0), + mnFormTextShdwYVal(0), + mnFormTextShdwTransp(0), + meFormTextStyle(XFT_NONE), + meFormTextAdjust(XFT_CENTER), + meFormTextShadow(XFTSHADOW_NONE), + maFormTextShdwColor(), + maOutline(), + maShadowOutline(), + mbFormTextMirror(false), + mbFormTextOutline(false) + { } - } - SdrFormTextAttribute::~SdrFormTextAttribute() - { - if(mpOutline) + // data read access + sal_Int32 getFormTextDistance() const { return mnFormTextDistance; } + sal_Int32 getFormTextStart() const { return mnFormTextStart; } + sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; } + sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; } + sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; } + XFormTextStyle getFormTextStyle() const { return meFormTextStyle; } + XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; } + XFormTextShadow getFormTextShadow() const { return meFormTextShadow; } + Color getFormTextShdwColor() const { return maFormTextShdwColor; } + const SdrFormTextOutlineAttribute& getOutline() const { return maOutline; } + const SdrFormTextOutlineAttribute& getShadowOutline() const { return maShadowOutline; } + bool getFormTextMirror() const { return mbFormTextMirror; } + bool getFormTextOutline() const { return mbFormTextOutline; } + + // compare operator + bool operator==(const ImpSdrFormTextAttribute& rCandidate) const { - delete mpOutline; - mpOutline = 0; + return (getFormTextDistance() == rCandidate.getFormTextDistance() + && getFormTextStart() == rCandidate.getFormTextStart() + && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal() + && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal() + && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp() + && getFormTextStyle() == rCandidate.getFormTextStyle() + && getFormTextAdjust() == rCandidate.getFormTextAdjust() + && getFormTextShadow() == rCandidate.getFormTextShadow() + && getFormTextShdwColor() == rCandidate.getFormTextShdwColor() + && getOutline() == rCandidate.getOutline() + && getShadowOutline() == rCandidate.getShadowOutline() + && getFormTextMirror() == rCandidate.getFormTextMirror() + && getFormTextOutline() == rCandidate.getFormTextOutline()); } - if(mpShadowOutline) + static ImpSdrFormTextAttribute* get_global_default() { - delete mpShadowOutline; - mpShadowOutline = 0; + static ImpSdrFormTextAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrFormTextAttribute(); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; } + }; + + SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet) + : mpSdrFormTextAttribute(new ImpSdrFormTextAttribute(rSet)) + { + } + + SdrFormTextAttribute::SdrFormTextAttribute() + : mpSdrFormTextAttribute(ImpSdrFormTextAttribute::get_global_default()) + { + mpSdrFormTextAttribute->mnRefCount++; } SdrFormTextAttribute::SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate) - : mnFormTextDistance(rCandidate.getFormTextDistance()), - mnFormTextStart(rCandidate.getFormTextStart()), - mnFormTextShdwXVal(rCandidate.getFormTextShdwXVal()), - mnFormTextShdwYVal(rCandidate.getFormTextShdwYVal()), - mnFormTextShdwTransp(rCandidate.getFormTextShdwTransp()), - meFormTextStyle(rCandidate.getFormTextStyle()), - meFormTextAdjust(rCandidate.getFormTextAdjust()), - meFormTextShadow(rCandidate.getFormTextShadow()), - maFormTextShdwColor(rCandidate.getFormTextShdwColor()), - mpOutline(0), - mpShadowOutline(0), - mbFormTextMirror(rCandidate.getFormTextMirror()), - mbFormTextOutline(rCandidate.getFormTextOutline()) + : mpSdrFormTextAttribute(rCandidate.mpSdrFormTextAttribute) { - if(rCandidate.getOutline()) + mpSdrFormTextAttribute->mnRefCount++; + } + + SdrFormTextAttribute::~SdrFormTextAttribute() + { + if(mpSdrFormTextAttribute->mnRefCount) { - mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline()); + mpSdrFormTextAttribute->mnRefCount--; } - - if(rCandidate.getShadowOutline()) + else { - mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline()); + delete mpSdrFormTextAttribute; } } + bool SdrFormTextAttribute::isDefault() const + { + return mpSdrFormTextAttribute == ImpSdrFormTextAttribute::get_global_default(); + } + SdrFormTextAttribute& SdrFormTextAttribute::operator=(const SdrFormTextAttribute& rCandidate) { - mnFormTextDistance = rCandidate.getFormTextDistance(); - mnFormTextStart = rCandidate.getFormTextStart(); - mnFormTextShdwXVal = rCandidate.getFormTextShdwXVal(); - mnFormTextShdwYVal = rCandidate.getFormTextShdwYVal(); - mnFormTextShdwTransp = rCandidate.getFormTextShdwTransp(); - meFormTextStyle = rCandidate.getFormTextStyle(); - meFormTextAdjust = rCandidate.getFormTextAdjust(); - meFormTextShadow = rCandidate.getFormTextShadow(); - maFormTextShdwColor = rCandidate.getFormTextShdwColor(); - - if(mpOutline) + if(rCandidate.mpSdrFormTextAttribute != mpSdrFormTextAttribute) { - delete mpOutline; + if(mpSdrFormTextAttribute->mnRefCount) + { + mpSdrFormTextAttribute->mnRefCount--; + } + else + { + delete mpSdrFormTextAttribute; + } + + mpSdrFormTextAttribute = rCandidate.mpSdrFormTextAttribute; + mpSdrFormTextAttribute->mnRefCount++; } - mpOutline = 0; + return *this; + } - if(rCandidate.getOutline()) + bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const + { + if(rCandidate.mpSdrFormTextAttribute == mpSdrFormTextAttribute) { - mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline()); + return true; } - if(mpShadowOutline) + if(rCandidate.isDefault() != isDefault()) { - delete mpShadowOutline; + return false; } - mpShadowOutline = 0; - - if(rCandidate.getShadowOutline()) - { - mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline()); - } + return (*rCandidate.mpSdrFormTextAttribute == *mpSdrFormTextAttribute); + } + + sal_Int32 SdrFormTextAttribute::getFormTextDistance() const + { + return mpSdrFormTextAttribute->getFormTextDistance(); + } - mbFormTextMirror = rCandidate.getFormTextMirror(); - mbFormTextOutline = rCandidate.getFormTextOutline(); + sal_Int32 SdrFormTextAttribute::getFormTextStart() const + { + return mpSdrFormTextAttribute->getFormTextStart(); + } - return *this; + sal_Int32 SdrFormTextAttribute::getFormTextShdwXVal() const + { + return mpSdrFormTextAttribute->getFormTextShdwXVal(); } - bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const - { - return (getFormTextDistance() == rCandidate.getFormTextDistance() - && getFormTextStart() == rCandidate.getFormTextStart() - && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal() - && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal() - && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp() - && getFormTextStyle() == rCandidate.getFormTextStyle() - && getFormTextAdjust() == rCandidate.getFormTextAdjust() - && getFormTextShadow() == rCandidate.getFormTextShadow() - && getFormTextShdwColor() == rCandidate.getFormTextShdwColor() - && pointerOrContentEqual(getOutline(), rCandidate.getOutline()) - && pointerOrContentEqual(getShadowOutline(), rCandidate.getShadowOutline()) - && getFormTextMirror() == rCandidate.getFormTextMirror() - && getFormTextOutline() == rCandidate.getFormTextOutline()); + sal_Int32 SdrFormTextAttribute::getFormTextShdwYVal() const + { + return mpSdrFormTextAttribute->getFormTextShdwYVal(); + } + + sal_uInt16 SdrFormTextAttribute::getFormTextShdwTransp() const + { + return mpSdrFormTextAttribute->getFormTextShdwTransp(); + } + + XFormTextStyle SdrFormTextAttribute::getFormTextStyle() const + { + return mpSdrFormTextAttribute->getFormTextStyle(); + } + + XFormTextAdjust SdrFormTextAttribute::getFormTextAdjust() const + { + return mpSdrFormTextAttribute->getFormTextAdjust(); + } + + XFormTextShadow SdrFormTextAttribute::getFormTextShadow() const + { + return mpSdrFormTextAttribute->getFormTextShadow(); + } + + Color SdrFormTextAttribute::getFormTextShdwColor() const + { + return mpSdrFormTextAttribute->getFormTextShdwColor(); + } + + const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getOutline() const + { + return mpSdrFormTextAttribute->getOutline(); + } + + const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getShadowOutline() const + { + return mpSdrFormTextAttribute->getShadowOutline(); + } + + bool SdrFormTextAttribute::getFormTextMirror() const + { + return mpSdrFormTextAttribute->getFormTextMirror(); + } + + bool SdrFormTextAttribute::getFormTextOutline() const + { + return mpSdrFormTextAttribute->getFormTextOutline(); } } // end of namespace attribute } // end of namespace drawinglayer diff --git a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx index 0a96ad2f6f..683088931f 100644 --- a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx +++ b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx @@ -32,10 +32,8 @@ #include "precompiled_svx.hxx" #include - -////////////////////////////////////////////////////////////////////////////// -// pointer compare define -#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -43,21 +41,146 @@ namespace drawinglayer { namespace attribute { + class ImpSdrFormTextOutlineAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // one set of attributes for FormText (FontWork) outline visualisation + LineAttribute maLineAttribute; + StrokeAttribute maStrokeAttribute; + sal_uInt8 mnTransparence; + + ImpSdrFormTextOutlineAttribute( + const LineAttribute& rLineAttribute, + const StrokeAttribute& rStrokeAttribute, + sal_uInt8 nTransparence) + : mnRefCount(0), + maLineAttribute(rLineAttribute), + maStrokeAttribute(rStrokeAttribute), + mnTransparence(nTransparence) + { + } + + // data read access + const LineAttribute& getLineAttribute() const { return maLineAttribute; } + const StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } + sal_uInt8 getTransparence() const { return mnTransparence; } + + // compare operator + bool operator==(const ImpSdrFormTextOutlineAttribute& rCandidate) const + { + return (getLineAttribute() == rCandidate.getLineAttribute() + && getStrokeAttribute() == rCandidate.getStrokeAttribute() + && getTransparence() == rCandidate.getTransparence()); + } + + static ImpSdrFormTextOutlineAttribute* get_global_default() + { + static ImpSdrFormTextOutlineAttribute* pDefault = 0; + + if(!pDefault) + { + pDefault = new ImpSdrFormTextOutlineAttribute( + LineAttribute(), + StrokeAttribute(), + 0); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute( const LineAttribute& rLineAttribute, const StrokeAttribute& rStrokeAttribute, sal_uInt8 nTransparence) - : maLineAttribute(rLineAttribute), - maStrokeAttribute(rStrokeAttribute), - mnTransparence(nTransparence) + : mpSdrFormTextOutlineAttribute(new ImpSdrFormTextOutlineAttribute( + rLineAttribute, rStrokeAttribute, nTransparence)) + { + } + + SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute() + : mpSdrFormTextOutlineAttribute(ImpSdrFormTextOutlineAttribute::get_global_default()) + { + mpSdrFormTextOutlineAttribute->mnRefCount++; + } + + SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate) + : mpSdrFormTextOutlineAttribute(rCandidate.mpSdrFormTextOutlineAttribute) { + mpSdrFormTextOutlineAttribute->mnRefCount++; + } + + SdrFormTextOutlineAttribute::~SdrFormTextOutlineAttribute() + { + if(mpSdrFormTextOutlineAttribute->mnRefCount) + { + mpSdrFormTextOutlineAttribute->mnRefCount--; + } + else + { + delete mpSdrFormTextOutlineAttribute; + } + } + + bool SdrFormTextOutlineAttribute::isDefault() const + { + return mpSdrFormTextOutlineAttribute == ImpSdrFormTextOutlineAttribute::get_global_default(); + } + + SdrFormTextOutlineAttribute& SdrFormTextOutlineAttribute::operator=(const SdrFormTextOutlineAttribute& rCandidate) + { + if(rCandidate.mpSdrFormTextOutlineAttribute != mpSdrFormTextOutlineAttribute) + { + if(mpSdrFormTextOutlineAttribute->mnRefCount) + { + mpSdrFormTextOutlineAttribute->mnRefCount--; + } + else + { + delete mpSdrFormTextOutlineAttribute; + } + + mpSdrFormTextOutlineAttribute = rCandidate.mpSdrFormTextOutlineAttribute; + mpSdrFormTextOutlineAttribute->mnRefCount++; + } + + return *this; } bool SdrFormTextOutlineAttribute::operator==(const SdrFormTextOutlineAttribute& rCandidate) const { - return (getLineAttribute() == rCandidate.getLineAttribute() - && getStrokeAttribute() == rCandidate.getStrokeAttribute() - && getTransparence() == rCandidate.getTransparence()); + if(rCandidate.mpSdrFormTextOutlineAttribute == mpSdrFormTextOutlineAttribute) + { + return true; + } + + if(rCandidate.isDefault() != isDefault()) + { + return false; + } + + return (*rCandidate.mpSdrFormTextOutlineAttribute == *mpSdrFormTextOutlineAttribute); + } + + const LineAttribute& SdrFormTextOutlineAttribute::getLineAttribute() const + { + return mpSdrFormTextOutlineAttribute->getLineAttribute(); + } + + const StrokeAttribute& SdrFormTextOutlineAttribute::getStrokeAttribute() const + { + return mpSdrFormTextOutlineAttribute->getStrokeAttribute(); + } + + sal_uInt8 SdrFormTextOutlineAttribute::getTransparence() const + { + return mpSdrFormTextOutlineAttribute->getTransparence(); } } // end of namespace attribute } // end of namespace drawinglayer diff --git a/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx new file mode 100644 index 0000000000..073d9b7cf8 --- /dev/null +++ b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * 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: sdrallattribute.cxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_svx.hxx" + +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute( + const SdrLineAttribute& rLine, + const SdrFillAttribute& rFill, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const FillGradientAttribute& rFillFloatTransGradient, + const SdrTextAttribute& rTextAttribute) + : SdrLineShadowTextAttribute(rLine, rLineStartEnd, rShadow, rTextAttribute), + maFill(rFill), + maFillFloatTransGradient(rFillFloatTransGradient) + { + } + + SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute() + : SdrLineShadowTextAttribute(), + maFill(), + maFillFloatTransGradient() + { + } + + SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate) + : SdrLineShadowTextAttribute(rCandidate), + maFill(rCandidate.getFill()), + maFillFloatTransGradient(rCandidate.getFillFloatTransGradient()) + { + } + + SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate) + { + SdrLineShadowTextAttribute::operator=(rCandidate); + maFill = rCandidate.getFill(); + maFillFloatTransGradient = rCandidate.getFillFloatTransGradient(); + + return *this; + } + + bool SdrLineFillShadowTextAttribute::isDefault() const + { + return (SdrLineShadowTextAttribute::isDefault() + && getFill().isDefault() + && getFillFloatTransGradient().isDefault()); + } + + bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const + { + return(SdrLineShadowTextAttribute::operator==(rCandidate) + && getFill() == rCandidate.getFill() + && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient()); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx new file mode 100644 index 0000000000..f2042d6d0c --- /dev/null +++ b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * 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: sdrallattribute.cxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_svx.hxx" + +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + SdrLineShadowTextAttribute::SdrLineShadowTextAttribute( + const SdrLineAttribute& rLine, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute) + : SdrShadowTextAttribute(rShadow, rTextAttribute), + maLine(rLine), + maLineStartEnd(rLineStartEnd) + { + } + + SdrLineShadowTextAttribute::SdrLineShadowTextAttribute() + : SdrShadowTextAttribute(), + maLine(), + maLineStartEnd() + { + } + + SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate) + : SdrShadowTextAttribute(rCandidate), + maLine(rCandidate.getLine()), + maLineStartEnd(rCandidate.getLineStartEnd()) + { + } + + SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate) + { + SdrShadowTextAttribute::operator=(rCandidate); + maLine = rCandidate.getLine(); + maLineStartEnd = rCandidate.getLineStartEnd(); + + return *this; + } + + bool SdrLineShadowTextAttribute::isDefault() const + { + return(SdrShadowTextAttribute::isDefault() + && getLine().isDefault() + && getLineStartEnd().isDefault()); + } + + bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const + { + return(SdrShadowTextAttribute::operator==(rCandidate) + && getLine() == rCandidate.getLine() + && getLineStartEnd() == rCandidate.getLineStartEnd()); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/attribute/sdrshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx new file mode 100644 index 0000000000..d1da426a79 --- /dev/null +++ b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * 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: sdrallattribute.cxx,v $ + * + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_svx.hxx" + +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + SdrShadowTextAttribute::SdrShadowTextAttribute( + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute) + : maShadow(rShadow), + maTextAttribute(rTextAttribute) + { + } + + SdrShadowTextAttribute::SdrShadowTextAttribute() + : maShadow(), + maTextAttribute() + { + } + + SdrShadowTextAttribute::SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate) + : maShadow(rCandidate.getShadow()), + maTextAttribute(rCandidate.getText()) + { + } + + SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate) + { + maShadow = rCandidate.getShadow(); + maTextAttribute = rCandidate.getText(); + + return *this; + } + + bool SdrShadowTextAttribute::isDefault() const + { + return (getShadow().isDefault() + && getText().isDefault()); + } + + bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const + { + return (getShadow() == rCandidate.getShadow() + && getText() == rCandidate.getText()); + } + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 1c72623610..1c410b9c31 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -34,21 +34,233 @@ #include #include #include -#include -#include -#include #include -////////////////////////////////////////////////////////////////////////////// -// pointer compare define -#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q)) - ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace attribute { + class ImpSdrTextAttribute + { + public: + // refcounter + sal_uInt32 mnRefCount; + + // all-text attributes. The SdrText itself and a copy + // of te OPO + const SdrText* mpSdrText; + const OutlinerParaObject* mpOutlinerParaObject; + + // Set when it's a FormText; contains all FormText attributes + SdrFormTextAttribute maSdrFormTextAttribute; + + // text distances + sal_Int32 maTextLeftDistance; + sal_Int32 maTextUpperDistance; + sal_Int32 maTextRightDistance; + sal_Int32 maTextLowerDistance; + + // #i101556# use versioning from text attributes to detect changes + sal_uInt32 maPropertiesVersion; + + // text alignments + SdrTextHorzAdjust maSdrTextHorzAdjust; + SdrTextVertAdjust maSdrTextVertAdjust; + + // bitfield + unsigned mbContour : 1; + unsigned mbFitToSize : 1; + unsigned mbHideContour : 1; + unsigned mbBlink : 1; + unsigned mbScroll : 1; + unsigned mbInEditMode : 1; + unsigned mbFixedCellHeight : 1; + unsigned mbWrongSpell : 1; + + public: + ImpSdrTextAttribute( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObject, + XFormTextStyle eFormTextStyle, + sal_Int32 aTextLeftDistance, + sal_Int32 aTextUpperDistance, + sal_Int32 aTextRightDistance, + sal_Int32 aTextLowerDistance, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, + bool bContour, + bool bFitToSize, + bool bHideContour, + bool bBlink, + bool bScroll, + bool bInEditMode, + bool bFixedCellHeight, + bool bWrongSpell) + : mnRefCount(0), + mpSdrText(pSdrText), + mpOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)), + maSdrFormTextAttribute(), + maTextLeftDistance(aTextLeftDistance), + maTextUpperDistance(aTextUpperDistance), + maTextRightDistance(aTextRightDistance), + maTextLowerDistance(aTextLowerDistance), + maPropertiesVersion(0), + maSdrTextHorzAdjust(aSdrTextHorzAdjust), + maSdrTextVertAdjust(aSdrTextVertAdjust), + mbContour(bContour), + mbFitToSize(bFitToSize), + mbHideContour(bHideContour), + mbBlink(bBlink), + mbScroll(bScroll), + mbInEditMode(bInEditMode), + mbFixedCellHeight(bFixedCellHeight), + mbWrongSpell(bWrongSpell) + { + if(pSdrText) + { + if(XFT_NONE != eFormTextStyle) + { + // text on path. Create FormText attribute + const SfxItemSet& rSet = pSdrText->GetItemSet(); + maSdrFormTextAttribute = SdrFormTextAttribute(rSet); + } + + // #i101556# init with version number to detect changes of single text + // attribute and/or style sheets in primitive data without having to + // copy that data locally (which would be better from principle) + maPropertiesVersion = pSdrText->GetObject().GetProperties().getVersion(); + } + } + + ImpSdrTextAttribute() + : mnRefCount(0), + mpSdrText(0), + mpOutlinerParaObject(0), + maSdrFormTextAttribute(), + maTextLeftDistance(0), + maTextUpperDistance(0), + maTextRightDistance(0), + maTextLowerDistance(0), + maPropertiesVersion(0), + maSdrTextHorzAdjust(SDRTEXTHORZADJUST_LEFT), + maSdrTextVertAdjust(SDRTEXTVERTADJUST_TOP), + mbContour(false), + mbFitToSize(false), + mbHideContour(false), + mbBlink(false), + mbScroll(false), + mbInEditMode(false), + mbFixedCellHeight(false), + mbWrongSpell(false) + { + } + + ~ImpSdrTextAttribute() + { + if(mpOutlinerParaObject) + { + delete mpOutlinerParaObject; + } + } + + // data read access + const SdrText& getSdrText() const + { + OSL_ENSURE(mpSdrText, "Access to text of default version of ImpSdrTextAttribute (!)"); + return *mpSdrText; + } + const OutlinerParaObject& getOutlinerParaObject() const + { + OSL_ENSURE(mpOutlinerParaObject, "Access to OutlinerParaObject of default version of ImpSdrTextAttribute (!)"); + return *mpOutlinerParaObject; + } + bool isContour() const { return mbContour; } + bool isFitToSize() const { return mbFitToSize; } + bool isHideContour() const { return mbHideContour; } + bool isBlink() const { return mbBlink; } + bool isScroll() const { return mbScroll; } + bool isInEditMode() const { return mbInEditMode; } + bool isFixedCellHeight() const { return mbFixedCellHeight; } + bool isWrongSpell() const { return mbWrongSpell; } + const SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; } + sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; } + sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; } + sal_Int32 getTextRightDistance() const { return maTextRightDistance; } + sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; } + sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; } + SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; } + SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; } + + // compare operator + bool operator==(const ImpSdrTextAttribute& rCandidate) const + { + if(mpOutlinerParaObject != rCandidate.mpOutlinerParaObject) + { + if(mpOutlinerParaObject && rCandidate.mpOutlinerParaObject) + { + // compares OPO and it's contents, but traditionally not the RedLining + // which is not seen as model, but as temporary information + if(!(getOutlinerParaObject() == rCandidate.getOutlinerParaObject())) + { + return false; + } + + // #i102062# for primitive visualisation, the WrongList (SpellChecking) + // is important, too, so use isWrongListEqual since there is no WrongList + // comparison in the regular OutlinerParaObject compare (since it's + // not-persistent data) + if(!(getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject()))) + { + return false; + } + } + else + { + // only one is zero; not equal + return false; + } + } + + return ( + getSdrFormTextAttribute() == rCandidate.getSdrFormTextAttribute() + && getTextLeftDistance() == rCandidate.getTextLeftDistance() + && getTextUpperDistance() == rCandidate.getTextUpperDistance() + && getTextRightDistance() == rCandidate.getTextRightDistance() + && getTextLowerDistance() == rCandidate.getTextLowerDistance() + && getPropertiesVersion() == rCandidate.getPropertiesVersion() + + && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust() + && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust() + + && isContour() == rCandidate.isContour() + && isFitToSize() == rCandidate.isFitToSize() + && isHideContour() == rCandidate.isHideContour() + && isBlink() == rCandidate.isBlink() + && isScroll() == rCandidate.isScroll() + && isInEditMode() == rCandidate.isInEditMode() + && isFixedCellHeight() == rCandidate.isFixedCellHeight() + && isWrongSpell() == rCandidate.isWrongSpell()); + } + + static ImpSdrTextAttribute* get_global_default() + { + static ImpSdrTextAttribute* pDefault = 0; + + if(!pDefault) + { + // use default constructor + pDefault = new ImpSdrTextAttribute(); + + // never delete; start with RefCount 1, not 0 + pDefault->mnRefCount++; + } + + return pDefault; + } + }; + SdrTextAttribute::SdrTextAttribute( const SdrText& rSdrText, const OutlinerParaObject& rOutlinerParaObject, @@ -67,149 +279,172 @@ namespace drawinglayer bool bInEditMode, bool bFixedCellHeight, bool bWrongSpell) - : mpSdrText(&rSdrText), - maOutlinerParaObject(rOutlinerParaObject), - mpSdrFormTextAttribute(0), - maTextLeftDistance(aTextLeftDistance), - maTextUpperDistance(aTextUpperDistance), - maTextRightDistance(aTextRightDistance), - maTextLowerDistance(aTextLowerDistance), - maPropertiesVersion(0), - maSdrTextHorzAdjust(aSdrTextHorzAdjust), - maSdrTextVertAdjust(aSdrTextVertAdjust), - mbContour(bContour), - mbFitToSize(bFitToSize), - mbHideContour(bHideContour), - mbBlink(bBlink), - mbScroll(bScroll), - mbInEditMode(bInEditMode), - mbFixedCellHeight(bFixedCellHeight), - mbWrongSpell(bWrongSpell) + : mpSdrTextAttribute(new ImpSdrTextAttribute( + &rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance, aTextUpperDistance, + aTextRightDistance, aTextLowerDistance, aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour, + bFitToSize, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell)) { - if(XFT_NONE != eFormTextStyle) - { - // text on path. Create FormText attribute - const SfxItemSet& rSet = getSdrText().GetItemSet(); - mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet); - } + } + + SdrTextAttribute::SdrTextAttribute() + : mpSdrTextAttribute(ImpSdrTextAttribute::get_global_default()) + { + mpSdrTextAttribute->mnRefCount++; + } - // #i101556# init with version number to detect changes of single text - // attribute and/or style sheets in primitive data without having to - // copy that data locally (which would be better from principle) - maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion(); + SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate) + : mpSdrTextAttribute(rCandidate.mpSdrTextAttribute) + { + mpSdrTextAttribute->mnRefCount++; } SdrTextAttribute::~SdrTextAttribute() { - if(mpSdrFormTextAttribute) + if(mpSdrTextAttribute->mnRefCount) + { + mpSdrTextAttribute->mnRefCount--; + } + else { - delete mpSdrFormTextAttribute; - mpSdrFormTextAttribute = 0; + delete mpSdrTextAttribute; } } - SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate) - : mpSdrText(&rCandidate.getSdrText()), - maOutlinerParaObject(rCandidate.getOutlinerParaObject()), - mpSdrFormTextAttribute(0), - maTextLeftDistance(rCandidate.getTextLeftDistance()), - maTextUpperDistance(rCandidate.getTextUpperDistance()), - maTextRightDistance(rCandidate.getTextRightDistance()), - maTextLowerDistance(rCandidate.getTextLowerDistance()), - maPropertiesVersion(rCandidate.getPropertiesVersion()), - maSdrTextHorzAdjust(rCandidate.getSdrTextHorzAdjust()), - maSdrTextVertAdjust(rCandidate.getSdrTextVertAdjust()), - mbContour(rCandidate.isContour()), - mbFitToSize(rCandidate.isFitToSize()), - mbHideContour(rCandidate.isHideContour()), - mbBlink(rCandidate.isBlink()), - mbScroll(rCandidate.isScroll()), - mbInEditMode(rCandidate.isInEditMode()), - mbFixedCellHeight(rCandidate.isFixedCellHeight()), - mbWrongSpell(rCandidate.isWrongSpell()) + bool SdrTextAttribute::isDefault() const { - if(rCandidate.getSdrFormTextAttribute()) - { - mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute()); - } + return mpSdrTextAttribute == ImpSdrTextAttribute::get_global_default(); } SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate) { - mpSdrText = &rCandidate.getSdrText(); - maOutlinerParaObject = rCandidate.getOutlinerParaObject(); + if(rCandidate.mpSdrTextAttribute != mpSdrTextAttribute) + { + if(mpSdrTextAttribute->mnRefCount) + { + mpSdrTextAttribute->mnRefCount--; + } + else + { + delete mpSdrTextAttribute; + } + + mpSdrTextAttribute = rCandidate.mpSdrTextAttribute; + mpSdrTextAttribute->mnRefCount++; + } + + return *this; + } - if(mpSdrFormTextAttribute) + bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const + { + if(rCandidate.mpSdrTextAttribute == mpSdrTextAttribute) { - delete mpSdrFormTextAttribute; + return true; } - - mpSdrFormTextAttribute = 0; - if(rCandidate.getSdrFormTextAttribute()) + if(rCandidate.isDefault() != isDefault()) { - mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute()); + return false; } - maTextLeftDistance = rCandidate.getTextLeftDistance(); - maTextUpperDistance = rCandidate.getTextUpperDistance(); - maTextRightDistance = rCandidate.getTextRightDistance(); - maTextLowerDistance = rCandidate.getTextLowerDistance(); - maPropertiesVersion = rCandidate.getPropertiesVersion(); - - maSdrTextHorzAdjust = rCandidate.getSdrTextHorzAdjust(); - maSdrTextVertAdjust = rCandidate.getSdrTextVertAdjust(); - - mbContour = rCandidate.isContour(); - mbFitToSize = rCandidate.isFitToSize(); - mbHideContour = rCandidate.isHideContour(); - mbBlink = rCandidate.isBlink(); - mbScroll = rCandidate.isScroll(); - mbInEditMode = rCandidate.isInEditMode(); - mbFixedCellHeight = rCandidate.isFixedCellHeight(); - mbWrongSpell = rCandidate.isWrongSpell(); + return (*rCandidate.mpSdrTextAttribute == *mpSdrTextAttribute); + } - return *this; + const SdrText& SdrTextAttribute::getSdrText() const + { + return mpSdrTextAttribute->getSdrText(); } - bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const - { - return ( - // compares OPO and it's contents, but traditionally not the RedLining - // which is not seen as model, but as temporary information - getOutlinerParaObject() == rCandidate.getOutlinerParaObject() - - // #i102062# for primitive visualisation, the WrongList (SpellChecking) - // is important, too, so use isWrongListEqual since there is no WrongList - // comparison in the regular OutlinerParaObject compare (since it's - // not-persistent data) - && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject()) - - && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute()) - && getTextLeftDistance() == rCandidate.getTextLeftDistance() - && getTextUpperDistance() == rCandidate.getTextUpperDistance() - && getTextRightDistance() == rCandidate.getTextRightDistance() - && getTextLowerDistance() == rCandidate.getTextLowerDistance() - && getPropertiesVersion() == rCandidate.getPropertiesVersion() - - && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust() - && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust() - - && isContour() == rCandidate.isContour() - && isFitToSize() == rCandidate.isFitToSize() - && isHideContour() == rCandidate.isHideContour() - && isBlink() == rCandidate.isBlink() - && isScroll() == rCandidate.isScroll() - && isInEditMode() == rCandidate.isInEditMode() - && isFixedCellHeight() == rCandidate.isFixedCellHeight() - && isWrongSpell() == rCandidate.isWrongSpell()); + const OutlinerParaObject& SdrTextAttribute::getOutlinerParaObject() const + { + return mpSdrTextAttribute->getOutlinerParaObject(); + } + + bool SdrTextAttribute::isContour() const + { + return mpSdrTextAttribute->isContour(); + } + + bool SdrTextAttribute::isFitToSize() const + { + return mpSdrTextAttribute->isFitToSize(); + } + + bool SdrTextAttribute::isHideContour() const + { + return mpSdrTextAttribute->isHideContour(); + } + + bool SdrTextAttribute::isBlink() const + { + return mpSdrTextAttribute->isBlink(); + } + + bool SdrTextAttribute::isScroll() const + { + return mpSdrTextAttribute->isScroll(); + } + + bool SdrTextAttribute::isInEditMode() const + { + return mpSdrTextAttribute->isInEditMode(); + } + + bool SdrTextAttribute::isFixedCellHeight() const + { + return mpSdrTextAttribute->isFixedCellHeight(); + } + + bool SdrTextAttribute::isWrongSpell() const + { + return mpSdrTextAttribute->isWrongSpell(); + } + + const SdrFormTextAttribute& SdrTextAttribute::getSdrFormTextAttribute() const + { + return mpSdrTextAttribute->getSdrFormTextAttribute(); + } + + sal_Int32 SdrTextAttribute::getTextLeftDistance() const + { + return mpSdrTextAttribute->getTextLeftDistance(); + } + + sal_Int32 SdrTextAttribute::getTextUpperDistance() const + { + return mpSdrTextAttribute->getTextUpperDistance(); + } + + sal_Int32 SdrTextAttribute::getTextRightDistance() const + { + return mpSdrTextAttribute->getTextRightDistance(); + } + + sal_Int32 SdrTextAttribute::getTextLowerDistance() const + { + return mpSdrTextAttribute->getTextLowerDistance(); + } + + sal_uInt32 SdrTextAttribute::getPropertiesVersion() const + { + return mpSdrTextAttribute->getPropertiesVersion(); + } + + SdrTextHorzAdjust SdrTextAttribute::getSdrTextHorzAdjust() const + { + return mpSdrTextAttribute->getSdrTextHorzAdjust(); + } + + SdrTextVertAdjust SdrTextAttribute::getSdrTextVertAdjust() const + { + return mpSdrTextAttribute->getSdrTextVertAdjust(); } void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const { if(isBlink()) { - mpSdrText->GetObject().impGetBlinkTextTiming(rAnimList); + getSdrText().GetObject().impGetBlinkTextTiming(rAnimList); } } @@ -217,7 +452,7 @@ namespace drawinglayer { if(isScroll()) { - mpSdrText->GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength); + getSdrText().GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength); } } } // end of namespace attribute diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx index f3c6ea732a..0f27d11090 100644 --- a/svx/source/sdr/contact/viewcontact.cxx +++ b/svx/source/sdr/contact/viewcontact.cxx @@ -280,7 +280,8 @@ namespace sdr DBG_ERROR("ViewContact::createViewIndependentPrimitive2DSequence(): Never call the fallback base implementation, this is always an error (!)"); const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(1000.0, 1000.0, 5000.0, 3000.0))); const basegfx::BColor aYellow(1.0, 1.0, 0.0); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow)); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow)); return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx index 948bab1b2f..afd4ce8815 100644 --- a/svx/source/sdr/contact/viewcontactofe3d.cxx +++ b/svx/source/sdr/contact/viewcontactofe3d.cxx @@ -37,10 +37,12 @@ #include #include #include -#include -#include #include #include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -128,13 +130,14 @@ namespace sdr // create embedded 2d primitive and add. LightNormal and ShadowSlant are needed for evtl. // 3D shadow extraction for correct B2DRange calculation (shadow is part of the object) - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::Embedded3DPrimitive2D( - rxContent3D, - pVCOfE3DScene->getObjectTransformation(), - aViewInformation3D, - aLightNormal, - fShadowSlant, - rAllContentRange)); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::Embedded3DPrimitive2D( + rxContent3D, + pVCOfE3DScene->getObjectTransformation(), + aViewInformation3D, + aLightNormal, + fShadowSlant, + rAllContentRange)); xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } @@ -179,9 +182,12 @@ namespace sdr if(!rObjectTransform.isIdentity()) { - const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::TransformPrimitive3D( - rObjectTransform, xRetval)); - return drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1); + const drawinglayer::primitive3d::Primitive3DReference xReference( + new drawinglayer::primitive3d::TransformPrimitive3D( + rObjectTransform, + xRetval)); + + xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1); } } diff --git a/svx/source/sdr/contact/viewcontactofe3dcube.cxx b/svx/source/sdr/contact/viewcontactofe3dcube.cxx index 8bde7b3c45..883c3e7faa 100644 --- a/svx/source/sdr/contact/viewcontactofe3dcube.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dcube.cxx @@ -58,16 +58,8 @@ namespace sdr { drawinglayer::primitive3d::Primitive3DSequence xRetval; const SfxItemSet& rItemSet = GetE3dCubeObj().GetMergedItemSet(); - drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false); - - // for 3D Objects, always create a primitive even when not visible. This is necessary ATM - // since e.g. chart geometries rely on the occupied space of non-visible objects - if(!pAttribute) - { - pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute( - impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)), - 0, 0, 0, 0); - } + const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false)); // get cube geometry and use as traslation and scaling for unit cube basegfx::B3DRange aCubeRange; @@ -100,13 +92,14 @@ namespace sdr const basegfx::B2DVector aTextureSize(aCubeSize.getX(), aCubeSize.getY()); // create primitive and add - const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrCubePrimitive3D(aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute)); + const drawinglayer::primitive3d::Primitive3DReference xReference( + new drawinglayer::primitive3d::SdrCubePrimitive3D( + aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute)); xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1); // delete 3D Object Attributes delete pSdr3DObjectAttribute; - delete pAttribute; - + return xRetval; } } // end of namespace contact diff --git a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx index 954b54396a..b042d58cb9 100644 --- a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx @@ -58,16 +58,8 @@ namespace sdr { drawinglayer::primitive3d::Primitive3DSequence xRetval; const SfxItemSet& rItemSet = GetE3dExtrudeObj().GetMergedItemSet(); - drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false); - - // for 3D Objects, always create a primitive even when not visible. This is necessary ATM - // since e.g. chart geometries rely on the occupied space of non-visible objects - if(!pAttribute) - { - pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute( - impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)), - 0, 0, 0, 0); - } + const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false)); // get extrude geometry const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dExtrudeObj().GetExtrudePolygon()); @@ -93,15 +85,15 @@ namespace sdr // create primitive and add const basegfx::B3DHomMatrix aWorldTransform; - const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrExtrudePrimitive3D( - aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute, - aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids, - bCharacterMode, bCloseFront, bCloseBack)); + const drawinglayer::primitive3d::Primitive3DReference xReference( + new drawinglayer::primitive3d::SdrExtrudePrimitive3D( + aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute, + aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids, + bCharacterMode, bCloseFront, bCloseBack)); xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1); // delete 3D Object Attributes delete pSdr3DObjectAttribute; - delete pAttribute; return xRetval; } diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx index 5ef516f9a0..026d25beff 100644 --- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx @@ -58,16 +58,8 @@ namespace sdr { drawinglayer::primitive3d::Primitive3DSequence xRetval; const SfxItemSet& rItemSet = GetE3dLatheObj().GetMergedItemSet(); - drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false); - - // for 3D Objects, always create a primitive even when not visible. This is necessary ATM - // since e.g. chart geometries rely on the occupied space of non-visible objects - if(!pAttribute) - { - pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute( - impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)), - 0, 0, 0, 0); - } + const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false)); // get extrude geometry const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dLatheObj().GetPolyPoly2D()); @@ -107,16 +99,16 @@ namespace sdr // create primitive and add const basegfx::B3DHomMatrix aWorldTransform; - const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrLathePrimitive3D( - aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute, - aPolyPolygon, nHorizontalSegments, nVerticalSegments, - fDiagonal, fBackScale, fRotation, - bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack)); + const drawinglayer::primitive3d::Primitive3DReference xReference( + new drawinglayer::primitive3d::SdrLathePrimitive3D( + aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute, + aPolyPolygon, nHorizontalSegments, nVerticalSegments, + fDiagonal, fBackScale, fRotation, + bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack)); xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1); // delete 3D Object Attributes delete pSdr3DObjectAttribute; - delete pAttribute; return xRetval; } diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx index e61c73c2d8..7b47e70cec 100644 --- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx @@ -60,23 +60,15 @@ namespace sdr drawinglayer::primitive3d::Primitive3DSequence xRetval; const SfxItemSet& rItemSet = GetE3dPolygonObj().GetMergedItemSet(); const bool bSuppressFill(GetE3dPolygonObj().GetLineOnly()); - drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill); - - // for 3D Objects, always create a primitive even when not visible. This is necessary ATM - // since e.g. chart geometries rely on the occupied space of non-visible objects - if(!pAttribute) - { - pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute( - impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)), - 0, 0, 0, 0); - } + const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill)); // get extrude geometry basegfx::B3DPolyPolygon aPolyPolygon3D(GetE3dPolygonObj().GetPolyPolygon3D()); const basegfx::B3DPolyPolygon aPolyNormals3D(GetE3dPolygonObj().GetPolyNormals3D()); const basegfx::B2DPolyPolygon aPolyTexture2D(GetE3dPolygonObj().GetPolyTexture2D()); - const bool bNormals(aPolyNormals3D.count() && aPolyNormals3D.count() == aPolyPolygon3D.count()); - const bool bTexture(aPolyTexture2D.count() && aPolyTexture2D.count() == aPolyPolygon3D.count()); + const bool bNormals(aPolyNormals3D.count() && aPolyNormals3D.count() == aPolyPolygon3D.count()); + const bool bTexture(aPolyTexture2D.count() && aPolyTexture2D.count() == aPolyPolygon3D.count()); if(bNormals || bTexture) { @@ -181,13 +173,13 @@ namespace sdr // create primitive and add const basegfx::B3DHomMatrix aWorldTransform; - const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D( - aPolyPolygon3D, aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute)); + const drawinglayer::primitive3d::Primitive3DReference xReference( + new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D( + aPolyPolygon3D, aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute)); xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1); // delete 3D Object Attributes delete pSdr3DObjectAttribute; - delete pAttribute; return xRetval; } diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx index cf5768910f..c267508755 100644 --- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx @@ -41,11 +41,11 @@ #include #include #include -#include #include #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -167,21 +167,13 @@ namespace sdr ViewContactOfE3dScene::ViewContactOfE3dScene(E3dScene& rScene) : ViewContactOfSdrObj(rScene), - mpViewInformation3D(0), - mpObjectTransformation(0), - mpSdrSceneAttribute(0), - mpSdrLightingAttribute(0) + maViewInformation3D(), + maObjectTransformation(), + maSdrSceneAttribute(), + maSdrLightingAttribute() { } - ViewContactOfE3dScene::~ViewContactOfE3dScene() - { - delete mpViewInformation3D; - delete mpObjectTransformation; - delete mpSdrSceneAttribute; - delete mpSdrLightingAttribute; - } - void ViewContactOfE3dScene::createViewInformation3D(const basegfx::B3DRange& rContentRange) { basegfx::B3DHomMatrix aTransformation; @@ -265,34 +257,36 @@ namespace sdr } const uno::Sequence< beans::PropertyValue > aEmptyProperties; - mpViewInformation3D = new drawinglayer::geometry::ViewInformation3D(aTransformation, aOrientation, aProjection, aDeviceToView, 0.0, aEmptyProperties); + maViewInformation3D = drawinglayer::geometry::ViewInformation3D( + aTransformation, aOrientation, aProjection, + aDeviceToView, 0.0, aEmptyProperties); } void ViewContactOfE3dScene::createObjectTransformation() { // create 2d Object Transformation from relative point in 2d scene to world - mpObjectTransformation = new basegfx::B2DHomMatrix; const Rectangle& rRectangle = GetE3dScene().GetSnapRect(); - mpObjectTransformation->set(0, 0, rRectangle.getWidth()); - mpObjectTransformation->set(1, 1, rRectangle.getHeight()); - mpObjectTransformation->set(0, 2, rRectangle.Left()); - mpObjectTransformation->set(1, 2, rRectangle.Top()); + maObjectTransformation.set(0, 0, rRectangle.getWidth()); + maObjectTransformation.set(1, 1, rRectangle.getHeight()); + maObjectTransformation.set(0, 2, rRectangle.Left()); + maObjectTransformation.set(1, 2, rRectangle.Top()); } void ViewContactOfE3dScene::createSdrSceneAttribute() { const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet(); - mpSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet); + maSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet); } void ViewContactOfE3dScene::createSdrLightingAttribute() { const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet(); - mpSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet); + maSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet); } - drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const + drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence( + const SetOfByte* pLayerVisibility) const { drawinglayer::primitive2d::Primitive2DSequence xRetval; const sal_uInt32 nChildrenCount(GetObjectCount()); @@ -332,19 +326,27 @@ namespace sdr // on identity and the time on 0.0. const uno::Sequence< beans::PropertyValue > aEmptyProperties; const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties); - const basegfx::B3DRange aContentRange(drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D)); + const basegfx::B3DRange aContentRange( + drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D)); // create 2d primitive 3dscene with generated sub-list from collector - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ScenePrimitive2D( - bTestVisibility ? aVisibleSequence : aAllSequence, - getSdrSceneAttribute(), - getSdrLightingAttribute(), - getObjectTransformation(), - getViewInformation3D(aContentRange))); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::ScenePrimitive2D( + bTestVisibility ? aVisibleSequence : aAllSequence, + getSdrSceneAttribute(), + getSdrLightingAttribute(), + getObjectTransformation(), + getViewInformation3D(aContentRange))); + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } + // always append an invisible outline for the cases where no visible content exists + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, getObjectTransformation())); + return xRetval; } @@ -358,27 +360,7 @@ namespace sdr xRetval = createScenePrimitive2DSequence(0); } - if(xRetval.hasElements()) - { - return xRetval; - } - else - { - // create a gray placeholder hairline polygon in object size as empty 3D scene marker. Use object size - // model information directly, NOT getBoundRect()/getSnapRect() since these will - // be using the geometry data we get just asked for. AFAIK for empty 3D Scenes, the model data - // is SdrObject::aOutRect which i can access directly using GetLastBoundRect() here - const Rectangle aEmptySceneGeometry(GetE3dScene().GetLastBoundRect()); - const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange( - aEmptySceneGeometry.Left(), aEmptySceneGeometry.Top(), - aEmptySceneGeometry.Right(), aEmptySceneGeometry.Bottom()))); - const double fGrayTone(0xc0 / 255.0); - const basegfx::BColor aGrayTone(fGrayTone, fGrayTone, fGrayTone); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone)); - - // The replacement object may also get a text like 'empty 3D Scene' here later - return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } + return xRetval; } void ViewContactOfE3dScene::ActionChanged() @@ -387,22 +369,15 @@ namespace sdr ViewContactOfSdrObj::ActionChanged(); // mark locally cached values as invalid - delete mpViewInformation3D; - mpViewInformation3D = 0; - - delete mpObjectTransformation; - mpObjectTransformation = 0; - - delete mpSdrSceneAttribute; - mpSdrSceneAttribute = 0; - - delete mpSdrLightingAttribute; - mpSdrLightingAttribute = 0; + maViewInformation3D = drawinglayer::geometry::ViewInformation3D(); + maObjectTransformation.identity(); + maSdrSceneAttribute = drawinglayer::attribute::SdrSceneAttribute(); + maSdrLightingAttribute = drawinglayer::attribute::SdrLightingAttribute(); } const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D() const { - if(!mpViewInformation3D) + if(maViewInformation3D.isDefault()) { // this version will create the content range on demand locally and thus is less // performant than the other one. Since the information is buffered the planned @@ -421,47 +396,47 @@ namespace sdr const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(aContentRange); } - return *mpViewInformation3D; + return maViewInformation3D; } const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D(const basegfx::B3DRange& rContentRange) const { - if(!mpViewInformation3D) + if(maViewInformation3D.isDefault()) { const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(rContentRange); } - return *mpViewInformation3D; + return maViewInformation3D; } const basegfx::B2DHomMatrix& ViewContactOfE3dScene::getObjectTransformation() const { - if(!mpObjectTransformation) + if(maObjectTransformation.isIdentity()) { const_cast < ViewContactOfE3dScene* >(this)->createObjectTransformation(); } - return *mpObjectTransformation; + return maObjectTransformation; } const drawinglayer::attribute::SdrSceneAttribute& ViewContactOfE3dScene::getSdrSceneAttribute() const { - if(!mpSdrSceneAttribute) + if(maSdrSceneAttribute.isDefault()) { const_cast < ViewContactOfE3dScene* >(this)->createSdrSceneAttribute(); } - return *mpSdrSceneAttribute; + return maSdrSceneAttribute; } const drawinglayer::attribute::SdrLightingAttribute& ViewContactOfE3dScene::getSdrLightingAttribute() const { - if(!mpSdrLightingAttribute) + if(maSdrLightingAttribute.isDefault()) { const_cast < ViewContactOfE3dScene* >(this)->createSdrLightingAttribute(); } - return *mpSdrLightingAttribute; + return maSdrLightingAttribute; } drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3dScene::getAllPrimitive3DSequence() const diff --git a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx index 8dad4c0d93..5603a7da1b 100644 --- a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx @@ -57,16 +57,8 @@ namespace sdr { drawinglayer::primitive3d::Primitive3DSequence xRetval; const SfxItemSet& rItemSet = GetE3dSphereObj().GetMergedItemSet(); - drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false); - - // for 3D Objects, always create a primitive even when not visible. This is necessary ATM - // since e.g. chart geometries rely on the occupied space of non-visible objects - if(!pAttribute) - { - pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute( - impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)), - 0, 0, 0, 0); - } + const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false)); // get sphere center and size for geometry basegfx::B3DRange aSphereRange; @@ -92,14 +84,14 @@ namespace sdr F_PI2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d // create primitive and add - const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrSpherePrimitive3D( - aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute, - nHorizontalSegments, nVerticalSegments)); + const drawinglayer::primitive3d::Primitive3DReference xReference( + new drawinglayer::primitive3d::SdrSpherePrimitive3D( + aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute, + nHorizontalSegments, nVerticalSegments)); xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1); // delete 3D Object Attributes delete pSdr3DObjectAttribute; - delete pAttribute; return xRetval; } diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index b2340f94e1..dcd06915be 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -42,7 +41,6 @@ #endif #include -#include #include #include #include @@ -62,6 +60,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -151,10 +150,9 @@ namespace sdr * aSmallerMatrix; const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false); - const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0); const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D( aSmallerMatrix, - aEmptyAttributes, + drawinglayer::attribute::SdrLineFillShadowTextAttribute(), rGraphicObject, rLocalGrafInfo)); @@ -180,14 +178,12 @@ namespace sdr aEmptyGraphicAttr)); xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1); - if(!rAttribute.getLine()) + if(rAttribute.getLine().isDefault()) { // create a surrounding frame when no linestyle given const Color aColor(Application::GetSettings().GetStyleSettings().GetShadowColor()); const basegfx::BColor aBColor(aColor.getBColor()); - const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0); - - basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange)); + basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon()); aOutline.transform(rObjectMatrix); drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, @@ -317,127 +313,123 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createViewIndependentPrimitive2DSequence() const { drawinglayer::primitive2d::Primitive2DSequence xRetval; - SdrText* pSdrText = GetGrafObject().getText(0); - - if(pSdrText) + const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet(); + drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + GetGrafObject().getText(0))); + + // create and fill GraphicAttr + GraphicAttr aLocalGrafInfo; + const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue()); + const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP)); + aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue()); + aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue()); + aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue()); + aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue()); + aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue()); + aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01); + aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55)); + aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue()); + aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue()); + aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom()); + + if(aAttribute.isDefault() && 255L != aLocalGrafInfo.GetTransparency()) { - const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet(); - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = - drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); - bool bVisible(pAttribute && pAttribute->isVisible()); - - // create and fill GraphicAttr - GraphicAttr aLocalGrafInfo; - const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue()); - const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP)); - aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue()); - aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue()); - aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue()); - aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue()); - aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue()); - aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01); - aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55)); - aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue()); - aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue()); - aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom()); - - if(!bVisible && 255L != aLocalGrafInfo.GetTransparency()) + // no fill, no line, no text (invisible), but the graphic content is visible. + // Create evtl. shadow for content which was not created by createNewSdrLineFillShadowTextAttribute yet + const drawinglayer::attribute::SdrShadowAttribute aShadow( + drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet)); + + if(!aShadow.isDefault()) { - // content is visible, so force some fill stuff - delete pAttribute; - bVisible = true; + // create new attribute set if indeed shadow is used + aAttribute = drawinglayer::attribute::SdrLineFillShadowTextAttribute( + aAttribute.getLine(), + aAttribute.getFill(), + aAttribute.getLineStartEnd(), + aShadow, + aAttribute.getFillFloatTransGradient(), + aAttribute.getText()); + } + } - // check shadow - drawinglayer::attribute::SdrShadowAttribute* pShadow = drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet); + // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect() + // 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()); + + // look for mirroring + const GeoStat& rGeoStat(GetGrafObject().GetGeoStat()); + const sal_Int32 nDrehWink(rGeoStat.nDrehWink); + const bool bRota180(18000 == nDrehWink); + const bool bMirrored(GetGrafObject().IsMirrored()); + const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1)); + bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase)); + bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase)); + + // set mirror flags at LocalGrafInfo. Take into account that the geometry in + // aObjectRange is already changed and rotated when bRota180 is used. To rebuild + // that old behaviour (as long as part of the model data), correct the H/V flags + // accordingly. The created bitmapPrimitive WILL use the rotation, too. + if(bRota180) + { + // if bRota180 which is used for vertical mirroring, the graphic will already be rotated + // by 180 degrees. To correct, switch off VMirror and invert HMirroring. + bHMirr = !bHMirr; + bVMirr = false; + } - if(pShadow && !pShadow->isVisible()) - { - delete pShadow; - pShadow = 0L; - } + if(bHMirr || bVMirr) + { + aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0)); + } - // create new attribute set - pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0L, 0L, 0L, pShadow, 0L, 0L); - } + // 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); + const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), + fShearX, fRotate, + aObjectRange.getMinX(), aObjectRange.getMinY())); - if(pAttribute) - { - if(pAttribute->isVisible() || bVisible) - { - // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect() - // 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()); - - // look for mirroring - const GeoStat& rGeoStat(GetGrafObject().GetGeoStat()); - const sal_Int32 nDrehWink(rGeoStat.nDrehWink); - const bool bRota180(18000 == nDrehWink); - const bool bMirrored(GetGrafObject().IsMirrored()); - const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1)); - bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase)); - bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase)); - - // set mirror flags at LocalGrafInfo. Take into account that the geometry in - // aObjectRange is already changed and rotated when bRota180 is used. To rebuild - // that old behaviour (as long as part of the model data), correct the H/V flags - // accordingly. The created bitmapPrimitive WILL use the rotation, too. - if(bRota180) - { - // if bRota180 which is used for vertical mirroring, the graphic will already be rotated - // by 180 degrees. To correct, switch off VMirror and invert HMirroring. - bHMirr = !bHMirr; - bVMirr = false; - } - - if(bHMirr || bVMirr) - { - aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0)); - } - - // 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); - 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); - - if(visualisationUsesPresObj()) - { - // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one - // with the content which is the placeholder graphic - xRetval = createVIP2DSForPresObj(aObjectMatrix, *pAttribute, aLocalGrafInfo); - } - else if(visualisationUsesDraft()) - { - // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism - // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious - // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent - // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster - // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages - xRetval = createVIP2DSForDraft(aObjectMatrix, *pAttribute); - } - else - { - // create primitive. Info: Calling the copy-constructor of GraphicObject in this - // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D( - aObjectMatrix, - *pAttribute, - rGraphicObject, - aLocalGrafInfo)); - - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - } - - delete pAttribute; - } + // get the current, unchenged graphic obect from SdrGrafObj + const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false); + + if(visualisationUsesPresObj()) + { + // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one + // with the content which is the placeholder graphic + xRetval = createVIP2DSForPresObj(aObjectMatrix, aAttribute, aLocalGrafInfo); + } + else if(visualisationUsesDraft()) + { + // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism + // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious + // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent + // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster + // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages + xRetval = createVIP2DSForDraft(aObjectMatrix, aAttribute); } + else + { + // create primitive. Info: Calling the copy-constructor of GraphicObject in this + // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic + const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D( + aObjectMatrix, + aAttribute, + rGraphicObject, + aLocalGrafInfo)); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + + // always append an invisible outline for the cases where no visible content exists + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, aObjectMatrix)); return xRetval; } diff --git a/svx/source/sdr/contact/viewcontactofgroup.cxx b/svx/source/sdr/contact/viewcontactofgroup.cxx index 5c5e6edc48..51599ea88f 100644 --- a/svx/source/sdr/contact/viewcontactofgroup.cxx +++ b/svx/source/sdr/contact/viewcontactofgroup.cxx @@ -39,6 +39,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -81,25 +82,22 @@ namespace sdr drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, aCandSeq); } } - - if(xRetval.hasElements()) - { - return xRetval; - } else { - // create a gray placeholder hairline polygon in object size. Use the model data directly. For empty groups, - // this is SdrObject::aOutRect, as can be seen in SdrObjGroup::GetSnapRect(). Access that using GetLastBoundRect() - // to not execute anything. + // append an invisible outline for the cases where no visible content exists const Rectangle aCurrentBoundRect(GetSdrObjGroup().GetLastBoundRect()); - const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange( - aCurrentBoundRect.Left(), aCurrentBoundRect.Top(), aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom()))); - const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone)); + const basegfx::B2DRange aCurrentRange( + aCurrentBoundRect.Left(), aCurrentBoundRect.Top(), + aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom()); + + const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, aCurrentRange)); - // The replacement object may also get a text like 'empty group' here later - return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } + + return xRetval; } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx index 0b7d9d7572..4e526b4239 100644 --- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx @@ -41,12 +41,14 @@ #include #include #include -#include #include #include #include #include #include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -68,26 +70,27 @@ namespace sdr { // build primitive from pBackgroundCandidate's attributes const SfxItemSet& rFillProperties = pBackgroundCandidate->GetMergedItemSet(); - drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties); + const drawinglayer::attribute::SdrFillAttribute aFill( + drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties)); - if(pFill) + if(!aFill.isDefault()) { - if(pFill->isVisible()) - { - // direct model data is the page size, get and use it - const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage(); - const basegfx::B2DRange aInnerRange( - rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(), - rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder()); - const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); - const basegfx::B2DHomMatrix aEmptyTransform; - const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive( - basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill)); - - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - - delete pFill; + // direct model data is the page size, get and use it + const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage(); + const basegfx::B2DRange aInnerRange( + rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(), + rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), + rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder()); + const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); + const basegfx::B2DHomMatrix aEmptyTransform; + const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aInnerPolgon), + aEmptyTransform, + aFill, + drawinglayer::attribute::FillGradientAttribute())); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index 6dcd211856..a040c7c310 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -70,107 +69,108 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence xRetval; const SdrCaptionObj& rCaptionObj(GetCaptionObj()); const SfxItemSet& rItemSet = rCaptionObj.GetMergedItemSet(); - SdrText* pSdrText = rCaptionObj.getText(0); - - if(pSdrText) + const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + rCaptionObj.getText(0))); + + // take unrotated snap rect (direct model data) for position and size + const Rectangle& rRectangle = rCaptionObj.GetGeoRect(); + const ::basegfx::B2DRange aObjectRange( + rRectangle.Left(), rRectangle.Top(), + rRectangle.Right(), rRectangle.Bottom()); + const GeoStat& rGeoStat(rCaptionObj.GetGeoStat()); + + // fill object matrix + 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; + double fCornerRadiusY; + drawinglayer::primitive2d::calculateRelativeCornerRadius( + rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY); + + // create primitive. Always create one (even if invisible) to let the decomposition + // of SdrCaptionPrimitive2D create needed invisible elements for HitTest and BoundRect + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrCaptionPrimitive2D( + aObjectMatrix, + aAttribute, + rCaptionObj.getTailPolygon(), + fCornerRadiusX, + fCornerRadiusY)); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + + if(!aAttribute.isDefault() && rCaptionObj.GetSpecialTextBoxShadow()) { - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); - - if(pAttribute) + // for SC, the caption object may have a specialized shadow. The usual object shadow is off + // and a specialized shadow gets created here (see old paint) + const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR)); + const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue()); + const Color aShadCol(rShadColItem.GetColorValue()); + const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue(); + + // Create own ItemSet and modify as needed + // Always hide lines for special calc shadow + SfxItemSet aSet(rItemSet); + aSet.Put(XLineStyleItem(XLINE_NONE)); + + if(XFILL_HATCH == eStyle) + { + // #41666# Hatch color is set hard to shadow color + XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue(); + aHatch.SetColor(aShadCol); + aSet.Put(XFillHatchItem(String(),aHatch)); + } + else { - if(pAttribute->isVisible()) + if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle) { - // take unrotated snap rect (direct model data) for position and size - const Rectangle& rRectangle = rCaptionObj.GetGeoRect(); - const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); - const GeoStat& rGeoStat(rCaptionObj.GetGeoStat()); - - // fill object matrix - 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; - double fCornerRadiusY; - drawinglayer::primitive2d::calculateRelativeCornerRadius(rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY); - - // create primitive - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCaptionPrimitive2D( - aObjectMatrix, *pAttribute, rCaptionObj.getTailPolygon(), fCornerRadiusX, fCornerRadiusY)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - - if(rCaptionObj.GetSpecialTextBoxShadow()) - { - // for SC, the caption object may have a specialized shadow. The usual object shadow is off - // and a specialized shadow gets created here (see old paint) - const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR)); - const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue()); - const Color aShadCol(rShadColItem.GetColorValue()); - const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue(); - - // Create own ItemSet and modify as needed - // Always hide lines for special calc shadow - SfxItemSet aSet(rItemSet); - aSet.Put(XLineStyleItem(XLINE_NONE)); - - if(XFILL_HATCH == eStyle) - { - // #41666# Hatch color is set hard to shadow color - XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue(); - aHatch.SetColor(aShadCol); - aSet.Put(XFillHatchItem(String(),aHatch)); - } - else - { - if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle) - { - // force fill to solid (for Gradient and Bitmap) - aSet.Put(XFillStyleItem(XFILL_SOLID)); - } - - aSet.Put(XFillColorItem(String(),aShadCol)); - aSet.Put(XFillTransparenceItem(nTransp)); - } - - // crete FillAttribute from modified ItemSet - drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(aSet); - drawinglayer::primitive2d::Primitive2DReference xSpecialShadow; - - if(pFill) - { - if(pFill->isVisible()) - { - // add shadow offset to object matrix - const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue()); - const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue()); - aObjectMatrix.translate(nXDist, nYDist); - - // 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 - xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), aObjectMatrix, *pFill); - } - - delete pFill; - } - - if(xSpecialShadow.is()) - { - // if we really got a special shadow, create a two-element retval with the shadow - // behind the standard object's geometry - xRetval.realloc(2); - - xRetval[0] = xSpecialShadow; - xRetval[1] = xReference; - } - } + // force fill to solid (for Gradient and Bitmap) + aSet.Put(XFillStyleItem(XFILL_SOLID)); } - delete pAttribute; + aSet.Put(XFillColorItem(String(),aShadCol)); + aSet.Put(XFillTransparenceItem(nTransp)); + } + + // crete FillAttribute from modified ItemSet + const drawinglayer::attribute::SdrFillAttribute aFill( + drawinglayer::primitive2d::createNewSdrFillAttribute(aSet)); + drawinglayer::primitive2d::Primitive2DReference xSpecialShadow; + + if(!aFill.isDefault() && 1.0 != aFill.getTransparence()) + { + // add shadow offset to object matrix + const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue()); + const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue()); + aObjectMatrix.translate(nXDist, nYDist); + + // 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 + xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + aObjectMatrix, + aFill, + drawinglayer::attribute::FillGradientAttribute()); + } + + if(xSpecialShadow.is()) + { + // if we really got a special shadow, create a two-element retval with the shadow + // behind the standard object's geometry + xRetval.realloc(2); + + xRetval[0] = xSpecialShadow; + xRetval[1] = xReference; } } diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index eaaacd849c..ff2f5b945e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -58,56 +57,62 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrCircObj::createViewIndependentPrimitive2DSequence() const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; const SfxItemSet& rItemSet = GetCircObj().GetMergedItemSet(); - SdrText* pSdrText = GetCircObj().getText(0); + const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + GetCircObj().getText(0))); - if(pSdrText) - { - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); - - if(pAttribute) - { - if(pAttribute->isVisible()) - { - // take unrotated snap rect (direct model data) for position and size - const Rectangle& rRectangle = GetCircObj().GetGeoRect(); - const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); - const GeoStat& rGeoStat(GetCircObj().GetGeoStat()); - - // fill object matrix - 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())); + // take unrotated snap rect (direct model data) for position and size + const Rectangle& rRectangle = GetCircObj().GetGeoRect(); + const basegfx::B2DRange aObjectRange( + rRectangle.Left(), rRectangle.Top(), + rRectangle.Right(), rRectangle.Bottom()); + const GeoStat& rGeoStat(GetCircObj().GetGeoStat()); - // create primitive data - const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier()); + // fill object matrix + 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())); - if(OBJ_CIRC == nIdentifier) - { - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipsePrimitive2D(aObjectMatrix, *pAttribute)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - else - { - const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue()); - const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue()); - const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000); - const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000); - const bool bCloseSegment(OBJ_CARC != nIdentifier); - const bool bCloseUsingCenter(OBJ_SECT == nIdentifier); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(aObjectMatrix, *pAttribute, fStart, fEnd, bCloseSegment, bCloseUsingCenter)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - } + // create primitive data + const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier()); - delete pAttribute; - } + // always create primitives to allow the decomposition of SdrEllipsePrimitive2D + // or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest + // and/or BoundRect + if(OBJ_CIRC == nIdentifier) + { + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrEllipsePrimitive2D( + aObjectMatrix, + aAttribute)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } + else + { + const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue()); + const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue()); + const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000); + const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000); + const bool bCloseSegment(OBJ_CARC != nIdentifier); + const bool bCloseUsingCenter(OBJ_SECT == nIdentifier); - return xRetval; + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D( + aObjectMatrix, + aAttribute, + fStart, + fEnd, + bCloseSegment, + bCloseUsingCenter)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx index 54da961623..132698916c 100644 --- a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include ////////////////////////////////////////////////////////////////////////////// @@ -55,35 +54,27 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrEdgeObj::createViewIndependentPrimitive2DSequence() const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; - ::basegfx::B2DPolygon aEdgeTrack(GetEdgeObj().getEdgeTrack()); + const basegfx::B2DPolygon& rEdgeTrack = GetEdgeObj().getEdgeTrack(); - // base visualisation on EdgeTrack - if(aEdgeTrack.count()) - { - // ckeck attributes - const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet(); - SdrText* pSdrText = GetEdgeObj().getText(0); + // what to do when no EdgeTrack is provided (HitTest and selectability) ? + OSL_ENSURE(0 != rEdgeTrack.count(), "Connectors with no geometry are not allowed (!)"); - if(pSdrText) - { - drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText); + // ckeck attributes + const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet(); + const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute( + rItemSet, + GetEdgeObj().getText(0))); - if(pAttribute) - { - if(pAttribute->isVisible()) - { - // create primitive - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrConnectorPrimitive2D(*pAttribute, aEdgeTrack)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } + // create primitive. Always create primitives to allow the decomposition of + // SdrConnectorPrimitive2D to create needed invisible elements for HitTest + // and/or BoundRect + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrConnectorPrimitive2D( + aAttribute, + rEdgeTrack)); - delete pAttribute; - } - } - } - - return xRetval; + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx index 9012768fcb..01d1a9b901 100644 --- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -61,91 +60,85 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrMeasureObj::createViewIndependentPrimitive2DSequence() const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; const SfxItemSet& rItemSet = GetMeasureObj().GetMergedItemSet(); - SdrText* pSdrText = GetMeasureObj().getText(0); + const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute( + rItemSet, + GetMeasureObj().getText(0))); - if(pSdrText) - { - drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText); + // take properties which are the model data. + const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y()); + const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y()); + const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue()); + const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue()); + const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue()); + const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue()); + const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue()); + const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue()); + const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue()); + const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue()); + drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC); + drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC); - if(pAttribute) + switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue()) + { + case SDRMEASURE_TEXTLEFTOUTSIDE : { - if(pAttribute->isVisible()) - { - // take properties which are the model data. - const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y()); - const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y()); - const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue()); - const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue()); - const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue()); - const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue()); - const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue()); - const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue()); - const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue()); - const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue()); - drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC); - drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC); - - switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue()) - { - case SDRMEASURE_TEXTLEFTOUTSIDE : - { - aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE; - break; - } - case SDRMEASURE_TEXTINSIDE : - { - aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED; - break; - } - case SDRMEASURE_TEXTRIGHTOUTSIDE : - { - aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE; - break; - } - default : // SDRMEASURE_TEXTHAUTO - { - break; - } - } - - switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue()) - { - case SDRMEASURE_ABOVE : - { - aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE; - break; - } - case SDRMEASURETEXT_BREAKEDLINE : - case SDRMEASURETEXT_VERTICALCENTERED : - { - aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED; - break; - } - case SDRMEASURE_BELOW : - { - aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE; - break; - } - default : // SDRMEASURE_TEXTVAUTO - { - break; - } - } - - // create primitive with the model data - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrMeasurePrimitive2D(*pAttribute, - aStart, aEnd, aMTPHor, aMTPVer, fDistance, fUpperDistance, fLowerDistance, fLeftDelta, fRightDelta, - bBelow, bTextRotation, bTextAutoAngle)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } + aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE; + break; + } + case SDRMEASURE_TEXTINSIDE : + { + aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED; + break; + } + case SDRMEASURE_TEXTRIGHTOUTSIDE : + { + aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE; + break; + } + default : // SDRMEASURE_TEXTHAUTO + { + break; + } + } - delete pAttribute; + switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue()) + { + case SDRMEASURE_ABOVE : + { + aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE; + break; + } + case SDRMEASURETEXT_BREAKEDLINE : + case SDRMEASURETEXT_VERTICALCENTERED : + { + aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED; + break; + } + case SDRMEASURE_BELOW : + { + aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE; + break; + } + default : // SDRMEASURE_TEXTVAUTO + { + break; } } - return xRetval; + // create primitive with the model data. Always create primitives to allow the + // decomposition of SdrMeasurePrimitive2D to create needed invisible elements for HitTest + // and/or BoundRect + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrMeasurePrimitive2D( + aAttribute, aStart, aEnd, + aMTPHor, aMTPVer, fDistance, + fUpperDistance, fLowerDistance, + fLeftDelta, fRightDelta, bBelow, + bTextRotation, bTextAutoAngle)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx index b9cf4e0a9b..1909b1bdf1 100644 --- a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx @@ -157,7 +157,9 @@ namespace sdr // create range using the model data directly. This is in SdrTextObj::aRect which i will access using // GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM. const Rectangle& rRectangle(GetSdrMediaObj().GetGeoRect()); - const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + const basegfx::B2DRange aRange( + rRectangle.Left(), rRectangle.Top(), + rRectangle.Right(), rRectangle.Bottom()); // create object transform basegfx::B2DHomMatrix aTransform; @@ -166,12 +168,15 @@ namespace sdr aTransform.set(0, 2, aRange.getMinX()); aTransform.set(1, 2, aRange.getMinY()); - // create media primitive + // create media primitive. Always create primitives to allow the + // decomposition of MediaPrimitive2D to create needed invisible elements for HitTest + // and/or BoundRect const basegfx::BColor aBackgroundColor(67.0 / 255.0, 67.0 / 255.0, 67.0 / 255.0); const rtl::OUString& rURL(GetSdrMediaObj().getURL()); const sal_uInt32 nPixelBorder(4L); - const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::MediaPrimitive2D( - aTransform, rURL, aBackgroundColor, nPixelBorder)); + const drawinglayer::primitive2d::Primitive2DReference xRetval( + new drawinglayer::primitive2d::MediaPrimitive2D( + aTransform, rURL, aBackgroundColor, nPixelBorder)); return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1); } diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index e07f6b4d37..9492427862 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -34,13 +34,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -121,126 +121,121 @@ namespace sdr { drawinglayer::primitive2d::Primitive2DSequence xRetval; const SfxItemSet& rItemSet = GetCustomShapeObj().GetMergedItemSet(); - SdrText* pSdrText = GetCustomShapeObj().getText(0); - if(pSdrText) - { - // #i98072# Get shandow and text; eventually suppress the text if it's - // a TextPath FontworkGallery object - drawinglayer::attribute::SdrShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrShadowTextAttribute( + // #i98072# Get shandow and text; eventually suppress the text if it's + // a TextPath FontworkGallery object + const drawinglayer::attribute::SdrShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrShadowTextAttribute( rItemSet, - *pSdrText, - GetCustomShapeObj().IsTextPath()); - drawinglayer::primitive2d::Primitive2DSequence xGroup; - bool bHasText(pAttribute && pAttribute->getText()); + GetCustomShapeObj().getText(0), + GetCustomShapeObj().IsTextPath())); + drawinglayer::primitive2d::Primitive2DSequence xGroup; + bool bHasText(!aAttribute.getText().isDefault()); - // create Primitive2DSequence from sub-geometry - const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape(); - bool b3DShape(false); + // create Primitive2DSequence from sub-geometry + const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape(); + bool b3DShape(false); - if(pSdrObjRepresentation) + if(pSdrObjRepresentation) + { + SdrObjListIter aIterator(*pSdrObjRepresentation); + + while(aIterator.IsMore()) { - SdrObjListIter aIterator(*pSdrObjRepresentation); - - while(aIterator.IsMore()) - { - SdrObject& rCandidate = *aIterator.Next(); + SdrObject& rCandidate = *aIterator.Next(); - if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate)) - { - b3DShape = true; - } - - const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence()); - drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew); + if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate)) + { + b3DShape = true; } + + const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence()); + drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew); } + } + + if(bHasText || xGroup.hasElements()) + { + // prepare text box geometry + basegfx::B2DHomMatrix aTextBoxMatrix; + bool bWordWrap(false); - if(bHasText || xGroup.hasElements()) + if(bHasText) { - // prepare text box geometry - basegfx::B2DHomMatrix aTextBoxMatrix; - bool bWordWrap(false); + // take unrotated snap rect as default, then get the + // unrotated text box. Rotation needs to be done centered + const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect()); + const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom()); - if(bHasText) - { - // take unrotated snap rect as default, then get the - // unrotated text box. Rotation needs to be done centered - const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect()); - const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom()); + // #i101684# get the text range unrotated and absolute to the object range + const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect()); - // #i101684# get the text range unrotated and absolute to the object range - const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect()); + // give text object a size + aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight()); - // give text object a size - aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight()); + // check if we have a rotation/shear at all to take care of + const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation()); + const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat()); - // check if we have a rotation/shear at all to take care of - const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation()); - const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat()); + if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation)) + { + if(aObjectRange != aTextRange) + { + // move relative to unrotated object range + aTextBoxMatrix.translate( + aTextRange.getMinX() - aObjectRange.getMinimum().getX(), + aTextRange.getMinY() - aObjectRange.getMinimum().getY()); + } - if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation)) + if(rGeoStat.nShearWink) { - if(aObjectRange != aTextRange) - { - // move relative to unrotated object range - aTextBoxMatrix.translate( - aTextRange.getMinX() - aObjectRange.getMinimum().getX(), - aTextRange.getMinY() - aObjectRange.getMinimum().getY()); - } - - if(rGeoStat.nShearWink) - { - aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); - } - - if(rGeoStat.nDrehWink) - { - aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); - } - - if(!basegfx::fTools::equalZero(fExtraTextRotation)) - { - aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); - } - - // give text it's target position - aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); + aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); } - else + + if(rGeoStat.nDrehWink) { - aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY()); + aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); } - // check if SdrTextWordWrapItem is set - bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue(); - } + if(!basegfx::fTools::equalZero(fExtraTextRotation)) + { + aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); + } - // make sure a (even empty) SdrShadowTextAttribute exists for - // primitive creation - if(!pAttribute) + // give text it's target position + aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); + } + else { - pAttribute = new drawinglayer::attribute::SdrShadowTextAttribute(0L, 0L); + aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY()); } - // create primitive - 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); + // check if SdrTextWordWrapItem is set + bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue(); } - if(pAttribute) - { - delete pAttribute; - } + // create primitive + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrCustomShapePrimitive2D( + aAttribute, + xGroup, + aTextBoxMatrix, + bWordWrap, + b3DShape, + false)); // #SJ# New parameter to force to clipped BlockText for SC + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } + // always append an invisible outline for the cases where no visible content exists + const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect()); + const basegfx::B2DRange aObjectRange( + aObjectBound.Left(), aObjectBound.Top(), + aObjectBound.Right(), aObjectBound.Bottom()); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, aObjectRange)); + return xRetval; } } // end of namespace contact diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 0038b7ea85..ca0735d93b 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -76,59 +75,51 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters( bool bHighContrast) const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; - SdrText* pSdrText = GetOle2Obj().getText(0); - - if(pSdrText) - { - // take unrotated snap rect (direct model data) for position and size - const Rectangle& rRectangle = GetOle2Obj().GetGeoRect(); - const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); - - // create object matrix - 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); - 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(); - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); - - if(!pAttribute) - { - // force existence, even when not visible - pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0, 0, 0, 0, 0, 0); - } - - // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing - // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect - // calculations without OLE Graphic access (which may trigger e.g. chart recalculation). - // It will also take care of HighContrast and ScaleContent - const drawinglayer::primitive2d::Primitive2DReference xOleContent( - new drawinglayer::primitive2d::SdrOleContentPrimitive2D( - GetOle2Obj(), - aObjectMatrix, - - // #i104867# add GraphicVersion number to be able to check for - // content change in the primitive later - GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(), - - bHighContrast)); - - // create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways. - const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrOle2Primitive2D( + // take unrotated snap rect (direct model data) for position and size + const Rectangle& rRectangle = GetOle2Obj().GetGeoRect(); + const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + + // create object matrix + 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); + 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(); + const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + GetOle2Obj().getText(0))); + + // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing + // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect + // calculations without OLE Graphic access (which may trigger e.g. chart recalculation). + // It will also take care of HighContrast and ScaleContent + const drawinglayer::primitive2d::Primitive2DReference xOleContent( + new drawinglayer::primitive2d::SdrOleContentPrimitive2D( + GetOle2Obj(), + aObjectMatrix, + + // #i104867# add GraphicVersion number to be able to check for + // content change in the primitive later + GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(), + + bHighContrast)); + + // create primitive. Use Ole2 primitive here. Prepare attribute settings, will + // be used soon anyways. Always create primitives to allow the decomposition of + // SdrOle2Primitive2D to create needed invisible elements for HitTest and/or BoundRect + const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrOle2Primitive2D( xOLEContent, aObjectMatrix, - *pAttribute)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - delete pAttribute; - } + aAttribute)); - return xRetval; + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index c150681efb..9a86a44032 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -45,9 +45,9 @@ #include #include #include -#include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -101,7 +101,8 @@ namespace sdr const svtools::ColorConfig aColorConfig; const Color aInitColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); const basegfx::BColor aRGBColor(aInitColor.getBColor()); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor)); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor)); return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } @@ -216,25 +217,25 @@ namespace sdr { // build primitive from pObject's attributes const SfxItemSet& rFillProperties = pObject->GetMergedItemSet(); - drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties); + const drawinglayer::attribute::SdrFillAttribute aFill( + drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties)); - if(pFill) + if(!aFill.isDefault() && 1.0 != aFill.getTransparence()) { - if(pFill->isVisible()) - { - // direct model data is the page size, get and use it - const basegfx::B2DRange aInnerRange( - rPage.GetLftBorder(), rPage.GetUppBorder(), - rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder()); - const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); - const basegfx::B2DHomMatrix aEmptyTransform; - const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive( - basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill)); - - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - - delete pFill; + // direct model data is the page size, get and use it + const basegfx::B2DRange aInnerRange( + rPage.GetLftBorder(), rPage.GetUppBorder(), + rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder()); + const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); + const basegfx::B2DHomMatrix aEmptyTransform; + const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aInnerPolgon), + aEmptyTransform, + aFill, + drawinglayer::attribute::FillGradientAttribute())); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } } diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index 4b92c70587..67a31d7423 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -57,93 +56,91 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrPathObj::createViewIndependentPrimitive2DSequence() const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; const SfxItemSet& rItemSet = GetPathObj().GetMergedItemSet(); - SdrText* pSdrText = GetPathObj().getText(0); + const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + GetPathObj().getText(0))); + basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly()); + sal_uInt32 nPolyCount(aUnitPolyPolygon.count()); + sal_uInt32 nPointCount(0); + + for(sal_uInt32 a(0); a < nPolyCount; a++) + { + nPointCount += aUnitPolyPolygon.getB2DPolygon(a).count(); + } - if(pSdrText) + if(!nPointCount) { - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = - drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( - rItemSet, - *pSdrText); - - if(pAttribute) - { - if(pAttribute->isVisible()) - { - basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly()); - const sal_uInt32 nPolyCount(aUnitPolyPolygon.count()); - - if(nPolyCount) - { - // prepare object transformation and unit polygon (direct model data) - basegfx::B2DHomMatrix aObjectMatrix; - const bool bIsLine( - !aUnitPolyPolygon.areControlPointsUsed() - && 1 == nPolyCount - && 2 == aUnitPolyPolygon.getB2DPolygon(0).count()); - - if(bIsLine) - { - // special handling for single line mode (2 points) - const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0)); - const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0)); - const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1)); - const basegfx::B2DVector aLine(aEnd - aStart); - - // #i102548# create new unit polygon for line (horizontal) - basegfx::B2DPolygon aNewPolygon; - aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0)); - aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0)); - aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon); - - // #i102548# fill objectMatrix with rotation and offset (no shear for lines) - aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( - aLine.getLength(), 1.0, - 0.0, - atan2(aLine.getY(), aLine.getX()), - aStart.getX(), aStart.getY()); - } - else - { - // #i102548# create unscaled, unsheared, unrotated and untranslated polygon - // (unit polygon) by creating the object matrix and back-transforming the polygon - const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon)); - const GeoStat& rGeoStat(GetPathObj().GetGeoStat()); - const double fWidth(aObjectRange.getWidth()); - const double fHeight(aObjectRange.getHeight()); - 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); - aInverse.invert(); - aUnitPolyPolygon.transform(aInverse); - } - - // create primitive - const drawinglayer::primitive2d::Primitive2DReference xReference( - new drawinglayer::primitive2d::SdrPathPrimitive2D( - aObjectMatrix, - *pAttribute, - aUnitPolyPolygon)); - - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - } - - delete pAttribute; - } + OSL_ENSURE(false, "PolyPolygon object without geometry detected, this should not be created (!)"); + basegfx::B2DPolygon aFallbackLine; + aFallbackLine.append(basegfx::B2DPoint(0.0, 0.0)); + aFallbackLine.append(basegfx::B2DPoint(1000.0, 1000.0)); + aUnitPolyPolygon = basegfx::B2DPolyPolygon(aFallbackLine); + + nPolyCount = 1; } - return xRetval; + // prepare object transformation and unit polygon (direct model data) + basegfx::B2DHomMatrix aObjectMatrix; + const bool bIsLine( + !aUnitPolyPolygon.areControlPointsUsed() + && 1 == nPolyCount + && 2 == aUnitPolyPolygon.getB2DPolygon(0).count()); + + if(bIsLine) + { + // special handling for single line mode (2 points) + const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0)); + const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0)); + const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1)); + const basegfx::B2DVector aLine(aEnd - aStart); + + // #i102548# create new unit polygon for line (horizontal) + basegfx::B2DPolygon aNewPolygon; + aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0)); + aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0)); + aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon); + + // #i102548# fill objectMatrix with rotation and offset (no shear for lines) + aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aLine.getLength(), 1.0, + 0.0, + atan2(aLine.getY(), aLine.getX()), + aStart.getX(), aStart.getY()); + } + else + { + // #i102548# create unscaled, unsheared, unrotated and untranslated polygon + // (unit polygon) by creating the object matrix and back-transforming the polygon + const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon)); + const GeoStat& rGeoStat(GetPathObj().GetGeoStat()); + const double fWidth(aObjectRange.getWidth()); + const double fHeight(aObjectRange.getHeight()); + 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); + aInverse.invert(); + aUnitPolyPolygon.transform(aInverse); + } + + // create primitive. Always create primitives to allow the decomposition of + // SdrPathPrimitive2D to create needed invisible elements for HitTest and/or BoundRect + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrPathPrimitive2D( + aObjectMatrix, + aAttribute, + aUnitPolyPolygon)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index 8ac99245a1..ae36d674aa 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -59,70 +58,48 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrRectObj::createViewIndependentPrimitive2DSequence() const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; const SfxItemSet& rItemSet = GetRectObj().GetMergedItemSet(); - SdrText* pSdrText = GetRectObj().getText(0); + const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + GetRectObj().getText(0))); - if(pSdrText) - { - drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText); + // take unrotated snap rect (direct model data) for position and size + const Rectangle& rRectangle = GetRectObj().GetGeoRect(); + const ::basegfx::B2DRange aObjectRange( + rRectangle.Left(), rRectangle.Top(), + rRectangle.Right(), rRectangle.Bottom()); + const GeoStat& rGeoStat(GetRectObj().GetGeoStat()); + + // fill object matrix + 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())); - if(pAttribute) - { - if(pAttribute->isVisible()) - { - // take unrotated snap rect (direct model data) for position and size - const Rectangle& rRectangle = GetRectObj().GetGeoRect(); - const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); - const GeoStat& rGeoStat(GetRectObj().GetGeoStat()); - - // fill object matrix - 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()); + double fCornerRadiusX; + double fCornerRadiusY; + drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY); - // calculate corner radius - sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue()); - double fCornerRadiusX; - double fCornerRadiusY; - drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY); + // #i105856# use knowledge about pickthrough from the model + const bool bPickThroughTransparentTextFrames( + GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames()); - // #i105856# use knowledge about pickthrough from the model - const bool bPickThroughTransparentTextFrames( - GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames()); - - // create primitive - const drawinglayer::primitive2d::Primitive2DReference xReference( - new drawinglayer::primitive2d::SdrRectanglePrimitive2D( - aObjectMatrix, - *pAttribute, - fCornerRadiusX, - fCornerRadiusY, - // #i105856# use fill for HitTest when TextFrame and not PickThrough - GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames)); - - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - - delete pAttribute; - } - - if(!xRetval.hasElements()) - { - // #i99123# - // Object is invisible. Create a fallback primitive for HitTest - basegfx::B2DHomMatrix aObjectMatrix; - basegfx::B2DPolyPolygon aObjectPolyPolygon; - GetRectObj().TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon); - const drawinglayer::primitive2d::Primitive2DReference xReference( - drawinglayer::primitive2d::createFallbackHitTestPrimitive(aObjectMatrix)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - } - - return xRetval; + // create primitive. Always create primitives to allow the decomposition of + // SdrRectanglePrimitive2D to create needed invisible elements for HitTest and/or BoundRect + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrRectanglePrimitive2D( + aObjectMatrix, + aAttribute, + fCornerRadiusX, + fCornerRadiusY, + // #i105856# use fill for HitTest when TextFrame and not PickThrough + GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx index 1de8ffd792..d25ee9606f 100644 --- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx @@ -50,6 +50,7 @@ #include #include #include +#include //........................................................................ namespace sdr { namespace contact { @@ -138,35 +139,43 @@ namespace sdr { namespace contact { //-------------------------------------------------------------------- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfUnoControl::createViewIndependentPrimitive2DSequence() const { + // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use + // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj) + // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything + const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect()); + const basegfx::B2DRange aRange( + rRectangle.Left(), rRectangle.Top(), + rRectangle.Right(), rRectangle.Bottom()); + + // create object transform + basegfx::B2DHomMatrix aTransform; + + aTransform.set(0, 0, aRange.getWidth()); + aTransform.set(1, 1, aRange.getHeight()); + aTransform.set(0, 2, aRange.getMinX()); + aTransform.set(1, 2, aRange.getMinY()); + Reference< XControlModel > xControlModel = GetSdrUnoObj().GetUnoControlModel(); if(xControlModel.is()) { - // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use - // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj) - // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything - const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect()); - const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); - - // create object transform - basegfx::B2DHomMatrix aTransform; - aTransform.set(0, 0, aRange.getWidth()); - aTransform.set(1, 1, aRange.getHeight()); - aTransform.set(0, 2, aRange.getMinX()); - aTransform.set(1, 2, aRange.getMinY()); - // create control primitive WITHOUT possibly existing XControl; this would be done in // the VOC in createPrimitive2DSequence() - const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D( - aTransform, xControlModel)); + const drawinglayer::primitive2d::Primitive2DReference xRetval( + new drawinglayer::primitive2d::ControlPrimitive2D( + aTransform, + xControlModel)); return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1); } else { - // #i93161# This UnoControl does not yet have a xControlModel (can happen - // during diverse creations). Without a model, create no visualisation. - return drawinglayer::primitive2d::Primitive2DSequence(); + // always append an invisible outline for the cases where no visible content exists + const drawinglayer::primitive2d::Primitive2DReference xRetval( + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, aTransform)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1); } } diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx b/svx/source/sdr/contact/viewcontactofvirtobj.cxx index ce6a755af7..e3582f88eb 100644 --- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx +++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx @@ -36,6 +36,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -77,29 +78,39 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfVirtObj::createViewIndependentPrimitive2DSequence() const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; + // create displacement transformation if we have content + basegfx::B2DHomMatrix aObjectMatrix; + Point aAnchor(GetVirtObj().GetAnchorPos()); + + if(aAnchor.X() || aAnchor.Y()) + { + aObjectMatrix.set(0, 2, aAnchor.X()); + aObjectMatrix.set(1, 2, aAnchor.Y()); + } // use method from referenced object to get the Primitive2DSequence - const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence()); + const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual( + GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence()); if(xSequenceVirtual.hasElements()) { - // create displacement transformation if we have content - ::basegfx::B2DHomMatrix aObjectMatrix; - Point aAnchor(GetVirtObj().GetAnchorPos()); - - if(aAnchor.X() || aAnchor.Y()) - { - aObjectMatrix.set(0, 2, aAnchor.X()); - aObjectMatrix.set(1, 2, aAnchor.Y()); - } - // create transform primitive - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::TransformPrimitive2D(aObjectMatrix, xSequenceVirtual)); - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::TransformPrimitive2D( + aObjectMatrix, + xSequenceVirtual)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } + else + { + // always append an invisible outline for the cases where no visible content exists + const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, aObjectMatrix)); - return xRetval; + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx index c59072c31d..b036b2d460 100644 --- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx @@ -39,7 +39,6 @@ #include #include #include -#include ////////////////////////////////////////////////////////////////////////////// // predeclarations diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx index 21f7a9d3e2..f41e864f8b 100644 --- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx @@ -125,17 +125,6 @@ namespace sdr xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } - else - { - // do neither print nor PDF export the fallback visualisation - if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile()) - { - // empty group, fallback to parent method which will create the default - // grayed frame for empty 3d scenes by using model data and - // createViewIndependentPrimitive2DSequence::ViewContactOfE3dScene - xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo); - } - } if(bIsActiveVC) { diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx index 9f58fe5f9e..5e037dd44a 100644 --- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx @@ -59,20 +59,6 @@ namespace sdr { } - bool ViewObjectContactOfGroup::isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const - { - const bool bHasChildren(0 != GetViewContact().GetObjectCount()); - - if(!bHasChildren && (GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile())) - { - // empty group uses fallback gray empty frame display. Do neither print nor PDF export it - return false; - } - - // call parent - return ViewObjectContactOfSdrObj::isPrimitiveVisible(rDisplayInfo); - } - drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const { const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount()); diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index fefe1fa720..3c4e531999 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -296,28 +296,19 @@ namespace sdr 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); + // on the handout page more simple, add hidden fill geometry + const drawinglayer::primitive2d::Primitive2DReference xFrameHit( + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, + aPageObjectTransform)); + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xFrameHit, 1); } // add a gray outline frame, except not when printing 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))); + basegfx::B2DPolygon aOwnOutline(basegfx::tools::createUnitPolygon()); aOwnOutline.transform(aPageObjectTransform); const drawinglayer::primitive2d::Primitive2DReference xGrayFrame( diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx index 9c9aaa959c..c2b62b0cff 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx @@ -39,11 +39,11 @@ #include #include #include -#include #include #include -#include -#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -207,7 +207,7 @@ namespace sdr if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile()) { // shade the representation if the object is activated outplace - basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aObjectOutline(basegfx::tools::createUnitPolygon()); aObjectOutline.transform(aObjectTransform); // Use a FillHatchPrimitive2D with necessary attributes diff --git a/svx/source/sdr/overlay/overlayobjectcell.cxx b/svx/source/sdr/overlay/overlayobjectcell.cxx index cda1bbd636..00e80ced0c 100644 --- a/svx/source/sdr/overlay/overlayobjectcell.cxx +++ b/svx/source/sdr/overlay/overlayobjectcell.cxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include using namespace ::basegfx; @@ -87,12 +87,12 @@ namespace sdr if(mePaintType == CELL_OVERLAY_TRANSPARENT) { // embed in 50% transparent paint - const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha( - new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence( + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( aRetval, 0.5)); - aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1); + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1); } else // CELL_OVERLAY_INVERT { diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx index 24c73e045b..d8d1e21e39 100644 --- a/svx/source/sdr/overlay/overlayselection.cxx +++ b/svx/source/sdr/overlay/overlayselection.cxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -144,8 +144,8 @@ namespace sdr { // embed all rectangles in transparent paint const double fTransparence(mnLastTransparence / 100.0); - const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha( - new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence( + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( aRetval, fTransparence)); @@ -159,13 +159,13 @@ namespace sdr // add both to result aRetval.realloc(2); - aRetval[0] = aUnifiedAlpha; + aRetval[0] = aUnifiedTransparence; aRetval[1] = aSelectionOutline; } else { // just add transparent part - aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1); + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1); } } } diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 5d5ecad5d0..33b720f59f 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -58,14 +58,11 @@ #include #include #include -#include #include #include -#include #include #include #include -#include #include #include #include @@ -73,13 +70,22 @@ #include #include #include -#include #include #include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -221,9 +227,8 @@ namespace drawinglayer { namespace primitive2d { - attribute::SdrLineAttribute* createNewSdrLineAttribute(const SfxItemSet& rSet) + attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet& rSet) { - attribute::SdrLineAttribute* pRetval(0L); const XLineStyle eStyle(((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue()); if(XLINE_NONE != eStyle) @@ -253,7 +258,7 @@ namespace drawinglayer } } - pRetval = new attribute::SdrLineAttribute( + return attribute::SdrLineAttribute( XLineJointtoB2DLineJoin(eJoint), (double)nWidth, (double)nTransparence * 0.01, @@ -263,12 +268,13 @@ namespace drawinglayer } } - return pRetval; + return attribute::SdrLineAttribute(); } - attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth) + attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute( + const SfxItemSet& rSet, + double fWidth) { - attribute::SdrLineStartEndAttribute* pRetval(0L); const sal_Int32 nTempStartWidth(((const XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue()); const sal_Int32 nTempEndWidth(((const XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue()); basegfx::B2DPolyPolygon aStartPolyPolygon; @@ -328,15 +334,16 @@ namespace drawinglayer if(bStartActive || bEndActive) { - pRetval = new attribute::SdrLineStartEndAttribute(aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth, bStartActive, bEndActive, bStartCentered, bEndCentered); + return attribute::SdrLineStartEndAttribute( + aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth, + bStartActive, bEndActive, bStartCentered, bEndCentered); } - return pRetval; + return attribute::SdrLineStartEndAttribute(); } - attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet) + attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet& rSet) { - attribute::SdrShadowAttribute* pRetval(0L); const bool bShadow(((SdrShadowItem&)rSet.Get(SDRATTR_SHADOW)).GetValue()); if(bShadow) @@ -374,16 +381,15 @@ namespace drawinglayer (double)((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue()); const Color aColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue()); - pRetval = new attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor()); + return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor()); } } - return pRetval; + return attribute::SdrShadowAttribute(); } - attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet) + attribute::SdrFillAttribute createNewSdrFillAttribute(const SfxItemSet& rSet) { - attribute::SdrFillAttribute* pRetval(0L); const XFillStyle eStyle(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue()); if(XFILL_NONE != eStyle) @@ -398,9 +404,9 @@ namespace drawinglayer if(100 != nTransparence) { const Color aColor(((const XFillColorItem&)(rSet.Get(XATTR_FILLCOLOR))).GetColorValue()); - attribute::FillGradientAttribute* pGradient(0L); - attribute::FillHatchAttribute* pHatch(0L); - attribute::SdrFillBitmapAttribute* pBitmap(0L); + attribute::FillGradientAttribute aGradient; + attribute::FillHatchAttribute aHatch; + attribute::SdrFillBitmapAttribute aBitmap; switch(eStyle) { @@ -412,10 +418,10 @@ namespace drawinglayer } case XFILL_GRADIENT : { - XGradient aGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue()); + XGradient aXGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue()); - const Color aStartColor(aGradient.GetStartColor()); - const sal_uInt16 nStartIntens(aGradient.GetStartIntens()); + const Color aStartColor(aXGradient.GetStartColor()); + const sal_uInt16 nStartIntens(aXGradient.GetStartIntens()); basegfx::BColor aStart(aStartColor.getBColor()); if(nStartIntens != 100) @@ -424,8 +430,8 @@ namespace drawinglayer aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01); } - const Color aEndColor(aGradient.GetEndColor()); - const sal_uInt16 nEndIntens(aGradient.GetEndIntens()); + const Color aEndColor(aXGradient.GetEndColor()); + const sal_uInt16 nEndIntens(aXGradient.GetEndIntens()); basegfx::BColor aEnd(aEndColor.getBColor()); if(nEndIntens != 100) @@ -434,12 +440,12 @@ namespace drawinglayer aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01); } - pGradient = new attribute::FillGradientAttribute( - XGradientStyleToGradientStyle(aGradient.GetGradientStyle()), - (double)aGradient.GetBorder() * 0.01, - (double)aGradient.GetXOffset() * 0.01, - (double)aGradient.GetYOffset() * 0.01, - (double)aGradient.GetAngle() * F_PI1800, + aGradient = attribute::FillGradientAttribute( + XGradientStyleToGradientStyle(aXGradient.GetGradientStyle()), + (double)aXGradient.GetBorder() * 0.01, + (double)aXGradient.GetXOffset() * 0.01, + (double)aXGradient.GetYOffset() * 0.01, + (double)aXGradient.GetAngle() * F_PI1800, aStart, aEnd, ((const XGradientStepCountItem&)rSet.Get(XATTR_GRADIENTSTEPCOUNT)).GetValue()); @@ -451,7 +457,7 @@ namespace drawinglayer const XHatch& rHatch(((XFillHatchItem&)(rSet.Get(XATTR_FILLHATCH))).GetHatchValue()); const Color aColorB(rHatch.GetColor()); - pHatch = new attribute::FillHatchAttribute( + aHatch = attribute::FillHatchAttribute( XHatchStyleToHatchStyle(rHatch.GetHatchStyle()), (double)rHatch.GetDistance(), (double)rHatch.GetAngle() * F_PI1800, @@ -462,23 +468,25 @@ namespace drawinglayer } case XFILL_BITMAP : { - pBitmap = createNewSdrFillBitmapAttribute(rSet); + aBitmap = createNewSdrFillBitmapAttribute(rSet); break; } } - pRetval = new attribute::SdrFillAttribute( + return attribute::SdrFillAttribute( (double)nTransparence * 0.01, aColor.getBColor(), - pGradient, pHatch, pBitmap); + aGradient, + aHatch, + aBitmap); } } - return pRetval; + return attribute::SdrFillAttribute(); } // #i101508# Support handing over given text-to-border distances - attribute::SdrTextAttribute* createNewSdrTextAttribute( + attribute::SdrTextAttribute createNewSdrTextAttribute( const SfxItemSet& rSet, const SdrText& rText, const sal_Int32* pLeft, @@ -486,7 +494,6 @@ namespace drawinglayer const sal_Int32* pRight, const sal_Int32* pLower) { - attribute::SdrTextAttribute* pRetval(0); const SdrTextObj& rTextObj = rText.GetObject(); if(rText.GetOutlinerParaObject() && rText.GetModel()) @@ -530,7 +537,7 @@ namespace drawinglayer const SdrOutliner& rDrawTextOutliner = rText.GetModel()->GetDrawOutliner(&rTextObj); const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EE_CNTRL_ONLINESPELLING); - pRetval = new attribute::SdrTextAttribute( + return attribute::SdrTextAttribute( rText, aOutlinerParaObject, ((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue(), @@ -550,15 +557,15 @@ namespace drawinglayer bWrongSpell); } - return pRetval; + return attribute::SdrTextAttribute(); } - attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet) + attribute::FillGradientAttribute createNewTransparenceGradientAttribute(const SfxItemSet& rSet) { - attribute::FillGradientAttribute* pRetval = 0L; const SfxPoolItem* pGradientItem; - if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem) && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled()) + if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem) + && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled()) { // test if float transparence is completely transparent const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue(); @@ -571,7 +578,7 @@ namespace drawinglayer const double fStartLum(nStartLuminance / 255.0); const double fEndLum(nEndLuminance / 255.0); - pRetval = new attribute::FillGradientAttribute( + return attribute::FillGradientAttribute( XGradientStyleToGradientStyle(rGradient.GetGradientStyle()), (double)rGradient.GetBorder() * 0.01, (double)rGradient.GetXOffset() * 0.01, @@ -583,12 +590,11 @@ namespace drawinglayer } } - return pRetval; + return attribute::FillGradientAttribute(); } - attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet) + attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute(const SfxItemSet& rSet) { - attribute::SdrFillBitmapAttribute* pRetval(0L); Bitmap aBitmap((((const XFillBitmapItem&)(rSet.Get(XATTR_FILLBITMAP))).GetBitmapValue()).GetBitmap()); // make sure it's not empty, use default instead @@ -635,7 +641,7 @@ namespace drawinglayer (double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETX))).GetValue(), (double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETY))).GetValue()); - pRetval = new attribute::SdrFillBitmapAttribute( + return attribute::SdrFillBitmapAttribute( aBitmap, aSize, aOffset, @@ -644,252 +650,174 @@ namespace drawinglayer ((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_TILE))).GetValue(), ((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_STRETCH))).GetValue(), ((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_SIZELOG))).GetValue()); - - return pRetval; } - attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText, bool bSuppressText) + attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText, + bool bSuppressText) { - attribute::SdrShadowTextAttribute* pRetval(0L); - attribute::SdrShadowAttribute* pShadow(0L); - attribute::SdrTextAttribute* pText(0L); + attribute::SdrTextAttribute aText; // #i98072# added option to suppress text // look for text first - if(!bSuppressText) + if(!bSuppressText && pText) { - pText = createNewSdrTextAttribute(rSet, rText); + aText = createNewSdrTextAttribute(rSet, *pText); } // try shadow - pShadow = createNewSdrShadowAttribute(rSet); - - if(pShadow && !pShadow->isVisible()) - { - delete pShadow; - pShadow = 0L; - } + const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet)); - if(pText || pShadow) - { - pRetval = new attribute::SdrShadowTextAttribute(pShadow, pText); - } - - return pRetval; + return attribute::SdrShadowTextAttribute(aShadow, aText); } - attribute::SdrLineShadowTextAttribute* createNewSdrLineShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText) + attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText) { - attribute::SdrLineShadowTextAttribute* pRetval(0L); - attribute::SdrLineAttribute* pLine(0L); - attribute::SdrLineStartEndAttribute* pLineStartEnd(0L); - attribute::SdrShadowAttribute* pShadow(0L); - attribute::SdrTextAttribute* pText(0L); + attribute::SdrLineAttribute aLine; + attribute::SdrLineStartEndAttribute aLineStartEnd; + attribute::SdrTextAttribute aText; bool bFontworkHideContour(false); // look for text first - pText = createNewSdrTextAttribute(rSet, rText); - - // when object has text and text is fontwork and hide contour is set for fontwork, force - // line and fill style to empty - if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour()) + if(pText) { - bFontworkHideContour = true; + aText = createNewSdrTextAttribute(rSet, *pText); + + // when object has text and text is fontwork and hide contour is set for fontwork, force + // line and fill style to empty + if(!aText.isDefault() + && !aText.getSdrFormTextAttribute().isDefault() + && aText.isHideContour()) + { + bFontworkHideContour = true; + } } // try line style if(!bFontworkHideContour) { - pLine = createNewSdrLineAttribute(rSet); + aLine = createNewSdrLineAttribute(rSet); - if(pLine && !pLine->isVisible()) - { - delete pLine; - pLine = 0L; - } - - if(pLine) + if(!aLine.isDefault()) { // try LineStartEnd - pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth()); - - if(pLineStartEnd && !pLineStartEnd->isVisible()) - { - delete pLineStartEnd; - pLineStartEnd = 0L; - } + aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth()); } } - // try shadow - if(pLine || pText) + if(!aLine.isDefault() || !aText.isDefault()) { - pShadow = createNewSdrShadowAttribute(rSet); + // try shadow + const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet)); - if(pShadow && !pShadow->isVisible()) - { - delete pShadow; - pShadow = 0L; - } + return attribute::SdrLineShadowTextAttribute(aLine, aLineStartEnd, aShadow, aText); } - if(pLine || pText) - { - pRetval = new attribute::SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pText); - } - - return pRetval; + return attribute::SdrLineShadowTextAttribute(); } - attribute::SdrLineFillShadowTextAttribute* createNewSdrLineFillShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText) + attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText) { - attribute::SdrLineFillShadowTextAttribute* pRetval(0L); - attribute::SdrLineAttribute* pLine(0L); - attribute::SdrFillAttribute* pFill(0L); - attribute::SdrLineStartEndAttribute* pLineStartEnd(0L); - attribute::SdrShadowAttribute* pShadow(0L); - attribute::FillGradientAttribute* pFillFloatTransGradient(0L); - attribute::SdrTextAttribute* pText(0L); + attribute::SdrLineAttribute aLine; + attribute::SdrFillAttribute aFill; + attribute::SdrLineStartEndAttribute aLineStartEnd; + attribute::SdrShadowAttribute aShadow; + attribute::FillGradientAttribute aFillFloatTransGradient; + attribute::SdrTextAttribute aText; bool bFontworkHideContour(false); // look for text first - pText = createNewSdrTextAttribute(rSet, rText); - - // when object has text and text is fontwork and hide contour is set for fontwork, force - // line and fill style to empty - if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour()) + if(pText) { - bFontworkHideContour = true; - } - - // try line style - if(!bFontworkHideContour) - { - pLine = createNewSdrLineAttribute(rSet); + aText = createNewSdrTextAttribute(rSet, *pText); - if(pLine && !pLine->isVisible()) + // when object has text and text is fontwork and hide contour is set for fontwork, force + // line and fill style to empty + if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour()) { - delete pLine; - pLine = 0L; - } - - if(pLine) - { - // try LineStartEnd - pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth()); - - if(pLineStartEnd && !pLineStartEnd->isVisible()) - { - delete pLineStartEnd; - pLineStartEnd = 0L; - } + bFontworkHideContour = true; } } - // try fill style if(!bFontworkHideContour) { - pFill = createNewSdrFillAttribute(rSet); + // try line style + aLine = createNewSdrLineAttribute(rSet); - if(pFill && !pFill->isVisible()) + if(!aLine.isDefault()) { - delete pFill; - pFill = 0L; + // try LineStartEnd + aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth()); } - if(pFill) + // try fill style + aFill = createNewSdrFillAttribute(rSet); + + if(!aFill.isDefault()) { // try fillfloattransparence - pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet); + aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet); } } - // try shadow - if(pLine || pFill || pText) + if(!aLine.isDefault() || !aFill.isDefault() || !aText.isDefault()) { - pShadow = createNewSdrShadowAttribute(rSet); - - if(pShadow && !pShadow->isVisible()) - { - delete pShadow; - pShadow = 0L; - } - } + // try shadow + aShadow = createNewSdrShadowAttribute(rSet); - if(pLine || pFill || pText) - { - pRetval = new attribute::SdrLineFillShadowTextAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient, pText); + return attribute::SdrLineFillShadowTextAttribute( + aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient, aText); } - return pRetval; + return attribute::SdrLineFillShadowTextAttribute(); } - attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill) + attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill) { - attribute::SdrLineFillShadowAttribute* pRetval(0L); - attribute::SdrLineAttribute* pLine(0L); - attribute::SdrFillAttribute* pFill(0L); - attribute::SdrLineStartEndAttribute* pLineStartEnd(0L); - attribute::SdrShadowAttribute* pShadow(0L); - attribute::FillGradientAttribute* pFillFloatTransGradient(0L); + attribute::SdrFillAttribute aFill; + attribute::SdrLineStartEndAttribute aLineStartEnd; + attribute::SdrShadowAttribute aShadow; + attribute::FillGradientAttribute aFillFloatTransGradient; // try line style - pLine = createNewSdrLineAttribute(rSet); + const attribute::SdrLineAttribute aLine(createNewSdrLineAttribute(rSet)); - if(pLine && !pLine->isVisible()) - { - delete pLine; - pLine = 0L; - } - - if(pLine) + if(!aLine.isDefault()) { // try LineStartEnd - pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth()); - - if(pLineStartEnd && !pLineStartEnd->isVisible()) - { - delete pLineStartEnd; - pLineStartEnd = 0L; - } + aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth()); } // try fill style - pFill = bSuppressFill ? 0 : createNewSdrFillAttribute(rSet); - - if(pFill && !pFill->isVisible()) + if(!bSuppressFill) { - delete pFill; - pFill = 0L; - } - - if(pFill) - { - // try fillfloattransparence - pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet); - } + aFill = createNewSdrFillAttribute(rSet); - // try shadow - if(pLine || pFill) - { - pShadow = createNewSdrShadowAttribute(rSet); - - if(pShadow && !pShadow->isVisible()) + if(!aFill.isDefault()) { - delete pShadow; - pShadow = 0L; + // try fillfloattransparence + aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet); } } - if(pLine || pFill) + if(!aLine.isDefault() || !aFill.isDefault()) { - pRetval = new attribute::SdrLineFillShadowAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient); + // try shadow + aShadow = createNewSdrShadowAttribute(rSet); + + return attribute::SdrLineFillShadowAttribute3D( + aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient); } - return pRetval; + return attribute::SdrLineFillShadowAttribute3D(); } - attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet) + attribute::SdrSceneAttribute createNewSdrSceneAttribute(const SfxItemSet& rSet) { // get perspective ::com::sun::star::drawing::ProjectionMode aProjectionMode(::com::sun::star::drawing::ProjectionMode_PARALLEL); @@ -926,10 +854,10 @@ namespace drawinglayer // get two sided lighting const bool bTwoSidedLighting(((const Svx3DTwoSidedLightingItem&)rSet.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue()); - return new attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting); + return attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting); } - attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet) + attribute::SdrLightingAttribute createNewSdrLightingAttribute(const SfxItemSet& rSet) { // extract lights from given SfxItemSet (from scene) ::std::vector< attribute::Sdr3DLightAttribute > aLightVector; @@ -994,7 +922,7 @@ namespace drawinglayer const Color aAmbientValue(((const Svx3DAmbientcolorItem&)rSet.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue()); const basegfx::BColor aAmbientLight(aAmbientValue.getBColor()); - return new attribute::SdrLightingAttribute(aAmbientLight, aLightVector); + return attribute::SdrLightingAttribute(aAmbientLight, aLightVector); } void calculateRelativeCornerRadius(sal_Int32 nRadius, const basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY) @@ -1051,57 +979,50 @@ namespace drawinglayer } // #i101508# Support handing over given text-to-border distances - attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute( + attribute::SdrFillTextAttribute createNewSdrFillTextAttribute( const SfxItemSet& rSet, - const SdrText* pSdrText, + const SdrText* pText, const sal_Int32* pLeft, const sal_Int32* pUpper, const sal_Int32* pRight, const sal_Int32* pLower) { - attribute::SdrFillTextAttribute* pRetval(0L); - attribute::SdrFillAttribute* pFill(0L); - attribute::FillGradientAttribute* pFillFloatTransGradient(0L); - attribute::SdrTextAttribute* pText(0L); + attribute::SdrFillAttribute aFill; + attribute::FillGradientAttribute aFillFloatTransGradient; + attribute::SdrTextAttribute aText; bool bFontworkHideContour(false); // look for text first - if(pSdrText) + if(pText) { - pText = createNewSdrTextAttribute(rSet, *pSdrText, pLeft, pUpper, pRight, pLower); - } + aText = createNewSdrTextAttribute(rSet, *pText, pLeft, pUpper, pRight, pLower); - // when object has text and text is fontwork and hide contour is set for fontwork, force - // fill style to empty - if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour()) - { - bFontworkHideContour = true; + // when object has text and text is fontwork and hide contour is set for fontwork, force + // fill style to empty + if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour()) + { + bFontworkHideContour = true; + } } - // try fill style if(!bFontworkHideContour) { - pFill = createNewSdrFillAttribute(rSet); - - if(pFill && !pFill->isVisible()) - { - delete pFill; - pFill = 0L; - } + // try fill style + aFill = createNewSdrFillAttribute(rSet); - if(pFill) + if(!aFill.isDefault()) { // try fillfloattransparence - pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet); + aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet); } } - if(pFill || pText) + if(!aFill.isDefault() || !aText.isDefault()) { - pRetval = new attribute::SdrFillTextAttribute(pFill, pFillFloatTransGradient, pText); + return attribute::SdrFillTextAttribute(aFill, aFillFloatTransGradient, aText); } - return pRetval; + return attribute::SdrFillTextAttribute(); } } // end of namespace primitive2d diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx index cc71488fb6..517c1318ee 100644 --- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -50,7 +50,6 @@ namespace drawinglayer Primitive2DSequence SdrCaptionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; - Primitive2DSequence aHitTestContent; // create unit outline polygon const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect( @@ -59,68 +58,66 @@ namespace drawinglayer getCornerRadiusY())); // add fill - if(getSdrLFSTAttribute().getFill()) + if(getSdrLFSTAttribute().getFill().isDefault()) { + // create invisible fill for HitTest appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createPolyPolygonFillPrimitive( - basegfx::B2DPolyPolygon(aUnitOutline), - getTransform(), - *getSdrLFSTAttribute().getFill(), - getSdrLFSTAttribute().getFillFloatTransGradient())); + createHiddenGeometryPrimitives2D( + true, + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform())); } else { - // if no fill, create one for HitTest and BoundRect fallback - appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive( basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), - attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)), + getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line - if(getSdrLFSTAttribute().getLine()) + if(getSdrLFSTAttribute().getLine().isDefault()) { + // create invisible line for HitTest/BoundRect appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createPolygonLinePrimitive( - aUnitOutline, - getTransform(), - *getSdrLFSTAttribute().getLine())); + createHiddenGeometryPrimitives2D( + false, + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform())); appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createPolygonLinePrimitive( - getTail(), - getTransform(), - *getSdrLFSTAttribute().getLine(), - getSdrLFSTAttribute().getLineStartEnd())); + createHiddenGeometryPrimitives2D( + false, + basegfx::B2DPolyPolygon(getTail()), + getTransform())); } else { - // if initially no line is defined, create one for HitTest and BoundRect. It - // is sufficient to use the tail; the body is already ensured with fill creation - appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive( - getTail(), + aUnitOutline, getTransform(), - attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0)))); - } + getSdrLFSTAttribute().getLine(), + attribute::SdrLineStartEndAttribute())); - // add HitTest and BoundRect helper geometry (if exists) - if(aHitTestContent.hasElements()) - { appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - Primitive2DReference(new HitTestPrimitive2D(aHitTestContent))); + createPolygonLinePrimitive( + getTail(), + getTransform(), + getSdrLFSTAttribute().getLine(), + getSdrLFSTAttribute().getLineStartEnd())); } // add text - if(getSdrLFSTAttribute().getText()) + if(!getSdrLFSTAttribute().getText().isDefault()) { appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive( basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), - *getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, @@ -128,9 +125,9 @@ namespace drawinglayer } // add shadow - if(getSdrLFSTAttribute().getShadow()) + if(!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx index f08fd75ab0..b1afda1671 100644 --- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx @@ -35,7 +35,8 @@ #include #include #include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -51,34 +52,45 @@ namespace drawinglayer { Primitive2DSequence aRetval; - // prepare unit transform - ::basegfx::B2DHomMatrix aEmptyMatrix; - // add line - if(getSdrLSTAttribute().getLine()) + if(getSdrLSTAttribute().getLine().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd())); + // create invisible line for HitTest/BoundRect + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + false, + basegfx::B2DPolyPolygon(getUnitPolygon()))); } else { - // if initially no line is defined, create one for HitTest and BoundRect - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, aBlackHairline)); - const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + getUnitPolygon(), + basegfx::B2DHomMatrix(), + getSdrLSTAttribute().getLine(), + getSdrLSTAttribute().getLineStartEnd())); } // add text - if(getSdrLSTAttribute().getText()) + if(!getSdrLSTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(getUnitPolygon()), + basegfx::B2DHomMatrix(), + getSdrLSTAttribute().getText(), + getSdrLSTAttribute().getLine(), + false, + false, + false)); } // add shadow - if(getSdrLSTAttribute().getShadow()) + if(!getSdrLSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx index 61b60abc52..9d4df7fc5e 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -36,6 +36,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -52,21 +53,23 @@ namespace drawinglayer Primitive2DSequence aRetval(getSubPrimitives()); // add text - if(getSdrSTAttribute().getText()) + if(!getSdrSTAttribute().getText().isDefault()) { - const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive( - basegfx::B2DPolyPolygon(aUnitOutline), - getTextBox(), - *getSdrSTAttribute().getText(), - 0, - false, - getWordWrap(), - isForceTextClipToTextRange())); + const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon()); + + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTextBox(), + getSdrSTAttribute().getText(), + attribute::SdrLineAttribute(), + false, + getWordWrap(), + isForceTextClipToTextRange())); } // add shadow - if(aRetval.hasElements() && getSdrSTAttribute().getShadow()) + if(aRetval.hasElements() && !getSdrSTAttribute().getShadow().isDefault()) { // #i105323# add generic shadow only for 2D shapes. For // 3D shapes shadow will be set at the individual created @@ -80,7 +83,7 @@ namespace drawinglayer // shadow will be correct (using ColorModifierStack), but expensive. if(!get3DShape()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrSTAttribute().getShadow()); } } diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 67fb97e6b7..265ddb32ec 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -31,12 +31,10 @@ #include "precompiled_svx.hxx" #include -#include #include -#include #include -#include -#include +#include +#include #include #include #include @@ -55,6 +53,10 @@ #include #include #include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -70,25 +72,25 @@ namespace drawinglayer const basegfx::B2DPolyPolygon& rUnitPolyPolygon, const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrFillAttribute& rFill, - const attribute::FillGradientAttribute* pFillGradient) + const attribute::FillGradientAttribute& rFillGradient) { // prepare fully scaled polygon basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); aScaledPolyPolygon.transform(rObjectTransform); BasePrimitive2D* pNewFillPrimitive = 0; - if(rFill.isGradient()) + if(!rFill.getGradient().isDefault()) { - pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, *rFill.getGradient()); + pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getGradient()); } - else if(rFill.isHatch()) + else if(!rFill.getHatch().isDefault()) { - pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), *rFill.getHatch()); + pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getHatch()); } - else if(rFill.isBitmap()) + else if(!rFill.getBitmap().isDefault()) { const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon)); - pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap()->getFillBitmapAttribute(aRange)); + pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap().getFillBitmapAttribute(aRange)); } else { @@ -100,9 +102,9 @@ namespace drawinglayer // create simpleTransparencePrimitive, add created fill primitive const Primitive2DReference xRefA(pNewFillPrimitive); const Primitive2DSequence aContent(&xRefA, 1L); - return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rFill.getTransparence())); + return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rFill.getTransparence())); } - else if(pFillGradient) + else if(!rFillGradient.isDefault()) { // create sequence with created fill primitive const Primitive2DReference xRefA(pNewFillPrimitive); @@ -111,11 +113,11 @@ namespace drawinglayer // create FillGradientPrimitive2D for transparence and add to new sequence // fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon)); - const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient)); + const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, rFillGradient)); const Primitive2DSequence aAlpha(&xRefB, 1L); - // create AlphaPrimitive2D using alpha and content - return Primitive2DReference(new AlphaPrimitive2D(aContent, aAlpha)); + // create TransparencePrimitive2D using alpha and content + return Primitive2DReference(new TransparencePrimitive2D(aContent, aAlpha)); } else { @@ -128,7 +130,7 @@ namespace drawinglayer const basegfx::B2DPolygon& rUnitPolygon, const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrLineAttribute& rLine, - const attribute::SdrLineStartEndAttribute* pStroke) + const attribute::SdrLineStartEndAttribute& rStroke) { // prepare fully scaled polygon basegfx::B2DPolygon aScaledPolygon(rUnitPolygon); @@ -139,10 +141,10 @@ namespace drawinglayer const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen()); BasePrimitive2D* pNewLinePrimitive = 0L; - if(!rUnitPolygon.isClosed() && pStroke) + if(!rUnitPolygon.isClosed() && !rStroke.isDefault()) { - attribute::LineStartEndAttribute aStart(pStroke->getStartWidth(), pStroke->getStartPolyPolygon(), pStroke->isStartCentered()); - attribute::LineStartEndAttribute aEnd(pStroke->getEndWidth(), pStroke->getEndPolyPolygon(), pStroke->isEndCentered()); + attribute::LineStartEndAttribute aStart(rStroke.getStartWidth(), rStroke.getStartPolyPolygon(), rStroke.isStartCentered()); + attribute::LineStartEndAttribute aEnd(rStroke.getEndWidth(), rStroke.getEndPolyPolygon(), rStroke.isEndCentered()); // create data pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd); @@ -158,7 +160,7 @@ namespace drawinglayer // create simpleTransparencePrimitive, add created fill primitive const Primitive2DReference xRefA(pNewLinePrimitive); const Primitive2DSequence aContent(&xRefA, 1L); - return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rLine.getTransparence())); + return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rLine.getTransparence())); } else { @@ -171,7 +173,7 @@ namespace drawinglayer const basegfx::B2DPolyPolygon& rUnitPolyPolygon, const basegfx::B2DHomMatrix& rObjectTransform, const attribute::SdrTextAttribute& rText, - const attribute::SdrLineAttribute* pStroke, + const attribute::SdrLineAttribute& rStroke, bool bCellText, bool bWordWrap, bool bClipOnBounds) @@ -182,7 +184,7 @@ namespace drawinglayer if(rText.isContour()) { // contour text - if(pStroke && 0.0 != pStroke->getWidth()) + if(!rStroke.isDefault() && 0.0 != rStroke.getWidth()) { // take line width into account and shrink contour polygon accordingly // decompose to get scale @@ -197,7 +199,7 @@ namespace drawinglayer 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)); + aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(rStroke.getWidth() * 0.5)); // scale back to unit polygon aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix( @@ -221,7 +223,7 @@ namespace drawinglayer rObjectTransform); } } - else if(rText.getSdrFormTextAttribute()) + else if(!rText.getSdrFormTextAttribute().isDefault()) { // text on path, use scaled polygon basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); @@ -230,7 +232,7 @@ namespace drawinglayer &rText.getSdrText(), rText.getOutlinerParaObject(), aScaledPolyPolygon, - *rText.getSdrFormTextAttribute()); + rText.getSdrFormTextAttribute()); } else { @@ -327,7 +329,7 @@ namespace drawinglayer if(rText.isScroll()) { // suppress scroll when FontWork - if(!rText.getSdrFormTextAttribute()) + if(rText.getSdrFormTextAttribute().isDefault()) { // get scroll direction const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection()); @@ -468,7 +470,7 @@ namespace drawinglayer const Primitive2DSequence aTempContent(&aRetval[0], 1); aRetval[0] = Primitive2DReference( - new UnifiedAlphaPrimitive2D( + new UnifiedTransparencePrimitive2D( aTempContent, rShadow.getTransparence())); } diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx index 016ff9fa8f..80056260f1 100644 --- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx @@ -36,10 +36,9 @@ #include #include #include -#include #include -#include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -59,52 +58,73 @@ namespace drawinglayer // Do use createPolygonFromUnitCircle, but let create from first quadrant to mimic old geometry creation. // This is needed to have the same look when stroke is used since the polygon start point defines the // stroke start, too. - ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitCircle(1)); + basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitCircle(1)); // scale and move UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1) - const basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5)); + const basegfx::B2DHomMatrix aUnitCorrectionMatrix( + basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5)); // apply to the geometry aUnitOutline.transform(aUnitCorrectionMatrix); // add fill - if(getSdrLFSTAttribute().getFill()) + if(!getSdrLFSTAttribute().getFill().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line - if(getSdrLFSTAttribute().getLine()) + if(getSdrLFSTAttribute().getLine().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine())); + // create invisible line for HitTest/BoundRect + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + false, + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform())); } else { - // if initially no line is defined, create one for HitTest and BoundRect - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline)); - const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aUnitOutline, + getTransform(), + getSdrLFSTAttribute().getLine(), + attribute::SdrLineStartEndAttribute())); } // add text - if(getSdrLFSTAttribute().getText()) + if(!getSdrLFSTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getLine(), + false, + false, + false)); } // add shadow - if(getSdrLFSTAttribute().getShadow()) + if(!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLFSTAttribute().getShadow()); } return aRetval; } SdrEllipsePrimitive2D::SdrEllipsePrimitive2D( - const ::basegfx::B2DHomMatrix& rTransform, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute) : BufferedDecompositionPrimitive2D(), maTransform(rTransform), @@ -142,7 +162,7 @@ namespace drawinglayer Primitive2DSequence aRetval; // create unit outline polygon - ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle)); + basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle)); if(mbCloseSegment) { @@ -150,57 +170,77 @@ namespace drawinglayer { // for compatibility, insert the center point at polygon start to get the same // line stroking pattern as the old painting mechanisms. - aUnitOutline.insert(0L, ::basegfx::B2DPoint(0.0, 0.0)); + aUnitOutline.insert(0L, basegfx::B2DPoint(0.0, 0.0)); } aUnitOutline.setClosed(true); } // move and scale UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1) - basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createTranslateB2DHomMatrix(1.0, 1.0)); - aUnitCorrectionMatrix.scale(0.5, 0.5); + const basegfx::B2DHomMatrix aUnitCorrectionMatrix( + basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5)); // apply to the geometry aUnitOutline.transform(aUnitCorrectionMatrix); // add fill - if(getSdrLFSTAttribute().getFill() && aUnitOutline.isClosed()) + if(!getSdrLFSTAttribute().getFill().isDefault() && aUnitOutline.isClosed()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line - if(getSdrLFSTAttribute().getLine()) + if(getSdrLFSTAttribute().getLine().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd())); + // create invisible line for HitTest/BoundRect + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + false, + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform())); } else { - // if initially no line is defined, create one for HitTest and BoundRect - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline)); - const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aUnitOutline, + getTransform(), + getSdrLFSTAttribute().getLine(), + getSdrLFSTAttribute().getLineStartEnd())); } // add text - if(getSdrLFSTAttribute().getText()) + if(!getSdrLFSTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getLine(), + false, + false, + false)); } // add shadow - if(getSdrLFSTAttribute().getShadow()) + if(!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLFSTAttribute().getShadow()); } return aRetval; } SdrEllipseSegmentPrimitive2D::SdrEllipseSegmentPrimitive2D( - const ::basegfx::B2DHomMatrix& rTransform, + const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, double fStartAngle, double fEndAngle, diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index 70b973e521..8b1ce3a911 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -36,7 +36,8 @@ #include #include #include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -49,21 +50,25 @@ namespace drawinglayer Primitive2DSequence aRetval; // create unit outline polygon - basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon()); // add fill, but only when graphic ist transparent - if(getSdrLFSTAttribute().getFill() && isTransparent()) + if(!getSdrLFSTAttribute().getFill().isDefault() && isTransparent()) { appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line - if(getSdrLFSTAttribute().getLine()) + if(!getSdrLFSTAttribute().getLine().isDefault()) { // if line width is given, polygon needs to be grown by half of it to make the // outline to be outside of the bitmap - if(0.0 != getSdrLFSTAttribute().getLine()->getWidth()) + if(0.0 != getSdrLFSTAttribute().getLine().getWidth()) { // decompose to get scale basegfx::B2DVector aScale, aTranslate; @@ -71,46 +76,61 @@ namespace drawinglayer getTransform().decompose(aScale, aTranslate, fRotate, fShearX); // create expanded range (add relative half line width to unit rectangle) - double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5); + double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5); double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0); double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0); const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY); basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange)); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aExpandedUnitOutline, + getTransform(), + getSdrLFSTAttribute().getLine(), + attribute::SdrLineStartEndAttribute())); } else { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aUnitOutline, getTransform(), + getSdrLFSTAttribute().getLine(), + attribute::SdrLineStartEndAttribute())); } } - else - { - // if initially no line is defined, create one for HitTest and BoundRect - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline)); - const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); - } // add graphic content if(255L != getGraphicAttr().GetTransparency()) { - Primitive2DReference xGraphicContentPrimitive(new GraphicPrimitive2D(getTransform(), getGraphicObject(), getGraphicAttr())); + const Primitive2DReference xGraphicContentPrimitive( + new GraphicPrimitive2D( + getTransform(), + getGraphicObject(), + getGraphicAttr())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xGraphicContentPrimitive); } // add text - if(getSdrLFSTAttribute().getText()) + if(!getSdrLFSTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getLine(), + false, + false, + false)); } // add shadow - if(getSdrLFSTAttribute().getShadow()) + if(!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index 7f59e8be96..4f65287b55 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -39,8 +39,8 @@ #include #include #include -#include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -60,36 +60,44 @@ namespace drawinglayer bool bLeftActive, bool bRightActive) const { - const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); + const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); basegfx::B2DPolygon aPolygon; aPolygon.append(rStart); aPolygon.append(rEnd); - if(!pLineStartEnd || (!bLeftActive && !bRightActive)) + if(rLineStartEnd.isDefault() || (!bLeftActive && !bRightActive)) { - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, 0); + return createPolygonLinePrimitive( + aPolygon, + rObjectMatrix, + rLineAttribute, + attribute::SdrLineStartEndAttribute()); } if(bLeftActive && bRightActive) { - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, pLineStartEnd); + return createPolygonLinePrimitive( + aPolygon, + rObjectMatrix, + rLineAttribute, + rLineStartEnd); } const basegfx::B2DPolyPolygon aEmpty; const attribute::SdrLineStartEndAttribute aLineStartEnd( - bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty, - bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0, - bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false, - bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false); + bLeftActive ? rLineStartEnd.getStartPolyPolygon() : aEmpty, bRightActive ? rLineStartEnd.getEndPolyPolygon() : aEmpty, + bLeftActive ? rLineStartEnd.getStartWidth() : 0.0, bRightActive ? rLineStartEnd.getEndWidth() : 0.0, + bLeftActive ? rLineStartEnd.isStartActive() : false, bRightActive ? rLineStartEnd.isEndActive() : false, + bLeftActive ? rLineStartEnd.isStartCentered() : false, bRightActive? rLineStartEnd.isEndCentered() : false); - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, &aLineStartEnd); + return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, aLineStartEnd); } Primitive2DSequence SdrMeasurePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - SdrBlockTextPrimitive2D* pBlockText = 0L; + SdrBlockTextPrimitive2D* pBlockText = 0; basegfx::B2DRange aTextRange; double fTextX((getStart().getX() + getEnd().getX()) * 0.5); double fTextY((getStart().getX() + getEnd().getX()) * 0.5); @@ -97,11 +105,13 @@ namespace drawinglayer const double fDistance(aLine.getLength()); const double fAngle(atan2(aLine.getY(), aLine.getX())); bool bAutoUpsideDown(false); - const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText(); + const attribute::SdrTextAttribute rTextAttribute = getSdrLSTAttribute().getText(); const basegfx::B2DHomMatrix aObjectMatrix( basegfx::tools::createShearXRotateTranslateB2DHomMatrix(0.0, fAngle, getStart())); - if(pTextAttribute) + // preapare text, but do not add yet; it needs to be aligned to + // the line geometry + if(!rTextAttribute.isDefault()) { basegfx::B2DHomMatrix aTextMatrix; double fTestAngle(fAngle); @@ -127,58 +137,52 @@ namespace drawinglayer // create primitive and get text range pBlockText = new SdrBlockTextPrimitive2D( - &pTextAttribute->getSdrText(), - pTextAttribute->getOutlinerParaObject(), + &rTextAttribute.getSdrText(), + rTextAttribute.getOutlinerParaObject(), aTextMatrix, SDRTEXTHORZADJUST_CENTER, SDRTEXTVERTADJUST_CENTER, - pTextAttribute->isScroll(), + rTextAttribute.isScroll(), false, false, false, false); + aTextRange = pBlockText->getB2DRange(aViewInformation); } // prepare line attribute and result - const attribute::SdrLineAttribute* pLineAttribute(getSdrLSTAttribute().getLine()); - - if(!pLineAttribute) - { - // if initially no line is defined, create one for HitTest and BoundRect - pLineAttribute = new attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0)); - } - { + const attribute::SdrLineAttribute rLineAttribute(getSdrLSTAttribute().getLine()); bool bArrowsOutside(false); bool bMainLineSplitted(false); - const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); + const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); double fStartArrowW(0.0); double fStartArrowH(0.0); double fEndArrowW(0.0); double fEndArrowH(0.0); - if(pLineStartEnd) + if(!rLineStartEnd.isDefault()) { - if(pLineStartEnd->isStartActive()) + if(rLineStartEnd.isStartActive()) { - const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon())); - fStartArrowW = pLineStartEnd->getStartWidth(); + const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getStartPolyPolygon())); + fStartArrowW = rLineStartEnd.getStartWidth(); fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth(); - if(pLineStartEnd->isStartCentered()) + if(rLineStartEnd.isStartCentered()) { fStartArrowH *= 0.5; } } - if(pLineStartEnd->isEndActive()) + if(rLineStartEnd.isEndActive()) { - const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon())); - fEndArrowW = pLineStartEnd->getEndWidth(); + const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getEndPolyPolygon())); + fEndArrowW = rLineStartEnd.getEndWidth(); fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth(); - if(pLineStartEnd->isEndCentered()) + if(rLineStartEnd.isEndCentered()) { fEndArrowH *= 0.5; } @@ -187,7 +191,7 @@ namespace drawinglayer const double fSpaceNeededByArrows(fStartArrowH + fEndArrowH + ((fStartArrowW + fEndArrowW) * 0.5)); const double fArrowsOutsideLen((fStartArrowH + fEndArrowH + fStartArrowW + fEndArrowW) * 0.5); - const double fHalfLineWidth(pLineAttribute->getWidth() * 0.5); + const double fHalfLineWidth(rLineAttribute.getWidth() * 0.5); if(fSpaceNeededByArrows > fDistance) { @@ -279,12 +283,12 @@ namespace drawinglayer const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY()); const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY()); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true)); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false)); if(!bMainLineSplitted || MEASURETEXTPOSITION_CENTERED != eHorizontal) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(* pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false)); } } else @@ -295,12 +299,12 @@ namespace drawinglayer const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY()); const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY()); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false)); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true)); } else { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true)); } } @@ -313,13 +317,13 @@ namespace drawinglayer const basegfx::B2DPoint aLeftUp(0.0, fTopEdge); const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false)); // right help line const basegfx::B2DPoint aRightUp(fDistance, fTopEdge); const basegfx::B2DPoint aRightDown(fDistance, fBottomRight); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false)); // text horizontal position if(MEASURETEXTPOSITION_NEGATIVE == eHorizontal) @@ -333,9 +337,9 @@ namespace drawinglayer fTextX -= (fArrowsOutsideLen - fStartArrowH); } - if(pTextAttribute) + if(!rTextAttribute.isDefault()) { - fTextX -= pTextAttribute->getTextRightDistance(); + fTextX -= rTextAttribute.getTextRightDistance(); } } else if(MEASURETEXTPOSITION_POSITIVE == eHorizontal) @@ -349,9 +353,9 @@ namespace drawinglayer fTextX += (fArrowsOutsideLen - fEndArrowH); } - if(pTextAttribute) + if(!rTextAttribute.isDefault()) { - fTextX += pTextAttribute->getTextLeftDistance(); + fTextX += rTextAttribute.getTextLeftDistance(); } } else // MEASURETEXTPOSITION_CENTERED @@ -359,9 +363,9 @@ namespace drawinglayer // centered fTextX = aMainLeft.getX() + ((fDistance - aTextRange.getWidth()) * 0.5); - if(pTextAttribute) + if(!rTextAttribute.isDefault()) { - fTextX += (pTextAttribute->getTextLeftDistance() - pTextAttribute->getTextRightDistance()) / 2L; + fTextX += (rTextAttribute.getTextLeftDistance() - rTextAttribute.getTextRightDistance()) / 2L; } } @@ -372,9 +376,9 @@ namespace drawinglayer const double fSmall(fArrowsOutsideLen * 0.10); fTextY = aMainLeft.getY() - (aTextRange.getHeight() + fSmall + fHalfLineWidth); - if(pTextAttribute) + if(!rTextAttribute.isDefault()) { - fTextY -= pTextAttribute->getTextLowerDistance(); + fTextY -= rTextAttribute.getTextLowerDistance(); } } else if(MEASURETEXTPOSITION_POSITIVE == eVertical) @@ -383,9 +387,9 @@ namespace drawinglayer const double fSmall(fArrowsOutsideLen * 0.10); fTextY = aMainLeft.getY() + (fSmall + fHalfLineWidth); - if(pTextAttribute) + if(!rTextAttribute.isDefault()) { - fTextY += pTextAttribute->getTextUpperDistance(); + fTextY += rTextAttribute.getTextUpperDistance(); } } else // MEASURETEXTPOSITION_CENTERED @@ -393,21 +397,19 @@ namespace drawinglayer // centered fTextY = aMainLeft.getY() - (aTextRange.getHeight() * 0.5); - if(pTextAttribute) + if(!rTextAttribute.isDefault()) { - fTextY += (pTextAttribute->getTextUpperDistance() - pTextAttribute->getTextLowerDistance()) / 2L; + fTextY += (rTextAttribute.getTextUpperDistance() - rTextAttribute.getTextLowerDistance()) / 2L; } } } - if(!getSdrLSTAttribute().getLine()) + if(getSdrLSTAttribute().getLine().isDefault()) { - // embed line geometry to invisible line group - const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval)); + // embed line geometry to invisible (100% transparent) line group for HitTest + const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(aRetval)); + aRetval = Primitive2DSequence(&xHiddenLines, 1); - - // delete temporary LineAttribute again - delete pLineAttribute; } if(pBlockText) @@ -437,9 +439,11 @@ namespace drawinglayer } // add shadow - if(getSdrLSTAttribute().getShadow()) + if(!getSdrLSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index 5a7d327cd9..ba38e006eb 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -84,23 +85,29 @@ namespace drawinglayer Primitive2DSequence aRetval; // create unit outline polygon - basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon()); // add fill - if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getFill()) + if(!bBehaveCompatibleToPaintVersion + && !getSdrLFSTAttribute().getFill().isDefault()) { appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); + createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line // #i97981# condition was inverse to purpose. When being compatible to paint version, // border needs to be suppressed - if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getLine()) + if(!bBehaveCompatibleToPaintVersion + && !getSdrLFSTAttribute().getLine().isDefault()) { // if line width is given, polygon needs to be grown by half of it to make the // outline to be outside of the bitmap - if(0.0 != getSdrLFSTAttribute().getLine()->getWidth()) + if(0.0 != getSdrLFSTAttribute().getLine().getWidth()) { // decompose to get scale basegfx::B2DVector aScale, aTranslate; @@ -108,27 +115,37 @@ namespace drawinglayer getTransform().decompose(aScale, aTranslate, fRotate, fShearX); // create expanded range (add relative half line width to unit rectangle) - double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5); + double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5); double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0); double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0); const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY); basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange)); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aExpandedUnitOutline, + getTransform(), + getSdrLFSTAttribute().getLine(), + attribute::SdrLineStartEndAttribute())); } else { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolygonLinePrimitive( + aUnitOutline, + getTransform(), + getSdrLFSTAttribute().getLine(), + attribute::SdrLineStartEndAttribute())); } } else { // if initially no line is defined, create one for HitTest and BoundRect - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline)); - const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + false, + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform())); } // add graphic content @@ -136,15 +153,26 @@ namespace drawinglayer // add text, no need to supress to stay compatible since text was // always supported by the old paints, too - if(getSdrLFSTAttribute().getText()) + if(!getSdrLFSTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getLine(), + false, + false, + false)); } // add shadow - if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getShadow()) + if(!bBehaveCompatibleToPaintVersion + && !getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index cb871d0949..907510127a 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -138,7 +138,7 @@ namespace drawinglayer if(aColor.bIsVisible) { - basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); + basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon()); const Color aVclColor(aColor.nColor); aOutline.transform(getObjectTransform()); const drawinglayer::primitive2d::Primitive2DReference xOutline( diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx index e19bc75fd6..a52060a68f 100644 --- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -52,50 +52,67 @@ namespace drawinglayer Primitive2DSequence aRetval; // add fill - if(getSdrLFSTAttribute().getFill() && getUnitPolyPolygon().isClosed()) + if(!getSdrLFSTAttribute().getFill().isDefault() + && getUnitPolyPolygon().isClosed()) { // take care for orientations - basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(basegfx::tools::correctOrientations(getUnitPolyPolygon())); - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); + const basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon( + basegfx::tools::correctOrientations(getUnitPolyPolygon())); + + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolyPolygonFillPrimitive( + aOrientedUnitPolyPolygon, + getTransform(), + getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFillFloatTransGradient())); } // add line - if(getSdrLFSTAttribute().getLine()) + if(getSdrLFSTAttribute().getLine().isDefault()) { - Primitive2DSequence aTemp(getUnitPolyPolygon().count()); - - for(sal_uInt32 a(0L); a < getUnitPolyPolygon().count(); a++) - { - aTemp[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()); - } - - appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp); + // if initially no line is defined, create one for HitTest and BoundRect + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + false, + getUnitPolyPolygon(), + getTransform())); } else { - // if initially no line is defined, create one for HitTest and BoundRect - const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0)); - Primitive2DSequence xHiddenLineSequence(getUnitPolyPolygon().count()); - + Primitive2DSequence aTemp(getUnitPolyPolygon().count()); + for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++) { - xHiddenLineSequence[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), aBlackHairline); + aTemp[a] = createPolygonLinePrimitive( + getUnitPolyPolygon().getB2DPolygon(a), + getTransform(), + getSdrLFSTAttribute().getLine(), + getSdrLFSTAttribute().getLineStartEnd()); } - - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence))); + + appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp); } // add text - if(getSdrLFSTAttribute().getText()) + if(!getSdrLFSTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + getUnitPolyPolygon(), + getTransform(), + getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getLine(), + false, + false, + false)); } // add shadow - if(getSdrLFSTAttribute().getShadow()) + if(!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx index 0ae9483787..6dd57aff80 100644 --- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx +++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx @@ -33,10 +33,6 @@ #include #include #include -#include -#include -#include -#include #include ////////////////////////////////////////////////////////////////////////////// @@ -177,19 +173,6 @@ namespace drawinglayer return aRetVal.get() ? *aRetVal.get() : BitmapEx(); } - // #i99123# - Primitive2DReference createFallbackHitTestPrimitive(const basegfx::B2DHomMatrix& rMatrix) - { - // create PolygonHairlinePrimitive2D - basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0))); - aUnitOutline.transform(rMatrix); - const basegfx::BColor aBlack(0.0, 0.0, 0.0); - const Primitive2DReference xReference(new PolygonHairlinePrimitive2D(aUnitOutline, aBlack)); - - // create HitTestPrimitive2D with it - const Primitive2DSequence xSequence(&xReference, 1); - return Primitive2DReference(new HitTestPrimitive2D(xSequence)); - } } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx index 1e963e3244..fb14f3393a 100644 --- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx @@ -35,7 +35,8 @@ #include #include #include -#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -50,7 +51,6 @@ namespace drawinglayer Primitive2DSequence SdrRectanglePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DSequence aRetval; - Primitive2DSequence aHitTestContent; // create unit outline polygon const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect( @@ -59,64 +59,67 @@ namespace drawinglayer getCornerRadiusY())); // add fill - if(getSdrLFSTAttribute().getFill()) + if(!getSdrLFSTAttribute().getFill().isDefault()) { appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive( basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), - *getSdrLFSTAttribute().getFill(), + getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); } else if(getForceFillForHitTest()) { // if no fill and it's a text frame, create a fill for HitTest and // BoundRect fallback - appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, - createPolyPolygonFillPrimitive( - basegfx::B2DPolyPolygon(aUnitOutline), - getTransform(), - attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)), - getSdrLFSTAttribute().getFillFloatTransGradient())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + true, + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform())); } // add line - if(getSdrLFSTAttribute().getLine()) + if(!getSdrLFSTAttribute().getLine().isDefault()) { appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive( aUnitOutline, getTransform(), - *getSdrLFSTAttribute().getLine())); + getSdrLFSTAttribute().getLine(), + attribute::SdrLineStartEndAttribute())); } else if(!getForceFillForHitTest()) { // if initially no line is defined and it's not a text frame, create // a line for HitTest and BoundRect - appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent, - createPolygonLinePrimitive( - aUnitOutline, - getTransform(), - attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0)))); - } - - // add HitTest and BoundRect helper geometry (if exists) - if(aHitTestContent.hasElements()) - { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - Primitive2DReference(new HitTestPrimitive2D(aHitTestContent))); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + false, + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform())); } // add text - if(getSdrLFSTAttribute().getText()) + if(!getSdrLFSTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + basegfx::B2DPolyPolygon(aUnitOutline), + getTransform(), + getSdrLFSTAttribute().getText(), + getSdrLFSTAttribute().getLine(), + false, + false, + false)); } // add shadow - if(getSdrLFSTAttribute().getShadow()) + if(!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive( + aRetval, + getSdrLFSTAttribute().getShadow()); } return aRetval; diff --git a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx index aaa885fb2a..fd8d8f1a21 100644 --- a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx +++ b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx @@ -34,8 +34,11 @@ #include #include #include -#include +#include +#include #include +#include +#include ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/sdr/properties/oleproperties.cxx b/svx/source/sdr/properties/oleproperties.cxx new file mode 100644 index 0000000000..5c6fae24da --- /dev/null +++ b/svx/source/sdr/properties/oleproperties.cxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * 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: graphicproperties.cxx,v $ + * $Revision: 1.12.76.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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svx.hxx" + +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + OleProperties::OleProperties(SdrObject& rObj) + : RectangleProperties(rObj) + { + } + + OleProperties::OleProperties(const OleProperties& rProps, SdrObject& rObj) + : RectangleProperties(rProps, rObj) + { + } + + OleProperties::~OleProperties() + { + } + + BaseProperties& OleProperties::Clone(SdrObject& rObj) const + { + return *(new OleProperties(*this, rObj)); + } + + void OleProperties::ForceDefaultAttributes() + { + // call parent + RectangleProperties::ForceDefaultAttributes(); + + // force ItemSet + GetObjectItemSet(); + + // #i108221# + mpItemSet->Put( XFillStyleItem(XFILL_NONE) ); + mpItemSet->Put( XLineStyleItem(XLINE_NONE) ); + } + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 074045d4ef..35da9eb1f0 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -69,7 +69,7 @@ #include #include #include -#include +#include #include #include "svditer.hxx" #include @@ -78,13 +78,14 @@ #include #include #include -#include #include #include #include #include #include #include +#include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -726,8 +727,8 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay if(aResultTransparent.hasElements()) { - drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aResultTransparent, 0.5)); - aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1); + drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aResultTransparent, 0.5)); + aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1); sdr::overlay::OverlayObject* pNewOverlayObject = new sdr::overlay::OverlayPrimitive2DSequenceObject(aResultTransparent); rOverlayManager.add(*pNewOverlayObject); @@ -825,35 +826,22 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla if(getSolidDraggingActive()) { const SfxItemSet& rItemSet = pEdge->GetMergedItemSet(); - drawinglayer::attribute::SdrLineAttribute* pLine = drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet); - drawinglayer::attribute::SdrLineStartEndAttribute* pLineStartEnd = 0; + const drawinglayer::attribute::SdrLineAttribute aLine( + drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet)); - if(pLine && !pLine->isVisible()) + if(!aLine.isDefault()) { - delete pLine; - pLine = 0; - } - - if(pLine) - { - pLineStartEnd = drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(rItemSet, pLine->getWidth()); - - if(pLineStartEnd && !pLineStartEnd->isVisible()) - { - delete pLineStartEnd; - pLineStartEnd = 0; - } + const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd( + drawinglayer::primitive2d::createNewSdrLineStartEndAttribute( + rItemSet, + aLine.getWidth())); drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence( aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive( - aEdgePolygon, basegfx::B2DHomMatrix(), *pLine, pLineStartEnd)); - - if(pLineStartEnd) - { - delete pLineStartEnd; - } - - delete pLine; + aEdgePolygon, + basegfx::B2DHomMatrix(), + aLine, + aLineStartEnd)); } } else diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index ec5d5ba7ab..7c2680f3f0 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -808,16 +808,101 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) void SdrEditView::DeleteMarkedObj() { - if (GetMarkedObjectCount()) { - BrkAction(); - //HMHHideMarkHdl(); - BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE); + // moved breaking action and undo start outside loop + BrkAction(); + BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE); + + // remove as long as something is selected. This allows to schedule objects for + // removal for a next run as needed + while(GetMarkedObjectCount()) + { + // vector to remember the parents which may be empty after object removal + std::vector< SdrObject* > aParents; + + { + const SdrMarkList& rMarkList = GetMarkedObjectList(); + const sal_uInt32 nCount(rMarkList.GetMarkCount()); + sal_uInt32 a(0); + + for(a = 0; a < nCount; a++) + { + // in the first run, add all found parents, but only once + SdrMark* pMark = rMarkList.GetMark(a); + SdrObject* pObject = pMark->GetMarkedSdrObj(); + SdrObject* pParent = pObject->GetObjList()->GetOwnerObj(); + + if(pParent) + { + if(aParents.size()) + { + std::vector< SdrObject* >::iterator aFindResult = + std::find(aParents.begin(), aParents.end(), pParent); + + if(aFindResult == aParents.end()) + { + aParents.push_back(pParent); + } + } + else + { + aParents.push_back(pParent); + } + } + } + + if(aParents.size()) + { + // in a 2nd run, remove all objects which may already be scheduled for + // removal. I am not sure if this can happen, but theoretically + // a to-be-removed object may already be the group/3DScene itself + for(a = 0; a < nCount; a++) + { + SdrMark* pMark = rMarkList.GetMark(a); + SdrObject* pObject = pMark->GetMarkedSdrObj(); + + std::vector< SdrObject* >::iterator aFindResult = + std::find(aParents.begin(), aParents.end(), pObject); + + if(aFindResult != aParents.end()) + { + aParents.erase(aFindResult); + } + } + } + } + + // original stuff: remove selected objects. Handle clear will + // do something only once DeleteMarkedList(GetMarkedObjectList()); GetMarkedObjectListWriteAccess().Clear(); aHdl.Clear(); - EndUndo(); - MarkListHasChanged(); + + while(aParents.size() && !GetMarkedObjectCount()) + { + // iterate over remembered parents + SdrObject* pParent = aParents.back(); + aParents.pop_back(); + + if(pParent->GetSubList() && 0 == pParent->GetSubList()->GetObjCount()) + { + // we detected an empty parent, a candidate to leave group/3DScene + // if entered + if(GetSdrPageView()->GetAktGroup() + && GetSdrPageView()->GetAktGroup() == pParent) + { + GetSdrPageView()->LeaveOneGroup(); + } + + // schedule empty parent for removal + GetMarkedObjectListWriteAccess().InsertEntry( + SdrMark(pParent, GetSdrPageView())); + } + } } + + // end undo and change messaging moved at the end + EndUndo(); + MarkListHasChanged(); } void SdrEditView::CopyMarkedObj() diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 13b5f4a3a2..7ed63ce2fb 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -846,7 +846,7 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons } // geometry access -::basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const +basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const { return aTailPoly.getB2DPolygon(); } diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 70cfe07549..cba55f7740 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -166,6 +166,12 @@ void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const } +void SdrObjGroup::SetBoundRectDirty() +{ + // avoid resetting aOutRect which in case of this object is model data, + // not re-creatable view data +} + UINT16 SdrObjGroup::GetObjIdentifier() const { return UINT16(OBJ_GRUP); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 5daa6204b1..62f7f6a299 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -79,6 +79,7 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); } #include #include #include +#include using namespace sdr; @@ -2744,13 +2745,10 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index) SdrObject* SdrPathObj::DoConvertToPolyObj(BOOL bBezier) const { // #i89784# check for FontWork with activated HideContour - bool bHideContour(false); - - { - drawinglayer::attribute::SdrTextAttribute* pText = drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0)); - bHideContour = pText && pText->getSdrFormTextAttribute() && pText->isHideContour(); - delete pText; - } + const drawinglayer::attribute::SdrTextAttribute aText( + drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0))); + const bool bHideContour( + !aText.isDefault() && !aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour()); SdrObject* pRet = bHideContour ? 0 : diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index ecccd6fa42..452b24a607 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -66,7 +66,7 @@ #include #include #include -#include +#include #include #include #include @@ -230,7 +230,7 @@ namespace { class impPolygonParagraphHandler { - const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters + const drawinglayer::attribute::SdrFormTextAttribute maSdrFormTextAttribute; // FormText parameters std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator @@ -273,7 +273,7 @@ namespace const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute, std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition, std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition) - : mrSdrFormTextAttribute(rSdrFormTextAttribute), + : maSdrFormTextAttribute(rSdrFormTextAttribute), mrDecomposition(rDecomposition), mrShadowDecomposition(rShadowDecomposition) { @@ -297,18 +297,18 @@ namespace double fPolyStart(0.0); double fScaleFactor(1.0); - if(mrSdrFormTextAttribute.getFormTextMirror()) + if(maSdrFormTextAttribute.getFormTextMirror()) { aPolygonCandidate.flip(); } - if(mrSdrFormTextAttribute.getFormTextStart() - && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust() - || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())) + if(maSdrFormTextAttribute.getFormTextStart() + && (XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust() + || XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust())) { - if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust()) { - fPolyStart += mrSdrFormTextAttribute.getFormTextStart(); + fPolyStart += maSdrFormTextAttribute.getFormTextStart(); if(fPolyStart > fPolyEnd) { @@ -317,7 +317,7 @@ namespace } else { - fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart(); + fPolyEnd -= maSdrFormTextAttribute.getFormTextStart(); if(fPolyEnd < fPolyStart) { @@ -326,7 +326,7 @@ namespace } } - if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_LEFT != maSdrFormTextAttribute.getFormTextAdjust()) { // calculate total text length of this paragraph, some layout needs to be done const double fParagraphTextLength(getParagraphTextLength(rTextPortions)); @@ -335,7 +335,7 @@ namespace // but still take care of XFT_AUTOSIZE in that case const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart)); - if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust()) { if(!bTextTooLong) { @@ -343,7 +343,7 @@ namespace fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength); } } - else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust()) + else if(XFT_CENTER == maSdrFormTextAttribute.getFormTextAdjust()) { if(!bTextTooLong) { @@ -351,7 +351,7 @@ namespace fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0; } } - else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) + else if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust()) { // if scale, prepare scale factor between curve length and text length if(0.0 != fParagraphTextLength) @@ -386,7 +386,7 @@ namespace // prepare portion length. Takes RTL sections into account. double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen)); - if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust()) { // when scaling, expand portion length fPortionLength *= fScaleFactor; @@ -401,27 +401,27 @@ namespace aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY()); // prepare scaling of text primitive - if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust()) { // when scaling, expand text primitive scaling aNewTransformA.scale(fScaleFactor, fScaleFactor); } // eventually create shadow primitives from aDecomposition and add to rDecomposition - const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow()); + const bool bShadow(XFTSHADOW_NONE != maSdrFormTextAttribute.getFormTextShadow()); if(bShadow) { - if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow()) + if(XFTSHADOW_NORMAL == maSdrFormTextAttribute.getFormTextShadow()) { aNewShadowTransform.translate( - mrSdrFormTextAttribute.getFormTextShdwXVal(), - -mrSdrFormTextAttribute.getFormTextShdwYVal()); + maSdrFormTextAttribute.getFormTextShdwXVal(), + -maSdrFormTextAttribute.getFormTextShdwYVal()); } else // XFTSHADOW_SLANT { - double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0); - double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800); + double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0); + double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800); aNewShadowTransform.scale(1.0, fScaleValue); aNewShadowTransform.shearX(sin(fShearValue)); @@ -429,7 +429,7 @@ namespace } } - switch(mrSdrFormTextAttribute.getFormTextStyle()) + switch(maSdrFormTextAttribute.getFormTextStyle()) { case XFT_ROTATE : { @@ -487,7 +487,7 @@ namespace } // distance from path? - if(mrSdrFormTextAttribute.getFormTextDistance()) + if(maSdrFormTextAttribute.getFormTextDistance()) { if(aEndPos.equal(aStartPos)) { @@ -497,7 +497,7 @@ namespace // use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff const basegfx::B2DVector aPerpendicular( basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) * - mrSdrFormTextAttribute.getFormTextDistance()); + maSdrFormTextAttribute.getFormTextDistance()); aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY()); } @@ -506,7 +506,7 @@ namespace { if(pCandidate->getText().Len() && nNextGlyphLen) { - const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor()); + const Color aShadowColor(maSdrFormTextAttribute.getFormTextShdwColor()); const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen)); const ::std::vector< double > aNewDXArray( @@ -627,7 +627,7 @@ namespace { if(rOutlineAttribute.getTransparence()) { - // create UnifiedAlphaPrimitive2D + // create UnifiedTransparencePrimitive2D drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount); for(sal_uInt32 b(0L); b < nStrokeCount; b++) @@ -635,8 +635,8 @@ namespace aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]); } - drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 = - new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + drawinglayer::primitive2d::UnifiedTransparencePrimitive2D* pNew2 = + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( aStrokePrimitiveSequence, (double)rOutlineAttribute.getTransparence() / 100.0); aNewPrimitives.push_back(pNew2); @@ -716,7 +716,9 @@ void SdrTextObj::impDecomposePathTextPrimitive( std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition; std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition; impPolygonParagraphHandler aPolygonParagraphHandler( - rFormTextAttribute, aRegularDecomposition, aShadowDecomposition); + rFormTextAttribute, + aRegularDecomposition, + aShadowDecomposition); sal_uInt32 a; for(a = 0L; a < nLoopCount; a++) @@ -755,10 +757,14 @@ void SdrTextObj::impDecomposePathTextPrimitive( } // evtl. add shadow outlines - if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline()) + if(rFormTextAttribute.getFormTextOutline() + && !rFormTextAttribute.getShadowOutline().isDefault()) { const drawinglayer::primitive2d::Primitive2DSequence aOutlines( - impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline())); + impAddPathTextOutlines( + aShadowDecomposition, + rFormTextAttribute.getShadowOutline())); + drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines); } } @@ -774,10 +780,14 @@ void SdrTextObj::impDecomposePathTextPrimitive( } // evtl. add outlines - if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline()) + if(rFormTextAttribute.getFormTextOutline() + && !rFormTextAttribute.getOutline().isDefault()) { const drawinglayer::primitive2d::Primitive2DSequence aOutlines( - impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline())); + impAddPathTextOutlines( + aRegularDecomposition, + rFormTextAttribute.getOutline())); + drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines); } } diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 511616921c..7bf9ff3a85 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -50,7 +50,7 @@ #include #include #include -#include +#include namespace sdr { namespace table { @@ -245,10 +245,11 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb } else { - // embed in HitTest primitive to support HitTest of this overlay object + // embed in 100% transparent UnifiedTransparencePrimitive2D to support HitTest + // of this overlay object const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1); const drawinglayer::primitive2d::Primitive2DReference aNewReference( - new drawinglayer::primitive2d::HitTestPrimitive2D(aSequence)); + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aSequence, 1.0)); aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1); } } diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 70fd77ea1b..55776623b1 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -37,19 +37,20 @@ #include #include #include -#include #include #include #include -#include #include -#include #include #include -#include #include #include #include +#include +#include +#include +#include +#include #include "cell.hxx" #include "tablelayouter.hxx" @@ -99,31 +100,44 @@ namespace drawinglayer { Primitive2DSequence aRetval; - if(getSdrFTAttribute().getFill() || getSdrFTAttribute().getText()) + if(!getSdrFTAttribute().getFill().isDefault() + || !getSdrFTAttribute().getText().isDefault()) { // prepare unit polygon - const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0); - const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createPolygonFromRect(aUnitRange)); + const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createUnitPolygon()); // add fill - if(getSdrFTAttribute().getFill()) + if(!getSdrFTAttribute().getFill().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive( - aUnitPolyPolygon, - getTransform(), - *getSdrFTAttribute().getFill(), - getSdrFTAttribute().getFillFloatTransGradient())); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolyPolygonFillPrimitive( + aUnitPolyPolygon, + getTransform(), + getSdrFTAttribute().getFill(), + getSdrFTAttribute().getFillFloatTransGradient())); + } + else + { + // if no fill create one for HitTest and BoundRect fallback + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + true, + aUnitPolyPolygon, + getTransform())); } // add text - if(getSdrFTAttribute().getText()) + if(!getSdrFTAttribute().getText().isDefault()) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive( - aUnitPolyPolygon, - getTransform(), - *getSdrFTAttribute().getText(), - 0, - true, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + aUnitPolyPolygon, + getTransform(), + getSdrFTAttribute().getText(), + attribute::SdrLineAttribute(), + true, + false, + false)); } } @@ -539,14 +553,13 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfTableObj::createViewIndependentPrimitive2DSequence() const { - drawinglayer::primitive2d::Primitive2DSequence xRetval; const sdr::table::SdrTableObj& rTableObj = GetTableObj(); const uno::Reference< com::sun::star::table::XTable > xTable = rTableObj.getTable(); - const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet(); if(xTable.is()) { // create primitive representation for table + drawinglayer::primitive2d::Primitive2DSequence xRetval; const sal_Int32 nRowCount(xTable->getRowCount()); const sal_Int32 nColCount(xTable->getColumnCount()); const sal_Int32 nAllCount(nRowCount * nColCount); @@ -599,7 +612,7 @@ namespace sdr const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet(); const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol); const SdrText* pSdrText = rTableObj.getText(nTextIndex); - drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0; + drawinglayer::attribute::SdrFillTextAttribute aAttribute; if(pSdrText) { @@ -609,7 +622,7 @@ namespace sdr const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance()); const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance()); - pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( rCellItemSet, pSdrText, &nLeft, @@ -619,21 +632,17 @@ namespace sdr } else { - pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( rCellItemSet, pSdrText); } - if(pAttribute) + // always create cell primitives for BoundRect and HitTest { - if(pAttribute->isVisible()) - { - const drawinglayer::primitive2d::Primitive2DReference xCellReference(new drawinglayer::primitive2d::SdrCellPrimitive2D( - aCellMatrix, *pAttribute)); - xCellSequence[nCellInsert++] = xCellReference; - } - - delete pAttribute; + const drawinglayer::primitive2d::Primitive2DReference xCellReference( + new drawinglayer::primitive2d::SdrCellPrimitive2D( + aCellMatrix, aAttribute)); + xCellSequence[nCellInsert++] = xCellReference; } // handle cell borders @@ -678,21 +687,46 @@ namespace sdr xRetval = xCellSequence; drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, xBorderSequence); } - } - if(xRetval.hasElements()) - { - // check and create evtl. shadow for created content - drawinglayer::attribute::SdrShadowAttribute* pNewShadowAttribute = drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet); - - if(pNewShadowAttribute) + if(xRetval.hasElements()) { - xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute); - delete pNewShadowAttribute; + // check and create evtl. shadow for created content + const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet(); + const drawinglayer::attribute::SdrShadowAttribute aNewShadowAttribute( + drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet)); + + if(!aNewShadowAttribute.isDefault()) + { + xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, aNewShadowAttribute); + } } - } - return xRetval; + return xRetval; + } + else + { + // take unrotated snap rect (direct model data) for position and size + const Rectangle& rRectangle = rTableObj.GetGeoRect(); + const basegfx::B2DRange aObjectRange( + rRectangle.Left(), rRectangle.Top(), + rRectangle.Right(), rRectangle.Bottom()); + + // create object matrix + const GeoStat& rGeoStat(rTableObj.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); + const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate, + aObjectRange.getMinX(), aObjectRange.getMinY())); + + // credate an invisible outline for the cases where no visible content exists + const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( + false, + aObjectMatrix)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } } ViewContactOfTableObj::ViewContactOfTableObj(::sdr::table::SdrTableObj& rTableObj) -- cgit v1.2.3 From cce7fc0948b93019968ce8bb8f04620af05b728a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 28 Jan 2010 14:12:41 +0100 Subject: autorecovery: merged DocumentMacroConfirmationRequest2 into DocumentMacroConfirmationRequest - no need to have two types which are effectively the same, and both rarely used --- sfx2/source/doc/objmisc.cxx | 6 +++--- uui/source/iahndl.cxx | 24 +++++------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 49c3491e77..90f77bfd11 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -87,7 +87,7 @@ #include #include -#include +#include #include #include @@ -2441,9 +2441,9 @@ sal_Bool SfxObjectShell_Impl::hasTrustedScriptingSignature( sal_Bool bAllowUIToA if ( xInteraction.is() ) { - task::DocumentMacroConfirmationRequest2 aRequest; + task::DocumentMacroConfirmationRequest aRequest; aRequest.DocumentURL = getDocumentLocation(); - aRequest.DocumentZipStorage = rDocShell.GetMedium()->GetZipStorageToSign_Impl(); + aRequest.DocumentStorage = rDocShell.GetMedium()->GetZipStorageToSign_Impl(); aRequest.DocumentSignatureInformation = aInfo; aRequest.DocumentVersion = aVersion; aRequest.Classification = task::InteractionClassification_QUERY; diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index cc65580aec..916f217bf0 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -69,7 +69,6 @@ #include "com/sun/star/task/MasterPasswordRequest.hpp" #include "com/sun/star/task/NoMasterException.hpp" #include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp" -#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" #include "com/sun/star/task/XInteractionApprove.hpp" #include "com/sun/star/task/XInteractionDisapprove.hpp" @@ -1286,26 +1285,13 @@ bool UUIInteractionHelper::handleErrorHandlerRequests( handleMacroConfirmRequest( aMacroConfirmRequest.DocumentURL, aMacroConfirmRequest.DocumentStorage, - ODFVER_012_TEXT, + aMacroConfirmRequest.DocumentVersion.getLength() ? aMacroConfirmRequest.DocumentVersion : ODFVER_012_TEXT, aMacroConfirmRequest.DocumentSignatureInformation, rRequest->getContinuations() ); return true; } - star::task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2; - if (aAnyRequest >>= aMacroConfirmRequest2) - { - handleMacroConfirmRequest( - aMacroConfirmRequest2.DocumentURL, - aMacroConfirmRequest2.DocumentZipStorage, - aMacroConfirmRequest2.DocumentVersion, - aMacroConfirmRequest2.DocumentSignatureInformation, - rRequest->getContinuations() - ); - return true; - } - FutureDocumentVersionProductUpdateRequest aProductUpdateRequest; if (aAnyRequest >>= aProductUpdateRequest) { @@ -1378,10 +1364,10 @@ UUIInteractionHelper::handle_impl( OSL_ENSURE( xInitialization.is(), "Custom Interactionhandler does not implement mandatory interface XInitialization!" ); if (xInitialization.is()) { - uno::Sequence< uno::Any > propertyValues(1); - beans::PropertyValue aProperty; - - aProperty.Name = rtl::OUString::createFromAscii( "Parent" ); + uno::Sequence< uno::Any > propertyValues(1); + beans::PropertyValue aProperty; + + aProperty.Name = rtl::OUString::createFromAscii( "Parent" ); aProperty.Value <<= getParentXWindow(); propertyValues[ 0 ] <<= aProperty; -- cgit v1.2.3 From 6673f7075dee95ef4ccdda9b0847f57055d83d4f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 28 Jan 2010 15:31:27 +0100 Subject: autorecovery: NotifyModifyListeners_Impl is called to generously, ensure that m_bModifiedSinceLastSave is properly set --- sfx2/source/doc/sfxbasemodel.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 75963a11bb..2a613dd107 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2549,7 +2549,9 @@ void SfxBaseModel::NotifyModifyListeners_Impl() const pIC->notifyEach( &util::XModifyListener::modified, aEvent ); } - m_pData->m_bModifiedSinceLastSave = sal_True; + // this notification here is done too generously, we cannot simply assume that we're really modified + // now, but we need to check it ... + m_pData->m_bModifiedSinceLastSave = const_cast< SfxBaseModel* >( this )->isModified(); } void SfxBaseModel::changing() -- cgit v1.2.3 From 4d8d6236116de46959d39c57f2f44b59fedfe5d7 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 28 Jan 2010 17:21:44 +0100 Subject: aw079: #i99147# corrected diverse aspects of invisible object visualisation and interaction --- .../source/processor2d/hittestprocessor2d.cxx | 44 ++++++++++++++ svx/inc/svx/cube3d.hxx | 5 +- svx/inc/svx/extrud3d.hxx | 7 +-- svx/inc/svx/lathe3d.hxx | 7 +-- svx/inc/svx/obj3d.hxx | 10 ++-- svx/inc/svx/polygn3d.hxx | 6 +- svx/inc/svx/scene3d.hxx | 9 +-- svx/inc/svx/sdrmasterpagedescriptor.hxx | 5 +- svx/inc/svx/sphere3d.hxx | 7 +-- svx/inc/svx/svdoashp.hxx | 11 ++-- svx/inc/svx/svdoattr.hxx | 5 +- svx/inc/svx/svdobj.hxx | 2 + svx/inc/svx/svdocapt.hxx | 7 +-- svx/inc/svx/svdocirc.hxx | 9 +-- svx/inc/svx/svdoedge.hxx | 7 +-- svx/inc/svx/svdograf.hxx | 10 +--- svx/inc/svx/svdogrp.hxx | 7 +-- svx/inc/svx/svdomeas.hxx | 7 +-- svx/inc/svx/svdomedia.hxx | 3 +- svx/inc/svx/svdoole2.hxx | 5 +- svx/inc/svx/svdopage.hxx | 11 ++-- svx/inc/svx/svdopath.hxx | 5 +- svx/inc/svx/svdorect.hxx | 11 +--- svx/inc/svx/svdotable.hxx | 8 +-- svx/inc/svx/svdotext.hxx | 8 +-- svx/inc/svx/svdovirt.hxx | 4 +- svx/inc/svx/svdpage.hxx | 1 + svx/source/customshapes/EnhancedCustomShape2d.cxx | 13 ---- svx/source/sdr/properties/makefile.mk | 1 + svx/source/svdraw/sdrmasterpagedescriptor.cxx | 3 +- svx/source/svdraw/svddrgmt.cxx | 15 ++++- svx/source/svdraw/svdhdl.cxx | 4 +- svx/source/svdraw/svdobj.cxx | 6 +- svx/source/svdraw/svdogrp.cxx | 2 +- svx/source/svdraw/svdoole2.cxx | 9 +++ svx/source/svdraw/svdpage.cxx | 3 +- svx/source/table/svdotable.cxx | 2 +- svx/source/table/tablehandles.cxx | 8 +-- svx/source/table/viewcontactoftableobj.cxx | 69 ++++++++++------------ 39 files changed, 181 insertions(+), 175 deletions(-) diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx index 81b37424dd..c97cdcf0f7 100644 --- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx +++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx @@ -50,6 +50,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -487,6 +488,49 @@ namespace drawinglayer break; } case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D : + { + if(!getHitTextOnly()) + { + // The recently added BitmapEx::GetTransparency() makes it easy to extend + // the BitmapPrimitive2D HitTest to take the contained BotmapEx and it's + // transparency into account + const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D())); + + if(!aRange.isEmpty()) + { + const primitive2d::BitmapPrimitive2D& rBitmapCandidate(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate)); + const BitmapEx& rBitmapEx = rBitmapCandidate.getBitmapEx(); + const Size& rSizePixel(rBitmapEx.GetSizePixel()); + + if(rSizePixel.Width() && rSizePixel.Height()) + { + basegfx::B2DHomMatrix aBackTransform( + getViewInformation2D().getObjectToViewTransformation() * + rBitmapCandidate.getTransform()); + aBackTransform.invert(); + + const basegfx::B2DPoint aRelativePoint(aBackTransform * getDiscreteHitPosition()); + const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0); + + if(aUnitRange.isInside(aRelativePoint)) + { + const sal_Int32 nX(basegfx::fround(aRelativePoint.getX() * rSizePixel.Width())); + const sal_Int32 nY(basegfx::fround(aRelativePoint.getY() * rSizePixel.Height())); + + mbHit = (0xff != rBitmapEx.GetTransparency(nX, nY)); + } + } + else + { + // fallback to standard HitTest + const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange)); + mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance()); + } + } + } + + break; + } case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D : case PRIMITIVE2D_ID_CONTROLPRIMITIVE2D : case PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D : diff --git a/svx/inc/svx/cube3d.hxx b/svx/inc/svx/cube3d.hxx index b280128fc8..409f7d8ca1 100644 --- a/svx/inc/svx/cube3d.hxx +++ b/svx/inc/svx/cube3d.hxx @@ -55,10 +55,6 @@ enum { CUBE_BOTTOM = 0x0001, CUBE_BACK = 0x0002, CUBE_LEFT = 0x0004, class SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject { private: - // Zur Geometrieerzeugung eines Cubes notwendige - // #110094# DrawContact section - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - // Parameter basegfx::B3DPoint aCubePos; basegfx::B3DVector aCubeSize; @@ -69,6 +65,7 @@ private: protected: void SetDefaultAttributes(E3dDefaultAttributes& rDefault); + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); public: TYPEINFO(); diff --git a/svx/inc/svx/extrud3d.hxx b/svx/inc/svx/extrud3d.hxx index 4d5d62e145..b644e3b038 100644 --- a/svx/inc/svx/extrud3d.hxx +++ b/svx/inc/svx/extrud3d.hxx @@ -43,11 +43,6 @@ class SVX_DLLPUBLIC E3dExtrudeObj : public E3dCompoundObject { private: - // #110094# DrawContact section - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - // to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid() friend class sdr::properties::E3dExtrudeProperties; @@ -55,6 +50,8 @@ private: basegfx::B2DPolyPolygon maExtrudePolygon; protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); void SetDefaultAttributes(E3dDefaultAttributes& rDefault); public: diff --git a/svx/inc/svx/lathe3d.hxx b/svx/inc/svx/lathe3d.hxx index c87e6f1983..472cfb77bc 100644 --- a/svx/inc/svx/lathe3d.hxx +++ b/svx/inc/svx/lathe3d.hxx @@ -47,16 +47,13 @@ class SVX_DLLPUBLIC E3dLatheObj : public E3dCompoundObject { private: - // #110094# DrawContact section - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - // Partcodes fuer Wireframe-Generierung: Standard oder Deckelflaeche enum { LATHE_PART_STD = 1, LATHE_PART_COVER = 2 }; basegfx::B2DPolyPolygon maPolyPoly2D; protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); void SetDefaultAttributes(E3dDefaultAttributes& rDefault); public: diff --git a/svx/inc/svx/obj3d.hxx b/svx/inc/svx/obj3d.hxx index 7a6e48a909..7ca9e0371c 100644 --- a/svx/inc/svx/obj3d.hxx +++ b/svx/inc/svx/obj3d.hxx @@ -109,8 +109,7 @@ public: class SVX_DLLPUBLIC E3dObject : public SdrAttrObj { - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - +private: // to allow sdr::properties::E3dProperties access to StructureChanged() friend class sdr::properties::E3dProperties; @@ -119,6 +118,8 @@ class SVX_DLLPUBLIC E3dObject : public SdrAttrObj friend class E3dDragMethod; protected: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); + E3dObjList maSubList; // Subliste (Childobjekte) basegfx::B3DRange maLocalBoundVol; // umschliessendes Volumen des Objekts (aus geometrieerzeugung) @@ -223,8 +224,7 @@ public: class SVX_DLLPUBLIC E3dCompoundObject : public E3dObject { - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - +private: // to allow sdr::properties::E3dCompoundProperties access to SetGeometryValid() friend class sdr::properties::E3dCompoundProperties; friend class sdr::properties::E3dExtrudeProperties; @@ -232,6 +232,8 @@ class SVX_DLLPUBLIC E3dCompoundObject : public E3dObject friend class sdr::properties::E3dSphereProperties; protected: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); + // Material des Objektes Color aMaterialAmbientColor; diff --git a/svx/inc/svx/polygn3d.hxx b/svx/inc/svx/polygn3d.hxx index 63ceee30cc..b87ca83b44 100644 --- a/svx/inc/svx/polygn3d.hxx +++ b/svx/inc/svx/polygn3d.hxx @@ -37,9 +37,6 @@ class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject { private: - // #110094# DrawContact section - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - // Parameter basegfx::B3DPolyPolygon aPolyPoly3D; basegfx::B3DPolyPolygon aPolyNormals3D; @@ -49,6 +46,9 @@ private: SVX_DLLPRIVATE void CreateDefaultNormals(); SVX_DLLPRIVATE void CreateDefaultTexture(); +protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + public: void SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D); void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D); diff --git a/svx/inc/svx/scene3d.hxx b/svx/inc/svx/scene3d.hxx index 5f6374c47d..82c23d89bc 100644 --- a/svx/inc/svx/scene3d.hxx +++ b/svx/inc/svx/scene3d.hxx @@ -71,17 +71,14 @@ class Imp3DDepthRemapper; class SVX_DLLPUBLIC E3dScene : public E3dObject { - // BaseProperties section - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - +private: // to allow sdr::properties::E3dSceneProperties access to StructureChanged() friend class sdr::properties::E3dSceneProperties; - // #110094# DrawContact section -private: +protected: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); -protected: // Transformationen B3dCamera aCameraSet; Camera3D aCamera; diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx index f7eb05fb18..5c6481f359 100644 --- a/svx/inc/svx/sdrmasterpagedescriptor.hxx +++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx @@ -52,17 +52,20 @@ namespace sdr { class MasterPageDescriptor : public sdr::PageUser { + private: SdrPage& maOwnerPage; SdrPage& maUsedPage; SetOfByte maVisibleLayers; // ViewContact part sdr::contact::ViewContact* mpViewContact; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); // assignment operator defined, but not implemented void operator=(const MasterPageDescriptor& rCandidate); + protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + public: MasterPageDescriptor(SdrPage& aOwnerPage, SdrPage& aUsedPage); virtual ~MasterPageDescriptor(); diff --git a/svx/inc/svx/sphere3d.hxx b/svx/inc/svx/sphere3d.hxx index 38f78eca52..1609de5329 100644 --- a/svx/inc/svx/sphere3d.hxx +++ b/svx/inc/svx/sphere3d.hxx @@ -44,15 +44,12 @@ class SVX_DLLPUBLIC E3dSphereObj : public E3dCompoundObject { private: - // #110094# DrawContact section - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - basegfx::B3DPoint aCenter; basegfx::B3DVector aSize; protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); void SetDefaultAttributes(E3dDefaultAttributes& rDefault); public: diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx index 6ce8f54039..15bda2b725 100644 --- a/svx/inc/svx/svdoashp.hxx +++ b/svx/inc/svx/svdoashp.hxx @@ -88,15 +88,16 @@ struct SdrCustomShapeInteraction class SVX_DLLPUBLIC SdrObjCustomShape : public SdrTextObj { +private: // fObjectRotation is containing the object rotation in degrees. double fObjectRotation; -private: - // BaseProperties section - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); +public: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); + // to allow sdr::properties::CustomShapeProperties access friend class sdr::properties::CustomShapeProperties; @@ -179,7 +180,7 @@ public: virtual UINT16 GetObjIdentifier() const; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; - virtual void SetModel(SdrModel* pNewModel); + virtual void SetModel(SdrModel* pNewModel); virtual void RecalcSnapRect(); diff --git a/svx/inc/svx/svdoattr.hxx b/svx/inc/svx/svdoattr.hxx index ca84262c7b..8b843fb1bb 100644 --- a/svx/inc/svx/svdoattr.hxx +++ b/svx/inc/svx/svdoattr.hxx @@ -55,11 +55,12 @@ class SfxItemPool; class SVX_DLLPUBLIC SdrAttrObj : public SdrObject { - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - +private: friend class SdrOutliner; protected: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); + Rectangle maSnapRect; protected: diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index 548d78a778..ac4c831b9e 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -426,6 +426,7 @@ public: // BaseProperties section private: sdr::properties::BaseProperties* mpProperties; +protected: virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); public: virtual sdr::properties::BaseProperties& GetProperties() const; @@ -434,6 +435,7 @@ public: // #110094# DrawContact section private: sdr::contact::ViewContact* mpViewContact; +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); public: sdr::contact::ViewContact& GetViewContact() const; diff --git a/svx/inc/svx/svdocapt.hxx b/svx/inc/svx/svdocapt.hxx index e2cecd0579..c5d2ca11f6 100644 --- a/svx/inc/svx/svdocapt.hxx +++ b/svx/inc/svx/svdocapt.hxx @@ -63,19 +63,16 @@ public: class SVX_DLLPUBLIC SdrCaptionObj : public SdrRectObj { - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); private: - // to allow sdr::properties::CaptionProperties access to ImpRecalcTail() friend class sdr::properties::CaptionProperties; - friend class SdrTextObj; // fuer ImpRecalcTail() bei AutoGrow protected: - // DrawContact section -private: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); +private: Polygon aTailPoly; // das ganze Polygon des Schwanzes sal_Bool mbSpecialTextBoxShadow; // for calc special shadow, default FALSE sal_Bool mbFixedTail; // for calc note box fixed tail, default FALSE diff --git a/svx/inc/svx/svdocirc.hxx b/svx/inc/svx/svdocirc.hxx index 7fff0c36db..e5498cf3e3 100644 --- a/svx/inc/svx/svdocirc.hxx +++ b/svx/inc/svx/svdocirc.hxx @@ -61,20 +61,17 @@ public: class SVX_DLLPUBLIC SdrCircObj : public SdrRectObj { private: - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - // to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo() friend class sdr::properties::CircleProperties; // only for SdrCircleAttributes SdrObjKind GetCircleKind() const { return meCircleKind; } - // DrawContact section -private: +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); -protected: - SdrObjKind meCircleKind; + SdrObjKind meCircleKind; long nStartWink; long nEndWink; diff --git a/svx/inc/svx/svdoedge.hxx b/svx/inc/svx/svdoedge.hxx index 0f5366d5b1..1be3ed4f6a 100644 --- a/svx/inc/svx/svdoedge.hxx +++ b/svx/inc/svx/svdoedge.hxx @@ -160,19 +160,16 @@ public: class SVX_DLLPUBLIC SdrEdgeObj : public SdrTextObj { private: - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - // to allow sdr::properties::ConnectorProperties access to ImpSetAttrToEdgeInfo() friend class sdr::properties::ConnectorProperties; friend class SdrCreateView; friend class ImpEdgeHdl; - // DrawContact section -private: +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); -protected: SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs SdrObjConnection aCon2; // Verbindungszustand des Linienendes diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx index 8a81917dfe..1cf9101ba6 100644 --- a/svx/inc/svx/svdograf.hxx +++ b/svx/inc/svx/svdograf.hxx @@ -88,22 +88,16 @@ class SdrGraphicLink; class SVX_DLLPUBLIC SdrGrafObj : public SdrRectObj { private: - // BaseProperties section - SVX_DLLPRIVATE virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - - // DrawContact section -private: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - // to allow sdr::properties::GraphicProperties access to SetXPolyDirty() friend class sdr::properties::GraphicProperties; // to allow sdr::contact::ViewObjectContactOfGraphic access to ImpUpdateGraphicLink() friend class sdr::contact::ViewObjectContactOfGraphic; - friend class SdrGraphicLink; protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); void ImpSetAttrToGrafInfo(); // Werte vom Pool kopieren void ImpSetGrafInfoToAttr(); // Werte in den Pool kopieren diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx index ab7b8b926b..15d6de760b 100644 --- a/svx/inc/svx/svdogrp.hxx +++ b/svx/inc/svx/svdogrp.hxx @@ -49,14 +49,11 @@ class SfxItemSet; class SVX_DLLPUBLIC SdrObjGroup : public SdrObject { - // BaseProperties section - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - - // #110094# DrawContact section private: +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); -protected: SdrObjList* pSub; // Subliste (Kinder) long nDrehWink; long nShearWink; diff --git a/svx/inc/svx/svdomeas.hxx b/svx/inc/svx/svdomeas.hxx index e410904fe5..22bde06558 100644 --- a/svx/inc/svx/svdomeas.hxx +++ b/svx/inc/svx/svdomeas.hxx @@ -68,18 +68,15 @@ public: class SVX_DLLPUBLIC SdrMeasureObj : public SdrTextObj { private: - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - // to allow sdr::properties::MeasureProperties access to SetTextDirty() friend class sdr::properties::MeasureProperties; friend class SdrMeasureField; - // DrawContact section -private: +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); -protected: Point aPt1; Point aPt2; FASTBOOL bTextDirty; diff --git a/svx/inc/svx/svdomedia.hxx b/svx/inc/svx/svdomedia.hxx index 14bbfac260..bfb52acf6a 100644 --- a/svx/inc/svx/svdomedia.hxx +++ b/svx/inc/svx/svdomedia.hxx @@ -83,11 +83,10 @@ public: protected: virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState ); + virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact(); private: - virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - ::avmedia::MediaItem maMediaProperties; ::std::auto_ptr< Graphic > mapGraphic; }; diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx index 41157116b3..024154ee81 100644 --- a/svx/inc/svx/svdoole2.hxx +++ b/svx/inc/svx/svdoole2.hxx @@ -62,11 +62,10 @@ private: SVX_DLLPRIVATE void GetObjRef_Impl(); SVX_DLLPRIVATE void SetGraphic_Impl(const Graphic* pGrf); - // DrawContact section -private: +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); -protected: svt::EmbeddedObjectRef xObjRef; Graphic* pGraphic; String aProgName; diff --git a/svx/inc/svx/svdopage.hxx b/svx/inc/svx/svdopage.hxx index 763f5b9a72..ae3d1ce3a5 100644 --- a/svx/inc/svx/svdopage.hxx +++ b/svx/inc/svx/svdopage.hxx @@ -44,17 +44,14 @@ public: virtual void PageInDestruction(const SdrPage& rPage); private: - // BaseProperties section - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - - // DrawContact section -private: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - // #111111# // To make things more safe, remember the page, not a number SdrPage* mpShownPage; +protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); + public: TYPEINFO(); SdrPageObj(SdrPage* pNewPage = 0L); diff --git a/svx/inc/svx/svdopath.hxx b/svx/inc/svx/svdopath.hxx index b59ee4b84b..369249fe09 100644 --- a/svx/inc/svx/svdopath.hxx +++ b/svx/inc/svx/svdopath.hxx @@ -65,13 +65,12 @@ public: class SVX_DLLPUBLIC SdrPathObj : public SdrTextObj { +private: friend class ImpPathForDragAndCreate; - // DrawContact section -private: +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); -protected: basegfx::B2DPolyPolygon maPathPolygon; SdrObjKind meKind; diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx index 9942941d04..66ad72320e 100644 --- a/svx/inc/svx/svdorect.hxx +++ b/svx/inc/svx/svdorect.hxx @@ -54,19 +54,14 @@ namespace sdr { namespace properties { class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj { private: - // BaseProperties section - virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - // to allow sdr::properties::RectangleProperties access to SetXPolyDirty() friend class sdr::properties::RectangleProperties; - - // DrawContact section -private: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); - friend class SdrTextObj; // wg SetXPolyDirty bei GrowAdjust protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); + XPolygon* mpXPoly; protected: diff --git a/svx/inc/svx/svdotable.hxx b/svx/inc/svx/svdotable.hxx index f14695ca48..48f091cd6e 100644 --- a/svx/inc/svx/svdotable.hxx +++ b/svx/inc/svx/svdotable.hxx @@ -315,14 +315,10 @@ public: private: void init( sal_Int32 nColumns, sal_Int32 nRows ); - // BaseProperties section - SVX_DLLPRIVATE virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - - // DrawContact section -private: +protected: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); -protected: virtual SdrObjGeoData* NewGeoData() const; virtual void SaveGeoData(SdrObjGeoData& rGeo) const; virtual void RestGeoData(const SdrObjGeoData& rGeo); diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx index abe9978730..9a2d2c9058 100644 --- a/svx/inc/svx/svdotext.hxx +++ b/svx/inc/svx/svdotext.hxx @@ -145,13 +145,11 @@ private: // CustomShapeproperties need to access the "bTextFrame" member: friend class sdr::properties::CustomShapeProperties; - // BaseProperties section - SVX_DLLPRIVATE virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - - // DrawContact section -private: +protected: + virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); +private: // This method is only allowed for sdr::properties::TextProperties SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const { diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx index b055c37dc7..18457ee735 100644 --- a/svx/inc/svx/svdovirt.hxx +++ b/svx/inc/svx/svdovirt.hxx @@ -49,11 +49,9 @@ class SVX_DLLPUBLIC SdrVirtObj : public SdrObject public: virtual sdr::properties::BaseProperties& GetProperties() const; -private: - // AW, OD 2004-05-03 #i27224# +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); -protected: SdrObject& rRefObj; // Referenziertes Zeichenobjekt Rectangle aSnapRect; diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx index 6723a7a1ba..123a73f13c 100644 --- a/svx/inc/svx/svdpage.hxx +++ b/svx/inc/svx/svdpage.hxx @@ -403,6 +403,7 @@ public: // #110094# DrawContact section private: sdr::contact::ViewContact* mpViewContact; +protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); public: sdr::contact::ViewContact& GetViewContact() const; diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index eba03cd9ea..d0ce4b49e9 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -1709,19 +1709,6 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm if(aNewB2DPolyPolygon.count()) { - if( !bLineGeometryNeededOnly ) - { - // hack aNewB2DPolyPolygon to fill logic rect - this is - // needed to produce gradient fills that look like mso - aNewB2DPolygon.clear(); - aNewB2DPolygon.append(basegfx::B2DPoint(0,0)); - aNewB2DPolyPolygon.append(aNewB2DPolygon); - - aNewB2DPolygon.clear(); - aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(), - aLogicRect.GetHeight())); - aNewB2DPolyPolygon.append(aNewB2DPolygon); - } // #i37011# bool bForceCreateTwoObjects(false); diff --git a/svx/source/sdr/properties/makefile.mk b/svx/source/sdr/properties/makefile.mk index 04e96dd6c2..8e0fe5955a 100644 --- a/svx/source/sdr/properties/makefile.mk +++ b/svx/source/sdr/properties/makefile.mk @@ -51,6 +51,7 @@ SLOFILES=\ $(SLO)$/textproperties.obj \ $(SLO)$/customshapeproperties.obj \ $(SLO)$/rectangleproperties.obj \ + $(SLO)$/oleproperties.obj \ $(SLO)$/captionproperties.obj \ $(SLO)$/circleproperties.obj \ $(SLO)$/connectorproperties.obj \ diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index befbc27f98..eb9768b3ac 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -76,7 +76,8 @@ namespace sdr { if(!mpViewContact) { - ((MasterPageDescriptor*)this)->mpViewContact = ((MasterPageDescriptor*)this)->CreateObjectSpecificViewContact(); + const_cast< MasterPageDescriptor* >(this)->mpViewContact = + const_cast< MasterPageDescriptor* >(this)->CreateObjectSpecificViewContact(); } return *mpViewContact; diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 35da9eb1f0..da32cb08a0 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -678,7 +678,7 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay createSdrDragEntries(); } - // if there are entries, derive OverlayObjects fromthe entries, including + // if there are entries, derive OverlayObjects from the entries, including // modification from current interactive state if(maSdrDragEntries.size()) { @@ -823,7 +823,18 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla // this polygon is a temporary calculated connector path, so it is not possible to fetch // the needed primitives directly from the pEdge object which does not get changed. If full // drag is on, use the SdrObjects ItemSet to create a adequate representation - if(getSolidDraggingActive()) + bool bUseSolidDragging(getSolidDraggingActive()); + + if(bUseSolidDragging) + { + // switch off solid dragging if connector is not visible + if(!pEdge->HasLineStyle()) + { + bUseSolidDragging = false; + } + } + + if(bUseSolidDragging) { const SfxItemSet& rItemSet = pEdge->GetMergedItemSet(); const drawinglayer::attribute::SdrLineAttribute aLine( diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index f5df1658b3..2433f93507 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -284,13 +284,13 @@ SdrHdlBitmapSet& getSimpleSet() SdrHdlBitmapSet& getModernSet() { - static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS)); return *aModernSet.get(); } SdrHdlBitmapSet& getHighContrastSet() { - static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS)); return *aHighContrastSet.get(); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 8261f917dd..a586aed5dc 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -329,7 +329,8 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const { if(!mpProperties) { - ((SdrObject*)this)->mpProperties = ((SdrObject*)this)->CreateObjectSpecificProperties(); + const_cast< SdrObject* >(this)->mpProperties = + const_cast< SdrObject* >(this)->CreateObjectSpecificProperties(); } return *mpProperties; @@ -364,7 +365,8 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const { if(!mpViewContact) { - ((SdrObject*)this)->mpViewContact = ((SdrObject*)this)->CreateObjectSpecificViewContact(); + const_cast< SdrObject* >(this)->mpViewContact = + const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact(); } return *mpViewContact; diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index cba55f7740..348d637c9d 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -83,7 +83,7 @@ sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties() { - return new sdr::properties::GroupProperties((SdrObject&)(*this)); + return new sdr::properties::GroupProperties(*this); } ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 7f2dde332a..b09906057a 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -89,6 +89,7 @@ #include #include #include +#include // #i100710# #include @@ -735,6 +736,14 @@ static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObj } } +////////////////////////////////////////////////////////////////////////////// +// BaseProperties section + +sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties() +{ + return new sdr::properties::OleProperties(*this); +} + ////////////////////////////////////////////////////////////////////////////// // DrawContact section diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 4276f2c950..1ed0dee8f6 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1168,7 +1168,8 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const { if(!mpViewContact) { - ((SdrPage*)this)->mpViewContact = ((SdrPage*)this)->CreateObjectSpecificViewContact(); + const_cast< SdrPage* >(this)->mpViewContact = + const_cast< SdrPage* >(this)->CreateObjectSpecificViewContact(); } return *mpViewContact; diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 00d09251cd..9de408faac 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -2575,7 +2575,7 @@ basegfx::B2DPolyPolygon SdrTableObj::getSpecialDragPoly(const SdrDragStat& rDrag basegfx::B2DPolyPolygon aRetval; const SdrHdl* pHdl = rDrag.GetHdl(); - if(HDL_USER == pHdl->GetKind()) + if(pHdl && HDL_USER == pHdl->GetKind()) { const TableEdgeHdl* pEdgeHdl = dynamic_cast< const TableEdgeHdl* >( pHdl ); diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 7bf9ff3a85..819e68836b 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -50,7 +50,7 @@ #include #include #include -#include +#include namespace sdr { namespace table { @@ -245,11 +245,11 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb } else { - // embed in 100% transparent UnifiedTransparencePrimitive2D to support HitTest - // of this overlay object + // embed in HiddenGeometryPrimitive2D to support HitTest of this invisible + // overlay object const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1); const drawinglayer::primitive2d::Primitive2DReference aNewReference( - new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aSequence, 1.0)); + new drawinglayer::primitive2d::HiddenGeometryPrimitive2D(aSequence)); aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1); } } diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 55776623b1..0e108ed469 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -98,47 +98,42 @@ namespace drawinglayer Primitive2DSequence SdrCellPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const { + // prepare unit polygon Primitive2DSequence aRetval; + const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createUnitPolygon()); - if(!getSdrFTAttribute().getFill().isDefault() - || !getSdrFTAttribute().getText().isDefault()) + // add fill + if(!getSdrFTAttribute().getFill().isDefault()) { - // prepare unit polygon - const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createUnitPolygon()); - - // add fill - if(!getSdrFTAttribute().getFill().isDefault()) - { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createPolyPolygonFillPrimitive( - aUnitPolyPolygon, - getTransform(), - getSdrFTAttribute().getFill(), - getSdrFTAttribute().getFillFloatTransGradient())); - } - else - { - // if no fill create one for HitTest and BoundRect fallback - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createHiddenGeometryPrimitives2D( - true, - aUnitPolyPolygon, - getTransform())); - } + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createPolyPolygonFillPrimitive( + aUnitPolyPolygon, + getTransform(), + getSdrFTAttribute().getFill(), + getSdrFTAttribute().getFillFloatTransGradient())); + } + else + { + // if no fill create one for HitTest and BoundRect fallback + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createHiddenGeometryPrimitives2D( + true, + aUnitPolyPolygon, + getTransform())); + } - // add text - if(!getSdrFTAttribute().getText().isDefault()) - { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, - createTextPrimitive( - aUnitPolyPolygon, - getTransform(), - getSdrFTAttribute().getText(), - attribute::SdrLineAttribute(), - true, - false, - false)); - } + // add text + if(!getSdrFTAttribute().getText().isDefault()) + { + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, + createTextPrimitive( + aUnitPolyPolygon, + getTransform(), + getSdrFTAttribute().getText(), + attribute::SdrLineAttribute(), + true, + false, + false)); } return aRetval; -- cgit v1.2.3 From a6c97c6bf5aa328d121498732a8e1b74ee8e4499 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 28 Jan 2010 22:19:50 +0100 Subject: autorecovery: move the responsibility for calling attachResource into recoverFromFile. This saves us from some problems with SFX-based documents, which change there Args during the load process (during macro confirmation), so a later attachResource from outside would overwrite those changed args --- framework/source/services/autorecovery.cxx | 9 ++++++--- sfx2/source/doc/sfxbasemodel.cxx | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index bb23f201e5..4c319ae070 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2735,6 +2735,9 @@ void AutoRecovery::implts_openOneDoc(const ::rtl::OUString& sURL "unexpected document state" ); Reference< XLoadable > xModelLoad( xModel, UNO_QUERY_THROW ); xModelLoad->initNew(); + + // TODO: remove load-process specific arguments from the descriptor, e.g. the status indicator + xModel->attachResource( sURL, lDescriptor.getAsConstPropertyValueList() ); } else { @@ -2745,10 +2748,10 @@ void AutoRecovery::implts_openOneDoc(const ::rtl::OUString& sURL lDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_SALVAGEDFILE(), ::rtl::OUString() ), lDescriptor.getAsConstPropertyValueList() ); - } - xModel->attachResource( sURL, lDescriptor.getAsConstPropertyValueList() ); - // TODO: remove load-process specific arguments from the descriptor, e.g. the status indicator + // No attachResource needed here. By definition (of XDocumentRecovery), the implementation is responsible + // for completely initializing the model, which includes attachResource (or equivalent), if required. + } // re-create all the views ::std::vector< ::rtl::OUString > aViewsToRestore( rInfo.ViewNames.getLength() ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 2a613dd107..f404242cc0 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1687,6 +1687,13 @@ void SAL_CALL SfxBaseModel::recoverFromFile( const ::rtl::OUString& i_SourceLoca aMediaDescriptor.put( "URL", i_SourceLocation ); load( aMediaDescriptor.getPropertyValues() ); + + // Note: The XDocumentRecovery interface specification requires us to do an attachResource after loading. + // However, we will not do this here, as we know that our load implementation (respectively some method + // called from there) already did so. + // In particular, the load process might already have modified some elements of the media + // descriptor, for instance the MacroExecMode (in case the user was involved to decide about it), and we do + // not want to overwrite it with the "old" elements passed to this method here. } //________________________________________________________________________________________________________ -- cgit v1.2.3 From 982d7aaf4449021a8289d771d9685afc8f50e16d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 29 Jan 2010 14:18:52 +0100 Subject: autorecovery: implts_changeAllDocVisibility: iterate through the sub frames, too, not only desktop-level frames --- framework/source/services/autorecovery.cxx | 45 +++++++++++++++++++----------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 4c319ae070..b747d26306 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2053,6 +2053,33 @@ AutoRecovery::TDocumentList::iterator AutoRecovery::impl_searchDocument( Au return pIt; } +//----------------------------------------------- +namespace +{ + void lcl_changeVisibility( const css::uno::Reference< css::frame::XFramesSupplier >& i_rFrames, sal_Bool i_bVisible ) + { + css::uno::Reference< css::container::XIndexAccess > xFramesContainer( i_rFrames->getFrames(), css::uno::UNO_QUERY ); + const sal_Int32 count = xFramesContainer->getCount(); + + Any aElement; + for ( sal_Int32 i=0; i < count; ++i ) + { + aElement = xFramesContainer->getByIndex(i); + // check for sub frames + css::uno::Reference< css::frame::XFramesSupplier > xFramesSupp( aElement, css::uno::UNO_QUERY ); + if ( xFramesSupp.is() ) + lcl_changeVisibility( xFramesSupp, i_bVisible ); + + css::uno::Reference< css::frame::XFrame > xFrame( aElement, css::uno::UNO_QUERY ); + if ( !xFrame.is() ) + continue; + + css::uno::Reference< css::awt::XWindow > xWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); + xWindow->setVisible( i_bVisible ); + } + } +} + //----------------------------------------------- void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible) { @@ -2062,22 +2089,8 @@ void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible) aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::frame::XFramesSupplier > xDesktop (xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY); - css::uno::Reference< css::container::XIndexAccess > xContainer(xDesktop->getFrames() , css::uno::UNO_QUERY); - sal_Int32 c = xContainer->getCount(); - sal_Int32 i = 0; - - for (i=0; i xTask; - - xContainer->getByIndex(i) >>= xTask; - if (!xTask.is()) - continue; - - css::uno::Reference< css::awt::XWindow > xWindow = xTask->getContainerWindow(); - xWindow->setVisible(bVisible); - } + css::uno::Reference< css::frame::XFramesSupplier > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY); + lcl_changeVisibility( xDesktop, bVisible ); aReadLock.unlock(); // <- SAFE ---------------------------------- -- cgit v1.2.3 From c2e9fcda7bd2b865bac468b63c37340020c6ad27 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 29 Jan 2010 15:38:20 +0100 Subject: autorecovery: saveToRecoveryFile => storeToRecoveryFile --- framework/source/services/autorecovery.cxx | 2 +- sfx2/inc/sfx2/sfxbasemodel.hxx | 2 +- sfx2/source/doc/sfxbasemodel.cxx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index b747d26306..ce583fde1e 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2449,7 +2449,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& { try { - xDocRecover->saveToRecoveryFile( rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList() ); + xDocRecover->storeToRecoveryFile( rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList() ); #ifdef TRIGGER_FULL_DISC_CHECK throw css::uno::Exception(); diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index c6b9b71c06..ab058b5a61 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -1301,7 +1301,7 @@ public: // css.document.XDocumentRecovery virtual ::sal_Bool SAL_CALL wasModifiedSinceLastSave() throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL saveToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) + virtual void SAL_CALL storeToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ) throw ( ::com::sun::star::uno::RuntimeException, ::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index f404242cc0..cdf8d63851 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1657,7 +1657,7 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString& return m_pData->m_bModifiedSinceLastSave; } -void SAL_CALL SfxBaseModel::saveToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) +void SAL_CALL SfxBaseModel::storeToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) { SfxModelGuard aGuard( *this ); @@ -1665,7 +1665,7 @@ void SAL_CALL SfxBaseModel::saveToRecoveryFile( const ::rtl::OUString& i_TargetL SfxSaveGuard aSaveGuard( this, m_pData, sal_False ); impl_store( i_TargetLocation, i_MediaDescriptor, sal_True ); - // no need for subsequent calls to saveToRecoveryFile, unless we're modified, again + // no need for subsequent calls to storeToRecoveryFile, unless we're modified, again m_pData->m_bModifiedSinceLastSave = sal_False; } -- cgit v1.2.3 From f6dbf67e8423d96f3f04f65bbb374233704c9e63 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 1 Feb 2010 21:32:33 +0100 Subject: autorecovery: more sophisticated configuration data for interaction handlers The generic css.task.InteractionHandler implementation in module uui is now able to instantiate "sub handlers", i.e. components to delegate a request to, based on the type of the request, and some configuration data. The "old" (and now deprecated) configuration scheme at org.openoffice.ucb.InteractionHandler did not contain type information, so any handlers registered there were always called when no default implementation for a given request was available. The "new" configuration scheme at org.openoffice.Interaction contains UNO type information. That is, a given handler implementation can declare itself responsible for an arbitrary set of UNO types, and for each of those types, whether it is also responsible for sub types. The generic interaction handler implementation uses this configuration data, when it encounteres an interaction request it cannot fullfill itself, to instantiate a component to delegate the request to. As with the "old" data, such a component is required to support the css.task.XInteractionHandler2 interface. Also, if it supports css.lang.XInitialization, then it will be initialized with a name-value pair, the name being "Parent", the value being the XWindow interface of the parent window for any message boxes. As an examplary implementation for this feature, the css.sdb.InteractionHandler has been deprecated. Now the css.sdb.DatabaseInteractionHandler is reponsible for database-related interactions, and the new configuration scheme is pre-filled with data assigning this responsibility. Consequently, a lot of places previously creating an css.sdb.InteractionHandler have been modified to create the default css.task.InteractionHandler. --- connectivity/source/commontools/dbtools.cxx | 4 +- .../registry/data/org/openoffice/Interaction.xcu | 56 +++ officecfg/registry/data/org/openoffice/makefile.mk | 3 +- .../registry/schema/org/openoffice/Interaction.xcs | 86 ++++ .../registry/schema/org/openoffice/makefile.mk | 3 +- .../org/openoffice/ucb/InteractionHandler.xcs | 59 +-- svx/source/form/fmctrler.cxx | 2 +- svx/source/inc/fmservs.hxx | 1 - uui/source/iahndl.cxx | 243 +++++++--- uui/source/iahndl.hxx | 531 ++++++++++----------- 10 files changed, 599 insertions(+), 389 deletions(-) create mode 100644 officecfg/registry/data/org/openoffice/Interaction.xcu create mode 100644 officecfg/registry/schema/org/openoffice/Interaction.xcs diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index eaf1d6fe8e..cdeab37c0b 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -320,8 +320,8 @@ Reference< XConnection > getConnection_allowException( Reference xConnectionCompletion(xProp, UNO_QUERY); if (xConnectionCompletion.is()) { // instantiate the default SDB interaction handler - Reference< XInteractionHandler > xHandler(_rxFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.sdb.InteractionHandler")), UNO_QUERY); - OSL_ENSURE(xHandler.is(), "dbtools::getConnection service com.sun.star.sdb.InteractionHandler not available!"); + Reference< XInteractionHandler > xHandler(_rxFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY); + OSL_ENSURE(xHandler.is(), "dbtools::getConnection service com.sun.star.task.InteractionHandler not available!"); if (xHandler.is()) { xConnection = xConnectionCompletion->connectWithCompletion(xHandler); diff --git a/officecfg/registry/data/org/openoffice/Interaction.xcu b/officecfg/registry/data/org/openoffice/Interaction.xcu new file mode 100644 index 0000000000..4269378c36 --- /dev/null +++ b/officecfg/registry/data/org/openoffice/Interaction.xcu @@ -0,0 +1,56 @@ + + + + + + + + + + + named-and-derived + + + + + named-and-derived + + + + + named-and-derived + + + + + com.sun.star.comp.dbaccess.DatabaseInteractionHandler + + + + diff --git a/officecfg/registry/data/org/openoffice/makefile.mk b/officecfg/registry/data/org/openoffice/makefile.mk index b953c9b1cd..e2b1d26856 100644 --- a/officecfg/registry/data/org/openoffice/makefile.mk +++ b/officecfg/registry/data/org/openoffice/makefile.mk @@ -44,7 +44,8 @@ XCUFILES= \ Setup.xcu \ VCL.xcu \ FirstStartWizard.xcu \ - UserProfile.xcu + UserProfile.xcu \ + Interaction.xcu MODULEFILES= \ Setup-brand.xcu \ diff --git a/officecfg/registry/schema/org/openoffice/Interaction.xcs b/officecfg/registry/schema/org/openoffice/Interaction.xcs new file mode 100644 index 0000000000..e39d44da7f --- /dev/null +++ b/officecfg/registry/schema/org/openoffice/Interaction.xcs @@ -0,0 +1,86 @@ + + + + + + Frank Schönheit + contains configuration related to the interaction system of OpenOffice.org. + + + + + describes the responsibility for a single interaction request type. + + + + describes how the responsibility for this particular request type propagates through the + type hierarchy. + + + + + specifies that the interaction handler is responsible only for this particular type. + + + + + + specifies that the interaction handler is responsible not only for this particular type, + but also for all derived types. + + + + + + + + + contains information about a concrete interaction handler implementation. + + + + specifies the types which the interaction handler implementation is responsible for. The node names + of this set are interpreted as names in the UNO type system, this way specifying the request types + which should be delegated to the given interaction handler. + + + + + contains the name to be used to create an instance of the interaction handler implementation. + + + + + + + + collects information about registered interaction handlers. + + + + diff --git a/officecfg/registry/schema/org/openoffice/makefile.mk b/officecfg/registry/schema/org/openoffice/makefile.mk index 2269c68b00..9754501407 100644 --- a/officecfg/registry/schema/org/openoffice/makefile.mk +++ b/officecfg/registry/schema/org/openoffice/makefile.mk @@ -46,7 +46,8 @@ XCSFILES= \ System.xcs \ UserProfile.xcs \ VCL.xcs \ - FirstStartWizard.xcs + FirstStartWizard.xcs \ + Interaction.xcs .INCLUDE : target.mk diff --git a/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs b/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs index 6cf0a994c8..0cbc20eaff 100644 --- a/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs +++ b/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs @@ -29,39 +29,28 @@ * ************************************************************************ --> - - TKR - Contains components and templates used for InteractionHandler configuration related data. - - - - - Contains the Service name of the custom InteractionHandler. The listed InteractionHandlers will be called after the "build-in" InteractionHandler sequently. - - - - Specifies the name of the UNO service to be used to instantiate the InteractionHandler. The type should be com.sun.star.task.XInteractionHandler. - - - - - - - - Contains a root entry for InteractionHandler configurations. - - - + + + TKR + Deprecated. Use org.openoffice.Interaction instead. + + + + + Deprecated. Use org.openoffice.Interaction instead. + + + + Deprecated. Use org.openoffice.Interaction instead. + + + + + + + + Deprecated. Use org.openoffice.Interaction instead. + + + - - - - - - - - - - - - diff --git a/svx/source/form/fmctrler.cxx b/svx/source/form/fmctrler.cxx index 21b905566d..09d397bc37 100644 --- a/svx/source/form/fmctrler.cxx +++ b/svx/source/form/fmctrler.cxx @@ -3942,7 +3942,7 @@ bool FmXFormController::ensureInteractionHandler() if ( !m_xORB.is() ) return false; - m_xInteractionHandler.set( m_xORB->createInstance( SRV_SDB_INTERACTION_HANDLER ), UNO_QUERY ); + m_xInteractionHandler.set( m_xORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" ) ) ), UNO_QUERY ); OSL_ENSURE( m_xInteractionHandler.is(), "FmXFormController::ensureInteractionHandler: could not create an interaction handler!" ); return m_xInteractionHandler.is(); } diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx index 165630eab8..de0e0757d9 100644 --- a/svx/source/inc/fmservs.hxx +++ b/svx/source/inc/fmservs.hxx @@ -59,7 +59,6 @@ #define FM_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) ) #define FM_FORM_CONTROLLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.FormController" ) ) #define SRV_SDB_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) ) -#define SRV_SDB_INTERACTION_HANDLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.InteractionHandler" ) ) #define FM_SUN_COMPONENT_FORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) ) #define FM_SUN_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) ) #define FM_SUN_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ) ) diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 916f217bf0..0a0b7e659b 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -111,6 +111,7 @@ #include "vos/mutex.hxx" #include "tools/rcid.h" +#include "tools/diagnose_ex.h" #include "vcl/svapp.hxx" #include "svl/svtools.hrc" #include "svl/httpcook.hxx" @@ -118,7 +119,10 @@ #include "toolkit/helper/vclunohelper.hxx" #include "comphelper/sequenceashashmap.hxx" #include "comphelper/documentconstants.hxx" +#include "comphelper/namedvaluecollection.hxx" +#include "typelib/typedescription.hxx" #include "unotools/configmgr.hxx" +#include "unotools/confignode.hxx" #include "ids.hrc" #include "cookiedg.hxx" @@ -144,6 +148,7 @@ using namespace com::sun; namespace csss = ::com::sun::star::security; +/** === begin UNO using === **/ using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::Reference; @@ -152,6 +157,15 @@ using ::com::sun::star::task::XInteractionAbort; using ::com::sun::star::task::XInteractionApprove; using ::com::sun::star::task::XInteractionAskLater; using ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest; +using ::com::sun::star::uno::XInterface; +using ::com::sun::star::lang::XInitialization; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::task::XInteractionHandler2; +using ::com::sun::star::uno::Exception; +using ::com::sun::star::uno::Any; +using ::com::sun::star::task::XInteractionRequest; +using ::com::sun::star::lang::XMultiServiceFactory; +/** === end UNO using === **/ #define CONFIG_INTERACTIONHANDLERS_KEY "/org.openoffice.ucb.InteractionHandler/InteractionHandlers" @@ -1316,6 +1330,114 @@ bool UUIInteractionHelper::handleErrorHandlerRequests( return false; } +namespace +{ + // ................................................................................................................. + static bool lcl_matchesRequest( const Any& i_rRequest, const ::rtl::OUString& i_rTypeName, const ::rtl::OUString& i_rPropagation ) + { + const ::com::sun::star::uno::TypeDescription aTypeDesc( i_rTypeName ); + const typelib_TypeDescription* pTypeDesc = aTypeDesc.get(); + if ( !pTypeDesc || !pTypeDesc->pWeakRef ) + { +#if OSL_DEBUG_LEVEL > 0 + ::rtl::OStringBuffer aMessage; + aMessage.append( "no type found for '" ); + aMessage.append( ::rtl::OUStringToOString( i_rTypeName, RTL_TEXTENCODING_UTF8 ) ); + aMessage.append( "'" ); + OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); +#endif + return false; + } + const ::com::sun::star::uno::Type aType( pTypeDesc->pWeakRef ); + + const bool bExactMatch = ( i_rPropagation.compareToAscii( "named-only" ) == 0 ); + if ( bExactMatch ) + return i_rRequest.getValueType().equals( aType ); + + return i_rRequest.isExtractableTo( aType ); + } +} + +// --------------------------------------------------------------------------------------------------------------------- +bool UUIInteractionHelper::handleCustomRequest( const Reference< XInteractionRequest >& i_rRequest, const ::rtl::OUString& i_rServiceName ) const +{ + try + { + Reference< XInteractionHandler2 > xHandler( m_xServiceFactory->createInstance( i_rServiceName ), UNO_QUERY_THROW ); + + Reference< XInitialization > xHandlerInit( xHandler, UNO_QUERY ); + if ( xHandlerInit.is() ) + { + ::comphelper::NamedValueCollection aInitArgs; + aInitArgs.put( "Parent", getParentXWindow() ); + xHandlerInit->initialize( aInitArgs.getWrappedPropertyValues() ); + } + + if ( xHandler->handleInteractionRequest( i_rRequest ) ) + return true; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return false; +} + +// --------------------------------------------------------------------------------------------------------------------- +bool UUIInteractionHelper::handleTypedHandlerImplementations( Reference< XInteractionRequest > const & rRequest ) +{ + // the request + const Any aRequest( rRequest->getRequest() ); + + const StringHashMap::const_iterator aCacheHitTest = m_aTypedCustomHandlers.find( aRequest.getValueTypeName() ); + if ( aCacheHitTest != m_aTypedCustomHandlers.end() ) + return handleCustomRequest( rRequest, aCacheHitTest->second ); + + // the base registration node for "typed" interaction handlers + const ::utl::OConfigurationTreeRoot aConfigRoot( ::utl::OConfigurationTreeRoot::createWithServiceFactory( + m_xServiceFactory, + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Interaction/InteractionHandlers" ) ), + -1, + ::utl::OConfigurationTreeRoot::CM_READONLY + ) ); + + // loop through all registered implementations + const Sequence< ::rtl::OUString > aRegisteredHandlers( aConfigRoot.getNodeNames() ); + const ::rtl::OUString* pHandlerName = aRegisteredHandlers.getConstArray(); + const ::rtl::OUString* pHandlersEnd = aRegisteredHandlers.getConstArray() + aRegisteredHandlers.getLength(); + for ( ; pHandlerName != pHandlersEnd; ++pHandlerName ) + { + const ::utl::OConfigurationNode aHandlerNode( aConfigRoot.openNode( *pHandlerName ) ); + const ::utl::OConfigurationNode aTypesNode( aHandlerNode.openNode( "HandledRequestTypes" ) ); + + // loop through all the types which the current handler is registered for + const Sequence< ::rtl::OUString > aHandledTypes( aTypesNode.getNodeNames() ); + const ::rtl::OUString* pType = aHandledTypes.getConstArray(); + const ::rtl::OUString* pTypesEnd = aHandledTypes.getConstArray() + aHandledTypes.getLength(); + for ( ; pType != pTypesEnd; ++pType ) + { + // the UNO type is the node name + ::utl::OConfigurationNode aType( aTypesNode.openNode( *pType ) ); + // and there's a child denoting how the responsibility propagates + ::rtl::OUString sPropagation; + OSL_VERIFY( aType.getNodeValue( "Propagation" ) >>= sPropagation ); + if ( lcl_matchesRequest( aRequest, *pType, sPropagation ) ) + { + // retrieve the service/implementation name of the handler + ::rtl::OUString sServiceName; + OSL_VERIFY( aHandlerNode.getNodeValue( "ServiceName" ) >>= sServiceName ); + // cache the information who feels responsible for requests of this type + m_aTypedCustomHandlers[ aRequest.getValueTypeName() ] = sServiceName; + // actually handle the request + if ( handleCustomRequest( rRequest, sServiceName ) ) + return true; + } + } + } + + return false; +} + bool UUIInteractionHelper::handle_impl( star::uno::Reference< star::task::XInteractionRequest > const & rRequest) @@ -1326,68 +1448,39 @@ UUIInteractionHelper::handle_impl( if (!rRequest.is()) return false; - //////////////////////////////////////////////////////////// // Display Messagebox - //////////////////////////////////////////////////////////// bool bDummy = false; rtl::OUString aDummy; - if (! handleMessageboxRequests(rRequest, false, bDummy, aDummy)) - { - //////////////////////////////////////////////////////////// - // Use ErrorHandler::HandleError - //////////////////////////////////////////////////////////// - if (!handleErrorHandlerRequests(rRequest, false, bDummy, aDummy)) - { - //////////////////////////////////////////////////////////// - // Display Special Dialog - //////////////////////////////////////////////////////////// - if (!handleDialogRequests(rRequest)) - { - //////////////////////////////////////////////////////////// - // Use customized InteractionHandler from configuration - //////////////////////////////////////////////////////////// - InteractionHandlerDataList dataList; - - GetInteractionHandlerList(dataList); - - InteractionHandlerDataList::const_iterator aEnd(dataList.end()); - for (InteractionHandlerDataList::const_iterator aIt(dataList.begin()); - aIt != aEnd; ++aIt) - { - Reference< uno::XInterface > xIfc = - m_xServiceFactory->createInstance(aIt->ServiceName); - - - Reference< com::sun::star::lang::XInitialization > xInitialization = - Reference< com::sun::star::lang::XInitialization >( xIfc, UNO_QUERY ); - - OSL_ENSURE( xInitialization.is(), "Custom Interactionhandler does not implement mandatory interface XInitialization!" ); - if (xInitialization.is()) - { - uno::Sequence< uno::Any > propertyValues(1); - beans::PropertyValue aProperty; - - aProperty.Name = rtl::OUString::createFromAscii( "Parent" ); - aProperty.Value <<= getParentXWindow(); - propertyValues[ 0 ] <<= aProperty; - - xInitialization->initialize(propertyValues); - } - - Reference< task::XInteractionHandler2 > - xInteractionHandler( xIfc, UNO_QUERY ); - - OSL_ENSURE( xInteractionHandler.is(), - "Custom Interactionhandler does not implement " - "mandatory interface XInteractionHandler2!" ); - if (xInteractionHandler.is()) - if (xInteractionHandler->handleInteractionRequest(rRequest)) - return true; - } - return false; - } - } - } + if ( handleMessageboxRequests(rRequest, false, bDummy, aDummy) ) + return true; + + // Use ErrorHandler::HandleError + if ( handleErrorHandlerRequests(rRequest, false, bDummy, aDummy) ) + return true; + + // Display Special Dialog + if ( handleDialogRequests( rRequest ) ) + return true; + + // Use typed InteractionHandlers from configuration + if ( handleTypedHandlerImplementations( rRequest ) ) + return true; + + // Use customized InteractionHandler from configuration + InteractionHandlerDataList dataList; + GetInteractionHandlerList(dataList); + + InteractionHandlerDataList::const_iterator aEnd(dataList.end()); + for ( InteractionHandlerDataList::const_iterator aIt( dataList.begin() ); + aIt != aEnd; + ++aIt + ) + { + if ( handleCustomRequest( rRequest, aIt->ServiceName ) ) + return true; + } + + return false; } catch (std::bad_alloc const &) { @@ -1395,6 +1488,14 @@ UUIInteractionHelper::handle_impl( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), star::uno::Reference< star::uno::XInterface >()); } + catch( const uno::RuntimeException& ) + { + throw; // allowed to leave here + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } return true; } @@ -1514,20 +1615,15 @@ Window * UUIInteractionHelper::getParentProperty() SAL_THROW(()) return 0; } -star::uno::Reference< ::com::sun::star::awt::XWindow> UUIInteractionHelper::getParentXWindow() SAL_THROW(()) +star::uno::Reference< ::com::sun::star::awt::XWindow> UUIInteractionHelper::getParentXWindow() const SAL_THROW(()) { osl::MutexGuard aGuard(m_aPropertyMutex); - for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i) + ::comphelper::NamedValueCollection aProperties( m_aProperties ); + if ( aProperties.has( "Parent" ) ) { - star::beans::PropertyValue aProperty; - if ((m_aProperties[i] >>= aProperty) - && aProperty. - Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Parent"))) - { - star::uno::Reference< star::awt::XWindow > xWindow; - aProperty.Value >>= xWindow; - return xWindow; - } + star::uno::Reference< star::awt::XWindow > xWindow; + OSL_VERIFY( aProperties.get( "Parent" ) >>= xWindow ); + return xWindow; } return 0; } @@ -3357,11 +3453,8 @@ UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest( // suitable place), again, and we would only have one place where we remember the s_bDeferredToNextSession // flag. // - // The side effect (well, actually the more important effect) would be that we do not need to burden - // this central implementation with all interactions which are possible. Instead, separate parts of OOo - // can define/implement different requests. (for instance, everything which today is done in the - // css.sdb.InteractionHandler can then be routed through a "normal" interaction handler, where today we - // always need to tell people to instantiate the SDB-version of the handler, not the normal one.) + // Note: The above pattern has been implemented in CWS autorecovery. Now the remaining task is to move the + // handling of this interaction to SFX, again. if ( !s_bDeferredToNextSession ) { diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 177273a032..7ef85c958d 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -54,6 +54,8 @@ #include #endif +#include + class Window; class LoginErrorInfo; struct CntHTTPCookieRequest; @@ -113,14 +115,17 @@ namespace com { namespace sun { namespace star { } } } } +typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > Continuations; + +typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > StringHashMap; + class UUIInteractionHelper { private: - osl::Mutex m_aPropertyMutex; - com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > - m_xServiceFactory; - com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties; + mutable osl::Mutex m_aPropertyMutex; + ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; + ::com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties; + StringHashMap m_aTypedCustomHandlers; UUIInteractionHelper(UUIInteractionHelper &); // not implemented void operator =(UUIInteractionHelper); // not implemented @@ -152,298 +157,278 @@ public: throw (com::sun::star::uno::RuntimeException); private: - bool - handle_impl(com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & - rRequest) - throw (com::sun::star::uno::RuntimeException); + bool handle_impl( + com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest > const & rRequest + ) + throw (com::sun::star::uno::RuntimeException); - void - GetInteractionHandlerList(InteractionHandlerDataList &rdataList); + void GetInteractionHandlerList(InteractionHandlerDataList &rdataList); sal_Bool - isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName); + isDomainMatch( + rtl::OUString hostName, + rtl::OUString certHostName + ); + static long - handlerequest(void* pHandleData, void* pInteractionHandler); + handlerequest( + void* pHandleData, + void* pInteractionHandler + ); com::sun::star::beans::Optional< rtl::OUString > - getStringFromRequest_impl(com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & - rRequest) - throw (com::sun::star::uno::RuntimeException); + getStringFromRequest_impl( + com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest > const & rRequest + ) + throw (com::sun::star::uno::RuntimeException); static long - getstringfromrequest(void* pHandleData, void* pInteractionHandler); + getstringfromrequest(void* pHandleData, void* pInteractionHandler); - Window * getParentProperty() SAL_THROW(()); + Window* getParentProperty() SAL_THROW(()); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> getParentXWindow() SAL_THROW(()); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> + getParentXWindow() const SAL_THROW(()); - rtl::OUString getContextProperty() SAL_THROW(()); + rtl::OUString + getContextProperty() SAL_THROW(()); - bool - initPasswordContainer(com::sun::star::uno::Reference< - com::sun::star::task::XPasswordContainer > * - pContainer, - com::sun::star::uno::Reference< - com::sun::star::task::XUrlContainer > * - pUrlContainer) - const SAL_THROW(()); + bool initPasswordContainer( + com::sun::star::uno::Reference< com::sun::star::task::XPasswordContainer > * pContainer, + com::sun::star::uno::Reference< com::sun::star::task::XUrlContainer > * pUrlContainer + ) const + SAL_THROW(()); com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > - getInteractionHandler() const - SAL_THROW((com::sun::star::uno::RuntimeException)); + getInteractionHandler() const + SAL_THROW((com::sun::star::uno::RuntimeException)); - void executeLoginDialog(LoginErrorInfo & rInfo, + void executeLoginDialog(LoginErrorInfo & rInfo, rtl::OUString const & rRealm) SAL_THROW((com::sun::star::uno::RuntimeException)); - void - executeMasterPasswordDialog(LoginErrorInfo & rInfo, - com::sun::star::task::PasswordRequestMode nMode) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - executePasswordDialog(LoginErrorInfo & rInfo, - com::sun::star::task::PasswordRequestMode nMode, - ::rtl::OUString aDocumentName) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - executeMSPasswordDialog(LoginErrorInfo & rInfo, - com::sun::star::task::PasswordRequestMode nMode, - ::rtl::OUString aDocumentName) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void executeCookieDialog(CntHTTPCookieRequest & rRequest) - SAL_THROW((com::sun::star::uno::RuntimeException)); + void executeMasterPasswordDialog( + LoginErrorInfo & rInfo, + com::sun::star::task::PasswordRequestMode nMode + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void executePasswordDialog( + LoginErrorInfo & rInfo, + com::sun::star::task::PasswordRequestMode nMode, + ::rtl::OUString aDocumentName + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void executeMSPasswordDialog( + LoginErrorInfo & rInfo, + com::sun::star::task::PasswordRequestMode nMode, + ::rtl::OUString aDocumentName + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void executeCookieDialog( + CntHTTPCookieRequest & rReques + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); - void executeFilterDialog(rtl::OUString const & rURL , - uui::FilterNameList const & rFilters, - rtl::OUString & rFilter ) - SAL_THROW((com::sun::star::uno::RuntimeException)); + void executeFilterDialog( + rtl::OUString const & rURL , + uui::FilterNameList const & rFilters, + rtl::OUString & rFilter + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); - sal_Bool executeUnknownAuthDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert ) - SAL_THROW((com::sun::star::uno::RuntimeException)); + sal_Bool + executeUnknownAuthDialog( + const cssu::Reference< dcss::security::XCertificate >& rXCert + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); - sal_Bool executeSSLWarnDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert, - sal_Int32 const & failures, - const rtl::OUString & hostName) - SAL_THROW((com::sun::star::uno::RuntimeException)); + sal_Bool + executeSSLWarnDialog( + const cssu::Reference< dcss::security::XCertificate >& rXCert, + sal_Int32 const & failures, + const rtl::OUString & hostName + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); rtl::OUString - getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime ); - - USHORT - executeErrorDialog(com::sun::star::task::InteractionClassification - eClassification, - rtl::OUString const & rContext, - rtl::OUString const & rMessage, - WinBits nButtonMask ) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - USHORT - executeMessageBox( rtl::OUString const & rTitle, - rtl::OUString const & rMessage, - WinBits nButtonMask ) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleAuthenticationRequest( - com::sun::star::ucb::AuthenticationRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - rtl::OUString const & rURL) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleCertificateValidationRequest( - com::sun::star::ucb::CertificateValidationRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleNameClashResolveRequest( - com::sun::star::ucb::NameClashResolveRequest const & rRequest, - com::sun::star::uno::Sequence< com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleMasterPasswordRequest( - com::sun::star::task::PasswordRequestMode nMode, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - - void - handlePasswordRequest( - com::sun::star::task::PasswordRequestMode nMode, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName = ::rtl::OUString()) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleMSPasswordRequest( - com::sun::star::task::PasswordRequestMode nMode, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName = ::rtl::OUString()) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleCookiesRequest( - com::sun::star::ucb::HandleCookiesRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleNoSuchFilterRequest( - com::sun::star::document::NoSuchFilterRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleAmbigousFilterRequest( - com::sun::star::document::AmbigousFilterRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleFilterOptionsRequest( - com::sun::star::document::FilterOptionsRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleErrorRequest( - com::sun::star::task::InteractionClassification eClassification, - ErrCode nErrorCode, - std::vector< rtl::OUString > const & rArguments, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) - SAL_THROW((com::sun::star::uno::RuntimeException)); + getLocalizedDatTimeStr( + ::com::sun::star::util::DateTime aDateTime + ); + + USHORT executeErrorDialog( + com::sun::star::task::InteractionClassification eClassification, + rtl::OUString const & rContext, + rtl::OUString const & rMessage, + WinBits nButtonMask + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + USHORT executeMessageBox( + rtl::OUString const & rTitle, + rtl::OUString const & rMessage, + WinBits nButtonMask + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + + void handleAuthenticationRequest( + com::sun::star::ucb::AuthenticationRequest const & rRequest, + Continuations const & rContinuations, + rtl::OUString const & rURL + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleCertificateValidationRequest( + com::sun::star::ucb::CertificateValidationRequest const & rRequest, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleNameClashResolveRequest( + com::sun::star::ucb::NameClashResolveRequest const & rRequest, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleMasterPasswordRequest( + com::sun::star::task::PasswordRequestMode nMode, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + + void handlePasswordRequest( + com::sun::star::task::PasswordRequestMode nMode, + Continuations const & rContinuations, + ::rtl::OUString aDocumentName = ::rtl::OUString() + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleMSPasswordRequest( + com::sun::star::task::PasswordRequestMode nMode, + Continuations const & rContinuations, + ::rtl::OUString aDocumentName = ::rtl::OUString() + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleCookiesRequest( + com::sun::star::ucb::HandleCookiesRequest const & rRequest, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleNoSuchFilterRequest( + com::sun::star::document::NoSuchFilterRequest const & rRequest, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleAmbigousFilterRequest( + com::sun::star::document::AmbigousFilterRequest const & rRequest, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleFilterOptionsRequest( + com::sun::star::document::FilterOptionsRequest const & rRequest, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + + void handleErrorRequest( + com::sun::star::task::InteractionClassification eClassification, + ErrCode nErrorCode, + std::vector< rtl::OUString > const & rArguments, + Continuations const & rContinuations, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); - void - handleGenericErrorRequest( - sal_Int32 nErrorCode, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleMacroConfirmRequest( - const ::rtl::OUString& aDocumentURL, - const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage, - const ::rtl::OUString& aDocumentVersion, - const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations - ) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleFutureDocumentVersionUpdateRequest( - const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& _rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations - ) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleBrokenPackageRequest( - std::vector< rtl::OUString > const & rArguments, - ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) - SAL_THROW((::com::sun::star::uno::RuntimeException)); - - bool handleMessageboxRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & - rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString); - - bool handleDialogRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & - rRequest); - - bool handleErrorHandlerRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & - rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString); - - void handleLockedDocumentRequest( - const ::rtl::OUString& aDocumentURL, - const ::rtl::OUString& aInfo, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - sal_uInt16 nMode ) - SAL_THROW((::com::sun::star::uno::RuntimeException)); - - void handleChangedByOthersRequest( - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations ) - SAL_THROW((::com::sun::star::uno::RuntimeException)); - - void handleLockFileIgnoreRequest( - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations ) - SAL_THROW((::com::sun::star::uno::RuntimeException)); - + void handleGenericErrorRequest( + sal_Int32 nErrorCode, + Continuations const & rContinuations, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleMacroConfirmRequest( + const ::rtl::OUString& aDocumentURL, + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage, + const ::rtl::OUString& aDocumentVersion, + const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleFutureDocumentVersionUpdateRequest( + const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& _rRequest, + Continuations const & rContinuations + ) + SAL_THROW((com::sun::star::uno::RuntimeException)); + + void handleBrokenPackageRequest( + ::std::vector< rtl::OUString > const & rArguments, + Continuations const & + rContinuations, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + ::rtl::OUString & rErrorString + ) + SAL_THROW((::com::sun::star::uno::RuntimeException)); + + bool handleMessageboxRequests( + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + ::rtl::OUString & rErrorString + ); + + bool handleDialogRequests( + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & rRequest + ); + + bool handleErrorHandlerRequests( + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + ::rtl::OUString & rErrorString + ); + + bool handleTypedHandlerImplementations( + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & rRequest + ); + + void handleLockedDocumentRequest( + const ::rtl::OUString& aDocumentURL, + const ::rtl::OUString& aInfo, + Continuations const & + rContinuations, + sal_uInt16 nMode + ) + SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); + + void handleChangedByOthersRequest( + Continuations const & rContinuations + ) + SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); + + void handleLockFileIgnoreRequest( + Continuations const & rContinuations + ) + SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); + + bool handleCustomRequest( + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& i_rRequest, + const ::rtl::OUString& i_rServiceName + ) const; }; #endif // UUI_IAHNDL_HXX -- cgit v1.2.3 From c4f94649f2f6079061f1b6cfd4395e5d6f653a87 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 2 Feb 2010 12:15:37 +0100 Subject: aw079 #i108636# use better operator== for comparing two UNO API sequences of primitives --- svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index ba38e006eb..4371e698a0 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -63,8 +63,14 @@ namespace drawinglayer if(BasePrimitive2D::operator==(rPrimitive)) { const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive; - - if(getOLEContent() == rCompare.getOLEContent() + + // #i108636# The standard operator== on two UNO sequences did not work as i + // would have expected; it just checks the .is() states and the data type + // of the sequence. What i need here is detection of equality of the whole + // sequence content, thus i need to use the arePrimitive2DSequencesEqual helper + // here instead of the operator== which lead to always returning false and thus + // always re-decompositions of the subcontent. + if(arePrimitive2DSequencesEqual(getOLEContent(), rCompare.getOLEContent()) && getTransform() == rCompare.getTransform() && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()) { -- cgit v1.2.3 From 360bd431125dd249442065275676298c05467aac Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 2 Feb 2010 12:16:54 +0100 Subject: aw079 #i108440# Support MetaStretchTextAction in MetafilePrimitive2D decomposition --- .../drawinglayer/primitive2d/textlayoutdevice.hxx | 21 ++- .../source/primitive2d/metafileprimitive2d.cxx | 176 +++++++++++++++++---- .../source/primitive2d/textlayoutdevice.cxx | 69 ++++++-- 3 files changed, 214 insertions(+), 52 deletions(-) diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx index 27f547e973..12b5bd33c6 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx @@ -101,20 +101,20 @@ namespace drawinglayer double getTextWidth( const String& rText, - xub_StrLen nIndex, - xub_StrLen nLength) const; + sal_uInt32 nIndex, + sal_uInt32 nLength) const; bool getTextOutlines( basegfx::B2DPolyPolygonVector&, const String& rText, - xub_StrLen nIndex, - xub_StrLen nLength, - const ::std::vector< double >& rDXArray); + sal_uInt32 nIndex, + sal_uInt32 nLength, + const ::std::vector< double >& rDXArray) const; basegfx::B2DRange getTextBoundRect( const String& rText, - xub_StrLen nIndex, - xub_StrLen nLength) const; + sal_uInt32 nIndex, + sal_uInt32 nLength) const; double getFontAscent() const; double getFontDescent() const; @@ -123,7 +123,12 @@ namespace drawinglayer const Rectangle& rRectangle, const String& rText, sal_uInt16 nStyle, - GDIMetaFile& rGDIMetaFile); + GDIMetaFile& rGDIMetaFile) const; + + ::std::vector< double > getTextArray( + const String& rText, + sal_uInt32 nIndex, + sal_uInt32 nLength) const; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index b6496f085b..90e56ce0cf 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -981,7 +981,42 @@ namespace TargetHolders& rTargetHolders, PropertyHolders& rPropertyHolders) { - // process evtl. created primitives which belong to the current region settings + const bool bNewActive(pRegion && !pRegion->IsEmpty()); + + // #i108636# The handlig of new ClipRegions was not done as good as possible + // in the first version of this interpreter; e.g. when a ClipRegion was set + // initially and then using a lot of push/pop actions, the pop always leads + // to setting a 'new' ClipRegion which indeed is the return to the ClipRegion + // of the properties next on the stack. + // This ClipRegion is identical to the current one, so there is no need to + // create a MaskPrimitive2D containing the up-to-now created primitives, but + // this was done before. While this does not lead to wrong primitive + // representations of the metafile data, it creates unneccesarily expensive + // representations. Just detecting when no really 'new' ClipRegion gets set + // solves the problem. + + if(!rPropertyHolders.Current().getRegionActive() && !bNewActive) + { + // no active region exchanged by no new one, done + return; + } + + if(rPropertyHolders.Current().getRegionActive() && bNewActive) + { + // active region and new active region + if(rPropertyHolders.Current().getRegion() == *pRegion) + { + // new region is the same as the old region, done + return; + } + } + + // Here the old region and the new one are definitively different, maybe + // old one and/or new one is not active. + + // Handle deletion of old region.The process evtl. created primitives which + // belong to this active region. These need to be embedded to a + // MaskPrimitive2D accordingly. if(rPropertyHolders.Current().getRegionActive() && rTargetHolders.size() > 1) { drawinglayer::primitive2d::Primitive2DSequence aSubContent; @@ -1001,8 +1036,8 @@ namespace } } - // apply new settings - const bool bNewActive(pRegion && !pRegion->IsEmpty()); + // apply new settings to current properties by setting + // the new region now rPropertyHolders.Current().setRegionActive(bNewActive); if(bNewActive) @@ -1259,13 +1294,12 @@ namespace const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLength, - sal_Int32* pDXArray, + const ::std::vector< double >& rDXArray, 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) @@ -1283,17 +1317,6 @@ namespace // 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())); @@ -1353,7 +1376,7 @@ namespace rText, nTextStart, nTextLength, - aDXArray, + rDXArray, aFontAttribute, aLocale, aFontColor, @@ -1380,7 +1403,7 @@ namespace rText, nTextStart, nTextLength, - aDXArray, + rDXArray, aFontAttribute, aLocale, aFontColor); @@ -1396,13 +1419,13 @@ namespace // get text width double fTextWidth(0.0); - if(aDXArray.empty()) + if(rDXArray.empty()) { fTextWidth = aTextLayouterDevice.getTextWidth(rText, nTextStart, nTextLength); } else { - fTextWidth = aDXArray.back(); + fTextWidth = rDXArray.back(); } if(basegfx::fTools::more(fTextWidth, 0.0)) @@ -1957,15 +1980,24 @@ namespace { /** CHECKED, WORKS WELL */ const MetaTextAction* pA = (const MetaTextAction*)pAction; + sal_uInt32 nTextLength(pA->GetLen()); + const sal_uInt32 nTextIndex(pA->GetIndex()); + const sal_uInt32 nStringLength(pA->GetText().Len()); + + if(nTextLength + nTextIndex > nStringLength) + { + nTextLength = nStringLength - nTextIndex; + } - if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive()) + if(nTextLength && rPropertyHolders.Current().getTextColorActive()) { + const std::vector< double > aDXArray; proccessMetaTextAction( pA->GetPoint(), pA->GetText(), - pA->GetIndex(), - pA->GetLen(), - 0, + nTextIndex, + nTextLength, + aDXArray, rTargetHolders.Current(), rPropertyHolders.Current()); } @@ -1976,15 +2008,37 @@ namespace { /** CHECKED, WORKS WELL */ const MetaTextArrayAction* pA = (const MetaTextArrayAction*)pAction; + sal_uInt32 nTextLength(pA->GetLen()); + const sal_uInt32 nTextIndex(pA->GetIndex()); + const sal_uInt32 nStringLength(pA->GetText().Len()); + + if(nTextLength + nTextIndex > nStringLength) + { + nTextLength = nStringLength - nTextIndex; + } - if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive()) + if(nTextLength && rPropertyHolders.Current().getTextColorActive()) { + // preapare DXArray (if used) + std::vector< double > aDXArray; + sal_Int32* pDXArray = pA->GetDXArray(); + + if(pDXArray) + { + aDXArray.reserve(nTextLength); + + for(sal_uInt32 a(0); a < nTextLength; a++) + { + aDXArray.push_back((double)(*(pDXArray + a))); + } + } + proccessMetaTextAction( pA->GetPoint(), pA->GetText(), - pA->GetIndex(), - pA->GetLen(), - pA->GetDXArray(), + nTextIndex, + nTextLength, + aDXArray, rTargetHolders.Current(), rPropertyHolders.Current()); } @@ -1993,10 +2047,65 @@ namespace } 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; + // #i108440# StarMath uses MetaStretchTextAction, thus support is needed. + // It looks as if it pretty never really uses a width different from + // the default text-layout width, but it's not possible to be sure. + // Implemented getting the DXArray and checking for scale at all. If + // scale is more than 3.5% different, scale the DXArray before usage. + // New status: + + /** CHECKED, WORKS WELL */ + const MetaStretchTextAction* pA = (const MetaStretchTextAction*)pAction; + sal_uInt32 nTextLength(pA->GetLen()); + const sal_uInt32 nTextIndex(pA->GetIndex()); + const sal_uInt32 nStringLength(pA->GetText().Len()); + + if(nTextLength + nTextIndex > nStringLength) + { + nTextLength = nStringLength - nTextIndex; + } + + if(nTextLength && rPropertyHolders.Current().getTextColorActive()) + { + drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice; + aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont()); + + ::std::vector< double > aTextArray( + aTextLayouterDevice.getTextArray( + pA->GetText(), + nTextIndex, + nTextLength)); + + if(!aTextArray.empty()) + { + const double fTextLength(aTextArray.back()); + + if(0.0 != fTextLength && pA->GetWidth()) + { + const double fRelative(pA->GetWidth() / fTextLength); + + if(fabs(fRelative - 1.0) >= 0.035) + { + // when derivation is more than 3,5% from default text size, + // scale the DXArray + for(sal_uInt32 a(0); a < aTextArray.size(); a++) + { + aTextArray[a] *= fRelative; + } + } + } + } + + proccessMetaTextAction( + pA->GetPoint(), + pA->GetText(), + nTextIndex, + nTextLength, + aTextArray, + rTargetHolders.Current(), + rPropertyHolders.Current()); + } + break; } case META_TEXTRECT_ACTION : @@ -2005,8 +2114,9 @@ namespace // OSL_ENSURE(false, "META_TEXTRECT_ACTION requested (!)"); const MetaTextRectAction* pA = (const MetaTextRectAction*)pAction; const Rectangle& rRectangle = pA->GetRect(); + const sal_uInt32 nStringLength(pA->GetText().Len()); - if(!rRectangle.IsEmpty() && 0 != pA->GetText().Len()) + if(!rRectangle.IsEmpty() && 0 != nStringLength) { // The problem with this action is that it describes unlayouted text // and the layout capabilities are in EditEngine/Outliner in SVX. The diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 53df1e65b8..93f3f6d5c5 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -223,8 +223,8 @@ namespace drawinglayer double TextLayouterDevice::getTextWidth( const String& rText, - xub_StrLen nIndex, - xub_StrLen nLength) const + sal_uInt32 nIndex, + sal_uInt32 nLength) const { return mrDevice.GetTextWidth(rText, nIndex, nLength); } @@ -232,15 +232,22 @@ namespace drawinglayer bool TextLayouterDevice::getTextOutlines( basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector, const String& rText, - xub_StrLen nIndex, - xub_StrLen nLength, - const ::std::vector< double >& rDXArray) + sal_uInt32 nIndex, + sal_uInt32 nLength, + const ::std::vector< double >& rDXArray) const { const sal_uInt32 nDXArrayCount(rDXArray.size()); + sal_uInt32 nTextLength(nLength); + const sal_uInt32 nStringLength(rText.Len()); + + if(nTextLength + nIndex > nStringLength) + { + nTextLength = nStringLength - nIndex; + } if(nDXArrayCount) { - OSL_ENSURE(nDXArrayCount == nLength, "DXArray size does not correspond to text portion size (!)"); + OSL_ENSURE(nDXArrayCount == nTextLength, "DXArray size does not correspond to text portion size (!)"); std::vector< sal_Int32 > aIntegerDXArray(nDXArrayCount); for(sal_uInt32 a(0); a < nDXArrayCount; a++) @@ -274,10 +281,18 @@ namespace drawinglayer basegfx::B2DRange TextLayouterDevice::getTextBoundRect( const String& rText, - xub_StrLen nIndex, - xub_StrLen nLength) const + sal_uInt32 nIndex, + sal_uInt32 nLength) const { - if(nLength) + sal_uInt32 nTextLength(nLength); + const sal_uInt32 nStringLength(rText.Len()); + + if(nTextLength + nIndex > nStringLength) + { + nTextLength = nStringLength - nIndex; + } + + if(nTextLength) { Rectangle aRect; @@ -291,7 +306,9 @@ namespace drawinglayer // #i104432#, #i102556# take empty results into account if(!aRect.IsEmpty()) { - return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()); + return basegfx::B2DRange( + aRect.Left(), aRect.Top(), + aRect.Right(), aRect.Bottom()); } } @@ -314,11 +331,41 @@ namespace drawinglayer const Rectangle& rRectangle, const String& rText, sal_uInt16 nStyle, - GDIMetaFile& rGDIMetaFile) + GDIMetaFile& rGDIMetaFile) const { mrDevice.AddTextRectActions( rRectangle, rText, nStyle, rGDIMetaFile); } + + ::std::vector< double > TextLayouterDevice::getTextArray( + const String& rText, + sal_uInt32 nIndex, + sal_uInt32 nLength) const + { + ::std::vector< double > aRetval; + sal_uInt32 nTextLength(nLength); + const sal_uInt32 nStringLength(rText.Len()); + + if(nTextLength + nIndex > nStringLength) + { + nTextLength = nStringLength - nIndex; + } + + if(nTextLength) + { + aRetval.reserve(nTextLength); + sal_Int32* pArray = new sal_Int32[nTextLength]; + mrDevice.GetTextArray(rText, pArray, nIndex, nLength); + + for(sal_uInt32 a(0); a < nTextLength; a++) + { + aRetval.push_back(pArray[a]); + } + } + + return aRetval; + } + } // end of namespace primitive2d } // end of namespace drawinglayer -- cgit v1.2.3 From e8c09da56fa00cb6559ae4402ae0210d6ee902fc Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 3 Feb 2010 16:23:21 +0100 Subject: ause113: #i108416# update windows version defines --- fpicker/source/win32/filepicker/makefile.mk | 1 + shell/source/win32/shlxthandler/propsheets/makefile.mk | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fpicker/source/win32/filepicker/makefile.mk b/fpicker/source/win32/filepicker/makefile.mk index de192879b6..044d19b280 100644 --- a/fpicker/source/win32/filepicker/makefile.mk +++ b/fpicker/source/win32/filepicker/makefile.mk @@ -47,6 +47,7 @@ CDEFS+=-D_UNICODE CDEFS+=-DUNICODE #CDEFS+=-DWIN32_LEAN_AND_MEAN #CDEFS+=-DWIN32 +CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0600 # --- Resources ---------------------------------------------------- diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk index ac12795cf3..ce13005966 100644 --- a/shell/source/win32/shlxthandler/propsheets/makefile.mk +++ b/shell/source/win32/shlxthandler/propsheets/makefile.mk @@ -39,13 +39,14 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE +CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0501 -U_WIN32_IE -D_WIN32_IE=0x501 +.IF "$(COM)"!="GCC" CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS+=-D_WIN32_IE=0x501 - -CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS_X64+=-D_WIN32_IE=0x501 +CDEFS_X64+=-D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x501 +.ENDIF # --- Files -------------------------------------------------------- -- cgit v1.2.3 From 5f5c8ac191c4fc45cfe9670eedf54940173fb67b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 4 Feb 2010 14:13:58 +0100 Subject: autorecovery: post-rebase build problems solved --- sfx2/source/view/viewfrm2.cxx | 2 +- uui/source/iahndl.cxx | 2 ++ uui/source/iahndl.hxx | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 93c4fa1379..80197caa27 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -231,7 +231,7 @@ String SfxViewFrame::UpdateTitle() // Name des SbxObjects String aSbxName = pObjSh->SfxShell::GetName(); - if ( IsVisible_Impl() ) + if ( IsVisible() ) { aSbxName += ':'; aSbxName += String::CreateFromInt32(pImp->nDocViewNo); diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 7d10a879ff..898081fd1b 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -112,6 +112,8 @@ using ::com::sun::star::task::XInteractionRequest; using ::com::sun::star::lang::XMultiServiceFactory; /** === end UNO using === **/ +using namespace ::com::sun::star; + namespace { class HandleData : public osl::Condition diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index a4db6632b6..e0b58f66ed 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -174,6 +174,10 @@ private: getInteractionHandler() SAL_THROW((com::sun::star::uno::RuntimeException)); + bool handleTypedHandlerImplementations( + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & rRequest + ); + bool tryOtherInteractionHandler( com::sun::star::uno::Reference< -- cgit v1.2.3 From cca7785321c80b05b9bc64730edaa0bfd379c165 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 4 Feb 2010 22:33:56 +0100 Subject: autorecovery: #i10000# make compile on unxlngi6.pro --- framework/source/services/autorecovery.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index ce583fde1e..2836e176c5 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -97,6 +97,7 @@ #include #include #include +#include #include -- cgit v1.2.3 From 19c721620fe41f6e250e7da79bf940fd8d542a39 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 5 Feb 2010 13:04:20 +0100 Subject: autorecovery: when a handler is not yet in the cache, nonetheless use the first matching entry from the configuration, instead of continueing with other handlers when the first can't handle the request --- uui/source/iahndl.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 898081fd1b..e9f1b9e4c6 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -439,8 +439,7 @@ bool UUIInteractionHelper::handleTypedHandlerImplementations( Reference< XIntera // cache the information who feels responsible for requests of this type m_aTypedCustomHandlers[ aRequest.getValueTypeName() ] = sServiceName; // actually handle the request - if ( handleCustomRequest( rRequest, sServiceName ) ) - return true; + return handleCustomRequest( rRequest, sServiceName ); } } } -- cgit v1.2.3 From 694c8d44e16a963505a0fd5c5a1af4ece89617ec Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Mon, 8 Feb 2010 16:03:09 +0100 Subject: mtaccfixes: #i87415 Mnemonics need to be unambiguous --- svx/source/dialog/srchdlg.src | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src index 2c69a25b92..510d7b59cc 100644 --- a/svx/source/dialog/srchdlg.src +++ b/svx/source/dialog/srchdlg.src @@ -240,7 +240,7 @@ ModelessDialog RID_SVXDLG_SEARCH { Pos = MAP_APPFONT ( 12 , 163 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; - Text [ en-US ] = "Current selection ~only" ; + Text [ en-US ] = "C~urrent selection only" ; TabStop = TRUE ; Hide = TRUE ; }; @@ -349,7 +349,7 @@ ModelessDialog RID_SVXDLG_SEARCH { Pos = MAP_APPFONT ( 12 , 285 ) ; Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "~Search in" ; + Text [ en-US ] = "Search i~n" ; Hide = TRUE ; }; ListBox LB_CALC_SEARCHIN @@ -371,7 +371,7 @@ ModelessDialog RID_SVXDLG_SEARCH { Pos = MAP_APPFONT ( 12 , 300 ) ; Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "~Search direction" ; + Text [ en-US ] = "Search ~direction" ; Hide = TRUE ; }; RadioButton RB_CALC_ROWS @@ -385,7 +385,7 @@ ModelessDialog RID_SVXDLG_SEARCH { Pos = MAP_APPFONT ( 75 , 313 ) ; Size = MAP_APPFONT ( 63 , 10 ) ; - Text [ en-US ] = "Col~umns" ; + Text [ en-US ] = "Colu~mns" ; Hide = TRUE ; }; CheckBox CB_ALL_SHEETS -- cgit v1.2.3 From f9956ec3cbcf23d0da2275f43af1684297b9f007 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 9 Feb 2010 11:33:08 +0100 Subject: aw079 #i99386# finer granular changes for MPBGO removal --- svx/inc/svx/sdrmasterpagedescriptor.hxx | 7 + svx/inc/svx/svdobj.hxx | 4 + svx/inc/svx/svdpage.hxx | 118 ++++++++----- .../contact/viewcontactofmasterpagedescriptor.cxx | 34 +++- svx/source/sdr/contact/viewcontactofsdrpage.cxx | 30 ++++ .../viewobjectcontactofmasterpagedescriptor.cxx | 13 ++ svx/source/sdr/properties/attributeproperties.cxx | 2 + svx/source/svdraw/sdrmasterpagedescriptor.cxx | 21 +++ svx/source/svdraw/svdobj.cxx | 4 + svx/source/svdraw/svdpage.cxx | 194 ++++++++++++++++++++- svx/source/svdraw/svdpntv.cxx | 2 +- svx/source/unodraw/UnoGraphicExporter.cxx | 56 +++++- 12 files changed, 436 insertions(+), 49 deletions(-) diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx index 5c6481f359..45c09c3d49 100644 --- a/svx/inc/svx/sdrmasterpagedescriptor.hxx +++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx @@ -34,9 +34,12 @@ #include #include +#define NEWPBG + ////////////////////////////////////////////////////////////////////////////// // predeclarations class SdrObject; +class SfxItemSet; namespace sdr { @@ -92,8 +95,12 @@ namespace sdr sal_Bool operator==(const MasterPageDescriptor& rCandidate) const; sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const; +#ifdef NEWPBG + const SfxItemSet& getCorrectFillAttributes() const; +#else // #i42075# Get the correct BackgroundObject SdrObject* GetBackgroundObject() const; +#endif }; } // end of namespace sdr diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index ac4c831b9e..e64c4ba0f4 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -31,6 +31,8 @@ #ifndef _SVDOBJ_HXX #define _SVDOBJ_HXX +#define NEWPBG + #include #include #include @@ -1102,10 +1104,12 @@ public: sal_Bool IsTransparent( BOOL bCheckForAlphaChannel = FALSE ) const; +#ifndef NEWPBG // #111111# // Needed again and again i will now add a test for finding out if // this object is the BackgroundObject of the page. sal_Bool IsMasterPageBackgroundObject() const; +#endif // #116168# // Give info if object is in destruction diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx index 123a73f13c..a13e96f8bd 100644 --- a/svx/inc/svx/svdpage.hxx +++ b/svx/inc/svx/svdpage.hxx @@ -31,59 +31,29 @@ #ifndef _SVDPAGE_HXX #define _SVDPAGE_HXX -#include +#define NEWPBG -#ifndef _PRINT_HXX //autogen +#include #include -#endif -#ifndef _GDIMTF_HXX //autogen #include -#endif #include #include #include #include - -////////////////////////////////////////////////////////////////////////////// -// sdr::Comment interface #include - -// #111111# #include #include - -// StandardCheckVisisbilityRedirector #include #include #include "svx/svxdllapi.h" - #include #include #include -// #110094# -namespace sdr -{ - namespace contact - { - class ViewContact; - } // end of namespace contact -} // end of namespace sdr - -// ------------------------------ -// - intern benutzte Paint-Modi - -// ------------------------------ - -//#if 0 // _SOLAR__PRIVATE - -#define IMP_PAGEPAINT_NORMAL 0 -#define IMP_PAGEPAINT_PREPARE_CACHE 1 -#define IMP_PAGEPAINT_PAINT_CACHE 2 -#define IMP_PAGEPAINT_PREPARE_BG_CACHE 3 -#define IMP_PAGEPAINT_PAINT_BG_CACHE 4 - -//#endif // __PRIVATE +////////////////////////////////////////////////////////////////////////////// +// predefines +namespace sdr { namespace contact { class ViewContact; }} class SdrPage; class SdrModel; class SfxItemPool; @@ -113,7 +83,11 @@ public: SdrInsertReasonKind GetReason() const { return eReason; } }; -class SVX_DLLPUBLIC SdrObjList { +////////////////////////////////////////////////////////////////////////////// +// class SdrObjList + +class SVX_DLLPUBLIC SdrObjList +{ private: typedef ::std::vector SdrObjectContainerType; SdrObjectContainerType maList; @@ -350,8 +324,12 @@ Objektes abgefragt sowie direkt gesetzt werden. // Used for all methods which return a page number #define SDRPAGE_NOTFOUND 0xFFFF +////////////////////////////////////////////////////////////////////////////// +// class SdrPageGridFrame + // Fuer das Fangraster/Punkgitter im Writer -class SdrPageGridFrame { +class SdrPageGridFrame +{ Rectangle aPaper; Rectangle aUserArea; public: @@ -383,8 +361,50 @@ public: }; //////////////////////////////////////////////////////////////////////////////////////////////////// +// class SdrPageProperties + +#ifdef NEWPBG + +class SVX_DLLPUBLIC SdrPageProperties : public SfxListener +{ +private: + // data + SdrPage* mpSdrPage; + SfxStyleSheet* mpStyleSheet; + SfxItemSet* mpProperties; + + // internal helpers + void ImpRemoveStyleSheet(); + void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet); + + // not implemented + SdrPageProperties& operator=(const SdrPageProperties& rCandidate); + +public: + // construct/destruct + SdrPageProperties(SdrPage& rSdrPage); + SdrPageProperties(const SdrPageProperties& rCandidate); + virtual ~SdrPageProperties(); + + // Notify(...) from baseclass SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); + + // data read/write + const SfxItemSet& GetItemSet() const; + void PutItemSet(const SfxItemSet& rSet); + void PutItem(const SfxPoolItem& rItem); + void ClearItem(const sal_uInt16 nWhich = 0); + + // StyleSheet access + void SetStyleSheet(SfxStyleSheet* pStyleSheet); + SfxStyleSheet* GetStyleSheet() const; +}; + +#endif +//////////////////////////////////////////////////////////////////////////////////////////////////// +// class SdrPage -class SVX_DLLPUBLIC SdrPage: public SdrObjList, public tools::WeakBase< SdrPage > +class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage > { /////////////////////////////////////////////////////////////////////////////// // start PageUser section @@ -430,9 +450,19 @@ friend class ChXChartDocument; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage; protected: - SdrLayerAdmin* pLayerAdmin; - SdrObject* pBackgroundObj; + SdrLayerAdmin* pLayerAdmin; +#ifndef NEWPBG + SdrObject* pBackgroundObj; +#else +private: + SdrPageProperties* mpSdrPageProperties; + +public: + SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; } + const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; } +#endif +protected: // new MasterPageDescriptorVector ::sdr::MasterPageDescriptor* mpMasterPageDescriptor; @@ -537,8 +567,10 @@ public: bool IsSwappingLocked() const { return mbSwappingLocked; } void SetSwappingLocked(bool bLock) { mbSwappingLocked = bLock; } +#ifndef NEWPBG SdrObject* GetBackgroundObj() const { return pBackgroundObj; } void SetBackgroundObj( SdrObject* pObj ); +#endif ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoPage(); @@ -567,8 +599,8 @@ public: /** Check if page is the HandoutMasterPage (in SVX, no PK_HANDOUT available) */ bool isHandoutMasterPage() const; -////////////////////////////////////////////////////////////////////////////// -// sdr::Comment interface + ////////////////////////////////////////////////////////////////////////////// + // sdr::Comment interface private: sdr::CommentVector maComments; @@ -577,8 +609,6 @@ public: const sdr::Comment& GetCommentByIndex(sal_uInt32 nIndex); void AddComment(const sdr::Comment& rNew); void ReplaceCommentByIndex(sal_uInt32 nIndex, const sdr::Comment& rNew); - -////////////////////////////////////////////////////////////////////////////// }; typedef tools::WeakReference< SdrPage > SdrPageWeakRef; diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx index 4e526b4239..09c865f27d 100644 --- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx @@ -64,6 +64,33 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfMasterPageDescriptor::createViewIndependentPrimitive2DSequence() const { drawinglayer::primitive2d::Primitive2DSequence xRetval; + +#ifdef NEWPBG + // build primitive from page fill attributes + const SfxItemSet& rPageFillAttributes = GetMasterPageDescriptor().getCorrectFillAttributes(); + const drawinglayer::attribute::SdrFillAttribute aFill( + drawinglayer::primitive2d::createNewSdrFillAttribute(rPageFillAttributes)); + + if(!aFill.isDefault()) + { + // direct model data is the page size, get and use it + const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage(); + const basegfx::B2DRange aInnerRange( + rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(), + rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), + rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder()); + const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); + const basegfx::B2DHomMatrix aEmptyTransform; + const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aInnerPolgon), + aEmptyTransform, + aFill, + drawinglayer::attribute::FillGradientAttribute())); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } +#else const SdrObject* pBackgroundCandidate = GetMasterPageDescriptor().GetBackgroundObject(); if(pBackgroundCandidate) @@ -93,6 +120,7 @@ namespace sdr xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } } +#endif return xRetval; } @@ -113,21 +141,25 @@ namespace sdr { sal_uInt32 nRetval(GetMasterPageDescriptor().GetUsedPage().GetObjCount()); +#ifndef NEWPBG if(nRetval && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject()) { nRetval--; } +#endif return nRetval; } ViewContact& ViewContactOfMasterPageDescriptor::GetViewContact(sal_uInt32 nIndex) const { +#ifndef NEWPBG if(GetMasterPageDescriptor().GetUsedPage().GetObjCount() && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject()) { nIndex++; } - +#endif + return GetMasterPageDescriptor().GetUsedPage().GetObj(nIndex)->GetViewContact(); } diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index 9a86a44032..6c4461f3c5 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -206,6 +206,31 @@ namespace sdr } else { +#ifdef NEWPBG + // build primitive from pObject's attributes + const SfxItemSet& rFillAttributes = rPage.getSdrPageProperties().GetItemSet(); + const drawinglayer::attribute::SdrFillAttribute aFill( + drawinglayer::primitive2d::createNewSdrFillAttribute(rFillAttributes)); + + if(!aFill.isDefault()) + { + // direct model data is the page size, get and use it + const basegfx::B2DRange aInnerRange( + rPage.GetLftBorder(), rPage.GetUppBorder(), + rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder()); + const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); + const basegfx::B2DHomMatrix aEmptyTransform; + const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::createPolyPolygonFillPrimitive( + basegfx::B2DPolyPolygon(aInnerPolgon), + aEmptyTransform, + aFill, + drawinglayer::attribute::FillGradientAttribute())); + + xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + +#else OSL_ENSURE(0 != rPage.GetObjCount(), "MasterPage without MPBGO detected (!)"); if(rPage.GetObjCount()) @@ -239,6 +264,7 @@ namespace sdr } } } +#endif } } @@ -461,20 +487,24 @@ namespace sdr { sal_uInt32 nSubObjectCount(getPage().GetObjCount()); +#ifndef NEWPBG if(nSubObjectCount && getPage().GetObj(0L)->IsMasterPageBackgroundObject()) { nSubObjectCount--; } +#endif return nSubObjectCount; } ViewContact& ViewContactOfPageHierarchy::GetViewContact(sal_uInt32 nIndex) const { +#ifndef NEWPBG if(getPage().GetObjCount() && getPage().GetObj(0L)->IsMasterPageBackgroundObject()) { nIndex++; } +#endif SdrObject* pObj = getPage().GetObj(nIndex); DBG_ASSERT(pObj, "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)"); diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx index 567708e5da..e7b414cd71 100644 --- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx @@ -98,6 +98,18 @@ namespace sdr rDisplayInfo.SetProcessLayers(aPreprocessedLayers); rDisplayInfo.SetSubContentActive(true); +#ifdef NEWPBG + // check layer visibility (traditionally was member of layer 1) + if(aPreprocessedLayers.IsSet(1)) + { + // hide PageBackground for special DrawModes; historical reasons + if(!GetObjectContact().isDrawModeGray() && !GetObjectContact().isDrawModeHighContrast()) + { + // if visible, create the default background primitive sequence + xRetval = static_cast< ViewContactOfMasterPageDescriptor& >(GetViewContact()).getViewIndependentPrimitive2DSequence(); + } + } +#else // check if there is a MasterPageBackgroundObject and if it's visible in the LayerSet const SdrObject* pBackgroundCandidate = rDescriptor.GetBackgroundObject(); @@ -110,6 +122,7 @@ namespace sdr xRetval = static_cast< ViewContactOfMasterPageDescriptor& >(GetViewContact()).getViewIndependentPrimitive2DSequence(); } } +#endif // hide MasterPage content? Test self here for hierarchy if(isPrimitiveVisible(rDisplayInfo)) diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index e3ce0ada1d..6f0941ea42 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -587,6 +587,7 @@ namespace sdr bHintUsed = sal_True; } +#ifndef NEWPBG // #111111# // When it's the BackgroundObject, set the MasterPage to changed to // get a refresh for the evtl. changed BackgroundStyle @@ -602,6 +603,7 @@ namespace sdr { GetSdrObject().GetPage()->ActionChanged(); } +#endif if(!bHintUsed) { diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index eb9768b3ac..0b02a80b7c 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -37,6 +37,11 @@ // #i42075# #include +#ifdef NEWPBG +#include +#include +#endif + ////////////////////////////////////////////////////////////////////////////// namespace sdr @@ -98,6 +103,7 @@ namespace sdr maVisibleLayers = rNew; GetViewContact().ActionChanged(); +#ifndef NEWPBG // #i42075# For AFs convenience, do a change notify at the MasterPageBackgroundObject, too SdrObject* pObject = GetBackgroundObject(); @@ -105,6 +111,7 @@ namespace sdr { pObject->BroadcastObjectChange(); } +#endif } } @@ -123,6 +130,19 @@ namespace sdr || maVisibleLayers != rCandidate.maVisibleLayers); } +#ifdef NEWPBG + const SfxItemSet& MasterPageDescriptor::getCorrectFillAttributes() const + { + const SfxItemSet& rOwnerPageAtributes = GetOwnerPage().getSdrPageProperties().GetItemSet(); + + if(XFILL_NONE != ((const XFillStyleItem&)rOwnerPageAtributes.Get(XATTR_FILLSTYLE)).GetValue()) + { + return rOwnerPageAtributes; + } + + return GetUsedPage().getSdrPageProperties().GetItemSet(); + } +#else // #i42075# Get the correct BackgroundObject SdrObject* MasterPageDescriptor::GetBackgroundObject() const { @@ -158,6 +178,7 @@ namespace sdr return pRetval; } +#endif } // end of namespace sdr ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index a586aed5dc..4814597c5f 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -375,6 +375,7 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const // DrawContact support: Methods for handling Object changes void SdrObject::ActionChanged() const { +#ifndef NEWPBG // Forward change call to MasterPageDescriptor if BackgroundObject was changed const SdrPage* pObjectsPage = GetPage(); @@ -419,6 +420,7 @@ void SdrObject::ActionChanged() const } } } +#endif // Do necessary ViewContact actions GetViewContact().ActionChanged(); @@ -3117,6 +3119,7 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba SetSnapRect(aBaseRect); } +#ifndef NEWPBG // #111111# // Needed again and again i will now add a test for finding out if // this object is the BackgroundObject of the page. @@ -3136,6 +3139,7 @@ sal_Bool SdrObject::IsMasterPageBackgroundObject() const return sal_False; } +#endif // #116168# // Give info if object is in destruction diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 1ed0dee8f6..6edcb4c43e 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -69,6 +69,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -1175,6 +1176,140 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const return *mpViewContact; } +//////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef NEWPBG + +void SdrPageProperties::ImpRemoveStyleSheet() +{ + if(mpStyleSheet) + { + EndListening(*mpStyleSheet); + mpProperties->SetParent(0); + mpStyleSheet = 0; + } +} + +void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet) +{ + if(mpStyleSheet != &rNewStyleSheet) + { + ImpRemoveStyleSheet(); + mpStyleSheet = &rNewStyleSheet; + StartListening(rNewStyleSheet); + mpProperties->SetParent(&rNewStyleSheet.GetItemSet()); + } +} + +void ImpPageChange(SdrPage& rSdrPage) +{ + rSdrPage.ActionChanged(); + + if(rSdrPage.GetModel()) + { + rSdrPage.GetModel()->SetChanged(true); + SdrHint aHint(HINT_PAGEORDERCHG); + aHint.SetPage(&rSdrPage); + rSdrPage.GetModel()->Broadcast(aHint); + } +} + +SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage) +: mpSdrPage(&rSdrPage), + mpStyleSheet(0), + mpProperties(new SfxItemSet(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST)) +{ + if(!rSdrPage.IsMasterPage()) + { + mpProperties->Put(XFillStyleItem(XFILL_NONE)); + } +} + +SdrPageProperties::SdrPageProperties(const SdrPageProperties& rCandidate) +: mpSdrPage(rCandidate.mpSdrPage), + mpStyleSheet(0), + mpProperties(new SfxItemSet(*rCandidate.mpProperties)) +{ + if(rCandidate.GetStyleSheet()) + { + ImpAddStyleSheet(*rCandidate.GetStyleSheet()); + } +} + +SdrPageProperties::~SdrPageProperties() +{ + ImpRemoveStyleSheet(); + delete mpProperties; +} + +void SdrPageProperties::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) +{ + const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint); + + if(pSimpleHint) + { + switch(pSimpleHint->GetId()) + { + case SFX_HINT_DATACHANGED : + { + // notify change, broadcast + ImpPageChange(*mpSdrPage); + break; + } + case SFX_HINT_DYING : + { + // Style needs to be forgotten + ImpRemoveStyleSheet(); + break; + } + } + } +} + +const SfxItemSet& SdrPageProperties::GetItemSet() const +{ + return *mpProperties; +} + +void SdrPageProperties::PutItemSet(const SfxItemSet& rSet) +{ + OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)"); + mpProperties->Put(rSet); + ImpPageChange(*mpSdrPage); +} + +void SdrPageProperties::PutItem(const SfxPoolItem& rItem) +{ + OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)"); + mpProperties->Put(rItem); + ImpPageChange(*mpSdrPage); +} + +void SdrPageProperties::ClearItem(const sal_uInt16 nWhich) +{ + mpProperties->ClearItem(nWhich); + ImpPageChange(*mpSdrPage); +} + +void SdrPageProperties::SetStyleSheet(SfxStyleSheet* pStyleSheet) +{ + if(pStyleSheet) + { + ImpAddStyleSheet(*pStyleSheet); + } + else + { + ImpRemoveStyleSheet(); + } + + ImpPageChange(*mpSdrPage); +} + +SfxStyleSheet* SdrPageProperties::GetStyleSheet() const +{ + return mpStyleSheet; +} + +#endif //////////////////////////////////////////////////////////////////////////////////////////////////// TYPEINIT1(SdrPage,SdrObjList); @@ -1189,7 +1324,11 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) nBordRgt(0L), nBordLwr(0L), pLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())), +#ifndef NEWPBG pBackgroundObj(0L), +#else + mpSdrPageProperties(0), +#endif mpMasterPageDescriptor(0L), nPageNum(0L), mbMaster(bMasterPage), @@ -1201,6 +1340,10 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) DBG_CTOR(SdrPage,NULL); aPrefVisiLayers.SetAll(); eListKind = (bMasterPage) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE; + +#ifdef NEWPBG + mpSdrPageProperties = new SdrPageProperties(*this); +#endif } SdrPage::SdrPage(const SdrPage& rSrcPage) @@ -1214,7 +1357,11 @@ SdrPage::SdrPage(const SdrPage& rSrcPage) nBordRgt(rSrcPage.nBordRgt), nBordLwr(rSrcPage.nBordLwr), pLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())), +#ifndef NEWPBG pBackgroundObj(0L), +#else + mpSdrPageProperties(0), +#endif mpMasterPageDescriptor(0L), nPageNum(rSrcPage.nPageNum), mbMaster(rSrcPage.mbMaster), @@ -1248,6 +1395,10 @@ SdrPage::SdrPage(const SdrPage& rSrcPage) mxUnoPage = NULL; xComponent->dispose(); } + +#ifdef NEWPBG + mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties()); +#endif } SdrPage::~SdrPage() @@ -1281,7 +1432,9 @@ SdrPage::~SdrPage() // when they get called from PageInDestruction(). maPageUsers.clear(); +#ifndef NEWPBG SdrObject::Free( pBackgroundObj ); +#endif delete pLayerAdmin; TRG_ClearMasterPage(); @@ -1293,6 +1446,13 @@ SdrPage::~SdrPage() mpViewContact = 0L; } +#ifdef NEWPBG + { + delete mpSdrPageProperties; + mpSdrPageProperties = 0; + } +#endif + DBG_DTOR(SdrPage,NULL); } @@ -1304,7 +1464,9 @@ void SdrPage::operator=(const SdrPage& rSrcPage) mpViewContact = 0L; } +#ifndef NEWPBG SdrObject::Free( pBackgroundObj ); +#endif // Joe also sets some parameters for the class this one // is derived from. SdrObjList does the same bad handling of @@ -1339,6 +1501,7 @@ void SdrPage::operator=(const SdrPage& rSrcPage) mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent; +#ifndef NEWPBG if(rSrcPage.pBackgroundObj) { pBackgroundObj = rSrcPage.pBackgroundObj->Clone(); @@ -1348,6 +1511,12 @@ void SdrPage::operator=(const SdrPage& rSrcPage) // #i62000# for single-page MPBGO, force no line pBackgroundObj->SetMergedItem(XLineStyleItem(XLINE_NONE)); } +#else + { + delete mpSdrPageProperties; + mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties()); + } +#endif // Now copy the contained obejcts (by cloning them) SdrObjList::operator=(rSrcPage); @@ -1526,8 +1695,16 @@ void SdrPage::SetModel(SdrModel* pNewModel) } pLayerAdmin->SetModel(pNewModel); +#ifndef NEWPBG if( pBackgroundObj ) pBackgroundObj->SetModel( pNewModel ); +#else + { + SdrPageProperties *pNew = new SdrPageProperties(getSdrPageProperties()); + delete mpSdrPageProperties; + mpSdrPageProperties = pNew; + } +#endif } // update listeners at possible api wrapper object @@ -1661,6 +1838,7 @@ XubString SdrPage::GetLayoutName() const return String(); } +#ifndef NEWPBG void SdrPage::SetBackgroundObj( SdrObject* pObj ) { if ( pObj ) @@ -1676,6 +1854,7 @@ void SdrPage::SetBackgroundObj( SdrObject* pObj ) SdrObject::Free( pBackgroundObj ); pBackgroundObj = pObj; } +#endif void SdrPage::SetInserted( bool bIns ) { @@ -1750,10 +1929,22 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay ) aColor = pView->GetApplicationDocumentColor(); } +#ifdef NEWPBG + const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet(); + + if(!IsMasterPage() && TRG_HasMasterPage()) + { + if(XFILL_NONE == ((const XFillStyleItem&)pBackgroundFill->Get(XATTR_FILLSTYLE)).GetValue()) + { + pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet(); + } + } + + GetDraftFillColor(*pBackgroundFill, aColor); +#else // first, see if we have a background object SdrObject* pBackgroundObj2 = NULL; - if( IsMasterPage() ) { if( GetObjCount() ) @@ -1782,6 +1973,7 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay ) const SfxItemSet& rSet = pBackgroundObj2->GetMergedItemSet(); GetDraftFillColor( rSet, aColor ); } +#endif return aColor; } diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index f77dc8dc54..cc13315510 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -335,7 +335,7 @@ void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint if (eKind==HINT_PAGEORDERCHG) { const SdrPage* pPg=pSdrHint->GetPage(); - if(!pPg->IsInserted()) + if(pPg && !pPg->IsInserted()) { if(mpPageView && mpPageView->GetPage() == pPg) { diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index b75a2c6f1d..15770b08fe 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -618,6 +618,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, VirtualDevice aVDev; const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY ); +#ifndef NEWPBG // create a view SdrView* pView; @@ -633,17 +634,25 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, pView->SetBordVisible( FALSE ); pView->SetPageVisible( FALSE ); pView->ShowSdrPage( pPage ); - +#endif + SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL); maOldCalcFieldValueHdl = rOutl.GetCalcFieldValueHdl(); rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) ); +#ifdef NEWPBG + rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor() ); +#else rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) ); +#endif // #i102251# const sal_uInt32 nOldCntrl(rOutl.GetControlWord()); sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING; rOutl.SetControlWord(nCntrl); +#ifdef NEWPBG + SdrObject* pTempBackgroundShape = 0; +#endif std::vector< SdrObject* > aShapes; bool bRet = true; @@ -652,6 +661,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, { if( rSettings.mbExportOnlyBackground ) { +#ifdef NEWPBG + pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize())); + pTempBackgroundShape->SetMergedItemSet(pPage->getSdrPageProperties().GetItemSet()); + pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE)); + aShapes.push_back(pTempBackgroundShape); +#else SdrObject* pShape = 0; if( pPage->IsMasterPage() ) { @@ -665,6 +680,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, if( pShape ) aShapes.push_back( pShape ); +#endif } else { @@ -741,8 +757,26 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aVDev.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ); aVDev.EnableOutput( FALSE ); aMtf.Record( &aVDev ); - Size aNewSize; + +#ifdef NEWPBG + // create a view + SdrView* pView; + + if( PTR_CAST( FmFormModel, mpDoc ) ) + { + pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev ); + } + else + { + pView = new SdrView( mpDoc, &aVDev ); + } + + pView->SetBordVisible( FALSE ); + pView->SetPageVisible( FALSE ); + pView->ShowSdrPage( pPage ); +#endif + if ( pView && pPage ) { pView->SetBordVisible( FALSE ); @@ -783,6 +817,13 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aGraphic = Graphic(aMtf); } +#ifdef NEWPBG + if ( pView ) + { + pView->HideSdrPage(); + delete pView; + } +#endif if( rSettings.mbTranslucent ) { Size aOutSize; @@ -907,6 +948,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, // calculate bound rect for all shapes Rectangle aBound; +#ifndef NEWPBG if(rSettings.mbExportOnlyBackground) { // shape is MPBGO and if it's not yet set, it's size will @@ -916,6 +958,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aBound = Rectangle(Point(0,0), pPage->GetSize()); } else +#endif { std::vector< SdrObject* >::iterator aIter = aShapes.begin(); const std::vector< SdrObject* >::iterator aEnd = aShapes.end(); @@ -989,11 +1032,20 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, } } +#ifndef NEWPBG if ( pView ) { pView->HideSdrPage(); delete pView; } +#endif + +#ifdef NEWPBG + if(pTempBackgroundShape) + { + SdrObject::Free(pTempBackgroundShape); + } +#endif rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl ); -- cgit v1.2.3 From 54dbcea7f896a3eda1ff48be77db94f36e6ac7e1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 9 Feb 2010 23:10:16 +0100 Subject: autorecovery: even when loading a new document from a recovery storage, ensure that attachResource is called, for those (correct) implentations which do *not* implicitly do this in their loadFromStorage method --- embeddedobj/source/commonembedding/persistence.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 433a74f1f3..2d0bbc9d05 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -372,8 +372,8 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() { // init document as a new xLoadable->initNew(); - xModel->attachResource( xModel->getURL(), m_aDocMediaDescriptor ); } + xModel->attachResource( xModel->getURL(), m_aDocMediaDescriptor ); } catch( uno::Exception& ) { -- cgit v1.2.3 From 463b15d84325ced30a55b55b0e08679b2b703bef Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 10 Feb 2010 12:01:12 +0100 Subject: dba33e: #i109097 --- basic/source/uno/namecont.cxx | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 885c52652d..1809701d92 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1793,11 +1793,11 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto { // create a temporary target storage const ::rtl::OUStringBuffer aTempTargetNameBase = maLibrariesDir + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_temp_" ) ); + sal_Int32 index = 0; do { ::rtl::OUStringBuffer aTempTargetName( aTempTargetNameBase ); - sal_Int32 index = 0; - aTempTargetName.append( index ); + aTempTargetName.append( index++ ); sTargetLibrariesStoreName = aTempTargetName.makeStringAndClear(); if ( !i_rStorage->hasByName( sTargetLibrariesStoreName ) ) @@ -1826,6 +1826,8 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto { if ( mxStorage->hasByName( maLibrariesDir ) ) xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, bInplaceStorage ? embed::ElementModes::READWRITE : embed::ElementModes::READ ); + else if ( bInplaceStorage ) + xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READWRITE ); } catch( const uno::Exception& ) { @@ -1939,6 +1941,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto // then we need to clean up the temporary storage we used for this if ( bInplaceStorage && sTempTargetStorName.getLength() ) { + OSL_ENSURE( xSourceLibrariesStor.is(), "SfxLibrariesContainer::storeLibraries_impl: unexpected: we should have a source storage here!" ); try { // for this, we first remove everything from the source storage, then copy the complete content @@ -1948,24 +1951,27 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto // (We cannot simply remove the storage, denoted by maLibrariesDir, from i_rStorage - there might be // open references to it.) - // remove - const Sequence< ::rtl::OUString > aRemoveNames( xTargetLibrariesStor->getElementNames() ); - for ( const ::rtl::OUString* pRemoveName = aRemoveNames.getConstArray(); - pRemoveName != aRemoveNames.getConstArray() + aRemoveNames.getLength(); - ++pRemoveName - ) + if ( xSourceLibrariesStor.is() ) { - xSourceLibrariesStor->removeElement( *pRemoveName ); - } + // remove + const Sequence< ::rtl::OUString > aRemoveNames( xSourceLibrariesStor->getElementNames() ); + for ( const ::rtl::OUString* pRemoveName = aRemoveNames.getConstArray(); + pRemoveName != aRemoveNames.getConstArray() + aRemoveNames.getLength(); + ++pRemoveName + ) + { + xSourceLibrariesStor->removeElement( *pRemoveName ); + } - // copy - const Sequence< ::rtl::OUString > aCopyNames( xTargetLibrariesStor->getElementNames() ); - for ( const ::rtl::OUString* pCopyName = aCopyNames.getConstArray(); - pCopyName != aCopyNames.getConstArray() + aCopyNames.getLength(); - ++pCopyName - ) - { - xTargetLibrariesStor->copyElementTo( *pCopyName, xSourceLibrariesStor, *pCopyName ); + // copy + const Sequence< ::rtl::OUString > aCopyNames( xTargetLibrariesStor->getElementNames() ); + for ( const ::rtl::OUString* pCopyName = aCopyNames.getConstArray(); + pCopyName != aCopyNames.getConstArray() + aCopyNames.getLength(); + ++pCopyName + ) + { + xTargetLibrariesStor->copyElementTo( *pCopyName, xSourceLibrariesStor, *pCopyName ); + } } // close and remove temp target -- cgit v1.2.3 From 86c3d4f3834de49b299f0cc8e825bb012f8b00d2 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 10 Feb 2010 12:16:22 +0100 Subject: aw079: changes after resync (linux) --- drawinglayer/source/primitive2d/metafileprimitive2d.cxx | 2 +- drawinglayer/source/primitive2d/shadowprimitive2d.cxx | 2 +- .../source/primitive2d/unifiedtransparenceprimitive2d.cxx | 2 +- drawinglayer/source/processor2d/canvasprocessor.cxx | 2 +- drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 2 +- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 2 +- drawinglayer/source/processor2d/vclprocessor2d.cxx | 2 +- drawinglayer/source/processor3d/shadow3dextractor.cxx | 2 +- svx/source/svdraw/svdpage.cxx | 8 +++++--- 9 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index 90e56ce0cf..3a61930493 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index 046be5372c..769bd676e4 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx index 2d9c0f8c97..a97a921637 100644 --- a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx @@ -36,7 +36,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_drawinglayer.hxx" -#include +#include #include #include #include diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx index 3e705c69c0..f2a40f1a9f 100644 --- a/drawinglayer/source/processor2d/canvasprocessor.cxx +++ b/drawinglayer/source/processor2d/canvasprocessor.cxx @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 32481646de..6327967f76 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index a2fbb54670..a7dfe08573 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index f7732d9a61..f341f74bfc 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx index 78a672eee5..8ffa098296 100644 --- a/drawinglayer/source/processor3d/shadow3dextractor.cxx +++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 6edcb4c43e..bce7dc4c48 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1214,7 +1214,8 @@ void ImpPageChange(SdrPage& rSdrPage) } SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage) -: mpSdrPage(&rSdrPage), +: SfxListener(), + mpSdrPage(&rSdrPage), mpStyleSheet(0), mpProperties(new SfxItemSet(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST)) { @@ -1225,7 +1226,8 @@ SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage) } SdrPageProperties::SdrPageProperties(const SdrPageProperties& rCandidate) -: mpSdrPage(rCandidate.mpSdrPage), +: SfxListener(), + mpSdrPage(rCandidate.mpSdrPage), mpStyleSheet(0), mpProperties(new SfxItemSet(*rCandidate.mpProperties)) { @@ -1241,7 +1243,7 @@ SdrPageProperties::~SdrPageProperties() delete mpProperties; } -void SdrPageProperties::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) +void SdrPageProperties::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) { const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint); -- cgit v1.2.3 From 4e48619a5c72da38eeff13f9ee9593d4343a527c Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 10 Feb 2010 13:05:28 +0100 Subject: dba33e: #i107717# some renaming and wording changed --- connectivity/source/commontools/TTableHelper.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index f8a43fd237..fcee5f57fa 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -98,6 +98,16 @@ public: } namespace connectivity { + ::rtl::OUString lcl_getServiceNameForSetting(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& i_sSetting) + { + ::rtl::OUString sSupportService; + Any aValue; + if ( ::dbtools::getDataSourceSetting(_xConnection,i_sSetting,aValue) ) + { + aValue >>= sSupportService; + } + return sSupportService; + } struct OTableHelperImpl { TKeyMap m_aKeys; @@ -122,13 +132,13 @@ namespace connectivity if ( xFac.is() ) { static const ::rtl::OUString s_sTableRename(RTL_CONSTASCII_USTRINGPARAM("TableRenameServiceName")); - m_xRename.set(xFac->createInstance(s_sTableRename),UNO_QUERY); + m_xRename.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableRename)),UNO_QUERY); static const ::rtl::OUString s_sTableAlteration(RTL_CONSTASCII_USTRINGPARAM("TableAlterationServiceName")); - m_xAlter.set(xFac->createInstance(s_sTableAlteration),UNO_QUERY); + m_xAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableAlteration)),UNO_QUERY); static const ::rtl::OUString s_sKeyAlteration(RTL_CONSTASCII_USTRINGPARAM("KeyAlterationServiceName")); - m_xKeyAlter.set(xFac->createInstance(s_sKeyAlteration),UNO_QUERY); + m_xKeyAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sKeyAlteration)),UNO_QUERY); static const ::rtl::OUString s_sIndexAlteration(RTL_CONSTASCII_USTRINGPARAM("IndexAlterationServiceName")); - m_xIndexAlter.set(xFac->createInstance(s_sIndexAlteration),UNO_QUERY); + m_xIndexAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sIndexAlteration)),UNO_QUERY); } } catch(const Exception&) -- cgit v1.2.3 From 5113abab456ce5cb6b9c4032c224bf266d79d85a Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 11 Feb 2010 17:35:16 +0100 Subject: aw079 #i99386# cleanup of define and last change from CL --- svx/inc/svx/sdrmasterpagedescriptor.hxx | 7 -- svx/inc/svx/svdobj.hxx | 9 -- svx/inc/svx/svdpage.hxx | 14 --- .../contact/viewcontactofmasterpagedescriptor.cxx | 50 +---------- svx/source/sdr/contact/viewcontactofsdrpage.cxx | 55 +----------- .../viewobjectcontactofmasterpagedescriptor.cxx | 15 ---- svx/source/sdr/properties/attributeproperties.cxx | 18 ---- svx/source/svdraw/sdrmasterpagedescriptor.cxx | 51 ----------- svx/source/svdraw/svdobj.cxx | 69 -------------- svx/source/svdraw/svdpage.cxx | 100 +-------------------- svx/source/unodraw/UnoGraphicExporter.cxx | 66 +------------- 11 files changed, 6 insertions(+), 448 deletions(-) diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx index 45c09c3d49..1a1677cd26 100644 --- a/svx/inc/svx/sdrmasterpagedescriptor.hxx +++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx @@ -34,8 +34,6 @@ #include #include -#define NEWPBG - ////////////////////////////////////////////////////////////////////////////// // predeclarations class SdrObject; @@ -95,12 +93,7 @@ namespace sdr sal_Bool operator==(const MasterPageDescriptor& rCandidate) const; sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const; -#ifdef NEWPBG const SfxItemSet& getCorrectFillAttributes() const; -#else - // #i42075# Get the correct BackgroundObject - SdrObject* GetBackgroundObject() const; -#endif }; } // end of namespace sdr diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index e64c4ba0f4..46ab8e278a 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -31,8 +31,6 @@ #ifndef _SVDOBJ_HXX #define _SVDOBJ_HXX -#define NEWPBG - #include #include #include @@ -1104,13 +1102,6 @@ public: sal_Bool IsTransparent( BOOL bCheckForAlphaChannel = FALSE ) const; -#ifndef NEWPBG - // #111111# - // Needed again and again i will now add a test for finding out if - // this object is the BackgroundObject of the page. - sal_Bool IsMasterPageBackgroundObject() const; -#endif - // #116168# // Give info if object is in destruction sal_Bool IsInDestruction() const; diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx index a13e96f8bd..d31d532d19 100644 --- a/svx/inc/svx/svdpage.hxx +++ b/svx/inc/svx/svdpage.hxx @@ -31,8 +31,6 @@ #ifndef _SVDPAGE_HXX #define _SVDPAGE_HXX -#define NEWPBG - #include #include #include @@ -363,8 +361,6 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////////// // class SdrPageProperties -#ifdef NEWPBG - class SVX_DLLPUBLIC SdrPageProperties : public SfxListener { private: @@ -400,7 +396,6 @@ public: SfxStyleSheet* GetStyleSheet() const; }; -#endif //////////////////////////////////////////////////////////////////////////////////////////////////// // class SdrPage @@ -451,16 +446,12 @@ friend class ChXChartDocument; protected: SdrLayerAdmin* pLayerAdmin; -#ifndef NEWPBG - SdrObject* pBackgroundObj; -#else private: SdrPageProperties* mpSdrPageProperties; public: SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; } const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; } -#endif protected: // new MasterPageDescriptorVector @@ -567,11 +558,6 @@ public: bool IsSwappingLocked() const { return mbSwappingLocked; } void SetSwappingLocked(bool bLock) { mbSwappingLocked = bLock; } -#ifndef NEWPBG - SdrObject* GetBackgroundObj() const { return pBackgroundObj; } - void SetBackgroundObj( SdrObject* pObj ); -#endif - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoPage(); virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const; diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx index 09c865f27d..b5793b5dc9 100644 --- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx @@ -65,7 +65,6 @@ namespace sdr { drawinglayer::primitive2d::Primitive2DSequence xRetval; -#ifdef NEWPBG // build primitive from page fill attributes const SfxItemSet& rPageFillAttributes = GetMasterPageDescriptor().getCorrectFillAttributes(); const drawinglayer::attribute::SdrFillAttribute aFill( @@ -90,37 +89,6 @@ namespace sdr xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } -#else - const SdrObject* pBackgroundCandidate = GetMasterPageDescriptor().GetBackgroundObject(); - - if(pBackgroundCandidate) - { - // build primitive from pBackgroundCandidate's attributes - const SfxItemSet& rFillProperties = pBackgroundCandidate->GetMergedItemSet(); - const drawinglayer::attribute::SdrFillAttribute aFill( - drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties)); - - if(!aFill.isDefault()) - { - // direct model data is the page size, get and use it - const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage(); - const basegfx::B2DRange aInnerRange( - rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(), - rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), - rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder()); - const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); - const basegfx::B2DHomMatrix aEmptyTransform; - const drawinglayer::primitive2d::Primitive2DReference xReference( - drawinglayer::primitive2d::createPolyPolygonFillPrimitive( - basegfx::B2DPolyPolygon(aInnerPolgon), - aEmptyTransform, - aFill, - drawinglayer::attribute::FillGradientAttribute())); - - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - } -#endif return xRetval; } @@ -139,27 +107,11 @@ namespace sdr sal_uInt32 ViewContactOfMasterPageDescriptor::GetObjectCount() const { - sal_uInt32 nRetval(GetMasterPageDescriptor().GetUsedPage().GetObjCount()); - -#ifndef NEWPBG - if(nRetval && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject()) - { - nRetval--; - } -#endif - - return nRetval; + return GetMasterPageDescriptor().GetUsedPage().GetObjCount(); } ViewContact& ViewContactOfMasterPageDescriptor::GetViewContact(sal_uInt32 nIndex) const { -#ifndef NEWPBG - if(GetMasterPageDescriptor().GetUsedPage().GetObjCount() && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject()) - { - nIndex++; - } -#endif - return GetMasterPageDescriptor().GetUsedPage().GetObj(nIndex)->GetViewContact(); } diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index 6c4461f3c5..80887af5a4 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -206,7 +206,6 @@ namespace sdr } else { -#ifdef NEWPBG // build primitive from pObject's attributes const SfxItemSet& rFillAttributes = rPage.getSdrPageProperties().GetItemSet(); const drawinglayer::attribute::SdrFillAttribute aFill( @@ -229,42 +228,6 @@ namespace sdr xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } - -#else - OSL_ENSURE(0 != rPage.GetObjCount(), "MasterPage without MPBGO detected (!)"); - - if(rPage.GetObjCount()) - { - SdrObject* pObject = rPage.GetObj(0); - OSL_ENSURE(pObject && pObject->IsMasterPageBackgroundObject(), "MasterPage with wrong MPBGO detected (!)"); - - if(pObject && pObject->IsMasterPageBackgroundObject()) - { - // build primitive from pObject's attributes - const SfxItemSet& rFillProperties = pObject->GetMergedItemSet(); - const drawinglayer::attribute::SdrFillAttribute aFill( - drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties)); - - if(!aFill.isDefault() && 1.0 != aFill.getTransparence()) - { - // direct model data is the page size, get and use it - const basegfx::B2DRange aInnerRange( - rPage.GetLftBorder(), rPage.GetUppBorder(), - rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder()); - const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange)); - const basegfx::B2DHomMatrix aEmptyTransform; - const drawinglayer::primitive2d::Primitive2DReference xReference( - drawinglayer::primitive2d::createPolyPolygonFillPrimitive( - basegfx::B2DPolyPolygon(aInnerPolgon), - aEmptyTransform, - aFill, - drawinglayer::attribute::FillGradientAttribute())); - - xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); - } - } - } -#endif } } @@ -485,27 +448,11 @@ namespace sdr sal_uInt32 ViewContactOfPageHierarchy::GetObjectCount() const { - sal_uInt32 nSubObjectCount(getPage().GetObjCount()); - -#ifndef NEWPBG - if(nSubObjectCount && getPage().GetObj(0L)->IsMasterPageBackgroundObject()) - { - nSubObjectCount--; - } -#endif - - return nSubObjectCount; + return getPage().GetObjCount(); } ViewContact& ViewContactOfPageHierarchy::GetViewContact(sal_uInt32 nIndex) const { -#ifndef NEWPBG - if(getPage().GetObjCount() && getPage().GetObj(0L)->IsMasterPageBackgroundObject()) - { - nIndex++; - } -#endif - SdrObject* pObj = getPage().GetObj(nIndex); DBG_ASSERT(pObj, "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)"); return pObj->GetViewContact(); diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx index e7b414cd71..2abdf552ec 100644 --- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx @@ -98,7 +98,6 @@ namespace sdr rDisplayInfo.SetProcessLayers(aPreprocessedLayers); rDisplayInfo.SetSubContentActive(true); -#ifdef NEWPBG // check layer visibility (traditionally was member of layer 1) if(aPreprocessedLayers.IsSet(1)) { @@ -109,20 +108,6 @@ namespace sdr xRetval = static_cast< ViewContactOfMasterPageDescriptor& >(GetViewContact()).getViewIndependentPrimitive2DSequence(); } } -#else - // check if there is a MasterPageBackgroundObject and if it's visible in the LayerSet - const SdrObject* pBackgroundCandidate = rDescriptor.GetBackgroundObject(); - - if(pBackgroundCandidate && aPreprocessedLayers.IsSet(pBackgroundCandidate->GetLayer())) - { - // hide PageBackground for special DrawModes; historical reasons - if(!GetObjectContact().isDrawModeGray() && !GetObjectContact().isDrawModeHighContrast()) - { - // if yes, create the default background primitive sequence - xRetval = static_cast< ViewContactOfMasterPageDescriptor& >(GetViewContact()).getViewIndependentPrimitive2DSequence(); - } - } -#endif // hide MasterPage content? Test self here for hierarchy if(isPrimitiveVisible(rDisplayInfo)) diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 6f0941ea42..bbcb5e95ae 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -587,24 +587,6 @@ namespace sdr bHintUsed = sal_True; } -#ifndef NEWPBG - // #111111# - // When it's the BackgroundObject, set the MasterPage to changed to - // get a refresh for the evtl. changed BackgroundStyle - - // #114265# - // To only invalidate the page when the StyleSheet change happens, - // some more rigid testing is necessary. - const SfxSimpleHint *pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint); - - if(pSimpleHint - && pSimpleHint->GetId() == SFX_HINT_DATACHANGED - && GetSdrObject().IsMasterPageBackgroundObject()) - { - GetSdrObject().GetPage()->ActionChanged(); - } -#endif - if(!bHintUsed) { // forward to SdrObject ATM. Not sure if this will be necessary diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index 0b02a80b7c..d01e18c73f 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -36,11 +36,8 @@ // #i42075# #include - -#ifdef NEWPBG #include #include -#endif ////////////////////////////////////////////////////////////////////////////// @@ -102,16 +99,6 @@ namespace sdr { maVisibleLayers = rNew; GetViewContact().ActionChanged(); - -#ifndef NEWPBG - // #i42075# For AFs convenience, do a change notify at the MasterPageBackgroundObject, too - SdrObject* pObject = GetBackgroundObject(); - - if(pObject) - { - pObject->BroadcastObjectChange(); - } -#endif } } @@ -130,7 +117,6 @@ namespace sdr || maVisibleLayers != rCandidate.maVisibleLayers); } -#ifdef NEWPBG const SfxItemSet& MasterPageDescriptor::getCorrectFillAttributes() const { const SfxItemSet& rOwnerPageAtributes = GetOwnerPage().getSdrPageProperties().GetItemSet(); @@ -142,43 +128,6 @@ namespace sdr return GetUsedPage().getSdrPageProperties().GetItemSet(); } -#else - // #i42075# Get the correct BackgroundObject - SdrObject* MasterPageDescriptor::GetBackgroundObject() const - { - SdrObject* pRetval = 0L; - const SdrPage& rMasterPage = GetUsedPage(); - - // Here i will rely on old knowledge about the 0'st element of a masterpage - // being the PageBackgroundObject. This will be removed again when that definition - // will be changed. -#ifdef DBG_UTIL - const sal_uInt32 nMasterPageObjectCount(rMasterPage.GetObjCount()); - DBG_ASSERT(1 <= nMasterPageObjectCount, - "MasterPageDescriptor::GetBackgroundObject(): MasterPageBackgroundObject missing (!)"); -#endif - pRetval = rMasterPage.GetObj(0L); - - // Test if it's really what we need. There are known problems where - // the 0th object is not the MasterPageBackgroundObject at all. - if(pRetval && !pRetval->IsMasterPageBackgroundObject()) - { - pRetval = 0L; - } - - // Get the evtl. existing page background object from the using page and use it - // preferred to the MasterPageBackgroundObject - const SdrPage& rOwnerPage = GetOwnerPage(); - SdrObject* pCandidate = rOwnerPage.GetBackgroundObj(); - - if(pCandidate) - { - pRetval = pCandidate; - } - - return pRetval; - } -#endif } // end of namespace sdr ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 4814597c5f..f642e89cd1 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -375,53 +375,6 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const // DrawContact support: Methods for handling Object changes void SdrObject::ActionChanged() const { -#ifndef NEWPBG - // Forward change call to MasterPageDescriptor if BackgroundObject was changed - const SdrPage* pObjectsPage = GetPage(); - - if(pObjectsPage) - { - // do the necessary ActionChange() forwards when a MasterPageBackgroundObject - // gets changed. This can be removed as soon as the MasterPageBackgroundObject - // handling is replaced with the proper ItemSet handling at the SdrPages. The - // needed ActionChanged calls will then be triggered by changing those ItemSets. - if(pObjectsPage->IsMasterPage()) - { - if(IsMasterPageBackgroundObject()) - { - SdrModel* pObjectsModel = GetModel(); - - if(pObjectsModel) - { - const sal_uInt16 nCount(pObjectsModel->GetPageCount()); - - for(sal_uInt16 a(0); a < nCount; a++) - { - const SdrPage* pUserPage = pObjectsModel->GetPage(a); - - if(pUserPage && pUserPage->TRG_HasMasterPage()) - { - SdrPage& rUsedMasterPage = pUserPage->TRG_GetMasterPage(); - - if(&rUsedMasterPage == pObjectsPage) - { - pUserPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged(); - } - } - } - } - } - } - else - { - if(pObjectsPage->TRG_HasMasterPage() && pObjectsPage->GetBackgroundObj() == this) - { - pObjectsPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged(); - } - } - } -#endif - // Do necessary ViewContact actions GetViewContact().ActionChanged(); } @@ -3119,28 +3072,6 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba SetSnapRect(aBaseRect); } -#ifndef NEWPBG -// #111111# -// Needed again and again i will now add a test for finding out if -// this object is the BackgroundObject of the page. -sal_Bool SdrObject::IsMasterPageBackgroundObject() const -{ - if(pObjList - && pObjList == pPage - && pPage->IsMasterPage() - && pObjList->GetObj(0) == this - && 1L == (pPage->GetPageNum() % 2)) - { - // 0'th object, directly on page, page is MasterPage, - // MasterPagePageNum is 1,3,5,... - // --> It's the background object (!) - return sal_True; - } - - return sal_False; -} -#endif - // #116168# // Give info if object is in destruction sal_Bool SdrObject::IsInDestruction() const diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index bce7dc4c48..f352fc61d0 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1177,7 +1177,6 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const } //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef NEWPBG void SdrPageProperties::ImpRemoveStyleSheet() { @@ -1311,7 +1310,6 @@ SfxStyleSheet* SdrPageProperties::GetStyleSheet() const return mpStyleSheet; } -#endif //////////////////////////////////////////////////////////////////////////////////////////////////// TYPEINIT1(SdrPage,SdrObjList); @@ -1326,11 +1324,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) nBordRgt(0L), nBordLwr(0L), pLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())), -#ifndef NEWPBG - pBackgroundObj(0L), -#else mpSdrPageProperties(0), -#endif mpMasterPageDescriptor(0L), nPageNum(0L), mbMaster(bMasterPage), @@ -1343,9 +1337,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) aPrefVisiLayers.SetAll(); eListKind = (bMasterPage) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE; -#ifdef NEWPBG mpSdrPageProperties = new SdrPageProperties(*this); -#endif } SdrPage::SdrPage(const SdrPage& rSrcPage) @@ -1359,11 +1351,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage) nBordRgt(rSrcPage.nBordRgt), nBordLwr(rSrcPage.nBordLwr), pLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())), -#ifndef NEWPBG - pBackgroundObj(0L), -#else mpSdrPageProperties(0), -#endif mpMasterPageDescriptor(0L), nPageNum(rSrcPage.nPageNum), mbMaster(rSrcPage.mbMaster), @@ -1398,9 +1386,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage) xComponent->dispose(); } -#ifdef NEWPBG mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties()); -#endif } SdrPage::~SdrPage() @@ -1434,9 +1420,6 @@ SdrPage::~SdrPage() // when they get called from PageInDestruction(). maPageUsers.clear(); -#ifndef NEWPBG - SdrObject::Free( pBackgroundObj ); -#endif delete pLayerAdmin; TRG_ClearMasterPage(); @@ -1448,12 +1431,10 @@ SdrPage::~SdrPage() mpViewContact = 0L; } -#ifdef NEWPBG { delete mpSdrPageProperties; mpSdrPageProperties = 0; } -#endif DBG_DTOR(SdrPage,NULL); } @@ -1466,10 +1447,6 @@ void SdrPage::operator=(const SdrPage& rSrcPage) mpViewContact = 0L; } -#ifndef NEWPBG - SdrObject::Free( pBackgroundObj ); -#endif - // Joe also sets some parameters for the class this one // is derived from. SdrObjList does the same bad handling of // copy constructor and operator=, so i better let it stand here. @@ -1503,22 +1480,10 @@ void SdrPage::operator=(const SdrPage& rSrcPage) mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent; -#ifndef NEWPBG - if(rSrcPage.pBackgroundObj) - { - pBackgroundObj = rSrcPage.pBackgroundObj->Clone(); - pBackgroundObj->SetPage( this ); - pBackgroundObj->SetModel( pModel ); - - // #i62000# for single-page MPBGO, force no line - pBackgroundObj->SetMergedItem(XLineStyleItem(XLINE_NONE)); - } -#else { delete mpSdrPageProperties; mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties()); } -#endif // Now copy the contained obejcts (by cloning them) SdrObjList::operator=(rSrcPage); @@ -1697,16 +1662,9 @@ void SdrPage::SetModel(SdrModel* pNewModel) } pLayerAdmin->SetModel(pNewModel); -#ifndef NEWPBG - if( pBackgroundObj ) - pBackgroundObj->SetModel( pNewModel ); -#else - { - SdrPageProperties *pNew = new SdrPageProperties(getSdrPageProperties()); - delete mpSdrPageProperties; - mpSdrPageProperties = pNew; - } -#endif + SdrPageProperties *pNew = new SdrPageProperties(getSdrPageProperties()); + delete mpSdrPageProperties; + mpSdrPageProperties = pNew; } // update listeners at possible api wrapper object @@ -1840,24 +1798,6 @@ XubString SdrPage::GetLayoutName() const return String(); } -#ifndef NEWPBG -void SdrPage::SetBackgroundObj( SdrObject* pObj ) -{ - if ( pObj ) - { - pObj->SetPage( this ); - pObj->SetModel( pModel ); - pObj->SetLayer( 1 ); // Nothing known about the backgroundlayer... - - // #i62000# for single-page MPBGO, force no line - pObj->SetMergedItem(XLineStyleItem(XLINE_NONE)); - } - - SdrObject::Free( pBackgroundObj ); - pBackgroundObj = pObj; -} -#endif - void SdrPage::SetInserted( bool bIns ) { if( mbInserted != bIns ) @@ -1931,7 +1871,6 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay ) aColor = pView->GetApplicationDocumentColor(); } -#ifdef NEWPBG const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet(); if(!IsMasterPage() && TRG_HasMasterPage()) @@ -1943,39 +1882,6 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay ) } GetDraftFillColor(*pBackgroundFill, aColor); -#else - // first, see if we have a background object - SdrObject* pBackgroundObj2 = NULL; - - if( IsMasterPage() ) - { - if( GetObjCount() ) - pBackgroundObj2 = GetObj( 0 ); - } - else - { - pBackgroundObj2 = GetBackgroundObj(); - if( NULL == pBackgroundObj2 ) - { - // if not, see if we have a masterpage and get that background object - if(TRG_HasMasterPage()) - { - SdrPage& rMasterPage = TRG_GetMasterPage(); - - if(rMasterPage.GetObjCount()) - { - pBackgroundObj2 = rMasterPage.GetObj( 0 ); - } - } - } - } - - if( pBackgroundObj2 ) - { - const SfxItemSet& rSet = pBackgroundObj2->GetMergedItemSet(); - GetDraftFillColor( rSet, aColor ); - } -#endif return aColor; } diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 15770b08fe..96736253ec 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -618,41 +618,17 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, VirtualDevice aVDev; const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY ); -#ifndef NEWPBG - // create a view - SdrView* pView; - - if( PTR_CAST( FmFormModel, mpDoc ) ) - { - pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev ); - } - else - { - pView = new SdrView( mpDoc, &aVDev ); - } - - pView->SetBordVisible( FALSE ); - pView->SetPageVisible( FALSE ); - pView->ShowSdrPage( pPage ); -#endif - SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL); maOldCalcFieldValueHdl = rOutl.GetCalcFieldValueHdl(); rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) ); -#ifdef NEWPBG rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor() ); -#else - rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) ); -#endif // #i102251# const sal_uInt32 nOldCntrl(rOutl.GetControlWord()); sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING; rOutl.SetControlWord(nCntrl); -#ifdef NEWPBG SdrObject* pTempBackgroundShape = 0; -#endif std::vector< SdrObject* > aShapes; bool bRet = true; @@ -661,26 +637,10 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, { if( rSettings.mbExportOnlyBackground ) { -#ifdef NEWPBG pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize())); pTempBackgroundShape->SetMergedItemSet(pPage->getSdrPageProperties().GetItemSet()); pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE)); aShapes.push_back(pTempBackgroundShape); -#else - SdrObject* pShape = 0; - if( pPage->IsMasterPage() ) - { - if( pPage->GetObjCount() > 0 ) - pShape = pPage->GetObj(0); - } - else - { - pShape = pPage->GetBackgroundObj(); - } - - if( pShape ) - aShapes.push_back( pShape ); -#endif } else { @@ -759,7 +719,6 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aMtf.Record( &aVDev ); Size aNewSize; -#ifdef NEWPBG // create a view SdrView* pView; @@ -775,7 +734,6 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, pView->SetBordVisible( FALSE ); pView->SetPageVisible( FALSE ); pView->ShowSdrPage( pPage ); -#endif if ( pView && pPage ) { @@ -817,13 +775,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aGraphic = Graphic(aMtf); } -#ifdef NEWPBG if ( pView ) { pView->HideSdrPage(); delete pView; } -#endif + if( rSettings.mbTranslucent ) { Size aOutSize; @@ -948,17 +905,6 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, // calculate bound rect for all shapes Rectangle aBound; -#ifndef NEWPBG - if(rSettings.mbExportOnlyBackground) - { - // shape is MPBGO and if it's not yet set, it's size will - // be empty when using GetCurrentBoundRect(). Since anyways - // the page size is used by MPBGO and MPBGO is EOLd, get - // the wanted size from the page model directly - aBound = Rectangle(Point(0,0), pPage->GetSize()); - } - else -#endif { std::vector< SdrObject* >::iterator aIter = aShapes.begin(); const std::vector< SdrObject* >::iterator aEnd = aShapes.end(); @@ -1032,20 +978,10 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, } } -#ifndef NEWPBG - if ( pView ) - { - pView->HideSdrPage(); - delete pView; - } -#endif - -#ifdef NEWPBG if(pTempBackgroundShape) { SdrObject::Free(pTempBackgroundShape); } -#endif rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl ); -- cgit v1.2.3 From 46752d1d51b5c82f17469c5749bdfa9c39d2788d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 12 Feb 2010 11:35:33 +0100 Subject: vcl109: #i109129# avoid recursive behavior of NSFileWrapper --- fpicker/source/aqua/FilterHelper.cxx | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx index 75996f2d32..f135c63910 100644 --- a/fpicker/source/aqua/FilterHelper.cxx +++ b/fpicker/source/aqua/FilterHelper.cxx @@ -394,30 +394,25 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename) { DBG_PRINT_ENTRY(CLASS_NAME, __func__); -// OSL_TRACE("filter event handler called"); - if (m_aCurrentFilter == NULL) { OSL_TRACE("filter name is null"); return sal_True; } NSFileManager *manager = [NSFileManager defaultManager]; - MacOSBOOL bDir = NO; - if ([manager fileExistsAtPath:sFilename isDirectory:&bDir] && bDir == YES) { -// OSL_TRACE(" folder"); - return sal_True; - } - - NSFileWrapper *wrapper = [[NSFileWrapper alloc] initWithPath:sFilename]; - MacOSBOOL bIsLink = [wrapper isSymbolicLink]; - [wrapper release]; - if (bIsLink) { -// OSL_TRACE(" symboliclink"); - return sal_True; + NSDictionary* pAttribs = [manager fileAttributesAtPath: sFilename traverseLink: NO]; + if( pAttribs ) + { + NSObject* pType = [pAttribs objectForKey: NSFileType]; + if( pType && [pType isMemberOfClass: [NSString class]] ) + { + NSString* pT = (NSString*)pType; + if( [pT isEqualToString: NSFileTypeDirectory] || + [pT isEqualToString: NSFileTypeSymbolicLink] ) + return sal_True; + } } -// OSL_TRACE(" file"); - FilterList::iterator filter = ::std::find_if(m_pFilterList->begin(), m_pFilterList->end(), FilterTitleMatch(m_aCurrentFilter)); if (filter == m_pFilterList->end()) { OSL_TRACE("filter not found in list"); @@ -427,7 +422,6 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename) OUStringList suffixList = filter->getFilterSuffixList(); { -// OSL_TRACE(" starting to work"); rtl::OUString aName = [sFilename OUString]; rtl::OUString allMatcher = rtl::OUString::createFromAscii(".*"); for(OUStringList::iterator iter = suffixList.begin(); iter != suffixList.end(); iter++) { -- cgit v1.2.3 From 8e365fc706b657e588678b4acc75e8e8cd8e2306 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 12 Feb 2010 12:08:41 +0100 Subject: autorecovery: let the XMLSettingsExportHelper work on an abstract interface for actual writing, instead of an SvXMLExport. This way, it can also be used in contexts where we do not have a full blown SvXMLExport instance. --- xmloff/inc/xmloff/SettingsExportHelper.hxx | 12 ++- xmloff/inc/xmloff/XMLSettingsExportContext.hxx | 66 +++++++++++++ xmloff/prj/d.lst | 1 + xmloff/source/core/SettingsExportHelper.cxx | 129 +++++++++++++------------ xmloff/source/core/xmlexp.cxx | 74 +++++++++++++- 5 files changed, 216 insertions(+), 66 deletions(-) create mode 100644 xmloff/inc/xmloff/XMLSettingsExportContext.hxx diff --git a/xmloff/inc/xmloff/SettingsExportHelper.hxx b/xmloff/inc/xmloff/SettingsExportHelper.hxx index 5e0514aa2d..c6ff451575 100644 --- a/xmloff/inc/xmloff/SettingsExportHelper.hxx +++ b/xmloff/inc/xmloff/SettingsExportHelper.hxx @@ -43,9 +43,15 @@ namespace com namespace util { struct DateTime; } } } } + +namespace xmloff +{ + class XMLSettingsExportContext; +} + class XMLSettingsExportHelper { - SvXMLExport& rExport; + ::xmloff::XMLSettingsExportContext& m_rContext; ::com::sun::star::uno::Reference< ::com::sun::star::util::XStringSubstitution > mxStringSubsitution; @@ -94,10 +100,10 @@ class XMLSettingsExportHelper const rtl::OUString rName) const; public: - XMLSettingsExportHelper(SvXMLExport& rExport); + XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext ); ~XMLSettingsExportHelper(); - void exportSettings( + void exportAllSettings( const com::sun::star::uno::Sequence& aProps, const rtl::OUString& rName) const; }; diff --git a/xmloff/inc/xmloff/XMLSettingsExportContext.hxx b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx new file mode 100644 index 0000000000..d26a7e46a3 --- /dev/null +++ b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx @@ -0,0 +1,66 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef XML_SETTINGS_EXPORT_CONTEXT_HXX +#define XML_SETTINGS_EXPORT_CONTEXT_HXX + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include "xmloff/xmltoken.hxx" + +//........................................................................ +namespace xmloff +{ +//........................................................................ + + //==================================================================== + //= XMLExporter + //==================================================================== + class SAL_NO_VTABLE XMLSettingsExportContext + { + public: + virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, + const ::rtl::OUString& i_rValue ) = 0; + virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, + enum ::xmloff::token::XMLTokenEnum i_eValue ) = 0; + + virtual void StartElement( enum ::xmloff::token::XMLTokenEnum i_eName, + const sal_Bool i_bIgnoreWhitespace ) = 0; + virtual void EndElement( const sal_Bool i_bIgnoreWhitespace ) = 0; + + virtual void Characters( const ::rtl::OUString& i_rCharacters ) = 0; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + GetServiceFactory() const = 0; + + }; + +//........................................................................ +} // namespace xmloff +//........................................................................ + +#endif // XML_SETTINGS_EXPORT_CONTEXT_HXX diff --git a/xmloff/prj/d.lst b/xmloff/prj/d.lst index 686b4b70a0..98ab3c3e5c 100644 --- a/xmloff/prj/d.lst +++ b/xmloff/prj/d.lst @@ -87,6 +87,7 @@ mkdir: %_DEST%\inc%_EXT%\xmloff ..\inc\HatchStyle.hxx %_DEST%\inc%_EXT%\xmloff\HatchStyle.hxx ..\inc\ImageStyle.hxx %_DEST%\inc%_EXT%\xmloff\ImageStyle.hxx ..\inc\xmloff\SettingsExportHelper.hxx %_DEST%\inc%_EXT%\xmloff\SettingsExportHelper.hxx +..\inc\xmloff\XMLSettingsExportContext.hxx %_DEST%\inc%_EXT%\xmloff\XMLSettingsExportContext.hxx ..\inc\xmloff\DocumentSettingsContext.hxx %_DEST%\inc%_EXT%\xmloff\DocumentSettingsContext.hxx ..\inc\xmloff\XMLGraphicsDefaultStyle.hxx %_DEST%\inc%_EXT%\xmloff\XMLGraphicsDefaultStyle.hxx ..\inc\XMLEmbeddedObjectExportFilter.hxx %_DEST%\inc%_EXT%\xmloff\XMLEmbeddedObjectExportFilter.hxx diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index 33db74dd13..54b57910ba 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -35,32 +35,27 @@ #include #include #include +#include #include -// #110680# -//#ifndef _COMPHELPER_PROCESSFACTORYHXX_ -//#include -//#endif #include #include #include #include -#ifndef _COM_SUN_STAR_CONTAINER_XIndexCONTAINER_HPP_ #include -#endif #include #include #include #include #include -#include +#include #include using namespace ::com::sun::star; using namespace ::xmloff::token; -XMLSettingsExportHelper::XMLSettingsExportHelper(SvXMLExport& rTempExport) -: rExport(rTempExport) +XMLSettingsExportHelper::XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext ) +: m_rContext( i_rContext ) , msPrinterIndependentLayout( RTL_CONSTASCII_USTRINGPARAM( "PrinterIndependentLayout" ) ) , msColorTableURL( RTL_CONSTASCII_USTRINGPARAM( "ColorTableURL" ) ) , msLineEndTableURL( RTL_CONSTASCII_USTRINGPARAM( "LineEndTableURL" ) ) @@ -197,89 +192,97 @@ void XMLSettingsExportHelper::CallTypeFunction(const uno::Any& rAny, void XMLSettingsExportHelper::exportBool(const sal_Bool bValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BOOLEAN); - SvXMLElementExport aBoolElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_BOOLEAN ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUString sValue; if (bValue) sValue = GetXMLToken(XML_TRUE); else sValue = GetXMLToken(XML_FALSE); - rExport.GetDocHandler()->characters(sValue); + m_rContext.Characters( sValue ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportByte(const sal_Int8 nValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BYTE); - SvXMLElementExport aShortElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_BYTE ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue)); - rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear()); + m_rContext.Characters( sBuffer.makeStringAndClear() ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportShort(const sal_Int16 nValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_SHORT); - SvXMLElementExport aShortElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_SHORT ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue)); - rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear()); + m_rContext.Characters( sBuffer.makeStringAndClear() ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportInt(const sal_Int32 nValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_INT); - SvXMLElementExport aIntElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_INT ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertNumber(sBuffer, nValue); - rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear()); + m_rContext.Characters( sBuffer.makeStringAndClear() ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportLong(const sal_Int64 nValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_LONG); - SvXMLElementExport aIntElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_LONG ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUString sValue(rtl::OUString::valueOf(nValue)); - rExport.GetDocHandler()->characters(sValue); + m_rContext.Characters( sValue ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportDouble(const double fValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_DOUBLE); - SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_DOUBLE ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertDouble(sBuffer, fValue); - rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear()); + m_rContext.Characters( sBuffer.makeStringAndClear() ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportString(const rtl::OUString& sValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_STRING); - SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_STRING ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); if (sValue.getLength()) - rExport.GetDocHandler()->characters(sValue); + m_rContext.Characters( sValue ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportDateTime(const util::DateTime& aValue, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_DATETIME); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_DATETIME ); rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertDateTime(sBuffer, aValue); - SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); - rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear()); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); + m_rContext.Characters( sBuffer.makeStringAndClear() ); + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportSequencePropertyValue( @@ -290,10 +293,11 @@ void XMLSettingsExportHelper::exportSequencePropertyValue( sal_Int32 nLength(aProps.getLength()); if(nLength) { - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - SvXMLElementExport aSequenceElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_SET, sal_True, sal_True); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.StartElement( XML_CONFIG_ITEM_SET, sal_True ); for (sal_Int32 i = 0; i < nLength; i++) CallTypeFunction(aProps[i].Value, aProps[i].Name); + m_rContext.EndElement( sal_True ); } } void XMLSettingsExportHelper::exportSymbolDescriptors( @@ -302,7 +306,7 @@ void XMLSettingsExportHelper::exportSymbolDescriptors( { // #110680# // uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() ); - uno::Reference< lang::XMultiServiceFactory > xServiceFactory( rExport.getServiceFactory() ); + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( m_rContext.GetServiceFactory() ); DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportSymbolDescriptors: got no service manager" ); if( xServiceFactory.is() ) @@ -365,15 +369,16 @@ void XMLSettingsExportHelper::exportbase64Binary( { DBG_ASSERT(rName.getLength(), "no name"); sal_Int32 nLength(aProps.getLength()); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BASE64BINARY); - SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.AddAttribute( XML_TYPE, XML_BASE64BINARY ); + m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); if(nLength) { rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::encodeBase64(sBuffer, aProps); - rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear()); + m_rContext.Characters( sBuffer.makeStringAndClear() ); } + m_rContext.EndElement( sal_False ); } void XMLSettingsExportHelper::exportMapEntry(const uno::Any& rAny, @@ -387,10 +392,11 @@ void XMLSettingsExportHelper::exportMapEntry(const uno::Any& rAny, if (nLength) { if (bNameAccess) - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - SvXMLElementExport aEntryElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_ENTRY, sal_True, sal_True); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.StartElement( XML_CONFIG_ITEM_MAP_ENTRY, sal_True ); for (sal_Int32 i = 0; i < nLength; i++) CallTypeFunction(aProps[i].Value, aProps[i].Name); + m_rContext.EndElement( sal_True ); } } @@ -403,11 +409,12 @@ void XMLSettingsExportHelper::exportNameAccess( "wrong NameAccess" ); if(aNamed->hasElements()) { - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - SvXMLElementExport aNamedElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_NAMED, sal_True, sal_True); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.StartElement( XML_CONFIG_ITEM_MAP_NAMED, sal_True ); uno::Sequence< rtl::OUString > aNames(aNamed->getElementNames()); for (sal_Int32 i = 0; i < aNames.getLength(); i++) exportMapEntry(aNamed->getByName(aNames[i]), aNames[i], sal_True); + m_rContext.EndElement( sal_True ); } } @@ -421,13 +428,14 @@ void XMLSettingsExportHelper::exportIndexAccess( rtl::OUString sEmpty;// ( RTLCONSTASCII_USTRINGPARAM( "View" ) ); if(aIndexed->hasElements()) { - rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName); - SvXMLElementExport aIndexedElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_INDEXED, sal_True, sal_True); + m_rContext.AddAttribute( XML_NAME, rName ); + m_rContext.StartElement( XML_CONFIG_ITEM_MAP_INDEXED, sal_True ); sal_Int32 nCount = aIndexed->getCount(); for (sal_Int32 i = 0; i < nCount; i++) { exportMapEntry(aIndexed->getByIndex(i), sEmpty, sal_False); } + m_rContext.EndElement( sal_True ); } } @@ -448,7 +456,7 @@ void XMLSettingsExportHelper::exportForbiddenCharacters( // #110680# // uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() ); - uno::Reference< lang::XMultiServiceFactory > xServiceFactory( rExport.getServiceFactory() ); + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( m_rContext.GetServiceFactory() ); DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportForbiddenCharacters: got no service manager" ); if( xServiceFactory.is() ) @@ -499,14 +507,12 @@ void XMLSettingsExportHelper::exportForbiddenCharacters( } } -void XMLSettingsExportHelper::exportSettings( +void XMLSettingsExportHelper::exportAllSettings( const uno::Sequence& aProps, const rtl::OUString& rName) const { DBG_ASSERT(rName.getLength(), "no name"); - ::rtl::OUString aQName = - rExport.GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOO, rName ); - exportSequencePropertyValue(aProps, aQName); + exportSequencePropertyValue(aProps, rName); } @@ -534,15 +540,16 @@ void XMLSettingsExportHelper::ManipulateSetting( uno::Any& rAny, const rtl::OUSt { if( !mxStringSubsitution.is() ) { - if( rExport.getServiceFactory().is() ) try + if( m_rContext.GetServiceFactory().is() ) try { const_cast< XMLSettingsExportHelper* >(this)->mxStringSubsitution = uno::Reference< util::XStringSubstitution >::query( - rExport.getServiceFactory()-> + m_rContext.GetServiceFactory()-> createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.PathSubstitution" ) ) ) ); } catch( uno::Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index ee29b3161d..ca3522f8cb 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include "XMLStarBasicExportHandler.hxx" @@ -160,6 +161,72 @@ const XMLServiceMapEntry_Impl aServiceMap[] = //============================================================================== +class SAL_DLLPRIVATE SettingsExportFacade : public ::xmloff::XMLSettingsExportContext +{ +public: + SettingsExportFacade( SvXMLExport& i_rExport ) + :m_rExport( i_rExport ) + { + } + + virtual ~SettingsExportFacade() + { + } + + virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, + const ::rtl::OUString& i_rValue ); + virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, + enum ::xmloff::token::XMLTokenEnum i_eValue ); + + virtual void StartElement( enum ::xmloff::token::XMLTokenEnum i_eName, + const sal_Bool i_bIgnoreWhitespace ); + virtual void EndElement( const sal_Bool i_bIgnoreWhitespace ); + + virtual void Characters( const ::rtl::OUString& i_rCharacters ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + GetServiceFactory() const; +private: + SvXMLExport& m_rExport; + ::std::stack< ::rtl::OUString > m_aElements; +}; + +void SettingsExportFacade::AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, const ::rtl::OUString& i_rValue ) +{ + m_rExport.AddAttribute( XML_NAMESPACE_CONFIG, i_eName, i_rValue ); +} + +void SettingsExportFacade::AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, enum ::xmloff::token::XMLTokenEnum i_eValue ) +{ + m_rExport.AddAttribute( XML_NAMESPACE_CONFIG, i_eName, i_eValue ); +} + +void SettingsExportFacade::StartElement( enum ::xmloff::token::XMLTokenEnum i_eName, const sal_Bool i_bIgnoreWhitespace ) +{ + const ::rtl::OUString sElementName( m_rExport.GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_CONFIG, GetXMLToken( i_eName ) ) ); + m_rExport.StartElement( sElementName, i_bIgnoreWhitespace ); + m_aElements.push( sElementName ); +} + +void SettingsExportFacade::EndElement( const sal_Bool i_bIgnoreWhitespace ) +{ + const ::rtl::OUString sElementName( m_aElements.top() ); + m_rExport.EndElement( sElementName, i_bIgnoreWhitespace ); + m_aElements.pop(); +} + +void SettingsExportFacade::Characters( const ::rtl::OUString& i_rCharacters ) +{ + m_rExport.GetDocHandler()->characters( i_rCharacters ); +} + +Reference< XMultiServiceFactory > SettingsExportFacade::GetServiceFactory() const +{ + return m_rExport.getServiceFactory(); +} + +//============================================================================== + class SvXMLExportEventListener : public cppu::WeakImplHelper1< com::sun::star::lang::XEventListener > { @@ -1103,7 +1170,9 @@ void SvXMLExport::ImplExportSettings() nSettingsCount != 0, XML_NAMESPACE_OFFICE, XML_SETTINGS, sal_True, sal_True ); - XMLSettingsExportHelper aSettingsExportHelper(*this); + + SettingsExportFacade aSettingsExportContext( *this ); + XMLSettingsExportHelper aSettingsExportHelper( aSettingsExportContext ); for ( ::std::list< SettingsGroup >::const_iterator settings = aSettings.begin(); settings != aSettings.end(); @@ -1114,7 +1183,8 @@ void SvXMLExport::ImplExportSettings() continue; OUString sSettingsName( GetXMLToken( settings->eGroupName ) ); - aSettingsExportHelper.exportSettings( settings->aSettings, sSettingsName ); + OUString sQName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOO, sSettingsName ); + aSettingsExportHelper.exportAllSettings( settings->aSettings, sQName ); } } } -- cgit v1.2.3 From 280011607458c9521d87dc6fcaacc03b10b16d1c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 15 Feb 2010 10:48:01 +0100 Subject: vcl109: #i109129# use isKindOfClass instead of isMemeberOfClass --- fpicker/source/aqua/FilterHelper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx index f135c63910..5fc9369cc2 100644 --- a/fpicker/source/aqua/FilterHelper.cxx +++ b/fpicker/source/aqua/FilterHelper.cxx @@ -404,7 +404,7 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename) if( pAttribs ) { NSObject* pType = [pAttribs objectForKey: NSFileType]; - if( pType && [pType isMemberOfClass: [NSString class]] ) + if( pType && [pType isKindOfClass: [NSString class]] ) { NSString* pT = (NSString*)pType; if( [pT isEqualToString: NSFileTypeDirectory] || -- cgit v1.2.3 From 2d1a6eee4ebde81de2d1046d26ab6dd3be61ee41 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 15 Feb 2010 14:23:37 +0100 Subject: autorecovery: export XMLSettingsExportHelper --- xmloff/inc/xmloff/SettingsExportHelper.hxx | 4 +++- xmloff/source/core/SettingsExportHelper.cxx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xmloff/inc/xmloff/SettingsExportHelper.hxx b/xmloff/inc/xmloff/SettingsExportHelper.hxx index c6ff451575..5b54f10533 100644 --- a/xmloff/inc/xmloff/SettingsExportHelper.hxx +++ b/xmloff/inc/xmloff/SettingsExportHelper.hxx @@ -31,6 +31,8 @@ #ifndef _XMLOFF_SETTINGSEXPORTHELPER_HXX #define _XMLOFF_SETTINGSEXPORTHELPER_HXX +#include "xmloff/dllapi.h" + #include #include #include @@ -49,7 +51,7 @@ namespace xmloff class XMLSettingsExportContext; } -class XMLSettingsExportHelper +class XMLOFF_DLLPUBLIC XMLSettingsExportHelper { ::xmloff::XMLSettingsExportContext& m_rContext; diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index 54b57910ba..9834b76765 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -424,7 +424,7 @@ void XMLSettingsExportHelper::exportIndexAccess( { DBG_ASSERT(rName.getLength(), "no name"); DBG_ASSERT(aIndexed->getElementType().equals(getCppuType( (uno::Sequence *)0 ) ), - "wrong NameAccess" ); + "wrong IndexAccess" ); rtl::OUString sEmpty;// ( RTLCONSTASCII_USTRINGPARAM( "View" ) ); if(aIndexed->hasElements()) { -- cgit v1.2.3 From 4df6d71f94b1e2ec365f4e947e3914ca70ce519f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 15 Feb 2010 16:05:58 +0100 Subject: autorecovery: clarified the role of a doc's URL/Location as per agreement with MAV, XModel::getURL and XStorable::getLocation both need to return the logical document URL, even when the document has been recoved from another location. So, the DocFileLocation of the ModelImpl now is for internal purpose only. Consequently, ModelImpl's API has been reworked to better differ between the logical and the "loaded-from" URL of the document. --- framework/source/services/autorecovery.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 2836e176c5..f1c1856348 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2679,7 +2679,10 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa { ::comphelper::MediaDescriptor lPatchDescriptor(rInfo.Document->getArgs()); lPatchDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= rInfo.RealFilter; - rInfo.Document->attachResource(sURL, lPatchDescriptor.getAsConstPropertyValueList()); + rInfo.Document->attachResource(rInfo.Document->getURL(), lPatchDescriptor.getAsConstPropertyValueList()); + // do *not* use sURL here. In case this points to the recovery file, it has already been passed + // to recoverFromFile. Also, passing it here is logically wrong, as attachResource is intended + // to take the logical file URL. } css::uno::Reference< css::util::XModifiable > xModify(rInfo.Document, css::uno::UNO_QUERY); -- cgit v1.2.3 From 096dc50b2cc28555d51cb86620b77d818462ec9c Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 18 Feb 2010 11:33:54 +0100 Subject: dba33e: #i108128# check if the found driver also accepts the URL --- connectivity/source/manager/mdrivermanager.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index 64526b8a23..a305d18e4b 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -720,7 +720,7 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const ::rtl::OUStri } // found something? - if ( m_aDriversBS.end() != aFind ) + if ( m_aDriversBS.end() != aFind && aFind->xDriver.is() && aFind->xDriver->acceptsURL(_rURL) ) xReturn = aFind->xDriver; } -- cgit v1.2.3 From 832e0626ce432d782769ea921698d63d010522da Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 18 Feb 2010 12:19:04 +0100 Subject: aw079: corrected include path --- svx/source/sdr/primitive2d/sdrattributecreator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 33b720f59f..a8fed91194 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -75,7 +75,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3 From 3a42d38cb443d981351c97679665799be2ddc318 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 19 Feb 2010 11:22:17 +0100 Subject: autorecovery: SwitchToViewShell_Impl: do not use the doc's suspend, but only the view's PrepareClose (preventing the 'do you want to save' question this way). Strange enough, I'm pretty sure I already did this patch in the past - but I can find a respective change set in the log ... --- sfx2/source/view/viewfrm.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 767281b026..6f195f4d86 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2205,8 +2205,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl if ( pOldSh ) { // ask wether it can be closed - Reference< XController > xController( pOldSh->GetController(), UNO_SET_THROW ); - if ( !xController->suspend( sal_True ) ) + if ( !pOldSh->PrepareClose( TRUE ) ) return sal_False; // remove sub shells from Dispatcher before switching to new ViewShell -- cgit v1.2.3 From db0c5ae969c70b41eddae9409836318f36bcea0c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 22 Feb 2010 11:25:52 +0100 Subject: autorecovery: silently survice a close call when we're already disposed - there might be legacy code not expecting the DisposedException --- sfx2/source/doc/sfxbasemodel.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index cdf8d63851..fab762d081 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1355,9 +1355,8 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo { static ::rtl::OUString MSG_1 = ::rtl::OUString::createFromAscii("Cant close while saving."); - SfxModelGuard aGuard( *this ); - - if ( m_pData->m_bClosed || m_pData->m_bClosing ) + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( impl_isDisposed() || m_pData->m_bClosed || m_pData->m_bClosing ) return; uno::Reference< uno::XInterface > xSelfHold( static_cast< ::cppu::OWeakObject* >(this) ); @@ -1706,10 +1705,7 @@ void SAL_CALL SfxBaseModel::initNew() ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // do not use the SfxModelGuard, it would throw, since we're not yet initialized - if ( IsDisposed() ) - throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *this ); + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( IsInitialized() ) throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this ); @@ -3419,10 +3415,7 @@ void SAL_CALL SfxBaseModel::loadFromStorage( const uno::Reference< XSTORAGE >& x EXCEPTION, uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // do not use the SfxModelGuard, it would throw, since we're not yet initialized - if ( IsDisposed() ) - throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *this ); + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( IsInitialized() ) throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this ); -- cgit v1.2.3 From 3504cb388dd43c12f8b4435aa2084b9dda13a7cb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 22 Feb 2010 13:04:13 +0100 Subject: autorecovery: oops, GetFormState broke with one of the recent changes - fixed --- svx/source/form/fmshell.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index d591bb3eda..facfc88701 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -1128,9 +1128,6 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich) || m_bDesignMode || !GetImpl()->getActiveForm().is() || GetImpl()->isInFilterMode() - || ( /*GetImpl()->HasPendingCursorAction(GetImpl()->getNavController()) - && */(SID_FM_RECORD_TOTAL != nWhich) - ) ) rSet.DisableItem(nWhich); else -- cgit v1.2.3 From 999af695701fe170945fd02c2c5965b925785d0c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 22 Feb 2010 13:31:57 +0100 Subject: autorecovery: removeEventListener can also be called in the initialization phase --- sfx2/source/doc/sfxbasemodel.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index fab762d081..dc494dcff4 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -824,7 +824,6 @@ void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XEVENTLISTEN throw(::com::sun::star::uno::RuntimeException) { SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); - m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XEVENTLISTENER >*)0), aListener ); } @@ -835,7 +834,7 @@ void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XEVENTLISTEN void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XEVENTLISTENER >& aListener ) throw(::com::sun::star::uno::RuntimeException) { - SfxModelGuard aGuard( *this ); + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XEVENTLISTENER >*)0), aListener ); } -- cgit v1.2.3 From 2f2e8c1dfda3fd27cf182f136132ad7f34975494 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 23 Feb 2010 10:16:39 +0100 Subject: autorecovery: it's allowed to dispose a document which has not yet been (fully) initialized - happens in some clipboard scenarios with 'artificial' documents --- sfx2/source/doc/sfxbasemodel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index dc494dcff4..09e6f4fdc8 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -764,7 +764,7 @@ void SAL_CALL SfxBaseModel::setParent(const uno::Reference< uno::XInterface >& P void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeException) { - SfxModelGuard aGuard( *this ); + SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); if ( !m_pData->m_bClosed ) { -- cgit v1.2.3 From d8038d103a6228e64d9723142ed55ba1f0d08c1f Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Thu, 25 Feb 2010 16:58:44 +0100 Subject: mtaccfixes: #i14114# XAccessibleHypertext for EditEngine --- svx/inc/svx/unoedsrc.hxx | 5 +- svx/inc/svx/unofored.hxx | 3 +- svx/inc/svx/unoforou.hxx | 2 + svx/inc/svx/unotext.hxx | 4 +- .../accessibility/AccessibleEditableTextPara.cxx | 89 ++++++++++++- .../accessibility/AccessibleEditableTextPara.hxx | 11 +- .../accessibility/AccessibleEmptyEditSource.cxx | 4 +- svx/source/accessibility/AccessibleHyperlink.cxx | 146 +++++++++++++++++++++ svx/source/accessibility/AccessibleHyperlink.hxx | 82 ++++++++++++ svx/source/accessibility/AccessibleTextHelper.cxx | 4 - svx/source/accessibility/makefile.mk | 1 + svx/source/inc/unoedprx.hxx | 9 +- svx/source/unoedit/unoedprx.cxx | 27 ++++ svx/source/unoedit/unofored.cxx | 5 + svx/source/unoedit/unoforou.cxx | 5 + svx/source/unoedit/unotext.cxx | 4 + svx/xml/AccessibleEditableTextPara.xml | 1 + 17 files changed, 388 insertions(+), 14 deletions(-) create mode 100644 svx/source/accessibility/AccessibleHyperlink.cxx create mode 100644 svx/source/accessibility/AccessibleHyperlink.hxx diff --git a/svx/inc/svx/unoedsrc.hxx b/svx/inc/svx/unoedsrc.hxx index b60ec2d586..12d0692d5e 100644 --- a/svx/inc/svx/unoedsrc.hxx +++ b/svx/inc/svx/unoedsrc.hxx @@ -155,7 +155,7 @@ class SVX_DLLPUBLIC SvxTextForwarder { public: virtual ~SvxTextForwarder(); - + virtual USHORT GetParagraphCount() const = 0; virtual USHORT GetTextLen( USHORT nParagraph ) const = 0; virtual String GetText( const ESelection& rSel ) const = 0; @@ -164,7 +164,7 @@ public: virtual void SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) = 0; virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ) = 0; virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const = 0; - + virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const = 0; virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const = 0; @@ -174,6 +174,7 @@ public: virtual void QuickInsertLineBreak( const ESelection& rSel ) = 0; virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) = 0; + virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) = 0; virtual SfxItemPool* GetPool() const = 0; diff --git a/svx/inc/svx/unofored.hxx b/svx/inc/svx/unofored.hxx index 6aa4a18fb0..b8516a5e70 100644 --- a/svx/inc/svx/unofored.hxx +++ b/svx/inc/svx/unofored.hxx @@ -54,7 +54,7 @@ public: virtual void SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const; - + virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const; virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const; @@ -66,6 +66,7 @@ public: virtual SfxItemPool* GetPool() const; virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ); + virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ); virtual BOOL IsValid() const; virtual LanguageType GetLanguage( USHORT, USHORT ) const; diff --git a/svx/inc/svx/unoforou.hxx b/svx/inc/svx/unoforou.hxx index bb56d57721..c3d86b5b58 100644 --- a/svx/inc/svx/unoforou.hxx +++ b/svx/inc/svx/unoforou.hxx @@ -85,6 +85,8 @@ public: virtual SfxItemPool* GetPool() const; virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ); + virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ); + virtual BOOL IsValid() const; Outliner& GetOutliner() const { return rOutliner; } diff --git a/svx/inc/svx/unotext.hxx b/svx/inc/svx/unotext.hxx index da5c79c2ed..b6e3a44ab3 100644 --- a/svx/inc/svx/unotext.hxx +++ b/svx/inc/svx/unotext.hxx @@ -203,7 +203,7 @@ public: virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; - + sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const; @@ -215,6 +215,8 @@ public: virtual void QuickInsertLineBreak( const ESelection& rSel ); virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ); + virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ); + virtual sal_Bool IsValid() const; virtual void SetNotifyHdl( const Link& ); diff --git a/svx/source/accessibility/AccessibleEditableTextPara.cxx b/svx/source/accessibility/AccessibleEditableTextPara.cxx index 55775b8fbb..8381d9953b 100644 --- a/svx/source/accessibility/AccessibleEditableTextPara.cxx +++ b/svx/source/accessibility/AccessibleEditableTextPara.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,7 @@ #include "unolingu.hxx" #include "unopracc.hxx" #include "AccessibleEditableTextPara.hxx" +#include "AccessibleHyperlink.hxx" #include #include "accessibility.hrc" @@ -528,7 +530,9 @@ namespace accessibility { uno::Reference< XAccessible > xPara = xParentContext->getAccessibleChild( nIndex ); if( xPara.is() ) + { return uno::Reference< XAccessibleText > ( xPara, uno::UNO_QUERY ); + } } } @@ -814,6 +818,11 @@ namespace accessibility uno::Reference< XAccessibleEditableText > aAccEditText = this; aRet <<= aAccEditText; } + else if ( rType == ::getCppuType((uno::Reference< XAccessibleHypertext > *)0) ) + { + uno::Reference< XAccessibleHypertext > aAccHyperText = this; + aRet <<= aAccHyperText; + } else { aRet = AccessibleTextParaInterfaceBase::queryInterface(rType); @@ -1437,7 +1446,7 @@ namespace accessibility ::rtl::OUString SAL_CALL AccessibleEditableTextPara::getText() throw (uno::RuntimeException) { DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); - + ::vos::OGuard aGuard( Application::GetSolarMutex() ); DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX, @@ -2065,7 +2074,85 @@ namespace accessibility return aOutSequence; } + + // XAccessibleHypertext + ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException) + { + SvxAccessibleTextAdapter& rT = GetTextForwarder(); + const sal_Int32 nPara = GetParagraphIndex(); + + USHORT nHyperLinks = 0; + USHORT nFields = rT.GetFieldCount( nPara ); + for ( USHORT n = 0; n < nFields; n++ ) + { + EFieldInfo aField = rT.GetFieldInfo( nPara, n ); + if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) + nHyperLinks++; + } + return nHyperLinks; + } + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL AccessibleEditableTextPara::getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > xRef; + + SvxAccessibleTextAdapter& rT = GetTextForwarder(); + const sal_Int32 nPara = GetParagraphIndex(); + + USHORT nHyperLink = 0; + USHORT nFields = rT.GetFieldCount( nPara ); + for ( USHORT n = 0; n < nFields; n++ ) + { + EFieldInfo aField = rT.GetFieldInfo( nPara, n ); + if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) + { + if ( nHyperLink == nLinkIndex ) + { + USHORT nEEStart = aField.aPosition.nIndex; + // Translate EE Index to accessible index + USHORT nStart = rT.CalcEditEngineIndex( nPara, nEEStart ); + USHORT nEnd = nStart + aField.aCurrentText.Len(); + xRef = new AccessibleHyperlink( rT, new SvxFieldItem( *aField.pFieldItem ), nPara, nEEStart, nStart, nEnd, aField.aCurrentText ); + break; + } + nHyperLink++; + } + } + + return xRef; + } + + ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + const sal_Int32 nPara = GetParagraphIndex(); + SvxAccessibleTextAdapter& rT = GetTextForwarder(); + +// SvxAccessibleTextIndex aIndex; +// aIndex.SetIndex(nPara, nCharIndex, rT); +// const USHORT nEEIndex = aIndex.GetEEIndex(); + + const USHORT nEEIndex = rT.CalcEditEngineIndex( nPara, nCharIndex ); + sal_Int32 nHLIndex = 0; + USHORT nHyperLink = 0; + USHORT nFields = rT.GetFieldCount( nPara ); + for ( USHORT n = 0; n < nFields; n++ ) + { + EFieldInfo aField = rT.GetFieldInfo( nPara, n ); + if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) + { + if ( aField.aPosition.nIndex == nEEIndex ) + { + nHLIndex = nHyperLink; + break; + } + nHyperLink++; + } + } + + return nHLIndex; + } + // XAccessibleMultiLineText sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { diff --git a/svx/source/accessibility/AccessibleEditableTextPara.hxx b/svx/source/accessibility/AccessibleEditableTextPara.hxx index f78cbd4ad4..2d3f35f9df 100644 --- a/svx/source/accessibility/AccessibleEditableTextPara.hxx +++ b/svx/source/accessibility/AccessibleEditableTextPara.hxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -55,12 +56,13 @@ namespace accessibility { - typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible, + typedef ::cppu::WeakComponentImplHelper9< ::com::sun::star::accessibility::XAccessible, ::com::sun::star::accessibility::XAccessibleContext, ::com::sun::star::accessibility::XAccessibleComponent, ::com::sun::star::accessibility::XAccessibleEditableText, ::com::sun::star::accessibility::XAccessibleEventBroadcaster, ::com::sun::star::accessibility::XAccessibleTextAttributes, + ::com::sun::star::accessibility::XAccessibleHypertext, ::com::sun::star::accessibility::XAccessibleMultiLineText, ::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase; @@ -163,6 +165,11 @@ namespace accessibility // XAccessibleTextAttributes virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleHypertext + virtual ::sal_Int32 SAL_CALL getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); // XAccessibleMultiLineText virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx index 0ed80a5af8..f50d42bb7a 100644 --- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx +++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx @@ -125,7 +125,7 @@ namespace accessibility USHORT GetItemState( const ESelection& /*rSel*/, USHORT /*nWhich*/ ) const { return 0; } USHORT GetItemState( USHORT /*nPara*/, USHORT /*nWhich*/ ) const { return 0; } - + SfxItemPool* GetPool() const { return NULL; } void QuickInsertText( const String& /*rText*/, const ESelection& /*rSel*/ ) {} @@ -145,6 +145,8 @@ namespace accessibility { return XubString(); } + void FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen ) {;} + BOOL IsValid() const { return sal_True; } void SetNotifyHdl( const Link& ) {} diff --git a/svx/source/accessibility/AccessibleHyperlink.cxx b/svx/source/accessibility/AccessibleHyperlink.cxx new file mode 100644 index 0000000000..041e9c78ea --- /dev/null +++ b/svx/source/accessibility/AccessibleHyperlink.cxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * 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: AccessibleEditableTextPara.cxx,v $ + * $Revision: 1.53 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svx.hxx" + +#include +#include +#include + +#include "AccessibleHyperlink.hxx" +#include "unoedprx.hxx" +#include +#include + +using namespace ::com::sun::star; + + +//------------------------------------------------------------------------ +// +// AccessibleHyperlink implementation +// +//------------------------------------------------------------------------ + +namespace accessibility +{ + + AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ) + : rTA( r ) + { + pFld = p; + nPara = nP; + nRealIdx = nR; + nStartIdx = nStt; + nEndIdx = nEnd; + aDescription = rD; + } + + AccessibleHyperlink::~AccessibleHyperlink() + { + delete pFld; + } + + // XAccessibleAction + sal_Int32 SAL_CALL AccessibleHyperlink::getAccessibleActionCount() throw (uno::RuntimeException) + { + return isValid() ? 1 : 0; + } + + sal_Bool SAL_CALL AccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + sal_Bool bRet = sal_False; + if ( isValid() && ( nIndex == 0 ) ) + { + rTA.FieldClicked( *pFld, nPara, nRealIdx ); + bRet = sal_True; + } + return bRet; + } + + ::rtl::OUString SAL_CALL AccessibleHyperlink::getAccessibleActionDescription( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + ::rtl::OUString aDesc; + + if ( isValid() && ( nIndex == 0 ) ) + aDesc = aDescription; + + return aDesc; + } + + uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL AccessibleHyperlink::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > xKeyBinding; + + if( isValid() && ( nIndex == 0 ) ) + { + ::comphelper::OAccessibleKeyBindingHelper* pKeyBindingHelper = new ::comphelper::OAccessibleKeyBindingHelper(); + xKeyBinding = pKeyBindingHelper; + + awt::KeyStroke aKeyStroke; + aKeyStroke.Modifiers = 0; + aKeyStroke.KeyCode = KEY_RETURN; + aKeyStroke.KeyChar = 0; + aKeyStroke.KeyFunc = 0; + pKeyBindingHelper->AddKeyBinding( aKeyStroke ); + } + + return xKeyBinding; + } + + // XAccessibleHyperlink + uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionAnchor( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + return uno::Any(); + } + + uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionObject( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + return uno::Any(); + } + + sal_Int32 SAL_CALL AccessibleHyperlink::getStartIndex() throw (uno::RuntimeException) + { + return nStartIdx; + } + + sal_Int32 SAL_CALL AccessibleHyperlink::getEndIndex() throw (uno::RuntimeException) + { + return nEndIdx; + } + + sal_Bool SAL_CALL AccessibleHyperlink::isValid( ) throw (uno::RuntimeException) + { + return rTA.IsValid(); + } + +} // end of namespace accessibility + +//------------------------------------------------------------------------ diff --git a/svx/source/accessibility/AccessibleHyperlink.hxx b/svx/source/accessibility/AccessibleHyperlink.hxx new file mode 100644 index 0000000000..e0d607f6f3 --- /dev/null +++ b/svx/source/accessibility/AccessibleHyperlink.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * 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: AccessibleEditableTextPara.hxx,v $ + * $Revision: 1.22 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVX_ACCESSIBLE_HYPERLINK_HXX +#define _SVX_ACCESSIBLE_HYPERLINK_HXX + +#include +#include +#include +#include + +#include +#include +#include + +#include + +class SvxFieldItem; +class SvxAccessibleTextAdapter; + +namespace accessibility +{ + + class AccessibleHyperlink : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleHyperlink > + { + private: + + SvxAccessibleTextAdapter& rTA; + SvxFieldItem* pFld; + USHORT nPara, nRealIdx; // EE values + sal_Int32 nStartIdx, nEndIdx; // translated values + ::rtl::OUString aDescription; + + public: + AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ); + ~AccessibleHyperlink(); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleHyperlink + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getStartIndex() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getEndIndex() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isValid() throw (::com::sun::star::uno::RuntimeException); + }; + +} // end of namespace accessibility + +#endif + diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 6217cf9caf..c83744e688 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -52,10 +52,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include diff --git a/svx/source/accessibility/makefile.mk b/svx/source/accessibility/makefile.mk index 8b1802bf1a..dfc25b00a3 100755 --- a/svx/source/accessibility/makefile.mk +++ b/svx/source/accessibility/makefile.mk @@ -68,6 +68,7 @@ LIB2OBJFILES= \ $(SLO)$/AccessibleTextEventQueue.obj \ $(SLO)$/AccessibleStaticTextBase.obj \ $(SLO)$/AccessibleParaManager.obj \ + $(SLO)$/AccessibleHyperlink.obj \ $(SLO)$/AccessibleEditableTextPara.obj \ $(SLO)$/AccessibleImageBullet.obj \ $(SLO)$/ShapeTypeHandler.obj \ diff --git a/svx/source/inc/unoedprx.hxx b/svx/source/inc/unoedprx.hxx index 9235e212ba..9300afe209 100644 --- a/svx/source/inc/unoedprx.hxx +++ b/svx/source/inc/unoedprx.hxx @@ -52,8 +52,11 @@ public: virtual void SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const; - - virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const; + + virtual sal_Int32 CalcLogicalIndex( USHORT nPara, USHORT nEEIndex ); + virtual USHORT CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex ); + + virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const; virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const; virtual void QuickInsertText( const String& rText, const ESelection& rSel ); @@ -64,6 +67,8 @@ public: virtual SfxItemPool* GetPool() const; virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ); + virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ); + virtual BOOL IsValid() const; virtual LanguageType GetLanguage( USHORT, USHORT ) const; diff --git a/svx/source/unoedit/unoedprx.cxx b/svx/source/unoedit/unoedprx.cxx index 2b500aeac6..987e336de5 100644 --- a/svx/source/unoedit/unoedprx.cxx +++ b/svx/source/unoedit/unoedprx.cxx @@ -692,6 +692,33 @@ XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, return mrTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } +void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +{ + DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + + mrTextForwarder->FieldClicked( rField, nPara, nPos ); +} + +sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( USHORT nPara, USHORT nEEIndex ) +{ + DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + + SvxAccessibleTextIndex aIndex; + aIndex.SetEEIndex(nPara, nEEIndex, *mrTextForwarder); + return aIndex.GetIndex(); +} + +USHORT SvxAccessibleTextAdapter::CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex ) +{ + DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + + SvxAccessibleTextIndex aIndex; + aIndex.SetIndex(nPara, nLogicalIndex, *mrTextForwarder); + return aIndex.GetEEIndex(); +} + + + BOOL SvxAccessibleTextAdapter::IsValid() const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx index 0a357002aa..12ef3468f3 100644 --- a/svx/source/unoedit/unofored.cxx +++ b/svx/source/unoedit/unofored.cxx @@ -174,6 +174,11 @@ XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, US return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } +void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +{ + rEditEngine.FieldClicked( rField, nPara, nPos ); +} + USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, USHORT nWhich ) { EECharAttribArray aAttribs; diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx index 6faf19938a..d619729734 100644 --- a/svx/source/unoedit/unoforou.cxx +++ b/svx/source/unoedit/unoforou.cxx @@ -245,6 +245,11 @@ XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, USHO return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } +void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +{ + rOutliner.FieldClicked( rField, nPara, nPos ); +} + BOOL SvxOutlinerForwarder::IsValid() const { // cannot reliably query outliner state diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx index c70b63a1e6..b6518e1437 100644 --- a/svx/source/unoedit/unotext.cxx +++ b/svx/source/unoedit/unotext.cxx @@ -2573,6 +2573,10 @@ XubString SvxDummyTextSource::CalcFieldValue( const SvxFieldItem&, sal_uInt16, s return XubString(); } +void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen ) +{ +} + sal_Bool SvxDummyTextSource::IsValid() const { return sal_False; diff --git a/svx/xml/AccessibleEditableTextPara.xml b/svx/xml/AccessibleEditableTextPara.xml index 1859980760..affb15f4dd 100644 --- a/svx/xml/AccessibleEditableTextPara.xml +++ b/svx/xml/AccessibleEditableTextPara.xml @@ -28,6 +28,7 @@ title="Link to a general description of UNO accessibility"/> com.sun.star.accessibility.XAccessibleEventBroadcaster com.sun.star.accessibility.XAccessibleComponent com.sun.star.accessibility.XAccessibleEditableText +com.sun.star.accessibility.XAccessibleHyperext com.sun.star.accessibility.XAccessibleTextAttributes com.sun.star.lang.XTypeProvider com.sun.star.lang.XServiceInfo -- cgit v1.2.3 From 64e119ad679d53a3de382c7fbc7cd0c429017979 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Mon, 1 Mar 2010 14:29:36 +0100 Subject: ause115: #i109704# fix build breakage --- xmlhelp/source/com/sun/star/help/makefile.mk | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk index eab2a6a08a..73e3f38c88 100644 --- a/xmlhelp/source/com/sun/star/help/makefile.mk +++ b/xmlhelp/source/com/sun/star/help/makefile.mk @@ -32,42 +32,18 @@ PRJ = ..$/..$/..$/..$/.. PRJNAME = xmlhelp TARGET = HelpLinker -LIBBASENAME = helplinker PACKAGE = com$/sun$/star$/help -TARGETTYPE=CUI .IF "$(SOLAR_JAVA)"!="" # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk -.INCLUDE : helplinker.pmk -.IF "$(SYSTEM_LIBXSLT)" == "YES" -CFLAGS+= $(LIBXSLT_CFLAGS) -.ELSE -LIBXSLTINCDIR=external$/libxslt -CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR) -.ENDIF - -.IF "$(SYSTEM_DB)" == "YES" -CFLAGS+=-DSYSTEM_DB -I$(DB_INCLUDES) -.ENDIF - -.IF "$(SYSTEM_EXPAT)" == "YES" -CFLAGS+=-DSYSTEM_EXPAT -.ENDIF - - JAVACLASSFILES = \ $(CLASSDIR)$/$(PACKAGE)$/HelpSearch.class \ $(CLASSDIR)$/$(PACKAGE)$/HelpComponent.class \ $(CLASSDIR)$/$(PACKAGE)$/HelpIndexer.class -JAVAFILES = \ - HelpSearch.java \ - HelpComponent.java \ - HelpIndexer.java - TRANSEX3FILES = \ $(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpIndexerTool.class \ $(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpFileDocument.class @@ -91,14 +67,12 @@ CUSTOMMANIFESTFILE = MANIFEST.MF .INCLUDE : target.mk -ALLTAR : $(ADDFILES) - .IF "$(JARTARGETN)"!="" $(JAVATARGET) : $(ADDFILES) $(JARTARGETN) : $(ADDFILES) .ENDIF -$(CLASSDIR)$/$(PACKAGE)$/%.class : $(SOLARBINDIR)$/help$/$(PACKAGE)$/%.class +$(ADDFILES) : $(SOLARBINDIR)$/help$/$(PACKAGE)$/$$(@:f) $(MKDIRHIER) $(@:d) $(COPY) $< $@ -- cgit v1.2.3 From cfd74e3d4f90f07ab527b3818435ddba33bc05c5 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Mon, 1 Mar 2010 14:40:40 +0100 Subject: mtaccfixes: #i50760 Handle CSS for high contrast --- xmlhelp/source/cxxhelp/provider/databases.cxx | 45 +++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 3f0087b5eb..cab9f4db62 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -60,6 +60,12 @@ #include #include +#include +#include +#include +#include +#include + #include #include @@ -1293,20 +1299,48 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language, int retry = 2; bool error = true; rtl::OUString fileURL; + + sal_Bool bHighContrastMode = sal_False; + rtl::OUString aCSS( m_aCSS ); + if ( aCSS.compareToAscii( "default" ) == 0 ) + { + // #i50760: "default" needs to adapt HC mode + uno::Reference< awt::XToolkit > xToolkit = uno::Reference< awt::XToolkit >( + ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ), uno::UNO_QUERY ); + if ( xToolkit.is() ) + { + uno::Reference< awt::XExtendedToolkit > xExtToolkit( xToolkit, uno::UNO_QUERY ); + if ( xExtToolkit.is() ) + { + uno::Reference< awt::XTopWindow > xTopWindow = xExtToolkit->getActiveTopWindow(); + if ( xTopWindow.is() ) + { + uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY ); + if ( xVclWindowPeer.is() ) + { + uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString::createFromAscii( "HighContrastMode" ) ); + if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode ) + aCSS = rtl::OUString::createFromAscii( "highcontrastblack" ); + } + } + } + } + } while( error && retry ) { + if( retry == 2 ) fileURL = getInstallPathAsURL() + processLang( Language ) + rtl::OUString::createFromAscii( "/" ) + - m_aCSS + + aCSS + rtl::OUString::createFromAscii( ".css" ); else if( retry == 1 ) fileURL = getInstallPathAsURL() + - m_aCSS + + aCSS + rtl::OUString::createFromAscii( ".css" ); osl::DirectoryItem aDirItem; @@ -1327,6 +1361,13 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language, } --retry; + if ( !retry && error && bHighContrastMode ) + { + // fall back to default css + aCSS = rtl::OUString::createFromAscii( "default" ); + retry = 2; + bHighContrastMode = sal_False; + } } if( error ) -- cgit v1.2.3 From 3d391460c1c9165e9bf1d9602506dfbdf16bc89b Mon Sep 17 00:00:00 2001 From: "Malte Timmermann [mt]" Date: Wed, 3 Mar 2010 21:15:58 +0100 Subject: fixed some rebase issues --- editeng/source/accessibility/AccessibleEditableTextPara.cxx | 2 +- editeng/source/accessibility/AccessibleHyperlink.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 27ddb74a3c..56df6392c2 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -76,7 +76,7 @@ #include #include #include "editeng/AccessibleEditableTextPara.hxx" -#include "editeng/AccessibleHyperlink.hxx" +#include "AccessibleHyperlink.hxx" #include diff --git a/editeng/source/accessibility/AccessibleHyperlink.cxx b/editeng/source/accessibility/AccessibleHyperlink.cxx index 041e9c78ea..2a1e281dee 100644 --- a/editeng/source/accessibility/AccessibleHyperlink.cxx +++ b/editeng/source/accessibility/AccessibleHyperlink.cxx @@ -29,14 +29,14 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" +#include "precompiled_editeng.hxx" #include #include #include #include "AccessibleHyperlink.hxx" -#include "unoedprx.hxx" +#include "editeng/unoedprx.hxx" #include #include -- cgit v1.2.3 From de804c3eaeb7930c787e2604909ae81ba8190cd9 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 11 Mar 2010 13:09:35 +0100 Subject: mtaccfixes: adjustments due to merge with DEV300_m73 --- editeng/source/accessibility/AccessibleEditableTextPara.cxx | 2 +- editeng/source/accessibility/AccessibleHyperlink.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 56df6392c2..89917d77a8 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/editeng/source/accessibility/AccessibleHyperlink.cxx b/editeng/source/accessibility/AccessibleHyperlink.cxx index 2a1e281dee..8fa1c93ad4 100644 --- a/editeng/source/accessibility/AccessibleHyperlink.cxx +++ b/editeng/source/accessibility/AccessibleHyperlink.cxx @@ -37,7 +37,7 @@ #include "AccessibleHyperlink.hxx" #include "editeng/unoedprx.hxx" -#include +#include #include using namespace ::com::sun::star; -- cgit v1.2.3 From 5ebd96bda689316f5034cf8f89280f3e8f011a74 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 11 Mar 2010 15:53:40 +0100 Subject: autorecovery: include with \\\, not with < > , to fetch the files from the module, not from solver --- svx/source/items/svxitems.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src index a2fd85293c..d70e69ea99 100644 --- a/svx/source/items/svxitems.src +++ b/svx/source/items/svxitems.src @@ -26,8 +26,8 @@ ************************************************************************/ // include ------------------------------------------------------------------ -#include -#include +#include "svx/svxitems.hrc" +#include "svx/svxids.hrc" #include StringArray RID_ATTR_NAMES -- cgit v1.2.3 From 3d284ccb004103a3defe1b8eeec8126d0484a57e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 15 Mar 2010 09:47:00 +0100 Subject: autorecovery: post-rebase: SetTransferPriority removed (had been removed from SvxLinkManager in CWS, and moved to sfx2's LinkManager in MWS) --- sfx2/inc/sfx2/linkmgr.hxx | 2 -- sfx2/source/appl/linkmgr2.cxx | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx index f17ed58a0c..6ff4e267d9 100644 --- a/sfx2/inc/sfx2/linkmgr.hxx +++ b/sfx2/inc/sfx2/linkmgr.hxx @@ -131,8 +131,6 @@ public: // (ist zur Zeit nur fuer die FileLinks interressant!) void CancelTransfers(); - static void SetTransferPriority( sfx2::SvBaseLink& rLink, USHORT nPrio ); - // um Status Informationen aus dem FileObject an den BaseLink zu // senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat // dann die entsprechenden Informationen als String. diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 4511e428e5..76536378ad 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -430,16 +430,6 @@ void LinkManager::CancelTransfers() pFileObj->CancelTransfers(); } -void LinkManager::SetTransferPriority( sfx2::SvBaseLink& /*rLink*/, USHORT /*nPrio*/ ) -{ -// SvFileObject* pFileObj = -// (SvFileObject*)SvFileObject::ClassFactory()-> -// CastAndAddRef( rLink.GetObj() ); -// OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & rLink.GetObjType()) ? -// (SvFileObject*)rLink.GetObj() : 0; -} - - // um Status Informationen aus dem FileObject an den BaseLink zu // senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat // dann die entsprechenden Informationen als String. -- cgit v1.2.3 From 54b25fbbbe7a349cf27ba16ffe87660a2e3dda42 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 17 Mar 2010 12:34:44 +0100 Subject: dba33e: #i102366# parse [ as names as well --- connectivity/source/parse/sqlflex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index e365fdec1e..46d1c7e814 100644 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -400,7 +400,7 @@ VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_S \" { return gatherString('\"',0); } ` { return gatherString('`' ,0); } -"[" { return gatherString(']' ,0);} +"[" { return gatherString(']' ,0);} \' { return gatherString('\'',1); } -- cgit v1.2.3 From 7803089603345f402251c9eae05b33513884dd1f Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Fri, 5 Mar 2010 10:05:32 +0100 Subject: native287 #i109807# no more soffice.exe into msi database --- sysui/prj/d.lst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysui/prj/d.lst b/sysui/prj/d.lst index 126376930c..89ce910295 100644 --- a/sysui/prj/d.lst +++ b/sysui/prj/d.lst @@ -20,6 +20,9 @@ mkdir: %_DEST%\bin%_EXT%\desktop-integration\pkg ..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe ..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe +..\%__SRC%\misc\ooo3_main_app.ico %_DEST%\bin%_EXT%\soffice.ico +..\%__SRC%\misc\so9_main_app.ico %_DEST%\bin%_EXT%\so\soffice.ico + ..\%__SRC%\misc\desktopshare\*.desktop %_DEST%\pck%_EXT%\*.desktop ..\%__SRC%\misc\PkgInfo %_DEST%\pck%_EXT%\PkgInfo ..\%__SRC%\misc\Info.plist %_DEST%\pck%_EXT%\Info.plist -- cgit v1.2.3 From 31b5a96d1c247e85fde465fef7a71192c9a20b32 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Fri, 5 Mar 2010 10:20:54 +0100 Subject: native287 #i109807# no more soffice.exe into msi database --- sysui/prj/d.lst | 1 - 1 file changed, 1 deletion(-) diff --git a/sysui/prj/d.lst b/sysui/prj/d.lst index 89ce910295..c6019cea9a 100644 --- a/sysui/prj/d.lst +++ b/sysui/prj/d.lst @@ -21,7 +21,6 @@ mkdir: %_DEST%\bin%_EXT%\desktop-integration\pkg ..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe ..\%__SRC%\misc\ooo3_main_app.ico %_DEST%\bin%_EXT%\soffice.ico -..\%__SRC%\misc\so9_main_app.ico %_DEST%\bin%_EXT%\so\soffice.ico ..\%__SRC%\misc\desktopshare\*.desktop %_DEST%\pck%_EXT%\*.desktop ..\%__SRC%\misc\PkgInfo %_DEST%\pck%_EXT%\PkgInfo -- cgit v1.2.3 From a1420358b8b709a91c0fd1357da7361b4592ae43 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 15 Feb 2010 16:14:08 +0100 Subject: #i108916# added STRG-ALT-N shortcut to new comments in impress/draw --- .../registry/data/org/openoffice/Office/Accelerators.xcu | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) mode change 100644 => 100755 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu old mode 100644 new mode 100755 index 18b0658cc0..5067e500af --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -1869,6 +1869,12 @@ + + + I10N SHORTCUTS - NO TRANSLATE + .uno:InsertAnnotation + + I10N SHORTCUTS - NO TRANSLATE @@ -5499,7 +5505,13 @@ - + + + I10N SHORTCUTS - NO TRANSLATE + .uno:InsertAnnotation + + + I10N SHORTCUTS - NO TRANSLATE .uno:Undo -- cgit v1.2.3 From 0e093ab23caf6e3febd98f6cd3d8184be8c71886 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Wed, 24 Mar 2010 15:39:09 +0100 Subject: #i108976# applied patch fix a crash when default style is deleted - transplanted from 263352@impresscomments1 --- svx/source/svdraw/svdpntv.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 9e8641d88a..6b58e623e4 100755 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -294,6 +294,9 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut) SdrPaintView::~SdrPaintView() { DBG_DTOR(SdrPaintView,NULL); + if (pDefaultStyleSheet) + EndListening(*pDefaultStyleSheet); + maColorConfig.RemoveListener(this); ClearPageView(); @@ -317,8 +320,16 @@ SdrPaintView::~SdrPaintView() //////////////////////////////////////////////////////////////////////////////////////////////////// -void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) +void __EXPORT SdrPaintView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { + //If the stylesheet has been destroyed + if (&rBC == pDefaultStyleSheet) + { + if (rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING) + pDefaultStyleSheet = NULL; + return; + } + BOOL bObjChg=!bSomeObjChgdFlag; // TRUE= auswerten fuer ComeBack-Timer if (bObjChg) { SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint); @@ -1238,7 +1249,12 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, BOOL bReplaceAll) void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, BOOL bDontRemoveHardAttr) { + if (pDefaultStyleSheet) + EndListening(*pDefaultStyleSheet); pDefaultStyleSheet=pStyleSheet; + if (pDefaultStyleSheet) + StartListening(*pDefaultStyleSheet); + if (pStyleSheet!=NULL && !bDontRemoveHardAttr) { SfxWhichIter aIter(pStyleSheet->GetItemSet()); USHORT nWhich=aIter.FirstWhich(); -- cgit v1.2.3 From 3fb17b29e58688f9c036cca856ce66197c5cd68e Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 25 Mar 2010 14:14:26 +0100 Subject: CWS-TOOLING: integrate CWS ooo321gsl04_DEV300 --- scripting/source/pyprov/pythonscript.py | 51 ++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py index 6a57fa7928..88e0a9efbc 100644 --- a/scripting/source/pyprov/pythonscript.py +++ b/scripting/source/pyprov/pythonscript.py @@ -5,6 +5,7 @@ import sys import os import imp import time +import compiler class LogLevel: NONE = 0 @@ -340,6 +341,32 @@ class ProviderContext: ret = url[0:pos]+ package.transientPathElement + "/" + url[pos:len(url)] log.isDebugLevel() and log.debug( "getStorageUrlFromPersistentUrl " + url + " -> "+ ret) return ret + + def getFuncsByUrl( self, url ): + src = readTextFromStream( self.sfa.openFileRead( url ) ) + checkForPythonPathBesideScript( url[0:url.rfind('/')] ) + src = ensureSourceState( src ) + + code = compiler.parse( src ) + + allFuncs = [] + + if code == None: + return allFuncs + + g_exportedScripts = [] + for node in code.node.nodes: + if node.__class__.__name__ == 'Function': + allFuncs.append(node.name) + elif node.__class__.__name__ == 'Assign': + for assignee in node.nodes: + if assignee.name == 'g_exportedScripts': + for item in node.expr: + if item.__class__.__name__ == 'Name': + g_exportedScripts.append(item.name) + return g_exportedScripts + + return allFuncs def getModuleByUrl( self, url ): entry = self.modules.get(url) @@ -382,11 +409,10 @@ def isScript( candidate ): #------------------------------------------------------- class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation, XActionListener ): - def __init__( self, provCtx, uri, fileName, funcName, func ): + def __init__( self, provCtx, uri, fileName, funcName ): self.fileName = fileName self.funcName = funcName self.provCtx = provCtx - self.func = func self.uri = uri def getName( self ): @@ -407,8 +433,6 @@ class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation, if name == "URI": ret = self.provCtx.uriHelper.getScriptURI( self.provCtx.getPersistentUrlFromStorageUrl( self.uri + "$" + self.funcName ) ) - elif name == "Description": - ret = getattr( self.func, "__doc__", None ) elif name == "Editable" and ENABLE_EDIT_DIALOG: ret = not self.provCtx.sfa.isReadOnly( self.uri ) @@ -506,7 +530,7 @@ class FileBrowseNode( unohelper.Base, XBrowseNode ): self.provCtx = provCtx self.uri = uri self.name = name - self.module = None + self.funcnames = None def getName( self ): return self.name @@ -514,21 +538,14 @@ class FileBrowseNode( unohelper.Base, XBrowseNode ): def getChildNodes(self): ret = () try: - self.module = self.provCtx.getModuleByUrl( self.uri ) - values = self.module.__dict__.get( CALLABLE_CONTAINER_NAME , None ) + self.funcnames = self.provCtx.getFuncsByUrl( self.uri ) - # no g_exportedScripts, export every function - if not isinstance(values, type(())): - values = self.module.__dict__.values() - scriptNodeList = [] - for i in values: - if isScript( i ): - scriptNodeList.append( - ScriptBrowseNode( - self.provCtx, self.uri, self.name, i.__name__, i )) + for i in self.funcnames: + scriptNodeList.append( + ScriptBrowseNode( + self.provCtx, self.uri, self.name, i )) ret = tuple( scriptNodeList ) - # must compile ! log.isDebugLevel() and log.debug( "returning " +str(len(ret)) + " ScriptChildNodes on " + self.uri ) except Exception, e: text = lastException2String() -- cgit v1.2.3 From a43b5febd6f36c3193bf48784bf2a33a7fdb665f Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 8 Jan 2010 15:15:59 +0000 Subject: #i108159# new ODF- and nonODF-Icons --- sysui/desktop/icons/database.icns | Bin 0 -> 48416 bytes sysui/desktop/icons/database.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/drawing-template.icns | Bin 10935 -> 48006 bytes sysui/desktop/icons/drawing-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/drawing.icns | Bin 11290 -> 46878 bytes sysui/desktop/icons/drawing.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/formula.icns | Bin 10380 -> 41940 bytes sysui/desktop/icons/formula.ico | Bin 0 -> 295606 bytes .../icons/hicolor/128x128/mimetypes/database.png | Bin 0 -> 5874 bytes .../hicolor/128x128/mimetypes/drawing-template.png | Bin 0 -> 6217 bytes .../icons/hicolor/128x128/mimetypes/drawing.png | Bin 0 -> 6387 bytes .../icons/hicolor/128x128/mimetypes/formula.png | Bin 0 -> 4353 bytes .../hicolor/128x128/mimetypes/master-document.png | Bin 0 -> 2662 bytes .../hicolor/128x128/mimetypes/oasis-database.png | Bin 15854 -> 6845 bytes .../128x128/mimetypes/oasis-drawing-template.png | Bin 16120 -> 7206 bytes .../hicolor/128x128/mimetypes/oasis-drawing.png | Bin 16063 -> 7373 bytes .../hicolor/128x128/mimetypes/oasis-formula.png | Bin 12936 -> 5370 bytes .../128x128/mimetypes/oasis-master-document.png | Bin 11992 -> 3703 bytes .../mimetypes/oasis-presentation-template.png | Bin 13955 -> 6193 bytes .../128x128/mimetypes/oasis-presentation.png | Bin 13654 -> 5434 bytes .../mimetypes/oasis-spreadsheet-template.png | Bin 12792 -> 5753 bytes .../hicolor/128x128/mimetypes/oasis-spreadsheet.png | Bin 12338 -> 4617 bytes .../128x128/mimetypes/oasis-text-template.png | Bin 12100 -> 6763 bytes .../icons/hicolor/128x128/mimetypes/oasis-text.png | Bin 11770 -> 6847 bytes .../128x128/mimetypes/oasis-web-template.png | Bin 17754 -> 3493 bytes .../128x128/mimetypes/presentation-template.png | Bin 0 -> 5212 bytes .../hicolor/128x128/mimetypes/presentation.png | Bin 0 -> 4459 bytes .../128x128/mimetypes/spreadsheet-template.png | Bin 0 -> 4764 bytes .../icons/hicolor/128x128/mimetypes/spreadsheet.png | Bin 0 -> 3598 bytes .../hicolor/128x128/mimetypes/text-template.png | Bin 0 -> 5772 bytes .../icons/hicolor/128x128/mimetypes/text.png | Bin 0 -> 5817 bytes .../icons/hicolor/16x16/mimetypes/database.png | Bin 291 -> 555 bytes .../hicolor/16x16/mimetypes/drawing-template.png | Bin 348 -> 522 bytes .../icons/hicolor/16x16/mimetypes/drawing.png | Bin 354 -> 555 bytes .../icons/hicolor/16x16/mimetypes/formula.png | Bin 252 -> 562 bytes .../hicolor/16x16/mimetypes/master-document.png | Bin 310 -> 450 bytes .../hicolor/16x16/mimetypes/oasis-database.png | Bin 1009 -> 574 bytes .../16x16/mimetypes/oasis-drawing-template.png | Bin 1094 -> 554 bytes .../icons/hicolor/16x16/mimetypes/oasis-drawing.png | Bin 1082 -> 572 bytes .../icons/hicolor/16x16/mimetypes/oasis-formula.png | Bin 1014 -> 580 bytes .../16x16/mimetypes/oasis-master-document.png | Bin 929 -> 472 bytes .../16x16/mimetypes/oasis-presentation-template.png | Bin 1025 -> 532 bytes .../hicolor/16x16/mimetypes/oasis-presentation.png | Bin 960 -> 441 bytes .../16x16/mimetypes/oasis-spreadsheet-template.png | Bin 1018 -> 538 bytes .../hicolor/16x16/mimetypes/oasis-spreadsheet.png | Bin 961 -> 436 bytes .../hicolor/16x16/mimetypes/oasis-text-template.png | Bin 986 -> 444 bytes .../icons/hicolor/16x16/mimetypes/oasis-text.png | Bin 923 -> 420 bytes .../hicolor/16x16/mimetypes/oasis-web-template.png | Bin 1023 -> 436 bytes .../16x16/mimetypes/presentation-template.png | Bin 303 -> 515 bytes .../icons/hicolor/16x16/mimetypes/presentation.png | Bin 302 -> 425 bytes .../16x16/mimetypes/spreadsheet-template.png | Bin 287 -> 513 bytes .../icons/hicolor/16x16/mimetypes/spreadsheet.png | Bin 271 -> 412 bytes .../icons/hicolor/16x16/mimetypes/text-template.png | Bin 240 -> 413 bytes .../desktop/icons/hicolor/16x16/mimetypes/text.png | Bin 245 -> 392 bytes .../icons/hicolor/32x32/mimetypes/database.png | Bin 529 -> 1319 bytes .../hicolor/32x32/mimetypes/drawing-template.png | Bin 1344 -> 1307 bytes .../icons/hicolor/32x32/mimetypes/drawing.png | Bin 1483 -> 1363 bytes .../icons/hicolor/32x32/mimetypes/formula.png | Bin 1349 -> 1172 bytes .../hicolor/32x32/mimetypes/master-document.png | Bin 1559 -> 909 bytes .../hicolor/32x32/mimetypes/oasis-database.png | Bin 2922 -> 1497 bytes .../32x32/mimetypes/oasis-drawing-template.png | Bin 2957 -> 1506 bytes .../icons/hicolor/32x32/mimetypes/oasis-drawing.png | Bin 2828 -> 1548 bytes .../icons/hicolor/32x32/mimetypes/oasis-formula.png | Bin 2622 -> 1346 bytes .../32x32/mimetypes/oasis-master-document.png | Bin 2338 -> 1110 bytes .../32x32/mimetypes/oasis-presentation-template.png | Bin 2812 -> 1370 bytes .../hicolor/32x32/mimetypes/oasis-presentation.png | Bin 2623 -> 1180 bytes .../32x32/mimetypes/oasis-spreadsheet-template.png | Bin 2856 -> 1130 bytes .../hicolor/32x32/mimetypes/oasis-spreadsheet.png | Bin 2618 -> 917 bytes .../hicolor/32x32/mimetypes/oasis-text-template.png | Bin 2575 -> 1153 bytes .../icons/hicolor/32x32/mimetypes/oasis-text.png | Bin 2311 -> 1106 bytes .../hicolor/32x32/mimetypes/oasis-web-template.png | Bin 2908 -> 966 bytes .../32x32/mimetypes/presentation-template.png | Bin 1403 -> 1166 bytes .../icons/hicolor/32x32/mimetypes/presentation.png | Bin 1515 -> 982 bytes .../32x32/mimetypes/spreadsheet-template.png | Bin 1211 -> 919 bytes .../icons/hicolor/32x32/mimetypes/spreadsheet.png | Bin 1301 -> 692 bytes .../icons/hicolor/32x32/mimetypes/text-template.png | Bin 1211 -> 941 bytes .../desktop/icons/hicolor/32x32/mimetypes/text.png | Bin 1406 -> 903 bytes .../icons/hicolor/48x48/mimetypes/database.png | Bin 652 -> 1862 bytes .../hicolor/48x48/mimetypes/drawing-template.png | Bin 1819 -> 1923 bytes .../icons/hicolor/48x48/mimetypes/drawing.png | Bin 1913 -> 1962 bytes .../icons/hicolor/48x48/mimetypes/formula.png | Bin 1803 -> 1589 bytes .../hicolor/48x48/mimetypes/master-document.png | Bin 2003 -> 1160 bytes .../hicolor/48x48/mimetypes/oasis-database.png | Bin 5032 -> 2430 bytes .../48x48/mimetypes/oasis-drawing-template.png | Bin 4919 -> 2482 bytes .../icons/hicolor/48x48/mimetypes/oasis-drawing.png | Bin 4935 -> 2518 bytes .../icons/hicolor/48x48/mimetypes/oasis-formula.png | Bin 4422 -> 2171 bytes .../48x48/mimetypes/oasis-master-document.png | Bin 3808 -> 1741 bytes .../48x48/mimetypes/oasis-presentation-template.png | Bin 4650 -> 2376 bytes .../hicolor/48x48/mimetypes/oasis-presentation.png | Bin 4611 -> 2125 bytes .../48x48/mimetypes/oasis-spreadsheet-template.png | Bin 4409 -> 2400 bytes .../hicolor/48x48/mimetypes/oasis-spreadsheet.png | Bin 4211 -> 2079 bytes .../hicolor/48x48/mimetypes/oasis-text-template.png | Bin 4023 -> 2125 bytes .../icons/hicolor/48x48/mimetypes/oasis-text.png | Bin 3785 -> 2094 bytes .../hicolor/48x48/mimetypes/oasis-web-template.png | Bin 4854 -> 1537 bytes .../48x48/mimetypes/presentation-template.png | Bin 2044 -> 1792 bytes .../icons/hicolor/48x48/mimetypes/presentation.png | Bin 2043 -> 1551 bytes .../48x48/mimetypes/spreadsheet-template.png | Bin 1599 -> 1829 bytes .../icons/hicolor/48x48/mimetypes/spreadsheet.png | Bin 1684 -> 1476 bytes .../icons/hicolor/48x48/mimetypes/text-template.png | Bin 1687 -> 1552 bytes .../desktop/icons/hicolor/48x48/mimetypes/text.png | Bin 1764 -> 1525 bytes sysui/desktop/icons/master-document.icns | Bin 11003 -> 41443 bytes sysui/desktop/icons/master-document.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-database.icns | Bin 53983 -> 51503 bytes sysui/desktop/icons/oasis-database.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-drawing-template.icns | Bin 53400 -> 51093 bytes sysui/desktop/icons/oasis-drawing-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-drawing.icns | Bin 52603 -> 49965 bytes sysui/desktop/icons/oasis-drawing.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-formula.icns | Bin 50335 -> 45027 bytes sysui/desktop/icons/oasis-formula.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-master-document.icns | Bin 48904 -> 44531 bytes sysui/desktop/icons/oasis-master-document.ico | Bin 0 -> 295606 bytes .../desktop/icons/oasis-presentation-template.icns | Bin 51890 -> 47163 bytes sysui/desktop/icons/oasis-presentation-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-presentation.icns | Bin 51073 -> 43638 bytes sysui/desktop/icons/oasis-presentation.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-spreadsheet-template.icns | Bin 51919 -> 52924 bytes sysui/desktop/icons/oasis-spreadsheet-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-spreadsheet.icns | Bin 50953 -> 51578 bytes sysui/desktop/icons/oasis-spreadsheet.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-text-template.icns | Bin 49196 -> 49722 bytes sysui/desktop/icons/oasis-text-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-text.icns | Bin 47545 -> 48791 bytes sysui/desktop/icons/oasis-text.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/oasis-web-template.icns | Bin 55853 -> 42146 bytes sysui/desktop/icons/oasis-web-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/presentation-template.icns | Bin 10690 -> 44076 bytes sysui/desktop/icons/presentation-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/presentation.icns | Bin 10947 -> 40551 bytes sysui/desktop/icons/presentation.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/spreadsheet-template.icns | Bin 10085 -> 49837 bytes sysui/desktop/icons/spreadsheet-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/spreadsheet.icns | Bin 10457 -> 48491 bytes sysui/desktop/icons/spreadsheet.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/text-template.icns | Bin 10095 -> 46635 bytes sysui/desktop/icons/text-template.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/text.icns | Bin 10401 -> 45704 bytes sysui/desktop/icons/text.ico | Bin 0 -> 295606 bytes 138 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 sysui/desktop/icons/database.icns create mode 100644 sysui/desktop/icons/database.ico create mode 100644 sysui/desktop/icons/drawing-template.ico create mode 100644 sysui/desktop/icons/drawing.ico create mode 100644 sysui/desktop/icons/formula.ico create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/database.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/formula.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.png create mode 100644 sysui/desktop/icons/hicolor/128x128/mimetypes/text.png create mode 100644 sysui/desktop/icons/master-document.ico create mode 100644 sysui/desktop/icons/oasis-database.ico create mode 100644 sysui/desktop/icons/oasis-drawing-template.ico create mode 100644 sysui/desktop/icons/oasis-drawing.ico create mode 100644 sysui/desktop/icons/oasis-formula.ico create mode 100644 sysui/desktop/icons/oasis-master-document.ico create mode 100644 sysui/desktop/icons/oasis-presentation-template.ico create mode 100644 sysui/desktop/icons/oasis-presentation.ico create mode 100644 sysui/desktop/icons/oasis-spreadsheet-template.ico create mode 100644 sysui/desktop/icons/oasis-spreadsheet.ico create mode 100644 sysui/desktop/icons/oasis-text-template.ico create mode 100644 sysui/desktop/icons/oasis-text.ico create mode 100644 sysui/desktop/icons/oasis-web-template.ico create mode 100644 sysui/desktop/icons/presentation-template.ico create mode 100644 sysui/desktop/icons/presentation.ico create mode 100644 sysui/desktop/icons/spreadsheet-template.ico create mode 100644 sysui/desktop/icons/spreadsheet.ico create mode 100644 sysui/desktop/icons/text-template.ico create mode 100644 sysui/desktop/icons/text.ico diff --git a/sysui/desktop/icons/database.icns b/sysui/desktop/icons/database.icns new file mode 100644 index 0000000000..115dc859cd Binary files /dev/null and b/sysui/desktop/icons/database.icns differ diff --git a/sysui/desktop/icons/database.ico b/sysui/desktop/icons/database.ico new file mode 100644 index 0000000000..171d39bb96 Binary files /dev/null and b/sysui/desktop/icons/database.ico differ diff --git a/sysui/desktop/icons/drawing-template.icns b/sysui/desktop/icons/drawing-template.icns index 359164f314..407484582f 100644 Binary files a/sysui/desktop/icons/drawing-template.icns and b/sysui/desktop/icons/drawing-template.icns differ diff --git a/sysui/desktop/icons/drawing-template.ico b/sysui/desktop/icons/drawing-template.ico new file mode 100644 index 0000000000..5b5a74e99f Binary files /dev/null and b/sysui/desktop/icons/drawing-template.ico differ diff --git a/sysui/desktop/icons/drawing.icns b/sysui/desktop/icons/drawing.icns index 81777c7f92..5322625b05 100644 Binary files a/sysui/desktop/icons/drawing.icns and b/sysui/desktop/icons/drawing.icns differ diff --git a/sysui/desktop/icons/drawing.ico b/sysui/desktop/icons/drawing.ico new file mode 100644 index 0000000000..1065490a28 Binary files /dev/null and b/sysui/desktop/icons/drawing.ico differ diff --git a/sysui/desktop/icons/formula.icns b/sysui/desktop/icons/formula.icns index 61cd00a0e0..4620688c79 100644 Binary files a/sysui/desktop/icons/formula.icns and b/sysui/desktop/icons/formula.icns differ diff --git a/sysui/desktop/icons/formula.ico b/sysui/desktop/icons/formula.ico new file mode 100644 index 0000000000..e06aef1877 Binary files /dev/null and b/sysui/desktop/icons/formula.ico differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/database.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/database.png new file mode 100644 index 0000000000..93b8e60cb2 Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/database.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.png new file mode 100644 index 0000000000..15b80e0393 Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.png new file mode 100644 index 0000000000..9d47f747df Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/formula.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/formula.png new file mode 100644 index 0000000000..184dd0ca6c Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/formula.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.png new file mode 100644 index 0000000000..acf19ff835 Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png index 1429d82ce8..f95bbf137a 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png index 4fdde3c34c..630a51ebb4 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png index 7272482a04..82ac8d15bf 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png index 9e4c72eab7..c838eaa128 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png index 6f191e2cf0..640e2d9861 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png index bf8229c1f5..c4954802e8 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png index 2b3a5bb900..1d5acededb 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png index 18c00ad4bb..01781db415 100644 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png index ca480522d8..bc46714afa 100644 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png index ef5b5dd7a5..569bd514fc 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png index 178d4e26d9..b45244ac1a 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png index 7edd66d369..8e6c4580e9 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png and b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.png new file mode 100644 index 0000000000..c8a3813188 Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.png new file mode 100644 index 0000000000..2a0552eb62 Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.png new file mode 100644 index 0000000000..cc7aa51bcb Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.png new file mode 100644 index 0000000000..c701fd7b5d Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.png new file mode 100644 index 0000000000..652c1ce480 Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/text.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/text.png new file mode 100644 index 0000000000..f881aca218 Binary files /dev/null and b/sysui/desktop/icons/hicolor/128x128/mimetypes/text.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png index bbf485561e..fb32e00a1b 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png index 74770d5d48..f045190f39 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png index 30303797ba..3bd7b7d29c 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png index 3eb7f884f9..e7e95875ef 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png index c424e4fbf4..e442a0c098 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png index 2f2d56dd0d..e4ae28570f 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png index 94f4ac9ec5..eaad54fcdf 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png index d65439afbc..3d66cc97eb 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png index 9c628ce789..4cefbb690d 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png index 137778d11f..12aab4a27c 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png index 3153d8e3c7..9f281836d7 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png index c642127abc..46942cba28 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png index 689bb5aef4..4781bfc3a6 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png index f51a29a854..abc38d4310 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png index 1c20ed072b..9836814c6c 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png index 8b095bfcba..06c1f30c8f 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png index 795d92615e..01c04a0ea6 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png index bb20d139e1..df1d5293a8 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png index b82ddf7209..6803ae4c74 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png index 3546349b59..5be785e40f 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png index df164ff2ca..46c72242a0 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png index 4d89528825..2827f29f3a 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png index 6ff2517af4..c0d1cd3dcc 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png and b/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png index 709903d46c..6e0a4b8f60 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png index 76e5abdab9..a341632dab 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png index 380c60a7df..4abe5c0f80 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png index 37306ac617..d989593924 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png index 1f3e799276..d4b033f4aa 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png index ddfcd7d195..461bdf37b7 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png index e742adc402..cdc2f2df0f 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png index 8d78d91c18..55dda2143e 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png index 302c7ab633..6b8f2f7322 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png index fc032402b7..234bac461e 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png index 03c96f8dd8..0125160652 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png index 465583b9b0..fedeb0620a 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png index 383906a70a..9d63063e67 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png index 67da85c10b..020d95bef3 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png index feb935cc1d..983b39e611 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png index 571e6a0e4a..ac350cb409 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png index e3bd788ea1..8e906f8be1 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png index 0edabbc86f..5163f44103 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png index 0eee1162ce..730f86f0ba 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png index 158a63a58c..d81cd27dd9 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png index f7352ab517..dc9bd083c2 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png index cfba261023..7c738c21eb 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png index 77f87e777b..1454b20fd5 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png and b/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png index 224943b0e9..b385ed9db5 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png index 043dd5dfae..b7da9bfa2c 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png index 8857034ce2..85499fd219 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png index 45f6d91938..bcc61b432b 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png index 191a619f7c..7a7b869565 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png index 2c2ffb86e6..77e684960e 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png index 655a938f82..8cb4dd3fa7 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png index c1bbdc4de6..258b3b2fc1 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png index fbdede243a..f6508de453 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png index d06b5ca8b1..1923fc9b9f 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png index f77c9c6e9a..00d3113175 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png index 7336f35303..635953e1c7 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png index 850250c71a..7c4beda53d 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png index 6f6328cece..4c407a0f5f 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png index ac0d373a03..64b8694088 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png index 8c2b714b29..0c04210a0c 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png index a7cf8d0f7d..0ff92ec7a2 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png index 2193c98931..d9651bf654 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png index bd59fbbbaf..e058d25f82 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png index 34c60c2819..5d5e46e21b 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png index 6868f577ce..c352966320 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png index 52a28fb3af..ad51297748 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png index 7ead079cad..2a1707006d 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png and b/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png differ diff --git a/sysui/desktop/icons/master-document.icns b/sysui/desktop/icons/master-document.icns index 2089b9a660..33fdae3d47 100644 Binary files a/sysui/desktop/icons/master-document.icns and b/sysui/desktop/icons/master-document.icns differ diff --git a/sysui/desktop/icons/master-document.ico b/sysui/desktop/icons/master-document.ico new file mode 100644 index 0000000000..2c581f59a2 Binary files /dev/null and b/sysui/desktop/icons/master-document.ico differ diff --git a/sysui/desktop/icons/oasis-database.icns b/sysui/desktop/icons/oasis-database.icns index f64c6d2570..4d70286b0d 100644 Binary files a/sysui/desktop/icons/oasis-database.icns and b/sysui/desktop/icons/oasis-database.icns differ diff --git a/sysui/desktop/icons/oasis-database.ico b/sysui/desktop/icons/oasis-database.ico new file mode 100644 index 0000000000..3157568c32 Binary files /dev/null and b/sysui/desktop/icons/oasis-database.ico differ diff --git a/sysui/desktop/icons/oasis-drawing-template.icns b/sysui/desktop/icons/oasis-drawing-template.icns index bb357bae58..dcb55db8e9 100644 Binary files a/sysui/desktop/icons/oasis-drawing-template.icns and b/sysui/desktop/icons/oasis-drawing-template.icns differ diff --git a/sysui/desktop/icons/oasis-drawing-template.ico b/sysui/desktop/icons/oasis-drawing-template.ico new file mode 100644 index 0000000000..f98a2d6f44 Binary files /dev/null and b/sysui/desktop/icons/oasis-drawing-template.ico differ diff --git a/sysui/desktop/icons/oasis-drawing.icns b/sysui/desktop/icons/oasis-drawing.icns index 80adc9feaa..3802af5ef3 100644 Binary files a/sysui/desktop/icons/oasis-drawing.icns and b/sysui/desktop/icons/oasis-drawing.icns differ diff --git a/sysui/desktop/icons/oasis-drawing.ico b/sysui/desktop/icons/oasis-drawing.ico new file mode 100644 index 0000000000..b24f2dadbe Binary files /dev/null and b/sysui/desktop/icons/oasis-drawing.ico differ diff --git a/sysui/desktop/icons/oasis-formula.icns b/sysui/desktop/icons/oasis-formula.icns index a7bded196c..657ea29eb9 100644 Binary files a/sysui/desktop/icons/oasis-formula.icns and b/sysui/desktop/icons/oasis-formula.icns differ diff --git a/sysui/desktop/icons/oasis-formula.ico b/sysui/desktop/icons/oasis-formula.ico new file mode 100644 index 0000000000..8ba738304e Binary files /dev/null and b/sysui/desktop/icons/oasis-formula.ico differ diff --git a/sysui/desktop/icons/oasis-master-document.icns b/sysui/desktop/icons/oasis-master-document.icns index 1891c129ad..c39cb8963c 100644 Binary files a/sysui/desktop/icons/oasis-master-document.icns and b/sysui/desktop/icons/oasis-master-document.icns differ diff --git a/sysui/desktop/icons/oasis-master-document.ico b/sysui/desktop/icons/oasis-master-document.ico new file mode 100644 index 0000000000..2104eafef5 Binary files /dev/null and b/sysui/desktop/icons/oasis-master-document.ico differ diff --git a/sysui/desktop/icons/oasis-presentation-template.icns b/sysui/desktop/icons/oasis-presentation-template.icns index 337df2fa7b..57455ada70 100644 Binary files a/sysui/desktop/icons/oasis-presentation-template.icns and b/sysui/desktop/icons/oasis-presentation-template.icns differ diff --git a/sysui/desktop/icons/oasis-presentation-template.ico b/sysui/desktop/icons/oasis-presentation-template.ico new file mode 100644 index 0000000000..ef561b8215 Binary files /dev/null and b/sysui/desktop/icons/oasis-presentation-template.ico differ diff --git a/sysui/desktop/icons/oasis-presentation.icns b/sysui/desktop/icons/oasis-presentation.icns index 4b9ba4231f..cf768ac47b 100644 Binary files a/sysui/desktop/icons/oasis-presentation.icns and b/sysui/desktop/icons/oasis-presentation.icns differ diff --git a/sysui/desktop/icons/oasis-presentation.ico b/sysui/desktop/icons/oasis-presentation.ico new file mode 100644 index 0000000000..6f2c1602ef Binary files /dev/null and b/sysui/desktop/icons/oasis-presentation.ico differ diff --git a/sysui/desktop/icons/oasis-spreadsheet-template.icns b/sysui/desktop/icons/oasis-spreadsheet-template.icns index 2bae7e38a8..8235e52878 100644 Binary files a/sysui/desktop/icons/oasis-spreadsheet-template.icns and b/sysui/desktop/icons/oasis-spreadsheet-template.icns differ diff --git a/sysui/desktop/icons/oasis-spreadsheet-template.ico b/sysui/desktop/icons/oasis-spreadsheet-template.ico new file mode 100644 index 0000000000..1124d9f433 Binary files /dev/null and b/sysui/desktop/icons/oasis-spreadsheet-template.ico differ diff --git a/sysui/desktop/icons/oasis-spreadsheet.icns b/sysui/desktop/icons/oasis-spreadsheet.icns index 69b46c2a1d..5facf50dbc 100644 Binary files a/sysui/desktop/icons/oasis-spreadsheet.icns and b/sysui/desktop/icons/oasis-spreadsheet.icns differ diff --git a/sysui/desktop/icons/oasis-spreadsheet.ico b/sysui/desktop/icons/oasis-spreadsheet.ico new file mode 100644 index 0000000000..160ab0cbf3 Binary files /dev/null and b/sysui/desktop/icons/oasis-spreadsheet.ico differ diff --git a/sysui/desktop/icons/oasis-text-template.icns b/sysui/desktop/icons/oasis-text-template.icns index 1986a329cb..0f0fe3f897 100644 Binary files a/sysui/desktop/icons/oasis-text-template.icns and b/sysui/desktop/icons/oasis-text-template.icns differ diff --git a/sysui/desktop/icons/oasis-text-template.ico b/sysui/desktop/icons/oasis-text-template.ico new file mode 100644 index 0000000000..602124fabe Binary files /dev/null and b/sysui/desktop/icons/oasis-text-template.ico differ diff --git a/sysui/desktop/icons/oasis-text.icns b/sysui/desktop/icons/oasis-text.icns index 21a44a91d6..2d031fe499 100644 Binary files a/sysui/desktop/icons/oasis-text.icns and b/sysui/desktop/icons/oasis-text.icns differ diff --git a/sysui/desktop/icons/oasis-text.ico b/sysui/desktop/icons/oasis-text.ico new file mode 100644 index 0000000000..d2bd594316 Binary files /dev/null and b/sysui/desktop/icons/oasis-text.ico differ diff --git a/sysui/desktop/icons/oasis-web-template.icns b/sysui/desktop/icons/oasis-web-template.icns index 66b0db74ad..ee6d299991 100644 Binary files a/sysui/desktop/icons/oasis-web-template.icns and b/sysui/desktop/icons/oasis-web-template.icns differ diff --git a/sysui/desktop/icons/oasis-web-template.ico b/sysui/desktop/icons/oasis-web-template.ico new file mode 100644 index 0000000000..63ac9f348f Binary files /dev/null and b/sysui/desktop/icons/oasis-web-template.ico differ diff --git a/sysui/desktop/icons/presentation-template.icns b/sysui/desktop/icons/presentation-template.icns index 5cdf700d97..f4d01878b9 100644 Binary files a/sysui/desktop/icons/presentation-template.icns and b/sysui/desktop/icons/presentation-template.icns differ diff --git a/sysui/desktop/icons/presentation-template.ico b/sysui/desktop/icons/presentation-template.ico new file mode 100644 index 0000000000..471940369a Binary files /dev/null and b/sysui/desktop/icons/presentation-template.ico differ diff --git a/sysui/desktop/icons/presentation.icns b/sysui/desktop/icons/presentation.icns index 3f6e268c68..091be5b136 100644 Binary files a/sysui/desktop/icons/presentation.icns and b/sysui/desktop/icons/presentation.icns differ diff --git a/sysui/desktop/icons/presentation.ico b/sysui/desktop/icons/presentation.ico new file mode 100644 index 0000000000..360ef79e18 Binary files /dev/null and b/sysui/desktop/icons/presentation.ico differ diff --git a/sysui/desktop/icons/spreadsheet-template.icns b/sysui/desktop/icons/spreadsheet-template.icns index 058a147b50..d2dfa84929 100644 Binary files a/sysui/desktop/icons/spreadsheet-template.icns and b/sysui/desktop/icons/spreadsheet-template.icns differ diff --git a/sysui/desktop/icons/spreadsheet-template.ico b/sysui/desktop/icons/spreadsheet-template.ico new file mode 100644 index 0000000000..be267eb21b Binary files /dev/null and b/sysui/desktop/icons/spreadsheet-template.ico differ diff --git a/sysui/desktop/icons/spreadsheet.icns b/sysui/desktop/icons/spreadsheet.icns index 8594b9ba86..5c89354195 100644 Binary files a/sysui/desktop/icons/spreadsheet.icns and b/sysui/desktop/icons/spreadsheet.icns differ diff --git a/sysui/desktop/icons/spreadsheet.ico b/sysui/desktop/icons/spreadsheet.ico new file mode 100644 index 0000000000..a88045e9c1 Binary files /dev/null and b/sysui/desktop/icons/spreadsheet.ico differ diff --git a/sysui/desktop/icons/text-template.icns b/sysui/desktop/icons/text-template.icns index 0f7c006b42..8b9694ac75 100644 Binary files a/sysui/desktop/icons/text-template.icns and b/sysui/desktop/icons/text-template.icns differ diff --git a/sysui/desktop/icons/text-template.ico b/sysui/desktop/icons/text-template.ico new file mode 100644 index 0000000000..07986929a6 Binary files /dev/null and b/sysui/desktop/icons/text-template.ico differ diff --git a/sysui/desktop/icons/text.icns b/sysui/desktop/icons/text.icns index 169ef0961d..401d2b9dbf 100644 Binary files a/sysui/desktop/icons/text.icns and b/sysui/desktop/icons/text.icns differ diff --git a/sysui/desktop/icons/text.ico b/sysui/desktop/icons/text.ico new file mode 100644 index 0000000000..f19a7812b1 Binary files /dev/null and b/sysui/desktop/icons/text.ico differ -- cgit v1.2.3 From 08847112a9a13956c078317f1f05dc0fc88a8639 Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 15 Jan 2010 12:36:19 +0000 Subject: #i108159# ODF-Icons for OOo build --- sysui/desktop/icons/makefile.mk | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk index f98b235d12..1af3f4367f 100644 --- a/sysui/desktop/icons/makefile.mk +++ b/sysui/desktop/icons/makefile.mk @@ -37,6 +37,33 @@ TARGET=icons # --- Targets ------------------------------------------------------------- all: \ + $(MISC)$/oasis-database.ico \ + $(MISC)$/oasis-drawing-template.ico \ + $(MISC)$/oasis-drawing.ico \ + $(MISC)$/oasis-empty-template.ico \ + $(MISC)$/oasis-empty-document.ico \ + $(MISC)$/oasis-formula.ico \ + $(MISC)$/oasis-master-document.ico \ + $(MISC)$/oasis-presentation-template.ico \ + $(MISC)$/oasis-presentation.ico \ + $(MISC)$/oasis-spreadsheet-template.ico \ + $(MISC)$/oasis-spreadsheet.ico \ + $(MISC)$/oasis-text-template.ico \ + $(MISC)$/oasis-text.ico \ + $(MISC)$/oasis-web-template.ico \ + $(MISC)$/database.ico \ + $(MISC)$/drawing-template.ico \ + $(MISC)$/drawing.ico \ + $(MISC)$/empty-template.ico \ + $(MISC)$/empty-document.ico \ + $(MISC)$/formula.ico \ + $(MISC)$/master-document.ico \ + $(MISC)$/presentation-template.ico \ + $(MISC)$/presentation.ico \ + $(MISC)$/spreadsheet-template.ico \ + $(MISC)$/spreadsheet.ico \ + $(MISC)$/text-template.ico \ + $(MISC)$/text.ico \ $(MISC)$/ooo-base-app.ico \ $(MISC)$/ooo-base-doc.ico \ $(MISC)$/ooo-calc-app.ico \ -- cgit v1.2.3 From 5c6330d41aae77feb44befb3ce42705a3eafc660 Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 15 Jan 2010 15:31:35 +0000 Subject: #i108159# ODF-Icons for OOo build --- desktop/util/ooverinfo.rc | 61 +++++++++++++++++++++++----------------------- desktop/util/ooverinfo2.rc | 61 +++++++++++++++++++++++----------------------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc index 7a80adcad6..b2fab36e41 100644 --- a/desktop/util/ooverinfo.rc +++ b/desktop/util/ooverinfo.rc @@ -96,44 +96,43 @@ VS_VERSION_INFO versioninfo } } - -2 ICON "icons\\ooo3_writer_doc.ico" -3 ICON "icons\\ooo3_writer_tem.ico" -4 ICON "icons\\ooo3_calc_doc.ico" -5 ICON "icons\\ooo3_calc_tem.ico" -6 ICON "icons\\ooo3_draw_doc.ico" -7 ICON "icons\\ooo3_draw_tem.ico" -8 ICON "icons\\ooo3_impress_doc.ico" -9 ICON "icons\\ooo3_impress_tem.ico" -10 ICON "icons\\ooo3_impress_doc.ico" -11 ICON "icons\\ooo3_global_doc.ico" -12 ICON "icons\\ooo3_html_doc.ico" -13 ICON "icons\\ooo3_chart_doc.ico" -14 ICON "icons\\ooo3_base_doc.ico" -15 ICON "icons\\ooo3_math_doc.ico" -16 ICON "icons\\ooo3_empty_tem.ico" -17 ICON "icons\\ooo3_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\\ooo-configuration.ico" 19 ICON "icons\\ooo-open.ico" -20 ICON "icons\\ooo-image-doc.ico" +20 ICON "icons\\empty-document.ico" 21 ICON "icons\\ooo3_writer_app.ico" 22 ICON "icons\\ooo3_calc_app.ico" 23 ICON "icons\\ooo3_draw_app.ico" 24 ICON "icons\\ooo3_impress_app.ico" 25 ICON "icons\\ooo3_math_app.ico" 26 ICON "icons\\ooo3_base_app.ico" -27 ICON "icons\\ooo3_empty_doc.ico" -28 ICON "icons\\ooo11-writer-doc.ico" -29 ICON "icons\\ooo11-writer-tem.ico" -30 ICON "icons\\ooo11-calc-doc.ico" -31 ICON "icons\\ooo11-calc-tem.ico" -32 ICON "icons\\ooo11-draw-doc.ico" -33 ICON "icons\\ooo11-draw-tem.ico" -34 ICON "icons\\ooo11-impress-doc.ico" -35 ICON "icons\\ooo11-impress-tem.ico" -36 ICON "icons\\ooo11-master-doc.ico" -37 ICON "icons\\ooo11-chart-doc.ico" -38 ICON "icons\\ooo11-base-doc.ico" -39 ICON "icons\\ooo11-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/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc index adf7aac708..d19603d548 100644 --- a/desktop/util/ooverinfo2.rc +++ b/desktop/util/ooverinfo2.rc @@ -48,42 +48,43 @@ // ----------------------------------------------------------------------- -ICON 2 "icons/ooo-writer-doc.ico" -ICON 3 "icons/ooo-writer-tem.ico" -ICON 4 "icons/ooo-calc-doc.ico" -ICON 5 "icons/ooo-calc-tem.ico" -ICON 6 "icons/ooo-draw-doc.ico" -ICON 7 "icons/ooo-draw-tem.ico" -ICON 8 "icons/ooo-impress-doc.ico" -ICON 9 "icons/ooo-impress-tem.ico" -ICON 10 "icons/ooo-impress-doc.ico" -//ICON 11 "icons/ooo-global-doc.ico" -//ICON 12 "icons/ooo-html-doc.ico" -ICON 13 "icons/ooo-chart-doc.ico" -ICON 14 "icons/ooo-base-doc.ico" -ICON 15 "icons/ooo-math-doc.ico" -ICON 16 "icons/ooo-empty-tem.ico" -ICON 17 "icons/ooo-macro-doc.ico" +ICON 2 "icons/oasis-text.ico" +ICON 3 "icons/oasis-text-template.ico" +ICON 4 "icons/oasis-spreadsheet.ico" +ICON 5 "icons/oasis-spreadsheet-template.ico" +ICON 6 "icons/oasis-drawing.ico" +ICON 7 "icons/oasis-drawing-template.ico" +ICON 8 "icons/oasis-presentation.ico" +ICON 9 "icons/oasis-presentation-template.ico" +ICON 10 "icons/oasis-presentation-template.ico" +// ICON 11 "icons/oasis-master-document.ico" +// ICON 12 "icons/oasis-web-template.ico" +ICON 13 "icons/oasis-empty-document.ico" +ICON 14 "icons/oasis-database.ico" +ICON 15 "icons/oasis-formula.ico" +ICON 16 "icons/empty-template.ico" +ICON 17 "icons/empty-document.ico" ICON 18 "icons/ooo-configuration.ico" ICON 19 "icons/ooo-open.ico" -ICON 20 "icons/ooo-image-doc.ico" +ICON 20 "icons/empty-document.ico" ICON 21 "icons/ooo-writer-app.ico" ICON 22 "icons/ooo-calc-app.ico" ICON 23 "icons/ooo-draw-app.ico" ICON 24 "icons/ooo-impress-app.ico" ICON 25 "icons/ooo-math-app.ico" ICON 26 "icons/ooo-base-app.ico" -ICON 27 "icons/ooo-empty-doc.ico" -ICON 28 "icons/ooo11-writer-doc.ico" -ICON 29 "icons/ooo11-writer-tem.ico" -ICON 30 "icons/ooo11-calc-doc.ico" -ICON 31 "icons/ooo11-calc-tem.ico" -ICON 32 "icons/ooo11-draw-doc.ico" -ICON 33 "icons/ooo11-draw-tem.ico" -ICON 34 "icons/ooo11-impress-doc.ico" -ICON 35 "icons/ooo11-impress-tem.ico" -ICON 36 "icons/ooo11-master-doc.ico" -ICON 37 "icons/ooo11-chart-doc.ico" -ICON 38 "icons/ooo11-base-doc.ico" -ICON 39 "icons/ooo11-math-doc.ico" +ICON 27 "icons/oasis-empty-document.ico" +ICON 28 "icons/text.ico" +ICON 29 "icons/text-template.ico" +ICON 30 "icons/spreadsheet.ico" +ICON 31 "icons/spreadsheet-template.ico" +ICON 32 "icons/drawing.ico" +ICON 33 "icons/drawing-template.ico" +ICON 34 "icons/presentation.ico" +ICON 35 "icons/presentation-template.ico" +ICON 36 "icons/master-document.ico" +ICON 37 "icons/empty-document.ico" +ICON 38 "icons/database.ico" +ICON 39 "icons/formula.ico" +ICON 40 "icons/oxt-extension.ico" -- cgit v1.2.3 From a01ba99fa081bbdb66912140761844f5469df2cb Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 15 Jan 2010 16:33:00 +0000 Subject: #i108159# ODF-Icons for OOo build --- sysui/desktop/icons/oasis-empty-template.icns | Bin 0 -> 42146 bytes sysui/desktop/icons/oasis-empty-template.ico | Bin 0 -> 295606 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 sysui/desktop/icons/oasis-empty-template.icns create mode 100644 sysui/desktop/icons/oasis-empty-template.ico diff --git a/sysui/desktop/icons/oasis-empty-template.icns b/sysui/desktop/icons/oasis-empty-template.icns new file mode 100644 index 0000000000..ee6d299991 Binary files /dev/null and b/sysui/desktop/icons/oasis-empty-template.icns differ diff --git a/sysui/desktop/icons/oasis-empty-template.ico b/sysui/desktop/icons/oasis-empty-template.ico new file mode 100644 index 0000000000..63ac9f348f Binary files /dev/null and b/sysui/desktop/icons/oasis-empty-template.ico differ -- cgit v1.2.3 From 054f0f13e1d8e8f2593f29ec65acb4702cdbec21 Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 15 Jan 2010 16:33:42 +0000 Subject: #i108159# ODF-Icons for OOo build --- sysui/desktop/icons/oasis-empty-document.icns | Bin 0 -> 40589 bytes sysui/desktop/icons/oasis-empty-document.ico | Bin 0 -> 295606 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 sysui/desktop/icons/oasis-empty-document.icns create mode 100644 sysui/desktop/icons/oasis-empty-document.ico diff --git a/sysui/desktop/icons/oasis-empty-document.icns b/sysui/desktop/icons/oasis-empty-document.icns new file mode 100644 index 0000000000..c52970324b Binary files /dev/null and b/sysui/desktop/icons/oasis-empty-document.icns differ diff --git a/sysui/desktop/icons/oasis-empty-document.ico b/sysui/desktop/icons/oasis-empty-document.ico new file mode 100644 index 0000000000..a12b54c2a2 Binary files /dev/null and b/sysui/desktop/icons/oasis-empty-document.ico differ -- cgit v1.2.3 From 5cd1b8d9b2b085d8a6b37074f343ba22414d1470 Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 15 Jan 2010 16:35:06 +0000 Subject: #i108159# ODF-Icons for OOo build --- sysui/desktop/icons/empty-document.icns | Bin 50465 -> 37502 bytes sysui/desktop/icons/empty-document.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/empty-template.icns | Bin 47059 -> 39059 bytes sysui/desktop/icons/empty-template.ico | Bin 0 -> 295606 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 sysui/desktop/icons/empty-document.ico create mode 100644 sysui/desktop/icons/empty-template.ico diff --git a/sysui/desktop/icons/empty-document.icns b/sysui/desktop/icons/empty-document.icns index 18d1133eb6..ab676f6ef8 100644 Binary files a/sysui/desktop/icons/empty-document.icns and b/sysui/desktop/icons/empty-document.icns differ diff --git a/sysui/desktop/icons/empty-document.ico b/sysui/desktop/icons/empty-document.ico new file mode 100644 index 0000000000..4115c30896 Binary files /dev/null and b/sysui/desktop/icons/empty-document.ico differ diff --git a/sysui/desktop/icons/empty-template.icns b/sysui/desktop/icons/empty-template.icns index 034d30bccb..50e63b9425 100644 Binary files a/sysui/desktop/icons/empty-template.icns and b/sysui/desktop/icons/empty-template.icns differ diff --git a/sysui/desktop/icons/empty-template.ico b/sysui/desktop/icons/empty-template.ico new file mode 100644 index 0000000000..dec147610a Binary files /dev/null and b/sysui/desktop/icons/empty-template.ico differ -- cgit v1.2.3 From 44d020db548943777b4b72334dc1b5d087e7fe02 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 14 Dec 2009 13:46:00 +0100 Subject: Support png instead of bmp file format for splash/about images --- desktop/source/splash/splash.cxx | 26 +++++++++++++++++++------- desktop/source/splash/splash.hxx | 4 ++-- sfx2/source/dialog/about.cxx | 17 +++++++++++++---- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 623799cbcb..037e625680 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -44,6 +44,9 @@ #include #include #include +#include +#include +#include #define NOT_LOADED ((long)-1) @@ -373,6 +376,9 @@ void SplashScreen::loadConfig() void SplashScreen::initBitmap() { + MessBox aMsgBox(0, WB_OK, String::CreateFromAscii("Oracle OpenOffice.org"), String::CreateFromAscii("Stop!")); + aMsgBox.Execute(); + if ( _bShowLogo ) { OUString sExecutePath; @@ -418,9 +424,15 @@ bool SplashScreen::loadBitmap( SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); if ( !aStrm.GetError() ) { + // Use graphic class to also support more graphic formats (bmp,png,...) + Graphic aGraphic; + + GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); + pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW ); + // Default case, we load the intro bitmap from a seperate file // (e.g. staroffice_intro.bmp or starsuite_intro.bmp) - aStrm >> _aIntroBmp; + _aIntroBmp = aGraphic.GetBitmapEx(); return true; } @@ -439,7 +451,7 @@ bool SplashScreen::findBitmap(rtl::OUString const & path) { } if ( !haveBitmap ) haveBitmap = loadBitmap( - path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp"))); + path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.png"))); return haveBitmap; } @@ -469,7 +481,7 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path) aStrBuf.append( OUString::valueOf( nWidth )); aStrBuf.appendAscii( "x" ); aStrBuf.append( OUString::valueOf( nHeight )); - aStrBuf.appendAscii( ".bmp" ); + aStrBuf.appendAscii( ".png" ); OUString aBmpFileName = aStrBuf.makeStringAndClear(); bool haveBitmap = loadBitmap( path, aBmpFileName ); @@ -480,7 +492,7 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path) aStrBuf.append( OUString::valueOf( nWidth )); aStrBuf.appendAscii( "x" ); aStrBuf.append( OUString::valueOf( nHeight )); - aStrBuf.appendAscii( ".bmp" ); + aStrBuf.appendAscii( ".png" ); aBmpFileName = aStrBuf.makeStringAndClear(); haveBitmap = loadBitmap( path, aBmpFileName ); @@ -498,7 +510,7 @@ bool SplashScreen::findAppBitmap(rtl::OUString const & path) aStrBuf.appendAscii( "intro_" ); aStrBuf.appendAscii( "_" ); aStrBuf.append( _sAppName ); - aStrBuf.appendAscii( ".bmp" ); + aStrBuf.appendAscii( ".png" ); OUString aBmpFileName = aStrBuf.makeStringAndClear(); haveBitmap = loadBitmap( path, aBmpFileName ); } @@ -586,7 +598,7 @@ void SplashScreen::Paint( const Rectangle&) // in case of native controls we need to draw directly to the window if( IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) ) { - DrawBitmap( Point(), _aIntroBmp ); + DrawBitmapEx( Point(), _aIntroBmp ); ImplControlValue aValue( _iProgress * _barwidth / _iMax); Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) ); @@ -612,7 +624,7 @@ void SplashScreen::Paint( const Rectangle&) //non native drawing // draw bitmap if (_bPaintBitmap) - _vdev.DrawBitmap( Point(), _aIntroBmp ); + _vdev.DrawBitmapEx( Point(), _aIntroBmp ); if (_bPaintProgress) { // draw progress... diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx index 77f34be5ce..1e6b77ac5e 100644 --- a/desktop/source/splash/splash.hxx +++ b/desktop/source/splash/splash.hxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -86,7 +86,7 @@ private: Reference< XMultiServiceFactory > _rFactory; VirtualDevice _vdev; - Bitmap _aIntroBmp; + BitmapEx _aIntroBmp; Color _cProgressFrameColor; Color _cProgressBarColor; OUString _sAppName; diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx index 770de189b4..5ca9544ea1 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -47,6 +47,8 @@ #include #include #include +#include +#include #include #include "about.hxx" @@ -92,8 +94,15 @@ static bool impl_loadBitmap( SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); if ( !aStrm.GetError() ) { - Bitmap aBmp; - aStrm >> aBmp; + // Use graphic class to also support more graphic formats (bmp,png,...) + Graphic aGraphic; + + GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); + pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW ); + + // Default case, we load the intro bitmap from a seperate file + // (e.g. staroffice_intro.bmp or starsuite_intro.bmp) + BitmapEx aBmp = aGraphic.GetBitmapEx(); rLogo = Image( aBmp ); return true; } @@ -151,14 +160,14 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS { bLoaded = impl_loadBitmap( rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ), - rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); + rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); } if ( !bLoaded ) { bLoaded = impl_loadBitmap( rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), - rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); + rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); } // Transparenter Font -- cgit v1.2.3 From f4228cc4a90286cb8bbd3a949d2f6a89e1d308bd Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 14 Dec 2009 15:00:09 +0100 Subject: Removed obsolete msgbox test code --- desktop/source/splash/splash.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 037e625680..226cc69503 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -46,7 +46,6 @@ #include #include #include -#include #define NOT_LOADED ((long)-1) @@ -376,9 +375,6 @@ void SplashScreen::loadConfig() void SplashScreen::initBitmap() { - MessBox aMsgBox(0, WB_OK, String::CreateFromAscii("Oracle OpenOffice.org"), String::CreateFromAscii("Stop!")); - aMsgBox.Execute(); - if ( _bShowLogo ) { OUString sExecutePath; -- cgit v1.2.3 From 88f5fdb954af3a0cc6610b69ff3d5a3435849f77 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 18 Dec 2009 16:06:10 +0100 Subject: sb118: desktop/source/app/app.cxx: the acceptors in the AcceptorMap must be released with the solar mutex unlocked, to avoid deadlock --- desktop/source/app/app.cxx | 4 ++++ desktop/source/app/appinit.cxx | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index aadf6bc625..fdc060d102 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1642,7 +1642,11 @@ void Desktop::Main() // remove temp directory RemoveTemporaryDirectory(); + // The acceptors in the AcceptorMap must be released (in DeregisterServices) + // with the solar mutex unlocked, to avoid deadlock: + nAcquireCount = Application::ReleaseSolarMutex(); DeregisterServices(); + Application::AcquireSolarMutex(nAcquireCount); tools::DeInitTestToolLib(); diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index a477eb2ad4..f51ac6015f 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -314,7 +314,6 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr ) namespace { struct acceptorMap : public rtl::Static< AcceptorMap, acceptorMap > {}; - struct mtxAccMap : public rtl::Static< osl::Mutex, mtxAccMap > {}; struct CurrentTempURL : public rtl::Static< String, CurrentTempURL > {}; } @@ -322,8 +321,6 @@ static sal_Bool bAccept = sal_False; void Desktop::createAcceptor(const OUString& aAcceptString) { - // make sure nobody adds an acceptor whle we create one... - osl::MutexGuard aGuard(mtxAccMap::get()); // check whether the requested acceptor already exists AcceptorMap &rMap = acceptorMap::get(); AcceptorMap::const_iterator pIter = rMap.find(aAcceptString); @@ -370,7 +367,6 @@ class enable void Desktop::enableAcceptors() { RTL_LOGFILE_CONTEXT(aLog, "desktop (lo119109) Desktop::enableAcceptors"); - osl::MutexGuard aGuard(mtxAccMap::get()); if (!bAccept) { // from now on, all new acceptors are enabled @@ -384,7 +380,6 @@ void Desktop::enableAcceptors() void Desktop::destroyAcceptor(const OUString& aAcceptString) { - osl::MutexGuard aGuard(mtxAccMap::get()); // special case stop all acceptors AcceptorMap &rMap = acceptorMap::get(); if (aAcceptString.compareToAscii("all") == 0) { -- cgit v1.2.3 From 76c70f1c7edf36928a83a9255e36d3ddb90e1615 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 12 Jan 2010 18:49:59 +0100 Subject: sb118: #i108269# first step of removing tcsh support --- connectivity/util/makefile.mk | 2 -- officecfg/util/makefile.mk | 2 -- readlicense_oo/util/makefile.pmk | 4 ---- sysui/desktop/slackware/makefile.mk | 6 +----- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/connectivity/util/makefile.mk b/connectivity/util/makefile.mk index 805aa0110f..e446a371c5 100755 --- a/connectivity/util/makefile.mk +++ b/connectivity/util/makefile.mk @@ -70,9 +70,7 @@ $(MISC)$/$(TARGET)_delzip : $(BIN)$/fcfg_drivers_{$(alllangiso)}.zip : $(REALFILTERPACKAGES_FILTERS_UI_LANGPACKS) cd $(DIR_FILTERCFGOUT)$/$(@:b:s/fcfg_drivers_//) && zip -ru ..$/..$/..$/bin$/fcfg_drivers_$(@:b:s/fcfg_drivers_//).zip org/* -.IF "$(USE_SHELL)"!="4nt" $(PERL) -w $(SOLARENV)$/bin$/cleanzip.pl $@ -.ENDIF # "$(USE_SHELL)"!="4nt" ALLTAR: \ $(MISC)$/$(TARGET)_delzip \ diff --git a/officecfg/util/makefile.mk b/officecfg/util/makefile.mk index d022c92537..f9a44d2e25 100644 --- a/officecfg/util/makefile.mk +++ b/officecfg/util/makefile.mk @@ -45,9 +45,7 @@ $(MISC)$/$(TARGET)_delzip : $(BIN)$/registry_{$(alllangiso)}.zip : $(MISC)$/$(TARGET)_delzip cd $(MISC)$/registry$/res$/$(@:b:s/registry_//) && zip -ru ..$/..$/..$/..$/bin$/registry_$(@:b:s/registry_//).zip org/* -.IF "$(USE_SHELL)"!="4nt" $(PERL) -w $(SOLARENV)$/bin$/cleanzip.pl $@ -.ENDIF # "$(USE_SHELL)"!="4nt" ALLTAR: \ $(MISC)$/$(TARGET)_delzip \ diff --git a/readlicense_oo/util/makefile.pmk b/readlicense_oo/util/makefile.pmk index 1b2e1de513..ebad08c363 100755 --- a/readlicense_oo/util/makefile.pmk +++ b/readlicense_oo/util/makefile.pmk @@ -55,11 +55,7 @@ $(COMMONMISC)$/readme.dtd : ..$/readme.dtd virtual : $(MERGEDXRM) $(COMMONMISC)$/readme.dtd $(PRJ)$/docs/readme.xsl $(MISC)$/readme_text.xsl : virtual -.IF "$(USE_SHELL)"!="4nt" $(SED) 's#method="html".*>#method="text"/>#' < ..$/readme.xsl > $@ -.ELSE # "$(USE_SHELL)"!="4nt" - $(SED) "s/method=\"html\".*>/method=\"text\"\/>/" < ..$/readme.xsl > $@ -.ENDIF # "$(USE_SHELL)"!="4nt" $(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual' @@-$(MKDIRHIER) $(@:d) diff --git a/sysui/desktop/slackware/makefile.mk b/sysui/desktop/slackware/makefile.mk index 8d8fc071d2..d689c1d38c 100644 --- a/sysui/desktop/slackware/makefile.mk +++ b/sysui/desktop/slackware/makefile.mk @@ -46,10 +46,6 @@ TARGET=slackware MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.3-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz -.IF "$(USE_SHELL)"=="bash" -ECHOPARAM=-e -.ENDIF - # --- Targets ------------------------------------------------------- .INCLUDE : target.mk @@ -78,7 +74,7 @@ $(MISC)/$(TARGET)/usr/share/applications/ : @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.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 )") >> $@ + @echo -e $(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 -- cgit v1.2.3 From e2a0c7c6c296599ece509543449a743a39008538 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 13 Jan 2010 17:16:16 +0100 Subject: sb118: added -quickstart=no to allow XDesktop::terminate to succeed --- desktop/source/app/app.cxx | 3 ++- desktop/source/app/cmdlineargs.cxx | 13 +++++++++++++ desktop/source/app/cmdlineargs.hxx | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index c0758fef02..f415106ccf 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1581,7 +1581,8 @@ void Desktop::Main() // SetSplashScreenProgress(80); - if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() ) + if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() && + !pCmdLineArgs->IsNoQuickstart() ) InitializeQuickstartMode( xSMgr ); RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" ); diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index e2a8558372..35653d1ed0 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -390,6 +390,13 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& #if defined(WNT) || defined(OS2) || defined(QUARTZ) SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True ); #endif + SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False ); + return sal_True; + } + else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart=no" ))) + { + SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_False ); return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-terminate_after_init" )) == sal_True ) @@ -648,6 +655,12 @@ sal_Bool CommandLineArgs::IsQuickstart() const return m_aBoolParams[ CMD_BOOLPARAM_QUICKSTART ]; } +sal_Bool CommandLineArgs::IsNoQuickstart() const +{ + osl::MutexGuard aMutexGuard( m_aMutex ); + return m_aBoolParams[ CMD_BOOLPARAM_NOQUICKSTART ]; +} + sal_Bool CommandLineArgs::IsTerminateAfterInit() const { osl::MutexGuard aMutexGuard( m_aMutex ); diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index db4619151f..994b66a733 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -51,6 +51,7 @@ class CommandLineArgs CMD_BOOLPARAM_SERVER, CMD_BOOLPARAM_HEADLESS, CMD_BOOLPARAM_QUICKSTART, + CMD_BOOLPARAM_NOQUICKSTART, CMD_BOOLPARAM_TERMINATEAFTERINIT, CMD_BOOLPARAM_NOFIRSTSTARTWIZARD, CMD_BOOLPARAM_NOLOGO, @@ -134,6 +135,7 @@ class CommandLineArgs sal_Bool IsServer() const; sal_Bool IsHeadless() const; sal_Bool IsQuickstart() const; + sal_Bool IsNoQuickstart() const; sal_Bool IsTerminateAfterInit() const; sal_Bool IsNoFirstStartWizard() const; sal_Bool IsNoLogo() const; -- cgit v1.2.3 From 47b6c64ca940fc067fe2e58e7ae43456427db080 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 15 Jan 2010 12:00:39 +0100 Subject: dr74: migrate changes to hg --- formula/inc/formula/errorcodes.hxx | 10 +++++++--- svx/source/msfilter/msocximex.cxx | 17 ++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/formula/inc/formula/errorcodes.hxx b/formula/inc/formula/errorcodes.hxx index c15697ac91..e87bef3a43 100644 --- a/formula/inc/formula/errorcodes.hxx +++ b/formula/inc/formula/errorcodes.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -86,9 +86,13 @@ const USHORT NOTAVAILABLE = 0x7fff; represent an interpreter error code. */ inline double CreateDoubleError( USHORT nErr ) { - double fVal; + union + { + double fVal; + sal_math_Double smVal; + }; ::rtl::math::setNan( &fVal ); - reinterpret_cast< sal_math_Double * >(&fVal)->nan_parts.fraction_lo = nErr; + smVal.nan_parts.fraction_lo = nErr; return fVal; } diff --git a/svx/source/msfilter/msocximex.cxx b/svx/source/msfilter/msocximex.cxx index 493e097857..2da9b995d0 100644 --- a/svx/source/msfilter/msocximex.cxx +++ b/svx/source/msfilter/msocximex.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -688,7 +688,7 @@ class ContainerRecReader ReadAlign( pS, pS->Tell() - nStartPos, 4 ); *pS >> rec.nLeft >> rec.nTop; } - + // control infotip sal_uInt32 nTipBufSize = lclGetBufferSize( nTipLen ); if( nTipBufSize > 0 ) @@ -2341,8 +2341,8 @@ sal_Bool OCX_ToggleButton::Import(com::sun::star::uno::Reference< if (pValue) { INT16 nTmp=pValue[0]-0x30; - aTmp <<= nTmp; - rPropSet->setPropertyValue( WW8_ASCII2STR("State"), aTmp); + aTmp <<= nTmp == 1; + rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultState"), aTmp); } if (pCaption) @@ -2462,9 +2462,9 @@ sal_Bool OCX_ToggleButton::WriteContents(SvStorageStreamRef &rContents, WriteAlign(rContents,4); nValueLen = 1|SVX_MSOCX_COMPRESSED; - aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("State")); - sal_Int16 nDefault = sal_Int16(); - aTmp >>= nDefault; + bool bDefault = false; + rPropSet->getPropertyValue(WW8_ASCII2STR("DefaultState")) >>= bDefault; + sal_uInt8 nDefault = static_cast< sal_uInt8 >( bDefault ? '1' : '0' ); *rContents << nValueLen; pBlockFlags[2] |= 0x40; @@ -2477,8 +2477,7 @@ sal_Bool OCX_ToggleButton::WriteContents(SvStorageStreamRef &rContents, *rContents << rSize.Width; *rContents << rSize.Height; - nDefault += 0x30; - *rContents << sal_uInt8(nDefault); + *rContents << nDefault; *rContents << sal_uInt8(0x00); aCaption.WriteCharArray( *rContents ); -- cgit v1.2.3 From af61642af5644a05ad6f844782d42954a043e0ec Mon Sep 17 00:00:00 2001 From: thb Date: Sat, 16 Jan 2010 02:20:50 +0100 Subject: #i105937# Fixed a few remaining gradient glitches * linear/axial gradient were f*cked up when border and rotation was given * found another place where drawinglayer was generating helper polygons for gradients (vclgradienthelper.cxx), adapted to new value ranges * fixed build breakage in debug build in oox * fixed order of gradient color generation --- drawinglayer/source/processor2d/vclhelpergradient.cxx | 16 ++++++---------- drawinglayer/source/texture/texture.cxx | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drawinglayer/source/processor2d/vclhelpergradient.cxx b/drawinglayer/source/processor2d/vclhelpergradient.cxx index c02845e9c6..2b50882b54 100644 --- a/drawinglayer/source/processor2d/vclhelpergradient.cxx +++ b/drawinglayer/source/processor2d/vclhelpergradient.cxx @@ -218,16 +218,6 @@ namespace drawinglayer ::std::vector< basegfx::BColor > aColors; basegfx::B2DPolygon aUnitPolygon; - if(attribute::GRADIENTSTYLE_RADIAL == eGradientStyle || attribute::GRADIENTSTYLE_ELLIPTICAL == eGradientStyle) - { - 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)); - } - // make sure steps is not too high/low nSteps = impCalcGradientSteps(rOutDev, nSteps, aOutlineRange, sal_uInt32((rStart.getMaximumDistance(rEnd) * 127.5) + 0.5)); @@ -239,6 +229,7 @@ namespace drawinglayer texture::GeoTexSvxGradientLinear aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)); break; } case attribute::GRADIENTSTYLE_AXIAL: @@ -246,6 +237,7 @@ namespace drawinglayer texture::GeoTexSvxGradientAxial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1)); break; } case attribute::GRADIENTSTYLE_RADIAL: @@ -253,6 +245,7 @@ namespace drawinglayer texture::GeoTexSvxGradientRadial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetY); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(0,0), 1, 1); break; } case attribute::GRADIENTSTYLE_ELLIPTICAL: @@ -260,6 +253,7 @@ namespace drawinglayer texture::GeoTexSvxGradientElliptical aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(0,0), 1, 1); break; } case attribute::GRADIENTSTYLE_SQUARE: @@ -267,6 +261,7 @@ namespace drawinglayer texture::GeoTexSvxGradientSquare aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1)); break; } case attribute::GRADIENTSTYLE_RECT: @@ -274,6 +269,7 @@ namespace drawinglayer texture::GeoTexSvxGradientRect aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1)); break; } } diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx index dc4b785c2b..10d98a53ae 100644 --- a/drawinglayer/source/texture/texture.cxx +++ b/drawinglayer/source/texture/texture.cxx @@ -276,7 +276,7 @@ namespace drawinglayer if(maGradientInfo.mnSteps) { const double fStepSize=1.0 / maGradientInfo.mnSteps; - for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) + for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a > 0; a--) { const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a); impAppendMatrix(rMatrices, aRect); @@ -391,7 +391,7 @@ namespace drawinglayer if(maGradientInfo.mnSteps) { const double fStepSize=1.0 / maGradientInfo.mnSteps; - for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++) + for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a > 0; a--) { const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a); impAppendMatrix(rMatrices, aRect); -- cgit v1.2.3 From 1e4ad338ff3bfaad62357de168868d9d1bf7ac7c Mon Sep 17 00:00:00 2001 From: thb Date: Mon, 18 Jan 2010 18:58:26 +0100 Subject: #i105937# Post-merge fixes * nicer gradient poly setup, made code more self-explanatory * corrected order of rotation matrix multiplication * fixed build breakage in presenter screen, type only implicitely included --- drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx | 8 ++++---- drawinglayer/source/processor2d/vclhelpergradient.cxx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx index 92cbd23577..4d1249a00e 100644 --- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx @@ -221,16 +221,16 @@ namespace drawinglayer 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); + aUnitPolygon = basegfx::tools::createPolygonFromCircle( + basegfx::B2DPoint(0,0), 1); } else if(attribute::GRADIENTSTYLE_LINEAR == maFillGradient.getStyle()) { - aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1)); } else { - aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1.0, -1.0, 1.0, 1.0)); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1)); } // get the transform matrices and colors (where colors diff --git a/drawinglayer/source/processor2d/vclhelpergradient.cxx b/drawinglayer/source/processor2d/vclhelpergradient.cxx index 2b50882b54..be6b8a8531 100644 --- a/drawinglayer/source/processor2d/vclhelpergradient.cxx +++ b/drawinglayer/source/processor2d/vclhelpergradient.cxx @@ -229,7 +229,7 @@ namespace drawinglayer texture::GeoTexSvxGradientLinear aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); - aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)); + aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1)); break; } case attribute::GRADIENTSTYLE_AXIAL: @@ -245,7 +245,7 @@ namespace drawinglayer texture::GeoTexSvxGradientRadial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetY); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); - aUnitPolygon = basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(0,0), 1, 1); + aUnitPolygon = basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0,0), 1); break; } case attribute::GRADIENTSTYLE_ELLIPTICAL: @@ -253,7 +253,7 @@ namespace drawinglayer texture::GeoTexSvxGradientElliptical aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle); aGradient.appendTransformations(aMatrices); aGradient.appendColors(aColors); - aUnitPolygon = basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(0,0), 1, 1); + aUnitPolygon = basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0,0), 1); break; } case attribute::GRADIENTSTYLE_SQUARE: -- cgit v1.2.3 From 05cecd633e362e876eb30592e8a36c06efedd581 Mon Sep 17 00:00:00 2001 From: hb Date: Tue, 19 Jan 2010 12:56:39 +0100 Subject: merged DEV300_m69 --- desktop/prj/d.lst | 2 +- desktop/scripts/makefile.mk | 11 + desktop/scripts/soffice.sh | 13 +- desktop/source/pagein/makefile.mk | 7 +- desktop/source/pkgchk/unopkg/makefile.mk | 2 + desktop/util/makefile.mk | 27 +- desktop/util/verinfo.rc | 60 +- desktop/win32/source/setup/setup.cpp | 114 + desktop/win32/source/setup/setup.hxx | 4 +- desktop/win32/source/setup/setup_main.cxx | 3 + desktop/win32/source/setup/setup_main.hxx | 1 + .../drawinglayer/attribute/fillbitmapattribute.hxx | 12 +- .../drawinglayer/primitive2d/alphaprimitive2d.hxx | 37 +- .../primitive2d/animatedprimitive2d.hxx | 123 +- .../primitive2d/backgroundcolorprimitive2d.hxx | 31 +- .../drawinglayer/primitive2d/baseprimitive2d.hxx | 239 +- .../drawinglayer/primitive2d/bitmapprimitive2d.hxx | 21 +- .../primitive2d/borderlineprimitive2d.hxx | 33 +- .../drawinglayer/primitive2d/chartprimitive2d.hxx | 6 + .../primitive2d/controlprimitive2d.hxx | 51 +- .../primitive2d/drawinglayer_primitivetypes2d.hxx | 6 + .../primitive2d/embedded3dprimitive2d.hxx | 57 +- .../primitive2d/fillbitmapprimitive2d.hxx | 31 +- .../primitive2d/fillgradientprimitive2d.hxx | 55 +- .../primitive2d/fillhatchprimitive2d.hxx | 31 +- .../primitive2d/graphicprimitive2d.hxx | 35 +- .../drawinglayer/primitive2d/gridprimitive2d.hxx | 38 +- .../drawinglayer/primitive2d/groupprimitive2d.hxx | 49 +- .../primitive2d/helplineprimitive2d.hxx | 38 +- .../primitive2d/hittestprimitive2d.hxx | 39 +- .../drawinglayer/primitive2d/invertprimitive2d.hxx | 13 +- .../primitive2d/markerarrayprimitive2d.hxx | 33 +- .../drawinglayer/primitive2d/maskprimitive2d.hxx | 25 +- .../drawinglayer/primitive2d/mediaprimitive2d.hxx | 31 +- .../primitive2d/metafileprimitive2d.hxx | 37 +- .../primitive2d/modifiedcolorprimitive2d.hxx | 25 +- .../primitive2d/pagepreviewprimitive2d.hxx | 51 +- .../primitive2d/pointarrayprimitive2d.hxx | 28 +- .../primitive2d/polygonprimitive2d.hxx | 125 +- .../primitive2d/polypolygonprimitive2d.hxx | 198 +- .../drawinglayer/primitive2d/primitivetools2d.hxx | 137 +- .../drawinglayer/primitive2d/sceneprimitive2d.hxx | 97 +- .../drawinglayer/primitive2d/shadowprimitive2d.hxx | 33 +- .../primitive2d/structuretagprimitive2d.hxx | 28 +- .../primitive2d/textdecoratedprimitive2d.hxx | 132 +- .../primitive2d/texteffectprimitive2d.hxx | 44 +- .../primitive2d/texthierarchyprimitive2d.hxx | 94 +- .../drawinglayer/primitive2d/textlayoutdevice.hxx | 55 +- .../drawinglayer/primitive2d/textprimitive2d.hxx | 135 +- .../primitive2d/transformprimitive2d.hxx | 29 +- .../primitive2d/unifiedalphaprimitive2d.hxx | 26 +- .../primitive2d/wrongspellprimitive2d.hxx | 30 +- .../drawinglayer/primitive3d/baseprimitive3d.hxx | 158 +- .../drawinglayer/primitive3d/groupprimitive3d.hxx | 36 +- .../primitive3d/hatchtextureprimitive3d.hxx | 29 +- .../primitive3d/hittestprimitive3d.hxx | 43 +- .../primitive3d/modifiedcolorprimitive3d.hxx | 15 +- .../primitive3d/polygonprimitive3d.hxx | 45 +- .../primitive3d/polygontubeprimitive3d.hxx | 34 +- .../primitive3d/polypolygonprimitive3d.hxx | 22 +- .../primitive3d/sdrcubeprimitive3d.hxx | 17 +- .../primitive3d/sdrdecompositiontools3d.hxx | 1 + .../primitive3d/sdrextrudelathetools3d.hxx | 10 +- .../primitive3d/sdrextrudeprimitive3d.hxx | 38 +- .../primitive3d/sdrlatheprimitive3d.hxx | 40 +- .../primitive3d/sdrpolypolygonprimitive3d.hxx | 25 +- .../drawinglayer/primitive3d/sdrprimitive3d.hxx | 24 +- .../primitive3d/sdrsphereprimitive3d.hxx | 20 +- .../drawinglayer/primitive3d/shadowprimitive3d.hxx | 20 +- .../primitive3d/textureprimitive3d.hxx | 93 +- .../primitive3d/transformprimitive3d.hxx | 19 +- .../drawinglayer/processor2d/vclprocessor2d.hxx | 2 + drawinglayer/prj/d.lst | 2 + .../source/attribute/fillbitmapattribute.cxx | 16 +- drawinglayer/source/attribute/makefile.mk | 1 + .../source/attribute/sdrfillbitmapattribute.cxx | 2 +- drawinglayer/source/geometry/viewinformation2d.cxx | 2 +- .../source/primitive2d/animatedprimitive2d.cxx | 143 +- .../primitive2d/backgroundcolorprimitive2d.cxx | 14 +- .../source/primitive2d/baseprimitive2d.cxx | 54 +- .../source/primitive2d/bitmapprimitive2d.cxx | 4 +- .../source/primitive2d/borderlineprimitive2d.cxx | 6 +- .../source/primitive2d/controlprimitive2d.cxx | 25 +- .../source/primitive2d/embedded3dprimitive2d.cxx | 6 +- .../source/primitive2d/fillbitmapprimitive2d.cxx | 12 +- .../source/primitive2d/fillgradientprimitive2d.cxx | 178 +- .../source/primitive2d/fillhatchprimitive2d.cxx | 6 +- .../source/primitive2d/graphicprimitive2d.cxx | 582 +++- .../source/primitive2d/gridprimitive2d.cxx | 21 +- .../source/primitive2d/groupprimitive2d.cxx | 12 +- .../source/primitive2d/helplineprimitive2d.cxx | 14 +- .../source/primitive2d/hittestprimitive2d.cxx | 12 +- drawinglayer/source/primitive2d/makefile.mk | 6 + .../source/primitive2d/markerarrayprimitive2d.cxx | 6 +- .../source/primitive2d/maskprimitive2d.cxx | 5 + .../source/primitive2d/mediaprimitive2d.cxx | 6 +- .../source/primitive2d/metafileprimitive2d.cxx | 3008 +++++++++++++++++++- .../source/primitive2d/pagepreviewprimitive2d.cxx | 19 +- .../source/primitive2d/polygonprimitive2d.cxx | 30 +- .../source/primitive2d/polypolygonprimitive2d.cxx | 55 +- .../source/primitive2d/primitivetools2d.cxx | 88 +- .../source/primitive2d/sceneprimitive2d.cxx | 14 +- .../source/primitive2d/shadowprimitive2d.cxx | 40 +- .../primitive2d/textdecoratedprimitive2d.cxx | 474 +-- .../source/primitive2d/texteffectprimitive2d.cxx | 56 +- .../source/primitive2d/textlayoutdevice.cxx | 58 +- .../source/primitive2d/textprimitive2d.cxx | 63 +- .../source/primitive2d/unifiedalphaprimitive2d.cxx | 42 +- .../source/primitive2d/wrongspellprimitive2d.cxx | 6 +- .../source/primitive3d/baseprimitive3d.cxx | 54 +- .../source/primitive3d/groupprimitive3d.cxx | 12 +- .../source/primitive3d/hatchtextureprimitive3d.cxx | 22 +- .../source/primitive3d/hittestprimitive3d.cxx | 12 +- .../source/primitive3d/polygonprimitive3d.cxx | 8 +- .../source/primitive3d/polygontubeprimitive3d.cxx | 16 +- .../source/primitive3d/sdrcubeprimitive3d.cxx | 2 +- .../source/primitive3d/sdrextrudeprimitive3d.cxx | 6 +- .../source/primitive3d/sdrlatheprimitive3d.cxx | 6 +- .../primitive3d/sdrpolypolygonprimitive3d.cxx | 2 +- drawinglayer/source/primitive3d/sdrprimitive3d.cxx | 4 +- .../source/primitive3d/sdrsphereprimitive3d.cxx | 2 +- .../source/primitive3d/textureprimitive3d.cxx | 58 +- .../source/processor2d/canvasprocessor.cxx | 51 +- .../source/processor2d/contourextractor2d.cxx | 2 +- .../source/processor2d/hittestprocessor2d.cxx | 7 +- .../source/processor2d/linegeometryextractor2d.cxx | 2 +- .../processor2d/textaspolygonextractor2d.cxx | 2 +- .../source/processor2d/vclhelperbitmaprender.cxx | 20 +- .../source/processor2d/vclmetafileprocessor2d.cxx | 133 +- .../source/processor2d/vclpixelprocessor2d.cxx | 52 +- drawinglayer/source/processor2d/vclprocessor2d.cxx | 164 +- .../source/processor3d/cutfindprocessor3d.cxx | 4 +- .../source/processor3d/defaultprocessor3d.cxx | 10 +- .../source/processor3d/geometry2dextractor.cxx | 4 +- .../source/processor3d/shadow3dextractor.cxx | 4 +- .../source/processor3d/zbufferprocessor3d.cxx | 4 +- drawinglayer/source/texture/texture.cxx | 6 +- scripting/source/pyprov/mailmerge.py | 12 +- shell/source/backends/localebe/localebackend.cxx | 6 +- svx/inc/svx/sdr/contact/objectcontact.hxx | 3 +- svx/inc/svx/sdr/overlay/overlaytools.hxx | 10 +- .../svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx | 4 +- .../sdr/primitive2d/sdrconnectorprimitive2d.hxx | 4 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.hxx | 16 +- .../svx/sdr/primitive2d/sdrellipseprimitive2d.hxx | 6 +- svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx | 4 +- .../svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx | 4 +- svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx | 21 +- .../sdr/primitive2d/sdrolecontentprimitive2d.hxx | 4 +- svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx | 4 +- .../sdr/primitive2d/sdrrectangleprimitive2d.hxx | 4 +- svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx | 10 +- svx/inc/svx/svdpage.hxx | 3 + svx/source/engine3d/helperminimaldepth3d.cxx | 4 +- svx/source/engine3d/view3d.cxx | 11 +- svx/source/gengal/gengal.sh | 5 - svx/source/sdr/contact/viewcontactofgraphic.cxx | 37 +- .../sdr/contact/viewcontactofsdrcaptionobj.cxx | 32 +- svx/source/sdr/contact/viewcontactofsdrcircobj.cxx | 28 +- .../sdr/contact/viewcontactofsdrobjcustomshape.cxx | 16 +- svx/source/sdr/contact/viewcontactofsdrole2obj.cxx | 10 +- svx/source/sdr/contact/viewcontactofsdrpathobj.cxx | 33 +- svx/source/sdr/contact/viewcontactofsdrrectobj.cxx | 30 +- svx/source/sdr/contact/viewobjectcontact.cxx | 2 +- .../sdr/contact/viewobjectcontactofpageobj.cxx | 28 +- .../sdr/contact/viewobjectcontactofunocontrol.cxx | 28 +- svx/source/sdr/overlay/overlayselection.cxx | 11 +- svx/source/sdr/overlay/overlaytools.cxx | 18 +- .../sdr/primitive2d/sdrcaptionprimitive2d.cxx | 6 +- .../sdr/primitive2d/sdrconnectorprimitive2d.cxx | 6 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.cxx | 18 +- .../sdr/primitive2d/sdrdecompositiontools.cxx | 35 +- .../sdr/primitive2d/sdrellipseprimitive2d.cxx | 18 +- svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 6 +- .../sdr/primitive2d/sdrmeasureprimitive2d.cxx | 15 +- svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 60 +- .../sdr/primitive2d/sdrolecontentprimitive2d.cxx | 18 +- svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx | 6 +- .../sdr/primitive2d/sdrrectangleprimitive2d.cxx | 6 +- svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx | 20 +- svx/source/svdraw/gradtrns.cxx | 25 +- svx/source/svdraw/svddrgmt.cxx | 34 +- svx/source/svdraw/svdfmtf.cxx | 111 +- svx/source/svdraw/svdfmtf.hxx | 2 + svx/source/svdraw/svdoashp.cxx | 31 +- svx/source/svdraw/svdobj.cxx | 22 +- svx/source/svdraw/svdocirc.cxx | 60 +- svx/source/svdraw/svdograf.cxx | 2 +- svx/source/svdraw/svdomeas.cxx | 13 +- svx/source/svdraw/svdopath.cxx | 57 +- svx/source/svdraw/svdotext.cxx | 39 +- svx/source/svdraw/svdotextdecomposition.cxx | 126 +- svx/source/svdraw/svdotextpathdecomposition.cxx | 8 +- svx/source/svdraw/svdovirt.cxx | 5 +- svx/source/svdraw/svdpage.cxx | 6 + svx/source/table/viewcontactoftableobj.cxx | 20 +- svx/source/unodraw/unoshape.cxx | 11 +- svx/util/makefile.mk | 4 - sysui/desktop/debian/makefile.mk | 20 +- sysui/desktop/productversion.mk | 2 +- sysui/desktop/slackware/makefile.mk | 20 +- ucb/source/ucp/webdav/NeonSession.cxx | 4 +- xmloff/source/text/txtimp.cxx | 8 - 203 files changed, 7428 insertions(+), 2854 deletions(-) diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst index fe688e2c4b..5ec84bca7d 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 52750ca0b4..001ead3519 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 63df07fb69..87f8fb4bb3 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 85cbb4d3c9..6264128772 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 3562fad961..4a1f409f45 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 05f129b3c5..82cad8c095 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 8f1840afbe..105933ff13 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 af50d912ef..23ba22e049 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" @@ -1896,6 +1902,114 @@ boolean SetupAppX::IsPatchInstalled( TCHAR* pBaseDir, TCHAR* pFileName ) return false; } +//-------------------------------------------------------------------------- +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 1393fbd326..06caa87de6 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 28fc251ea7..37acc1e665 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 5366dcf825..4e016768ee 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 93e1f1d9cb..f0b36d4501 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 +#include #include #include @@ -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/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx index af82017f0d..89cbc8e076 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 b7e36f822e..59d770be94 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx @@ -38,6 +38,7 @@ #include #include +#include ////////////////////////////////////////////////////////////////////////////// // 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 05986f6cdf..542a39084c 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 fa2501d0e3..ccb22f17ef 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -43,16 +43,17 @@ #include ////////////////////////////////////////////////////////////////////////////// -// 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,77 +76,197 @@ 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 @@ -146,23 +274,24 @@ 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 42c85fd025..0dc376a9d5 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 ddab5bb53b..9239fa0178 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 2c91d8d6ab..3add93b2a1 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 63c4a2ac01..048e5f6a5a 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/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 25f100121a..9df4816a70 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 8177e60305..90475016fc 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx @@ -42,52 +42,65 @@ #include ////////////////////////////////////////////////////////////////////////////// -// 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/fillbitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx index eafacf1c62..2ff1d3e5ca 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 70ce489721..055946566e 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx @@ -40,38 +40,77 @@ #include ////////////////////////////////////////////////////////////////////////////// -// 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 770d981ba8..dfebc869b9 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx @@ -40,41 +40,56 @@ #include ////////////////////////////////////////////////////////////////////////////// -// 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 ec18e98106..aa1c12d66f 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 e6a20f9640..8ea1b86f11 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 9aa3f518bd..27f79615dd 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 d7805c7e44..e1654cd5fe 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 f72ee164cf..f65eb6e883 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 ae7a316e03..85f1c6510c 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 1bd3fff055..3543957aeb 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx @@ -41,38 +41,55 @@ #include ////////////////////////////////////////////////////////////////////////////// -// 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 76c01793be..3e2638796d 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 0c124b3f34..37a9c3c26b 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 6dcfa2a409..8a41324f55 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 4af19d3ad8..dfaf65b2bf 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 6d17a2a17d..c24a9ab8fb 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 +#include #include #include @@ -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 f04db4db5f..e4e21fe9f2 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx @@ -40,37 +40,51 @@ #include ////////////////////////////////////////////////////////////////////////////// -// 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 8c567b4806..24785fcf71 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 c3e621b4ff..6f6f373c2f 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::B2DPolyPolygon& rPolyPolygon, + 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 0a9c8ecc0d..9eff05dc6e 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 +#include ////////////////////////////////////////////////////////////////////////////// -// 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 1383cc418f..1fafd3b2d1 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 17520cc7b9..2f3a680535 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 5e1bb573a0..f7b9554408 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 6585e62178..2e829eeaaf 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 +#include ////////////////////////////////////////////////////////////////////////////// // 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 f435cc9bb3..32a105a9c6 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 +#include #include ////////////////////////////////////////////////////////////////////////////// @@ -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/texthierarchyprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx index 685d3af57e..9177c02cb4 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 8d93175e61..27f547e973 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/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx index 412477c4c2..0f84b5f115 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx @@ -43,6 +43,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// // predefines @@ -60,123 +61,91 @@ namespace drawinglayer { namespace primitive2d { - class FontAttributes - { - 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: - 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 + /** 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. -namespace drawinglayer -{ - namespace primitive2d - { - class TextSimplePortionPrimitive2D : public BasePrimitive2D + 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: - 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 + /// text range transformation from unit range ([0.0 .. 1.0]) to text range + basegfx::B2DHomMatrix maTextTransform; + + /// The text, used from maTextPosition up to maTextPosition + maTextLength + String maText; + + /// The index from where on maText is used + xub_StrLen maTextPosition; + + /// 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/transformprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx index f877f88800..54aa9702cf 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 1f512f21cf..8f1385e0e4 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/wrongspellprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx index a1504ac489..2c687869fb 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 f32536785c..302f84f2b7 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx @@ -43,16 +43,17 @@ #include ////////////////////////////////////////////////////////////////////////////// -// 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,75 +76,120 @@ 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 @@ -144,23 +197,24 @@ 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 16d85e652f..d06161dbf7 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 aff2628c2f..daf4c2f1b0 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 3b0b17dc5d..dd6698b6a5 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 d3f5c6ff28..689478bf5d 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 8be3ffbfc9..d40d76ef22 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 ed006a8cc0..5d4b581a13 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 8d908f2512..610c49b2ab 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 b3cc9c850f..c7cf465dfe 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 22bc7db0bf..cee185f7d7 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 a810e585a5..6ed3e646bd 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 6773d1b7f6..195de69961 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 fd6cf65b56..1a3c82fff9 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 f7470aecfc..5e22c4940c 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 18d932d2c5..6b36a4e6c6 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 9d8ec96f21..6ba1feb9c8 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 b9ddfe74f7..2c54f3a4aa 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 f620afe165..b65fa0e8e5 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 2a9b7ea75d..63fdace781 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 75d2fe39a3..6ac3d2abdd 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 1ba3c2e7b6..ee5b96d98a 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 0d6ea7f66c..da93f5a7b7 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/makefile.mk b/drawinglayer/source/attribute/makefile.mk index fa91224e64..65f899f671 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 eaf7a01742..c826aa5847 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 d7029fc067..4eba454ea5 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 f935f5b5b3..41b15c4595 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) - { - } - - void BufferedMatrixDecompose::ensureDecompose() const + AnimatedInterpolatePrimitive2D::AnimatedInterpolatePrimitive2D( + const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack, + const animation::AnimationEntry& rAnimationEntry, + const Primitive2DSequence& rChildren, + bool bIsTextAnimation) + : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation), + maMatrixStack() { - if(!mbDecomposed) + // copy matrices to locally pre-decomposed matrix stack + const sal_uInt32 nCount(rmMatrixStack.size()); + maMatrixStack.reserve(nCount); + + 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 084fc8fc66..9dde13e2a5 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 f385812d61..6021adba6d 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 ) @@ -98,6 +88,38 @@ namespace drawinglayer } // end of namespace primitive2d } // 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 diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx index 8b3ba03e3b..12e0b7640a 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 a2fda82d8f..8d772ee21f 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 5fc261a79e..8e7de81cbb 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -54,6 +54,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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/embedded3dprimitive2d.cxx b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx index 54c71a1196..b34ade2b64 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/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx index d7d004df02..6b71b022f8 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 61760758c1..5e609ebe15 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 6749b4bf18..ed420f4f4d 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 e5de786032..f8a57a7389 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -55,6 +55,18 @@ #include #include +////////////////////////////////////////////////////////////////////////////// +// 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 +#include +#include +#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) + { + // 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 { - // 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()); +#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 14a3398697..17c13e35ad 100644 --- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx @@ -42,6 +42,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 276103d851..d95bb0aec2 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 2889ceadb2..6053d7f585 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 58f7242254..78156cebbe 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 e10d1ddbcc..c9a3cc191a 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 a324aac8f9..68ef733afc 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 223538c5a4..238939592a 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 198bc04c64..f16e322ae6 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 34ed96e19d..c0f89b4dd0 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -39,6 +39,39 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 a6e292eeec..83bbb58bde 100644 --- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx @@ -42,6 +42,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 ad9a23504f..a66cb4b2f5 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 81bc519136..092d572088 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 d288a697d7..2b25590bf1 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 acf3307bbf..61c7f59f3b 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 8ee3841782..5f7c20379c 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 94059228b1..87e7fe111e 100644 --- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx @@ -48,6 +48,8 @@ #include #include #include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 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 6c5952e6aa..ac55fc5900 100644 --- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx @@ -41,6 +41,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 6fe64bdd71..53df1e65b8 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(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(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(rFont.GetWeight()), diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index 92f3e3bfa3..f5b3396728 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -42,6 +42,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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/unifiedalphaprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx index 9005067b8a..ec80034261 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/wrongspellprimitive2d.cxx b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx index 5ac16fe972..2388ddf9ff 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 bdb1046c6f..894929d875 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 ) @@ -98,6 +88,38 @@ namespace drawinglayer } // end of namespace primitive3d } // 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 diff --git a/drawinglayer/source/primitive3d/groupprimitive3d.cxx b/drawinglayer/source/primitive3d/groupprimitive3d.cxx index c23ec72002..81d532b4cc 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 1bb44f9888..4ccf07bf3a 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 b74d9d01c2..62a30333ff 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 bde0ae85ea..43f8cb925f 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 f4b238b644..219f05fab4 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 25c53a8257..ebe9e727da 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 b3e21fc793..5ebe15db3f 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 16db524155..f9827ea627 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 38d9ad54e1..38a3fea538 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 b57f49e59e..58f4fee375 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 b03fe9801d..80ad33e484 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 4063ee299f..ea3c9e72fa 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 2a1e699197..f3376e2abe 100644 --- a/drawinglayer/source/processor2d/canvasprocessor.cxx +++ b/drawinglayer/source/processor2d/canvasprocessor.cxx @@ -76,6 +76,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 dc2cedad31..a5bd6d380a 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 16d69646cb..e7c9daabfa 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 fc7740eacc..e650a5d8db 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 2ca8f3ff38..deab99fe96 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 75ec7e3898..653a0833e4 100644 --- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx +++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx @@ -43,6 +43,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// // 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 4ebd3aaab4..59d111fffb 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -74,6 +74,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// // 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); - - // restore DrawMode - mpOutputDevice->SetDrawMode(nOriginalDrawMode); + if(basegfx::fTools::more(rLine.getWidth(), 0.0)) + { + const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute(); + basegfx::B2DPolyPolygon aHairLinePolyPolygon; + + 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 df0e6cbd27..ec09bef696 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -67,6 +67,8 @@ #include #include #include +#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 b5ea9484ee..402532c637 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -63,6 +63,8 @@ #include #include #include +#include +#include ////////////////////////////////////////////////////////////////////////////// // 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 5705ba74ca..789b9f375d 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 33a2e1639f..6de3061eb1 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 790ac05993..9b44961896 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 daf3df495b..d96880fcfb 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 3fd02a4a49..ceb7530350 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 964099b691..6abef78107 100644 --- a/drawinglayer/source/texture/texture.cxx +++ b/drawinglayer/source/texture/texture.cxx @@ -39,6 +39,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py index 75d2db5337..c8f7b67652 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/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 56094892f0..80d6240ae8 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -39,7 +39,7 @@ #include -#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 #include @@ -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/svx/inc/svx/sdr/contact/objectcontact.hxx b/svx/inc/svx/sdr/contact/objectcontact.hxx index fe0ce7cbac..1a35f5eae7 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 761b588f1d..c970a3919e 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 c47ba9b1cd..7ffc95344a 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 d4160148c7..3b73b09ca1 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 2193dd63af..b6044df2b0 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 aa4b76e493..c78e9e0655 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 b5fb28706d..9c57c15911 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 f228d6c1c7..559e914911 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 ff7e0942dc..54e8ce4d90 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 +#include #include #include #include @@ -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 e29bfb674d..bea5895650 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 199f3c4fdc..7c4bb21b73 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 20dede7f44..54afa94a68 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 b9f27511e0..d06e0080a0 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 09ff53ee5d..6723a7a1ba 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 9c31d2ef5e..609bdd0f82 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 06eb512996..7f0e83108e 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -77,6 +77,7 @@ #include #include #include +#include #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 e619ba559a..610a101f9a 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 d7dee2ceda..b2340f94e1 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -52,18 +52,16 @@ #include "svdstr.hrc" #include #include - #include #include #include #include #include #include - #include #include #include -//#include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 ce545b0315..6dcd211856 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -37,6 +37,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// // 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 3e19d34a8a..eaaacd849c 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -39,6 +39,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 28ab8cbff6..e07f6b4d37 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include ////////////////////////////////////////////////////////////////////////////// @@ -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 3facc1c031..0038b7ea85 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -46,6 +46,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 1cb99de835..4b92c70587 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -38,6 +38,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 cf78de1646..8ac99245a1 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include ////////////////////////////////////////////////////////////////////////////// @@ -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 2a600fd5d5..638375ac65 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 87ba0b8c3a..fefe1fa720 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -44,6 +44,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 f4075576ae..9bcb4ce6b7 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 b60f1e66ce..24c73e045b 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 ea20bd4f20..81bf8b8f9c 100644 --- a/svx/source/sdr/overlay/overlaytools.cxx +++ b/svx/source/sdr/overlay/overlaytools.cxx @@ -40,6 +40,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 233aed8ed2..cc71488fb6 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 a00820289c..f08fd75ab0 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 93e8b3a6e7..61b60abc52 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 6204eba4fa..67fb97e6b7 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 dee271c97f..016ff9fa8f 100644 --- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx @@ -39,6 +39,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 d57540cce7..70b973e521 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 ce9f40037c..7f59e8be96 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -40,6 +40,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 1f4d48ea0a..5a7d327cd9 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 164e122e67..cb871d0949 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -39,6 +39,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 128a450ee2..e19bc75fd6 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 6449859318..1e963e3244 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 bd8547c8b8..ef716c25d3 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 75da911e8c..3f093513ab 100644 --- a/svx/source/svdraw/gradtrns.cxx +++ b/svx/source/svdraw/gradtrns.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include // 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 47f7324b8a..074045d4ef 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -84,6 +84,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -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 f9f4ad2070..dab771c211 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -46,7 +46,6 @@ #include #include #include - #include #include #include @@ -55,9 +54,7 @@ #include #include #include - #include - #include #include #include @@ -73,9 +70,10 @@ #include #include #include // FRound - -// #i73407# #include +#include +#include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -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 bb35c7e03c..5ba98dee5b 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 a55d46264d..34d517e6c3 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -94,6 +94,7 @@ #include #include #include +#include // #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 f5c55af0d8..8261f917dd 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -68,9 +68,6 @@ #include // NotPersistItems #include #include - -//////////////////////////////////////////////////////////////////////////////////////////////////// - #include #include #include @@ -107,8 +104,6 @@ #include #include #include - -// #110094# #include #include #include @@ -120,7 +115,6 @@ #include #include #include - #include #include #include @@ -128,10 +122,8 @@ #include "svx/svdotable.hxx" #include "svx/shapepropertynotifier.hxx" #include - -// --> OD 2009-07-10 #i73249# #include -// <-- +#include 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 39d67e0646..98bf7c4364 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -61,6 +61,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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; + // 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); + + // needs own scaling and translation from unit circle to target size (same as + // would be in createPolygonFromEllipse) const basegfx::B2DPoint aCenter(aRange.getCenter()); - - aMatrix.scale(aRange.getWidth() / 2.0, aRange.getHeight() / 2.0); - aMatrix.translate(aCenter.getX(), aCenter.getY()); + 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 53022c99db..8d150e506c 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 38f92739ca..46a7779ea3 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -71,6 +71,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -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 5558f69a01..5daa6204b1 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -56,7 +56,6 @@ #include #include #include - #include #include #include // FRound @@ -77,10 +76,9 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); } #include #include #include - -// #i89784# #include #include +#include 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 5d1b83146c..dd8a8e2175 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -63,17 +63,14 @@ #include #include #include - -// #110496# #include - -// #111111# #include #include #include #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -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 004c97f6ef..28773dd24e 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -60,6 +60,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// // 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 060b916ad0..ecccd6fa42 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 63ff2ef669..2ad653d6c9 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -40,6 +40,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -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 dfbba7b02a..4276f2c950 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 03ffdc3acf..70fd77ea1b 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 f90b8ec83b..3cebabe9de 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -98,6 +98,7 @@ #include "unomaster.hxx" #include #include +#include #include @@ -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 1dffe3a953..070aecc308 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/sysui/desktop/debian/makefile.mk b/sysui/desktop/debian/makefile.mk index 1e0761198c..cb43697630 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 7d2467d32e..4bb67bc50b 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 ae08a37728..8d8fc071d2 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/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index 2600c10c51..9b6bae2c15 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/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index f47aa1016d..51af4f954f 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[count]; -#else mpOutlineStylesCandidates = new ::std::vector[xChapterNumbering->getCount()]; -#endif } mpOutlineStylesCandidates[nOutlineLevel-1].push_back( rStyleName ); } -- cgit v1.2.3 From 4385d2cc7806a73bb161dba0670af48a47aaedfd Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 16 Feb 2010 11:18:37 +0100 Subject: cws ppp02: #i109321#: return correct IsBusy property in XPrintable::getPrinter() call --- sfx2/inc/sfx2/viewsh.hxx | 7 +++---- sfx2/source/doc/printhelper.cxx | 22 ++++++++++++++-------- sfx2/source/view/viewimp.hxx | 28 +++------------------------- sfx2/source/view/viewprn.cxx | 10 ++++++++++ 4 files changed, 30 insertions(+), 37 deletions(-) diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 980a60fb84..e4389135dc 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -62,6 +62,7 @@ class SfxTabPage; class SfxPrintMonitor; class SfxFrameSetDescriptor; class PrintDialog; +class Printer; class SfxPrinter; class SfxProgress; class SvStringsDtor; @@ -168,6 +169,7 @@ friend class SfxInternalFrame; friend class SfxExternalTopViewFrame_Impl; friend class SfxOfficeDocController; friend class SfxBaseController; +friend class SfxPrinterController; #endif struct SfxViewShell_Impl* pImp; @@ -207,10 +209,6 @@ public: SfxViewShell( SfxViewFrame *pFrame, USHORT nFlags = 0 ); virtual ~SfxViewShell(); - // In-Place - // should be superfluous - //virtual SfxInPlaceClient* CreateIPClient( WorkWindow * pTop, WorkWindow * pDoc, Window * pDraw ); - SfxInPlaceClient* GetIPClient() const; SfxInPlaceClient* GetUIActiveClient() const; SfxInPlaceClient* FindIPClient( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, Window *pObjParentWin ) const; @@ -272,6 +270,7 @@ public: void LockPrinter( BOOL bLock = TRUE ); BOOL IsPrinterLocked() const; virtual JobSetup GetJobSetup() const; + Printer* GetActivePrinter() const; // Workingset virtual void WriteUserData( String&, BOOL bBrowse = FALSE ); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 4eb1ca3416..04f45d2a36 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -269,17 +269,23 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro // object already disposed? ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // Printer beschaffen - SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? - SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0; - if ( !pViewFrm ) - return uno::Sequence< beans::PropertyValue >(); - - const SfxPrinter *pPrinter = pViewFrm->GetViewShell()->GetPrinter(sal_True); + // search for any view of this document that is currently printing + const Printer *pPrinter = NULL; + SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0; + SfxViewFrame* pFirst = pViewFrm; + while ( pViewFrm && !pPrinter ) + { + pPrinter = pViewFrm->GetViewShell()->GetActivePrinter(); + pViewFrm = SfxViewFrame::GetNext( *pViewFrm, m_pData->m_pObjectShell, 0, sal_False ); + } + + // if no view is printing currently, use the permanent SfxPrinter instance + if ( !pPrinter && pFirst ) + pPrinter = pFirst->GetViewShell()->GetPrinter(sal_True); + if ( !pPrinter ) return uno::Sequence< beans::PropertyValue >(); - // Printer Eigenschaften uebertragen uno::Sequence< beans::PropertyValue > aPrinter(8); aPrinter.getArray()[7].Name = DEFINE_CONST_UNICODE( "CanSetPaperSize" ); diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index df00d40fbf..79f83d38e6 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -33,20 +33,16 @@ // include --------------------------------------------------------------- -#ifndef __SBX_SBXOBJ_HXX #include -#endif #include #include // SvBorder #include #include - #include #include #include - #include - +#include #include // forward --------------------------------------------------------------- @@ -57,24 +53,6 @@ class SfxBaseController; typedef SfxShell* SfxShellPtr_Impl; SV_DECL_PTRARR( SfxShellArr_Impl, SfxShellPtr_Impl, 4, 4 ) -// struct SfxViewShell_Impl ---------------------------------------------- -#if 0 -class SfxAsyncPrintExec_Impl : public SfxListener -{ - SfxViewShell* pView; - ::std::queue < SfxRequest*> aReqs; - - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - -public: - SfxAsyncPrintExec_Impl( SfxViewShell* pShell) - : pView( pShell ) - {} - - void AddRequest( SfxRequest& rReq ); -}; -#endif - class SfxClipboardChangeListener; struct SfxViewShell_Impl @@ -100,10 +78,10 @@ struct SfxViewShell_Impl USHORT nFamily; SfxBaseController* pController; ::svt::AcceleratorExecute* pAccExec; -// SfxAsyncPrintExec_Impl* pPrinterCommandQueue; com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts; ::rtl::Reference< SfxClipboardChangeListener > xClipboardListener; - + vcl::PrinterController* pPrinterController; + SfxViewShell_Impl(); }; diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 8a0a8e8ef9..75273860cf 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -332,6 +332,9 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt if ( m_bNeedsChange ) mpObjectShell->EnableSetModified( m_bOrigStatus ); + + if ( mpViewShell ) + mpViewShell->pImp->pPrinterController = 0; } } @@ -642,6 +645,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro this, rProps ) ); + pImp->pPrinterController = pController.get(); + SfxObjectShell *pObjShell = GetObjectShell(); pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ), makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) ); @@ -656,6 +661,11 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro Printer::PrintJob( pController, aJobSetup ); } +Printer* SfxViewShell::GetActivePrinter() const +{ + return pImp->pPrinterController ? pImp->pPrinterController->getPrinter().get() : 0; +} + void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) { // USHORT nCopies=1; -- cgit v1.2.3 From f81f509ce170a9e7618d1432d161011fbe8e7ade Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 26 Feb 2010 12:09:39 +0000 Subject: hunspell129: clear windows buildbot WaE --- framework/source/classes/addonmenu.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/source/classes/addonmenu.cxx b/framework/source/classes/addonmenu.cxx index c7c9b56138..82055c6295 100644 --- a/framework/source/classes/addonmenu.cxx +++ b/framework/source/classes/addonmenu.cxx @@ -64,9 +64,9 @@ using namespace ::com::sun::star::beans; // Please look at sfx2/inc/sfxsids.hrc the values are defined there. Due to build dependencies // we cannot include the header file. -const USHORT SID_SFX_START = 5000; -const USHORT SID_HELPMENU = (SID_SFX_START + 410); -const USHORT SID_ONLINE_REGISTRATION = (SID_SFX_START + 1537); +#define SID_SFX_START 5000 +#define SID_HELPMENU (SID_SFX_START + 410) +#define SID_ONLINE_REGISTRATION (SID_SFX_START + 1537) namespace framework { -- cgit v1.2.3 From c66bb48a30ffa3653b49d42f916efd4f69b808f1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 10 Mar 2010 12:16:18 +0000 Subject: cmcfixes73: #i110009# use rtl::StaticWithInit --- linguistic/source/convdiclist.cxx | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 3c95f1b52f..4647861b99 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -397,41 +397,12 @@ void ConvDicNameContainer::AddConvDics( namespace { -template -class StaticWithInit_ { -public: - /** Gets the static. Mutual exclusion is performed using the - osl global mutex. - - @return - static variable - */ - static T & get() { - return *rtl_Instance< - T, StaticInstanceWithInit, - ::osl::MutexGuard, ::osl::GetGlobalMutex, - Data, InitData >::create( StaticInstanceWithInit(), - ::osl::GetGlobalMutex(), - InitData() ); - } -private: - struct StaticInstanceWithInit { - T * operator () ( Data d ) { - static T instance(d); - return &instance; + struct StaticConvDicList : public rtl::StaticWithInit< + uno::Reference, StaticConvDicList> { + uno::Reference operator () () { + return (cppu::OWeakObject *) new ConvDicList; } }; -}; - -//after src680m62 you can replace StaticWithInit_ with rtl::StaticWithInit and remove the above definition of StaticWithInit_ - -struct StaticConvDicList : public StaticWithInit_< - uno::Reference, StaticConvDicList> { - uno::Reference operator () () { - return (cppu::OWeakObject *) new ConvDicList; - } -}; } -- cgit v1.2.3 From 822c0c085c5adcfb27155e16a528adfeb1ee63f4 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 11 Mar 2010 07:16:49 +0100 Subject: dtardon02: #i108500# remove empty file in linguistic --- linguistic/source/staticmb.cxx | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 linguistic/source/staticmb.cxx diff --git a/linguistic/source/staticmb.cxx b/linguistic/source/staticmb.cxx deleted file mode 100644 index e67e3e7cdb..0000000000 --- a/linguistic/source/staticmb.cxx +++ /dev/null @@ -1,29 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_linguistic.hxx" -- cgit v1.2.3 From c3c6d3cabb179d307f049bce5a3d8170717f2e5e Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 11 Mar 2010 07:21:46 +0100 Subject: dtardon02: #i108506# remove empty file in sfx2 --- sfx2/source/view/view.hxx | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 sfx2/source/view/view.hxx diff --git a/sfx2/source/view/view.hxx b/sfx2/source/view/view.hxx deleted file mode 100644 index e6daf9484d..0000000000 --- a/sfx2/source/view/view.hxx +++ /dev/null @@ -1,27 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -- cgit v1.2.3 From 3edb2f9e6886585d30542cab86a9a97a89d6a4aa Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 11 Mar 2010 07:34:30 +0100 Subject: dtardon02: #i108507# remove empty files in svx --- svx/source/engine3d/viewpt3d.cxx | 32 -------------------- svx/source/engine3d/volume3d.cxx | 32 -------------------- svx/source/form/typemap.cxx | 65 ---------------------------------------- svx/source/svdraw/svdcrtmt.hxx | 32 -------------------- svx/source/svdraw/svdoimp.cxx | 33 -------------------- svx/source/svdraw/svdscrol.cxx | 33 -------------------- svx/source/svdraw/svdscrol.hxx | 31 ------------------- 7 files changed, 258 deletions(-) delete mode 100644 svx/source/engine3d/viewpt3d.cxx delete mode 100644 svx/source/engine3d/volume3d.cxx delete mode 100644 svx/source/form/typemap.cxx delete mode 100644 svx/source/svdraw/svdcrtmt.hxx delete mode 100644 svx/source/svdraw/svdoimp.cxx delete mode 100644 svx/source/svdraw/svdscrol.cxx delete mode 100644 svx/source/svdraw/svdscrol.hxx diff --git a/svx/source/engine3d/viewpt3d.cxx b/svx/source/engine3d/viewpt3d.cxx deleted file mode 100644 index 61357e19cd..0000000000 --- a/svx/source/engine3d/viewpt3d.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#include - -// eof diff --git a/svx/source/engine3d/volume3d.cxx b/svx/source/engine3d/volume3d.cxx deleted file mode 100644 index c0d6db9d7c..0000000000 --- a/svx/source/engine3d/volume3d.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#include - -// eof diff --git a/svx/source/form/typemap.cxx b/svx/source/form/typemap.cxx deleted file mode 100644 index ae2d45ca76..0000000000 --- a/svx/source/form/typemap.cxx +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _SVX_CLIPBOARDCTL_HXX_ -#include "clipfmtitem.hxx" -#endif -#include -#include "editeng/fontitem.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _SVX_EMPHITEM_HXX -#include -#endif - -#include -#define SFX_TYPEMAP -#include "svxslots.hxx" - diff --git a/svx/source/svdraw/svdcrtmt.hxx b/svx/source/svdraw/svdcrtmt.hxx deleted file mode 100644 index 2b99c4a550..0000000000 --- a/svx/source/svdraw/svdcrtmt.hxx +++ /dev/null @@ -1,32 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVDCRTMT_HXX -#define _SVDCRTMT_HXX - -#endif //_SVDCRTMT_HXX - diff --git a/svx/source/svdraw/svdoimp.cxx b/svx/source/svdraw/svdoimp.cxx deleted file mode 100644 index 4362f5599e..0000000000 --- a/svx/source/svdraw/svdoimp.cxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#include - -/////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/svx/source/svdraw/svdscrol.cxx b/svx/source/svdraw/svdscrol.cxx deleted file mode 100644 index 0e7ebaf7eb..0000000000 --- a/svx/source/svdraw/svdscrol.cxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" - -#include "svdscrol.hxx" - -// eof diff --git a/svx/source/svdraw/svdscrol.hxx b/svx/source/svdraw/svdscrol.hxx deleted file mode 100644 index bf900c6380..0000000000 --- a/svx/source/svdraw/svdscrol.hxx +++ /dev/null @@ -1,31 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVDSCROL_HXX -#define _SVDSCROL_HXX - -#endif //_SVDSCROL_HXX -- cgit v1.2.3 From 647d147e4e5200ba50d9785c558b22c59272b4b9 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 11 Mar 2010 07:48:51 +0100 Subject: dtardon02: #i110035# remove unused files in sfx2 --- sfx2/source/doc/commitlistener.cxx | 81 ---- sfx2/source/doc/commitlistener.hxx | 57 --- sfx2/source/doc/opostponedtruncationstream.cxx | 491 ------------------------- sfx2/source/doc/opostponedtruncationstream.hxx | 122 ------ 4 files changed, 751 deletions(-) delete mode 100644 sfx2/source/doc/commitlistener.cxx delete mode 100644 sfx2/source/doc/commitlistener.hxx delete mode 100644 sfx2/source/doc/opostponedtruncationstream.cxx delete mode 100644 sfx2/source/doc/opostponedtruncationstream.hxx diff --git a/sfx2/source/doc/commitlistener.cxx b/sfx2/source/doc/commitlistener.cxx deleted file mode 100644 index 73e0d10683..0000000000 --- a/sfx2/source/doc/commitlistener.cxx +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -#include "commitlistener.hxx" - -using namespace ::com::sun::star; - -OChildCommitListen_Impl::OChildCommitListen_Impl( SfxBaseModel& aModel ) -: m_pModel( &aModel ) -{} - -OChildCommitListen_Impl::~OChildCommitListen_Impl() -{} - -void OChildCommitListen_Impl::OwnerIsDisposed() -{ - ::osl::MutexGuard aGuard( m_aMutex ); - m_pModel = NULL; -} - -void SAL_CALL OChildCommitListen_Impl::preCommit( const ::com::sun::star::lang::EventObject& ) - throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) -{ - // not interesting -} - -void SAL_CALL OChildCommitListen_Impl::commited( const ::com::sun::star::lang::EventObject& /*aEvent*/ ) - throw (::com::sun::star::uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - // StorageIsModified_Impl must not contain any locking! - if ( m_pModel ) - m_pModel->StorageIsModified_Impl(); -} - -void SAL_CALL OChildCommitListen_Impl::preRevert( const ::com::sun::star::lang::EventObject& ) - throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) -{ - // not interesting -} - -void SAL_CALL OChildCommitListen_Impl::reverted( const ::com::sun::star::lang::EventObject& ) - throw (::com::sun::star::uno::RuntimeException) -{ - // not interesting -} - - -void SAL_CALL OChildCommitListen_Impl::disposing( const lang::EventObject& ) - throw ( uno::RuntimeException ) -{ - // not interesting -} - diff --git a/sfx2/source/doc/commitlistener.hxx b/sfx2/source/doc/commitlistener.hxx deleted file mode 100644 index bffcd508d4..0000000000 --- a/sfx2/source/doc/commitlistener.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __COMMITLISTENER_HXX_ -#define __COMMITLISTENER_HXX_ - -#include -#include -#include - -#include - -class OChildCommitListen_Impl : public ::cppu::WeakImplHelper1 < ::com::sun::star::embed::XTransactionListener > -{ - ::osl::Mutex m_aMutex; - SfxBaseModel* m_pModel; - -public: - OChildCommitListen_Impl( SfxBaseModel& aStorage ); - virtual ~OChildCommitListen_Impl(); - - void OwnerIsDisposed(); - - virtual void SAL_CALL preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL commited( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL preRevert( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL reverted( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); -}; - -#endif - diff --git a/sfx2/source/doc/opostponedtruncationstream.cxx b/sfx2/source/doc/opostponedtruncationstream.cxx deleted file mode 100644 index 364a4d5a65..0000000000 --- a/sfx2/source/doc/opostponedtruncationstream.cxx +++ /dev/null @@ -1,491 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" -#include - -#include - -using namespace ::com::sun::star; - -// ======================================================================== -struct PTFStreamData_Impl -{ - uno::Reference< ucb::XSimpleFileAccess > m_xFileAccess; - sal_Bool m_bDelete; - ::rtl::OUString m_aURL; - - // the streams below are not visible from outside so there is no need to remember position - - // original stream related members - uno::Reference< io::XStream > m_xOrigStream; - uno::Reference< io::XTruncate > m_xOrigTruncate; - uno::Reference< io::XSeekable > m_xOrigSeekable; - uno::Reference< io::XInputStream > m_xOrigInStream; - uno::Reference< io::XOutputStream > m_xOrigOutStream; - - sal_Bool m_bInOpen; - sal_Bool m_bOutOpen; - - sal_Bool m_bPostponedTruncate; - - - PTFStreamData_Impl( - const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess, - sal_Bool bDelete, - const ::rtl::OUString& aURL, - const uno::Reference< io::XStream >& xOrigStream, - const uno::Reference< io::XTruncate >& xOrigTruncate, - const uno::Reference< io::XSeekable >& xOrigSeekable, - const uno::Reference< io::XInputStream >& xOrigInStream, - const uno::Reference< io::XOutputStream >& xOrigOutStream ) - : m_xFileAccess( xFileAccess ) - , m_bDelete( bDelete ) - , m_aURL( aURL ) - , m_xOrigStream( xOrigStream ) - , m_xOrigTruncate( xOrigTruncate ) - , m_xOrigSeekable( xOrigSeekable ) - , m_xOrigInStream( xOrigInStream ) - , m_xOrigOutStream( xOrigOutStream ) - , m_bInOpen( sal_False ) - , m_bOutOpen( sal_False ) - , m_bPostponedTruncate( sal_True ) - {} - - void NoPostponing() - { - m_bDelete = sal_False; - m_bPostponedTruncate = sal_False; - } -}; - -// ======================================================================== -// ------------------------------------------------------------------------ -OPostponedTruncationFileStream::OPostponedTruncationFileStream( - const ::rtl::OUString& aURL, - const uno::Reference< lang::XMultiServiceFactory >& /*xFactory*/, - const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess, - const uno::Reference< io::XStream >& xOrigStream, - sal_Bool bDelete ) -: m_pStreamData( NULL ) -{ - if ( !xFileAccess.is() || !xOrigStream.is() ) - throw uno::RuntimeException(); - - uno::Reference< io::XTruncate > xOrigTruncate( xOrigStream, uno::UNO_QUERY_THROW ); - uno::Reference< io::XSeekable > xOrigSeekable( xOrigStream, uno::UNO_QUERY_THROW ); - uno::Reference< io::XInputStream > xOrigInStream = xOrigStream->getInputStream(); - uno::Reference< io::XOutputStream > xOrigOutStream = xOrigStream->getOutputStream(); - if ( !xOrigInStream.is() || !xOrigOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData = new PTFStreamData_Impl( xFileAccess, bDelete, aURL, - xOrigStream, xOrigTruncate, xOrigSeekable, xOrigInStream, xOrigOutStream ); -} - -// ------------------------------------------------------------------------ -OPostponedTruncationFileStream::~OPostponedTruncationFileStream() -{ - CloseAll_Impl(); -} - -// ------------------------------------------------------------------------ -void OPostponedTruncationFileStream::CloseAll_Impl() -{ - if ( m_pStreamData ) - { - sal_Bool bDelete = m_pStreamData->m_bDelete; - ::rtl::OUString aURL = m_pStreamData->m_aURL; - uno::Reference< ucb::XSimpleFileAccess > xFileAccess = m_pStreamData->m_xFileAccess; - - delete m_pStreamData; - m_pStreamData = NULL; - - if ( bDelete && xFileAccess.is() && aURL.getLength() ) - { - // delete the file - try - { - xFileAccess->kill( aURL ); - } catch( uno::Exception& ) - { - OSL_ENSURE( sal_False, "Could not remove the file!" ); - } - } - } -} - -// ------------------------------------------------------------------------ -void OPostponedTruncationFileStream::CheckScheduledTruncation_Impl() -{ - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigTruncate.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigTruncate->truncate(); - m_pStreamData->NoPostponing(); - } -} - -// com::sun::star::io::XStream -// ------------------------------------------------------------------------ -uno::Reference< io::XInputStream > SAL_CALL OPostponedTruncationFileStream::getInputStream( ) - throw (uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( m_pStreamData ) - m_pStreamData->m_bInOpen = sal_True; - return static_cast< io::XInputStream* >( this ); -} - - -// ------------------------------------------------------------------------ -uno::Reference< io::XOutputStream > SAL_CALL OPostponedTruncationFileStream::getOutputStream( ) - throw (uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( m_pStreamData ) - m_pStreamData->m_bOutOpen = sal_True; - return static_cast< io::XOutputStream* >( this ); -} - - - -// com::sun::star::io::XInputStream -// ------------------------------------------------------------------------ -::sal_Int32 SAL_CALL OPostponedTruncationFileStream::readBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - // the stream must behave as truncated one - aData.realloc( 0 ); - return 0; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigInStream->readBytes( aData, nBytesToRead ); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int32 SAL_CALL OPostponedTruncationFileStream::readSomeBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - // the stream must behave as truncated one - aData.realloc( 0 ); - return 0; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigInStream->readBytes( aData, nMaxBytesToRead ); - } -} - -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::skipBytes( ::sal_Int32 nBytesToSkip ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - // the stream must behave as truncated one - if ( nBytesToSkip > 0 ) - throw io::BufferSizeExceededException(); - - return; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigInStream->skipBytes( nBytesToSkip ); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int32 SAL_CALL OPostponedTruncationFileStream::available( ) - throw (io::NotConnectedException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - // the stream must behave as truncated one - return 0; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigInStream->available(); - } -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::closeInput() - throw (io::NotConnectedException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - m_pStreamData->m_bInOpen = sal_False; - if ( !m_pStreamData->m_bOutOpen ) - CloseAll_Impl(); -} - - - -// com::sun::star::io::XOutputStream -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::writeBytes( const uno::Sequence< ::sal_Int8 >& aData ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - // writing method must check the truncation - CheckScheduledTruncation_Impl(); - - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigOutStream->writeBytes( aData ); -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::flush( ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - { - OSL_ENSURE( sal_False, "flush() call on closed stream!\n" ); - return; - // in future throw exception, for now some code might call flush() on closed stream - // since file ucp implementation allows it - // throw io::NotConnectedException(); - } - - if ( m_pStreamData->m_bPostponedTruncate ) - { - // it is no writing call, thus must be ignored - return; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigOutStream->flush(); - } -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::closeOutput( ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - m_pStreamData->m_bOutOpen = sal_False; - if ( !m_pStreamData->m_bInOpen ) - CloseAll_Impl(); -} - - - -// com::sun::star::io::XTruncate -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::truncate( ) - throw (io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - // the truncation is already scheduled, ignore - return; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigTruncate.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigTruncate->truncate(); - } -} - - - -// com::sun::star::io::XSeekable -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::seek( ::sal_Int64 location ) - throw (lang::IllegalArgumentException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - if ( location > 0 ) - throw lang::IllegalArgumentException(); - - return; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigSeekable.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigSeekable->seek( location ); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int64 SAL_CALL OPostponedTruncationFileStream::getPosition( ) - throw (io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - return 0; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigSeekable.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigSeekable->getPosition(); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int64 SAL_CALL OPostponedTruncationFileStream::getLength( ) - throw (io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - { - return 0; - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigSeekable.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigSeekable->getLength(); - } -} - -// ------------------------------------------------------------------------ -void SAL_CALL OPostponedTruncationFileStream::waitForCompletion() - throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) -{ - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bPostponedTruncate ) - return; - - uno::Reference< io::XAsyncOutputMonitor > asyncOutputMonitor( m_pStreamData->m_xOrigOutStream, uno::UNO_QUERY ); - if ( asyncOutputMonitor.is() ) - asyncOutputMonitor->waitForCompletion(); -} - diff --git a/sfx2/source/doc/opostponedtruncationstream.hxx b/sfx2/source/doc/opostponedtruncationstream.hxx deleted file mode 100644 index ce60cdf2e0..0000000000 --- a/sfx2/source/doc/opostponedtruncationstream.hxx +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX -#define _SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "sfx2/dllapi.h" - -//================================================================== -// OPostponedTruncationFileStream -// -// Allows to get stream access to a file, where the first truncation -// of the file is postponed till the first writing. If no writing happens -// after the first truncation/creation, it has no effect. ( The postponing of -// the creation can be switched off during initialization. Here the postponing -// of the creation means that the file will be created immediatelly, but -// if nothing is written into it, it will be removed during destruction -// of the object. ) -// -// On creation of this object the target file is scheduled for -// creation/truncation. But the action happens only during the first -// write access. After the first write access the object behaves -// itself as the original stream. -//================================================================== - -struct PTFStreamData_Impl; -class SFX2_DLLPUBLIC OPostponedTruncationFileStream - : public ::cppu::WeakImplHelper6 < - ::com::sun::star::io::XStream, - ::com::sun::star::io::XInputStream, - ::com::sun::star::io::XOutputStream, - ::com::sun::star::io::XTruncate, - ::com::sun::star::io::XSeekable, - ::com::sun::star::io::XAsyncOutputMonitor > -{ - ::osl::Mutex m_aMutex; - PTFStreamData_Impl* m_pStreamData; - - void CloseAll_Impl(); - - void CheckScheduledTruncation_Impl(); - -public: - - OPostponedTruncationFileStream( - const ::rtl::OUString& aURL, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, - const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess, - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream, - sal_Bool bDelete ); - - ~OPostponedTruncationFileStream(); - -// com::sun::star::io::XStream - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XInputStream - virtual ::sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XOutputStream - virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XTruncate - virtual void SAL_CALL truncate( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XSeekable - virtual void SAL_CALL seek( ::sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// ::com::sun::star::io::XAsyncOutputMonitor - virtual void SAL_CALL waitForCompletion( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -}; - -#endif //_SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX - - -- cgit v1.2.3 From 0ba8b3fd37a4bbbb9f5f511e2df6572d88258e4b Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 12 Mar 2010 07:49:50 +0100 Subject: dtardon02: #i18507# revert errorneously removed file --- svx/source/form/typemap.cxx | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 svx/source/form/typemap.cxx diff --git a/svx/source/form/typemap.cxx b/svx/source/form/typemap.cxx new file mode 100644 index 0000000000..ae2d45ca76 --- /dev/null +++ b/svx/source/form/typemap.cxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svx.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _SVX_CLIPBOARDCTL_HXX_ +#include "clipfmtitem.hxx" +#endif +#include +#include "editeng/fontitem.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _SVX_EMPHITEM_HXX +#include +#endif + +#include +#define SFX_TYPEMAP +#include "svxslots.hxx" + -- cgit v1.2.3 From 420945aa028d6bd5044b815ffa4d760a8579f442 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 12 Mar 2010 13:16:09 +0100 Subject: dtardon02: #i108503# #i108505# #i108507# #i108508# #i110035# clean up makefiles and #includes --- sfx2/source/doc/docfile.cxx | 1 - sfx2/source/doc/makefile.mk | 1 - svx/source/engine3d/makefile.mk | 2 -- svx/source/svdraw/makefile.mk | 2 -- svx/source/svdraw/svdobj.cxx | 1 - svx/source/svdraw/svdotext.cxx | 1 - 6 files changed, 8 deletions(-) diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index df9477c489..b5a18abacb 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -133,7 +133,6 @@ using namespace ::com::sun::star::io; #include #include -#include "opostponedtruncationstream.hxx" #include "helper.hxx" #include // SFX_ITEMSET_SET #include // GetFilterMatcher diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk index 7da456ebaa..b766921e34 100644 --- a/sfx2/source/doc/makefile.mk +++ b/sfx2/source/doc/makefile.mk @@ -75,7 +75,6 @@ SLOFILES = \ $(SLO)$/objembed.obj\ $(SLO)$/graphhelp.obj \ $(SLO)$/QuerySaveDocument.obj \ - $(SLO)$/opostponedtruncationstream.obj \ $(SLO)$/docinsert.obj \ $(SLO)$/docmacromode.obj \ $(SLO)$/SfxDocumentMetaData.obj \ diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk index 6e6e3f97c5..308b130e2b 100644 --- a/svx/source/engine3d/makefile.mk +++ b/svx/source/engine3d/makefile.mk @@ -64,8 +64,6 @@ LIB1OBJFILES= \ LIB2TARGET= $(SLB)$/$(TARGET).lib LIB2OBJFILES= \ - $(SLO)$/volume3d.obj \ - $(SLO)$/viewpt3d.obj \ $(SLO)$/float3d.obj SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk index 0108615b10..514c5b6d2c 100644 --- a/svx/source/svdraw/makefile.mk +++ b/svx/source/svdraw/makefile.mk @@ -113,8 +113,6 @@ LIB1OBJFILES= \ LIB2TARGET= $(SLB)$/$(TARGET).lib LIB2OBJFILES= \ - $(SLO)$/svdoimp.obj \ - $(SLO)$/svdscrol.obj \ $(SLO)$/ActionDescriptionProvider.obj \ $(SLO)$/impgrfll.obj diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index bcf81b91ef..381fdca5f8 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -47,7 +47,6 @@ #include #include // Fuer Add/Del Ref #include // fuer Dragging (Ortho abfragen) -#include "svdscrol.hxx" #include "svdglob.hxx" // StringCache #include "svdstr.hrc" // Objektname #include // Factory diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 173abeba43..b65bde818f 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -35,7 +35,6 @@ #include // und fuer AnimationHandler (Laufschrift) #include #include -#include "svdscrol.hxx" // fuer Laufschrift #include // OutlinerDefaults #include "svdglob.hxx" // Stringcache #include "svdstr.hrc" // Objektname -- cgit v1.2.3 From 2e36efaa2acaad647bcf4fd8c2aa452a56781134 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 13 Mar 2010 17:55:47 +0100 Subject: dtardon02: #i108507# remove windows-specific bits --- svx/source/engine3d/makefile.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk index 308b130e2b..71916df4a8 100644 --- a/svx/source/engine3d/makefile.mk +++ b/svx/source/engine3d/makefile.mk @@ -68,12 +68,6 @@ LIB2OBJFILES= \ SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) -#disable optimizer for MSCompiler and ICC -.IF "$(COM)"=="ICC" || "$(COM)"=="MSC" -NOOPTFILES=\ - $(SLO)$/viewpt3d.obj -.ENDIF - SRS1NAME=engine3d SRC1FILES=\ string3d.src \ -- cgit v1.2.3 From 629d81e637451e914888cc766c36c2ce0c10b2db Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 17 Mar 2010 17:42:25 +0100 Subject: impress187 #i109515# avoid styles from other ItemPools --- svx/source/sdr/properties/attributeproperties.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 2bc06ea473..8c97ea69bd 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -281,7 +281,19 @@ namespace sdr // set stylesheet (if used) if(pStySheet) { - ImpAddStyleSheet(pStySheet, sal_True); + // #i109515# + SfxItemPool* pStyleSheetPool = &pStySheet->GetPool().GetPool(); + + if(pStyleSheetPool == pDestPool) + { + // just re-set stylesheet + ImpAddStyleSheet(pStySheet, sal_True); + } + else + { + // StyleSheet is NOT from the correct pool; use default + ImpAddStyleSheet(pNewModel->GetDefaultStyleSheet(), sal_True); + } } delete pOldSet; -- cgit v1.2.3 From e48a1dc5f61ed71dc741d7dfccacbfe95fbe1c89 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 18 Mar 2010 14:21:16 +0100 Subject: sw321bf01: #i109015# to not use the old base URL --- sfx2/source/doc/objstor.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 1181499f5c..902793af73 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2548,6 +2548,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) // is a new medium "from scratch", so no version should be stored into it SfxItemSet* pSet = new SfxAllItemSet(*pRetrMedium->GetItemSet()); pSet->ClearItem( SID_VERSION ); + pSet->ClearItem( SID_DOC_BASEURL ); // create a medium as a copy; this medium is only for writingm, because it uses the same name as the original one // writing is done through a copy, that will be transferred to the target ( of course after calling HandsOff ) @@ -2833,6 +2834,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl pMergedParams->ClearItem( SID_STREAM ); pMergedParams->ClearItem( SID_CONTENT ); pMergedParams->ClearItem( SID_DOC_READONLY ); + pMergedParams->ClearItem( SID_DOC_BASEURL ); pMergedParams->ClearItem( SID_REPAIRPACKAGE ); -- cgit v1.2.3 From 11f8f2f81ecd8b31f26fef92374bc6f593b28689 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 23 Mar 2010 14:51:17 +0100 Subject: sw321bf01: #i109363# Fix crash with quickstarter and OOo file dialogs --- .../filepicker/VistaFilePickerEventHandler.cxx | 40 +++++++++++----------- sfx2/source/appl/shutdownicon.cxx | 23 +++++++++++-- sfx2/source/appl/shutdownicon.hxx | 1 + 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx index 28d894799a..83cc631a7c 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx @@ -125,14 +125,14 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFileOk(IFileDialog* /*pDialog*/) } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* pDialog, - IShellItem* pFolder) +STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* /*pDialog*/, + IShellItem* /*pFolder*/) { return E_NOTIMPL; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* pDialog) +STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog*/) { impl_sendEvent(E_DIRECTORY_CHANGED, 0); return S_OK; @@ -250,7 +250,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog) } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog) +STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* /*pDialog*/) { impl_sendEvent(E_FILE_SELECTION_CHANGED, 0); //lcl_updateVersionListDirectly(pDialog); @@ -258,16 +258,16 @@ STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* pDialog , - IShellItem* pItem , - FDE_SHAREVIOLATION_RESPONSE* pResponse) +STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* /*pDialog*/ , + IShellItem* /*pItem*/ , + FDE_SHAREVIOLATION_RESPONSE* /*pResponse*/) { impl_sendEvent(E_CONTROL_STATE_CHANGED, css::ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog) +STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* /*pDialog*/) { /* IFileDialogCustomize *iCustomize; @@ -299,32 +299,32 @@ STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog) } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* pDialog , - IShellItem* pItem , - FDE_OVERWRITE_RESPONSE* pResponse) +STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* /*pDialog*/ , + IShellItem* /*pItem*/ , + FDE_OVERWRITE_RESPONSE* /*pResponse*/) { return E_NOTIMPL; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl , - DWORD nIDItem ) + DWORD /*nIDItem*/ ) { - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl )); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl ) { - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl)); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl , BOOL bChecked ) { @@ -353,15 +353,15 @@ STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustom if (nIDCtl == css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) m_pInternalNotify->onAutoExtensionChanged(bChecked); - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl)); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl ) { - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl)); return S_OK; } diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 5eb2d3df79..c65393b8e4 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -33,6 +33,7 @@ #include #include #include +#include // #include #include #include @@ -235,6 +236,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) : ShutdownIconServiceBase( m_aMutex ), m_bVeto ( false ), m_bListenForTermination ( false ), + m_bSystemDialogs( false ), m_pResMgr( NULL ), m_pFileDlg( NULL ), m_xServiceManager( aSMgr ), @@ -243,6 +245,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) : m_pPlugin( 0 ), m_bInitialized( false ) { + m_bSystemDialogs = SvtMiscOptions().UseSystemFileDialog(); } ShutdownIcon::~ShutdownIcon() @@ -376,6 +379,16 @@ void ShutdownIcon::StartFileDialog() { ::vos::OGuard aGuard( Application::GetSolarMutex() ); + bool bDirty = ( m_bSystemDialogs != static_cast(SvtMiscOptions().UseSystemFileDialog()) ); + + if ( m_pFileDlg && bDirty ) + { + // Destroy instance as changing the system file dialog setting + // forces us to create a new FileDialogHelper instance! + delete m_pFileDlg; + m_pFileDlg = NULL; + } + if ( !m_pFileDlg ) m_pFileDlg = new FileDialogHelper( WB_OPEN | SFXWB_MULTISELECTION, String() ); m_pFileDlg->StartExecuteModal( STATIC_LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) ); @@ -512,8 +525,14 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR #ifdef WNT // #103346 Destroy dialog to prevent problems with custom controls - delete pThis->m_pFileDlg; - pThis->m_pFileDlg = NULL; + // This fix is dependent on the dialog settings. Destroying the dialog here will + // crash the non-native dialog implementation! Therefore make this dependent on + // the settings. + if ( SvtMiscOptions().UseSystemFileDialog() ) + { + delete pThis->m_pFileDlg; + pThis->m_pFileDlg = NULL; + } #endif LeaveModalMode(); diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx index a1c836cbea..cc18016e33 100644 --- a/sfx2/source/appl/shutdownicon.hxx +++ b/sfx2/source/appl/shutdownicon.hxx @@ -52,6 +52,7 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase ::osl::Mutex m_aMutex; bool m_bVeto; bool m_bListenForTermination; + bool m_bSystemDialogs; ResMgr* m_pResMgr; sfx2::FileDialogHelper* m_pFileDlg; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; -- cgit v1.2.3 From de743a447c4ce490c70201cbd8d2f05445cfce1e Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 23 Mar 2010 16:09:02 +0100 Subject: sw321bf01: #i110216# handle FilterOptionsRequest iin the quiet InteractionHandler correctly --- framework/source/interaction/quietinteraction.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/framework/source/interaction/quietinteraction.cxx b/framework/source/interaction/quietinteraction.cxx index 81fc2ec39c..14357a8d13 100644 --- a/framework/source/interaction/quietinteraction.cxx +++ b/framework/source/interaction/quietinteraction.cxx @@ -44,7 +44,9 @@ #include #include #include +#include #include +#include #include #ifndef _COM_SUN_STAR_DOCUMENT_LOCKEDDOCUMENTREQUEST_HPP_ @@ -111,6 +113,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI css::uno::Reference< css::task::XInteractionAbort > xAbort ; css::uno::Reference< css::task::XInteractionApprove > xApprove ; css::uno::Reference< css::document::XInteractionFilterSelect > xFilter ; + css::uno::Reference< css::document::XInteractionFilterOptions > xFOptions ; sal_Int32 nCount=lContinuations.getLength(); for (sal_Int32 i=0; i( lContinuations[i], css::uno::UNO_QUERY ); + + if ( ! xFOptions.is() ) + xFOptions = css::uno::Reference< css::document::XInteractionFilterOptions >( lContinuations[i], css::uno::UNO_QUERY ); } // differ between abortable interactions (error, unknown filter ...) @@ -130,6 +136,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI css::task::ErrorCodeRequest aErrorCodeRequest ; css::document::AmbigousFilterRequest aAmbigousFilterRequest; css::document::LockedDocumentRequest aLockedDocumentRequest; + css::document::FilterOptionsRequest aFilterOptionsRequest; if (aRequest>>=aAmbigousFilterRequest) { @@ -163,6 +170,15 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI xAbort->select(); } else + if (aRequest>>=aFilterOptionsRequest) + { + if (xFOptions.is()) + { + // let the default filter options be used + xFOptions->select(); + } + } + else if (xAbort.is()) xAbort->select(); } -- cgit v1.2.3 From 7b920a9a7167c7db23fea4eccd851c5888540f9a Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 24 Mar 2010 15:31:56 +0100 Subject: sw321bf01: #i109592# Fix wrong keyboard shortcuts for Spanish --- .../data/org/openoffice/Office/Accelerators.xcu | 71 +++++++++++++++++++++- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 5067e500af..c197b77231 100755 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -394,6 +394,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:AlignBlock .uno:Bold + .uno:SearchDialog @@ -459,6 +460,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:AlignHorizontalCenter + .uno:SelectAll @@ -828,6 +830,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -988,6 +991,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -1023,6 +1027,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -1228,6 +1233,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -1336,6 +1342,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -1421,6 +1428,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -1835,6 +1843,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -1931,6 +1940,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -1971,6 +1981,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -2201,6 +2212,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -2361,6 +2373,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -2446,6 +2459,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -2860,6 +2874,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -2973,6 +2988,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -3063,6 +3079,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -3497,6 +3514,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -3595,6 +3613,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -3680,6 +3699,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -4094,6 +4114,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -4197,6 +4218,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -4254,7 +4276,7 @@ .uno:ParaRightToLeft - + I10N SHORTCUTS - NO TRANSLATE .uno:GoToEndOfLine @@ -4282,6 +4304,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -4696,6 +4719,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -4804,6 +4828,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:JustifyPara .uno:Bold + .uno:SearchDialog @@ -4889,6 +4914,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:CenterPara + .uno:SelectAll @@ -5303,6 +5329,7 @@ I10N SHORTCUTS - NO TRANSLATE .uno:Underline + .uno:AddDirect @@ -5541,7 +5568,19 @@ .uno:Paste - + + + I10N SHORTCUTS - NO TRANSLATE + .uno:Italic + + + + + I10N SHORTCUTS - NO TRANSLATE + .uno:Bold + + + I10N SHORTCUTS - NO TRANSLATE .uno:Open @@ -5615,7 +5654,19 @@ .uno:Paste - + + + I10N SHORTCUTS - NO TRANSLATE + .uno:Italic + + + + + I10N SHORTCUTS - NO TRANSLATE + .uno:Bold + + + I10N SHORTCUTS - NO TRANSLATE .uno:Open @@ -5625,6 +5676,20 @@ .uno:Paste + + + I10N SHORTCUTS - NO TRANSLATE + .uno:Underline + + + + + I10N SHORTCUTS - NO TRANSLATE + .uno:SubScript + .uno:AlignHorizontalCenter + .uno:DesignerDialog + + I10N SHORTCUTS - NO TRANSLATE .uno:Undo -- cgit v1.2.3 From 9b879666e654a7fc49e652b00e298b57731ba929 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 29 Mar 2010 14:45:13 +0200 Subject: sw321bf01: #i110187#: xmloff: do not export grddl attribute in ODF < 1.2 --- xmloff/source/core/xmlexp.cxx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 3c4735400d..a87141adf2 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1314,6 +1314,23 @@ void SvXMLExport::SetBodyAttributes() { } +static void +lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode) +{ + // check version >= 1.2 + switch (rExport.getDefaultVersion()) { + case SvtSaveOptions::ODFVER_011: // fall thru + case SvtSaveOptions::ODFVER_010: return; + default: break; + } + + if (EXPORT_SETTINGS != nExportMode) // meta, content, styles + { + rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION, + OUString::createFromAscii(s_grddl_xsl) ); + } +} + sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) { bool bOwnGraphicResolver = false; @@ -1449,11 +1466,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) enum XMLTokenEnum eRootService = XML_TOKEN_INVALID; const sal_Int32 nExportMode = mnExportFlags & (EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS); - if ( EXPORT_SETTINGS != nExportMode ) // meta, content, styles - { - AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION, - OUString::createFromAscii(s_grddl_xsl) ); - } + lcl_AddGrddl(*this, nExportMode); if( EXPORT_META == nExportMode ) { -- cgit v1.2.3 From a5955b4d0d2846aa79bd8eee8bc6cbebd549b567 Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Tue, 19 Jan 2010 09:10:33 +0000 Subject: #i108375#: when searching the control belonging to a control model, ask the SdrUnoObj. This will ensure the control is actually created when it does not yet exist. --- svx/source/form/fmshimp.cxx | 104 +++++++++++++++++++++++++++++--------------- svx/source/inc/fmshimp.hxx | 8 +++- 2 files changed, 74 insertions(+), 38 deletions(-) diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index d4028a3b18..62d76467c0 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1579,22 +1579,25 @@ void FmXFormShell::ExecuteSearch() return; // filter out the forms which do not contain valid controls at all - FmFormArray::reverse_iterator form = m_aSearchForms.rbegin(); - ::std::vector< String >::reverse_iterator contextName = aContextNames.rbegin(); - sal_Int32 i = m_aSearchForms.size(); - for ( ; - form != m_aSearchForms.rend(); - ++form, ++contextName, --i - ) { - FmSearchContext aTestContext; - aTestContext.nContext = static_cast< sal_Int16 >( i-1 ); - sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext ); - if ( nValidControls == 0 ) + FmFormArray aValidForms; + ::std::vector< String > aValidContexts; + FmFormArray::const_iterator form = m_aSearchForms.begin(); + ::std::vector< String >::const_iterator contextName = aContextNames.begin(); + for ( ; form != m_aSearchForms.end(); ++form, ++contextName ) { - m_aSearchForms.erase( form.base() - 1 ); - aContextNames.erase( contextName.base() - 1 ); + FmSearchContext aTestContext; + aTestContext.nContext = static_cast< sal_Int16 >( form - m_aSearchForms.begin() ); + sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext ); + if ( nValidControls > 0 ) + { + aValidForms.push_back( *form ); + aValidContexts.push_back( *contextName ); + } } + + m_aSearchForms.swap( aValidForms ); + aContextNames.swap( aValidContexts ); } if (m_aSearchForms.size() == 0) @@ -1606,7 +1609,7 @@ void FmXFormShell::ExecuteSearch() // jetzt brauche ich noch einen 'initial context' sal_Int16 nInitialContext = 0; Reference< XForm> xActiveForm( getActiveForm()); - for (i=0; i<(sal_Int32)m_aSearchForms.size(); ++i) + for ( size_t i=0; i<(sal_Int32)m_aSearchForms.size(); ++i ) { if (m_aSearchForms.at(i) == xActiveForm) { @@ -2373,6 +2376,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) FmFormObj* pFormObject = FmFormObj::GetFormObject( pObject ); Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() ); DBG_ASSERT( xControlModel.is(), "FmXFormShell::OnFoundData: invalid control!" ); + if ( !xControlModel.is() ) + return 0; // disable the permanent cursor for the last grid we found a record if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel)) @@ -2390,7 +2395,7 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) sal_Int32 nGridColumn = m_arrRelativeGridColumn.GetObject(pfriWhere->nFieldPos); if (nGridColumn != -1) { // dummer weise muss ich mir das Control erst wieder besorgen - Reference< XControl> xControl( GetControlFromModel(xControlModel)); + Reference< XControl> xControl( impl_getControl( xControlModel, *pFormObject ) ); Reference< XGrid> xGrid(xControl, UNO_QUERY); DBG_ASSERT(xGrid.is(), "FmXFormShell::OnFoundData : ungueltiges Control !"); // wenn eine der Asserts anschlaegt, habe ich beim Aufbauen von m_arrSearchedControls wohl was falsch gemacht @@ -2402,7 +2407,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) xModelSet->setPropertyValue( FM_PROP_CURSORCOLOR, makeAny( sal_Int32( COL_LIGHTRED ) ) ); m_xLastGridFound = xControlModel; - xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn); + if ( xGrid.is() ) + xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn); } // als der Cursor neu positioniert wurde, habe ich (in positioned) meine Formularleisten-Slots invalidiert, aber das greift @@ -2510,7 +2516,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn // ... nach der ControlSource-Eigenschaft fragen SearchableControlIterator iter( xCurrentFormComponent ); - Reference< XControl> xControlBehindModel; + Reference< XControl> xControl; // das Control, das als Model xControlModel hat // (das folgende while kann mehrmals durchlaufen werden, ohne dass das Control sich aendert, dann muss // ich nicht jedesmal neu suchen) @@ -2522,10 +2528,12 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn if ( sControlSource.getLength() == 0 ) { // das aktuelle Element hat keine ControlSource, also ist es ein GridControl (das ist das einzige, was // der SearchableControlIterator noch zulaesst) - xControlBehindModel = GetControlFromModel(xControlModel); - DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); + xControl = impl_getControl( xControlModel, *pFormObject ); + DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); - Reference< XGridPeer> xGridPeer(xControlBehindModel->getPeer(), UNO_QUERY); + Reference< XGridPeer> xGridPeer; + if ( xControl.is() ) + xGridPeer.set( xControl->getPeer(), UNO_QUERY ); do { if (!xGridPeer.is()) @@ -2579,13 +2587,13 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn if (sControlSource.getLength() && xValidFormFields->hasByName(sControlSource)) { // jetzt brauche ich das Control zum SdrObject - if (!xControlBehindModel.is()) + if (!xControl.is()) { - xControlBehindModel = GetControlFromModel(xControlModel); - DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); + xControl = impl_getControl( xControlModel, *pFormObject ); + DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); } - if (IsSearchableControl(xControlBehindModel)) + if (IsSearchableControl(xControl)) { // alle Tests ueberstanden -> in die Liste mit aufnehmen strFieldList += sControlSource.getStr(); strFieldList += ';'; @@ -2601,7 +2609,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn m_arrRelativeGridColumn.Insert(-1, m_arrRelativeGridColumn.Count()); // und fuer die formatierte Suche ... - pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControlBehindModel, UNO_QUERY)); + pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControl, UNO_QUERY)); } } } @@ -2975,24 +2983,48 @@ void FmXFormShell::SetDesignMode(sal_Bool bDesign) } //------------------------------------------------------------------------------ -Reference< XControl> FmXFormShell::GetControlFromModel(const Reference< XControlModel>& xModel) +Reference< XControl> FmXFormShell::impl_getControl( const Reference< XControlModel >& i_rxModel, const FmFormObj& i_rKnownFormObj ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetControlFromModel" ); if ( impl_checkDisposed() ) return NULL; - Reference< XControlContainer> xControlContainer( getControlContainerForView() ); + Reference< XControl > xControl; + try + { + Reference< XControlContainer> xControlContainer( getControlContainerForView(), UNO_SET_THROW ); - Sequence< Reference< XControl> > seqControls( xControlContainer->getControls() ); - Reference< XControl>* pControls = seqControls.getArray(); - // ... die ich dann durchsuchen kann - for (int i=0; i > seqControls( xControlContainer->getControls() ); + const Reference< XControl >* pControls = seqControls.getArray(); + // ... die ich dann durchsuchen kann + for (sal_Int32 i=0; i xCurrentModel( xControl->getModel() ); + if ( xCurrentModel == i_rxModel ) + break; + xControl.clear(); + } + + if ( !xControl.is() ) + { + // fallabck (some controls might not have been created, yet, since they were never visible so far) + Reference< XControl > xContainerControl( xControlContainer, UNO_QUERY_THROW ); + const Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerControl->getPeer() ); + ENSURE_OR_THROW( pContainerWindow, "unexpected control container implementation" ); + + const SdrView* pSdrView = m_pShell ? m_pShell->GetFormView() : NULL; + ENSURE_OR_THROW( pSdrView, "no current view" ); + + xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow ), UNO_QUERY_THROW ); + } + } + catch( const Exception& ) { - Reference< XControlModel> xSearchLoopModel( pControls[i]->getModel()); - if ((XControlModel*)xSearchLoopModel.get() == (XControlModel*)xModel.get()) - return pControls[i]; + DBG_UNHANDLED_EXCEPTION(); } - return Reference< XControl>(NULL); + + OSL_ENSURE( xControl.is(), "FmXFormShell::impl_getControl: no control found!" ); + return xControl; } //------------------------------------------------------------------------------ diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 957d737a1b..ef38edc7e8 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -163,6 +163,7 @@ typedef ::utl::ConfigItem FmXFormShell_CFGBASE; struct SdrViewEvent; class FmFormShell; class FmFormView; +class FmFormObj; class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE ,public FmXFormShell_CFGBASE ,public ::svxform::OStaticDataAccessTools @@ -349,8 +350,11 @@ protected: void startListening(); void stopListening(); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl> GetControlFromModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& xModel); - // liefert das Control, welches das angegebene Model hat + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > + impl_getControl( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& i_rxModel, + const FmFormObj& i_rKnownFormObj + ); // sammelt in strNames die Namen aller Formulare static void impl_collectFormSearchContexts_nothrow( -- cgit v1.2.3 From a9ae6810250e0ebc835d321c563b5aa7f878cba2 Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Wed, 20 Jan 2010 18:45:26 +0000 Subject: reverting the fix for #i108325#, which caused #i108423#. Adding another, less invasive workaround. Still not the final solution, which is covered by issue 108357 --- svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 3b53a9c543..955aed7001 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -237,6 +237,8 @@ namespace sdr { namespace contact { void invalidate() const; + void invalidate() const; + public: inline const Reference< XControl >& getControl() const { return m_xControl; } }; @@ -305,6 +307,15 @@ namespace sdr { namespace contact { pWindow->Invalidate(); } + //-------------------------------------------------------------------- + void ControlHolder::invalidate() const + { + Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() ); + OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" ); + if ( pWindow ) + pWindow->Invalidate(); + } + //-------------------------------------------------------------------- ::basegfx::B2DVector ControlHolder::getZoom() const { @@ -1686,6 +1697,9 @@ namespace sdr { namespace contact { Reference< XControlModel > xControlModel( rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel() ); const ControlHolder& rControl( m_pVOCImpl->getExistentControl() ); + if ( !bHadControl && rControl.is() && rControl.isVisible() ) + rControl.invalidate(); + if ( !bHadControl && rControl.is() && rControl.isVisible() ) rControl.invalidate(); -- cgit v1.2.3 From 1ef82dae599b49590a8398abc662f36855750e19 Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Wed, 20 Jan 2010 19:31:43 +0000 Subject: #i10000# --- svx/source/form/fmshimp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 62d76467c0..29beb4d637 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1609,7 +1609,7 @@ void FmXFormShell::ExecuteSearch() // jetzt brauche ich noch einen 'initial context' sal_Int16 nInitialContext = 0; Reference< XForm> xActiveForm( getActiveForm()); - for ( size_t i=0; i<(sal_Int32)m_aSearchForms.size(); ++i ) + for ( size_t i=0; i Date: Fri, 26 Mar 2010 16:18:10 +0100 Subject: o5oo branding of startcenter - transplanted from 3b0a27115246@native0 --- framework/inc/framework.hrc | 1 + framework/source/services/backingwindow.cxx | 184 +++++++++++++++------ framework/source/services/backingwindow.hxx | 4 +- framework/source/services/fwk_services.src | 4 + .../registry/data/org/openoffice/Office/Common.xcu | 3 + .../schema/org/openoffice/Office/Common.xcs | 6 + 6 files changed, 148 insertions(+), 54 deletions(-) diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc index 5d52eed36b..d4037ea26a 100644 --- a/framework/inc/framework.hrc +++ b/framework/inc/framework.hrc @@ -67,6 +67,7 @@ #define STR_BACKING_INFOHELP 19 #define BMP_BACKING_TPLREP 20 #define STR_BACKING_TPLREP 21 +#define BMP_BACKING_FOLDER 22 #define RES_BACKING_IMAGES (DLG_BACKING+1) #define RES_BACKING_IMAGES_HC (DLG_BACKING+2) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 290b4cebc4..39f3910382 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -140,10 +140,37 @@ BackingWindow::BackingWindow( Window* i_pParent ) : maTemplateString( FwkResId( STR_BACKING_TEMPLATE ) ), maButtonImageSize( 10, 10 ), mbInitControls( false ), - mpAccExec( NULL ) + mnLayoutStyle( 0 ), + mpAccExec( NULL ), + mnBtnPos( 240 ) { mnColumnWidth[0] = mnColumnWidth[1] = 0; + try + { + Reference xConfig( comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_CFGPROVIDER),UNO_QUERY); + if( xConfig.is() ) + { + Sequence args(1); + PropertyValue val( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("nodepath") ), + 0, + Any(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/Help/StartCenter"))), + PropertyState_DIRECT_VALUE); + args.getArray()[0] <<= val; + Reference xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,args), UNO_QUERY); + if( xNameAccess.is() ) + { + //throws css::container::NoSuchElementException, css::lang::WrappedTargetException + Any value( xNameAccess->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartCenterLayoutStyle"))) ); + mnLayoutStyle = value.get(); + } + } + } + catch (Exception& ) + { + } + // get icon images from vcl resource and set them on the appropriate buttons loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton ); loadImage( FwkResId( BMP_BACKING_CALC ), maCalcButton ); @@ -151,8 +178,16 @@ BackingWindow::BackingWindow( Window* i_pParent ) : loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton ); loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton ); loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton ); - loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton ); - loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton ); + if( mnLayoutStyle == 1 ) + { + loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton ); + loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton ); + } + else + { + loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton ); + loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton ); + } BitmapEx aExtImage( FwkResId( BMP_BACKING_EXT ) ); String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) ); @@ -309,6 +344,9 @@ void BackingWindow::initBackground() maTemplateText.SetControlBackground( aTextBGColor ); maOpenText.SetControlForeground( maLabelTextColor ); maOpenText.SetControlBackground( aTextBGColor ); + + if( mnLayoutStyle == 1 ) + mnBtnPos = maBackgroundLeft.GetSizePixel().Width(); } void BackingWindow::initControls() @@ -344,8 +382,8 @@ void BackingWindow::initControls() nYPos += (maWelcomeSize.Height()*3)/2; - if( maControlRect.GetWidth() < nBtnPos + maWelcomeSize.Width() + 20 ) - maControlRect.Right() = maControlRect.Left() + maWelcomeSize.Width() + nBtnPos + 20; + if( maControlRect.GetWidth() < mnBtnPos + maWelcomeSize.Width() + 20 ) + maControlRect.Right() = maControlRect.Left() + maWelcomeSize.Width() + mnBtnPos + 20; maWelcome.Show(); @@ -365,8 +403,8 @@ void BackingWindow::initControls() maProductSize = Size( maProduct.GetTextWidth( maProductString ), maProduct.GetTextHeight() ); maProductSize.Width() = (maProductSize.Width() * 20)/19; - if( maControlRect.GetWidth() < maProductSize.Width() + nBtnPos + 10 ) - maControlRect.Right() = maControlRect.Left() + maProductSize.Width() + nBtnPos + 10; + if( maControlRect.GetWidth() < maProductSize.Width() + mnBtnPos + 10 ) + maControlRect.Right() = maControlRect.Left() + maProductSize.Width() + mnBtnPos + 10; maProduct.Show(); @@ -376,13 +414,16 @@ void BackingWindow::initControls() maTextFont.SetSize( Size( 0, 11 ) ); maTextFont.SetWeight( WEIGHT_NORMAL ); - maCreateText.SetText( maCreateString ); - maCreateText.SetFont( maTextFont ); - maCreateText.SetControlFont( maTextFont ); - maCreateSize = Size( maCreateText.GetTextWidth( maCreateString ), maCreateText.GetTextHeight() ); - maCreateText.Show(); - - nYPos += (maCreateSize.Height()*3)/2; + if( mnLayoutStyle == 0 ) + { + maCreateText.SetText( maCreateString ); + maCreateText.SetFont( maTextFont ); + maCreateText.SetControlFont( maTextFont ); + maCreateSize = Size( maCreateText.GetTextWidth( maCreateString ), maCreateText.GetTextHeight() ); + maCreateText.Show(); + + nYPos += (maCreateSize.Height()*3)/2; + } // collect the URLs of the entries in the File/New menu SvtModuleOptions aModuleOptions; @@ -445,22 +486,46 @@ void BackingWindow::initControls() maMathButton, maMathText, aMnemns ); nYPos += 3*maButtonImageSize.Height() / 2; - layoutButtonAndText( NULL, -1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maTemplateButton, maTemplateText, aMnemns, maTemplateString ); - - nYPos += 10; - layoutButtonAndText( NULL, -1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maOpenButton, maOpenText, aMnemns, maOpenString ); - nYPos += 10; + + if( mnLayoutStyle == 0 ) + { + layoutButtonAndText( NULL, -1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maTemplateButton, maTemplateText, aMnemns, maTemplateString ); + + nYPos += 10; + layoutButtonAndText( NULL, -1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maOpenButton, maOpenText, aMnemns, maOpenString ); + nYPos += 10; + } + else + { + layoutButtonAndText( NULL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maTemplateButton, maTemplateText, aMnemns, maTemplateString ); + layoutButtonAndText( NULL, 1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maOpenButton, maOpenText, aMnemns, maOpenString ); + nYPos += 10; + } DBG_ASSERT( nYPos < maControlRect.GetHeight(), "misformatting !" ); - if( mnColumnWidth[0] + mnColumnWidth[1] + nBtnPos + 20 > maControlRect.GetWidth() ) - maControlRect.Right() = maControlRect.Left() + mnColumnWidth[0] + mnColumnWidth[1] + nBtnPos + 20; + if( mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20 > maControlRect.GetWidth() ) + maControlRect.Right() = maControlRect.Left() + mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20; + + if( mnLayoutStyle == 1 ) + { + if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 ) + { + maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2; + mnColumnWidth[0] += (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20)/2; + } + } maToolbox.SetSelectHdl( LINK( this, BackingWindow, ToolboxHdl ) ); - maToolbox.Show(); + if( mnLayoutStyle == 0 ) + maToolbox.Show(); // scale middle map to formatted width Size aMiddleSegmentSize( maControlRect.GetSize().Width() + nShadowLeft + nShadowRight, @@ -637,47 +702,62 @@ void BackingWindow::Resize() long nYPos = maControlRect.Top(); nYPos += nW2Delta - nDiff; - maWelcome.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), - Size( maControlRect.GetWidth() - nBtnPos - 5, (maWelcomeSize.Height()*20)/19 ) ); + maWelcome.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), + Size( maControlRect.GetWidth() - mnBtnPos - 5, (maWelcomeSize.Height()*20)/19 ) ); nYPos += nWDelta - nDiff; - maProduct.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), Size( maControlRect.GetWidth() - nBtnPos - 5, (maProductSize.Height()*20)/19 ) ); + maProduct.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( maControlRect.GetWidth() - mnBtnPos - 5, (maProductSize.Height()*20)/19 ) ); nYPos += nPDelta - nDiff; - maCreateText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), - Size( maControlRect.GetWidth() - nBtnPos - 5, maCreateSize.Height() ) ); + maCreateText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), + Size( maControlRect.GetWidth() - mnBtnPos - 5, maCreateSize.Height() ) ); - nYPos += nCDelta - nDiff; + if( mnLayoutStyle == 0 ) + nYPos += nCDelta - nDiff; + else + nYPos += nWDelta/2 - nDiff; - maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize ); - maWriterText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ), + maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); + maWriterText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); - maCalcText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), + maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); + maCalcText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize ); - maImpressText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ), + maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); + maImpressText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); - maDrawText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), + maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); + maDrawText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maDBButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize ); - maDBText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ), + maDBButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); + maDBText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - maMathButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); - maMathText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), + maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); + maMathText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); nYPos += nB2Delta - nDiff; - maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize ); - maTemplateText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - nYPos += nBDelta - nDiff; - maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize ); - maOpenText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - nYPos += nBDelta - nDiff; + if( mnLayoutStyle == 0 ) + { + maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); + maTemplateText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), + Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + nYPos += nBDelta - nDiff; + maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); + maOpenText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), + Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + nYPos += nBDelta - nDiff; + } + else + { + maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); + maTemplateText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), + Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); + maOpenText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), + Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + } } IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index c617b5321d..c066cd078d 100644 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx @@ -127,10 +127,10 @@ namespace framework Size maButtonImageSize; bool mbInitControls; + sal_Int32 mnLayoutStyle; svt::AcceleratorExecute* mpAccExec; + long mnBtnPos; - - static const long nBtnPos = 240; static const int nItemId_Extensions = 1; static const int nItemId_Reg = 2; static const int nItemId_Info = 3; diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src index 1401e3c13e..3a8793e768 100644 --- a/framework/source/services/fwk_services.src +++ b/framework/source/services/fwk_services.src @@ -85,6 +85,10 @@ Window DLG_BACKING { File = "template_32.png"; }; + Bitmap BMP_BACKING_FOLDER + { + File = "folder_32.png"; + }; Bitmap BMP_BACKING_EXT { File = "extension_plus_26.png"; diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index 0fd3f03949..722ed4df10 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -134,6 +134,9 @@ ${STARTCENTER_TEMPLREP_URL} + + ${STARTCENTER_LAYOUT_STYLE} + diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index cd95db59e0..a1e203a293 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -3551,6 +3551,12 @@ + + + Contains a number deciding the layout style of the start center + + 0 + -- cgit v1.2.3 From 3733817142bddcb09616b71b24e26cbd567d70f0 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Tue, 26 Jan 2010 16:35:52 +0100 Subject: native0: #161561# rebrand links, exes and dlls --- desktop/util/ooverinfo.rc | 4 ++-- desktop/util/verinfo.rc | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc index b2fab36e41..28b1e0d4a8 100644 --- a/desktop/util/ooverinfo.rc +++ b/desktop/util/ooverinfo.rc @@ -69,7 +69,7 @@ VS_VERSION_INFO versioninfo value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" } #else block "040904E4" @@ -81,7 +81,7 @@ VS_VERSION_INFO versioninfo value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" } #endif } diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc index a9f3dcd3f4..d614935684 100644 --- a/desktop/util/verinfo.rc +++ b/desktop/util/verinfo.rc @@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo block "040704E4" { // German StringTable - value "CompanyName", "Sun Microsystems, Inc.\0" + value "CompanyName", "Oracle, Inc.\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" } #else block "040904E4" { // International StringTable - value "CompanyName", "Sun Microsystems, Inc.\0" + value "CompanyName", "Oracle, Inc.\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" } #endif } -- cgit v1.2.3 From e07b0d533b7956b5c7b9d1a75d0189da3ec9d915 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 27 Jan 2010 14:30:04 +0100 Subject: #161434# Support png and bmp intro/about images --- desktop/source/splash/splash.cxx | 38 ++++++++++++++++++++++++++++++++------ sfx2/source/dialog/about.cxx | 8 ++++++++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 226cc69503..fe297ea90b 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -446,8 +446,14 @@ bool SplashScreen::findBitmap(rtl::OUString const & path) { haveBitmap = findAppBitmap(path); } if ( !haveBitmap ) + { haveBitmap = loadBitmap( path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.png"))); + if ( !haveBitmap ) + haveBitmap = loadBitmap( + path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp"))); + } + return haveBitmap; } @@ -477,10 +483,17 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path) aStrBuf.append( OUString::valueOf( nWidth )); aStrBuf.appendAscii( "x" ); aStrBuf.append( OUString::valueOf( nHeight )); - aStrBuf.appendAscii( ".png" ); - OUString aBmpFileName = aStrBuf.makeStringAndClear(); + + OUString aRootIntroFileName = aStrBuf.makeStringAndClear(); + OUString aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".png"); bool haveBitmap = loadBitmap( path, aBmpFileName ); + if ( !haveBitmap ) + { + aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp"); + haveBitmap = loadBitmap( path, aBmpFileName ); + } + if ( !haveBitmap ) { aStrBuf.appendAscii( "intro_" ); @@ -488,10 +501,16 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path) aStrBuf.append( OUString::valueOf( nWidth )); aStrBuf.appendAscii( "x" ); aStrBuf.append( OUString::valueOf( nHeight )); - aStrBuf.appendAscii( ".png" ); - aBmpFileName = aStrBuf.makeStringAndClear(); + + aRootIntroFileName = aStrBuf.makeStringAndClear(); + aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".png"); haveBitmap = loadBitmap( path, aBmpFileName ); + if ( !haveBitmap ) + { + aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp"); + haveBitmap = loadBitmap( path, aBmpFileName ); + } } return haveBitmap; } @@ -506,9 +525,16 @@ bool SplashScreen::findAppBitmap(rtl::OUString const & path) aStrBuf.appendAscii( "intro_" ); aStrBuf.appendAscii( "_" ); aStrBuf.append( _sAppName ); - aStrBuf.appendAscii( ".png" ); - OUString aBmpFileName = aStrBuf.makeStringAndClear(); + + OUString aRootIntroFileName = aStrBuf.makeStringAndClear(); + + OUString aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".png" ); haveBitmap = loadBitmap( path, aBmpFileName ); + if ( !haveBitmap ) + { + aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".bmp" ); + haveBitmap = loadBitmap( path, aBmpFileName ); + } } return haveBitmap; } diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx index 5ca9544ea1..f0b5ec1b7f 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -161,6 +161,10 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS bLoaded = impl_loadBitmap( rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ), rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); + if ( !bLoaded ) + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ), + rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); } if ( !bLoaded ) @@ -168,6 +172,10 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS bLoaded = impl_loadBitmap( rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); + if ( !bLoaded ) + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), + rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); } // Transparenter Font -- cgit v1.2.3 From fb01b394da1627153d4b773f7bb2113102c7ede6 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 27 Jan 2010 16:23:59 +0100 Subject: sb118: changed tools/debug to never fall back from writing to shell to writing to file, and read DBGSV_INIT from rtl::Bootstrap; the latter causes problems if tools/debug is called from static code executing before SAL_MAIN has called osl_setCommandArgs -> removed statics from code and added assertions to osl/process; various improvements to smoketests.cxx (incl. passing an appropriate dbgsv.ini for non-pro builds) --- basic/source/basmgr/basmgr.cxx | 27 ++-- basic/source/classes/sb.cxx | 7 +- basic/source/classes/sbunoobj.cxx | 14 +- sfx2/source/appl/appuno.cxx | 292 +++++++++++++++++++------------------- sfx2/source/appl/sfxhelp.cxx | 15 +- 5 files changed, 171 insertions(+), 184 deletions(-) diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 196965e2ef..d68d79ae1a 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -100,20 +100,13 @@ typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper; // + BOOL bReference static const char* szStdLibName = "Standard"; -static const char* szBasicStorage = "StarBASIC"; +static const char szBasicStorage[] = "StarBASIC"; static const char* szOldManagerStream = "BasicManager"; -static const char* szManagerStream = "BasicManager2"; +static const char szManagerStream[] = "BasicManager2"; static const char* szImbedded = "LIBIMBEDDED"; static const char* szCryptingKey = "CryptedBasic"; static const char* szScriptLanguage = "StarBasic"; -static const String BasicStreamName( String::CreateFromAscii(szBasicStorage) ); -static const String ManagerStreamName( String::CreateFromAscii(szManagerStream) ); - - -#define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII)) - - TYPEINIT1( BasicManager, SfxBroadcaster ); DBG_NAME( BasicManager ); @@ -669,7 +662,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA // DBG_ASSERT(aStorageName.Len() != 0, "Bad storage name"); // If there is no Manager Stream, no further actions are necessary - if ( rStorage.IsStream( ManagerStreamName ) ) + if ( rStorage.IsStream( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)) ) ) { LoadBasicManager( rStorage, rBaseURL ); // StdLib contains Parent: @@ -710,12 +703,12 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA // #91626 Save all stream data to save it unmodified if basic isn't modified // in an 6.0+ office. So also the old basic dialogs can be saved. SotStorageStreamRef xManagerStream = rStorage.OpenSotStream - ( ManagerStreamName, eStreamReadMode ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)), eStreamReadMode ); mpImpl->mpManagerStream = new SvMemoryStream(); *static_cast(&xManagerStream) >> *mpImpl->mpManagerStream; SotStorageRef xBasicStorage = rStorage.OpenSotStorage - ( BasicStreamName, eStorageReadMode, FALSE ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE ); if( xBasicStorage.Is() && !xBasicStorage->GetError() ) { USHORT nLibs = GetLibCount(); @@ -924,7 +917,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseUR // StreamMode eStreamMode = STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE; SotStorageStreamRef xManagerStream = rStorage.OpenSotStream - ( ManagerStreamName, eStreamReadMode ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)), eStreamReadMode ); String aStorName( rStorage.GetName() ); // #i13114 removed, DBG_ASSERT( aStorName.Len(), "No Storage Name!" ); @@ -1172,7 +1165,7 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag xStorage = new SotStorage( FALSE, aStorageName, eStorageReadMode ); SotStorageRef xBasicStorage = xStorage->OpenSotStorage - ( BasicStreamName, eStorageReadMode, FALSE ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE ); if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) { @@ -1425,10 +1418,10 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ) else xStorage = new SotStorage( FALSE, pLibInfo->GetStorageName() ); - if ( xStorage->IsStorage( BasicStreamName ) ) + if ( xStorage->IsStorage( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)) ) ) { SotStorageRef xBasicStorage = xStorage->OpenSotStorage - ( BasicStreamName, STREAM_STD_READWRITE, FALSE ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), STREAM_STD_READWRITE, FALSE ); if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) { @@ -1448,7 +1441,7 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ) if ( !aInfoList.Count() ) { xBasicStorage.Clear(); - xStorage->Remove( BasicStreamName ); + xStorage->Remove( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)) ); xStorage->Commit(); // If no further Streams or SubStorages available, // delete the Storage, too. diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index a217ebc49c..605247e1db 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -67,20 +67,17 @@ TYPEINIT1(StarBASIC,SbxObject) #define RTLNAME "@SBRTL" // i#i68894# -const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") ); -const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); - SbxObject* StarBASIC::getVBAGlobals( ) { if ( !pVBAGlobals ) - pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE ); + pVBAGlobals = (SbUnoObject*)Find( String(RTL_CONSTASCII_USTRINGPARAM("VBAGlobals")), SbxCLASS_DONTCARE ); return pVBAGlobals; } // i#i68894# SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t ) { - if( rName == aThisComponent ) + if( rName.EqualsAscii("ThisComponent") ) return NULL; // rename to init globals if ( getVBAGlobals( ) ) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 06c29a5f2d..5381580e00 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -114,9 +114,9 @@ typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper; // Identifier fuer die dbg_-Properies als Strings anlegen -static String ID_DBG_SUPPORTEDINTERFACES( RTL_CONSTASCII_USTRINGPARAM("Dbg_SupportedInterfaces") ); -static String ID_DBG_PROPERTIES( RTL_CONSTASCII_USTRINGPARAM("Dbg_Properties") ); -static String ID_DBG_METHODS( RTL_CONSTASCII_USTRINGPARAM("Dbg_Methods") ); +static char const ID_DBG_SUPPORTEDINTERFACES[] = "Dbg_SupportedInterfaces"; +static char const ID_DBG_PROPERTIES[] = "Dbg_Properties"; +static char const ID_DBG_METHODS[] = "Dbg_Methods"; static ::rtl::OUString aSeqLevelStr( RTL_CONSTASCII_USTRINGPARAM("[]") ); static ::rtl::OUString defaultNameSpace( RTL_CONSTASCII_USTRINGPARAM("ooo.vba") ); @@ -1632,7 +1632,7 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) String aRet; if( eType != TypeClass_INTERFACE ) { - aRet += ID_DBG_SUPPORTEDINTERFACES; + aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES) ); aRet.AppendAscii( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" ); } else @@ -2655,15 +2655,15 @@ void SbUnoObject::implCreateDbgProperties( void ) Property aProp; // Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen - SbxVariableRef xVarRef = new SbUnoProperty( ID_DBG_SUPPORTEDINTERFACES, SbxSTRING, aProp, -1, false ); + SbxVariableRef xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_SUPPORTEDINTERFACES)), SbxSTRING, aProp, -1, false ); QuickInsert( (SbxVariable*)xVarRef ); // Id == -2: Properties ausgeben - xVarRef = new SbUnoProperty( ID_DBG_PROPERTIES, SbxSTRING, aProp, -2, false ); + xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_PROPERTIES)), SbxSTRING, aProp, -2, false ); QuickInsert( (SbxVariable*)xVarRef ); // Id == -3: Methoden ausgeben - xVarRef = new SbUnoProperty( ID_DBG_METHODS, SbxSTRING, aProp, -3, false ); + xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_METHODS)), SbxSTRING, aProp, -3, false ); QuickInsert( (SbxVariable*)xVarRef ); } diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index b623365c5a..c81d29cb74 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -147,54 +147,54 @@ using namespace ::com::sun::star::io; #define FRAMELOADER_SERVICENAME "com.sun.star.frame.FrameLoader" #define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler" -static const String sTemplateRegionName = String::CreateFromAscii( "TemplateRegionName" ); -static const String sTemplateName = String::CreateFromAscii( "TemplateName" ); -static const String sAsTemplate = String::CreateFromAscii( "AsTemplate" ); -static const String sOpenNewView = String::CreateFromAscii( "OpenNewView" ); -static const String sViewId = String::CreateFromAscii( "ViewId" ); -static const String sPluginMode = String::CreateFromAscii( "PluginMode" ); -static const String sReadOnly = String::CreateFromAscii( "ReadOnly" ); -static const String sStartPresentation = String::CreateFromAscii( "StartPresentation" ); -static const String sFrameName = String::CreateFromAscii( "FrameName" ); -static const String sMediaType = String::CreateFromAscii( "MediaType" ); -static const String sPostData = String::CreateFromAscii( "PostData" ); -static const String sCharacterSet = String::CreateFromAscii( "CharacterSet" ); -static const String sInputStream = String::CreateFromAscii( "InputStream" ); -static const String sStream = String::CreateFromAscii( "Stream" ); -static const String sOutputStream = String::CreateFromAscii( "OutputStream" ); -static const String sHidden = String::CreateFromAscii( "Hidden" ); -static const String sPreview = String::CreateFromAscii( "Preview" ); -static const String sViewOnly = String::CreateFromAscii( "ViewOnly" ); -static const String sDontEdit = String::CreateFromAscii( "DontEdit" ); -static const String sSilent = String::CreateFromAscii( "Silent" ); -static const String sJumpMark = String::CreateFromAscii( "JumpMark" ); -static const String sFileName = String::CreateFromAscii( "FileName" ); -static const String sSalvageURL = String::CreateFromAscii( "SalvagedFile" ); -static const String sStatusInd = String::CreateFromAscii( "StatusIndicator" ); -static const String sModel = String::CreateFromAscii( "Model" ); -static const String sFrame = String::CreateFromAscii( "Frame" ); -static const String sViewData = String::CreateFromAscii( "ViewData" ); -static const String sFilterData = String::CreateFromAscii( "FilterData" ); -static const String sSelectionOnly = String::CreateFromAscii( "SelectionOnly" ); -static const String sFilterFlags = String::CreateFromAscii( "FilterFlags" ); -static const String sMacroExecMode = String::CreateFromAscii( "MacroExecutionMode" ); -static const String sUpdateDocMode = String::CreateFromAscii( "UpdateDocMode" ); -static const String sMinimized = String::CreateFromAscii( "Minimized" ); -static const String sInteractionHdl = String::CreateFromAscii( "InteractionHandler" ); -static const String sWindowState = String::CreateFromAscii( "WindowState" ); -static const String sUCBContent = String::CreateFromAscii( "UCBContent" ); -static const String sRepairPackage = String::CreateFromAscii( "RepairPackage" ); -static const String sDocumentTitle = String::CreateFromAscii( "DocumentTitle" ); -static const String sComponentData = String::CreateFromAscii( "ComponentData" ); -static const String sComponentContext = String::CreateFromAscii( "ComponentContext" ); -static const String sDocumentBaseURL = String::CreateFromAscii( "DocumentBaseURL" ); -static const String sHierarchicalDocumentName = String::CreateFromAscii( "HierarchicalDocumentName" ); -static const String sCopyStreamIfPossible = String::CreateFromAscii( "CopyStreamIfPossible" ); -static const String sNoAutoSave = String::CreateFromAscii( "NoAutoSave" ); -static const String sFolderName = String::CreateFromAscii( "FolderName" ); -static const String sUseSystemDialog = String::CreateFromAscii( "UseSystemDialog" ); -static const String sStandardDir = String::CreateFromAscii( "StandardDir" ); -static const String sBlackList = String::CreateFromAscii( "BlackList" ); +static char const sTemplateRegionName[] = "TemplateRegionName"; +static char const sTemplateName[] = "TemplateName"; +static char const sAsTemplate[] = "AsTemplate"; +static char const sOpenNewView[] = "OpenNewView"; +static char const sViewId[] = "ViewId"; +static char const sPluginMode[] = "PluginMode"; +static char const sReadOnly[] = "ReadOnly"; +static char const sStartPresentation[] = "StartPresentation"; +static char const sFrameName[] = "FrameName"; +static char const sMediaType[] = "MediaType"; +static char const sPostData[] = "PostData"; +static char const sCharacterSet[] = "CharacterSet"; +static char const sInputStream[] = "InputStream"; +static char const sStream[] = "Stream"; +static char const sOutputStream[] = "OutputStream"; +static char const sHidden[] = "Hidden"; +static char const sPreview[] = "Preview"; +static char const sViewOnly[] = "ViewOnly"; +static char const sDontEdit[] = "DontEdit"; +static char const sSilent[] = "Silent"; +static char const sJumpMark[] = "JumpMark"; +static char const sFileName[] = "FileName"; +static char const sSalvageURL[] = "SalvagedFile"; +static char const sStatusInd[] = "StatusIndicator"; +static char const sModel[] = "Model"; +static char const sFrame[] = "Frame"; +static char const sViewData[] = "ViewData"; +static char const sFilterData[] = "FilterData"; +static char const sSelectionOnly[] = "SelectionOnly"; +static char const sFilterFlags[] = "FilterFlags"; +static char const sMacroExecMode[] = "MacroExecutionMode"; +static char const sUpdateDocMode[] = "UpdateDocMode"; +static char const sMinimized[] = "Minimized"; +static char const sInteractionHdl[] = "InteractionHandler"; +static char const sWindowState[] = "WindowState"; +static char const sUCBContent[] = "UCBContent"; +static char const sRepairPackage[] = "RepairPackage"; +static char const sDocumentTitle[] = "DocumentTitle"; +static char const sComponentData[] = "ComponentData"; +static char const sComponentContext[] = "ComponentContext"; +static char const sDocumentBaseURL[] = "DocumentBaseURL"; +static char const sHierarchicalDocumentName[] = "HierarchicalDocumentName"; +static char const sCopyStreamIfPossible[] = "CopyStreamIfPossible"; +static char const sNoAutoSave[] = "NoAutoSave"; +static char const sFolderName[] = "FolderName"; +static char const sUseSystemDialog[] = "UseSystemDialog"; +static char const sStandardDir[] = "StandardDir"; +static char const sBlackList[] = "BlackList"; void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -469,11 +469,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque for ( sal_uInt16 n=0; n>= bVal) @@ -490,18 +490,18 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque ++nFoundArgs; #endif const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n]; - String aName = rProp.Name; - if ( aName == sModel ) + rtl::OUString aName = rProp.Name; + if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sModel)) ) rSet.Put( SfxUnoAnyItem( SID_DOCUMENT, rProp.Value ) ); - else if ( aName == sComponentData ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sComponentData)) ) { rSet.Put( SfxUnoAnyItem( SID_COMPONENTDATA, rProp.Value ) ); } - else if ( aName == sComponentContext ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sComponentContext)) ) { rSet.Put( SfxUnoAnyItem( SID_COMPONENTCONTEXT, rProp.Value ) ); } - else if ( aName == sStatusInd ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStatusInd)) ) { Reference< ::com::sun::star::task::XStatusIndicator > xVal; sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is()); @@ -509,7 +509,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, rProp.Value ) ); } - else if ( aName == sInteractionHdl ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sInteractionHdl)) ) { Reference< ::com::sun::star::task::XInteractionHandler > xVal; sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is()); @@ -517,11 +517,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, rProp.Value ) ); } - else if ( aName == sViewData ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sViewData)) ) rSet.Put( SfxUnoAnyItem( SID_VIEW_DATA, rProp.Value ) ); - else if ( aName == sFilterData ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFilterData)) ) rSet.Put( SfxUnoAnyItem( SID_FILTER_DATA, rProp.Value ) ); - else if ( aName == sInputStream ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sInputStream)) ) { Reference< XInputStream > xVal; sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is()); @@ -529,7 +529,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_INPUTSTREAM, rProp.Value ) ); } - else if ( aName == sStream ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStream)) ) { Reference< XInputStream > xVal; sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is()); @@ -537,7 +537,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_STREAM, rProp.Value ) ); } - else if ( aName == sUCBContent ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sUCBContent)) ) { Reference< XContent > xVal; sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is()); @@ -545,7 +545,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_CONTENT, rProp.Value ) ); } - else if ( aName == sOutputStream ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sOutputStream)) ) { Reference< XOutputStream > xVal; sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is()); @@ -553,7 +553,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_OUTPUTSTREAM, rProp.Value ) ); } - else if ( aName == sPostData ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sPostData)) ) { Reference< XInputStream > xVal; sal_Bool bOK = (rProp.Value >>= xVal); @@ -561,7 +561,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_POSTDATA, rProp.Value ) ); } - else if ( aName == sFrame ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFrame)) ) { Reference< XFrame > xVal; sal_Bool bOK = (rProp.Value >>= xVal); @@ -569,7 +569,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUnoAnyItem( SID_FILLFRAME, rProp.Value ) ); } - else if ( aName == sAsTemplate ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sAsTemplate)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -577,7 +577,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_TEMPLATE, bVal ) ); } - else if ( aName == sOpenNewView ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sOpenNewView)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -585,7 +585,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_OPEN_NEW_VIEW, bVal ) ); } - else if ( aName == sViewId ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sViewId)) ) { sal_Int16 nVal = -1; sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1)); @@ -593,7 +593,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUInt16Item( SID_VIEW_ID, nVal ) ); } - else if ( aName == sPluginMode ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sPluginMode)) ) { sal_Int16 nVal = -1; sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1)); @@ -601,7 +601,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUInt16Item( SID_PLUGIN_MODE, nVal ) ); } - else if ( aName == sReadOnly ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sReadOnly)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -609,7 +609,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_DOC_READONLY, bVal ) ); } - else if ( aName == sStartPresentation ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStartPresentation)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -617,7 +617,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, bVal ) ); } - else if ( aName == sSelectionOnly ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSelectionOnly)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -625,7 +625,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_SELECTION, bVal ) ); } - else if ( aName == sHidden ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sHidden)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -633,7 +633,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_HIDDEN, bVal ) ); } - else if ( aName == sMinimized ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sMinimized)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -641,7 +641,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_MINIMIZED, bVal ) ); } - else if ( aName == sSilent ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSilent)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -649,7 +649,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_SILENT, bVal ) ); } - else if ( aName == sPreview ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sPreview)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -657,7 +657,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_PREVIEW, bVal ) ); } - else if ( aName == sViewOnly ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sViewOnly)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -665,7 +665,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_VIEWONLY, bVal ) ); } - else if ( aName == sDontEdit ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDontEdit)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -673,7 +673,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_EDITDOC, !bVal ) ); } - else if ( aName == sUseSystemDialog ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sUseSystemDialog)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -681,7 +681,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_FILE_DIALOG, bVal ) ); } - else if ( aName == sStandardDir ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStandardDir)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -689,7 +689,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) ); } - else if ( aName == sBlackList ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sBlackList)) ) { ::com::sun::star::uno::Sequence< ::rtl::OUString > xVal; sal_Bool bOK = (rProp.Value >>= xVal); @@ -701,7 +701,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque rSet.Put( stringList ); } } - else if ( aName == sFileName ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFileName)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -709,7 +709,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_FILE_NAME, sVal ) ); } - else if ( aName == sSalvageURL ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvageURL)) ) { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); @@ -717,7 +717,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_DOC_SALVAGE, sVal ) ); } - else if ( aName == sFolderName ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFolderName)) ) { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); @@ -725,7 +725,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_PATH, sVal ) ); } - else if ( aName == sFrameName ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFrameName)) ) { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); @@ -733,7 +733,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK && sVal.getLength()) rSet.Put( SfxStringItem( SID_TARGETNAME, sVal ) ); } - else if ( aName == sMediaType ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sMediaType)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -741,7 +741,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_CONTENTTYPE, sVal ) ); } - else if ( aName == sWindowState ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sWindowState)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -749,7 +749,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_WIN_POSSIZE, sVal ) ); } - else if ( aName == sTemplateName ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sTemplateName)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -757,7 +757,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_TEMPLATE_NAME, sVal ) ); } - else if ( aName == sTemplateRegionName ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sTemplateRegionName)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -765,7 +765,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_TEMPLATE_REGIONNAME, sVal ) ); } - else if ( aName == sJumpMark ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sJumpMark)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -773,7 +773,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_JUMPMARK, sVal ) ); } - else if ( aName == sCharacterSet ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sCharacterSet)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -781,7 +781,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_CHARSET, sVal ) ); } - else if ( aName == sFilterFlags ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFilterFlags)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -789,7 +789,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_FILE_FILTEROPTIONS, sVal ) ); } - else if ( aName == sMacroExecMode ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sMacroExecMode)) ) { sal_Int16 nVal =-1; sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1)); @@ -797,7 +797,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUInt16Item( SID_MACROEXECMODE, nVal ) ); } - else if ( aName == sUpdateDocMode ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sUpdateDocMode)) ) { sal_Int16 nVal =-1; sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1)); @@ -805,7 +805,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxUInt16Item( SID_UPDATEDOCMODE, nVal ) ); } - else if ( aName == sRepairPackage ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sRepairPackage)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -813,7 +813,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_REPAIRPACKAGE, bVal ) ); } - else if ( aName == sDocumentTitle ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDocumentTitle)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -821,7 +821,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_DOCINFO_TITLE, sVal ) ); } - else if ( aName == sDocumentBaseURL ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDocumentBaseURL)) ) { ::rtl::OUString sVal; // the base url can be set to empty ( for embedded objects for example ) @@ -830,7 +830,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_DOC_BASEURL, sVal ) ); } - else if ( aName == sHierarchicalDocumentName ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sHierarchicalDocumentName)) ) { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); @@ -838,7 +838,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_DOC_HIERARCHICALNAME, sVal ) ); } - else if ( aName == sCopyStreamIfPossible ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sCopyStreamIfPossible)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -846,7 +846,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_COPY_STREAM_IF_POSSIBLE, bVal ) ); } - else if ( aName == sNoAutoSave ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sNoAutoSave)) ) { sal_Bool bVal = sal_False; sal_Bool bOK = (rProp.Value >>= bVal); @@ -1334,147 +1334,147 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta const SfxPoolItem *pItem=0; if ( rSet.GetItemState( SID_COMPONENTDATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sComponentData; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sComponentData)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_COMPONENTCONTEXT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sComponentContext; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sComponentContext)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sStatusInd; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStatusInd)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_INTERACTIONHANDLER, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sInteractionHdl; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sInteractionHdl)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_VIEW_DATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sViewData; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewData)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_FILTER_DATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sFilterData; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFilterData)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOCUMENT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sModel; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModel)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_CONTENT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sUCBContent; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUCBContent)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_INPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sInputStream; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sInputStream)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_STREAM, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sStream; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStream)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_OUTPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sOutputStream; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sOutputStream)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_POSTDATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sPostData; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPostData)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sFrame; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrame)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sAsTemplate; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sAsTemplate)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sOpenNewView; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sOpenNewView)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_VIEW_ID, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sViewId; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewId)); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_PLUGIN_MODE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sPluginMode; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPluginMode)); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOC_READONLY, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sReadOnly; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sReadOnly)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sStartPresentation; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStartPresentation)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_SELECTION, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sSelectionOnly; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSelectionOnly)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_HIDDEN, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sHidden; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sHidden)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_MINIMIZED, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sMinimized; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMinimized)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_SILENT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sSilent; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSilent)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_PREVIEW, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sPreview; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPreview)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_VIEWONLY, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sViewOnly; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewOnly)); pValue[nActProp++].Value <<= (sal_Bool) (( ((SfxBoolItem*)pItem)->GetValue() )); } if ( rSet.GetItemState( SID_EDITDOC, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sDontEdit; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDontEdit)); pValue[nActProp++].Value <<= (sal_Bool) (!( ((SfxBoolItem*)pItem)->GetValue() )); } if ( rSet.GetItemState( SID_FILE_DIALOG, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sUseSystemDialog; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUseSystemDialog)); pValue[nActProp++].Value <<= (sal_Bool) ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_STANDARD_DIR, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sStandardDir; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStandardDir)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_BLACK_LIST, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sBlackList; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sBlackList)); com::sun::star::uno::Sequence< rtl::OUString > aList; ((SfxStringListItem*)pItem)->GetStringList( aList ); @@ -1482,42 +1482,42 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta } if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sFrameName; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrameName)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sSalvageURL; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvageURL)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sFolderName; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFolderName)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_CONTENTTYPE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sMediaType; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMediaType)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_WIN_POSSIZE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sWindowState; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sWindowState)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_TEMPLATE_NAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sTemplateName; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sTemplateName)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sTemplateRegionName; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sTemplateRegionName)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_JUMPMARK, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sJumpMark; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sJumpMark)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } @@ -1529,47 +1529,47 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( rSet.GetItemState( SID_CHARSET, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sCharacterSet; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCharacterSet)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_MACROEXECMODE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sMacroExecMode; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMacroExecMode)); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_UPDATEDOCMODE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sUpdateDocMode; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUpdateDocMode)); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_REPAIRPACKAGE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sRepairPackage; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sRepairPackage)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOCINFO_TITLE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sDocumentTitle; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDocumentTitle)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_DOC_BASEURL, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sDocumentBaseURL; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDocumentBaseURL)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_DOC_HIERARCHICALNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sHierarchicalDocumentName; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sHierarchicalDocumentName)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_COPY_STREAM_IF_POSSIBLE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sCopyStreamIfPossible; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCopyStreamIfPossible)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_NOAUTOSAVE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = sNoAutoSave; + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sNoAutoSave)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 7421330cf9..cf6860281a 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -721,9 +721,6 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rMo return aHelpURL; } -static ::rtl::OUString OFFICE_HELP_TASK = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")); -static ::rtl::OUString OFFICE_HELP = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP" )); - SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , Reference< XFrame >& rHelpContent) { @@ -732,7 +729,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , // otherwhise - create new help task Reference< XFrame > xHelpTask = xDesktop->findFrame( - OFFICE_HELP_TASK, + ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")), FrameSearchFlag::TASKS | FrameSearchFlag::CREATE); if (!xHelpTask.is()) return 0; @@ -747,7 +744,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , if (xHelpTask->setComponent( xHelpWindow, Reference< XController >() )) { // Customize UI ... - xHelpTask->setName( OFFICE_HELP_TASK ); + xHelpTask->setName( ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")) ); Reference< XPropertySet > xProps(xHelpTask, UNO_QUERY); if (xProps.is()) @@ -761,13 +758,13 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , // This sub frame is created internaly (if we called new SfxHelpWindow_Impl() ...) // It should exist :-) - xHelpContent = xHelpTask->findFrame(OFFICE_HELP, FrameSearchFlag::CHILDREN); + xHelpContent = xHelpTask->findFrame(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")), FrameSearchFlag::CHILDREN); } if (!xHelpContent.is()) delete pHelpWindow; - xHelpContent->setName(OFFICE_HELP); + xHelpContent->setName(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP"))); rHelpTask = xHelpTask; rHelpContent = xHelpContent; @@ -837,10 +834,10 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) // in both cases)! Reference< XFrame > xHelp = xDesktop->findFrame( - OFFICE_HELP_TASK, + ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")), FrameSearchFlag::CHILDREN); Reference< XFrame > xHelpContent = xDesktop->findFrame( - OFFICE_HELP, + ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")), FrameSearchFlag::CHILDREN); SfxHelpWindow_Impl* pHelpWindow = 0; -- cgit v1.2.3 From dbb3f34b54f2451e7b85d6b7fddba65cd22834c8 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 29 Jan 2010 17:01:54 +0100 Subject: sb118: #i108776# changed addsym.awk to also export STLport num_put symbols, and simplified it by requiring that first section is labeled UDK_3_0_0; adapted map files accordingly, replacing many individual ones with solenv/src templates --- avmedia/source/quicktime/avmediaQuickTime.map | 8 -------- avmedia/source/quicktime/makefile.mk | 2 +- configmgr/qa/unit/export.map | 2 +- configmgr/util/configmgr.map | 8 -------- configmgr/util/configmgrl.map | 8 -------- configmgr/util/makefile.mk | 2 +- connectivity/source/cpool/dbpool.map | 8 -------- connectivity/source/cpool/makefile.mk | 2 +- connectivity/source/dbtools/dbt.map | 8 -------- connectivity/source/drivers/adabas/adabas.map | 8 -------- connectivity/source/drivers/adabas/makefile.mk | 2 +- connectivity/source/drivers/calc/calc.map | 8 -------- connectivity/source/drivers/calc/makefile.mk | 2 +- connectivity/source/drivers/dbase/dbase.map | 10 ---------- connectivity/source/drivers/dbase/makefile.mk | 2 +- connectivity/source/drivers/evoab/evoab.map | 8 -------- connectivity/source/drivers/evoab/makefile.mk | 2 +- connectivity/source/drivers/evoab2/evoab2.map | 8 -------- connectivity/source/drivers/evoab2/makefile.mk | 2 +- connectivity/source/drivers/flat/flat.map | 8 -------- connectivity/source/drivers/flat/makefile.mk | 2 +- connectivity/source/drivers/jdbc/jdbc.map | 8 -------- connectivity/source/drivers/jdbc/makefile.mk | 2 +- connectivity/source/drivers/kab/kab.map | 8 -------- connectivity/source/drivers/kab/kabdrv.map | 2 +- connectivity/source/drivers/kab/makefile.mk | 2 +- connectivity/source/drivers/macab/macab.map | 8 -------- connectivity/source/drivers/macab/macabdrv.map | 2 +- connectivity/source/drivers/macab/makefile.mk | 2 +- connectivity/source/drivers/mozab/bootstrap/makefile.mk | 2 +- connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map | 8 -------- connectivity/source/drivers/mozab/makefile.mk | 2 +- connectivity/source/drivers/mozab/mozab.map | 8 -------- connectivity/source/drivers/mozab/mozabdrv.map | 2 +- connectivity/source/drivers/mysql/makefile.mk | 2 +- connectivity/source/drivers/mysql/mysql.map | 8 -------- connectivity/source/drivers/odbc/makefile.mk | 2 +- connectivity/source/drivers/odbc/odbc.map | 8 -------- connectivity/source/manager/makefile.mk | 2 +- connectivity/source/manager/sdbc.map | 8 -------- desktop/source/app/version.map | 2 +- desktop/source/deployment/deployment.map | 8 -------- desktop/source/deployment/gui/makefile.mk | 2 +- desktop/source/deployment/makefile.mk | 2 +- desktop/source/migration/services/makefile.mk | 2 +- desktop/source/migration/services/migrationoo2.map | 8 -------- desktop/source/offacc/exports.map | 10 ---------- desktop/source/offacc/makefile.mk | 2 +- desktop/source/pkgchk/unopkg/version.map | 2 +- desktop/source/so_comp/exports.map | 10 ---------- desktop/source/so_comp/makefile.mk | 2 +- desktop/source/splash/exports.map | 10 ---------- desktop/source/splash/makefile.mk | 2 +- eventattacher/source/exports.map | 10 ---------- eventattacher/source/makefile.mk | 2 +- fileaccess/source/exports.map | 10 ---------- fileaccess/source/makefile.mk | 2 +- formula/util/for.map | 8 -------- formula/util/forui.map | 8 -------- formula/util/makefile.mk | 1 - fpicker/source/aqua/exports.map | 8 -------- fpicker/source/aqua/makefile.mk | 2 +- fpicker/source/generic/exports.map | 8 -------- fpicker/source/generic/makefile.mk | 2 +- fpicker/source/office/exports.map | 8 -------- fpicker/source/office/makefile.mk | 2 +- fpicker/source/unx/gnome/exports.map | 8 -------- fpicker/source/unx/gnome/makefile.mk | 2 +- framework/util/exports.map | 10 ---------- framework/util/makefile.mk | 6 +++--- linguistic/workben/lex.map | 8 -------- linguistic/workben/makefile.mk | 2 +- scripting/source/basprov/basprov.map | 9 --------- scripting/source/basprov/makefile.mk | 2 +- scripting/source/dlgprov/dlgprov.map | 9 --------- scripting/source/dlgprov/makefile.mk | 2 +- scripting/source/stringresource/makefile.mk | 2 +- scripting/source/stringresource/stringresource.map | 9 --------- shell/source/backends/desktopbe/exports.map | 10 ---------- shell/source/backends/desktopbe/makefile.mk | 2 +- shell/source/backends/gconfbe/exports.map | 10 ---------- shell/source/backends/gconfbe/makefile.mk | 2 +- shell/source/backends/kde4be/exports.map | 10 ---------- shell/source/backends/kde4be/makefile.mk | 2 +- shell/source/backends/kdebe/exports.map | 10 ---------- shell/source/backends/kdebe/makefile.mk | 2 +- shell/source/backends/localebe/exports.map | 10 ---------- shell/source/backends/localebe/makefile.mk | 2 +- shell/source/backends/macbe/exports.map | 10 ---------- shell/source/backends/macbe/makefile.mk | 2 +- shell/source/backends/wininetbe/exports.map | 10 ---------- shell/source/backends/wininetbe/makefile.mk | 2 +- shell/source/cmdmail/exports.map | 10 ---------- shell/source/cmdmail/makefile.mk | 2 +- shell/source/unix/exec/exports.map | 10 ---------- shell/source/unix/exec/makefile.mk | 2 +- shell/source/unix/sysshell/recfile.map | 2 +- svx/source/unodialogs/textconversiondlgs/export.map | 8 -------- svx/source/unodialogs/textconversiondlgs/makefile.mk | 2 +- ucb/source/cacher/exports.map | 8 -------- ucb/source/cacher/makefile.mk | 2 +- ucb/source/core/exports.map | 8 -------- ucb/source/core/makefile.mk | 2 +- ucb/source/sorter/exports.map | 8 -------- ucb/source/sorter/makefile.mk | 2 +- ucb/source/ucp/expand/makefile.mk | 2 +- ucb/source/ucp/expand/ucpexpand1.uno.map | 8 -------- ucb/source/ucp/file/exports.map | 8 -------- ucb/source/ucp/file/makefile.mk | 2 +- ucb/source/ucp/ftp/makefile.mk | 2 +- ucb/source/ucp/ftp/ucpftp.map | 8 -------- ucb/source/ucp/gio/exports.map | 8 -------- ucb/source/ucp/gio/makefile.mk | 2 +- ucb/source/ucp/gvfs/exports.map | 8 -------- ucb/source/ucp/gvfs/makefile.mk | 2 +- ucb/source/ucp/hierarchy/makefile.mk | 2 +- ucb/source/ucp/hierarchy/ucphier.map | 8 -------- ucb/source/ucp/odma/exports.map | 8 -------- ucb/source/ucp/odma/makefile.mk | 2 +- ucb/source/ucp/package/exports.map | 8 -------- ucb/source/ucp/package/makefile.mk | 2 +- ucb/source/ucp/tdoc/exports.map | 8 -------- ucb/source/ucp/tdoc/makefile.mk | 2 +- ucb/source/ucp/webdav/exports.map | 8 -------- ucb/source/ucp/webdav/makefile.mk | 2 +- uui/util/exports.map | 10 ---------- uui/util/makefile.mk | 2 +- vbahelper/util/makefile.mk | 2 +- vbahelper/util/msforms.map | 9 --------- xmlhelp/source/treeview/makefile.mk | 2 +- xmlhelp/source/treeview/tvhlp.map | 9 --------- xmlhelp/util/exports.map | 8 -------- xmlhelp/util/makefile.mk | 2 +- xmloff/source/transform/makefile.mk | 2 +- xmloff/source/transform/xof.map | 8 -------- 135 files changed, 71 insertions(+), 631 deletions(-) delete mode 100644 avmedia/source/quicktime/avmediaQuickTime.map delete mode 100644 configmgr/util/configmgr.map delete mode 100644 configmgr/util/configmgrl.map delete mode 100644 connectivity/source/cpool/dbpool.map delete mode 100644 connectivity/source/dbtools/dbt.map delete mode 100644 connectivity/source/drivers/adabas/adabas.map delete mode 100644 connectivity/source/drivers/calc/calc.map delete mode 100644 connectivity/source/drivers/dbase/dbase.map delete mode 100644 connectivity/source/drivers/evoab/evoab.map delete mode 100644 connectivity/source/drivers/evoab2/evoab2.map delete mode 100644 connectivity/source/drivers/flat/flat.map delete mode 100644 connectivity/source/drivers/jdbc/jdbc.map delete mode 100644 connectivity/source/drivers/kab/kab.map delete mode 100755 connectivity/source/drivers/macab/macab.map delete mode 100644 connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map delete mode 100644 connectivity/source/drivers/mozab/mozab.map delete mode 100644 connectivity/source/drivers/mysql/mysql.map delete mode 100644 connectivity/source/drivers/odbc/odbc.map delete mode 100644 connectivity/source/manager/sdbc.map delete mode 100644 desktop/source/deployment/deployment.map delete mode 100644 desktop/source/migration/services/migrationoo2.map delete mode 100644 desktop/source/offacc/exports.map delete mode 100644 desktop/source/so_comp/exports.map delete mode 100644 desktop/source/splash/exports.map delete mode 100644 eventattacher/source/exports.map delete mode 100644 fileaccess/source/exports.map delete mode 100644 formula/util/for.map delete mode 100644 formula/util/forui.map delete mode 100644 fpicker/source/aqua/exports.map delete mode 100644 fpicker/source/generic/exports.map delete mode 100644 fpicker/source/office/exports.map delete mode 100644 fpicker/source/unx/gnome/exports.map delete mode 100644 framework/util/exports.map delete mode 100644 linguistic/workben/lex.map delete mode 100644 scripting/source/basprov/basprov.map delete mode 100644 scripting/source/dlgprov/dlgprov.map delete mode 100644 scripting/source/stringresource/stringresource.map delete mode 100644 shell/source/backends/desktopbe/exports.map delete mode 100644 shell/source/backends/gconfbe/exports.map delete mode 100644 shell/source/backends/kde4be/exports.map delete mode 100644 shell/source/backends/kdebe/exports.map delete mode 100644 shell/source/backends/localebe/exports.map delete mode 100644 shell/source/backends/macbe/exports.map delete mode 100644 shell/source/backends/wininetbe/exports.map delete mode 100644 shell/source/cmdmail/exports.map delete mode 100644 shell/source/unix/exec/exports.map delete mode 100644 svx/source/unodialogs/textconversiondlgs/export.map delete mode 100644 ucb/source/cacher/exports.map delete mode 100644 ucb/source/core/exports.map delete mode 100644 ucb/source/sorter/exports.map delete mode 100644 ucb/source/ucp/expand/ucpexpand1.uno.map delete mode 100644 ucb/source/ucp/file/exports.map delete mode 100644 ucb/source/ucp/ftp/ucpftp.map delete mode 100644 ucb/source/ucp/gio/exports.map delete mode 100644 ucb/source/ucp/gvfs/exports.map delete mode 100644 ucb/source/ucp/hierarchy/ucphier.map delete mode 100644 ucb/source/ucp/odma/exports.map delete mode 100644 ucb/source/ucp/package/exports.map delete mode 100644 ucb/source/ucp/tdoc/exports.map delete mode 100644 ucb/source/ucp/webdav/exports.map delete mode 100644 uui/util/exports.map delete mode 100644 vbahelper/util/msforms.map delete mode 100644 xmlhelp/source/treeview/tvhlp.map delete mode 100644 xmlhelp/util/exports.map delete mode 100644 xmloff/source/transform/xof.map diff --git a/avmedia/source/quicktime/avmediaQuickTime.map b/avmedia/source/quicktime/avmediaQuickTime.map deleted file mode 100644 index bf1fbe0696..0000000000 --- a/avmedia/source/quicktime/avmediaQuickTime.map +++ /dev/null @@ -1,8 +0,0 @@ -LEXPS_1_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/avmedia/source/quicktime/makefile.mk b/avmedia/source/quicktime/makefile.mk index a087e80075..5c8063b432 100644 --- a/avmedia/source/quicktime/makefile.mk +++ b/avmedia/source/quicktime/makefile.mk @@ -77,7 +77,7 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib SHL1IMPLIB=i$(TARGET) SHL1DEF=$(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Targets ------------------------------------------------------ diff --git a/configmgr/qa/unit/export.map b/configmgr/qa/unit/export.map index 4ca70fa854..879fa89537 100644 --- a/configmgr/qa/unit/export.map +++ b/configmgr/qa/unit/export.map @@ -1,4 +1,4 @@ -UDK_3.0 { +UDK_3_0_0 { global: registerAllTestFunction; diff --git a/configmgr/util/configmgr.map b/configmgr/util/configmgr.map deleted file mode 100644 index ad92fbe03e..0000000000 --- a/configmgr/util/configmgr.map +++ /dev/null @@ -1,8 +0,0 @@ -CFGMGR_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/configmgr/util/configmgrl.map b/configmgr/util/configmgrl.map deleted file mode 100644 index ad92fbe03e..0000000000 --- a/configmgr/util/configmgrl.map +++ /dev/null @@ -1,8 +0,0 @@ -CFGMGR_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/configmgr/util/makefile.mk b/configmgr/util/makefile.mk index eaea5d3435..1a1785d9ea 100644 --- a/configmgr/util/makefile.mk +++ b/configmgr/util/makefile.mk @@ -44,7 +44,7 @@ DLLPRE = # --- Library ----------------------------------- SHL1TARGET= $(CFGMGR_TARGET)$(CFGMGR_MAJOR).uno -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ diff --git a/connectivity/source/cpool/dbpool.map b/connectivity/source/cpool/dbpool.map deleted file mode 100644 index 7202c9d71b..0000000000 --- a/connectivity/source/cpool/dbpool.map +++ /dev/null @@ -1,8 +0,0 @@ -DBPOOL_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/cpool/makefile.mk b/connectivity/source/cpool/makefile.mk index 056e5c1617..9867b86638 100644 --- a/connectivity/source/cpool/makefile.mk +++ b/connectivity/source/cpool/makefile.mk @@ -59,7 +59,7 @@ SLOFILES=\ SHL1TARGET= $(DBPOOL_TARGET)$(DBPOOL_MAJOR) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ diff --git a/connectivity/source/dbtools/dbt.map b/connectivity/source/dbtools/dbt.map deleted file mode 100644 index c3eaaa5a25..0000000000 --- a/connectivity/source/dbtools/dbt.map +++ /dev/null @@ -1,8 +0,0 @@ -DBTOOLS_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/adabas/adabas.map b/connectivity/source/drivers/adabas/adabas.map deleted file mode 100644 index 7ce4c703e6..0000000000 --- a/connectivity/source/drivers/adabas/adabas.map +++ /dev/null @@ -1,8 +0,0 @@ -ADABAS_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk index 5b3483ed57..65cade7d83 100644 --- a/connectivity/source/drivers/adabas/makefile.mk +++ b/connectivity/source/drivers/adabas/makefile.mk @@ -75,7 +75,7 @@ SLOFILES=\ $(SLO)$/BResultSetMetaData.obj \ $(SLO)$/BResultSet.obj -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- diff --git a/connectivity/source/drivers/calc/calc.map b/connectivity/source/drivers/calc/calc.map deleted file mode 100644 index bcab8e6c91..0000000000 --- a/connectivity/source/drivers/calc/calc.map +++ /dev/null @@ -1,8 +0,0 @@ -CALC_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk index f4019564ed..465e9ff5d7 100644 --- a/connectivity/source/drivers/calc/makefile.mk +++ b/connectivity/source/drivers/calc/makefile.mk @@ -61,7 +61,7 @@ SLOFILES=\ $(SLO)$/Cservices.obj \ $(SLO)$/CDriver.obj -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- diff --git a/connectivity/source/drivers/dbase/dbase.map b/connectivity/source/drivers/dbase/dbase.map deleted file mode 100644 index 2c620b4f36..0000000000 --- a/connectivity/source/drivers/dbase/dbase.map +++ /dev/null @@ -1,10 +0,0 @@ -DBASE_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; - - diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk index 37a88ef476..e9f8314760 100644 --- a/connectivity/source/drivers/dbase/makefile.mk +++ b/connectivity/source/drivers/dbase/makefile.mk @@ -93,7 +93,7 @@ EXCEPTIONSFILES +=\ .ENDIF -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- diff --git a/connectivity/source/drivers/evoab/evoab.map b/connectivity/source/drivers/evoab/evoab.map deleted file mode 100644 index 00cf7191f1..0000000000 --- a/connectivity/source/drivers/evoab/evoab.map +++ /dev/null @@ -1,8 +0,0 @@ -EVOAB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/evoab/makefile.mk b/connectivity/source/drivers/evoab/makefile.mk index 8982322513..809df6ef85 100644 --- a/connectivity/source/drivers/evoab/makefile.mk +++ b/connectivity/source/drivers/evoab/makefile.mk @@ -69,7 +69,7 @@ SLOFILES=\ $(SLO)$/LDebug.obj -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- diff --git a/connectivity/source/drivers/evoab2/evoab2.map b/connectivity/source/drivers/evoab2/evoab2.map deleted file mode 100644 index 00cf7191f1..0000000000 --- a/connectivity/source/drivers/evoab2/evoab2.map +++ /dev/null @@ -1,8 +0,0 @@ -EVOAB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk index 6d7ca92fbd..dc5ac1a2f0 100644 --- a/connectivity/source/drivers/evoab2/makefile.mk +++ b/connectivity/source/drivers/evoab2/makefile.mk @@ -65,7 +65,7 @@ SLOFILES=\ $(SLO)$/EApi.obj \ $(SLO)$/NDebug.obj -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- diff --git a/connectivity/source/drivers/flat/flat.map b/connectivity/source/drivers/flat/flat.map deleted file mode 100644 index bf26bd0fa0..0000000000 --- a/connectivity/source/drivers/flat/flat.map +++ /dev/null @@ -1,8 +0,0 @@ -FLAT_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk index 071c8c0cc9..4a9b2aada2 100644 --- a/connectivity/source/drivers/flat/makefile.mk +++ b/connectivity/source/drivers/flat/makefile.mk @@ -74,7 +74,7 @@ EXCEPTIONSFILES=\ $(SLO)$/EDriver.obj -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- SHL1TARGET=$(TARGET)$(DLLPOSTFIX) diff --git a/connectivity/source/drivers/jdbc/jdbc.map b/connectivity/source/drivers/jdbc/jdbc.map deleted file mode 100644 index 23369ec764..0000000000 --- a/connectivity/source/drivers/jdbc/jdbc.map +++ /dev/null @@ -1,8 +0,0 @@ -JDBC_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk index fb37a30777..4eed481b17 100644 --- a/connectivity/source/drivers/jdbc/makefile.mk +++ b/connectivity/source/drivers/jdbc/makefile.mk @@ -82,7 +82,7 @@ SLOFILES=\ $(SLO)$/tools.obj \ $(SLO)$/ContextClassLoader.obj -SHL1VERSIONMAP=$(JDBC_TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- diff --git a/connectivity/source/drivers/kab/kab.map b/connectivity/source/drivers/kab/kab.map deleted file mode 100644 index 6b7216de8c..0000000000 --- a/connectivity/source/drivers/kab/kab.map +++ /dev/null @@ -1,8 +0,0 @@ -KAB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/kab/kabdrv.map b/connectivity/source/drivers/kab/kabdrv.map index c32084ddd4..5de866f2e5 100644 --- a/connectivity/source/drivers/kab/kabdrv.map +++ b/connectivity/source/drivers/kab/kabdrv.map @@ -1,4 +1,4 @@ -KAB_1_0 { +UDK_3_0_0 { global: createKabConnection; initKApplication; diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk index 2c0a86f856..de6955f4b0 100644 --- a/connectivity/source/drivers/kab/makefile.mk +++ b/connectivity/source/drivers/kab/makefile.mk @@ -65,7 +65,7 @@ DEPOBJFILES= \ # --- Library ----------------------------------- -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1TARGET= $(TARGET)$(KAB_MAJOR) SHL1OBJS=$(SLOFILES) diff --git a/connectivity/source/drivers/macab/macab.map b/connectivity/source/drivers/macab/macab.map deleted file mode 100755 index fe2d1ac905..0000000000 --- a/connectivity/source/drivers/macab/macab.map +++ /dev/null @@ -1,8 +0,0 @@ -MACAB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/macab/macabdrv.map b/connectivity/source/drivers/macab/macabdrv.map index d953690f6b..e23423e715 100755 --- a/connectivity/source/drivers/macab/macabdrv.map +++ b/connectivity/source/drivers/macab/macabdrv.map @@ -1,4 +1,4 @@ -MACAB_1_0 { +UDK_3_0_0 { global: createMacabConnection; local: diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 8edc8951fa..c5516d13a6 100755 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -58,7 +58,7 @@ DEPOBJFILES= \ # --- Library ----------------------------------- -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1TARGET= $(TARGET)$(MACAB_MAJOR) SHL1OBJS=$(SLOFILES) diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk index 00f76ddeb8..44881d1301 100644 --- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk +++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk @@ -71,7 +71,7 @@ SLOFILES += \ CDEFS+=-DMINIMAL_PROFILEDISCOVER SHL1TARGET=$(TARGET) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1OBJS=$(SLOFILES) SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map deleted file mode 100644 index 750db5d4af..0000000000 --- a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map +++ /dev/null @@ -1,8 +0,0 @@ -MOZBOOTSTRAP_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk index 76161dc321..f9a2159832 100644 --- a/connectivity/source/drivers/mozab/makefile.mk +++ b/connectivity/source/drivers/mozab/makefile.mk @@ -89,7 +89,7 @@ SLOFILES=\ # --- MOZAB BASE Library ----------------------------------- -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ diff --git a/connectivity/source/drivers/mozab/mozab.map b/connectivity/source/drivers/mozab/mozab.map deleted file mode 100644 index 9f3a1f27d0..0000000000 --- a/connectivity/source/drivers/mozab/mozab.map +++ /dev/null @@ -1,8 +0,0 @@ -MOZAB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/mozab/mozabdrv.map b/connectivity/source/drivers/mozab/mozabdrv.map index 918cb530e1..a431a07377 100644 --- a/connectivity/source/drivers/mozab/mozabdrv.map +++ b/connectivity/source/drivers/mozab/mozabdrv.map @@ -1,4 +1,4 @@ -MOZABDRV_1_0 { +UDK_3_0_0 { global: OMozabConnection_CreateInstance; OMozillaBootstrap_CreateInstance; diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk index 0d46f0c35d..fc59fca38e 100644 --- a/connectivity/source/drivers/mysql/makefile.mk +++ b/connectivity/source/drivers/mysql/makefile.mk @@ -59,7 +59,7 @@ SLOFILES=\ $(SLO)$/YUsers.obj \ $(SLO)$/Yservices.obj -SHL1VERSIONMAP=$(MYSQL_TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Library ----------------------------------- diff --git a/connectivity/source/drivers/mysql/mysql.map b/connectivity/source/drivers/mysql/mysql.map deleted file mode 100644 index 834658431a..0000000000 --- a/connectivity/source/drivers/mysql/mysql.map +++ /dev/null @@ -1,8 +0,0 @@ -MYSQL_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk index 8f37b6185d..95d20f751f 100644 --- a/connectivity/source/drivers/odbc/makefile.mk +++ b/connectivity/source/drivers/odbc/makefile.mk @@ -75,7 +75,7 @@ SHL1IMPLIB= i$(ODBC_TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) -SHL1VERSIONMAP=odbc.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Targets ---------------------------------- diff --git a/connectivity/source/drivers/odbc/odbc.map b/connectivity/source/drivers/odbc/odbc.map deleted file mode 100644 index 14e4b7110c..0000000000 --- a/connectivity/source/drivers/odbc/odbc.map +++ /dev/null @@ -1,8 +0,0 @@ -ODBC_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk index 7cb514cd36..8d11a5db46 100644 --- a/connectivity/source/manager/makefile.mk +++ b/connectivity/source/manager/makefile.mk @@ -56,7 +56,7 @@ SLOFILES=\ SHL1TARGET= $(SDBC_TARGET)$(SDBC_MAJOR) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ diff --git a/connectivity/source/manager/sdbc.map b/connectivity/source/manager/sdbc.map deleted file mode 100644 index 2d8534b22e..0000000000 --- a/connectivity/source/manager/sdbc.map +++ /dev/null @@ -1,8 +0,0 @@ -SDBC_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/desktop/source/app/version.map b/desktop/source/app/version.map index 0e1b5cb619..050d56660e 100644 --- a/desktop/source/app/version.map +++ b/desktop/source/app/version.map @@ -29,7 +29,7 @@ # #************************************************************************* -soffice.3 { +UDK_3_0_0 { global: soffice_main; diff --git a/desktop/source/deployment/deployment.map b/desktop/source/deployment/deployment.map deleted file mode 100644 index 563b3d86a5..0000000000 --- a/desktop/source/deployment/deployment.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk index 4d563ae159..3c7376a4c0 100644 --- a/desktop/source/deployment/gui/makefile.mk +++ b/desktop/source/deployment/gui/makefile.mk @@ -65,7 +65,7 @@ SLOFILES = \ $(SLO)$/descedit.obj SHL1TARGET = $(TARGET)$(DLLPOSTFIX).uno -SHL1VERSIONMAP = ..$/deployment.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1STDLIBS = \ $(SALLIB) \ diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk index f63661df4c..2bacac90a3 100644 --- a/desktop/source/deployment/makefile.mk +++ b/desktop/source/deployment/makefile.mk @@ -53,7 +53,7 @@ INCPRE += inc DLLPRE = SHL1TARGET = $(TARGET)$(DLLPOSTFIX).uno -SHL1VERSIONMAP = deployment.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1LIBS = \ $(SLB)$/deployment_manager.lib \ diff --git a/desktop/source/migration/services/makefile.mk b/desktop/source/migration/services/makefile.mk index 22d28ee00c..6dc0f3fd8b 100644 --- a/desktop/source/migration/services/makefile.mk +++ b/desktop/source/migration/services/makefile.mk @@ -58,7 +58,7 @@ SLOFILES= \ $(SLO)$/autocorrmigration.obj SHL1TARGET=$(TARGET) -SHL1VERSIONMAP = migrationoo2.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1STDLIBS= \ $(DEPLOYMENTMISCLIB) \ diff --git a/desktop/source/migration/services/migrationoo2.map b/desktop/source/migration/services/migrationoo2.map deleted file mode 100644 index ac2c3750bf..0000000000 --- a/desktop/source/migration/services/migrationoo2.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/desktop/source/offacc/exports.map b/desktop/source/offacc/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/desktop/source/offacc/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/desktop/source/offacc/makefile.mk b/desktop/source/offacc/makefile.mk index e269ec44d9..15cbbe3be7 100644 --- a/desktop/source/offacc/makefile.mk +++ b/desktop/source/offacc/makefile.mk @@ -51,7 +51,7 @@ SHL1OBJS= $(SLOFILES) SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/desktop/source/pkgchk/unopkg/version.map b/desktop/source/pkgchk/unopkg/version.map index 5e0b22c95d..2b9089233b 100644 --- a/desktop/source/pkgchk/unopkg/version.map +++ b/desktop/source/pkgchk/unopkg/version.map @@ -29,7 +29,7 @@ # #************************************************************************* -unopkg.3 { +UDK_3_0_0 { global: unopkg_main; diff --git a/desktop/source/so_comp/exports.map b/desktop/source/so_comp/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/desktop/source/so_comp/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/desktop/source/so_comp/makefile.mk b/desktop/source/so_comp/makefile.mk index 4886c3701e..e5f8ec623c 100644 --- a/desktop/source/so_comp/makefile.mk +++ b/desktop/source/so_comp/makefile.mk @@ -59,7 +59,7 @@ SHL1OBJS= $(SLOFILES) SHL1TARGET= $(TARGET) SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/desktop/source/splash/exports.map b/desktop/source/splash/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/desktop/source/splash/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk index 3ca31875c9..d9a2abf8a0 100644 --- a/desktop/source/splash/makefile.mk +++ b/desktop/source/splash/makefile.mk @@ -58,7 +58,7 @@ SHL1OBJS= $(SLOFILES) \ SHL1TARGET=$(TARGET)$(DLLPOSTFIX) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/eventattacher/source/exports.map b/eventattacher/source/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/eventattacher/source/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/eventattacher/source/makefile.mk b/eventattacher/source/makefile.mk index f642559b80..fb86ddac77 100644 --- a/eventattacher/source/makefile.mk +++ b/eventattacher/source/makefile.mk @@ -48,7 +48,7 @@ SLOFILES= \ SHL1TARGET= $(TARGET) SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/fileaccess/source/exports.map b/fileaccess/source/exports.map deleted file mode 100644 index 2dd01358d4..0000000000 --- a/fileaccess/source/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -OOO_1.1 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/fileaccess/source/makefile.mk b/fileaccess/source/makefile.mk index ff9eaab41f..c18ee15ed9 100644 --- a/fileaccess/source/makefile.mk +++ b/fileaccess/source/makefile.mk @@ -50,7 +50,7 @@ SLOFILES= \ SHL1TARGET= $(TARGET) SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/formula/util/for.map b/formula/util/for.map deleted file mode 100644 index b34eff63c4..0000000000 --- a/formula/util/for.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/formula/util/forui.map b/formula/util/forui.map deleted file mode 100644 index b34eff63c4..0000000000 --- a/formula/util/forui.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/formula/util/makefile.mk b/formula/util/makefile.mk index 130bf7f9bd..16f9439d94 100644 --- a/formula/util/makefile.mk +++ b/formula/util/makefile.mk @@ -124,7 +124,6 @@ DEFLIB2NAME=$(TARGET2) .ENDIF SHL2USE_EXPORTS=name -# SHL2VERSIONMAP=$(TARGET2).map # --- .res file ---------------------------------------------------------- diff --git a/fpicker/source/aqua/exports.map b/fpicker/source/aqua/exports.map deleted file mode 100644 index f4ed78b9e9..0000000000 --- a/fpicker/source/aqua/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/fpicker/source/aqua/makefile.mk b/fpicker/source/aqua/makefile.mk index e6a8247480..1287c98dac 100644 --- a/fpicker/source/aqua/makefile.mk +++ b/fpicker/source/aqua/makefile.mk @@ -78,7 +78,7 @@ SHL1STDLIBS=\ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/fpicker/source/generic/exports.map b/fpicker/source/generic/exports.map deleted file mode 100644 index f4ed78b9e9..0000000000 --- a/fpicker/source/generic/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/fpicker/source/generic/makefile.mk b/fpicker/source/generic/makefile.mk index 7f8f8c0bc4..db3d4c868f 100644 --- a/fpicker/source/generic/makefile.mk +++ b/fpicker/source/generic/makefile.mk @@ -57,7 +57,7 @@ SHL1STDLIBS=\ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) diff --git a/fpicker/source/office/exports.map b/fpicker/source/office/exports.map deleted file mode 100644 index f4ed78b9e9..0000000000 --- a/fpicker/source/office/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/fpicker/source/office/makefile.mk b/fpicker/source/office/makefile.mk index 1362458622..beba6fb57c 100644 --- a/fpicker/source/office/makefile.mk +++ b/fpicker/source/office/makefile.mk @@ -73,7 +73,7 @@ SHL1STDLIBS=\ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) diff --git a/fpicker/source/unx/gnome/exports.map b/fpicker/source/unx/gnome/exports.map deleted file mode 100644 index f4ed78b9e9..0000000000 --- a/fpicker/source/unx/gnome/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/fpicker/source/unx/gnome/makefile.mk b/fpicker/source/unx/gnome/makefile.mk index 2c0f42cafc..82f3f891f8 100644 --- a/fpicker/source/unx/gnome/makefile.mk +++ b/fpicker/source/unx/gnome/makefile.mk @@ -91,7 +91,7 @@ SHL1STDLIBS=\ LINKFLAGSDEFS= .ENDIF # "$(OS)"=="SOLARIS" -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) .ENDIF # GTK_TWO_FOUR diff --git a/framework/util/exports.map b/framework/util/exports.map deleted file mode 100644 index 85610ad808..0000000000 --- a/framework/util/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 0a07f3cf13..0a6c9c60fd 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -223,7 +223,7 @@ SHL3DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2TARGETN) DEF3NAME= $(SHL3TARGET) -SHL3VERSIONMAP= exports.map +SHL3VERSIONMAP= $(SOLARENV)/src/component.map # --- services library ---------------------------------------------------- @@ -365,7 +365,7 @@ SHL4DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2IMPLIBN) $(SHL2TARGETN) DEF4NAME= $(SHL4TARGET) -SHL4VERSIONMAP= exports.map +SHL4VERSIONMAP= $(SOLARENV)/src/component.map # --- services library ---------------------------------------------------- @@ -396,7 +396,7 @@ SHL5DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN) DEF5NAME= $(SHL5TARGET) -SHL5VERSIONMAP= exports.map +SHL5VERSIONMAP= $(SOLARENV)/src/component.map RESLIB1NAME= fwe RESLIB1IMAGES= $(PRJ)$/res diff --git a/linguistic/workben/lex.map b/linguistic/workben/lex.map deleted file mode 100644 index bd76ef3b85..0000000000 --- a/linguistic/workben/lex.map +++ /dev/null @@ -1,8 +0,0 @@ -LEX_1_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/linguistic/workben/makefile.mk b/linguistic/workben/makefile.mk index fcabbe9422..546ac98d37 100644 --- a/linguistic/workben/makefile.mk +++ b/linguistic/workben/makefile.mk @@ -98,7 +98,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def .IF "$(OS)"!="MACOSX" -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF # build DEF file diff --git a/scripting/source/basprov/basprov.map b/scripting/source/basprov/basprov.map deleted file mode 100644 index 737cddbfe3..0000000000 --- a/scripting/source/basprov/basprov.map +++ /dev/null @@ -1,9 +0,0 @@ -OOO_1.1 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk index 2b6fe7faa3..a5c2f8ab21 100644 --- a/scripting/source/basprov/makefile.mk +++ b/scripting/source/basprov/makefile.mk @@ -54,7 +54,7 @@ SLOFILES= \ SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/scripting/source/dlgprov/dlgprov.map b/scripting/source/dlgprov/dlgprov.map deleted file mode 100644 index 737cddbfe3..0000000000 --- a/scripting/source/dlgprov/dlgprov.map +++ /dev/null @@ -1,9 +0,0 @@ -OOO_1.1 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/scripting/source/dlgprov/makefile.mk b/scripting/source/dlgprov/makefile.mk index da1c88fdd6..f90fd940de 100644 --- a/scripting/source/dlgprov/makefile.mk +++ b/scripting/source/dlgprov/makefile.mk @@ -50,7 +50,7 @@ SLOFILES= \ SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/scripting/source/stringresource/makefile.mk b/scripting/source/stringresource/makefile.mk index 970a0c5d7b..9ca28535f9 100644 --- a/scripting/source/stringresource/makefile.mk +++ b/scripting/source/stringresource/makefile.mk @@ -48,7 +48,7 @@ SLOFILES= \ SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/scripting/source/stringresource/stringresource.map b/scripting/source/stringresource/stringresource.map deleted file mode 100644 index 737cddbfe3..0000000000 --- a/scripting/source/stringresource/stringresource.map +++ /dev/null @@ -1,9 +0,0 @@ -OOO_1.1 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/desktopbe/exports.map b/shell/source/backends/desktopbe/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/backends/desktopbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk index b6bcd3d959..a8f4270b9c 100644 --- a/shell/source/backends/desktopbe/makefile.mk +++ b/shell/source/backends/desktopbe/makefile.mk @@ -66,7 +66,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/gconfbe/exports.map b/shell/source/backends/gconfbe/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/backends/gconfbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk index 472db4b244..1eddb6a843 100644 --- a/shell/source/backends/gconfbe/makefile.mk +++ b/shell/source/backends/gconfbe/makefile.mk @@ -86,7 +86,7 @@ SHL1STDLIBS= \ SHL1STDLIBS+=$(PKGCONFIG_LIBS) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/backends/kde4be/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk index 6f92762e5a..e208670332 100644 --- a/shell/source/backends/kde4be/makefile.mk +++ b/shell/source/backends/kde4be/makefile.mk @@ -83,7 +83,7 @@ SHL1STDLIBS= \ $(SALLIB) \ $(KDE4_LIBS) -lkio -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/kdebe/exports.map b/shell/source/backends/kdebe/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/backends/kdebe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk index 6159be6be1..80259409eb 100644 --- a/shell/source/backends/kdebe/makefile.mk +++ b/shell/source/backends/kdebe/makefile.mk @@ -83,7 +83,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/localebe/exports.map b/shell/source/backends/localebe/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/backends/localebe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk index 76767264a8..5ad7dc153b 100644 --- a/shell/source/backends/localebe/makefile.mk +++ b/shell/source/backends/localebe/makefile.mk @@ -67,7 +67,7 @@ SHL1STDLIBS= \ SHL1STDLIBS+= -framework CoreServices .ENDIF -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/macbe/exports.map b/shell/source/backends/macbe/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/backends/macbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk index c8f6891d6f..654fb8a8ea 100644 --- a/shell/source/backends/macbe/makefile.mk +++ b/shell/source/backends/macbe/makefile.mk @@ -72,7 +72,7 @@ SHL1STDLIBS= \ $(SALLIB) \ -framework Cocoa -framework SystemConfiguration -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/wininetbe/exports.map b/shell/source/backends/wininetbe/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/backends/wininetbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk index be43ecaded..0b423d4b91 100644 --- a/shell/source/backends/wininetbe/makefile.mk +++ b/shell/source/backends/wininetbe/makefile.mk @@ -63,7 +63,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/cmdmail/exports.map b/shell/source/cmdmail/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/cmdmail/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk index 6b83d74842..d42afc3766 100644 --- a/shell/source/cmdmail/makefile.mk +++ b/shell/source/cmdmail/makefile.mk @@ -57,7 +57,7 @@ SHL1STDLIBS=$(CPPULIB)\ $(CPPUHELPERLIB)\ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/unix/exec/exports.map b/shell/source/unix/exec/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/shell/source/unix/exec/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk index e23e249e08..1ffcfcb185 100644 --- a/shell/source/unix/exec/makefile.mk +++ b/shell/source/unix/exec/makefile.mk @@ -60,7 +60,7 @@ SHL1IMPLIB=i$(TARGET) SHL1IMPLIB= .ENDIF -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/unix/sysshell/recfile.map b/shell/source/unix/sysshell/recfile.map index 0823ea937c..2af2083f9a 100755 --- a/shell/source/unix/sysshell/recfile.map +++ b/shell/source/unix/sysshell/recfile.map @@ -1,4 +1,4 @@ -RECFILE_1_0_0 { +UDK_3_0_0 { global: add_to_recently_used_file_list; local: diff --git a/svx/source/unodialogs/textconversiondlgs/export.map b/svx/source/unodialogs/textconversiondlgs/export.map deleted file mode 100644 index ff4971857d..0000000000 --- a/svx/source/unodialogs/textconversiondlgs/export.map +++ /dev/null @@ -1,8 +0,0 @@ -EXTDBI_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/svx/source/unodialogs/textconversiondlgs/makefile.mk b/svx/source/unodialogs/textconversiondlgs/makefile.mk index 26d975e00c..54352e816c 100644 --- a/svx/source/unodialogs/textconversiondlgs/makefile.mk +++ b/svx/source/unodialogs/textconversiondlgs/makefile.mk @@ -63,7 +63,7 @@ SHL1TARGET= txcnvdlg .ELSE SHL1TARGET= $(TARGET)$(DLLPOSTFIX) .ENDIF -SHL1VERSIONMAP= export.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS= \ $(CPPULIB) \ diff --git a/ucb/source/cacher/exports.map b/ucb/source/cacher/exports.map deleted file mode 100644 index bd32ad4747..0000000000 --- a/ucb/source/cacher/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -CAC_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/cacher/makefile.mk b/ucb/source/cacher/makefile.mk index 09717b3f0f..b16298bedf 100644 --- a/ucb/source/cacher/makefile.mk +++ b/ucb/source/cacher/makefile.mk @@ -63,7 +63,7 @@ SHL1STDLIBS=\ SHL1LIBS=$(LIB1TARGET) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) .ENDIF # L10N_framework diff --git a/ucb/source/core/exports.map b/ucb/source/core/exports.map deleted file mode 100644 index 5ab48b9e42..0000000000 --- a/ucb/source/core/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UCB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk index e70b5ca879..274b0254dc 100644 --- a/ucb/source/core/makefile.mk +++ b/ucb/source/core/makefile.mk @@ -68,7 +68,7 @@ SHL1IMPLIB=i$(TARGET) .IF "$(GUI)" == "OS2" DEF1EXPORTFILE=exports2.dxp .ELSE -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF DEF1NAME=$(SHL1TARGET) diff --git a/ucb/source/sorter/exports.map b/ucb/source/sorter/exports.map deleted file mode 100644 index 953380b4a9..0000000000 --- a/ucb/source/sorter/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -SRT_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/sorter/makefile.mk b/ucb/source/sorter/makefile.mk index bcd3b64447..bf38c861d9 100644 --- a/ucb/source/sorter/makefile.mk +++ b/ucb/source/sorter/makefile.mk @@ -58,7 +58,7 @@ SHL1STDLIBS=\ SHL1LIBS=$(LIB1TARGET) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) .ENDIF # L10N_framework diff --git a/ucb/source/ucp/expand/makefile.mk b/ucb/source/ucp/expand/makefile.mk index 6b4ffc8581..d9c960cfdd 100644 --- a/ucb/source/ucp/expand/makefile.mk +++ b/ucb/source/ucp/expand/makefile.mk @@ -50,7 +50,7 @@ SHL1STDLIBS = \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP = $(TARGET).map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1TARGET = $(TARGET) SHL1DEPN = diff --git a/ucb/source/ucp/expand/ucpexpand1.uno.map b/ucb/source/ucp/expand/ucpexpand1.uno.map deleted file mode 100644 index 563b3d86a5..0000000000 --- a/ucb/source/ucp/expand/ucpexpand1.uno.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/file/exports.map b/ucb/source/ucp/file/exports.map deleted file mode 100644 index a8bd267fc9..0000000000 --- a/ucb/source/ucp/file/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -FIL_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/file/makefile.mk b/ucb/source/ucp/file/makefile.mk index d03983bca0..78407d9683 100644 --- a/ucb/source/ucp/file/makefile.mk +++ b/ucb/source/ucp/file/makefile.mk @@ -71,7 +71,7 @@ SHL1STDLIBS=\ $(SALLIB) \ $(UCBHELPERLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .IF "$(GUI)" == "OS2" DEF1EXPORTFILE=exports2.dxp diff --git a/ucb/source/ucp/ftp/makefile.mk b/ucb/source/ucp/ftp/makefile.mk index 75f5512c72..eaf593d418 100644 --- a/ucb/source/ucp/ftp/makefile.mk +++ b/ucb/source/ucp/ftp/makefile.mk @@ -72,7 +72,7 @@ LIB1OBJFILES=$(SLOFILES1) SHL1TARGET=$(TARGET)$(UCPFTP_MAJOR) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ $(CPPUHELPERLIB) \ diff --git a/ucb/source/ucp/ftp/ucpftp.map b/ucb/source/ucp/ftp/ucpftp.map deleted file mode 100644 index 0ce3cd3ad8..0000000000 --- a/ucb/source/ucp/ftp/ucpftp.map +++ /dev/null @@ -1,8 +0,0 @@ -FTP_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/gio/exports.map b/ucb/source/ucp/gio/exports.map deleted file mode 100644 index 5ec50ad779..0000000000 --- a/ucb/source/ucp/gio/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/gio/makefile.mk b/ucb/source/ucp/gio/makefile.mk index 2e7009e52a..8c3c7d2185 100644 --- a/ucb/source/ucp/gio/makefile.mk +++ b/ucb/source/ucp/gio/makefile.mk @@ -77,7 +77,7 @@ SHL1STDLIBS=\ SHL1STDLIBS+=$(PKGCONFIG_LIBS) -SHL1VERSIONMAP= exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF # "$(ENABLE_GIO)"!="" .ENDIF # L10N_framework diff --git a/ucb/source/ucp/gvfs/exports.map b/ucb/source/ucp/gvfs/exports.map deleted file mode 100644 index 5ec50ad779..0000000000 --- a/ucb/source/ucp/gvfs/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/gvfs/makefile.mk b/ucb/source/ucp/gvfs/makefile.mk index 889e3ffd41..eb26a634de 100644 --- a/ucb/source/ucp/gvfs/makefile.mk +++ b/ucb/source/ucp/gvfs/makefile.mk @@ -81,7 +81,7 @@ SHL1STDLIBS=\ SHL1STDLIBS+=$(PKGCONFIG_LIBS) -SHL1VERSIONMAP= exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF # "$(ENABLE_GNOMEVFS)"!="" .ENDIF # L10N_framework diff --git a/ucb/source/ucp/hierarchy/makefile.mk b/ucb/source/ucp/hierarchy/makefile.mk index b71ee7fa18..07edda2190 100644 --- a/ucb/source/ucp/hierarchy/makefile.mk +++ b/ucb/source/ucp/hierarchy/makefile.mk @@ -65,7 +65,7 @@ LIB1OBJFILES=$(SLOFILES) SHL1TARGET=$(TARGET)$(UCPHIER_MAJOR) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ $(CPPUHELPERLIB) \ diff --git a/ucb/source/ucp/hierarchy/ucphier.map b/ucb/source/ucp/hierarchy/ucphier.map deleted file mode 100644 index 319e7b11a9..0000000000 --- a/ucb/source/ucp/hierarchy/ucphier.map +++ /dev/null @@ -1,8 +0,0 @@ -HIER_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/odma/exports.map b/ucb/source/ucp/odma/exports.map deleted file mode 100644 index 14a2531f23..0000000000 --- a/ucb/source/ucp/odma/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -VERS_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/odma/makefile.mk b/ucb/source/ucp/odma/makefile.mk index 290898e655..89be3a829a 100644 --- a/ucb/source/ucp/odma/makefile.mk +++ b/ucb/source/ucp/odma/makefile.mk @@ -68,7 +68,7 @@ LIB1OBJFILES=$(SLOFILES) SHL1TARGET=$(TARGET)$(UCP_VERSION) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ $(CPPUHELPERLIB) \ diff --git a/ucb/source/ucp/package/exports.map b/ucb/source/ucp/package/exports.map deleted file mode 100644 index 7e12f34d1b..0000000000 --- a/ucb/source/ucp/package/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -PKG_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk index 4b4f066ac1..b91382ace9 100644 --- a/ucb/source/ucp/package/makefile.mk +++ b/ucb/source/ucp/package/makefile.mk @@ -69,7 +69,7 @@ LIB1OBJFILES=$(SLOFILES) SHL1TARGET=$(TARGET)$(UCP_VERSION) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ $(CPPUHELPERLIB) \ diff --git a/ucb/source/ucp/tdoc/exports.map b/ucb/source/ucp/tdoc/exports.map deleted file mode 100644 index 5ec50ad779..0000000000 --- a/ucb/source/ucp/tdoc/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/tdoc/makefile.mk b/ucb/source/ucp/tdoc/makefile.mk index 1c2c44b124..ac05f8cdbd 100644 --- a/ucb/source/ucp/tdoc/makefile.mk +++ b/ucb/source/ucp/tdoc/makefile.mk @@ -70,7 +70,7 @@ LIB1OBJFILES=$(SLOFILES) SHL1TARGET=$(TARGET) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP= exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ $(COMPHELPERLIB) \ diff --git a/ucb/source/ucp/webdav/exports.map b/ucb/source/ucp/webdav/exports.map deleted file mode 100644 index 73671aa978..0000000000 --- a/ucb/source/ucp/webdav/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -DAV_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk index c8891723cd..a06a5130f8 100644 --- a/ucb/source/ucp/webdav/makefile.mk +++ b/ucb/source/ucp/webdav/makefile.mk @@ -116,7 +116,7 @@ LIB1OBJFILES=$(SLOFILES) SHL1TARGET=$(TARGET)$(UCP_VERSION) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ $(CPPUHELPERLIB) \ diff --git a/uui/util/exports.map b/uui/util/exports.map deleted file mode 100644 index ba501f9ae0..0000000000 --- a/uui/util/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/uui/util/makefile.mk b/uui/util/makefile.mk index a262b94438..1c5317f2a9 100644 --- a/uui/util/makefile.mk +++ b/uui/util/makefile.mk @@ -42,7 +42,7 @@ NO_BSYMBOLIC = true SHL1TARGET = $(TARGET)$(DLLPOSTFIX) SHL1IMPLIB = i$(TARGET) -SHL1VERSIONMAP = exports.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1DEF = $(MISC)$/$(SHL1TARGET).def DEF1NAME = $(SHL1TARGET) diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk index 39bfac9562..a3aa2deda6 100644 --- a/vbahelper/util/makefile.mk +++ b/vbahelper/util/makefile.mk @@ -77,7 +77,7 @@ TARGET_MSFORMS=msforms SHL2TARGET=$(TARGET_MSFORMS)$(DLLPOSTFIX).uno SHL2IMPLIB= i$(TARGET_MSFORMS) -SHL2VERSIONMAP=$(TARGET_MSFORMS).map +SHL2VERSIONMAP=$(SOLARENV)/src/component.map SHL2DEF=$(MISC)$/$(SHL2TARGET).def DEF2NAME=$(SHL2TARGET) SHL2STDLIBS= \ diff --git a/vbahelper/util/msforms.map b/vbahelper/util/msforms.map deleted file mode 100644 index 737cddbfe3..0000000000 --- a/vbahelper/util/msforms.map +++ /dev/null @@ -1,9 +0,0 @@ -OOO_1.1 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/xmlhelp/source/treeview/makefile.mk b/xmlhelp/source/treeview/makefile.mk index 4541a1745b..3895262866 100644 --- a/xmlhelp/source/treeview/makefile.mk +++ b/xmlhelp/source/treeview/makefile.mk @@ -62,7 +62,7 @@ SHL1STDLIBS=\ $(COMPHELPERLIB) \ $(EXPATASCII3RDLIB) \ $(SALLIB) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) DEF1DES=UCB : Treeview help diff --git a/xmlhelp/source/treeview/tvhlp.map b/xmlhelp/source/treeview/tvhlp.map deleted file mode 100644 index d432afe363..0000000000 --- a/xmlhelp/source/treeview/tvhlp.map +++ /dev/null @@ -1,9 +0,0 @@ -TVHLP_1_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; \ No newline at end of file diff --git a/xmlhelp/util/exports.map b/xmlhelp/util/exports.map deleted file mode 100644 index 14a2531f23..0000000000 --- a/xmlhelp/util/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -VERS_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk index a16e7958d7..7c1f432af9 100644 --- a/xmlhelp/util/makefile.mk +++ b/xmlhelp/util/makefile.mk @@ -54,7 +54,7 @@ CFLAGS+=-GR SHL1TARGET=$(TARGET)$(UCP_VERSION) SHL1DEF=$(MISC)$/$(SHL1TARGET).def SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # Add additional libs here. SHL1STDLIBS= \ diff --git a/xmloff/source/transform/makefile.mk b/xmloff/source/transform/makefile.mk index acd80bb1f3..6d2b7c8da0 100644 --- a/xmloff/source/transform/makefile.mk +++ b/xmloff/source/transform/makefile.mk @@ -90,7 +90,7 @@ SHL1STDLIBS = \ .ELSE SHL1STDLIBS += ixo.lib .ENDIF -SHL1VERSIONMAP = xof.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1IMPLIB = i$(SHL1TARGET) DEF1NAME = $(SHL1TARGET) diff --git a/xmloff/source/transform/xof.map b/xmloff/source/transform/xof.map deleted file mode 100644 index f4ed78b9e9..0000000000 --- a/xmloff/source/transform/xof.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; -- cgit v1.2.3 From 954da1067458684f2bac0712caa0cb7fd3726b14 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 3 Feb 2010 13:43:59 +0100 Subject: sb118: additional main -> SAL_MAIN adaptions (to ensure osl_setCommandArgs is called) --- shell/source/tools/lngconvex/lngconvex.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx index bc15796b25..4188b712b3 100644 --- a/shell/source/tools/lngconvex/lngconvex.cxx +++ b/shell/source/tools/lngconvex/lngconvex.cxx @@ -48,6 +48,7 @@ #include "osl/thread.h" #include "osl/process.h" #include "osl/file.hxx" +#include "sal/main.h" #include "tools/config.hxx" #include "i18npool/mslangid.hxx" @@ -568,7 +569,7 @@ void inflate_rc_template_to_file( #define RC_HEADER(c) MAKE_ABSOLUTE((c).get_arg("-rch")) #define RC_FOOTER(c) MAKE_ABSOLUTE((c).get_arg("-rcf")) -int main(int argc, char* argv[]) +SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { try { -- cgit v1.2.3 From b4a78e5d9df41f2355d397e91ebce294446e4099 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 11 Feb 2010 11:07:17 +0100 Subject: sb118: #i109112# re-purpose EXTRAJARFILES --- connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk | 7 +++---- xmlhelp/source/com/sun/star/help/makefile.mk | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk index 3977a4869e..3ded70663c 100644 --- a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk +++ b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk @@ -42,10 +42,9 @@ SECONDARY_PACKAGE = org$/hsqldb$/lib .IF "$(SYSTEM_HSQLDB)" == "YES" -XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(HSQLDB_JAR) -JARFILES+= $(HSQLDB_JAR) +EXTRAJARFILES = $(HSQLDB_JAR) .ELSE -JARFILES+= hsqldb.jar +JARFILES = hsqldb.jar .ENDIF JAVAFILES =\ @@ -64,7 +63,7 @@ JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class JARCOMPRESS = TRUE JARCLASSDIRS = $(PACKAGE) $(SECONDARY_PACKAGE) JARTARGET = $(TARGET).jar -JARCLASSPATH = $(JARFILES) .. +JARCLASSPATH = $(JARFILES) $(EXTRAJARFILES) .. # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk index eab2a6a08a..63ec8adfaa 100644 --- a/xmlhelp/source/com/sun/star/help/makefile.mk +++ b/xmlhelp/source/com/sun/star/help/makefile.mk @@ -76,8 +76,8 @@ ADDFILES = $(subst,$(SOLARBINDIR)$/help,$(CLASSDIR) $(TRANSEX3FILES)) JARFILES = ridl.jar jurt.jar unoil.jar juh.jar .IF "$(SYSTEM_LUCENE)" == "YES" -XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR) -JARCLASSPATH = file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR) +EXTRAJARFILES = $(LUCENE_CORE_JAR) $(LUCENE_ANALYZERS_JAR) +JARCLASSPATH = $(EXTRAJARFILES) .ELSE JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar JARCLASSPATH = lucene-core-2.3.jar lucene-analyzers-2.3.jar -- cgit v1.2.3 From f24928267f5f3f556fc3f88361c8c73127208f5e Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 26 Mar 2010 16:38:11 +0100 Subject: native0: #161580# make native intro progress optional - transplanted from 1070cbd32693@native0 --- desktop/source/splash/splash.cxx | 11 ++++++++++- desktop/source/splash/splash.hxx | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index fe297ea90b..7e2313b5eb 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -60,6 +60,7 @@ SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr) , _vdev(*((IntroWindow*)this)) , _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED)) , _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED)) + , _bNativeProgress(true) , _iMax(100) , _iProgress(0) , _eBitmapMode(BM_DEFAULTMODE) @@ -297,6 +298,9 @@ void SplashScreen::loadConfig() OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressPosition" ) ) ); OUString sFullScreenSplash = implReadBootstrapKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "FullScreenSplash" ) ) ); + OUString sNativeProgress = implReadBootstrapKey( + OUString( RTL_CONSTASCII_USTRINGPARAM( "NativeProgress" ) ) ); + // Determine full screen splash mode _bFullScreenSplash = (( sFullScreenSplash.getLength() > 0 ) && @@ -346,6 +350,11 @@ void SplashScreen::loadConfig() _cProgressBarColor = Color( nRed, nGreen, nBlue ); } } + + if( sNativeProgress.getLength() ) + { + _bNativeProgress = sNativeProgress.toBoolean(); + } if ( sSize.getLength() ) { @@ -618,7 +627,7 @@ void SplashScreen::Paint( const Rectangle&) BOOL bNativeOK = FALSE; // in case of native controls we need to draw directly to the window - if( IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) ) + if( _bNativeProgress && IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) ) { DrawBitmapEx( Point(), _aIntroBmp ); diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx index 1e6b77ac5e..8d1bfb7dbe 100644 --- a/desktop/source/splash/splash.hxx +++ b/desktop/source/splash/splash.hxx @@ -89,6 +89,7 @@ private: BitmapEx _aIntroBmp; Color _cProgressFrameColor; Color _cProgressBarColor; + bool _bNativeProgress; OUString _sAppName; std::vector< FullScreenProgressRatioValue > _sFullScreenProgressRatioValues; -- cgit v1.2.3 From f228cdb48cd2e0e25a862d0fe38f22d82e6ca6a5 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 26 Mar 2010 17:21:42 +0100 Subject: #i107751# #i89119# flat image buttons - transplanted from 7854e4fde73a@native0 --- framework/source/services/backingwindow.cxx | 96 +++++++++++++---------------- 1 file changed, 42 insertions(+), 54 deletions(-) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 39f3910382..b0b81e3f80 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -110,6 +110,7 @@ Size DecoToolBox::getMinSize() return maMinSize; } +#define STC_BUTTON_STYLE (WB_LEFT | WB_VCENTER | WB_FLATBUTTON | WB_BEVELBUTTON) BackingWindow::BackingWindow( Window* i_pParent ) : Window( i_pParent, FwkResId( DLG_BACKING ) ), @@ -117,21 +118,21 @@ BackingWindow::BackingWindow( Window* i_pParent ) : maProduct( this, WB_LEFT ), maCreateText( this, WB_LEFT ), maWriterText( this, WB_WORDBREAK | WB_VCENTER ), - maWriterButton( this, WB_CENTER | WB_BEVELBUTTON ), + maWriterButton( this, STC_BUTTON_STYLE ), maCalcText( this, WB_WORDBREAK | WB_VCENTER ), - maCalcButton( this, WB_CENTER | WB_BEVELBUTTON ), + maCalcButton( this, STC_BUTTON_STYLE ), maImpressText( this, WB_WORDBREAK | WB_VCENTER ), - maImpressButton( this, WB_CENTER | WB_BEVELBUTTON ), + maImpressButton( this, STC_BUTTON_STYLE ), maDrawText( this, WB_WORDBREAK | WB_VCENTER ), - maDrawButton( this, WB_CENTER | WB_BEVELBUTTON ), + maDrawButton( this, STC_BUTTON_STYLE ), maDBText( this, WB_WORDBREAK | WB_VCENTER ), - maDBButton( this, WB_CENTER | WB_BEVELBUTTON ), + maDBButton( this, STC_BUTTON_STYLE ), maMathText( this, WB_WORDBREAK | WB_VCENTER ), - maMathButton( this, WB_CENTER | WB_BEVELBUTTON ), + maMathButton( this, STC_BUTTON_STYLE ), maTemplateText( this, WB_WORDBREAK | WB_VCENTER ), - maTemplateButton( this, WB_CENTER | WB_BEVELBUTTON ), + maTemplateButton( this, STC_BUTTON_STYLE ), maOpenText( this, WB_WORDBREAK | WB_VCENTER ), - maOpenButton( this, WB_CENTER | WB_BEVELBUTTON ), + maOpenButton( this, STC_BUTTON_STYLE ), maToolbox( this, WB_DIALOGCONTROL ), maWelcomeString( FwkResId( STR_BACKING_WELCOME ) ), maProductString( FwkResId( STR_BACKING_WELCOMEPRODUCT ) ), @@ -467,20 +468,20 @@ void BackingWindow::initControls() layoutButtonAndText( WRITER_URL, 0, aFileNewAppsAvailable, aModuleOptions, SvtModuleOptions::E_SWRITER, maWriterButton, maWriterText, aMnemns ); - layoutButtonAndText( CALC_URL, 1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SCALC, - maCalcButton, maCalcText, aMnemns ); - nYPos += maButtonImageSize.Height() + 10; - layoutButtonAndText( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SIMPRESS, - maImpressButton, maImpressText, aMnemns ); layoutButtonAndText( DRAW_URL, 1, aFileNewAppsAvailable, aModuleOptions, SvtModuleOptions::E_SDRAW, maDrawButton, maDrawText, aMnemns ); nYPos += maButtonImageSize.Height() + 10; - layoutButtonAndText( BASE_URL, 0, aFileNewAppsAvailable, + layoutButtonAndText( CALC_URL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SCALC, + maCalcButton, maCalcText, aMnemns ); + layoutButtonAndText( BASE_URL, 1, aFileNewAppsAvailable, aModuleOptions, SvtModuleOptions::E_SDATABASE, maDBButton, maDBText, aMnemns ); + nYPos += maButtonImageSize.Height() + 10; + layoutButtonAndText( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SIMPRESS, + maImpressButton, maImpressText, aMnemns ); layoutButtonAndText( MATH_URL, 1, aFileNewAppsAvailable, aModuleOptions, SvtModuleOptions::E_SMATH, maMathButton, maMathText, aMnemns ); @@ -519,7 +520,9 @@ void BackingWindow::initControls() if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 ) { maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2; - mnColumnWidth[0] += (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20)/2; + long nDelta = (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20)/2; + mnColumnWidth[0] += nDelta/2; + mnColumnWidth[1] += nDelta/2; } } @@ -575,14 +578,13 @@ void BackingWindow::layoutButtonAndText( } // setup text - i_rText.SetFont( maTextFont ); - i_rText.SetControlFont( maTextFont ); + i_rBtn.SetFont( maTextFont ); + i_rBtn.SetControlFont( maTextFont ); String aText( i_rStr.Len() ? i_rStr : SvFileInformationManager::GetDescription( INetURLObject( aURL ) ) ); i_rMnemns.CreateMnemonic( aText ); - i_rText.SetText( aText ); - - long nTextWidth = i_rText.GetTextWidth( i_rText.GetText() ); - i_rText.SetPaintTransparent( TRUE ); + i_rBtn.SetText( aText ); + + long nTextWidth = i_rBtn.GetTextWidth( i_rBtn.GetText() ); nTextWidth += maButtonImageSize.Width() + 30; if( nColumn >= 0 && nColumn < static_cast(sizeof(mnColumnWidth)/sizeof(mnColumnWidth[0])) ) @@ -591,9 +593,15 @@ void BackingWindow::layoutButtonAndText( mnColumnWidth[nColumn] = nTextWidth; } + i_rBtn.SetImageAlign( IMAGEALIGN_LEFT ); // show the controls i_rBtn.Show(); - i_rText.Show(); + i_rText.Show( FALSE ); + + + // FIXME: the only reason the FixedTexts are left are not to trigger + // a translation change due to changed src files. For the next minor + // the FixedTexts should be removed completely } void BackingWindow::Paint( const Rectangle& ) @@ -716,47 +724,27 @@ void BackingWindow::Resize() else nYPos += nWDelta/2 - nDiff; - maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); - maWriterText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); - maCalcText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), - Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); + maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); - maImpressText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); - maDrawText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), - Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); + maDBButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maDBButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); - maDBText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); - maMathText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), - Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); + maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nB2Delta - nDiff; if( mnLayoutStyle == 0 ) { - maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); - maTemplateText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); - maOpenText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; } else { - maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), maButtonImageSize ); - maTemplateText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10, nYPos ), - Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); - maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize ); - maOpenText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ), - Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) ); + maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); + maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); } } -- cgit v1.2.3 From 2de65c4bfd9c196a91713e7624aba36ca01214c5 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 26 Mar 2010 17:30:54 +0100 Subject: #i107751# #i89119# reorder buttons - transplanted from 6735ee79adb4@native0 --- framework/source/services/backingwindow.cxx | 39 ++++++++++++++++++----------- framework/source/services/backingwindow.hxx | 1 + 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index b0b81e3f80..822653c70b 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -146,6 +146,7 @@ BackingWindow::BackingWindow( Window* i_pParent ) : mnBtnPos( 240 ) { mnColumnWidth[0] = mnColumnWidth[1] = 0; + mnTextColumnWidth[0] = mnTextColumnWidth[1] = 0; try { @@ -347,7 +348,7 @@ void BackingWindow::initBackground() maOpenText.SetControlBackground( aTextBGColor ); if( mnLayoutStyle == 1 ) - mnBtnPos = maBackgroundLeft.GetSizePixel().Width(); + mnBtnPos = maBackgroundLeft.GetSizePixel().Width() + 40; } void BackingWindow::initControls() @@ -504,10 +505,10 @@ void BackingWindow::initControls() { layoutButtonAndText( NULL, 0, aFileNewAppsAvailable, aModuleOptions, SvtModuleOptions::E_SWRITER, - maTemplateButton, maTemplateText, aMnemns, maTemplateString ); + maOpenButton, maOpenText, aMnemns, maOpenString ); layoutButtonAndText( NULL, 1, aFileNewAppsAvailable, aModuleOptions, SvtModuleOptions::E_SWRITER, - maOpenButton, maOpenText, aMnemns, maOpenString ); + maTemplateButton, maTemplateText, aMnemns, maTemplateString ); nYPos += 10; } @@ -515,16 +516,24 @@ void BackingWindow::initControls() if( mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20 > maControlRect.GetWidth() ) maControlRect.Right() = maControlRect.Left() + mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20; + mnTextColumnWidth[0] = mnColumnWidth[0]; + mnTextColumnWidth[1] = mnColumnWidth[1]; + if( mnLayoutStyle == 1 ) { if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 ) { maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2; - long nDelta = (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20)/2; + long nDelta = (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20); mnColumnWidth[0] += nDelta/2; mnColumnWidth[1] += nDelta/2; } } + else + { + mnColumnWidth[0] += 30; + mnColumnWidth[1] += 30; + } maToolbox.SetSelectHdl( LINK( this, BackingWindow, ToolboxHdl ) ); if( mnLayoutStyle == 0 ) @@ -586,7 +595,7 @@ void BackingWindow::layoutButtonAndText( long nTextWidth = i_rBtn.GetTextWidth( i_rBtn.GetText() ); - nTextWidth += maButtonImageSize.Width() + 30; + nTextWidth += maButtonImageSize.Width(); if( nColumn >= 0 && nColumn < static_cast(sizeof(mnColumnWidth)/sizeof(mnColumnWidth[0])) ) { if( nTextWidth > mnColumnWidth[nColumn] ) @@ -724,27 +733,27 @@ void BackingWindow::Resize() else nYPos += nWDelta/2 - nDiff; - maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); - maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); + maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); + maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); - maDBButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); + maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); + maDBButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); - maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); + maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); + maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nB2Delta - nDiff; if( mnLayoutStyle == 0 ) { - maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); + maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; - maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); + maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; } else { - maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnColumnWidth[0], maButtonImageSize.Height() ) ); - maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnColumnWidth[1], maButtonImageSize.Height() ) ); + maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); + maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); } } diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index c066cd078d..270f9d6dbc 100644 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx @@ -121,6 +121,7 @@ namespace framework Rectangle maControlRect; long mnColumnWidth[2]; + long mnTextColumnWidth[2]; Color maLabelTextColor; Color maWelcomeTextColor; -- cgit v1.2.3 From 2d1e2894d468f5d6fb483f437aa70a1340a5bf70 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 26 Mar 2010 17:39:11 +0100 Subject: native0: #161641# XPackageManager.addPackage can install a fold - transplanted from 0dce9af1d5a3@native0 --- framework/source/services/backingwindow.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 822653c70b..0ff26114a4 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -296,7 +296,13 @@ void BackingWindow::initBackground() SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() ); bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode(); - maWelcomeTextColor = maLabelTextColor = bDark ? Color( COL_WHITE ) : Color( 0x26, 0x35, 0x42 ); + if( bDark ) + maWelcomeTextColor = maLabelTextColor = Color( COL_WHITE ); + else if( mnLayoutStyle == 1 ) + maWelcomeTextColor = maLabelTextColor = Color( COL_BLACK ); + else + maWelcomeTextColor = maLabelTextColor = Color( 0x26, 0x35, 0x42 ); + Color aTextBGColor( bDark ? COL_BLACK : COL_WHITE ); // select image set @@ -615,14 +621,6 @@ void BackingWindow::layoutButtonAndText( void BackingWindow::Paint( const Rectangle& ) { - bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode(); - - Color aBackColor( bDark ? COL_BLACK : COL_WHITE ); - - // fill control rect - SetLineColor(); - SetFillColor( aBackColor ); - DrawRect( maControlRect ); // draw bitmap if( GetSettings().GetLayoutRTL() ) -- cgit v1.2.3 From af339bb1e1e3a68397221bf0b15b48349ae07703 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 11 Feb 2010 11:24:50 +0100 Subject: native0: #i100282# Support unopkg --suppress-license option --- .../deployment/inc/dp_descriptioninfoset.hxx | 16 +++++ .../deployment/misc/dp_descriptioninfoset.cxx | 44 +++++++++++++ .../deployment/registry/package/dp_package.cxx | 68 ++++++++------------- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 11 +++- desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 34 ++++++++--- desktop/source/pkgchk/unopkg/unopkg_shared.h | 3 +- .../deployment/simple_license/suppress_license.oxt | Bin 0 -> 2143 bytes .../simple_license/tests_simple_license.odt | Bin 15621 -> 16629 bytes 8 files changed, 121 insertions(+), 55 deletions(-) create mode 100755 desktop/test/deployment/simple_license/suppress_license.oxt diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx index cd964761da..80c46df937 100644 --- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx +++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx @@ -53,6 +53,15 @@ namespace rtl { class OUString; } namespace dp_misc { +struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC SimpleLicenseAttributes +{ + ::rtl::OUString acceptBy; + //Attribute suppress-on-update. Default is false. + bool suppressOnUpdate; + //Attribute suppress-if-required. Default is false. + bool suppressIfRequired; +}; + /** Access to the content of an XML description element. @@ -132,6 +141,13 @@ public: */ ::rtl::OUString getLocalizedLicenseURL() const; + /** returns the attributes of the simple-license element + + As long as there is a simple-license element, the function will return + the structure. If it does not exist, then the optional object is uninitialized. + */ + ::boost::optional getSimpleLicenseAttributes() const; + /** returns the localized display name of the extensions. In case there is no localized display-name then an empty string is returned. diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index 1ecb757d07..73df2b0168 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -370,6 +370,50 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getUrls( } +::boost::optional +DescriptionInfoset::getSimpleLicenseAttributes() const +{ + //Check if the node exist + css::uno::Reference< css::xml::dom::XNode > n; + if (m_element.is()) { + try { + n = m_xpath->selectSingleNode(m_element, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "/desc:description/desc:registration/desc:simple-license/@accept-by"))); + } catch (css::xml::xpath::XPathException &) { + // ignore + } + if (n.is()) + { + SimpleLicenseAttributes attributes; + attributes.acceptBy = + getNodeValueFromExpression(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "/desc:description/desc:registration/desc:simple-license/@accept-by"))); + + ::boost::optional< ::rtl::OUString > suppressOnUpdate = getOptionalValue( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "/desc:description/desc:registration/desc:simple-license/@suppress-on-update"))); + if (suppressOnUpdate) + attributes.suppressOnUpdate = (*suppressOnUpdate).trim().equalsIgnoreAsciiCase( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true"))); + else + attributes.suppressOnUpdate = false; + + ::boost::optional< ::rtl::OUString > suppressIfRequired = getOptionalValue( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "/desc:description/desc:registration/desc:simple-license/@suppress-if-required"))); + if (suppressIfRequired) + attributes.suppressIfRequired = (*suppressIfRequired).trim().equalsIgnoreAsciiCase( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true"))); + else + attributes.suppressIfRequired = false; + + return ::boost::optional(attributes); + } + } + return ::boost::optional(); +} + ::rtl::OUString DescriptionInfoset::getLocalizedDescriptionURL() const { return getLocalizedHREFAttrFromChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index bffe47b5e7..8a61eb026f 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -70,7 +70,7 @@ #include "com/sun/star/xml/dom/XDocumentBuilder.hpp" #include "com/sun/star/xml/xpath/XXPathAPI.hpp" #include "com/sun/star/deployment/XPackageManager.hpp" - +#include "boost/optional.hpp" #include #include @@ -583,21 +583,12 @@ bool BackendImpl::PackageImpl::checkDependencies( { try { - css::uno::Reference xRoot = desc.getRootElement(); - css::uno::Reference xPath = - getDescriptionInfoset().getXpath(); - - css::uno::Reference nodeSimpleLic; - try { - nodeSimpleLic = xPath->selectSingleNode(xRoot, - OUSTR("/desc:description/desc:registration/desc:simple-license")); - } catch (css::xml::xpath::XPathException &) { - // ignore - } - - if (!nodeSimpleLic.is()) + DescriptionInfoset info = getDescriptionInfoset(); + ::boost::optional simplLicAttr + = info.getSimpleLicenseAttributes(); + if (! simplLicAttr) return true; - OUString sLic = getDescriptionInfoset().getLocalizedLicenseURL(); + OUString sLic = info.getLocalizedLicenseURL(); //If we do not get a localized licence then there is an error in the description.xml //This should be handled by using a validating parser. Therefore we assume that no //license is available. @@ -606,23 +597,20 @@ bool BackendImpl::PackageImpl::checkDependencies( OUSTR("Could not obtain path to license. Possible error in description.xml"), 0, Any()); OUString sHref = desc.getExtensionRootUrl() + OUSTR("/") + sLic; OUString sLicense = getTextFromURL(xCmdEnv, sHref); - //determine who has to agree to the license - css::uno::Reference nodeAttribWho3 = - xPath->eval(nodeSimpleLic, - OUSTR("@accept-by")); - OUString sAccept = nodeAttribWho3->getString().trim(); + ////determine who has to agree to the license //check correct value for attribute - if ( ! (sAccept.equals(OUSTR("user")) || sAccept.equals(OUSTR("admin")))) + if ( ! (simplLicAttr->acceptBy.equals(OUSTR("user")) || simplLicAttr->acceptBy.equals(OUSTR("admin")))) throw css::deployment::DeploymentException( OUSTR("Could not obtain attribute simple-lincense@accept-by or it has no valid value"), 0, Any()); //If if @accept-by="user" then every user needs to accept the license before it can be installed. - //Therefore we must prevent the installation as shared extension. + //Therefore we must prevent the installation as shared extension unless suppress-if-required="true" OSL_ASSERT(aContextName.getLength()); - if (sAccept.equals(OUSTR("user")) && aContextName.equals(OUSTR("shared"))) + if (simplLicAttr->acceptBy.equals(OUSTR("user")) && aContextName.equals(OUSTR("shared"))) { - css::deployment::LicenseIndividualAgreementException exc = - css::deployment::LicenseIndividualAgreementException(OUString(), 0, m_name); + css::deployment::LicenseIndividualAgreementException + exc = css::deployment::LicenseIndividualAgreementException( + OUString(), 0, m_name, simplLicAttr->suppressIfRequired); bool approve = false; bool abort = false; @@ -632,32 +620,24 @@ bool BackendImpl::PackageImpl::checkDependencies( OUSTR("Could not interact with user."), 0, Any()); if (abort == true) return false; - //We should always prevent installation - OSL_ASSERT(0); - } - - //determine optional attribute simple-license@suppressOnUpdate - css::uno::Reference elemSimpleLic(nodeSimpleLic, css::uno::UNO_QUERY_THROW); - sal_Bool bSuppress = sal_False; - if (elemSimpleLic->hasAttribute(OUSTR("suppress-on-update"))) - { - if (elemSimpleLic->getAttribute(OUSTR("suppress-on-update")).equals(OUSTR("true"))) - bSuppress = sal_True; + + //If the unopkg --suppress-license was used and simplLicAttr->suppressIfRequired == true, + //then the user implicitely accepts the license } //Only use interaction if there is no version of this extension already installed //and the suppress-on-update flag is not set for the new extension - // bInstalled | bSuppress | show license + // bInstalled | bSuppressOnUpdate | show license //---------------------------------------- - // 0 | 0 | 1 - // 0 | 1 | 1 - // 1 | 0 | 1 - // 1 | 1 | 0 + // 0 | 0 | 1 + // 0 | 1 | 1 + // 1 | 0 | 1 + // 1 | 1 | 0 - if ( !(bInstalled && bSuppress)) + if ( !(bInstalled && simplLicAttr->suppressOnUpdate)) { - css::deployment::LicenseException licExc = - css::deployment::LicenseException(OUString(), 0, m_name, sLicense); + css::deployment::LicenseException licExc( + OUString(), 0, m_name, sLicense, simplLicAttr->suppressIfRequired); bool approve = false; bool abort = false; if (! interactContinuation( diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 6b49ed0f48..dc976718dc 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -82,6 +82,8 @@ const char s_usingText [] = " -V, --version version information\n" " -v, --verbose verbose output to stdout\n" " -f, --force force overwriting existing extensions\n" +" -s, --suppress-license prevents showing the license provided that\n" +" the extension allows it\n" " --log-file custom log file; default: /log.txt\n" " --shared expert feature: operate on shared installation\n" " deployment context;\n" @@ -103,6 +105,7 @@ const OptionInfo s_option_infos [] = { { RTL_CONSTASCII_STRINGPARAM("shared"), '\0', false }, { RTL_CONSTASCII_STRINGPARAM("deployment-context"), '\0', true }, { RTL_CONSTASCII_STRINGPARAM("bundled"), '\0', false}, + { RTL_CONSTASCII_STRINGPARAM("suppress-license"), 's', false}, { 0, 0, '\0', false } }; @@ -207,6 +210,7 @@ extern "C" int unopkg_main() bool option_force = false; bool option_verbose = false; bool option_bundled = false; + bool option_suppressLicense = false; bool subcmd_add = false; bool subcmd_gui = false; OUString logFile; @@ -230,6 +234,9 @@ extern "C" int unopkg_main() s_option_infos, OUSTR("version") ); OptionInfo const * info_bundled = getOptionInfo( s_option_infos, OUSTR("bundled") ); + OptionInfo const * info_suppressLicense = getOptionInfo( + s_option_infos, OUSTR("suppress-license") ); + Reference xComponentContext; Reference xLocalComponentContext; @@ -271,6 +278,7 @@ extern "C" int unopkg_main() !readOption( &option_shared, info_shared, &nPos ) && !readOption( &option_force, info_force, &nPos ) && !readOption( &option_bundled, info_bundled, &nPos ) && + !readOption( &option_suppressLicense, info_suppressLicense, &nPos ) && !readArgument( &deploymentContext, info_context, &nPos ) && !isBootstrapVariable(&nPos)) { @@ -342,7 +350,8 @@ extern "C" int unopkg_main() Reference< ::com::sun::star::ucb::XCommandEnvironment > xCmdEnv( createCmdEnv( xComponentContext, logFile, - option_force, option_verbose, option_bundled) ); + option_force, option_verbose, option_bundled, + option_suppressLicense) ); if (subcmd_add || subCommand.equalsAsciiL( diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx index 68eb11f91b..808f30712f 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx @@ -86,6 +86,7 @@ class CommandEnvironmentImpl bool m_option_force_overwrite; bool m_option_verbose; bool m_option_bundled; + bool m_option_suppressLicense; Reference< XComponentContext > m_xComponentContext; Reference< XProgressHandler > m_xLogFile; @@ -99,7 +100,8 @@ public: OUString const & log_file, bool option_force_overwrite, bool option_verbose, - bool option_bundled); + bool option_bundled, + bool option_suppressLicense); // XCommandEnvironment virtual Reference< task::XInteractionHandler > SAL_CALL @@ -124,11 +126,13 @@ CommandEnvironmentImpl::CommandEnvironmentImpl( OUString const & log_file, bool option_force_overwrite, bool option_verbose, - bool option_bundled) + bool option_bundled, + bool option_suppressLicense) : m_logLevel(0), m_option_force_overwrite( option_force_overwrite ), m_option_verbose( option_verbose ), m_option_bundled( option_bundled), + m_option_suppressLicense( option_suppressLicense), m_xComponentContext(xComponentContext) { if (log_file.getLength() > 0) { @@ -279,15 +283,25 @@ void CommandEnvironmentImpl::handle( } else if (request >>= licAgreementExc) { - String sResMsg( ResId( RID_STR_UNOPKG_NO_SHARED_ALLOWED, *DeploymentResMgr::get() ) ); - sResMsg.SearchAndReplaceAllAscii( "%NAME", licAgreementExc.ExtensionName ); - dp_misc::writeConsole(OUSTR("\n") + sResMsg + OUSTR("\n\n")); - abort = true; + if (m_option_suppressLicense && licAgreementExc.SuppressIfRequired) + { + approve = true; + } + else + { + String sResMsg( ResId( RID_STR_UNOPKG_NO_SHARED_ALLOWED, *DeploymentResMgr::get() ) ); + sResMsg.SearchAndReplaceAllAscii( "%NAME", licAgreementExc.ExtensionName ); + dp_misc::writeConsole(OUSTR("\n") + sResMsg + OUSTR("\n\n")); + abort = true; + } } else if (request >>= licExc) { bLicenseException = true; - printLicense(licExc.Text, approve, abort); + if (m_option_suppressLicense && licExc.SuppressIfRequired) + approve = true; + else + printLicense(licExc.Text, approve, abort); } else if (request >>= instExc) { @@ -432,10 +446,12 @@ Reference< XCommandEnvironment > createCmdEnv( OUString const & logFile, bool option_force_overwrite, bool option_verbose, - bool option_bundled) + bool option_bundled, + bool option_suppressLicense) { return new CommandEnvironmentImpl( - xContext, logFile, option_force_overwrite, option_verbose, option_bundled); + xContext, logFile, option_force_overwrite, option_verbose, option_bundled, + option_suppressLicense); } } // unopkg diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index 397c57c6a3..07a30abfb3 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -163,7 +163,8 @@ css::uno::Reference createCmdEnv( ::rtl::OUString const & logFile, bool option_force_overwrite, bool option_verbose, - bool option_bundled); + bool option_bundled, + bool option_suppressLicense); //============================================================================== void printf_packages( diff --git a/desktop/test/deployment/simple_license/suppress_license.oxt b/desktop/test/deployment/simple_license/suppress_license.oxt new file mode 100755 index 0000000000..2bacd6aa37 Binary files /dev/null and b/desktop/test/deployment/simple_license/suppress_license.oxt differ diff --git a/desktop/test/deployment/simple_license/tests_simple_license.odt b/desktop/test/deployment/simple_license/tests_simple_license.odt index b0f5410d99..b0c86e11c6 100644 Binary files a/desktop/test/deployment/simple_license/tests_simple_license.odt and b/desktop/test/deployment/simple_license/tests_simple_license.odt differ -- cgit v1.2.3 From 15a39a29488325e928c39904a7e099842f875914 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Thu, 11 Feb 2010 15:46:14 +0000 Subject: #i108897# set first bit to 20h --- connectivity/source/drivers/dbase/DTable.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index c8fadc05e6..ab6fc6d580 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1527,6 +1527,7 @@ BOOL ODbaseTable::InsertRow(OValueRefVector& rRow, BOOL bFlush,const Reference Date: Fri, 12 Feb 2010 21:44:58 +0100 Subject: sb118: introduced JAVAIFLAGS so that Java interpreter matches OOo jnilibs --- sfx2/qa/complex/docinfo/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/qa/complex/docinfo/makefile.mk b/sfx2/qa/complex/docinfo/makefile.mk index 7c074ccbe8..0ab561b970 100644 --- a/sfx2/qa/complex/docinfo/makefile.mk +++ b/sfx2/qa/complex/docinfo/makefile.mk @@ -57,4 +57,4 @@ JARCOMPRESS = TRUE run: - $(JAVAI) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b) + $(JAVAI) $(JAVAIFLAGS) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b) -- cgit v1.2.3 From fa6ad6b9df8808db24764ebdce0c5301130fab50 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 16 Feb 2010 11:53:58 +0100 Subject: sb118: adapted remaining */qa/unoapi tests to new framework --- configmgr/prj/build.lst | 2 +- configmgr/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ configmgr/qa/unoapi/makefile.mk | 42 ++++++++++++++++----------------- framework/prj/build.lst | 2 +- framework/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ framework/qa/unoapi/makefile.mk | 39 +++++++++++++++--------------- linguistic/prj/build.lst | 1 + linguistic/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ linguistic/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- sfx2/prj/build.lst | 1 + sfx2/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ sfx2/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- svx/prj/build.lst | 1 + svx/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ svx/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- ucb/prj/build.lst | 1 + ucb/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ ucb/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- xmloff/prj/build.lst | 1 + xmloff/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ xmloff/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- 21 files changed, 505 insertions(+), 122 deletions(-) create mode 100644 configmgr/qa/unoapi/Test.java create mode 100644 framework/qa/unoapi/Test.java create mode 100644 linguistic/qa/unoapi/Test.java create mode 100644 sfx2/qa/unoapi/Test.java create mode 100644 svx/qa/unoapi/Test.java create mode 100644 ucb/qa/unoapi/Test.java create mode 100644 xmloff/qa/unoapi/Test.java diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst index a3d93b598a..46edcd8b9f 100644 --- a/configmgr/prj/build.lst +++ b/configmgr/prj/build.lst @@ -15,4 +15,4 @@ cg configmgr\source\registry nmake - all cg_reg cg_inc NULL cg configmgr\source\platformbe nmake - all cg_platformbe cg_inc NULL cg configmgr\util nmake - all cg_util cg_platformbe cg_api cg_api2 cg_misc cg_reg cg_trcache cg_data cg_tree cg_treemgr cg_xml cg_backend cg_localbe NULL cg configmgr\source\localbe nmake - all cg_localbe cg_inc NULL - +cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL diff --git a/configmgr/qa/unoapi/Test.java b/configmgr/qa/unoapi/Test.java new file mode 100644 index 0000000000..5c820ed53d --- /dev/null +++ b/configmgr/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.configmgr.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "cfgmgr2.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/configmgr/qa/unoapi/makefile.mk b/configmgr/qa/unoapi/makefile.mk index 6be9331b2c..879e3bebde 100644 --- a/configmgr/qa/unoapi/makefile.mk +++ b/configmgr/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # 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 $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.7 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,23 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. -PRJNAME=configmgr -TARGET=qa_unoapi +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -.INCLUDE: settings.mk +PRJ = ../.. +PRJNAME = configmgr +TARGET = qa_unoapi +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/configmgr/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END + +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce cfgmgr2.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments - @echo ======================================================================= - @echo In case of problems with sysmgr1.SystemIntegration make sure that you - @echo ======================================================================= - @echo built and registered qadevOOo/testsdocs/backend/org/openoffice/JavaSystemBackend - @echo ======================================================================= +.END diff --git a/framework/prj/build.lst b/framework/prj/build.lst index b9814037e7..5c745e0907 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -20,4 +20,4 @@ fr framework\source\uiconfiguration nmake - all fr_uiconfiguration f fr framework\source\accelerators nmake - all fr_accelerators fr_threadhelp fr_inc NULL fr framework\source\tabwin nmake - all fr_tabwin fr_threadhelp fr_inc NULL fr framework\util nmake - all fr_util fr_constant fr_threadhelp fr_classes fr_loadenv fr_jobs fr_interaction fr_helper fr_dispatch fr_services fr_register fr_recording fr_layoutmanager fr_uielement fr_uifactory fr_xml fr_uiconfiguration fr_accelerators fr_tabwin NULL - +fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL diff --git a/framework/qa/unoapi/Test.java b/framework/qa/unoapi/Test.java new file mode 100644 index 0000000000..da9bb3bd50 --- /dev/null +++ b/framework/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.framework.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "framework.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/framework/qa/unoapi/makefile.mk b/framework/qa/unoapi/makefile.mk index 69c76f3e89..38a6cf7cce 100755 --- a/framework/qa/unoapi/makefile.mk +++ b/framework/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # 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 $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.9 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,22 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=framework -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = framework +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/framework/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce framework.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments -THRCNT 1 -AutoRestart true - @echo ======================================================================= - @echo In case you noticed a failures of fwk.JobExecutor or fwk.JobHandler make sure that you registered $(SOLARSRC)$/qadevOOo$/testdocs$/qadevlibs$/JobExecutor.jar - @echo ======================================================================= +.END diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index 8e09e3fd42..57c332f6f3 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -3,3 +3,4 @@ lg linguistic usr1 - all lg_mkout NULL lg linguistic\prj get - all lg_prj NULL lg linguistic\inc nmake - all lg_inc NULL lg linguistic\source nmake - all lg_src lg_inc NULL +lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL diff --git a/linguistic/qa/unoapi/Test.java b/linguistic/qa/unoapi/Test.java new file mode 100644 index 0000000000..4a96418255 --- /dev/null +++ b/linguistic/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.linguistic.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "lng.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/linguistic/qa/unoapi/makefile.mk b/linguistic/qa/unoapi/makefile.mk index 8bac81ca33..bd330c6fba 100644 --- a/linguistic/qa/unoapi/makefile.mk +++ b/linguistic/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # 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 $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=linguistic -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = linguistic +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/linguistic/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce lng.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index 89e618e8fc..3e791fbc20 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -21,3 +21,4 @@ sf sfx2\source\toolbox nmake - all sf_tbox sf_sdi sf_inc NULL sf sfx2\source\inet nmake - all sf_inet sf_sdi sf_inc NULL sf sfx2\source\explorer nmake - all sf_expl sf_sdi sf_inc NULL sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_layout sf_noti sf_sbar sf_tbox sf_view NULL +sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL diff --git a/sfx2/qa/unoapi/Test.java b/sfx2/qa/unoapi/Test.java new file mode 100644 index 0000000000..4263985c13 --- /dev/null +++ b/sfx2/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.sfx2.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "sfx.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk index 9d5403bb7c..ea91ba4d1c 100644 --- a/sfx2/qa/unoapi/makefile.mk +++ b/sfx2/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # 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 $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=sfx2 -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = sfx2 +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/sfx2/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce sfx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/svx/prj/build.lst b/svx/prj/build.lst index 3f66b2ae19..03e5316d15 100644 --- a/svx/prj/build.lst +++ b/svx/prj/build.lst @@ -49,3 +49,4 @@ sx svx\source\customshapes nmake - all sx_customshapes sx_inc NULL sx svx\source\toolbars nmake - all sx_toolbars sx_inc NULL sx svx\util nmake - all sx_util sx_3deng sx_dlg sx_draw sx_attribute sx_properties sx_contact sx_event sx_animation sx_primitive2d sx_primitive3d sx_overlay sx_eeng sx_fmcmp sx_form sx_gall sx_items sx_link sx_mnuc sx_opt sx_outl sx_rtf sx_sdi sx_stbc sx_tbxc sx_undrw sx_unedt sx_ungal sx_xml sx_xout sx_accessibility sx_intro sx_customshapes sx_toolbars sx_table sx_smarttags NULL sx svx\source\gengal nmake - all sx_gengal sx_util NULL +sx svx\qa\unoapi nmake - all sx_qa_unoapi NULL diff --git a/svx/qa/unoapi/Test.java b/svx/qa/unoapi/Test.java new file mode 100644 index 0000000000..90abd12776 --- /dev/null +++ b/svx/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.svx.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "svx.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/svx/qa/unoapi/makefile.mk b/svx/qa/unoapi/makefile.mk index da8e595ccb..133e9a3458 100644 --- a/svx/qa/unoapi/makefile.mk +++ b/svx/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # 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 $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.7 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=svx -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = svx +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/svx/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce svx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst index f0eb0da839..a4d7ef6b4f 100644 --- a/ucb/prj/build.lst +++ b/ucb/prj/build.lst @@ -14,3 +14,4 @@ uc ucb\source\ucp\webdav nmake - all uc_webdav uc_inc NULL uc ucb\source\ucp\package nmake - all uc_package uc_inc NULL uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL +uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL diff --git a/ucb/qa/unoapi/Test.java b/ucb/qa/unoapi/Test.java new file mode 100644 index 0000000000..145716d871 --- /dev/null +++ b/ucb/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.ucb.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "ucb.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/ucb/qa/unoapi/makefile.mk b/ucb/qa/unoapi/makefile.mk index 556e93f97d..80c7caae73 100644 --- a/ucb/qa/unoapi/makefile.mk +++ b/ucb/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # 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 $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=ucb -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = ucb +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/ucb/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce ucb.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/xmloff/prj/build.lst b/xmloff/prj/build.lst index 8817d45907..7b68ed08ff 100644 --- a/xmloff/prj/build.lst +++ b/xmloff/prj/build.lst @@ -14,3 +14,4 @@ xo xmloff\source\transform nmake - all xo_transform xo_util xo xmloff\source\xforms nmake - all xo_xforms xo_inc NULL xo xmloff\source\table nmake - all xo_table xo_inc NULL xo xmloff\util nmake - all xo_util xo_chart xo_core xo_draw xo_forms xo_meta xo_script xo_style xo_text xo_xforms xo_table NULL +xo xmloff\qa\unoapi nmake - all xo_qa_unoapi NULL diff --git a/xmloff/qa/unoapi/Test.java b/xmloff/qa/unoapi/Test.java new file mode 100644 index 0000000000..d66144f108 --- /dev/null +++ b/xmloff/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.xmloff.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "xmloff.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/xmloff/qa/unoapi/makefile.mk b/xmloff/qa/unoapi/makefile.mk index 61d01403a1..3cbbc5f2a7 100644 --- a/xmloff/qa/unoapi/makefile.mk +++ b/xmloff/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # 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 $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=xmloff -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = xmloff +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/xmloff/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce xmloff.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END -- cgit v1.2.3 From ddcf608f4b41f9b9e283e62272da271215fd6001 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 23 Feb 2010 13:51:38 +0100 Subject: sb118: do not use vector::front if vector::empty --- configmgr/source/localbe/localhierarchybrowsersvc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configmgr/source/localbe/localhierarchybrowsersvc.cxx b/configmgr/source/localbe/localhierarchybrowsersvc.cxx index 65e9bf8bef..cfadea4366 100644 --- a/configmgr/source/localbe/localhierarchybrowsersvc.cxx +++ b/configmgr/source/localbe/localhierarchybrowsersvc.cxx @@ -527,7 +527,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL } } - return uno::Sequence< rtl::OUString >(&components.front(),components.size()); + return components.empty() ? uno::Sequence< rtl::OUString >() : uno::Sequence< rtl::OUString >(&components.front(),components.size()); } //------------------------------------------------------------------------------ -- cgit v1.2.3 From 0c26e3ed365d498f5d9de0b8f8538e8012a15e29 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 26 Mar 2010 18:00:49 +0100 Subject: #161436# New migration service to migrate from SO 9.x/OOo 3.x to o5oo - transplanted from 8417a68af8e1@native0 --- desktop/source/migration/migration.cxx | 129 +++- desktop/source/migration/migration_impl.hxx | 38 +- desktop/source/migration/services/cexportsoo3.cxx | 71 +++ desktop/source/migration/services/makefile.mk | 48 +- desktop/source/migration/services/migrationoo3.map | 8 + .../migration/services/oo3extensionmigration.cxx | 656 +++++++++++++++++++++ .../migration/services/oo3extensionmigration.hxx | 171 ++++++ officecfg/registry/data/org/openoffice/Setup.xcu | 422 ++++++++----- officecfg/registry/schema/org/openoffice/Setup.xcs | 158 ++--- 9 files changed, 1432 insertions(+), 269 deletions(-) create mode 100755 desktop/source/migration/services/cexportsoo3.cxx create mode 100755 desktop/source/migration/services/migrationoo3.map create mode 100755 desktop/source/migration/services/oo3extensionmigration.cxx create mode 100755 desktop/source/migration/services/oo3extensionmigration.hxx diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 3de12d3b2c..161a090e22 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -140,11 +141,11 @@ sal_Bool MigrationImpl::checkMigration() MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFactory) : m_vrVersions(new strings_v) , m_xFactory(xFactory) - , m_vrMigrations(readMigrationSteps()) - , m_aInfo(findInstallation()) - , m_vrFileList(compileFileList()) - , m_vrServiceList(compileServiceList()) { + readAvailableMigrations(m_vMigrationsAvailable); + sal_Int32 nIndex = findPreferedMigrationProcess(m_vMigrationsAvailable); + if ( nIndex >= 0 ) + m_vrMigrations = readMigrationSteps(m_vMigrationsAvailable[nIndex].name); } MigrationImpl::~MigrationImpl() @@ -154,6 +155,10 @@ MigrationImpl::~MigrationImpl() sal_Bool MigrationImpl::doMigration() { + // compile file and service list for migration + m_vrFileList = compileFileList(); + m_vrServiceList = compileServiceList(); + sal_Bool result = sal_False; try{ copyFiles(); @@ -218,20 +223,61 @@ sal_Bool MigrationImpl::checkMigrationCompleted() return bMigrationCompleted; } - -migrations_vr MigrationImpl::readMigrationSteps() +static void insertSorted(migrations_available& rAvailableMigrations, supported_migration& aSupportedMigration) { + bool bInserted( false ); + migrations_available::iterator pIter = rAvailableMigrations.begin(); + while ( !bInserted && pIter != rAvailableMigrations.end()) + { + if ( pIter->nPriority < aSupportedMigration.nPriority ) + { + rAvailableMigrations.insert(pIter, aSupportedMigration ); + bInserted = true; + } + ++pIter; + } + if ( !bInserted ) + rAvailableMigrations.push_back( aSupportedMigration ); +} +bool MigrationImpl::readAvailableMigrations(migrations_available& rAvailableMigrations) +{ // get supported version names - uno::Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration"), uno::UNO_QUERY_THROW); - uno::Sequence< OUString > seqVersions; - aMigrationAccess->getByName(OUString::createFromAscii("SupportedVersions")) >>= seqVersions; - for (sal_Int32 i=0; ipush_back(seqVersions[i].trim()); + uno::Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration/SupportedVersions"), uno::UNO_QUERY_THROW); + uno::Sequence< OUString > seqSupportedVersions = aMigrationAccess->getElementNames(); + + const OUString aVersionIdentifiers( RTL_CONSTASCII_USTRINGPARAM( "VersionIdentifiers" )); + const OUString aPriorityIdentifier( RTL_CONSTASCII_USTRINGPARAM( "Priority" )); + for (sal_Int32 i=0; i seqVersions; + uno::Reference< XNameAccess > xMigrationData( aMigrationAccess->getByName(seqSupportedVersions[i]), uno::UNO_QUERY_THROW ); + xMigrationData->getByName( aVersionIdentifiers ) >>= seqVersions; + xMigrationData->getByName( aPriorityIdentifier ) >>= nPriority; + + supported_migration aSupportedMigration; + aSupportedMigration.name = seqSupportedVersions[i]; + aSupportedMigration.nPriority = nPriority; + for (sal_Int32 j=0; j aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration/SupportedVersions"), uno::UNO_QUERY_THROW); + uno::Reference< XNameAccess > xMigrationData( aMigrationAccess->getByName(rMigrationName), uno::UNO_QUERY_THROW ); + // get migration description from from org.openoffice.Setup/Migration // and build vector of migration steps - uno::Reference< XNameAccess > theNameAccess(getConfigAccess("org.openoffice.Setup/Migration/MigrationSteps"), uno::UNO_QUERY_THROW); + OUString aMigrationSteps( RTL_CONSTASCII_USTRINGPARAM( "MigrationSteps" )); + uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName(aMigrationSteps), uno::UNO_QUERY_THROW); uno::Sequence< OUString > seqMigrations = theNameAccess->getElementNames(); uno::Reference< XNameAccess > tmpAccess; uno::Reference< XNameAccess > tmpAccess2; @@ -273,6 +319,20 @@ migrations_vr MigrationImpl::readMigrationSteps() tmpStep.excludeConfig.push_back(tmpSeq[j]); } + // included extensions... + if (tmpAccess->getByName(OUString::createFromAscii("IncludedExtensions")) >>= tmpSeq) + { + for (sal_Int32 j=0; jgetByName(OUString::createFromAscii("ExcludedExtensions")) >>= tmpSeq) + { + for (sal_Int32 j=0; jgetByName(OUString::createFromAscii("ServiceConfigComponents")) >>= tmpSeq) { @@ -280,7 +340,6 @@ migrations_vr MigrationImpl::readMigrationSteps() tmpStep.configComponents.push_back(tmpSeq[j]); } - // generic service tmpAccess->getByName(OUString::createFromAscii("MigrationService")) >>= tmpStep.service; @@ -302,7 +361,7 @@ static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL) return result; } -install_info MigrationImpl::findInstallation() +install_info MigrationImpl::findInstallation(const strings_v& rVersions) { rtl::OUString aProductName; uno::Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); @@ -310,9 +369,9 @@ install_info MigrationImpl::findInstallation() aProductName = aProductName.toAsciiLowerCase(); install_info aInfo; - strings_v::const_iterator i_ver = m_vrVersions->begin(); + strings_v::const_iterator i_ver = rVersions.begin(); uno::Reference < util::XStringSubstitution > xSubst( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.PathSubstitution")), uno::UNO_QUERY ); - while (i_ver != m_vrVersions->end()) + while (i_ver != rVersions.end()) { ::rtl::OUString aVersion, aProfileName; sal_Int32 nSeparatorIndex = (*i_ver).indexOf('='); @@ -351,6 +410,28 @@ install_info MigrationImpl::findInstallation() return aInfo; } +sal_Int32 MigrationImpl::findPreferedMigrationProcess(const migrations_available& rAvailableMigrations) +{ + bool bFound( false ); + sal_Int32 nIndex( -1 ); + sal_Int32 i( 0 ); + + migrations_available::const_iterator rIter = rAvailableMigrations.begin(); + while ( rIter != rAvailableMigrations.end() ) + { + install_info aInstallInfo = findInstallation(rIter->supported_versions); + if (aInstallInfo.productname.getLength() > 0 ) + { + m_aInfo = aInstallInfo; + nIndex = i; + break; + } + ++i; + } + + return nIndex; +} + strings_vr MigrationImpl::applyPatterns(const strings_v& vSet, const strings_v& vPatterns) const { using namespace utl; @@ -517,8 +598,6 @@ void MigrationImpl::copyConfig() aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, aMsg.getStr()); } - - } // removes elements of vector 2 in vector 1 @@ -626,7 +705,6 @@ void MigrationImpl::copyFiles() void MigrationImpl::runServices() { - //create stratum for old user layer OUString aOldLayerURL = m_aInfo.userdata; aOldLayerURL += OUString::createFromAscii("/user/registry"); @@ -637,7 +715,7 @@ void MigrationImpl::runServices() aStratumSvc, stratumArgs), uno::UNO_QUERY); // Build argument array - uno::Sequence< uno::Any > seqArguments(3); + uno::Sequence< uno::Any > seqArguments(4); seqArguments[0] = uno::makeAny(NamedValue( OUString::createFromAscii("Productname"), uno::makeAny(m_aInfo.productname))); @@ -673,10 +751,21 @@ void MigrationImpl::runServices() i_comp++; i++; } + // set old config argument seqArguments[2] = uno::makeAny(NamedValue( OUString::createFromAscii("OldConfiguration"), uno::makeAny(seqComponents))); + + // set black list for extension migration + uno::Sequence< rtl::OUString > seqExtBlackList; + sal_uInt32 nSize = i_mig->excludeExtensions.size(); + if ( nSize > 0 ) + seqExtBlackList = comphelper::arrayToSequence< ::rtl::OUString >( + &i_mig->excludeExtensions[0], nSize ); + seqArguments[3] = uno::makeAny(NamedValue( + OUString::createFromAscii("ExtensionBlackList"), + uno::makeAny( seqExtBlackList ))); xMigrationJob = uno::Reference< XJob >(m_xFactory->createInstanceWithArguments( i_mig->service, seqArguments), uno::UNO_QUERY_THROW); diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx index 0de88d4dbc..a1533212ed 100644 --- a/desktop/source/migration/migration_impl.hxx +++ b/desktop/source/migration/migration_impl.hxx @@ -65,11 +65,21 @@ struct migration_step strings_v includeConfig; strings_v excludeConfig; strings_v configComponents; + strings_v includeExtensions; + strings_v excludeExtensions; rtl::OUString service; }; +struct supported_migration +{ + rtl::OUString name; + sal_Int32 nPriority; + strings_v supported_versions; +}; + typedef std::vector< migration_step > migrations_v; typedef std::auto_ptr< migrations_v > migrations_vr; +typedef std::vector< supported_migration > migrations_available; class MigrationImpl { @@ -77,18 +87,22 @@ class MigrationImpl private: strings_vr m_vrVersions; NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory > m_xFactory; - migrations_vr m_vrMigrations; // list of all migration specs from config - install_info m_aInfo; // info about the version being migrated - strings_vr m_vrFileList; // final list of files to be copied - strings_vr m_vrConfigList; // final list of nodes to be copied - strings_vr m_vrServiceList; // final list of services to be called - - // initializer functions... - migrations_vr readMigrationSteps(); - install_info findInstallation(); - strings_vr compileFileList(); - strings_vr compileConfigList(); - strings_vr compileServiceList(); + + migrations_available m_vMigrationsAvailable; // list of all available migrations + migrations_vr m_vrMigrations; // list of all migration specs from config + install_info m_aInfo; // info about the version being migrated + strings_vr m_vrFileList; // final list of files to be copied + strings_vr m_vrConfigList; // final list of nodes to be copied + strings_vr m_vrServiceList; // final list of services to be called + + // functions to control the migration process + bool readAvailableMigrations(migrations_available&); + migrations_vr readMigrationSteps(const ::rtl::OUString& rMigrationName); + sal_Int32 findPreferedMigrationProcess(const migrations_available&); + install_info findInstallation(const strings_v& rVersions); + strings_vr compileFileList(); + strings_vr compileConfigList(); + strings_vr compileServiceList(); // helpers void substract(strings_v& va, const strings_v& vb_c) const; diff --git a/desktop/source/migration/services/cexportsoo3.cxx b/desktop/source/migration/services/cexportsoo3.cxx new file mode 100755 index 0000000000..b33d78966f --- /dev/null +++ b/desktop/source/migration/services/cexportsoo3.cxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * 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: cexports.cxx,v $ + * $Revision: 1.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_desktop.hxx" + +#include "cppuhelper/implementationentry.hxx" +#include "oo3extensionmigration.hxx" + +extern "C" +{ + +::cppu::ImplementationEntry entries [] = +{ + { + migration::OO3ExtensionMigration_create, migration::OO3ExtensionMigration_getImplementationName, + migration::OO3ExtensionMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory, + 0, 0 + }, + { 0, 0, 0, 0, 0, 0 } +}; + + +void SAL_CALL component_getImplementationEnvironment( + const sal_Char ** ppEnvTypeName, uno_Environment ** ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey ) +{ + return ::cppu::component_writeInfoHelper( + pServiceManager, pRegistryKey, entries ); +} + +void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) +{ + return ::cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, entries ); +} + +} diff --git a/desktop/source/migration/services/makefile.mk b/desktop/source/migration/services/makefile.mk index 323b823fe3..64adfe70b7 100644 --- a/desktop/source/migration/services/makefile.mk +++ b/desktop/source/migration/services/makefile.mk @@ -31,6 +31,7 @@ PRJNAME=desktop TARGET = migrationoo2.uno ENABLE_EXCEPTIONS=TRUE COMP1TYPELIST = migrationoo2 +LIBTARGET=NO # --- Settings ----------------------------------------------------- .INCLUDE : ..$/..$/deployment/inc/dp_misc.mk @@ -50,7 +51,18 @@ SLOFILES= \ $(SLO)$/cexports.obj \ $(SLO)$/basicmigration.obj \ $(SLO)$/wordbookmigration.obj \ - $(SLO)$/extensionmigration.obj + $(SLO)$/extensionmigration.obj \ + $(SLO)$/autocorrmigration.obj \ + $(SLO)$/oo3extensionmigration.obj \ + $(SLO)$/cexportsoo3.obj + +SHL1OBJS= \ + $(SLO)$/jvmfwk.obj \ + $(SLO)$/cexports.obj \ + $(SLO)$/basicmigration.obj \ + $(SLO)$/wordbookmigration.obj \ + $(SLO)$/extensionmigration.obj \ + $(SLO)$/autocorrmigration.obj SHL1TARGET=$(TARGET) SHL1VERSIONMAP = migrationoo2.map @@ -67,16 +79,42 @@ SHL1STDLIBS= \ $(JVMFWKLIB) \ $(XMLSCRIPTLIB) \ $(BERKELEYLIB) - - SHL1DEPN= -SHL1IMPLIB=i$(TARGET) -SHL1LIBS=$(SLB)$/$(TARGET).lib +SHL1IMPLIB=imigrationoo2 +#SHL1LIBS=$(SLB)$/$(TARGET).lib SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) +COMP2TYPELIST = migrationoo3 +SHL2TARGET=migrationoo3.uno +SHL2VERSIONMAP = migrationoo3.map + +SHL2OBJS= \ + $(SLO)$/cexportsoo3.obj \ + $(SLO)$/oo3extensionmigration.obj + +SHL2STDLIBS= \ + $(DEPLOYMENTMISCLIB) \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(SALLIB) \ + $(UCBHELPERLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(I18NISOLANGLIB) \ + $(JVMFWKLIB) \ + $(XMLSCRIPTLIB) \ + $(BERKELEYLIB) + +SHL2DEPN= +SHL2IMPLIB=imigrationoo3 +#SHL2LIBS=$(SLB)$/$(SHL2TARGET).lib +SHL2DEF=$(MISC)$/$(SHL2TARGET).def + +DEF2NAME=$(SHL2TARGET) + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/desktop/source/migration/services/migrationoo3.map b/desktop/source/migration/services/migrationoo3.map new file mode 100755 index 0000000000..ac2c3750bf --- /dev/null +++ b/desktop/source/migration/services/migrationoo3.map @@ -0,0 +1,8 @@ +UDK_3_0_0 { + global: + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; + local: + *; +}; diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx new file mode 100755 index 0000000000..07e971b033 --- /dev/null +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -0,0 +1,656 @@ +/************************************************************************* + * + * 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: extensionmigration.cxx,v $ + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_desktop.hxx" + +#include "oo3extensionmigration.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; + +namespace migration +{ + +static ::rtl::OUString sExtensionSubDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/uno_packages/" ) ); +static ::rtl::OUString sSubDirName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cache" ) ); +static ::rtl::OUString sConfigDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data" ) ); +static ::rtl::OUString sOrgDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) ); +static ::rtl::OUString sExcludeDir1 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) ); +static ::rtl::OUString sExcludeDir2 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org/openoffice" ) ); +static ::rtl::OUString sDescriptionXmlFile = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/description.xml" ) ); +static ::rtl::OUString sExtensionRootSubDirName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/uno_packages" ) ); + +static ::rtl::OUString sConfigurationDataType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-data")); +static ::rtl::OUString sConfigurationSchemaType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-schema")); + +// ============================================================================= +// component operations +// ============================================================================= + +::rtl::OUString OO3ExtensionMigration_getImplementationName() +{ + static ::rtl::OUString* pImplName = 0; + if ( !pImplName ) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if ( !pImplName ) + { + static ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.desktop.migration.OOo3Extensions" ) ); + pImplName = &aImplName; + } + } + return *pImplName; +} + +// ----------------------------------------------------------------------------- + +Sequence< ::rtl::OUString > OO3ExtensionMigration_getSupportedServiceNames() +{ + static Sequence< ::rtl::OUString >* pNames = 0; + if ( !pNames ) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if ( !pNames ) + { + static Sequence< ::rtl::OUString > aNames(1); + aNames.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.migration.Extensions" ) ); + pNames = &aNames; + } + } + return *pNames; +} + +// ============================================================================= +// ExtensionMigration +// ============================================================================= + +OO3ExtensionMigration::OO3ExtensionMigration(Reference< XComponentContext > const & ctx) : +m_ctx(ctx) +{ +} + +// ----------------------------------------------------------------------------- + +OO3ExtensionMigration::~OO3ExtensionMigration() +{ +} + +::osl::FileBase::RC OO3ExtensionMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) +{ + ::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); + if ( aResult == ::osl::FileBase::E_NOENT ) + { + INetURLObject aBaseURL( rDirURL ); + aBaseURL.removeSegment(); + checkAndCreateDirectory( aBaseURL ); + return ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); + } + else + { + return aResult; + } +} + +void OO3ExtensionMigration::registerConfigurationPackage( const uno::Reference< deployment::XPackage > & xPkg) +{ + const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType(); + if ( (sMediaType.equals(sConfigurationDataType) || sMediaType.equals(sConfigurationSchemaType) ) ) + { + xPkg->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); + xPkg->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); + } +} + + void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions ) +{ + osl::Directory aScanRootDir( sSourceDir ); + osl::FileStatus fs(FileStatusMask_Type | FileStatusMask_FileURL); + osl::FileBase::RC nRetCode = aScanRootDir.open(); + if ( nRetCode == osl::Directory::E_None ) + { + sal_uInt32 nHint( 0 ); + osl::DirectoryItem aItem; + while ( aScanRootDir.getNextItem( aItem, nHint ) == osl::Directory::E_None ) + { + if (( aItem.getFileStatus(fs) == osl::FileBase::E_None ) && + ( fs.getFileType() == osl::FileStatus::Directory )) + { + //Check next folder as the "real" extension folder is below a temp folder! + ::rtl::OUString sExtensionFolderURL = fs.getFileURL(); + + osl::DirectoryItem aExtDirItem; + osl::Directory aExtensionRootDir( sExtensionFolderURL ); + + nRetCode = aExtensionRootDir.open(); + if (( nRetCode == osl::Directory::E_None ) && + ( aExtensionRootDir.getNextItem( aExtDirItem, nHint ) == osl::Directory::E_None )) + { + bool bFileStatus = aExtDirItem.getFileStatus(fs) == osl::FileBase::E_None; + bool bIsDir = fs.getFileType() == osl::FileStatus::Directory; + + if ( bFileStatus && bIsDir ) + { + sExtensionFolderURL = fs.getFileURL(); + ScanResult eResult = scanExtensionFolder( sExtensionFolderURL ); + if ( eResult == SCANRESULT_MIGRATE_EXTENSION ) + aMigrateExtensions.push_back( sExtensionFolderURL ); + } + } + } + } + } +} + +OO3ExtensionMigration::ScanResult OO3ExtensionMigration::scanExtensionFolder( const ::rtl::OUString& sExtFolder ) +{ + ScanResult aResult = SCANRESULT_NOTFOUND; + osl::Directory aDir(sExtFolder); + + // get sub dirs + if (aDir.open() == osl::FileBase::E_None) + { + // work through directory contents... + osl::DirectoryItem item; + osl::FileStatus fs(FileStatusMask_Type | FileStatusMask_FileURL); + TStringVector aDirectories; + while ((aDir.getNextItem(item) == osl::FileBase::E_None ) && + ( aResult == SCANRESULT_NOTFOUND )) + { + if (item.getFileStatus(fs) == osl::FileBase::E_None) + { + ::rtl::OUString aDirEntryURL; + if (fs.getFileType() == osl::FileStatus::Directory) + aDirectories.push_back( fs.getFileURL() ); + else + { + aDirEntryURL = fs.getFileURL(); + if ( aDirEntryURL.indexOf( sDescriptionXmlFile ) > 0 ) + aResult = scanDescriptionXml( aDirEntryURL ) ? SCANRESULT_MIGRATE_EXTENSION : SCANRESULT_DONTMIGRATE_EXTENSION; + } + } + } + + TStringVector::const_iterator pIter = aDirectories.begin(); + while ( pIter != aDirectories.end() && aResult == SCANRESULT_NOTFOUND ) + { + aResult = scanExtensionFolder( *pIter ); + ++pIter; + } + } + return aResult; +} + +bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescriptionXmlURL ) +{ + if ( !m_xDocBuilder.is() ) + { + m_xDocBuilder = uno::Reference< xml::dom::XDocumentBuilder >( + m_ctx->getServiceManager()->createInstanceWithContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.DocumentBuilder")), + m_ctx ), uno::UNO_QUERY ); + } + + if ( !m_xSimpleFileAccess.is() ) + { + m_xSimpleFileAccess = uno::Reference< ucb::XSimpleFileAccess >( + m_ctx->getServiceManager()->createInstanceWithContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), + m_ctx ), uno::UNO_QUERY ); + } + + ::rtl::OUString aExtIdentifier; + if ( m_xDocBuilder.is() && m_xSimpleFileAccess.is() ) + { + try + { + uno::Reference< io::XInputStream > xIn = + m_xSimpleFileAccess->openFileRead( sDescriptionXmlURL ); + + if ( xIn.is() ) + { + uno::Reference< xml::dom::XDocument > xDoc = m_xDocBuilder->parse( xIn ); + if ( xDoc.is() ) + { + uno::Reference< xml::dom::XElement > xRoot = xDoc->getDocumentElement(); + if ( xRoot.is() && + xRoot->getTagName().equals(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("description"))) ) + { + uno::Reference< xml::xpath::XXPathAPI > xPath( + m_ctx->getServiceManager()->createInstanceWithContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.xpath.XPathAPI")), + m_ctx), + uno::UNO_QUERY); + + xPath->registerNS( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc")), + xRoot->getNamespaceURI()); + xPath->registerNS( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("http://www.w3.org/1999/xlink"))); + + try + { + uno::Reference< xml::dom::XNode > xRootNode( xRoot, uno::UNO_QUERY ); + uno::Reference< xml::dom::XNode > xNode( + xPath->selectSingleNode( + xRootNode, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:identifier/@value")) )); + if ( xNode.is() ) + aExtIdentifier = xNode->getNodeValue(); + } + catch ( xml::xpath::XPathException& ) + { + } + catch ( xml::dom::DOMException& ) + { + } + } + } + } + + if ( aExtIdentifier.getLength() > 0 ) + { + // scan extension identifier and try to match with our black list entries + for ( sal_uInt32 i = 0; i < m_aBlackList.size(); i++ ) + { + utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP); + utl::TextSearch ts(param, LANGUAGE_DONTKNOW); + + xub_StrLen start = 0; + xub_StrLen end = static_cast(aExtIdentifier.getLength()); + if (ts.SearchFrwrd(aExtIdentifier, &start, &end)) + return false; + } + } + } + catch ( ucb::CommandAbortedException& ) + { + } + catch ( uno::RuntimeException& ) + { + } + + if ( aExtIdentifier.getLength() == 0 ) + { + // Fallback: + // Try to use the folder name to match our black list + // as some extensions don't provide an identifier in the + // description.xml! + for ( sal_uInt32 i = 0; i < m_aBlackList.size(); i++ ) + { + utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP); + utl::TextSearch ts(param, LANGUAGE_DONTKNOW); + + xub_StrLen start = 0; + xub_StrLen end = static_cast(sDescriptionXmlURL.getLength()); + if (ts.SearchFrwrd(sDescriptionXmlURL, &start, &end)) + return false; + } + } + } + + return true; +} + +bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir ) +{ + if ( !m_xPackageManager.is() ) + { + try + { + m_xPackageManager = deployment::thePackageManagerFactory::get( m_ctx )->getPackageManager( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "user" )) ); + } + catch ( ucb::CommandFailedException & ){} + catch ( uno::RuntimeException & ) {} + } + + if ( m_xPackageManager.is() ) + { + try + { + TmpRepositoryCommandEnv* pCmdEnv = new TmpRepositoryCommandEnv(); + + uno::Reference< ucb::XCommandEnvironment > xCmdEnv( + static_cast< cppu::OWeakObject* >( pCmdEnv ), uno::UNO_QUERY ); + uno::Reference< task::XAbortChannel > xAbortChannel; + uno::Reference< deployment::XPackage > xPackage = + m_xPackageManager->addPackage( sSourceDir, ::rtl::OUString(), xAbortChannel, xCmdEnv ); + + if ( xPackage.is() ) + return true; + } + catch ( ucb::CommandFailedException& ) + { + } + catch ( ucb::CommandAbortedException& ) + { + } + catch ( lang::IllegalArgumentException& ) + { + } + } + + return false; +} + +bool OO3ExtensionMigration::copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ) +{ + bool bRet = false; + + INetURLObject aSourceObj( sSourceDir ); + INetURLObject aDestObj( sTargetDir ); + String aName = aDestObj.getName(); + aDestObj.removeSegment(); + aDestObj.setFinalSlash(); + + try + { + ::ucbhelper::Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); + uno::Reference< ucb::XCommandInfo > xInfo = aDestPath.getCommands(); + ::rtl::OUString aTransferName = ::rtl::OUString::createFromAscii( "transfer" ); + if ( xInfo->hasCommandByName( aTransferName ) ) + { + aDestPath.executeCommand( aTransferName, uno::makeAny( + ucb::TransferInfo( sal_False, aSourceObj.GetMainURL( INetURLObject::NO_DECODE ), aName, ucb::NameClash::OVERWRITE ) ) ); + bRet = true; + } + } + catch( uno::Exception& ) + { + } + + return bRet; +} + + +// ----------------------------------------------------------------------------- +// XServiceInfo +// ----------------------------------------------------------------------------- + +::rtl::OUString OO3ExtensionMigration::getImplementationName() throw (RuntimeException) +{ + return OO3ExtensionMigration_getImplementationName(); +} + +// ----------------------------------------------------------------------------- + +sal_Bool OO3ExtensionMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) +{ + Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); + const ::rtl::OUString* pNames = aNames.getConstArray(); + const ::rtl::OUString* pEnd = pNames + aNames.getLength(); + for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) + ; + + return pNames != pEnd; +} + +// ----------------------------------------------------------------------------- + +Sequence< ::rtl::OUString > OO3ExtensionMigration::getSupportedServiceNames() throw (RuntimeException) +{ + return OO3ExtensionMigration_getSupportedServiceNames(); +} + +// ----------------------------------------------------------------------------- +// XInitialization +// ----------------------------------------------------------------------------- + +void OO3ExtensionMigration::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + const Any* pIter = aArguments.getConstArray(); + const Any* pEnd = pIter + aArguments.getLength(); + for ( ; pIter != pEnd ; ++pIter ) + { + beans::NamedValue aValue; + *pIter >>= aValue; + if ( aValue.Name.equalsAscii( "UserData" ) ) + { + if ( !(aValue.Value >>= m_sSourceDir) ) + { + OSL_ENSURE( false, "ExtensionMigration::initialize: argument UserData has wrong type!" ); + } + } + else if ( aValue.Name.equalsAscii( "ExtensionBlackList" ) ) + { + Sequence< ::rtl::OUString > aBlackList; + if ( (aValue.Value >>= aBlackList ) && ( aBlackList.getLength() > 0 )) + { + m_aBlackList.resize( aBlackList.getLength() ); + ::comphelper::sequenceToArray< ::rtl::OUString >( &m_aBlackList[0], aBlackList ); + } + } + } +} + +// ----------------------------------------------------------------------------- + +TStringVectorPtr getContent( const ::rtl::OUString& rBaseURL ) +{ + TStringVectorPtr aResult( new TStringVector ); + ::osl::Directory aDir( rBaseURL); + if ( aDir.open() == ::osl::FileBase::E_None ) + { + // iterate over directory content + TStringVector aSubDirs; + ::osl::DirectoryItem aItem; + while ( aDir.getNextItem( aItem ) == ::osl::FileBase::E_None ) + { + ::osl::FileStatus aFileStatus( FileStatusMask_Type | FileStatusMask_FileURL ); + if ( aItem.getFileStatus( aFileStatus ) == ::osl::FileBase::E_None ) + aResult->push_back( aFileStatus.getFileURL() ); + } + } + + return aResult; +} + +// ----------------------------------------------------------------------------- +// XJob +// ----------------------------------------------------------------------------- + +void OO3ExtensionMigration::copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ) +{ + ::rtl::OUString sEx1( m_sSourceDir ); + sEx1 += sExcludeDir1; + ::rtl::OUString sEx2( m_sSourceDir ); + sEx2 += sExcludeDir2; + + TStringVectorPtr aList = getContent( sSourceDir ); + TStringVector::const_iterator aI = aList->begin(); + while ( aI != aList->end() ) + { + ::rtl::OUString sSourceLocalName = aI->copy( sSourceDir.getLength() ); + ::rtl::OUString aTemp = aI->copy( m_sSourceDir.getLength() ); + if ( aTemp != sExcludeDir1 && aTemp != sExcludeDir2 ) + { + ::rtl::OUString sTargetName = sTargetDir + sSourceLocalName; + copy( (*aI), sTargetName ); + } + ++aI; + } +} + +Any OO3ExtensionMigration::execute( const Sequence< beans::NamedValue >& ) + throw (lang::IllegalArgumentException, Exception, RuntimeException) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + ::utl::Bootstrap::PathStatus aStatus = ::utl::Bootstrap::locateUserInstallation( m_sTargetDir ); + if ( aStatus == ::utl::Bootstrap::PATH_EXISTS ) + { + // copy all extensions + ::rtl::OUString sSourceDir( m_sSourceDir ); + sSourceDir += sExtensionSubDir; + sSourceDir += sSubDirName; + sSourceDir += sExtensionRootSubDirName; + TStringVector aExtensionToMigrate; + scanUserExtensions( sSourceDir, aExtensionToMigrate ); + if ( aExtensionToMigrate.size() > 0 ) + { + TStringVector::iterator pIter = aExtensionToMigrate.begin(); + while ( pIter != aExtensionToMigrate.end() ) + { + migrateExtension( *pIter ); + ++pIter; + } + } + } + + return Any(); +} + +// ----------------------------------------------------------------------------- +// TmpRepositoryCommandEnv +// ----------------------------------------------------------------------------- + +TmpRepositoryCommandEnv::TmpRepositoryCommandEnv() +{ +} + +TmpRepositoryCommandEnv::TmpRepositoryCommandEnv( + uno::Reference< task::XInteractionHandler> const & handler) + : m_forwardHandler(handler) +{ +} + +TmpRepositoryCommandEnv::~TmpRepositoryCommandEnv() +{ +} +// XCommandEnvironment +//______________________________________________________________________________ +uno::Reference< task::XInteractionHandler > TmpRepositoryCommandEnv::getInteractionHandler() +throw ( uno::RuntimeException ) +{ + return this; +} + +//______________________________________________________________________________ +uno::Reference< ucb::XProgressHandler > TmpRepositoryCommandEnv::getProgressHandler() +throw ( uno::RuntimeException ) +{ + return this; +} + +// XInteractionHandler +void TmpRepositoryCommandEnv::handle( + uno::Reference< task::XInteractionRequest> const & xRequest ) + throw ( uno::RuntimeException ) +{ + uno::Any request( xRequest->getRequest() ); + OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + + bool approve = true; + bool abort = false; + + // select: + uno::Sequence< Reference< task::XInteractionContinuation > > conts( + xRequest->getContinuations() ); + Reference< task::XInteractionContinuation > const * pConts = + conts.getConstArray(); + sal_Int32 len = conts.getLength(); + for ( sal_Int32 pos = 0; pos < len; ++pos ) + { + if (approve) { + uno::Reference< task::XInteractionApprove > xInteractionApprove( + pConts[ pos ], uno::UNO_QUERY ); + if (xInteractionApprove.is()) { + xInteractionApprove->select(); + // don't query again for ongoing continuations: + approve = false; + } + } + else if (abort) { + uno::Reference< task::XInteractionAbort > xInteractionAbort( + pConts[ pos ], uno::UNO_QUERY ); + if (xInteractionAbort.is()) { + xInteractionAbort->select(); + // don't query again for ongoing continuations: + abort = false; + } + } + } +} + +// XProgressHandler +void TmpRepositoryCommandEnv::push( uno::Any const & /*Status*/ ) +throw (uno::RuntimeException) +{ +} + + +void TmpRepositoryCommandEnv::update( uno::Any const & /*Status */) +throw (uno::RuntimeException) +{ +} + +void TmpRepositoryCommandEnv::pop() throw (uno::RuntimeException) +{ +} + +// ============================================================================= +// component operations +// ============================================================================= + +Reference< XInterface > SAL_CALL OO3ExtensionMigration_create( + Reference< XComponentContext > const & ctx ) + SAL_THROW( () ) +{ + return static_cast< lang::XTypeProvider * >( new OO3ExtensionMigration( + ctx) ); +} + +// ----------------------------------------------------------------------------- + +} // namespace migration diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx new file mode 100755 index 0000000000..4a2b389310 --- /dev/null +++ b/desktop/source/migration/services/oo3extensionmigration.hxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * 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: extensionmigration.hxx,v $ + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _DESKTOP_OO3EXTENSIONMIGRATION_HXX_ +#define _DESKTOP_OO3EXTENSIONMIGRATION_HXX_ + +#include "misc.hxx" +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace com { namespace sun { namespace star { + namespace uno { + class XComponentContext; + } + namespace deployment { + class XPackage; + } +}}} + +class INetURLObject; + + +namespace migration +{ + + ::rtl::OUString SAL_CALL OO3ExtensionMigration_getImplementationName(); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OO3ExtensionMigration_getSupportedServiceNames(); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL OO3ExtensionMigration_create( + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + + + // ============================================================================= + // class ExtensionMigration + // ============================================================================= + + typedef ::cppu::WeakImplHelper3< + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XInitialization, + ::com::sun::star::task::XJob > ExtensionMigration_BASE; + + class OO3ExtensionMigration : public ExtensionMigration_BASE + { + private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_ctx; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XDocumentBuilder > m_xDocBuilder; + ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > m_xSimpleFileAccess; + ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > m_xPackageManager; + ::osl::Mutex m_aMutex; + ::rtl::OUString m_sSourceDir; + ::rtl::OUString m_sTargetDir; + TStringVector m_aBlackList; + + enum ScanResult + { + SCANRESULT_NOTFOUND, + SCANRESULT_MIGRATE_EXTENSION, + SCANRESULT_DONTMIGRATE_EXTENSION + }; + + ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL ); + void copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ); + bool copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ); + ScanResult scanExtensionFolder( const ::rtl::OUString& sExtFolder ); + void scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions ); + bool scanDescriptionXml( const ::rtl::OUString& sDescriptionXmlFilePath ); + bool migrateExtension( const ::rtl::OUString& sSourceDir ); + /* fills m_scriptElements and m_dialogElements + */ + void registerConfigurationPackage( + const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg); + + public: + OO3ExtensionMigration(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & ctx); + virtual ~OO3ExtensionMigration(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XJob + virtual ::com::sun::star::uno::Any SAL_CALL execute( + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, + ::com::sun::star::uno::RuntimeException); + }; + + class TmpRepositoryCommandEnv + : public ::cppu::WeakImplHelper3< ::com::sun::star::ucb::XCommandEnvironment, + ::com::sun::star::task::XInteractionHandler, + ::com::sun::star::ucb::XProgressHandler > + { + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_forwardHandler; + public: + virtual ~TmpRepositoryCommandEnv(); + TmpRepositoryCommandEnv(); + TmpRepositoryCommandEnv( + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> const & handler); + + // XCommandEnvironment + virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > SAL_CALL + getInteractionHandler() throw ( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > + SAL_CALL getProgressHandler() throw ( ::com::sun::star::uno::RuntimeException ); + + // XInteractionHandler + virtual void SAL_CALL handle( + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & xRequest ) + throw (::com::sun::star::uno::RuntimeException); + + // XProgressHandler + virtual void SAL_CALL push( ::com::sun::star::uno::Any const & Status ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL update( ::com::sun::star::uno::Any const & Status ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL pop() throw (::com::sun::star::uno::RuntimeException); + }; + +//......................................................................... +} // namespace migration +//......................................................................... + +#endif // _DESKTOP_OO3EXTENSIONMIGRATION_HXX_ diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu index 2b5945bffd..f78882cbdf 100644 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -750,174 +750,274 @@ true - - - OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8 + + + + + 100 + + + StarOffice 9=staroffice/9,StarSuite 9=starsuite/9 - - - .*/database/biblio/biblio\.dbf - - - - - org.openoffice.Office.DataAccess - - - - org.openoffice.Office.DataAccess/Bibliography - org.openoffice.Office.DataAccess/ConnectionPool - org.openoffice.Office.DataAccess/DataSources - org.openoffice.Office.DataAccess/DriverManager - - - - - - com.sun.star.migration.Extensions - - - - - org.openoffice.Inet - - - - - - com.sun.star.migration.Basic - - - - - org.openoffice.UserProfile - - - - - - .*/autotext/.* - .*/autocorr/.* - .*/config/.*\.so[bcdegh] - .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml - .*/config/soffice.cfg/modules/.*/images/.* - .*/gallery/.* - .*/template/.* - - - - - org.openoffice.Office.Compatibility - org.openoffice.Office.Custom - org.openoffice.Office.Embedding - org.openoffice.Office.Events - org.openoffice.Office.ExtendedColorScheme - org.openoffice.Office.Common/Accessibility - org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC - org.openoffice.Office.Common/AsianLayout - org.openoffice.Office.Common/AutoCorrect - org.openoffice.Office.Common/Cache - org.openoffice.Office.Common/DateFormat - org.openoffice.Office.Common/ExternalMailer/Program - org.openoffice.Office.Common/Filter - org.openoffice.Office.Common/Font - org.openoffice.Office.Common/Forms - org.openoffice.Office.Common/Gallery - org.openoffice.Office.Common/Help - org.openoffice.Office.Common/History - org.openoffice.Office.Common/I18N - org.openoffice.Office.Common/InternalMSExport - org.openoffice.Office.Common/Load - org.openoffice.Office.Common/Misc/FormControlPilotsEnabled - org.openoffice.Office.Common/Misc/PluginsEnabled - org.openoffice.Office.Common/Misc/SymbolSet - org.openoffice.Office.Common/Misc/UseSystemFileDialog - org.openoffice.Office.Common/Misc/UseSystemPrintDialog - org.openoffice.Office.Common/Misc/SymbolStyle - org.openoffice.Office.Common/Passwords - org.openoffice.Office.Common/Print/PrintingModifiesDocument - org.openoffice.Office.Common/Print/Warning - org.openoffice.Office.Common/Vectorize - org.openoffice.Office.Common/Save - org.openoffice.Office.Common/SearchOptions - org.openoffice.Office.Common/Undo - org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton - org.openoffice.Office.Common/View/Dialog/MousePositioning - org.openoffice.Office.Common/View/Localization - org.openoffice.Office.Common/View/Menu - org.openoffice.Office.Common/_3D_Engine - + + + + user/autocorr/.* + user/autotext/.* + user/backup/.* + user/basic/.* + user/config/.*\.so[bcdegh] + user/config/.*\.fmt + user/config/.*\.dat + user/config/javasettings_.*\.xml + user/config/soffice\.cfg/modules/[^/]*/toolbar/custom.*\.xml + user/config/soffice\.cfg/modules/[^/]*/images/.* + user/crashdata/.* + user/database/.* + user/gallery/.* + user/registry/.* + user/Scripts/.* + user/store/.* + user/template/.* + user/wordbook/.* + + + + + + com.sun.star.comp.desktop.migration.OOo3Extensions + + + + com.sun.star.PDFImport.* + com.sun.star.PresentationMinimizer.* + com.sun.PresenterScreen.* + + + + + + + + 90 - - - org.openoffice.Office.Common/_3D_Engine/OpenGL - org.openoffice.Office.Common/Help/Registration - - - - - - org.openoffice.Office.Calc - - - - - org.openoffice.Office.Chart - - - - - org.openoffice.Office.Draw - - - - - org.openoffice.Office.Impress - - - - - org.openoffice.Office.Labels - - - - - com.sun.star.migration.Wordbooks + + OpenOffice.org 3=openoffice.org/3 - - org.openoffice.Office.Linguistic - - - org.openoffice.Office.Linguistic/ServiceManager + + + + + user/autocorr/.* + user/autotext/.* + user/backup/.* + user/basic/.* + user/config/.*\.so[bcdegh] + user/config/.*\.fmt + user/config/.*\.dat + user/config/javasettings_.*\.xml + user/config/soffice\.cfg/modules/[^/]*/toolbar/custom.*\.xml + user/config/soffice\.cfg/modules/[^/]*/images/.* + user/crashdata/.* + user/database/.* + user/gallery/.* + user/registry/.* + user/Scripts/.* + user/store/.* + user/template/.* + user/wordbook/.* + + + + + + com.sun.star.comp.desktop.migration.OOo3Extensions + + + + com.sun.star.PDFImport.* + com.sun.star.PresentationMinimizer.* + com.sun.PresenterScreen.* + + + + + + + + 10 - - - - org.openoffice.Office.Math - - - - - org.openoffice.Office.Security - - - - - org.openoffice.Office.UI/ColorScheme - - - - - - org.openoffice.Office.Writer - org.openoffice.Office.WriterWeb - - - - org.openoffice.Office.Writer/Wizard + + OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8 + + + + .*/database/biblio/biblio\.dbf + + + + + org.openoffice.Office.DataAccess + + + + org.openoffice.Office.DataAccess/Bibliography + org.openoffice.Office.DataAccess/ConnectionPool + org.openoffice.Office.DataAccess/DataSources + org.openoffice.Office.DataAccess/DriverManager + + + + + + com.sun.star.migration.Extensions + + + + + + org.openoffice.Inet + + + + + + com.sun.star.migration.Basic + + + + + org.openoffice.UserProfile + + + + + + .*/autotext/.* + .*/autocorr/.* + .*/config/.*\.so[bcdegh] + .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml + .*/config/soffice.cfg/modules/.*/images/.* + .*/gallery/.* + .*/template/.* + + + + + org.openoffice.Office.Compatibility + org.openoffice.Office.Custom + org.openoffice.Office.Embedding + org.openoffice.Office.Events + org.openoffice.Office.ExtendedColorScheme + org.openoffice.Office.Common/Accessibility + org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC + org.openoffice.Office.Common/AsianLayout + org.openoffice.Office.Common/AutoCorrect + org.openoffice.Office.Common/Cache + org.openoffice.Office.Common/DateFormat + org.openoffice.Office.Common/ExternalMailer/Program + org.openoffice.Office.Common/Filter + org.openoffice.Office.Common/Font + org.openoffice.Office.Common/Forms + org.openoffice.Office.Common/Gallery + org.openoffice.Office.Common/Help + org.openoffice.Office.Common/History + org.openoffice.Office.Common/I18N + org.openoffice.Office.Common/InternalMSExport + org.openoffice.Office.Common/Load + org.openoffice.Office.Common/Misc/FormControlPilotsEnabled + org.openoffice.Office.Common/Misc/PluginsEnabled + org.openoffice.Office.Common/Misc/SymbolSet + org.openoffice.Office.Common/Misc/UseSystemFileDialog + org.openoffice.Office.Common/Misc/UseSystemPrintDialog + org.openoffice.Office.Common/Misc/SymbolStyle + org.openoffice.Office.Common/Passwords + org.openoffice.Office.Common/Print/PrintingModifiesDocument + org.openoffice.Office.Common/Print/Warning + org.openoffice.Office.Common/Vectorize + org.openoffice.Office.Common/Save + org.openoffice.Office.Common/SearchOptions + org.openoffice.Office.Common/Undo + org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton + org.openoffice.Office.Common/View/Dialog/MousePositioning + org.openoffice.Office.Common/View/Localization + org.openoffice.Office.Common/View/Menu + org.openoffice.Office.Common/_3D_Engine + + + + + org.openoffice.Office.Common/_3D_Engine/OpenGL + org.openoffice.Office.Common/Help/Registration + + + + + + org.openoffice.Office.Calc + + + + + org.openoffice.Office.Chart + + + + + org.openoffice.Office.Draw + + + + + org.openoffice.Office.Impress + + + + + org.openoffice.Office.Labels + + + + + com.sun.star.migration.Wordbooks + + + org.openoffice.Office.Linguistic + + + org.openoffice.Office.Linguistic/ServiceManager + + + + + org.openoffice.Office.Math + + + + + org.openoffice.Office.Security + + + + + org.openoffice.Office.UI/ColorScheme + + + + + + org.openoffice.Office.Writer + org.openoffice.Office.WriterWeb + + + + org.openoffice.Office.Writer/Wizard + + + diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs index 9e5551bda1..de8a64e2b0 100644 --- a/officecfg/registry/schema/org/openoffice/Setup.xcs +++ b/officecfg/registry/schema/org/openoffice/Setup.xcs @@ -34,61 +34,86 @@ - JB + JB Describes a language pack that is installed to provide a localized office UI. - - JB - Identifies the organization, group or person that provided this language pack. - + + JB + Identifies the organization, group or person that provided this language pack. + - + + + Describes one step of migration + + + + an optional uno service that is called after files and nodes have been copied in order to perform custom migration actions. The service needs to support XInitializable and XJob interfaces according do http://specs.openoffice.org/appwide/migration/spec_migration.sxw + + + + + a list of config components that are to be passed to service + + + + + a list of wildcards relative to the old userdata origin that are to be copied + + + + + a list of wildcards relative to the old userdata origin that are to be copied + + + + + a list of configuration node paths that are to be moved from the old user layer to the new user layer + + + + + a list of configuration node paths that are not to be moved from the old user layer to the new user layer + + + + + a list of extension identifiers that are to be copied from the old user layer to the new user layer + + + + + a list of extension identifiers that are not to be copied from the old user layer to the new user layer + + + + + + Describes migration steps specific for certain version(s) + + + + version identifiers, that are supported for migration + + + + + + Contains the priority value to specify which migration should be prefered. Higher values are prefered. + + + + + + Contains necessary migration steps for specific versions + + + + - LO - Describes one step of migration - - - - LO - an optional uno service that is called after files and nodes have been copied in order to perform custom migration actions. The service needs to support XInitializable and XJob interfaces according do http://specs.openoffice.org/appwide/migration/spec_migration.sxw - - - - - LO - a list of config components that are to be passed to service - - - - - LO - a list of wildcards relative to the old userdata origin that are to be copied - - - - - LO - a list of wildcards relative to the old userdata origin that are to be copied - - - - - LO - a list of configuration node paths that are to be moved from the old user layer to the new user layer - - - - - LO - a list of configuration node paths that are not to be moved from the old user layer to the new user layer - - - - - - AS + AS Describes an application module (a document factory, such as Writer). @@ -416,30 +441,21 @@ - This feature is not supported any more since OOo 2.0 + This feature is not supported any more since OOo 2.0 JB - Deprecated - - - - - - LO - Contains settings that control configuration data access. - - - - LO - The enumeration of migration steps that are to be applied on first start - - - - - LO - version identifiers, that are supported for migration + Deprecated - - + + + Contains settings that control the migration process for certain versions. + + + + Define migration steps for supported versions + + + + -- cgit v1.2.3 From 798c29767b3d27334cd83708965802ff7aa7967e Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 25 Feb 2010 17:02:21 +0100 Subject: #161436# Updated black list for extension migration --- officecfg/registry/data/org/openoffice/Setup.xcu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu index f78882cbdf..15ab809b88 100644 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -793,6 +793,10 @@ com.sun.star.PDFImport.* com.sun.star.PresentationMinimizer.* com.sun.PresenterScreen.* + Sun-Presentation-Minimizer.* + com.sun.reportdesigner + com.sun.star.mysql-connector.* + com.sun.star.ichitaro.* @@ -839,6 +843,10 @@ com.sun.star.PDFImport.* com.sun.star.PresentationMinimizer.* com.sun.PresenterScreen.* + Sun-Presentation-Minimizer.* + com.sun.reportdesigner + com.sun.star.mysql-connector.* + com.sun.star.ichitaro.* -- cgit v1.2.3 From 2feedd1a5a553fa9ef8bba50ec34756d60b3ccf7 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 25 Feb 2010 17:50:08 +0100 Subject: sb118: #i108776# replaced newly introduced version map file with solenv/src template --- scripting/source/vbaevents/makefile.mk | 2 +- scripting/source/vbaevents/vbaevents.map | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100755 scripting/source/vbaevents/vbaevents.map diff --git a/scripting/source/vbaevents/makefile.mk b/scripting/source/vbaevents/makefile.mk index 227da45f9f..1946c61d1e 100755 --- a/scripting/source/vbaevents/makefile.mk +++ b/scripting/source/vbaevents/makefile.mk @@ -60,7 +60,7 @@ SLOFILES= \ SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/scripting/source/vbaevents/vbaevents.map b/scripting/source/vbaevents/vbaevents.map deleted file mode 100755 index 737cddbfe3..0000000000 --- a/scripting/source/vbaevents/vbaevents.map +++ /dev/null @@ -1,9 +0,0 @@ -OOO_1.1 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; -- cgit v1.2.3 From 838741e182920ea10c6cd2c1efd150889a64cb87 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 1 Mar 2010 09:03:00 +0100 Subject: sb118: 64 bit warning --- editeng/source/editeng/editdbg.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 47611286ca..c6035c1bb6 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -458,7 +458,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\n\n ================================================================================" ); fprintf( fp, "\n================== EditEngine & Views ======================================" ); fprintf( fp, "\n================================================================================" ); - fprintf( fp, "\nControl: %lx", pEE->GetControlWord() ); + fprintf( fp, "\nControl: %"SAL_PRIxUINT32, pEE->GetControlWord() ); fprintf( fp, "\nRefMapMode: %i", pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ); fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() ); fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() ); -- cgit v1.2.3 From 759a1e805335f177ea377edad79e4e5961944791 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 1 Mar 2010 16:48:19 +0100 Subject: sb118: make sure test OOo instances can dump core upon crash --- desktop/source/app/app.cxx | 29 ++++------------------------- desktop/source/inc/exithelper.hxx | 4 ---- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index e7172966bb..c716a10d1a 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1149,16 +1149,6 @@ USHORT Desktop::Exception(USHORT nError) switch( nError & EXC_MAJORTYPE ) { -/* - case EXC_USER: - if( nError == EXC_OUTOFMEMORY ) - { - // not possible without a special NewHandler! - String aMemExceptionString; - Application::Abort( aMemExceptionString ); - } - break; -*/ case EXC_RSCNOTLOADED: { String aResExceptionString; @@ -1175,23 +1165,14 @@ USHORT Desktop::Exception(USHORT nError) default: { - if ( pArgs->IsNoRestore() ) { - if (m_pLockfile != NULL) { - m_pLockfile->clean(); - } - _exit( ExitHelper::E_LOCKFILE ); + if (m_pLockfile != NULL) { + m_pLockfile->clean(); } - if( bRestart ) { OfficeIPCThread::DisableOfficeIPCThread(); if( pSignalHandler ) DELETEZ( pSignalHandler ); - - if (m_pLockfile != NULL) { - m_pLockfile->clean(); - } - #ifdef MACOSX DoRestart(); #endif @@ -1199,17 +1180,15 @@ USHORT Desktop::Exception(USHORT nError) } else { - bInException = sal_False; - _exit( ExitHelper::E_CRASH ); + Application::Abort( String() ); } break; } } + OSL_ASSERT(false); // unreachable return 0; - - // ConfigManager is disposed, so no way to continue } void Desktop::AppEvent( const ApplicationEvent& rAppEvent ) diff --git a/desktop/source/inc/exithelper.hxx b/desktop/source/inc/exithelper.hxx index 112d4848f0..682410c6b7 100644 --- a/desktop/source/inc/exithelper.hxx +++ b/desktop/source/inc/exithelper.hxx @@ -56,12 +56,8 @@ class ExitHelper E_SECOND_OFFICE = 1, /// an uno exception was catched during startup E_FATAL_ERROR = 333, // Only the low 8 bits are significant 333 % 256 = 77 - /// crash during runtime - E_CRASH = 78, /// user force automatic restart after crash E_CRASH_WITH_RESTART = 79, - /// ??? - E_LOCKFILE = 80 }; }; -- cgit v1.2.3 From fca521bbb686b3ac9ecfd974593f5791e26505d2 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 29 Mar 2010 10:53:28 +0200 Subject: #161436# Added throbber for migration page. Disable buttons to prevent user to cancel the process - transplanted from 219801e88d38@native0 --- desktop/source/migration/migration.cxx | 1 - desktop/source/migration/pages.cxx | 63 ++++++++++++++++++++++++++-- desktop/source/migration/pages.hxx | 5 ++- desktop/source/migration/wizard.cxx | 75 +++++++++++++++++++++++++++++++--- desktop/source/migration/wizard.hrc | 1 + desktop/source/migration/wizard.hxx | 5 +++ 6 files changed, 138 insertions(+), 12 deletions(-) diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 161a090e22..6666762c13 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -92,7 +92,6 @@ static void releaseImpl() } } - // static main entry point for the migration process void Migration::doMigration() { diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx index c70707bde8..64a1fd54a0 100644 --- a/desktop/source/migration/pages.cxx +++ b/desktop/source/migration/pages.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -62,6 +63,7 @@ using namespace rtl; using namespace osl; using namespace utl; using namespace svt; +using namespace com::sun::star; using namespace com::sun::star::frame; using namespace com::sun::star::lang; using namespace com::sun::star::util; @@ -305,12 +307,46 @@ void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint ) // ------------------------------------------------------------------- -MigrationPage::MigrationPage( svt::OWizardMachine* parent, const ResId& resid) +class MigrationThread : public ::osl::Thread +{ + public: + MigrationThread(); + + virtual void SAL_CALL run(); + virtual void SAL_CALL onTerminated(); +}; + +MigrationThread::MigrationThread() +{ +} + +void MigrationThread::run() +{ + try + { + Migration::doMigration(); + } + catch ( uno::Exception& ) + { + } +} + +void MigrationThread::onTerminated() +{ +} + +// ------------------------------------------------------------------- + +MigrationPage::MigrationPage( + svt::OWizardMachine* parent, + const ResId& resid, + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber) : OWizardPage(parent, resid) , m_ftHead(this, WizardResId(FT_MIGRATION_HEADER)) , m_ftBody(this, WizardResId(FT_MIGRATION_BODY)) , m_cbMigration(this, WizardResId(CB_MIGRATION)) , m_bMigrationDone(sal_False) + , m_xThrobber(xThrobber) { FreeResource(); _setBold(m_ftHead); @@ -325,9 +361,28 @@ sal_Bool MigrationPage::commitPage( CommitPageReason _eReason ) { if (_eReason == eTravelForward && m_cbMigration.IsChecked() && !m_bMigrationDone) { - EnterWait(); - Migration::doMigration(); - LeaveWait(); + GetParent()->EnterWait(); + FirstStartWizard* pWizard = dynamic_cast< FirstStartWizard* >( GetParent() ); + if ( pWizard ) + pWizard->DisableButtonsWhileMigration(); + + uno::Reference< awt::XWindow > xWin( m_xThrobber, uno::UNO_QUERY ); + xWin->setVisible( true ); + m_xThrobber->start(); + MigrationThread* pMigThread = new MigrationThread(); + pMigThread->create(); + + while ( pMigThread->isRunning() ) + { + Application::Reschedule(); + } + + m_xThrobber->stop(); + GetParent()->LeaveWait(); + // Next state will enable buttons - so no EnableButtons necessary! + xWin->setVisible( false ); + pMigThread->join(); + delete pMigThread; m_bMigrationDone = sal_True; } else diff --git a/desktop/source/migration/pages.hxx b/desktop/source/migration/pages.hxx index 57a3d57f7d..478782d266 100644 --- a/desktop/source/migration/pages.hxx +++ b/desktop/source/migration/pages.hxx @@ -38,6 +38,8 @@ #include #include +#include + namespace desktop { class WelcomePage : public svt::OWizardPage @@ -120,8 +122,9 @@ private: FixedText m_ftBody; CheckBox m_cbMigration; sal_Bool m_bMigrationDone; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber; public: - MigrationPage( svt::OWizardMachine* parent, const ResId& resid); + MigrationPage( svt::OWizardMachine* parent, const ResId& resid, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber ); virtual sal_Bool commitPage( CommitPageReason _eReason ); protected: diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx index ae40a73278..ffe27fdd9b 100644 --- a/desktop/source/migration/wizard.cxx +++ b/desktop/source/migration/wizard.cxx @@ -61,11 +61,14 @@ #include #include #include +#include +#include using namespace svt; using namespace rtl; using namespace osl; using namespace utl; +using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::beans; @@ -77,13 +80,23 @@ using namespace com::sun::star::container; namespace desktop { -const FirstStartWizard::WizardState FirstStartWizard::STATE_WELCOME = 0; -const FirstStartWizard::WizardState FirstStartWizard::STATE_LICENSE = 1; -const FirstStartWizard::WizardState FirstStartWizard::STATE_MIGRATION = 2; -const FirstStartWizard::WizardState FirstStartWizard::STATE_USER = 3; +const FirstStartWizard::WizardState FirstStartWizard::STATE_WELCOME = 0; +const FirstStartWizard::WizardState FirstStartWizard::STATE_LICENSE = 1; +const FirstStartWizard::WizardState FirstStartWizard::STATE_MIGRATION = 2; +const FirstStartWizard::WizardState FirstStartWizard::STATE_USER = 3; const FirstStartWizard::WizardState FirstStartWizard::STATE_UPDATE_CHECK = 4; const FirstStartWizard::WizardState FirstStartWizard::STATE_REGISTRATION = 5; +static uno::Reference< uno::XComponentContext > getComponentContext( const uno::Reference< lang::XMultiServiceFactory >& rFactory ) +{ + uno::Reference< uno::XComponentContext > rContext; + uno::Reference< beans::XPropertySet > rPropSet( rFactory, uno::UNO_QUERY ); + uno::Any a = rPropSet->getPropertyValue( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ); + a >>= rContext; + return rContext; +} + WizardResId::WizardResId( USHORT nId ) : ResId( nId, *FirstStartWizard::GetResManager() ) { @@ -118,7 +131,47 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep // enableState(STATE_USER, sal_False); // enableState(STATE_REGISTRATION, sal_False); - ShowButtonFixedLine(sal_True); + try + { + Point pos(5, 210 ); + Size size(11, 11 ); + + pos = LogicToPixel( pos, MAP_APPFONT ); + size = LogicToPixel( size, MAP_APPFONT ); + + uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + uno::Reference< awt::XToolkit > xToolkit( + uno::Reference< lang::XMultiComponentFactory >( + xFactory, uno::UNO_QUERY_THROW)-> + createInstanceWithContext( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")), + getComponentContext(xFactory)), + uno::UNO_QUERY_THROW); + + m_xThrobber = uno::Reference< awt::XThrobber >( + xToolkit->createWindow( + awt::WindowDescriptor( + awt::WindowClass_SIMPLE, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Throbber")), + GetComponentInterface(), 0, + awt::Rectangle( + pos.X(), pos.Y(), size.Width(), size.Height()), + awt::WindowAttribute::SHOW)), + uno::UNO_QUERY_THROW); + } + catch (uno::RuntimeException &) + { + throw; + } + catch (Exception& ) + { + } + + uno::Reference< awt::XWindow > xThrobberWin( m_xThrobber, uno::UNO_QUERY ); + if ( xThrobberWin.is() ) + xThrobberWin->setVisible( false ); + Size aTPSize(TP_WIDTH, TP_HEIGHT); SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT)); @@ -151,6 +204,16 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep defaultButton(WZB_NEXT); } +void FirstStartWizard::EnableButtonsWhileMigration() +{ + enableButtons(0xff, sal_True); +} + +void FirstStartWizard::DisableButtonsWhileMigration() +{ + enableButtons(0xff, sal_False); +} + ::svt::RoadmapWizardTypes::PathId FirstStartWizard::defineWizardPagesDependingFromContext() { ::svt::RoadmapWizardTypes::PathId aDefaultPath = 0; @@ -280,7 +343,7 @@ TabPage* FirstStartWizard::createPage(WizardState _nState) pTabPage = new LicensePage(this, WizardResId(TP_LICENSE), m_aLicensePath); break; case STATE_MIGRATION: - pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION)); + pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_xThrobber ); break; case STATE_USER: pTabPage = new UserPage(this, WizardResId(TP_USER)); diff --git a/desktop/source/migration/wizard.hrc b/desktop/source/migration/wizard.hrc index 7ef461f1ee..7e83748e90 100644 --- a/desktop/source/migration/wizard.hrc +++ b/desktop/source/migration/wizard.hrc @@ -78,6 +78,7 @@ #define ED_USER_LAST 17 #define ED_USER_FATHER 18 #define ED_USER_INITIALS 19 +#define TR_WAITING 20 // global strings #define STR_STATE_WELCOME RID_FIRSTSTSTART_START+100 diff --git a/desktop/source/migration/wizard.hxx b/desktop/source/migration/wizard.hxx index a994ec8274..bc404a8c55 100644 --- a/desktop/source/migration/wizard.hxx +++ b/desktop/source/migration/wizard.hxx @@ -32,6 +32,7 @@ #include #include #include +#include namespace desktop { @@ -61,6 +62,9 @@ public: virtual short Execute(); virtual long PreNotify( NotifyEvent& rNEvt ); + void EnableButtonsWhileMigration(); + void DisableButtonsWhileMigration(); + private: sal_Bool m_bOverride; WizardState _currentState; @@ -73,6 +77,7 @@ private: sal_Bool m_bLicenseWasAccepted; sal_Bool m_bAutomaticUpdChk; Link m_lnkCancel; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber; rtl::OUString m_aLicensePath; -- cgit v1.2.3 From a4de47d90772789647a8e92c4183f9e175091402 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 3 Mar 2010 11:31:11 +0100 Subject: fix a warning --- desktop/source/migration/migration.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 6666762c13..d70c747d6c 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -411,7 +411,6 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions) sal_Int32 MigrationImpl::findPreferedMigrationProcess(const migrations_available& rAvailableMigrations) { - bool bFound( false ); sal_Int32 nIndex( -1 ); sal_Int32 i( 0 ); -- cgit v1.2.3 From c0f9aeda19b46e5174616789cd6076641118e32d Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 29 Mar 2010 11:28:28 +0200 Subject: native0: #161679# Additional parameter and ini file entry to define startup language - transplanted from d9611cb63127@native0 --- desktop/source/app/cmdlineargs.cxx | 84 ++++++++++++++--------- desktop/source/app/cmdlineargs.hxx | 2 + desktop/source/app/langselect.cxx | 132 ++++++++++++++++++++++++++++++++++--- desktop/source/app/langselect.hxx | 1 + 4 files changed, 179 insertions(+), 40 deletions(-) diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 758d797fd4..a0626b762d 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -227,7 +227,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) bViewEvent = sal_False; bStartEvent = sal_False; bDisplaySpec = sal_False; - } + } else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" )) { // open in viewmode @@ -239,31 +239,43 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) bViewEvent = sal_True; bStartEvent = sal_False; bDisplaySpec = sal_False; - } + } else if ( aArgStr.EqualsIgnoreCaseAscii( "-show" )) { - // open in viewmode - bOpenEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_True; - bPrintEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bForceOpenEvent = sal_False; - bDisplaySpec = sal_False; + // open in viewmode + bOpenEvent = sal_False; + bViewEvent = sal_False; + bStartEvent = sal_True; + bPrintEvent = sal_False; + bPrintToEvent = sal_False; + bForceNewEvent = sal_False; + bForceOpenEvent = sal_False; + bDisplaySpec = sal_False; } else if ( aArgStr.EqualsIgnoreCaseAscii( "-display" )) { - // open in viewmode - bOpenEvent = sal_False; - bPrintEvent = sal_False; - bForceOpenEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_True; + // set display + bOpenEvent = sal_False; + bPrintEvent = sal_False; + bForceOpenEvent = sal_False; + bPrintToEvent = sal_False; + bForceNewEvent = sal_False; + bViewEvent = sal_False; + bStartEvent = sal_False; + bDisplaySpec = sal_True; + } + else if ( aArgStr.EqualsIgnoreCaseAscii( "-language" )) + { + bOpenEvent = sal_False; + bPrintEvent = sal_False; + bForceOpenEvent = sal_False; + bPrintToEvent = sal_False; + bForceNewEvent = sal_False; + bViewEvent = sal_False; + bStartEvent = sal_False; + bDisplaySpec = sal_False; } + #ifdef MACOSX /* #i84053# ignore -psn on Mac Platform dependent #ifdef here is ugly, however this is currently @@ -272,15 +284,15 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) */ else if ( aArgStr.CompareToAscii( "-psn", 4 ) == COMPARE_EQUAL ) { - // finder argument from MacOSX - bOpenEvent = sal_False; - bPrintEvent = sal_False; - bForceOpenEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_False; + // finder argument from MacOSX + bOpenEvent = sal_False; + bPrintEvent = sal_False; + bForceOpenEvent = sal_False; + bPrintToEvent = sal_False; + bForceNewEvent = sal_False; + bViewEvent = sal_False; + bStartEvent = sal_False; + bDisplaySpec = sal_False; } #endif } @@ -502,7 +514,12 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& } else if ( aArgStr.Copy(0, 9).EqualsIgnoreCaseAscii( "-version=" )) { - AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, aArgStr.Copy( 15 ) ); + AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, aArgStr.Copy( 9 ) ); + return sal_True; + } + else if ( aArgStr.Copy(0, 10).EqualsIgnoreCaseAscii( "-language=" )) + { + AddStringListParam_Impl( CMD_STRINGPARAM_LANGUAGE, aArgStr.Copy( 10 ) ); return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-writer" )) == sal_True ) @@ -845,6 +862,13 @@ sal_Bool CommandLineArgs::GetPrinterName( ::rtl::OUString& rPara ) const return m_aStrSetParams[ CMD_STRINGPARAM_PRINTERNAME ]; } +sal_Bool CommandLineArgs::GetLanguage( ::rtl::OUString& rPara ) const +{ + osl::MutexGuard aMutexGuard( m_aMutex ); + rPara = m_aStrParams[ CMD_STRINGPARAM_LANGUAGE ]; + return m_aStrSetParams[ CMD_STRINGPARAM_LANGUAGE ]; +} + sal_Bool CommandLineArgs::IsEmpty() const { osl::MutexGuard aMutexGuard( m_aMutex ); diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index fda4ab77cb..a19f4356b3 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -90,6 +90,7 @@ class CommandLineArgs CMD_STRINGPARAM_PRINTTOLIST, CMD_STRINGPARAM_PRINTERNAME, CMD_STRINGPARAM_DISPLAY, + CMD_STRINGPARAM_LANGUAGE, CMD_STRINGPARAM_COUNT // must be last element! }; @@ -165,6 +166,7 @@ class CommandLineArgs sal_Bool GetPrintList( ::rtl::OUString& rPara) const; sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const; sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const; + sal_Bool GetLanguage( ::rtl::OUString& rPara ) const; // Special analyzed states (does not match directly to a command line parameter!) sal_Bool IsPrinting() const; diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 62b3c89922..9904b98a3c 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -52,6 +52,7 @@ #include #include #include +#include using namespace rtl; using namespace com::sun::star::uno; @@ -62,10 +63,54 @@ using namespace com::sun::star::util; namespace desktop { +static char const SOFFICE_BOOTSTRAP[] = "Bootstrap"; +static char const SOFFICE_STARTLANG[] = "STARTLANG"; sal_Bool LanguageSelection::bFoundLanguage = sal_False; OUString LanguageSelection::aFoundLanguage; const OUString LanguageSelection::usFallbackLanguage = OUString::createFromAscii("en-US"); + +static sal_Bool existsURL( OUString const& sURL ) +{ + using namespace osl; + DirectoryItem aDirItem; + + if (sURL.getLength() != 0) + return ( DirectoryItem::get( sURL, aDirItem ) == DirectoryItem::E_None ); + + return sal_False; +} + +// locate soffice.ini/.rc file +static OUString locateSofficeIniFile() +{ + OUString aUserDataPath; + OUString aSofficeIniFileURL; + + // Retrieve the default file URL for the soffice.ini/rc + rtl::Bootstrap().getIniName( aSofficeIniFileURL ); + + if ( utl::Bootstrap::locateUserData( aUserDataPath ) == utl::Bootstrap::PATH_EXISTS ) + { + const char CONFIG_DIR[] = "/config"; + + sal_Int32 nIndex = aSofficeIniFileURL.lastIndexOf( '/'); + if ( nIndex > 0 ) + { + OUString aUserSofficeIniFileURL; + OUStringBuffer aBuffer( aUserDataPath ); + aBuffer.appendAscii( CONFIG_DIR ); + aBuffer.append( aSofficeIniFileURL.copy( nIndex )); + aUserSofficeIniFileURL = aBuffer.makeStringAndClear(); + + if ( existsURL( aUserSofficeIniFileURL )) + return aUserSofficeIniFileURL; + } + } + // Fallback try to use the soffice.ini/rc from program folder + return aSofficeIniFileURL; +} + Locale LanguageSelection::IsoStringToLocale(const OUString& str) { Locale l; @@ -119,8 +164,51 @@ bool LanguageSelection::prepareLanguage() catch (Exception&) { } + // get the selected UI language as string - OUString aLocaleString = getLanguageString(); + bool bCmdLanguage( false ); + bool bIniLanguage( false ); + OUString aEmpty; + OUString aLocaleString = getUserUILanguage(); + + if ( aLocaleString.getLength() == 0 ) + { + CommandLineArgs* pCmdLineArgs = Desktop::GetCommandLineArgs(); + if ( pCmdLineArgs ) + { + pCmdLineArgs->GetLanguage(aLocaleString); + if (isInstalledLanguage(aLocaleString, sal_False)) + { + bCmdLanguage = true; + bFoundLanguage = true; + aFoundLanguage = aLocaleString; + } + else + aLocaleString = aEmpty; + } + + if ( !bCmdLanguage ) + { + OUString aSOfficeIniURL = locateSofficeIniFile(); + Config aConfig(aSOfficeIniURL); + aConfig.SetGroup( SOFFICE_BOOTSTRAP ); + OString sLang = aConfig.ReadKey( SOFFICE_STARTLANG ); + aLocaleString = OUString( sLang.getStr(), sLang.getLength(), RTL_TEXTENCODING_ASCII_US ); + if (isInstalledLanguage(aLocaleString, sal_False)) + { + bIniLanguage = true; + bFoundLanguage = true; + aFoundLanguage = aLocaleString; + } + else + aLocaleString = aEmpty; + } + } + + // user further fallbacks for the UI language + if ( aLocaleString.getLength() == 0 ) + aLocaleString = getLanguageString(); + if ( aLocaleString.getLength() > 0 ) { try @@ -136,10 +224,22 @@ bool LanguageSelection::prepareLanguage() flush(); theConfigProvider->setLocale(loc); - Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW); - xProp->setPropertyValue(OUString::createFromAscii("ooLocale"), makeAny(aLocaleString)); - Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges(); - + if ( !bCmdLanguage ) + { + // Store language only + Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW); + xProp->setPropertyValue(OUString::createFromAscii("ooLocale"), makeAny(aLocaleString)); + Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges(); + } + + if ( bIniLanguage ) + { + // Store language only + Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW); + xProp->setPropertyValue(OUString::createFromAscii("UILocale"), makeAny(aLocaleString)); + Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges(); + } + MsLangId::setConfiguredSystemUILanguage( MsLangId::convertLocaleToLanguage(loc) ); OUString sLocale; @@ -165,7 +265,7 @@ bool LanguageSelection::prepareLanguage() } } - + // #i32939# setting of default document locale // #i32939# this should not be based on the UI language setDefaultLanguage(aLocaleString); @@ -197,11 +297,8 @@ void LanguageSelection::setDefaultLanguage(const OUString& sLocale) } } -OUString LanguageSelection::getLanguageString() +OUString LanguageSelection::getUserUILanguage() { - // did we already find a language? - if (bFoundLanguage) - return aFoundLanguage; // check whether the user has selected a specific language OUString aUserLanguage = getUserLanguage(); if (aUserLanguage.getLength() > 0 ) @@ -219,6 +316,21 @@ OUString LanguageSelection::getLanguageString() resetUserLanguage(); } } + + return aUserLanguage; +} + +OUString LanguageSelection::getLanguageString() +{ + // did we already find a language? + if (bFoundLanguage) + return aFoundLanguage; + + // check whether the user has selected a specific language + OUString aUserLanguage = getUserUILanguage(); + if (aUserLanguage.getLength() > 0 ) + return aUserLanguage ; + // try to use system default aUserLanguage = getSystemLanguage(); if (aUserLanguage.getLength() > 0 ) diff --git a/desktop/source/app/langselect.hxx b/desktop/source/app/langselect.hxx index 8d94b28b32..536bff8928 100644 --- a/desktop/source/app/langselect.hxx +++ b/desktop/source/app/langselect.hxx @@ -50,6 +50,7 @@ private: static com::sun::star::uno::Sequence< rtl::OUString > getInstalledLanguages(); static sal_Bool isInstalledLanguage(rtl::OUString& usLocale, sal_Bool bExact=sal_False); static rtl::OUString getFirstInstalledLanguage(); + static rtl::OUString getUserUILanguage(); static rtl::OUString getUserLanguage(); static rtl::OUString getSystemLanguage(); static void resetUserLanguage(); -- cgit v1.2.3 From becf0f17ce3abec844827763a62ce56e65a649d4 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 3 Mar 2010 15:04:45 +0100 Subject: correct d.lst --- desktop/prj/d.lst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst index 5ec84bca7d..92a4853c2b 100644 --- a/desktop/prj/d.lst +++ b/desktop/prj/d.lst @@ -59,8 +59,8 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms ..\%__SRC%\lib\liboffacc*.so %_DEST%\lib%_EXT%\liboffacc*.so ..\%__SRC%\lib\liboffacc*.dylib %_DEST%\lib%_EXT%\liboffacc*.dylib ..\%__SRC%\bin\migratio*.dll %_DEST%\bin%_EXT%\migratio*.dll -..\%__SRC%\lib\migrationoo2.uno.so %_DEST%\lib%_EXT%\migrationoo2.uno.so -..\%__SRC%\lib\migrationoo2.uno.dylib %_DEST%\lib%_EXT%\migrationoo2.uno.dylib +..\%__SRC%\lib\migratio*.uno.so %_DEST%\lib%_EXT%\migratio*.uno.so +..\%__SRC%\lib\migratio*.uno.dylib %_DEST%\lib%_EXT%\migratio*.uno.dylib ..\%__SRC%\bin\sweb %_DEST%\bin%_EXT%\sweb.bin -- cgit v1.2.3 From ec5d9f79878bbb8d9e0c14d82749963ef70320a9 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 3 Mar 2010 17:30:14 +0100 Subject: native0: #161727# implement latest UX changes --- framework/source/services/backingwindow.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 0ff26114a4..7696ab6ced 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -506,6 +506,9 @@ void BackingWindow::initControls() aModuleOptions, SvtModuleOptions::E_SWRITER, maOpenButton, maOpenText, aMnemns, maOpenString ); nYPos += 10; + + // change taborder to reflect changed positions + maOpenButton.SetZOrder( &maDrawButton, WINDOW_ZORDER_BEFOR ); } else { @@ -527,6 +530,16 @@ void BackingWindow::initControls() if( mnLayoutStyle == 1 ) { + if( mnTextColumnWidth[1] > mnTextColumnWidth[0] ) + { + mnColumnWidth[0] = mnColumnWidth[1]; + mnTextColumnWidth[0] = mnTextColumnWidth[1]; + } + else + { + mnColumnWidth[1] = mnColumnWidth[0]; + mnTextColumnWidth[1] = mnTextColumnWidth[0]; + } if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 ) { maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2; -- cgit v1.2.3 From 9e4a925414efe28af6334f607acfaed8a54c6218 Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Thu, 4 Mar 2010 00:11:19 +0100 Subject: sb118: add missing CFLAGS+= $(CPPUNIT_CFLAGS) to loads of other makefiles, too --- configmgr/qa/unit/makefile.mk | 4 ++++ desktop/qa/deployment_misc/makefile.mk | 4 ++++ shell/qa/makefile.mk | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk index 39f73183a9..b6f1bb2e55 100644 --- a/configmgr/qa/unit/makefile.mk +++ b/configmgr/qa/unit/makefile.mk @@ -33,6 +33,10 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGS+= $(CPPUNIT_CFLAGS) +.ENDIF + DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk index 556df1a623..d8a3317ff6 100644 --- a/desktop/qa/deployment_misc/makefile.mk +++ b/desktop/qa/deployment_misc/makefile.mk @@ -34,6 +34,10 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk .INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGS+= $(CPPUNIT_CFLAGS) +.ENDIF + DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk index a9047f97cf..b918d571ad 100755 --- a/shell/qa/makefile.mk +++ b/shell/qa/makefile.mk @@ -37,6 +37,10 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGS+= $(CPPUNIT_CFLAGS) +.ENDIF + # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl -- cgit v1.2.3 From d88cc3de939bfbf002c326e982556cb687fcdc36 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 29 Mar 2010 11:38:42 +0200 Subject: native0: #161436# fix mac user migration - transplanted from f7773ad1d0b9@native0 --- desktop/source/migration/migration.cxx | 5 +++-- officecfg/registry/data/org/openoffice/Setup.xcu | 6 ++++-- officecfg/registry/data/org/openoffice/makefile.mk | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index d70c747d6c..ede233edd2 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -388,7 +388,7 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions) osl::Security().getConfigDir( aUserInst ); if ( aUserInst.getLength() && aUserInst[ aUserInst.getLength()-1 ] != '/' ) aUserInst += ::rtl::OUString::createFromAscii("/"); -#ifdef UNX +#if defined UNX && ! defined MACOSX // tribute to whoever had the "great" idea to use different names on Windows and Unix aUserInst += ::rtl::OUString::createFromAscii("."); #endif @@ -403,7 +403,7 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions) } catch( uno::Exception& ){} } - i_ver++; + ++i_ver; } return aInfo; @@ -425,6 +425,7 @@ sal_Int32 MigrationImpl::findPreferedMigrationProcess(const migrations_available break; } ++i; + ++rIter; } return nIndex; diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu index 15ab809b88..446c2432f7 100644 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -757,7 +757,8 @@ 100 - StarOffice 9=staroffice/9,StarSuite 9=starsuite/9 + StarOffice 9=staroffice/9,StarSuite 9=starsuite/9 + StarOffice 9=StarOffice/9,StarSuite 9=StarSuite/9 @@ -807,7 +808,8 @@ 90 - OpenOffice.org 3=openoffice.org/3 + OpenOffice.org 3=openoffice.org/3 + OpenOffice.org 3=OpenOffice.org/3 diff --git a/officecfg/registry/data/org/openoffice/makefile.mk b/officecfg/registry/data/org/openoffice/makefile.mk index b51285af50..7de57da341 100644 --- a/officecfg/registry/data/org/openoffice/makefile.mk +++ b/officecfg/registry/data/org/openoffice/makefile.mk @@ -48,6 +48,8 @@ MODULEFILES= \ Inet-macosx.xcu \ Inet-unixdesktop.xcu \ Inet-wnt.xcu \ + Setup-all.xcu \ + Setup-macosx.xcu \ Setup-brand.xcu \ Setup-writer.xcu \ Setup-calc.xcu \ -- cgit v1.2.3 From 638827c296dcecb23bad9e5eb706f9d249171e83 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 4 Mar 2010 17:16:24 +0100 Subject: native0: #161735# Set accept date and patch level after migration --- desktop/source/migration/wizard.cxx | 49 ++++++++++++++++++++++++++++++++++++- desktop/source/migration/wizard.hxx | 1 + 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx index ffe27fdd9b..64b135d87f 100644 --- a/desktop/source/migration/wizard.cxx +++ b/desktop/source/migration/wizard.cxx @@ -97,6 +97,21 @@ static uno::Reference< uno::XComponentContext > getComponentContext( const uno:: return rContext; } +static sal_Int32 getBuildId() +{ + ::rtl::OUString aDefault; + ::rtl::OUString aBuildIdData = utl::Bootstrap::getBuildIdData( aDefault ); + sal_Int32 nBuildId( 0 ); + sal_Int32 nIndex1 = aBuildIdData.indexOf(':'); + sal_Int32 nIndex2 = aBuildIdData.indexOf(')'); + if (( nIndex1 > 0 ) && ( nIndex2 > 0 ) && ( nIndex2-1 > nIndex1+1 )) + { + ::rtl::OUString aBuildId = aBuildIdData.copy( nIndex1+1, nIndex2-nIndex1-1 ); + nBuildId = aBuildId.toInt32(); + } + return nBuildId; +} + WizardResId::WizardResId( USHORT nId ) : ResId( nId, *FirstStartWizard::GetResManager() ) { @@ -406,13 +421,21 @@ sal_Bool FirstStartWizard::prepareLeaveCurrentState( CommitPageReason _eReason ) storeAcceptDate(); m_bLicenseWasAccepted = sal_True; - } + } return svt::RoadmapWizard::prepareLeaveCurrentState(_eReason); } sal_Bool FirstStartWizard::leaveState(WizardState) { + if (( getCurrentState() == STATE_MIGRATION ) && m_bLicenseWasAccepted ) + { + // Store accept date and patch level now as it has been + // overwritten by the migration process! + storeAcceptDate(); + setPatchLevel(); + } + return sal_True; } @@ -499,6 +522,30 @@ void FirstStartWizard::storeAcceptDate() } +void FirstStartWizard::setPatchLevel() +{ + try { + Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + // get configuration provider + Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( + xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); + Sequence< Any > theArgs(1); + NamedValue v(OUString::createFromAscii("NodePath"), + makeAny(OUString::createFromAscii("org.openoffice.Office.Common/Help/Registration"))); + theArgs[0] <<= v; + Reference< XPropertySet > pset = Reference< XPropertySet >( + theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); + Any result = pset->getPropertyValue(OUString::createFromAscii("ReminderDate")); + + OUString aPatchLevel( RTL_CONSTASCII_USTRINGPARAM( "Patch" )); + aPatchLevel += OUString::valueOf( getBuildId(), 10 ); + pset->setPropertyValue(OUString::createFromAscii("ReminderDate"), makeAny(aPatchLevel)); + Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges(); + } catch (const Exception&) + { + } +} + #ifdef WNT typedef int ( __stdcall * CleanCurUserRegProc ) ( wchar_t* ); #endif diff --git a/desktop/source/migration/wizard.hxx b/desktop/source/migration/wizard.hxx index bc404a8c55..9f26a8b4f2 100644 --- a/desktop/source/migration/wizard.hxx +++ b/desktop/source/migration/wizard.hxx @@ -82,6 +82,7 @@ private: rtl::OUString m_aLicensePath; void storeAcceptDate(); + void setPatchLevel(); void disableWizard(); void enableQuickstart(); -- cgit v1.2.3 From 19a51dccadb906d6a91a2d702530c210fb009a94 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 4 Mar 2010 22:13:08 +0100 Subject: sb118: #i109791# improved CPPUNIT_CFLAGS handling --- configmgr/qa/unit/makefile.mk | 4 +--- desktop/qa/deployment_misc/makefile.mk | 5 +---- shell/qa/makefile.mk | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk index b6f1bb2e55..94b4c58c41 100644 --- a/configmgr/qa/unit/makefile.mk +++ b/configmgr/qa/unit/makefile.mk @@ -33,9 +33,7 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGS+= $(CPPUNIT_CFLAGS) -.ENDIF +CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk index d8a3317ff6..15faef0dc4 100644 --- a/desktop/qa/deployment_misc/makefile.mk +++ b/desktop/qa/deployment_misc/makefile.mk @@ -34,10 +34,7 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk .INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGS+= $(CPPUNIT_CFLAGS) -.ENDIF - +CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk index b918d571ad..cc91a6b1ad 100755 --- a/shell/qa/makefile.mk +++ b/shell/qa/makefile.mk @@ -37,9 +37,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGS+= $(CPPUNIT_CFLAGS) -.ENDIF +CFLAGSCXX += $(CPPUNIT_CFLAGS) # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl -- cgit v1.2.3 From fd16f817eb060dbef63d7419f950e5bf03200ec6 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 5 Mar 2010 07:57:12 +0100 Subject: sb118: fixed configmgr/qa/unoapi/Test.java after merge --- configmgr/qa/unoapi/Test.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configmgr/qa/unoapi/Test.java b/configmgr/qa/unoapi/Test.java index 5c820ed53d..4d1f5a3c4b 100644 --- a/configmgr/qa/unoapi/Test.java +++ b/configmgr/qa/unoapi/Test.java @@ -43,8 +43,7 @@ public final class Test { @org.junit.Test public void test() { assertTrue( Runner.run( - "-sce", "cfgmgr2.sce", "-xcl", "knownissues.xcl", "-cs", - connection.getDescription())); + "-sce", "module.sce", "-cs", connection.getDescription())); } private final OfficeConnection connection = new OfficeConnection(); -- cgit v1.2.3 From 56e56223d23f0ccf5a5ff714387aaf38b38c7304 Mon Sep 17 00:00:00 2001 From: tono Date: Fri, 5 Mar 2010 19:15:20 +0900 Subject: i#109673: Mingw port fix: new Windows property handler --- shell/source/win32/shlxthandler/makefile.mk | 10 ++++++++-- shell/source/win32/shlxthandler/ooofilt/makefile.mk | 7 +++++-- shell/source/win32/shlxthandler/prophdl/makefile.mk | 6 +++++- shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx | 4 ++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index 0c2abb405b..4452cb1a90 100755 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -75,8 +75,14 @@ SHL1STDLIBS+=\ $(SHELL32LIB)\ $(KERNEL32LIB)\ $(GDI32LIB)\ - $(GDIPLUSLIB)\ - msvcprt.lib \ + $(GDIPLUSLIB) + +.IF "$(COM)"!="GCC" +SHL1STDLIBS+=\ + msvcprt.lib +.ENDIF + +SHL1STDLIBS+=\ $(SHLWAPILIB) SHL1LIBS+=$(SLB)$/util.lib\ diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk index 0d2a40e147..9111069ab8 100755 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -73,12 +73,15 @@ SHL1STDLIBS+=$(OLE32LIB)\ $(UUIDLIB)\ $(SHELL32LIB)\ $(KERNEL32LIB)\ - $(OLDNAMESLIB)\ - msvcprt.lib + $(OLDNAMESLIB) + +.IF "$(COM)"!="GCC" +SHL1STDLIBS+=msvcprt.lib .IF "$(PRODUCT)"!="full" SHL1STDLIBS+=msvcrt.lib .ENDIF +.ENDIF # $(LIBSTLPORTST) diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk index 572dcb9385..dc6d0e1590 100755 --- a/shell/source/win32/shlxthandler/prophdl/makefile.mk +++ b/shell/source/win32/shlxthandler/prophdl/makefile.mk @@ -73,12 +73,16 @@ SHL1STDLIBS+=\ $(GDI32LIB)\ $(GDIPLUSLIB)\ $(SHLWAPILIB)\ - $(PROPSYSLIB) \ + $(PROPSYSLIB) + +.IF "$(COM)"!="GCC" +SHL1STDLIBS+=\ msvcprt.lib .IF "$(PRODUCT)"!="full" SHL1STDLIBS+=msvcrt.lib .ENDIF +.ENDIF SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx index cbe4638658..cb5d7e2627 100755 --- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -222,7 +222,11 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::Initialize( IStream *pStream, DWORD grfM if ( !m_pCache ) { +#ifdef __MINGW32__ + if ( FAILED( PSCreateMemoryPropertyStore( IID_IPropertyStoreCache, reinterpret_cast(&m_pCache) ) ) ) +#else if ( FAILED( PSCreateMemoryPropertyStore( IID_PPV_ARGS( &m_pCache ) ) ) ) +#endif OutputDebugStringFormat( "CPropertyHdl::Initialize: PSCreateMemoryPropertyStore failed" ); zlib_filefunc_def z_filefunc; -- cgit v1.2.3 From f92b34f93d52777d3c86ca9a7be8d7f69b33c9a2 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 29 Mar 2010 16:24:13 +0200 Subject: native0ext:#161688# rebranding extensions - transplanted from 28f77bc32e70@native0 --- desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 8 ++++---- desktop/source/deployment/gui/dp_gui_extlistbox.hxx | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 2852e67e7d..e974d7ab21 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -520,10 +520,10 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntr else aImage = isHCMode() ? pEntry->m_aIconHC : pEntry->m_aIcon; Size aImageSize = aImage.GetSizePixel(); - if ( ( aImageSize.Width() <= ICON_HEIGHT ) && ( aImageSize.Height() <= ICON_HEIGHT ) ) - DrawImage( Point( aPos.X()+((ICON_HEIGHT-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage ); + if ( ( aImageSize.Width() <= ICON_WIDTH ) && ( aImageSize.Height() <= ICON_HEIGHT ) ) + DrawImage( Point( aPos.X()+((ICON_WIDTH-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage ); else - DrawImage( aPos, Size( ICON_HEIGHT, ICON_HEIGHT ), aImage ); + DrawImage( aPos, Size( ICON_WIDTH, ICON_HEIGHT ), aImage ); // Setup fonts Font aStdFont( GetFont() ); diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index 2749db99ce..18f9844349 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -45,9 +45,10 @@ namespace dp_gui { #define SMALL_ICON_SIZE 16 -#define TOP_OFFSET 3 +#define TOP_OFFSET 5 #define ICON_HEIGHT 42 -#define ICON_OFFSET 50 +#define ICON_WIDTH 47 +#define ICON_OFFSET 72 #define RIGHT_ICON_OFFSET 5 #define SPACE_BETWEEN 3 -- cgit v1.2.3 From d71901791b1c1dbd069ec969c6080afd5ccfc2f8 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 29 Mar 2010 16:47:49 +0200 Subject: native0ext:#161688# rebranding extensions, part 2 - transplanted from 3d9497740c41@native0 --- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 8f79fc5820..afd3fcdf3d 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -90,7 +90,6 @@ using ::rtl::OUString; namespace dp_gui { -#define ICON_OFFSET 50 #define TOP_OFFSET 3 #define LINE_SIZE 4 #define PROGRESS_WIDTH 60 -- cgit v1.2.3 From fd47ace081397729989d761adc44075219025e87 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 5 Mar 2010 13:49:51 +0100 Subject: native0: #161702# New copyright message --- svx/source/intro/ooo.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src index f025fb9de0..4870a5c4dd 100644 --- a/svx/source/intro/ooo.src +++ b/svx/source/intro/ooo.src @@ -1,4 +1,4 @@ -/************************************************************************* +/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -86,7 +86,7 @@ ModalDialog RID_DEFAULTABOUT { Pos = MAP_APPFONT ( 54 , 25 ) ; Size = MAP_APPFONT ( 168 , 51 ) ; - Text[ en-US ] ="Copyright 2000-2009 Sun Microsystems Inc.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html."; + Text[ en-US ] ="Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html."; WordBreak = TRUE ; }; StringArray ABOUT_STR_DEVELOPER_ARY -- cgit v1.2.3 From ec0538753e04f59611c5a6d362af702bed79017e Mon Sep 17 00:00:00 2001 From: tono Date: Sun, 7 Mar 2010 06:59:41 +0900 Subject: mingwport29: Windows API version check fix (see i108416 and cws ause113) --- fpicker/source/win32/filepicker/makefile.mk | 1 + shell/source/win32/shlxthandler/propsheets/makefile.mk | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fpicker/source/win32/filepicker/makefile.mk b/fpicker/source/win32/filepicker/makefile.mk index feea7ee803..17e4f26090 100644 --- a/fpicker/source/win32/filepicker/makefile.mk +++ b/fpicker/source/win32/filepicker/makefile.mk @@ -43,6 +43,7 @@ CDEFS+=-D_UNICODE CDEFS+=-DUNICODE #CDEFS+=-DWIN32_LEAN_AND_MEAN #CDEFS+=-DWIN32 +CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0600 # --- Resources ---------------------------------------------------- diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk index fd83f33b99..55a31c9c59 100644 --- a/shell/source/win32/shlxthandler/propsheets/makefile.mk +++ b/shell/source/win32/shlxthandler/propsheets/makefile.mk @@ -35,13 +35,14 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE +CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0501 -U_WIN32_IE -D_WIN32_IE=0x501 +.IF "$(COM)"!="GCC" CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS+=-D_WIN32_IE=0x501 - -CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS_X64+=-D_WIN32_IE=0x501 +CDEFS_X64+=-D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x501 +.ENDIF # --- Files -------------------------------------------------------- -- cgit v1.2.3 From 73302e74691eae1a855436570aa1da5c53260add Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 10 Mar 2010 11:53:03 +0100 Subject: native0: #161727# latest background bitmap does not distinguish RTL, but placement does --- framework/source/services/backingwindow.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 7696ab6ced..cd66e56b30 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -354,7 +354,12 @@ void BackingWindow::initBackground() maOpenText.SetControlBackground( aTextBGColor ); if( mnLayoutStyle == 1 ) - mnBtnPos = maBackgroundLeft.GetSizePixel().Width() + 40; + { + if( Application::GetSettings().GetLayoutRTL() ) + mnBtnPos = maBackgroundRight.GetSizePixel().Width() + 40; + else + mnBtnPos = maBackgroundLeft.GetSizePixel().Width() + 40; + } } void BackingWindow::initControls() -- cgit v1.2.3 From 600dc79525d5df8161108d96edf8a8901d47b20e Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Tue, 30 Mar 2010 11:19:24 +0200 Subject: native0ext:#161688# rebranding extensions, part 2 - transplanted from 7e1d416e40bf@native0 --- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index afd3fcdf3d..2a0cef61b8 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -90,7 +90,7 @@ using ::rtl::OUString; namespace dp_gui { -#define TOP_OFFSET 3 +#define TOP_OFFSET 5 #define LINE_SIZE 4 #define PROGRESS_WIDTH 60 #define PROGRESS_HEIGHT 14 -- cgit v1.2.3 From a74010d5774c5dda812ce4d8df9330ebd4a68357 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Tue, 30 Mar 2010 11:31:53 +0200 Subject: native0: #161436# Make migration only available for o5oo - transplanted from 63cddf4e9a61@native0 --- officecfg/registry/data/org/openoffice/Setup.xcu | 102 --------------------- officecfg/registry/data/org/openoffice/makefile.mk | 2 - 2 files changed, 104 deletions(-) mode change 100644 => 100755 officecfg/registry/data/org/openoffice/Setup.xcu mode change 100644 => 100755 officecfg/registry/data/org/openoffice/makefile.mk diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu old mode 100644 new mode 100755 index 446c2432f7..087e2cf6c5 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -752,108 +752,6 @@ - - - 100 - - - StarOffice 9=staroffice/9,StarSuite 9=starsuite/9 - StarOffice 9=StarOffice/9,StarSuite 9=StarSuite/9 - - - - - - user/autocorr/.* - user/autotext/.* - user/backup/.* - user/basic/.* - user/config/.*\.so[bcdegh] - user/config/.*\.fmt - user/config/.*\.dat - user/config/javasettings_.*\.xml - user/config/soffice\.cfg/modules/[^/]*/toolbar/custom.*\.xml - user/config/soffice\.cfg/modules/[^/]*/images/.* - user/crashdata/.* - user/database/.* - user/gallery/.* - user/registry/.* - user/Scripts/.* - user/store/.* - user/template/.* - user/wordbook/.* - - - - - - com.sun.star.comp.desktop.migration.OOo3Extensions - - - - com.sun.star.PDFImport.* - com.sun.star.PresentationMinimizer.* - com.sun.PresenterScreen.* - Sun-Presentation-Minimizer.* - com.sun.reportdesigner - com.sun.star.mysql-connector.* - com.sun.star.ichitaro.* - - - - - - - - 90 - - - OpenOffice.org 3=openoffice.org/3 - OpenOffice.org 3=OpenOffice.org/3 - - - - - - user/autocorr/.* - user/autotext/.* - user/backup/.* - user/basic/.* - user/config/.*\.so[bcdegh] - user/config/.*\.fmt - user/config/.*\.dat - user/config/javasettings_.*\.xml - user/config/soffice\.cfg/modules/[^/]*/toolbar/custom.*\.xml - user/config/soffice\.cfg/modules/[^/]*/images/.* - user/crashdata/.* - user/database/.* - user/gallery/.* - user/registry/.* - user/Scripts/.* - user/store/.* - user/template/.* - user/wordbook/.* - - - - - - com.sun.star.comp.desktop.migration.OOo3Extensions - - - - com.sun.star.PDFImport.* - com.sun.star.PresentationMinimizer.* - com.sun.PresenterScreen.* - Sun-Presentation-Minimizer.* - com.sun.reportdesigner - com.sun.star.mysql-connector.* - com.sun.star.ichitaro.* - - - - - 10 diff --git a/officecfg/registry/data/org/openoffice/makefile.mk b/officecfg/registry/data/org/openoffice/makefile.mk old mode 100644 new mode 100755 index 7de57da341..b51285af50 --- a/officecfg/registry/data/org/openoffice/makefile.mk +++ b/officecfg/registry/data/org/openoffice/makefile.mk @@ -48,8 +48,6 @@ MODULEFILES= \ Inet-macosx.xcu \ Inet-unixdesktop.xcu \ Inet-wnt.xcu \ - Setup-all.xcu \ - Setup-macosx.xcu \ Setup-brand.xcu \ Setup-writer.xcu \ Setup-calc.xcu \ -- cgit v1.2.3 From 6586ac02d9223cf1616016fbad881f08bab3029f Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 12 Mar 2010 14:10:52 +0100 Subject: native0: #161756# New splash screen, about box and icons for OOo --- desktop/zipintro/makefile.mk | 13 ++++++++----- sysui/desktop/icons/hicolor/128x128/apps/base.png | Bin 16745 -> 17674 bytes sysui/desktop/icons/hicolor/128x128/apps/calc.png | Bin 12968 -> 15582 bytes sysui/desktop/icons/hicolor/128x128/apps/draw.png | Bin 16732 -> 16479 bytes .../desktop/icons/hicolor/128x128/apps/impress.png | Bin 14614 -> 17785 bytes sysui/desktop/icons/hicolor/128x128/apps/main.png | Bin 12442 -> 15601 bytes sysui/desktop/icons/hicolor/128x128/apps/math.png | Bin 12934 -> 15536 bytes .../desktop/icons/hicolor/128x128/apps/writer.png | Bin 11861 -> 14510 bytes sysui/desktop/icons/hicolor/16x16/apps/base.png | Bin 3618 -> 869 bytes sysui/desktop/icons/hicolor/16x16/apps/calc.png | Bin 3629 -> 779 bytes sysui/desktop/icons/hicolor/16x16/apps/draw.png | Bin 3606 -> 875 bytes sysui/desktop/icons/hicolor/16x16/apps/impress.png | Bin 3608 -> 837 bytes sysui/desktop/icons/hicolor/16x16/apps/main.png | Bin 0 -> 893 bytes sysui/desktop/icons/hicolor/16x16/apps/math.png | Bin 3607 -> 791 bytes sysui/desktop/icons/hicolor/16x16/apps/writer.png | Bin 3586 -> 776 bytes sysui/desktop/icons/hicolor/32x32/apps/base.png | Bin 3153 -> 2594 bytes sysui/desktop/icons/hicolor/32x32/apps/calc.png | Bin 2731 -> 2258 bytes sysui/desktop/icons/hicolor/32x32/apps/draw.png | Bin 3147 -> 2491 bytes sysui/desktop/icons/hicolor/32x32/apps/impress.png | Bin 2903 -> 2576 bytes sysui/desktop/icons/hicolor/32x32/apps/main.png | Bin 0 -> 2429 bytes sysui/desktop/icons/hicolor/32x32/apps/math.png | Bin 2715 -> 2371 bytes sysui/desktop/icons/hicolor/32x32/apps/writer.png | Bin 2485 -> 2158 bytes sysui/desktop/icons/hicolor/48x48/apps/base.png | Bin 5196 -> 4740 bytes sysui/desktop/icons/hicolor/48x48/apps/calc.png | Bin 4319 -> 4298 bytes sysui/desktop/icons/hicolor/48x48/apps/draw.png | Bin 5207 -> 4415 bytes sysui/desktop/icons/hicolor/48x48/apps/impress.png | Bin 4974 -> 4672 bytes sysui/desktop/icons/hicolor/48x48/apps/main.png | Bin 0 -> 4184 bytes sysui/desktop/icons/hicolor/48x48/apps/math.png | Bin 4489 -> 4263 bytes sysui/desktop/icons/hicolor/48x48/apps/writer.png | Bin 3938 -> 3983 bytes sysui/desktop/icons/main.icns | Bin 45712 -> 51889 bytes sysui/desktop/icons/ooo3_base_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/ooo3_calc_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/ooo3_draw_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/ooo3_impress_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/ooo3_main_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/ooo3_math_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/ooo3_writer_app.ico | Bin 295606 -> 295606 bytes 37 files changed, 8 insertions(+), 5 deletions(-) create mode 100755 sysui/desktop/icons/hicolor/16x16/apps/main.png create mode 100755 sysui/desktop/icons/hicolor/32x32/apps/main.png create mode 100755 sysui/desktop/icons/hicolor/48x48/apps/main.png mode change 100644 => 100755 sysui/desktop/icons/main.icns mode change 100644 => 100755 sysui/desktop/icons/ooo3_base_app.ico mode change 100644 => 100755 sysui/desktop/icons/ooo3_calc_app.ico mode change 100644 => 100755 sysui/desktop/icons/ooo3_draw_app.ico mode change 100644 => 100755 sysui/desktop/icons/ooo3_impress_app.ico mode change 100644 => 100755 sysui/desktop/icons/ooo3_main_app.ico mode change 100644 => 100755 sysui/desktop/icons/ooo3_math_app.ico mode change 100644 => 100755 sysui/desktop/icons/ooo3_writer_app.ico diff --git a/desktop/zipintro/makefile.mk b/desktop/zipintro/makefile.mk index 6a1ff592d6..a382d51e79 100644 --- a/desktop/zipintro/makefile.mk +++ b/desktop/zipintro/makefile.mk @@ -37,16 +37,16 @@ DEFAULT_FLAVOURS=dev dev_nologo nologo broffice dev_broffice nologo_broffice nol ZIP1LIST= \ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP2LIST= \ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP3LIST= \ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP4LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(INTRO_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/intro.png $(INTRO_BITMAPS)) \ + $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP5LIST= \ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) @@ -129,3 +129,6 @@ $(MISC)$/%.bmp : $(SOLARSRC)$/%.bmp @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ +$(MISC)$/%.png : $(SOLARSRC)$/%.png + @@-$(MKDIRHIER) $(@:d) + $(COPY) $< $@ diff --git a/sysui/desktop/icons/hicolor/128x128/apps/base.png b/sysui/desktop/icons/hicolor/128x128/apps/base.png index 42b027626c..398c2f058d 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/apps/base.png and b/sysui/desktop/icons/hicolor/128x128/apps/base.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/apps/calc.png b/sysui/desktop/icons/hicolor/128x128/apps/calc.png index 368fb03e2d..8156308833 100644 Binary files a/sysui/desktop/icons/hicolor/128x128/apps/calc.png and b/sysui/desktop/icons/hicolor/128x128/apps/calc.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/apps/draw.png b/sysui/desktop/icons/hicolor/128x128/apps/draw.png index 72b67c8312..3f71b25fe1 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/apps/draw.png and b/sysui/desktop/icons/hicolor/128x128/apps/draw.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/apps/impress.png b/sysui/desktop/icons/hicolor/128x128/apps/impress.png index 32ad785e16..b62b449e57 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/apps/impress.png and b/sysui/desktop/icons/hicolor/128x128/apps/impress.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/apps/main.png b/sysui/desktop/icons/hicolor/128x128/apps/main.png index fd68a10960..1b51a60bdd 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/apps/main.png and b/sysui/desktop/icons/hicolor/128x128/apps/main.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/apps/math.png b/sysui/desktop/icons/hicolor/128x128/apps/math.png index 79e71ce223..d37c98aa40 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/apps/math.png and b/sysui/desktop/icons/hicolor/128x128/apps/math.png differ diff --git a/sysui/desktop/icons/hicolor/128x128/apps/writer.png b/sysui/desktop/icons/hicolor/128x128/apps/writer.png index 0d057fa4ba..b991a6d2e2 100755 Binary files a/sysui/desktop/icons/hicolor/128x128/apps/writer.png and b/sysui/desktop/icons/hicolor/128x128/apps/writer.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/apps/base.png b/sysui/desktop/icons/hicolor/16x16/apps/base.png index 3a08ee1182..57a4477cc6 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/apps/base.png and b/sysui/desktop/icons/hicolor/16x16/apps/base.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/apps/calc.png b/sysui/desktop/icons/hicolor/16x16/apps/calc.png index 2dc540711b..78f923d0ed 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/apps/calc.png and b/sysui/desktop/icons/hicolor/16x16/apps/calc.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/apps/draw.png b/sysui/desktop/icons/hicolor/16x16/apps/draw.png index afc037060d..7779dd46f3 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/apps/draw.png and b/sysui/desktop/icons/hicolor/16x16/apps/draw.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/apps/impress.png b/sysui/desktop/icons/hicolor/16x16/apps/impress.png index f1957da748..ff07597b1d 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/apps/impress.png and b/sysui/desktop/icons/hicolor/16x16/apps/impress.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/apps/main.png b/sysui/desktop/icons/hicolor/16x16/apps/main.png new file mode 100755 index 0000000000..3aa8f08a8c Binary files /dev/null and b/sysui/desktop/icons/hicolor/16x16/apps/main.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/apps/math.png b/sysui/desktop/icons/hicolor/16x16/apps/math.png index de1488226a..10c71e6caa 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/apps/math.png and b/sysui/desktop/icons/hicolor/16x16/apps/math.png differ diff --git a/sysui/desktop/icons/hicolor/16x16/apps/writer.png b/sysui/desktop/icons/hicolor/16x16/apps/writer.png index 8304269862..2b82110e18 100644 Binary files a/sysui/desktop/icons/hicolor/16x16/apps/writer.png and b/sysui/desktop/icons/hicolor/16x16/apps/writer.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/base.png b/sysui/desktop/icons/hicolor/32x32/apps/base.png index f30fe4a53c..f4772d75da 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/apps/base.png and b/sysui/desktop/icons/hicolor/32x32/apps/base.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/calc.png b/sysui/desktop/icons/hicolor/32x32/apps/calc.png index 4e7e423d71..a1eae7b37a 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/apps/calc.png and b/sysui/desktop/icons/hicolor/32x32/apps/calc.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/draw.png b/sysui/desktop/icons/hicolor/32x32/apps/draw.png index f34faf5b51..4dc928a351 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/apps/draw.png and b/sysui/desktop/icons/hicolor/32x32/apps/draw.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/impress.png b/sysui/desktop/icons/hicolor/32x32/apps/impress.png index 7b8ec6432f..9abced7df4 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/apps/impress.png and b/sysui/desktop/icons/hicolor/32x32/apps/impress.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/main.png b/sysui/desktop/icons/hicolor/32x32/apps/main.png new file mode 100755 index 0000000000..296c6f4c58 Binary files /dev/null and b/sysui/desktop/icons/hicolor/32x32/apps/main.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/math.png b/sysui/desktop/icons/hicolor/32x32/apps/math.png index 6c3c3b68f0..146a7dea71 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/apps/math.png and b/sysui/desktop/icons/hicolor/32x32/apps/math.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/writer.png b/sysui/desktop/icons/hicolor/32x32/apps/writer.png index 8a59432558..97b9d3f5cf 100644 Binary files a/sysui/desktop/icons/hicolor/32x32/apps/writer.png and b/sysui/desktop/icons/hicolor/32x32/apps/writer.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/base.png b/sysui/desktop/icons/hicolor/48x48/apps/base.png index d68e712812..382ad3e6ec 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/apps/base.png and b/sysui/desktop/icons/hicolor/48x48/apps/base.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/calc.png b/sysui/desktop/icons/hicolor/48x48/apps/calc.png index 33690ba3c2..d94aae38fb 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/apps/calc.png and b/sysui/desktop/icons/hicolor/48x48/apps/calc.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/draw.png b/sysui/desktop/icons/hicolor/48x48/apps/draw.png index 2acb57226d..1a2d252c7c 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/apps/draw.png and b/sysui/desktop/icons/hicolor/48x48/apps/draw.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/impress.png b/sysui/desktop/icons/hicolor/48x48/apps/impress.png index a46324e006..35d3b25c55 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/apps/impress.png and b/sysui/desktop/icons/hicolor/48x48/apps/impress.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/main.png b/sysui/desktop/icons/hicolor/48x48/apps/main.png new file mode 100755 index 0000000000..86bcf59955 Binary files /dev/null and b/sysui/desktop/icons/hicolor/48x48/apps/main.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/math.png b/sysui/desktop/icons/hicolor/48x48/apps/math.png index 691ef832b1..3572d76b6b 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/apps/math.png and b/sysui/desktop/icons/hicolor/48x48/apps/math.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/writer.png b/sysui/desktop/icons/hicolor/48x48/apps/writer.png index 9ae7402374..8041a209dd 100644 Binary files a/sysui/desktop/icons/hicolor/48x48/apps/writer.png and b/sysui/desktop/icons/hicolor/48x48/apps/writer.png differ diff --git a/sysui/desktop/icons/main.icns b/sysui/desktop/icons/main.icns old mode 100644 new mode 100755 index c7ee5d7552..8357c09c0c Binary files a/sysui/desktop/icons/main.icns and b/sysui/desktop/icons/main.icns differ diff --git a/sysui/desktop/icons/ooo3_base_app.ico b/sysui/desktop/icons/ooo3_base_app.ico old mode 100644 new mode 100755 index c728e83027..ba96b79876 Binary files a/sysui/desktop/icons/ooo3_base_app.ico and b/sysui/desktop/icons/ooo3_base_app.ico differ diff --git a/sysui/desktop/icons/ooo3_calc_app.ico b/sysui/desktop/icons/ooo3_calc_app.ico old mode 100644 new mode 100755 index f46433ec08..c960415415 Binary files a/sysui/desktop/icons/ooo3_calc_app.ico and b/sysui/desktop/icons/ooo3_calc_app.ico differ diff --git a/sysui/desktop/icons/ooo3_draw_app.ico b/sysui/desktop/icons/ooo3_draw_app.ico old mode 100644 new mode 100755 index 74abe03ace..6e00cb8937 Binary files a/sysui/desktop/icons/ooo3_draw_app.ico and b/sysui/desktop/icons/ooo3_draw_app.ico differ diff --git a/sysui/desktop/icons/ooo3_impress_app.ico b/sysui/desktop/icons/ooo3_impress_app.ico old mode 100644 new mode 100755 index 1eed9c1f17..23ee3ecc5e Binary files a/sysui/desktop/icons/ooo3_impress_app.ico and b/sysui/desktop/icons/ooo3_impress_app.ico differ diff --git a/sysui/desktop/icons/ooo3_main_app.ico b/sysui/desktop/icons/ooo3_main_app.ico old mode 100644 new mode 100755 index f858d92bdd..98fcea3748 Binary files a/sysui/desktop/icons/ooo3_main_app.ico and b/sysui/desktop/icons/ooo3_main_app.ico differ diff --git a/sysui/desktop/icons/ooo3_math_app.ico b/sysui/desktop/icons/ooo3_math_app.ico old mode 100644 new mode 100755 index a712362795..605814c96e Binary files a/sysui/desktop/icons/ooo3_math_app.ico and b/sysui/desktop/icons/ooo3_math_app.ico differ diff --git a/sysui/desktop/icons/ooo3_writer_app.ico b/sysui/desktop/icons/ooo3_writer_app.ico old mode 100644 new mode 100755 index 3e7efa610b..005bd58766 Binary files a/sysui/desktop/icons/ooo3_writer_app.ico and b/sysui/desktop/icons/ooo3_writer_app.ico differ -- cgit v1.2.3 From df2551ec42bdb89406eb761a64b9b13b43e84653 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Tue, 30 Mar 2010 13:51:42 +0200 Subject: native0: #161767# OOo rebranding - transplanted from 26f86bb16da0@native0 --- framework/inc/framework.hrc | 8 +- framework/source/services/backingwindow.cxx | 149 ++++++++-------------------- framework/source/services/backingwindow.hxx | 6 +- framework/source/services/fwk_services.src | 56 ++++++----- 4 files changed, 81 insertions(+), 138 deletions(-) diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc index d4037ea26a..bea7dede55 100644 --- a/framework/inc/framework.hrc +++ b/framework/inc/framework.hrc @@ -59,13 +59,9 @@ #define BMP_BACKING_FORMULA 11 #define BMP_BACKING_OPENFILE 12 #define BMP_BACKING_OPENTEMPLATE 13 -#define BMP_BACKING_EXT 14 #define STR_BACKING_EXTHELP 15 -#define BMP_BACKING_REG 16 #define STR_BACKING_REGHELP 17 -#define BMP_BACKING_INFO 18 #define STR_BACKING_INFOHELP 19 -#define BMP_BACKING_TPLREP 20 #define STR_BACKING_TPLREP 21 #define BMP_BACKING_FOLDER 22 @@ -77,6 +73,10 @@ #define BMP_BACKING_BACKGROUND_RIGHT 3 #define BMP_BACKING_BACKGROUND_RTL_LEFT 4 #define BMP_BACKING_BACKGROUND_RTL_RIGHT 5 +#define BMP_BACKING_EXT 6 +#define BMP_BACKING_REG 7 +#define BMP_BACKING_INFO 8 +#define BMP_BACKING_TPLREP 9 // Ids of TabWindow #define WIN_TABWINDOW (RID_FWK_DIALOG_START+101) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index cd66e56b30..60a75609d6 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -116,13 +116,14 @@ BackingWindow::BackingWindow( Window* i_pParent ) : Window( i_pParent, FwkResId( DLG_BACKING ) ), maWelcome( this, WB_LEFT ), maProduct( this, WB_LEFT ), - maCreateText( this, WB_LEFT ), maWriterText( this, WB_WORDBREAK | WB_VCENTER ), maWriterButton( this, STC_BUTTON_STYLE ), maCalcText( this, WB_WORDBREAK | WB_VCENTER ), maCalcButton( this, STC_BUTTON_STYLE ), maImpressText( this, WB_WORDBREAK | WB_VCENTER ), maImpressButton( this, STC_BUTTON_STYLE ), + maOpenText( this, WB_WORDBREAK | WB_VCENTER ), + maOpenButton( this, STC_BUTTON_STYLE ), maDrawText( this, WB_WORDBREAK | WB_VCENTER ), maDrawButton( this, STC_BUTTON_STYLE ), maDBText( this, WB_WORDBREAK | WB_VCENTER ), @@ -131,19 +132,16 @@ BackingWindow::BackingWindow( Window* i_pParent ) : maMathButton( this, STC_BUTTON_STYLE ), maTemplateText( this, WB_WORDBREAK | WB_VCENTER ), maTemplateButton( this, STC_BUTTON_STYLE ), - maOpenText( this, WB_WORDBREAK | WB_VCENTER ), - maOpenButton( this, STC_BUTTON_STYLE ), maToolbox( this, WB_DIALOGCONTROL ), maWelcomeString( FwkResId( STR_BACKING_WELCOME ) ), maProductString( FwkResId( STR_BACKING_WELCOMEPRODUCT ) ), - maCreateString( FwkResId( STR_BACKING_CREATE ) ), maOpenString( FwkResId( STR_BACKING_FILE ) ), maTemplateString( FwkResId( STR_BACKING_TEMPLATE ) ), maButtonImageSize( 10, 10 ), mbInitControls( false ), mnLayoutStyle( 0 ), mpAccExec( NULL ), - mnBtnPos( 240 ) + mnBtnPos( 120 ) { mnColumnWidth[0] = mnColumnWidth[1] = 0; mnTextColumnWidth[0] = mnTextColumnWidth[1] = 0; @@ -180,24 +178,12 @@ BackingWindow::BackingWindow( Window* i_pParent ) : loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton ); loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton ); loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton ); - if( mnLayoutStyle == 1 ) - { - loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton ); - loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton ); - } - else - { - loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton ); - loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton ); - } + loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton ); + loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton ); - BitmapEx aExtImage( FwkResId( BMP_BACKING_EXT ) ); String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) ); - BitmapEx aRegImage( FwkResId( BMP_BACKING_REG ) ); String aRegHelpText( FwkResId( STR_BACKING_REGHELP ) ); - BitmapEx aInfoImage( FwkResId( BMP_BACKING_INFO ) ); String aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) ); - BitmapEx aTplRepImage( FwkResId( BMP_BACKING_TPLREP ) ); String aTplRepHelpText( FwkResId( STR_BACKING_TPLREP ) ); // clean up resource stack @@ -217,25 +203,25 @@ BackingWindow::BackingWindow( Window* i_pParent ) : maToolbox.SetStyle( maToolbox.GetStyle() | WB_FORCETABCYCLE ); // insert toolbox items - maToolbox.InsertItem( nItemId_TplRep, Image( aTplRepImage ) ); + maToolbox.InsertItem( nItemId_TplRep, Image() ); maToolbox.SetItemText( nItemId_TplRep, aTplRepHelpText ); maToolbox.SetQuickHelpText( nItemId_TplRep, aTplRepHelpText ); maToolbox.SetItemCommand( nItemId_TplRep, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:TemplateRepository" ) ) ); maToolbox.ShowItem( nItemId_TplRep ); - maToolbox.InsertItem( nItemId_Extensions, Image( aExtImage ) ); + maToolbox.InsertItem( nItemId_Extensions, Image() ); maToolbox.SetQuickHelpText( nItemId_Extensions, aExtHelpText ); maToolbox.SetItemText( nItemId_Extensions, aExtHelpText ); maToolbox.SetItemCommand( nItemId_Extensions, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Extensions" ) ) ); maToolbox.ShowItem( nItemId_Extensions ); - maToolbox.InsertItem( nItemId_Reg, Image( aRegImage ) ); + maToolbox.InsertItem( nItemId_Reg, Image() ); maToolbox.SetQuickHelpText( nItemId_Reg, aRegHelpText ); maToolbox.SetItemText( nItemId_Reg, aRegHelpText ); maToolbox.SetItemCommand( nItemId_Reg, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Register" ) ) ); maToolbox.ShowItem( nItemId_Reg ); - maToolbox.InsertItem( nItemId_Info, Image( aInfoImage ) ); + maToolbox.InsertItem( nItemId_Info, Image() ); maToolbox.SetItemText( nItemId_Info, aInfoHelpText ); maToolbox.SetQuickHelpText( nItemId_Info, aInfoHelpText ); maToolbox.SetItemCommand( nItemId_Info, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Info" ) ) ); @@ -329,13 +315,15 @@ void BackingWindow::initBackground() maBackgroundLeft = BitmapEx( FwkResId( BMP_BACKING_BACKGROUND_LEFT ) ); maBackgroundRight = BitmapEx( FwkResId( BMP_BACKING_BACKGROUND_RIGHT ) ); } + maToolbox.SetItemImage( nItemId_Extensions, BitmapEx( FwkResId( BMP_BACKING_EXT ) ) ); + maToolbox.SetItemImage( nItemId_Reg, BitmapEx( FwkResId( BMP_BACKING_REG ) ) ); + maToolbox.SetItemImage( nItemId_Info, BitmapEx( FwkResId( BMP_BACKING_INFO ) ) ); + maToolbox.SetItemImage( nItemId_TplRep, BitmapEx( FwkResId( BMP_BACKING_TPLREP ) ) ); maWelcome.SetControlForeground( maWelcomeTextColor ); maWelcome.SetBackground(); maProduct.SetControlForeground( maWelcomeTextColor ); maProduct.SetBackground(); - maCreateText.SetControlForeground( maLabelTextColor ); - maCreateText.SetControlBackground( aTextBGColor ); maWriterText.SetControlForeground( maLabelTextColor ); maWriterText.SetControlBackground( aTextBGColor ); maCalcText.SetControlForeground( maLabelTextColor ); @@ -398,8 +386,6 @@ void BackingWindow::initControls() if( maControlRect.GetWidth() < mnBtnPos + maWelcomeSize.Width() + 20 ) maControlRect.Right() = maControlRect.Left() + maWelcomeSize.Width() + mnBtnPos + 20; - maWelcome.Show(); - nYPos += maWelcomeSize.Height(); // set product string @@ -419,7 +405,11 @@ void BackingWindow::initControls() if( maControlRect.GetWidth() < maProductSize.Width() + mnBtnPos + 10 ) maControlRect.Right() = maControlRect.Left() + maProductSize.Width() + mnBtnPos + 10; - maProduct.Show(); + if( mnLayoutStyle == 1 ) + { + maWelcome.Show(); + maProduct.Show(); + } nYPos += (maProductSize.Height()*3)/2; @@ -427,17 +417,6 @@ void BackingWindow::initControls() maTextFont.SetSize( Size( 0, 11 ) ); maTextFont.SetWeight( WEIGHT_NORMAL ); - if( mnLayoutStyle == 0 ) - { - maCreateText.SetText( maCreateString ); - maCreateText.SetFont( maTextFont ); - maCreateText.SetControlFont( maTextFont ); - maCreateSize = Size( maCreateText.GetTextWidth( maCreateString ), maCreateText.GetTextHeight() ); - maCreateText.Show(); - - nYPos += (maCreateSize.Height()*3)/2; - } - // collect the URLs of the entries in the File/New menu SvtModuleOptions aModuleOptions; std::set< rtl::OUString > aFileNewAppsAvailable; @@ -500,31 +479,13 @@ void BackingWindow::initControls() nYPos += 3*maButtonImageSize.Height() / 2; - if( mnLayoutStyle == 0 ) - { - layoutButtonAndText( NULL, -1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maTemplateButton, maTemplateText, aMnemns, maTemplateString ); - - nYPos += 10; - layoutButtonAndText( NULL, -1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maOpenButton, maOpenText, aMnemns, maOpenString ); - nYPos += 10; - - // change taborder to reflect changed positions - maOpenButton.SetZOrder( &maDrawButton, WINDOW_ZORDER_BEFOR ); - } - else - { - layoutButtonAndText( NULL, 0, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maOpenButton, maOpenText, aMnemns, maOpenString ); - layoutButtonAndText( NULL, 1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maTemplateButton, maTemplateText, aMnemns, maTemplateString ); - nYPos += 10; - } + layoutButtonAndText( NULL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maOpenButton, maOpenText, aMnemns, maOpenString ); + layoutButtonAndText( NULL, 1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maTemplateButton, maTemplateText, aMnemns, maTemplateString ); + nYPos += 10; DBG_ASSERT( nYPos < maControlRect.GetHeight(), "misformatting !" ); if( mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20 > maControlRect.GetWidth() ) @@ -533,30 +494,22 @@ void BackingWindow::initControls() mnTextColumnWidth[0] = mnColumnWidth[0]; mnTextColumnWidth[1] = mnColumnWidth[1]; - if( mnLayoutStyle == 1 ) + if( mnTextColumnWidth[1] > mnTextColumnWidth[0] ) { - if( mnTextColumnWidth[1] > mnTextColumnWidth[0] ) - { - mnColumnWidth[0] = mnColumnWidth[1]; - mnTextColumnWidth[0] = mnTextColumnWidth[1]; - } - else - { - mnColumnWidth[1] = mnColumnWidth[0]; - mnTextColumnWidth[1] = mnTextColumnWidth[0]; - } - if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 ) - { - maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2; - long nDelta = (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20); - mnColumnWidth[0] += nDelta/2; - mnColumnWidth[1] += nDelta/2; - } + mnColumnWidth[0] = mnColumnWidth[1]; + mnTextColumnWidth[0] = mnTextColumnWidth[1]; } else { - mnColumnWidth[0] += 30; - mnColumnWidth[1] += 30; + mnColumnWidth[1] = mnColumnWidth[0]; + mnTextColumnWidth[1] = mnTextColumnWidth[0]; + } + if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 ) + { + maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2; + long nDelta = (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20); + mnColumnWidth[0] += nDelta/2; + mnColumnWidth[1] += nDelta/2; } maToolbox.SetSelectHdl( LINK( this, BackingWindow, ToolboxHdl ) ); @@ -705,8 +658,10 @@ void BackingWindow::Resize() maToolbox.calcMinSize(); Size aTBSize( maToolbox.getMinSize() ); - Point aTBPos( maControlRect.Right() - aTBSize.Width() - 10, + Point aTBPos( maControlRect.Left() + mnBtnPos, maControlRect.Bottom() - aTBSize.Height() - 10 ); + if( Application::GetSettings().GetLayoutRTL() ) + aTBPos.X() = maControlRect.Right() - aTBSize.Width() - mnBtnPos; maToolbox.SetPosSizePixel( aTBPos, aTBSize ); // #i93631# squeeze controls so they fit into the box @@ -715,7 +670,6 @@ void BackingWindow::Resize() const long nWDelta = maWelcomeSize.Height(); const long nW2Delta = (maWelcomeSize.Height()*3)/2; const long nPDelta = (maProductSize.Height()*3)/2; - const long nCDelta = (maCreateSize.Height()*3)/2; const long nBDelta = maButtonImageSize.Height() + 10; const long nB2Delta = 3*maButtonImageSize.Height()/2; const long nLastDelta = maButtonImageSize.Height(); @@ -724,7 +678,6 @@ void BackingWindow::Resize() (nWDelta - nDiff) + (nW2Delta- nDiff) + (nPDelta - nDiff) + - (nCDelta - nDiff) + 3 * (nBDelta - nDiff) + (nB2Delta- nDiff) + nLastDelta @@ -741,13 +694,7 @@ void BackingWindow::Resize() maProduct.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( maControlRect.GetWidth() - mnBtnPos - 5, (maProductSize.Height()*20)/19 ) ); nYPos += nPDelta - nDiff; - maCreateText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), - Size( maControlRect.GetWidth() - mnBtnPos - 5, maCreateSize.Height() ) ); - - if( mnLayoutStyle == 0 ) - nYPos += nCDelta - nDiff; - else - nYPos += nWDelta/2 - nDiff; + nYPos += nWDelta/2 - nDiff; maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); @@ -759,18 +706,8 @@ void BackingWindow::Resize() maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nB2Delta - nDiff; - if( mnLayoutStyle == 0 ) - { - maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); - nYPos += nBDelta - nDiff; - maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); - nYPos += nBDelta - nDiff; - } - else - { - maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); - maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); - } + maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); + maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); } IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index 270f9d6dbc..fa993fac34 100644 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx @@ -86,14 +86,14 @@ namespace framework Size maWelcomeSize; FixedText maProduct; Size maProductSize; - FixedText maCreateText; - Size maCreateSize; FixedText maWriterText; ImageButton maWriterButton; FixedText maCalcText; ImageButton maCalcButton; FixedText maImpressText; ImageButton maImpressButton; + FixedText maOpenText; + ImageButton maOpenButton; FixedText maDrawText; ImageButton maDrawButton; FixedText maDBText; @@ -102,8 +102,6 @@ namespace framework ImageButton maMathButton; FixedText maTemplateText; ImageButton maTemplateButton; - FixedText maOpenText; - ImageButton maOpenButton; DecoToolBox maToolbox; diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src index 3a8793e768..7329b381c1 100644 --- a/framework/source/services/fwk_services.src +++ b/framework/source/services/fwk_services.src @@ -77,46 +77,22 @@ Window DLG_BACKING { File = "odf_32.png"; }; - Bitmap BMP_BACKING_OPENFILE - { - File = "open_32.png"; - }; - Bitmap BMP_BACKING_OPENTEMPLATE - { - File = "template_32.png"; - }; Bitmap BMP_BACKING_FOLDER { File = "folder_32.png"; }; - Bitmap BMP_BACKING_EXT - { - File = "extension_plus_26.png"; - }; String STR_BACKING_EXTHELP { Text [ en-US ] = "Add new features to %PRODUCTNAME"; }; - Bitmap BMP_BACKING_REG - { - File = "register_32.png"; - }; String STR_BACKING_REGHELP { Text [ en-US ] = "Register your %PRODUCTNAME"; }; - Bitmap BMP_BACKING_INFO - { - File = "info_26.png"; - }; String STR_BACKING_INFOHELP { Text [ en-US ] = "Get more information about %PRODUCTNAME"; }; - Bitmap BMP_BACKING_TPLREP - { - File = "addtemplate_32.png"; - }; String STR_BACKING_TPLREP { Text [ en-US ] = "Get more templates for %PRODUCTNAME"; @@ -145,6 +121,22 @@ Resource RES_BACKING_IMAGES { File = "backing_rtl_right.png"; }; + Bitmap BMP_BACKING_EXT + { + File = "extension.png"; + }; + Bitmap BMP_BACKING_REG + { + File = "register_32.png"; + }; + Bitmap BMP_BACKING_INFO + { + File = "info_26.png"; + }; + Bitmap BMP_BACKING_TPLREP + { + File = "addtemplate_32.png"; + }; }; Resource RES_BACKING_IMAGES_HC @@ -169,6 +161,22 @@ Resource RES_BACKING_IMAGES_HC { File = "backing_rtl_right_hc.png"; }; + Bitmap BMP_BACKING_EXT + { + File = "extension_hc.png"; + }; + Bitmap BMP_BACKING_REG + { + File = "register_hc.png"; + }; + Bitmap BMP_BACKING_INFO + { + File = "info_hc.png"; + }; + Bitmap BMP_BACKING_TPLREP + { + File = "template_hc.png"; + }; }; Window WIN_TABWINDOW -- cgit v1.2.3 From 7d9e49ae2bfa0d309ec4caed947115746f13f3e7 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 15 Mar 2010 15:06:28 +0100 Subject: native0: #161779# New icons for the quickstart application --- sysui/desktop/icons/makefile.mk | 2 +- sysui/desktop/icons/so7-base-doc.ico | Bin sysui/desktop/icons/so7-calc-doc.ico | Bin sysui/desktop/icons/so7-calc-tem.ico | Bin sysui/desktop/icons/so7-chart-doc.ico | Bin sysui/desktop/icons/so7-draw-doc.ico | Bin sysui/desktop/icons/so7-draw-tem.ico | Bin sysui/desktop/icons/so7-impress-doc.ico | Bin sysui/desktop/icons/so7-impress-tem.ico | Bin sysui/desktop/icons/so7-master-doc.ico | Bin sysui/desktop/icons/so7-math-doc.ico | Bin sysui/desktop/icons/so7-writer-doc.ico | Bin sysui/desktop/icons/so7-writer-tem.ico | Bin sysui/desktop/icons/so8-base-app.ico | Bin sysui/desktop/icons/so8-base-doc.ico | Bin sysui/desktop/icons/so8-calc-app.ico | Bin sysui/desktop/icons/so8-calc-doc.ico | Bin sysui/desktop/icons/so8-calc-tem.ico | Bin sysui/desktop/icons/so8-chart-doc.ico | Bin sysui/desktop/icons/so8-configuration.ico | Bin sysui/desktop/icons/so8-draw-app.ico | Bin sysui/desktop/icons/so8-draw-doc.ico | Bin sysui/desktop/icons/so8-draw-tem.ico | Bin sysui/desktop/icons/so8-empty-doc.ico | Bin sysui/desktop/icons/so8-empty-tem.ico | Bin sysui/desktop/icons/so8-image-doc.ico | Bin sysui/desktop/icons/so8-impress-app.ico | Bin sysui/desktop/icons/so8-impress-doc.ico | Bin sysui/desktop/icons/so8-impress-tem.ico | Bin sysui/desktop/icons/so8-macro-doc.ico | Bin sysui/desktop/icons/so8-main-app.ico | Bin sysui/desktop/icons/so8-master-doc.ico | Bin sysui/desktop/icons/so8-math-app.ico | Bin sysui/desktop/icons/so8-math-doc.ico | Bin sysui/desktop/icons/so8-open.ico | Bin sysui/desktop/icons/so8-printer.ico | Bin sysui/desktop/icons/so8-web-doc.ico | Bin sysui/desktop/icons/so8-writer-app.ico | Bin sysui/desktop/icons/so8-writer-doc.ico | Bin sysui/desktop/icons/so8-writer-tem.ico | Bin sysui/desktop/icons/so9_base_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/so9_base_doc.ico | Bin sysui/desktop/icons/so9_calc_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/so9_calc_doc.ico | Bin sysui/desktop/icons/so9_calc_tem.ico | Bin sysui/desktop/icons/so9_chart_doc.ico | Bin sysui/desktop/icons/so9_draw_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/so9_draw_doc.ico | Bin sysui/desktop/icons/so9_draw_tem.ico | Bin sysui/desktop/icons/so9_empty_doc.ico | Bin sysui/desktop/icons/so9_empty_tem.ico | Bin sysui/desktop/icons/so9_global_doc.ico | Bin sysui/desktop/icons/so9_html_doc.ico | Bin sysui/desktop/icons/so9_impress_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/so9_impress_doc.ico | Bin sysui/desktop/icons/so9_impress_tem.ico | Bin sysui/desktop/icons/so9_macro_doc.ico | Bin sysui/desktop/icons/so9_main_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/so9_math_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/so9_math_doc.ico | Bin sysui/desktop/icons/so9_writer_app.ico | Bin 295606 -> 295606 bytes sysui/desktop/icons/so9_writer_doc.ico | Bin sysui/desktop/icons/so9_writer_tem.ico | Bin sysui/source/win32/QuickStart/so/QuickStart.rc | 10 +++++----- 64 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 sysui/desktop/icons/so7-base-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-calc-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-calc-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so7-chart-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-draw-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-draw-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so7-impress-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-impress-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so7-master-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-math-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-writer-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so7-writer-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so8-base-app.ico mode change 100644 => 100755 sysui/desktop/icons/so8-base-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-calc-app.ico mode change 100644 => 100755 sysui/desktop/icons/so8-calc-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-calc-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so8-chart-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-configuration.ico mode change 100644 => 100755 sysui/desktop/icons/so8-draw-app.ico mode change 100644 => 100755 sysui/desktop/icons/so8-draw-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-draw-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so8-empty-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-empty-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so8-image-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-impress-app.ico mode change 100644 => 100755 sysui/desktop/icons/so8-impress-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-impress-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so8-macro-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-main-app.ico mode change 100644 => 100755 sysui/desktop/icons/so8-master-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-math-app.ico mode change 100644 => 100755 sysui/desktop/icons/so8-math-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-open.ico mode change 100644 => 100755 sysui/desktop/icons/so8-printer.ico mode change 100644 => 100755 sysui/desktop/icons/so8-web-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-writer-app.ico mode change 100644 => 100755 sysui/desktop/icons/so8-writer-doc.ico mode change 100644 => 100755 sysui/desktop/icons/so8-writer-tem.ico mode change 100644 => 100755 sysui/desktop/icons/so9_base_app.ico mode change 100644 => 100755 sysui/desktop/icons/so9_base_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_calc_app.ico mode change 100644 => 100755 sysui/desktop/icons/so9_calc_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_calc_tem.ico mode change 100644 => 100755 sysui/desktop/icons/so9_chart_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_draw_app.ico mode change 100644 => 100755 sysui/desktop/icons/so9_draw_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_draw_tem.ico mode change 100644 => 100755 sysui/desktop/icons/so9_empty_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_empty_tem.ico mode change 100644 => 100755 sysui/desktop/icons/so9_global_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_html_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_impress_app.ico mode change 100644 => 100755 sysui/desktop/icons/so9_impress_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_impress_tem.ico mode change 100644 => 100755 sysui/desktop/icons/so9_macro_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_main_app.ico mode change 100644 => 100755 sysui/desktop/icons/so9_math_app.ico mode change 100644 => 100755 sysui/desktop/icons/so9_math_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_writer_app.ico mode change 100644 => 100755 sysui/desktop/icons/so9_writer_doc.ico mode change 100644 => 100755 sysui/desktop/icons/so9_writer_tem.ico diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk index 1af3f4367f..a533c24899 100644 --- a/sysui/desktop/icons/makefile.mk +++ b/sysui/desktop/icons/makefile.mk @@ -188,7 +188,7 @@ all: \ $(MISC)$/so7-math-doc.ico \ $(MISC)$/so7-writer-doc.ico \ $(MISC)$/so7-writer-tem.ico \ - $(MISC)$/oxt-extension.ico + $(MISC)$/oxt-extension.ico $(MISC)$/%.ico: %.ico $(COPY) $< $@ diff --git a/sysui/desktop/icons/so7-base-doc.ico b/sysui/desktop/icons/so7-base-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-calc-doc.ico b/sysui/desktop/icons/so7-calc-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-calc-tem.ico b/sysui/desktop/icons/so7-calc-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-chart-doc.ico b/sysui/desktop/icons/so7-chart-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-draw-doc.ico b/sysui/desktop/icons/so7-draw-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-draw-tem.ico b/sysui/desktop/icons/so7-draw-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-impress-doc.ico b/sysui/desktop/icons/so7-impress-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-impress-tem.ico b/sysui/desktop/icons/so7-impress-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-master-doc.ico b/sysui/desktop/icons/so7-master-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-math-doc.ico b/sysui/desktop/icons/so7-math-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-writer-doc.ico b/sysui/desktop/icons/so7-writer-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so7-writer-tem.ico b/sysui/desktop/icons/so7-writer-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-base-app.ico b/sysui/desktop/icons/so8-base-app.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-base-doc.ico b/sysui/desktop/icons/so8-base-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-calc-app.ico b/sysui/desktop/icons/so8-calc-app.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-calc-doc.ico b/sysui/desktop/icons/so8-calc-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-calc-tem.ico b/sysui/desktop/icons/so8-calc-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-chart-doc.ico b/sysui/desktop/icons/so8-chart-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-configuration.ico b/sysui/desktop/icons/so8-configuration.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-draw-app.ico b/sysui/desktop/icons/so8-draw-app.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-draw-doc.ico b/sysui/desktop/icons/so8-draw-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-draw-tem.ico b/sysui/desktop/icons/so8-draw-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-empty-doc.ico b/sysui/desktop/icons/so8-empty-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-empty-tem.ico b/sysui/desktop/icons/so8-empty-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-image-doc.ico b/sysui/desktop/icons/so8-image-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-impress-app.ico b/sysui/desktop/icons/so8-impress-app.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-impress-doc.ico b/sysui/desktop/icons/so8-impress-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-impress-tem.ico b/sysui/desktop/icons/so8-impress-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-macro-doc.ico b/sysui/desktop/icons/so8-macro-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-main-app.ico b/sysui/desktop/icons/so8-main-app.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-master-doc.ico b/sysui/desktop/icons/so8-master-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-math-app.ico b/sysui/desktop/icons/so8-math-app.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-math-doc.ico b/sysui/desktop/icons/so8-math-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-open.ico b/sysui/desktop/icons/so8-open.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-printer.ico b/sysui/desktop/icons/so8-printer.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-web-doc.ico b/sysui/desktop/icons/so8-web-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-writer-app.ico b/sysui/desktop/icons/so8-writer-app.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-writer-doc.ico b/sysui/desktop/icons/so8-writer-doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so8-writer-tem.ico b/sysui/desktop/icons/so8-writer-tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_base_app.ico b/sysui/desktop/icons/so9_base_app.ico old mode 100644 new mode 100755 index 56a323c07e..aa7036eb90 Binary files a/sysui/desktop/icons/so9_base_app.ico and b/sysui/desktop/icons/so9_base_app.ico differ diff --git a/sysui/desktop/icons/so9_base_doc.ico b/sysui/desktop/icons/so9_base_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_calc_app.ico b/sysui/desktop/icons/so9_calc_app.ico old mode 100644 new mode 100755 index 81e6948d39..d7182cad09 Binary files a/sysui/desktop/icons/so9_calc_app.ico and b/sysui/desktop/icons/so9_calc_app.ico differ diff --git a/sysui/desktop/icons/so9_calc_doc.ico b/sysui/desktop/icons/so9_calc_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_calc_tem.ico b/sysui/desktop/icons/so9_calc_tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_chart_doc.ico b/sysui/desktop/icons/so9_chart_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_draw_app.ico b/sysui/desktop/icons/so9_draw_app.ico old mode 100644 new mode 100755 index a2c108ad6f..a8b3c3270f Binary files a/sysui/desktop/icons/so9_draw_app.ico and b/sysui/desktop/icons/so9_draw_app.ico differ diff --git a/sysui/desktop/icons/so9_draw_doc.ico b/sysui/desktop/icons/so9_draw_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_draw_tem.ico b/sysui/desktop/icons/so9_draw_tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_empty_doc.ico b/sysui/desktop/icons/so9_empty_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_empty_tem.ico b/sysui/desktop/icons/so9_empty_tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_global_doc.ico b/sysui/desktop/icons/so9_global_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_html_doc.ico b/sysui/desktop/icons/so9_html_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_impress_app.ico b/sysui/desktop/icons/so9_impress_app.ico old mode 100644 new mode 100755 index 0fe4cea9f2..cf10331c5f Binary files a/sysui/desktop/icons/so9_impress_app.ico and b/sysui/desktop/icons/so9_impress_app.ico differ diff --git a/sysui/desktop/icons/so9_impress_doc.ico b/sysui/desktop/icons/so9_impress_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_impress_tem.ico b/sysui/desktop/icons/so9_impress_tem.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_macro_doc.ico b/sysui/desktop/icons/so9_macro_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_main_app.ico b/sysui/desktop/icons/so9_main_app.ico old mode 100644 new mode 100755 index 197b924d33..90f193d80d Binary files a/sysui/desktop/icons/so9_main_app.ico and b/sysui/desktop/icons/so9_main_app.ico differ diff --git a/sysui/desktop/icons/so9_math_app.ico b/sysui/desktop/icons/so9_math_app.ico old mode 100644 new mode 100755 index 4d947c2e59..11fbbf9a49 Binary files a/sysui/desktop/icons/so9_math_app.ico and b/sysui/desktop/icons/so9_math_app.ico differ diff --git a/sysui/desktop/icons/so9_math_doc.ico b/sysui/desktop/icons/so9_math_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_writer_app.ico b/sysui/desktop/icons/so9_writer_app.ico old mode 100644 new mode 100755 index 2df20830d9..10c964dba9 Binary files a/sysui/desktop/icons/so9_writer_app.ico and b/sysui/desktop/icons/so9_writer_app.ico differ diff --git a/sysui/desktop/icons/so9_writer_doc.ico b/sysui/desktop/icons/so9_writer_doc.ico old mode 100644 new mode 100755 diff --git a/sysui/desktop/icons/so9_writer_tem.ico b/sysui/desktop/icons/so9_writer_tem.ico old mode 100644 new mode 100755 diff --git a/sysui/source/win32/QuickStart/so/QuickStart.rc b/sysui/source/win32/QuickStart/so/QuickStart.rc index 48da2388b1..c48dc2358d 100644 --- a/sysui/source/win32/QuickStart/so/QuickStart.rc +++ b/sysui/source/win32/QuickStart/so/QuickStart.rc @@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -ICON_ACTIVE ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico" -IDI_QUICKSTART ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico" -IDI_SMALL ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico" -ICON_INACTIVE ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico" +ICON_ACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" +IDI_QUICKSTART ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" +IDI_SMALL ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" +ICON_INACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" ///////////////////////////////////////////////////////////////////////////// @@ -105,7 +105,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "SoQuickStart" IDC_QUICKSTART "QUICKSTART" - IDS_TOOLTIP "StarOffice 6.0 QuickStart" + IDS_TOOLTIP "Oracle Open Office 3.2 QuickStart" END STRINGTABLE DISCARDABLE -- cgit v1.2.3 From 38db14177294904bf696945e673b3b265d65e3b8 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 15 Mar 2010 15:37:26 +0100 Subject: native0: #161779# New icons for the quickstart application - don't copy custom icons --- sysui/desktop/icons/makefile.mk | 62 ----------------------------------------- 1 file changed, 62 deletions(-) diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk index a533c24899..c963dfbcbc 100644 --- a/sysui/desktop/icons/makefile.mk +++ b/sysui/desktop/icons/makefile.mk @@ -126,68 +126,6 @@ all: \ $(MISC)$/ooo11-math-doc.ico \ $(MISC)$/ooo11-writer-doc.ico \ $(MISC)$/ooo11-writer-tem.ico \ - $(MISC)$/so8-base-app.ico \ - $(MISC)$/so8-base-doc.ico \ - $(MISC)$/so8-calc-app.ico \ - $(MISC)$/so8-calc-doc.ico \ - $(MISC)$/so8-calc-tem.ico \ - $(MISC)$/so8-chart-doc.ico \ - $(MISC)$/so8-configuration.ico \ - $(MISC)$/so8-draw-app.ico \ - $(MISC)$/so8-draw-doc.ico \ - $(MISC)$/so8-draw-tem.ico \ - $(MISC)$/so8-empty-doc.ico \ - $(MISC)$/so8-empty-tem.ico \ - $(MISC)$/so8-image-doc.ico \ - $(MISC)$/so8-impress-app.ico \ - $(MISC)$/so8-impress-doc.ico \ - $(MISC)$/so8-impress-tem.ico \ - $(MISC)$/so8-macro-doc.ico \ - $(MISC)$/so8-main-app.ico \ - $(MISC)$/so8-master-doc.ico \ - $(MISC)$/so8-math-app.ico \ - $(MISC)$/so8-math-doc.ico \ - $(MISC)$/so8-open.ico \ - $(MISC)$/so8-printer.ico \ - $(MISC)$/so8-web-doc.ico \ - $(MISC)$/so8-writer-app.ico \ - $(MISC)$/so8-writer-doc.ico \ - $(MISC)$/so8-writer-tem.ico \ - $(MISC)$/so9_empty_tem.ico \ - $(MISC)$/so9_math_app.ico \ - $(MISC)$/so9_global_doc.ico \ - $(MISC)$/so9_main_app.ico \ - $(MISC)$/so9_empty_doc.ico \ - $(MISC)$/so9_math_doc.ico \ - $(MISC)$/so9_base_app.ico \ - $(MISC)$/so9_html_doc.ico \ - $(MISC)$/so9_impress_doc.ico \ - $(MISC)$/so9_draw_tem.ico \ - $(MISC)$/so9_writer_tem.ico \ - $(MISC)$/so9_impress_app.ico \ - $(MISC)$/so9_calc_tem.ico \ - $(MISC)$/so9_base_doc.ico \ - $(MISC)$/so9_macro_doc.ico \ - $(MISC)$/so9_calc_doc.ico \ - $(MISC)$/so9_draw_doc.ico \ - $(MISC)$/so9_writer_doc.ico \ - $(MISC)$/so9_calc_app.ico \ - $(MISC)$/so9_impress_tem.ico \ - $(MISC)$/so9_chart_doc.ico \ - $(MISC)$/so9_writer_app.ico \ - $(MISC)$/so9_draw_app.ico \ - $(MISC)$/so7-base-doc.ico \ - $(MISC)$/so7-calc-doc.ico \ - $(MISC)$/so7-calc-tem.ico \ - $(MISC)$/so7-chart-doc.ico \ - $(MISC)$/so7-draw-doc.ico \ - $(MISC)$/so7-draw-tem.ico \ - $(MISC)$/so7-impress-doc.ico \ - $(MISC)$/so7-impress-tem.ico \ - $(MISC)$/so7-master-doc.ico \ - $(MISC)$/so7-math-doc.ico \ - $(MISC)$/so7-writer-doc.ico \ - $(MISC)$/so7-writer-tem.ico \ $(MISC)$/oxt-extension.ico $(MISC)$/%.ico: %.ico -- cgit v1.2.3 From 181f4e49782c9731046ed9481bd941819a5f2a94 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 16 Mar 2010 13:34:38 +0100 Subject: native0: #161700# New chart icons and custom images must be delivered --- sysui/desktop/icons/makefile.mk | 64 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk index c963dfbcbc..1af3f4367f 100644 --- a/sysui/desktop/icons/makefile.mk +++ b/sysui/desktop/icons/makefile.mk @@ -126,7 +126,69 @@ all: \ $(MISC)$/ooo11-math-doc.ico \ $(MISC)$/ooo11-writer-doc.ico \ $(MISC)$/ooo11-writer-tem.ico \ - $(MISC)$/oxt-extension.ico + $(MISC)$/so8-base-app.ico \ + $(MISC)$/so8-base-doc.ico \ + $(MISC)$/so8-calc-app.ico \ + $(MISC)$/so8-calc-doc.ico \ + $(MISC)$/so8-calc-tem.ico \ + $(MISC)$/so8-chart-doc.ico \ + $(MISC)$/so8-configuration.ico \ + $(MISC)$/so8-draw-app.ico \ + $(MISC)$/so8-draw-doc.ico \ + $(MISC)$/so8-draw-tem.ico \ + $(MISC)$/so8-empty-doc.ico \ + $(MISC)$/so8-empty-tem.ico \ + $(MISC)$/so8-image-doc.ico \ + $(MISC)$/so8-impress-app.ico \ + $(MISC)$/so8-impress-doc.ico \ + $(MISC)$/so8-impress-tem.ico \ + $(MISC)$/so8-macro-doc.ico \ + $(MISC)$/so8-main-app.ico \ + $(MISC)$/so8-master-doc.ico \ + $(MISC)$/so8-math-app.ico \ + $(MISC)$/so8-math-doc.ico \ + $(MISC)$/so8-open.ico \ + $(MISC)$/so8-printer.ico \ + $(MISC)$/so8-web-doc.ico \ + $(MISC)$/so8-writer-app.ico \ + $(MISC)$/so8-writer-doc.ico \ + $(MISC)$/so8-writer-tem.ico \ + $(MISC)$/so9_empty_tem.ico \ + $(MISC)$/so9_math_app.ico \ + $(MISC)$/so9_global_doc.ico \ + $(MISC)$/so9_main_app.ico \ + $(MISC)$/so9_empty_doc.ico \ + $(MISC)$/so9_math_doc.ico \ + $(MISC)$/so9_base_app.ico \ + $(MISC)$/so9_html_doc.ico \ + $(MISC)$/so9_impress_doc.ico \ + $(MISC)$/so9_draw_tem.ico \ + $(MISC)$/so9_writer_tem.ico \ + $(MISC)$/so9_impress_app.ico \ + $(MISC)$/so9_calc_tem.ico \ + $(MISC)$/so9_base_doc.ico \ + $(MISC)$/so9_macro_doc.ico \ + $(MISC)$/so9_calc_doc.ico \ + $(MISC)$/so9_draw_doc.ico \ + $(MISC)$/so9_writer_doc.ico \ + $(MISC)$/so9_calc_app.ico \ + $(MISC)$/so9_impress_tem.ico \ + $(MISC)$/so9_chart_doc.ico \ + $(MISC)$/so9_writer_app.ico \ + $(MISC)$/so9_draw_app.ico \ + $(MISC)$/so7-base-doc.ico \ + $(MISC)$/so7-calc-doc.ico \ + $(MISC)$/so7-calc-tem.ico \ + $(MISC)$/so7-chart-doc.ico \ + $(MISC)$/so7-draw-doc.ico \ + $(MISC)$/so7-draw-tem.ico \ + $(MISC)$/so7-impress-doc.ico \ + $(MISC)$/so7-impress-tem.ico \ + $(MISC)$/so7-master-doc.ico \ + $(MISC)$/so7-math-doc.ico \ + $(MISC)$/so7-writer-doc.ico \ + $(MISC)$/so7-writer-tem.ico \ + $(MISC)$/oxt-extension.ico $(MISC)$/%.ico: %.ico $(COPY) $< $@ -- cgit v1.2.3 From 32f30ecf67a073c19f0397514a9f0cce85deb544 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 17 Mar 2010 10:37:00 +0100 Subject: native0: #161756# New images for dev, dev_nologo and nologo splash screen --- desktop/zipintro/makefile.mk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/desktop/zipintro/makefile.mk b/desktop/zipintro/makefile.mk index a382d51e79..361c46f217 100644 --- a/desktop/zipintro/makefile.mk +++ b/desktop/zipintro/makefile.mk @@ -36,13 +36,13 @@ TARGET=zipintro DEFAULT_FLAVOURS=dev dev_nologo nologo broffice dev_broffice nologo_broffice nologo_dev_broffice intro ZIP1LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev$/introabout$/intro.png $(INTRO_BITMAPS)) \ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP2LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo$/introabout$/intro.png $(INTRO_BITMAPS)) \ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP3LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo$/introabout$/intro.png $(INTRO_BITMAPS)) \ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP4LIST= \ $(null,$(INTRO_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/intro.png $(INTRO_BITMAPS)) \ @@ -54,11 +54,11 @@ ZIP6LIST= \ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) ZIP7LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ + $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) ZIP8LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ + $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) ZIP1TARGET=dev_intro ZIP1DEPS=$(ZIP1LIST) -- cgit v1.2.3 From 45f5243e8a2d154ffbd125c650d2645a9076360c Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 17 Mar 2010 11:17:09 +0000 Subject: #i109366# add SAL_DLLPUBLIC_EXPORT --- connectivity/source/drivers/macab/MacabServices.cxx | 6 +++--- connectivity/source/drivers/macab/makefile.mk | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx index 84bba28bb9..6fc29f4736 100755 --- a/connectivity/source/drivers/macab/MacabServices.cxx +++ b/connectivity/source/drivers/macab/MacabServices.cxx @@ -114,7 +114,7 @@ struct ProviderRequest //--------------------------------------------------------------------------------------- -extern "C" void SAL_CALL component_getImplementationEnvironment( +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, uno_Environment ** ) @@ -123,7 +123,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( } //--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) @@ -148,7 +148,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( } //--------------------------------------------------------------------------------------- -extern "C" void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void*) diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 811f1fabb1..68a832a3ea 100755 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -70,6 +70,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) +DEF1EXPORTFILE= exports.dxp # === MACAB impl library ========================== -- cgit v1.2.3 From fb3fe8e1837ba45f85b20465b7183e45149fb8ef Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 17 Mar 2010 12:19:26 +0000 Subject: removed export.dxp --- connectivity/source/drivers/macab/makefile.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 68a832a3ea..811f1fabb1 100755 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -70,7 +70,6 @@ SHL1IMPLIB= i$(TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) -DEF1EXPORTFILE= exports.dxp # === MACAB impl library ========================== -- cgit v1.2.3 From 425f99c33606dd9522f11838dd3c203f62a75a01 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 17 Mar 2010 12:53:49 +0000 Subject: add SAL_DLLPUBLIC_EXPORT --- connectivity/source/drivers/macab/MacabConnection.cxx | 3 ++- connectivity/source/drivers/macab/makefile.mk | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx index 0762879506..c9155adba2 100755 --- a/connectivity/source/drivers/macab/MacabConnection.cxx +++ b/connectivity/source/drivers/macab/MacabConnection.cxx @@ -314,10 +314,11 @@ MacabAddressBook* MacabConnection::getAddressBook() const return m_pAddressBook; } // ----------------------------------------------------------------------------- -extern "C" void* SAL_CALL createMacabConnection( void* _pDriver ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL createMacabConnection( void* _pDriver ) { MacabConnection* pConnection = new MacabConnection( static_cast< MacabDriver* >( _pDriver ) ); // by definition, the pointer crossing library boundaries as void ptr is acquired once pConnection->acquire(); return pConnection; } + diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 811f1fabb1..35532b15ec 100755 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -54,8 +54,6 @@ DEPOBJFILES= \ # --- Library ----------------------------------- -SHL1VERSIONMAP=$(TARGET).map - SHL1TARGET= $(TARGET)$(MACAB_MAJOR) SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ @@ -98,8 +96,6 @@ MACAB_LIB=-framework Carbon -framework AddressBook # --- Library ----------------------------------- -SHL2VERSIONMAP=$(TARGET2).map - SHL2TARGET= $(TARGET2)$(MACAB_MAJOR) SHL2OBJS=$(SLO2FILES) SHL2STDLIBS=\ -- cgit v1.2.3 From 9a072b33f4f5d19833afc6ad826b6506a65542ac Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 17 Mar 2010 12:54:06 +0000 Subject: add SAL_DLLPUBLIC_EXPORT --- connectivity/source/drivers/macab/macab.map | 8 -------- connectivity/source/drivers/macab/macabdrv.map | 6 ------ 2 files changed, 14 deletions(-) delete mode 100755 connectivity/source/drivers/macab/macab.map delete mode 100755 connectivity/source/drivers/macab/macabdrv.map diff --git a/connectivity/source/drivers/macab/macab.map b/connectivity/source/drivers/macab/macab.map deleted file mode 100755 index fe2d1ac905..0000000000 --- a/connectivity/source/drivers/macab/macab.map +++ /dev/null @@ -1,8 +0,0 @@ -MACAB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/macab/macabdrv.map b/connectivity/source/drivers/macab/macabdrv.map deleted file mode 100755 index d953690f6b..0000000000 --- a/connectivity/source/drivers/macab/macabdrv.map +++ /dev/null @@ -1,6 +0,0 @@ -MACAB_1_0 { - global: - createMacabConnection; - local: - *; -}; -- cgit v1.2.3 From 2c7a5d8a722d718df486e2958bcbee39da405ad2 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 17 Mar 2010 16:32:34 +0100 Subject: native0: #161722# Adapt about box to handle long legal text --- sfx2/inc/about.hxx | 10 +++----- sfx2/inc/sfx2/sfx.hrc | 1 + sfx2/source/dialog/about.cxx | 59 ++++++++++++++++++++------------------------ svx/source/intro/iso.src | 16 ++++++++---- svx/source/intro/ooo.src | 16 ++++++++---- 5 files changed, 53 insertions(+), 49 deletions(-) diff --git a/sfx2/inc/about.hxx b/sfx2/inc/about.hxx index a7c76d09f1..7a4d1c5f31 100644 --- a/sfx2/inc/about.hxx +++ b/sfx2/inc/about.hxx @@ -29,15 +29,10 @@ // include --------------------------------------------------------------- -#ifndef _RESARY_HXX //autogen #include -#endif -#ifndef _BUTTON_HXX //autogen #include -#endif -#ifndef _ACCEL_HXX //autogen #include -#endif +#include #include #include #include // SfxModalDialog @@ -53,13 +48,14 @@ private: Image aAppLogo; FixedInfo aVersionText; - FixedInfo aCopyrightText; + MultiLineEdit aCopyrightText; FixedInfo aBuildData; ResStringArray aDeveloperAry; String aDevVersionStr; String aAccelStr; String aVersionData; + String aCopyrightTextStr; AccelList aAccelList; diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index 573b6944e1..b0d91faf9e 100644 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -216,6 +216,7 @@ #define ABOUT_STR_DEVELOPER_ARY 1 #define ABOUT_STR_FRENCH_COPYRIGHT 2 #define ABOUT_STR_ACCEL 3 +#define ABOUT_STR_COPYRIGHT 4 #define RID_APPTITLE (RID_SFX_START+4) #define RID_BUILDVERSION (RID_SFX_START+5) diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx index f0b5ec1b7f..0822d50f8b 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -120,6 +120,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ), aDevVersionStr ( rVerStr ), aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ), + aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ), aTimer (), nOff ( 0 ), m_nDeltaWidth ( 0 ), @@ -248,46 +249,40 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS // determine size and position of the dialog & elements Size aAppLogoSiz = aAppLogo.GetSizePixel(); - Size aOutSiz = GetOutputSizePixel(); - aOutSiz.Width() = aAppLogoSiz.Width(); - // spacing to the margin - Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); - long nDlgMargin = a6Size.Width() * 4 ; - // The URL (if found in copyright text) should not be line-wrapped - if ( aCopyrightText.GetText().Search( WELCOME_URL ) != STRING_NOTFOUND ) - { - long nURLWidth = GetTextWidth( WELCOME_URL ) + nDlgMargin + (2*SPACE_OFFSET); - if ( nURLWidth > aAppLogoSiz.Width() ) - { - // pb: can be used to align the position of the logo - // m_nDeltaWidth = nURLWidth - aOutSiz.Width(); - - aOutSiz.Width() = nURLWidth; - } - } + Size aOutSiz = GetOutputSizePixel(); + aOutSiz.Width() = aAppLogoSiz.Width(); - // layout the text-elements - long nTextWidth = aOutSiz.Width() - nDlgMargin; - long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 ); + Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); + long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 ); + long nDlgMargin = a6Size.Width() * 4 ; + long nCtrlMargin = a6Size.Height() * 2; + long nTextWidth = aOutSiz.Width() - nDlgMargin; + aCopyrightText.SetText( aCopyrightTextStr ); + layoutText( aVersionText, nY, nTextWidth, a6Size ); - nY += ( a6Size.Height() / 3 ); - layoutText( aCopyrightText, nY, nTextWidth, a6Size ); - nY += ( a6Size.Height() / 3 ); - if( aBuildString.Len() > 0 ) - { - layoutText( aBuildData, nY, nTextWidth, a6Size ); - nY += ( a6Size.Height() / 2 ); - } - + nY += nCtrlMargin; + // OK-Button-Position (at the bottom and centered) Size aOKSiz = aOKButton.GetSizePixel(); Point aOKPnt = aOKButton.GetPosPixel(); + + // Multiline edit with Copyright-Text + Point aCopyPnt = aCopyrightText.GetPosPixel(); + Size aCopySize = aCopyrightText.GetSizePixel(); + aCopySize.Width() = nTextWidth; + aCopySize.Height() = aOutSiz.Height() - nY - ( aOKSiz.Height() * 2 ) - nCtrlMargin; + + aCopyPnt.X() = ( aOutSiz.Width() - aCopySize.Width() ) / 2; + aCopyPnt.Y() = nY; + aCopyrightText.SetPosSizePixel( aCopyPnt, aCopySize ); + + nY += aCopySize.Height() + nCtrlMargin; aOKPnt.X() = ( aOutSiz.Width() - aOKSiz.Width() ) / 2; - aOKPnt.Y() = nY + 8; + aOKPnt.Y() = nY; aOKButton.SetPosPixel( aOKPnt ); - nY = aOKPnt.Y() + aOKSiz.Height() + a6Size.Height(); - aOutSiz.Height() = nY; + + // Change the width of the dialog SetOutputSizePixel( aOutSiz ); FreeResource(); diff --git a/svx/source/intro/iso.src b/svx/source/intro/iso.src index 00a8ffe342..d1fcbc3420 100644 --- a/svx/source/intro/iso.src +++ b/svx/source/intro/iso.src @@ -59,7 +59,7 @@ String RID_BUILDVERSION ModalDialog RID_DEFAULTABOUT { OutputSize = TRUE ; - Size = MAP_APPFONT ( 245 , 200 ) ; + Size = MAP_APPFONT ( 245 , 260 ) ; Moveable = TRUE ; SVLook = TRUE ; TEXT_DEFAULTABOUT @@ -76,12 +76,18 @@ ModalDialog RID_DEFAULTABOUT WordBreak = TRUE ; Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ; }; - FixedText ABOUT_FTXT_COPYRIGHT + MultiLineEdit ABOUT_FTXT_COPYRIGHT { + Border = TRUE ; Pos = MAP_APPFONT ( 54 , 25 ) ; Size = MAP_APPFONT ( 168 , 51 ) ; - WordBreak = TRUE ; - Text[ en-US ] = "Copyright © 2005-2009 Sun Microsystems, Inc. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. This distribution may include materials developed by third parties. Sun, Sun Microsystems, the Sun logo, Java, Solaris and StarOffice are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.\n\nThis product is based on the OpenOffice.org project." ; + IgnoreTab = TRUE ; + ReadOnly = TRUE ; + AutoVScroll = TRUE ; + }; + String ABOUT_STR_COPYRIGHT + { + Text[ en-US ] = "Copyright © 1995, 2010, Oracle and/or its affiliates. All rights reserved.\n\nThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.\n\nThe information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.\n\nIf this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS\nPrograms, software, databases, and related documentation and technical data delivered to U.S. Government customers are \"commercial computer software\" or \"commercial technical data\" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nThis software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.\n\nOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\n\nThis software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.\n\nThis product is based on the OpenOffice.org project."; }; StringArray ABOUT_STR_DEVELOPER_ARY { @@ -89,7 +95,7 @@ ModalDialog RID_DEFAULTABOUT }; String ABOUT_STR_FRENCH_COPYRIGHT { - Text = "Copyright © 2005-2009 Sun Microsystems, Inc. Tous droits réservés. Sun Microsystems, Inc. détient les droits de propriété intellectuels relatifs á la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plus des brevets américains listés á l'adresse http://www.sun.com/patents et un ou les brevets supplémentaires ou les applications de brevet en attente aux Etats - Unis et dans les autres pays. L'utilisation est soumise aux termes du contrat de licence. Cette distribution peut comprendre des composants développés par des tierces parties. Sun, Sun Microsystems, le logo Sun, Java, Solaris et StarOffice sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. UNIX est une marque déposée aux Etats-Unis et dans d'autres pays et licenciée exlusivement par X/Open Company, Ltd.\n\nCe produit a été créé á partir du projet OpenOffice.org." ; + Text = "Copyright © 1995, 2010, Oracle and/or its affiliates. All rights reserved.\n\nThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.\n\nThe information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.\n\nIf this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS\nPrograms, software, databases, and related documentation and technical data delivered to U.S. Government customers are ""commercial computer software"" or ""commercial technical data"" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nThis software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.\n\nOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\n\nThis software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.\n\nThis product is based on the OpenOffice.org project." ; }; String ABOUT_STR_ACCEL { diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src index 4870a5c4dd..4c17838687 100644 --- a/svx/source/intro/ooo.src +++ b/svx/source/intro/ooo.src @@ -65,7 +65,7 @@ String RID_BUILDVERSION ModalDialog RID_DEFAULTABOUT { OutputSize = TRUE ; - Size = MAP_APPFONT ( 245 , 200 ) ; + Size = MAP_APPFONT ( 245 , 260 ) ; Moveable = TRUE ; SVLook = TRUE ; TEXT_DEFAULTABOUT @@ -81,13 +81,19 @@ ModalDialog RID_DEFAULTABOUT Size = MAP_APPFONT ( 118 , 16 ) ; WordBreak = TRUE ; Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ; - }; - FixedText ABOUT_FTXT_COPYRIGHT + }; + MultiLineEdit ABOUT_FTXT_COPYRIGHT { + Border = TRUE ; Pos = MAP_APPFONT ( 54 , 25 ) ; Size = MAP_APPFONT ( 168 , 51 ) ; - Text[ en-US ] ="Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html."; - WordBreak = TRUE ; + IgnoreTab = TRUE ; + ReadOnly = TRUE ; + AutoVScroll = TRUE ; + }; + String ABOUT_STR_COPYRIGHT + { + Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html."; }; StringArray ABOUT_STR_DEVELOPER_ARY { -- cgit v1.2.3 From 53902c5fd879c03e56dd45eaae0c2ef3c89125a1 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 18 Mar 2010 00:38:32 +0100 Subject: native0ext: rebranding minimizer --- .../registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu | 3 --- 1 file changed, 3 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu index 735fcd0204..af45c79cdf 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu @@ -129,9 +129,6 @@ 0 - - 2 - true -- cgit v1.2.3 From eca77cdaa0b129e166f33a2c5d5f0ee7f3aa5390 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 18 Mar 2010 11:33:46 +0100 Subject: native0: #161779# New app-icon for quickstart.exe --- sysui/source/win32/QuickStart/OOQuickStart.rc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sysui/source/win32/QuickStart/OOQuickStart.rc b/sysui/source/win32/QuickStart/OOQuickStart.rc index ebeed2560d..0dc4dab256 100644 --- a/sysui/source/win32/QuickStart/OOQuickStart.rc +++ b/sysui/source/win32/QuickStart/OOQuickStart.rc @@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -ICON_ACTIVE ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico" -IDI_QUICKSTART ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico" -IDI_SMALL ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico" -ICON_INACTIVE ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico" +ICON_ACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" +IDI_QUICKSTART ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" +IDI_SMALL ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" +ICON_INACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" ///////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 469b778db353b52261838a3d10d66ba7f5bbdfbc Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Tue, 23 Mar 2010 14:10:06 +0000 Subject: #i109366# remove :* from url --- connectivity/source/drivers/macab/macab.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/macab/macab.xcu b/connectivity/source/drivers/macab/macab.xcu index 2418698c3d..cbb9d0b6b0 100755 --- a/connectivity/source/drivers/macab/macab.xcu +++ b/connectivity/source/drivers/macab/macab.xcu @@ -27,7 +27,7 @@ ************************************************************************ --> - + com.sun.star.comp.sdbc.macab.Driver -- cgit v1.2.3 From caba70f2ec22dd8da3fb3091679cd20af4a8ca34 Mon Sep 17 00:00:00 2001 From: tono Date: Wed, 24 Mar 2010 19:26:36 +0900 Subject: i#110194: Mingw port update fix: use alloca instead of _alloca in shell --- shell/source/backends/wininetbe/wininetbackend.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index 04de8fdd7d..c62ff6ffe1 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -37,6 +37,7 @@ #endif #include #include +#include #if defined _MSC_VER #pragma warning(pop) #endif @@ -138,11 +139,11 @@ WinInetBackend::WinInetBackend() // in a stack overflow exception, we assume // this never happens, because of the relatively // small amount of memory we need - // _alloca is nice because it is fast and we don't + // alloca is nice because it is fast and we don't // have to free the allocated memory, it will be // automatically done lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >( - _alloca( dwLength ) ); + alloca( dwLength ) ); bRet = lpfnInternetQueryOption( NULL, -- cgit v1.2.3 From 51680950e8666bb97b68f92688b7fcc9ae33b89d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 29 Mar 2010 13:36:43 +0200 Subject: nativea: #i110344# arrow key focus travelling --- framework/source/services/backingwindow.cxx | 199 +++++++++++++--------------- framework/source/services/backingwindow.hxx | 22 +-- 2 files changed, 99 insertions(+), 122 deletions(-) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 60a75609d6..fee41b08ed 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -116,21 +116,13 @@ BackingWindow::BackingWindow( Window* i_pParent ) : Window( i_pParent, FwkResId( DLG_BACKING ) ), maWelcome( this, WB_LEFT ), maProduct( this, WB_LEFT ), - maWriterText( this, WB_WORDBREAK | WB_VCENTER ), maWriterButton( this, STC_BUTTON_STYLE ), - maCalcText( this, WB_WORDBREAK | WB_VCENTER ), maCalcButton( this, STC_BUTTON_STYLE ), - maImpressText( this, WB_WORDBREAK | WB_VCENTER ), maImpressButton( this, STC_BUTTON_STYLE ), - maOpenText( this, WB_WORDBREAK | WB_VCENTER ), maOpenButton( this, STC_BUTTON_STYLE ), - maDrawText( this, WB_WORDBREAK | WB_VCENTER ), maDrawButton( this, STC_BUTTON_STYLE ), - maDBText( this, WB_WORDBREAK | WB_VCENTER ), maDBButton( this, STC_BUTTON_STYLE ), - maMathText( this, WB_WORDBREAK | WB_VCENTER ), maMathButton( this, STC_BUTTON_STYLE ), - maTemplateText( this, WB_WORDBREAK | WB_VCENTER ), maTemplateButton( this, STC_BUTTON_STYLE ), maToolbox( this, WB_DIALOGCONTROL ), maWelcomeString( FwkResId( STR_BACKING_WELCOME ) ), @@ -324,23 +316,7 @@ void BackingWindow::initBackground() maWelcome.SetBackground(); maProduct.SetControlForeground( maWelcomeTextColor ); maProduct.SetBackground(); - maWriterText.SetControlForeground( maLabelTextColor ); - maWriterText.SetControlBackground( aTextBGColor ); - maCalcText.SetControlForeground( maLabelTextColor ); - maCalcText.SetControlBackground( aTextBGColor ); - maImpressText.SetControlForeground( maLabelTextColor ); - maImpressText.SetControlBackground( aTextBGColor ); - maDrawText.SetControlForeground( maLabelTextColor ); - maDrawText.SetControlBackground( aTextBGColor ); - maDBText.SetControlForeground( maLabelTextColor ); - maDBText.SetControlBackground( aTextBGColor ); - maMathText.SetControlForeground( maLabelTextColor ); - maMathText.SetControlBackground( aTextBGColor ); - maTemplateText.SetControlForeground( maLabelTextColor ); - maTemplateText.SetControlBackground( aTextBGColor ); - maOpenText.SetControlForeground( maLabelTextColor ); - maOpenText.SetControlBackground( aTextBGColor ); - + if( mnLayoutStyle == 1 ) { if( Application::GetSettings().GetLayoutRTL() ) @@ -456,35 +432,35 @@ void BackingWindow::initControls() } // layout the buttons - layoutButtonAndText( WRITER_URL, 0, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maWriterButton, maWriterText, aMnemns ); - layoutButtonAndText( DRAW_URL, 1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SDRAW, - maDrawButton, maDrawText, aMnemns ); + layoutButton( WRITER_URL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maWriterButton, aMnemns ); + layoutButton( DRAW_URL, 1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SDRAW, + maDrawButton, aMnemns ); nYPos += maButtonImageSize.Height() + 10; - layoutButtonAndText( CALC_URL, 0, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SCALC, - maCalcButton, maCalcText, aMnemns ); - layoutButtonAndText( BASE_URL, 1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SDATABASE, - maDBButton, maDBText, aMnemns ); + layoutButton( CALC_URL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SCALC, + maCalcButton, aMnemns ); + layoutButton( BASE_URL, 1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SDATABASE, + maDBButton, aMnemns ); nYPos += maButtonImageSize.Height() + 10; - layoutButtonAndText( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SIMPRESS, - maImpressButton, maImpressText, aMnemns ); - layoutButtonAndText( MATH_URL, 1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SMATH, - maMathButton, maMathText, aMnemns ); + layoutButton( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SIMPRESS, + maImpressButton, aMnemns ); + layoutButton( MATH_URL, 1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SMATH, + maMathButton, aMnemns ); nYPos += 3*maButtonImageSize.Height() / 2; - layoutButtonAndText( NULL, 0, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maOpenButton, maOpenText, aMnemns, maOpenString ); - layoutButtonAndText( NULL, 1, aFileNewAppsAvailable, - aModuleOptions, SvtModuleOptions::E_SWRITER, - maTemplateButton, maTemplateText, aMnemns, maTemplateString ); + layoutButton( NULL, 0, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maOpenButton, aMnemns, maOpenString ); + layoutButton( NULL, 1, aFileNewAppsAvailable, + aModuleOptions, SvtModuleOptions::E_SWRITER, + maTemplateButton, aMnemns, maTemplateString ); nYPos += 10; DBG_ASSERT( nYPos < maControlRect.GetHeight(), "misformatting !" ); @@ -545,11 +521,11 @@ void BackingWindow::loadImage( const ResId& i_rId, ImageButton& i_rButton ) i_rButton.SetModeImage( aBmp ); } -void BackingWindow::layoutButtonAndText( +void BackingWindow::layoutButton( const char* i_pURL, int nColumn, const std::set& i_rURLS, SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod, - ImageButton& i_rBtn, FixedText& i_rText, + ImageButton& i_rBtn, MnemonicGenerator& i_rMnemns, const String& i_rStr ) @@ -582,12 +558,6 @@ void BackingWindow::layoutButtonAndText( i_rBtn.SetImageAlign( IMAGEALIGN_LEFT ); // show the controls i_rBtn.Show(); - i_rText.Show( FALSE ); - - - // FIXME: the only reason the FixedTexts are left are not to trigger - // a translation change due to changed src files. For the next minor - // the FixedTexts should be removed completely } void BackingWindow::Paint( const Rectangle& ) @@ -635,8 +605,73 @@ long BackingWindow::Notify( NotifyEvent& rNEvt ) } const KeyEvent* pEvt = rNEvt.GetKeyEvent(); - if( pEvt && mpAccExec->execute(pEvt->GetKeyCode()) ) + const KeyCode& rKeyCode(pEvt->GetKeyCode()); + if( pEvt && mpAccExec->execute(rKeyCode) ) return 1; + // #i110344# extrawurst: specialized arrow key control + if( rKeyCode.GetModifier() == 0 ) + { + if( rKeyCode.GetCode() == KEY_RIGHT ) + { + if( maWriterButton.HasFocus() ) + maDrawButton.GrabFocus(); + else if( maCalcButton.HasFocus() ) + maDBButton.GrabFocus(); + else if( maImpressButton.HasFocus() ) + maMathButton.GrabFocus(); + else if( maOpenButton.HasFocus() ) + maTemplateButton.GrabFocus(); + return 1; + } + else if( rKeyCode.GetCode() == KEY_LEFT ) + { + if( maDrawButton.HasFocus() ) + maWriterButton.GrabFocus(); + else if( maDBButton.HasFocus() ) + maCalcButton.GrabFocus(); + else if( maMathButton.HasFocus() ) + maImpressButton.GrabFocus(); + else if( maTemplateButton.HasFocus() ) + maOpenButton.GrabFocus(); + return 1; + } + else if( rKeyCode.GetCode() == KEY_UP ) + { + // first column + if( maOpenButton.HasFocus() ) + maImpressButton.GrabFocus(); + else if( maImpressButton.HasFocus() ) + maCalcButton.GrabFocus(); + else if( maCalcButton.HasFocus() ) + maWriterButton.GrabFocus(); + // second column + else if( maTemplateButton.HasFocus() ) + maMathButton.GrabFocus(); + else if( maMathButton.HasFocus() ) + maDBButton.GrabFocus(); + else if( maDBButton.HasFocus() ) + maDrawButton.GrabFocus(); + return 1; + } + else if( rKeyCode.GetCode() == KEY_DOWN ) + { + // first column + if( maWriterButton.HasFocus() ) + maCalcButton.GrabFocus(); + else if( maCalcButton.HasFocus() ) + maImpressButton.GrabFocus(); + else if( maImpressButton.HasFocus() ) + maOpenButton.GrabFocus(); + // second column + else if( maDrawButton.HasFocus() ) + maDBButton.GrabFocus(); + else if( maDBButton.HasFocus() ) + maMathButton.GrabFocus(); + else if( maMathButton.HasFocus() ) + maTemplateButton.GrabFocus(); + return 1; + } + } } return Window::Notify( rNEvt ); } @@ -865,54 +900,6 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton ) return 0; } -Window* BackingWindow::GetParentLabelFor( const Window* pLabel ) const -{ - const Window* pRet = NULL; - - if( pLabel == &maWriterText ) - pRet = &maWriterButton; - else if( pLabel == &maCalcText ) - pRet = &maCalcButton; - else if( pLabel == &maImpressText ) - pRet = &maImpressButton; - else if( pLabel == &maDrawText ) - pRet = &maDrawButton; - else if( pLabel == &maDBText ) - pRet = &maDBButton; - else if( pLabel == &maMathText ) - pRet = &maMathButton; - else if( pLabel == &maTemplateText ) - pRet = &maTemplateButton; - else if( pLabel == &maOpenText ) - pRet = &maOpenButton; - - return const_cast(pRet); -} - -Window* BackingWindow::GetParentLabeledBy( const Window* pLabeled ) const -{ - const Window *pRet = NULL; - - if( pLabeled == &maWriterButton ) - pRet = &maWriterText; - else if( pLabeled == &maCalcButton ) - pRet = &maCalcText; - else if( pLabeled == &maImpressButton ) - pRet = &maImpressText; - else if( pLabeled == &maDrawButton ) - pRet = &maDrawText; - else if( pLabeled == &maDBButton ) - pRet = &maDBText; - else if( pLabeled == &maMathButton ) - pRet = &maMathText; - else if( pLabeled == &maTemplateButton ) - pRet = &maTemplateText; - else if( pLabeled == &maOpenButton ) - pRet = &maOpenText; - - return const_cast(pRet); -} - struct ImplDelayedDispatch { Reference< XDispatch > xDispatch; diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index fa993fac34..45fe60f67f 100644 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx @@ -86,21 +86,13 @@ namespace framework Size maWelcomeSize; FixedText maProduct; Size maProductSize; - FixedText maWriterText; ImageButton maWriterButton; - FixedText maCalcText; ImageButton maCalcButton; - FixedText maImpressText; ImageButton maImpressButton; - FixedText maOpenText; ImageButton maOpenButton; - FixedText maDrawText; ImageButton maDrawButton; - FixedText maDBText; ImageButton maDBButton; - FixedText maMathText; ImageButton maMathButton; - FixedText maTemplateText; ImageButton maTemplateButton; DecoToolBox maToolbox; @@ -141,12 +133,12 @@ namespace framework void loadImage( const ResId& i_rId, ImageButton& i_rButton ); - void layoutButtonAndText( const char* i_pURL, int nColumn, const std::set& i_rURLS, - SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod, - ImageButton& i_rBtn, FixedText& i_rText, - MnemonicGenerator& i_rMnemonicGen, - const String& i_rStr = String() - ); + void layoutButton( const char* i_pURL, int nColumn, const std::set& i_rURLS, + SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod, + ImageButton& i_rBtn, + MnemonicGenerator& i_rMnemonicGen, + const String& i_rStr = String() + ); void dispatchURL( const rtl::OUString& i_rURL, const rtl::OUString& i_rTarget = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ), @@ -167,8 +159,6 @@ namespace framework virtual void Resize(); virtual long Notify( NotifyEvent& rNEvt ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); - virtual Window* GetParentLabelFor( const Window* pLabel ) const; - virtual Window* GetParentLabeledBy( const Window* pLabeled ) const; virtual void GetFocus(); void setOwningFrame( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame ); -- cgit v1.2.3 From 92bd29fac787e58b9f0648c3c0aa486f9c327a4d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 29 Mar 2010 14:06:42 +0200 Subject: nativea: #161883# focus handling --- framework/source/services/backingwindow.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index fee41b08ed..e9938aecf0 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -508,6 +508,8 @@ void BackingWindow::initControls() maBackgroundMiddle = BitmapEx(); Resize(); + + maWriterButton.GrabFocus(); } void BackingWindow::loadImage( const ResId& i_rId, ImageButton& i_rButton ) -- cgit v1.2.3 From a56651095373914d5bd09cdc25e3073ddc512534 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Mon, 29 Mar 2010 14:30:42 +0200 Subject: masterfix: #i110415# makefile adapted due to changing .bmp to .png --- desktop/zipintro/makefile.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/desktop/zipintro/makefile.mk b/desktop/zipintro/makefile.mk index 361c46f217..fef106d1e0 100644 --- a/desktop/zipintro/makefile.mk +++ b/desktop/zipintro/makefile.mk @@ -48,17 +48,17 @@ ZIP4LIST= \ $(null,$(INTRO_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/intro.png $(INTRO_BITMAPS)) \ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP5LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \ + $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP6LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \ + $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP7LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo_broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \ + $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP8LIST= \ - $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \ - $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS)) + $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo_broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \ + $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS)) ZIP1TARGET=dev_intro ZIP1DEPS=$(ZIP1LIST) -- cgit v1.2.3 From 69472c2c0b627d3bf8aa4a3e19cbd97ea019f8eb Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 30 Mar 2010 11:02:34 +0200 Subject: nativea: #161739# New icons for printer administration application --- .../desktop/icons/hicolor/16x16/apps/printeradmin.png | Bin 963 -> 4259 bytes .../desktop/icons/hicolor/32x32/apps/printeradmin.png | Bin 2534 -> 5595 bytes .../desktop/icons/hicolor/48x48/apps/printeradmin.png | Bin 4058 -> 7337 bytes 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png mode change 100644 => 100755 sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png mode change 100644 => 100755 sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png diff --git a/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png b/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png old mode 100644 new mode 100755 index 4e8eb0e49d..399076c993 Binary files a/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png and b/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png differ diff --git a/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png b/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png old mode 100644 new mode 100755 index 2c7a0c03f8..b09999c7d0 Binary files a/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png and b/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png differ diff --git a/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png b/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png old mode 100644 new mode 100755 index 41971c9652..a11cbe5ab1 Binary files a/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png and b/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png differ -- cgit v1.2.3 From 544f238cc6f28985a934e3edba98b34c65a84767 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 30 Mar 2010 15:39:42 +0200 Subject: nativea: #161787# Exchange folder with application icon --- desktop/util/ooverinfo.rc | 2 +- desktop/util/verinfo.rc | 2 +- sysui/desktop/icons/makefile.mk | 2 ++ sysui/desktop/icons/ooo3_open.ico | Bin 0 -> 295606 bytes sysui/desktop/icons/so9_open.ico | Bin 0 -> 295606 bytes 5 files changed, 4 insertions(+), 2 deletions(-) create mode 100755 sysui/desktop/icons/ooo3_open.ico create mode 100755 sysui/desktop/icons/so9_open.ico diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc index 28b1e0d4a8..ab613443f5 100644 --- a/desktop/util/ooverinfo.rc +++ b/desktop/util/ooverinfo.rc @@ -113,7 +113,7 @@ VS_VERSION_INFO versioninfo 16 ICON "icons\\empty-template.ico" 17 ICON "icons\\empty-document.ico" 18 ICON "icons\\ooo-configuration.ico" -19 ICON "icons\\ooo-open.ico" +19 ICON "icons\\ooo3_open.ico" 20 ICON "icons\\empty-document.ico" 21 ICON "icons\\ooo3_writer_app.ico" 22 ICON "icons\\ooo3_calc_app.ico" diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc index d614935684..154b99f33c 100644 --- a/desktop/util/verinfo.rc +++ b/desktop/util/verinfo.rc @@ -118,7 +118,7 @@ VS_VERSION_INFO versioninfo 16 ICON "icons\\empty-template.ico" 17 ICON "icons\\empty-document.ico" 18 ICON "icons\\so8-configuration.ico" -19 ICON "icons\\so8-open.ico" +19 ICON "icons\\so9_open.ico" 20 ICON "icons\\empty-document.ico" 21 ICON "icons\\so9_writer_app.ico" 22 ICON "icons\\so9_calc_app.ico" diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk index 1af3f4367f..ac32cdbe45 100644 --- a/sysui/desktop/icons/makefile.mk +++ b/sysui/desktop/icons/makefile.mk @@ -114,6 +114,7 @@ all: \ $(MISC)$/ooo3_math_doc.ico \ $(MISC)$/ooo3_writer_tem.ico \ $(MISC)$/ooo3_empty_tem.ico \ + $(MISC)$/ooo3_open.ico \ $(MISC)$/ooo11-base-doc.ico \ $(MISC)$/ooo11-calc-doc.ico \ $(MISC)$/ooo11-calc-tem.ico \ @@ -176,6 +177,7 @@ all: \ $(MISC)$/so9_chart_doc.ico \ $(MISC)$/so9_writer_app.ico \ $(MISC)$/so9_draw_app.ico \ + $(MISC)$/so9_open.ico \ $(MISC)$/so7-base-doc.ico \ $(MISC)$/so7-calc-doc.ico \ $(MISC)$/so7-calc-tem.ico \ diff --git a/sysui/desktop/icons/ooo3_open.ico b/sysui/desktop/icons/ooo3_open.ico new file mode 100755 index 0000000000..98fcea3748 Binary files /dev/null and b/sysui/desktop/icons/ooo3_open.ico differ diff --git a/sysui/desktop/icons/so9_open.ico b/sysui/desktop/icons/so9_open.ico new file mode 100755 index 0000000000..90f193d80d Binary files /dev/null and b/sysui/desktop/icons/so9_open.ico differ -- cgit v1.2.3 From 49f0c639a91966e70a946ca6b1ad73f17a213430 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 30 Mar 2010 16:44:06 +0200 Subject: nativea: #161787# Use folder icon from Windows shell library --- sfx2/source/appl/shutdowniconw32.cxx | 40 ++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index e9e5ba6123..87c48034c6 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -109,7 +109,7 @@ using namespace ::osl; #define ICON_TEMPLATE 16 #define ICON_MACROLIBRARY 17 #define ICON_CONFIGURATION 18 -#define ICON_OPEN 19 +#define ICON_OPEN 5 // See index of open folder icon in shell32.dll #define ICON_SETUP 500 #define SFX_TASKBAR_NOTIFICATION WM_USER+1 @@ -124,6 +124,7 @@ static void OnDrawItem(HWND hwnd, LPDRAWITEMSTRUCT lpdis); typedef struct tagMYITEM { OUString text; + OUString module; UINT iconId; } MYITEM; @@ -152,7 +153,7 @@ static bool isNT() // ------------------------------- -static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw ) +static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw, const OUString& module ) { MENUITEMINFOW mi; memset( &mi, 0, sizeof( MENUITEMINFOW ) ); @@ -175,6 +176,7 @@ static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text MYITEM *pMyItem = new MYITEM; pMyItem->text = text; pMyItem->iconId = iconId; + pMyItem->module = module; mi.dwItemData = (DWORD) pMyItem; } else @@ -245,6 +247,8 @@ static HMENU createSystrayMenu( ) { SvtModuleOptions::E_SMATH, IDM_MATH, ICON_MATH_DOCUMENT, MATH_URL }, }; + OUString aEmpty; + // insert the menu entries for launching the applications for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i ) { @@ -260,19 +264,21 @@ static HMENU createSystrayMenu( ) continue; addMenuItem( hMenu, aMenuItems[i].nMenuItemID, aMenuItems[i].nMenuIconID, - pShutdownIcon->GetUrlDescription( sURL ), pos, true ); + pShutdownIcon->GetUrlDescription( sURL ), pos, true, aEmpty ); } + + // insert the remaining menu entries addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE, - pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true); - addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false ); - addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true ); - addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false ); + pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, aEmpty); + addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); + addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString::createFromAscii( "shell32" )); + addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); #endif - addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false ); - addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false ); - addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false ); + addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, aEmpty ); + addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); + addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false, aEmpty ); // indicate status of autostart folder CheckMenuItem( hMenu, IDM_INSTALL, MF_BYCOMMAND | (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) ); @@ -738,9 +744,17 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis) int cx = GetSystemMetrics( SM_CXSMICON ); int cy = GetSystemMetrics( SM_CYSMICON ); - HICON hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ), - IMAGE_ICON, cx, cy, - LR_DEFAULTCOLOR | LR_SHARED ); + HICON hIcon( 0 ); + + if ( pMyItem->module.getLength() > 0 ) + hIcon = (HICON) LoadImageA( GetModuleHandleW( reinterpret_cast( pMyItem->module.getStr() )), + MAKEINTRESOURCE( pMyItem->iconId ), + IMAGE_ICON, cx, cy, + LR_DEFAULTCOLOR | LR_SHARED ); + else + hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ), + IMAGE_ICON, cx, cy, + LR_DEFAULTCOLOR | LR_SHARED ); // DrawIconEx( lpdis->hDC, x, y+(height-cy)/2, hIcon, cx, cy, 0, NULL, DI_NORMAL ); -- cgit v1.2.3 From 698c2ee417010b1ca7693c71fb734259fc34ddc7 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 31 Mar 2010 13:22:31 +0200 Subject: nativea: #161879# Use correct icon for 'From Template...' menu entry in quickstarter --- desktop/util/ooverinfo.rc | 2 +- desktop/util/ooverinfo2.rc | 2 +- desktop/util/verinfo.rc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc index ab613443f5..6d92e2a995 100644 --- a/desktop/util/ooverinfo.rc +++ b/desktop/util/ooverinfo.rc @@ -110,7 +110,7 @@ VS_VERSION_INFO versioninfo 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" +16 ICON "icons\\oasis-web-template.ico" 17 ICON "icons\\empty-document.ico" 18 ICON "icons\\ooo-configuration.ico" 19 ICON "icons\\ooo3_open.ico" diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc index d19603d548..f149ec6474 100644 --- a/desktop/util/ooverinfo2.rc +++ b/desktop/util/ooverinfo2.rc @@ -62,7 +62,7 @@ ICON 10 "icons/oasis-presentation-template.ico" ICON 13 "icons/oasis-empty-document.ico" ICON 14 "icons/oasis-database.ico" ICON 15 "icons/oasis-formula.ico" -ICON 16 "icons/empty-template.ico" +ICON 16 "icons/oasis-web-template.ico" ICON 17 "icons/empty-document.ico" ICON 18 "icons/ooo-configuration.ico" ICON 19 "icons/ooo-open.ico" diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc index 154b99f33c..038953f2aa 100644 --- a/desktop/util/verinfo.rc +++ b/desktop/util/verinfo.rc @@ -115,7 +115,7 @@ VS_VERSION_INFO versioninfo 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" +16 ICON "icons\\oasis-web-template.ico" 17 ICON "icons\\empty-document.ico" 18 ICON "icons\\so8-configuration.ico" 19 ICON "icons\\so9_open.ico" -- cgit v1.2.3 From 5dc0e22084c3ca0782f94e27de4a481822d2bad6 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 31 Mar 2010 15:47:30 +0200 Subject: nativea: #161909# Exchange names and URLs --- desktop/source/app/desktop.src | 2 +- desktop/win32/source/applauncher/makefile.mk | 2 +- framework/source/classes/resource.src | 2 +- svx/source/dialog/docrecovery.src | 4 ++-- sysui/desktop/share/launcher_comment.ulf | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src index f172efb309..e333c44181 100644 --- a/desktop/source/app/desktop.src +++ b/desktop/source/app/desktop.src @@ -209,7 +209,7 @@ InfoBox INFOBOX_EXPIRED { Buttons = WB_OK ; DefButton = WB_DEF_OK ; - Message [ en-US ] = "This Evaluation Version has expired. To find out more about %PRODUCTNAME,\nvisit www.sun.com/%PRODUCTNAME."; + Message [ en-US ] = "This Evaluation Version has expired. To find out more about %PRODUCTNAME,\nvisit http://www.oracle.com/us/products/applications/open-office."; }; String STR_TITLE_EXPIRED diff --git a/desktop/win32/source/applauncher/makefile.mk b/desktop/win32/source/applauncher/makefile.mk index 4285476475..f0f5743f38 100644 --- a/desktop/win32/source/applauncher/makefile.mk +++ b/desktop/win32/source/applauncher/makefile.mk @@ -129,7 +129,7 @@ APP6PRODUCTDEF+=-DRES_APP_NAME=smath APP7TARGET=so$/sweb APP7NOSAL=TRUE APP7LINKRES=$(MISC)$/$(TARGET)7.res -APP7ICON=$(SOLARRESDIR)$/icons/so9_html_doc.ico +APP7ICON=$(SOLARRESDIR)$/icons/so9_writer_app.ico APP7OBJS = \ $(OBJ)$/launcher.obj\ $(OBJ)$/sweb.obj diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src index d9c9c558ad..c8114e7129 100644 --- a/framework/source/classes/resource.src +++ b/framework/source/classes/resource.src @@ -124,7 +124,7 @@ String STR_TOOLBAR_TITLE_ADDON String STR_STATUSBAR_LOGOTEXT { - Text [ en-US ] = "A %PRODUCTNAME product by Sun Microsystems, Inc."; + Text [ en-US ] = "A %PRODUCTNAME product by Oracle"; }; // *********************************************************************** diff --git a/svx/source/dialog/docrecovery.src b/svx/source/dialog/docrecovery.src index 67df927ee8..32c3560031 100644 --- a/svx/source/dialog/docrecovery.src +++ b/svx/source/dialog/docrecovery.src @@ -370,7 +370,7 @@ TabPage RID_SVXPAGE_ERR_REP_WELCOME Pos = MAP_APPFONT( RECOV_COL1, RECOV_ROW2 ); Size = MAP_APPFONT( RECOV_CONTROLWIDTH, (RECOV_ROW7-RECOV_ROW2-RSC_SP_CTRL_Y) ); WordBreak = TRUE; - Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Sun Microsystems to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Sun Microsystems' privacy policy, visit\nhttp://www.sun.com/privacy/"; + Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Oracle to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Oracle's privacy policy, visit\nwww.oracle.com/html/services-privacy-policy.html"; }; FixedLine FL_RECOV_BOTTOM { @@ -472,7 +472,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND Pos = MAP_APPFONT( ERRSEND_COL0, ERRSEND_ROW12 ); Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH2, RSC_CD_CHECKBOX_HEIGHT ); Check = FALSE; - Text[ en-US ] = "~I allow Sun Microsystems to contact me regarding this report."; + Text[ en-US ] = "~I allow Oracle to contact me regarding this report."; }; FixedText FT_ERRSEND_EMAILADDR { diff --git a/sysui/desktop/share/launcher_comment.ulf b/sysui/desktop/share/launcher_comment.ulf index e3abc7c7ea..6aeab6d94c 100644 --- a/sysui/desktop/share/launcher_comment.ulf +++ b/sysui/desktop/share/launcher_comment.ulf @@ -17,5 +17,5 @@ en-US = "Create and edit scientific formulas and equations by using Math." en-US = "Manage databases, create queries and reports to track and manage your information by using Base." [startcenter] -en-US = "The office productivity suite compatible to the open and standardized ODF document format. Supported by Sun Microsystems." +en-US = "The office productivity suite compatible to the open and standardized ODF document format. Supported by Oracle." -- cgit v1.2.3 From 049e49785014db9751613ed876b4ee209fdbd3d3 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 1 Apr 2010 09:50:13 +0200 Subject: nativea: #161787# More safe code to retrieve open icon from shell library --- sfx2/source/appl/shutdowniconw32.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 87c48034c6..e018d5e903 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -747,10 +747,19 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis) HICON hIcon( 0 ); if ( pMyItem->module.getLength() > 0 ) - hIcon = (HICON) LoadImageA( GetModuleHandleW( reinterpret_cast( pMyItem->module.getStr() )), + { + LPCWSTR pModuleName = reinterpret_cast( pMyItem->module.getStr() ); + HMODULE hModule = GetModuleHandleW( pModuleName ); + if ( hModule == NULL ) + { + LoadLibraryW( pModuleName ); + hModule = GetModuleHandleW( pModuleName ); + } + hIcon = (HICON) LoadImageA( hModule, MAKEINTRESOURCE( pMyItem->iconId ), IMAGE_ICON, cx, cy, LR_DEFAULTCOLOR | LR_SHARED ); + } else hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ), IMAGE_ICON, cx, cy, -- cgit v1.2.3 From 6658afda7b986e610c77da694e089f3891515049 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 1 Apr 2010 14:52:37 +0200 Subject: nativea: #161787# Ensure that SHELL32 is mapped when accessing via GetModuleHandle --- sfx2/source/appl/shutdowniconw32.cxx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index e018d5e903..9e260fdc85 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -273,7 +273,7 @@ static HMENU createSystrayMenu( ) addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE, pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, aEmpty); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); - addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString::createFromAscii( "shell32" )); + addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString::createFromAscii( "SHELL32" )); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); #endif addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, aEmpty ); @@ -742,28 +742,25 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis) x = aRect.left; y = aRect.top; - int cx = GetSystemMetrics( SM_CXSMICON ); - int cy = GetSystemMetrics( SM_CYSMICON ); - HICON hIcon( 0 ); + int cx = GetSystemMetrics( SM_CXSMICON ); + int cy = GetSystemMetrics( SM_CYSMICON ); + HICON hIcon( 0 ); + HMODULE hModule( GetModuleHandle( NULL ) ); if ( pMyItem->module.getLength() > 0 ) { LPCWSTR pModuleName = reinterpret_cast( pMyItem->module.getStr() ); - HMODULE hModule = GetModuleHandleW( pModuleName ); + hModule = GetModuleHandleW( pModuleName ); if ( hModule == NULL ) { LoadLibraryW( pModuleName ); hModule = GetModuleHandleW( pModuleName ); } - hIcon = (HICON) LoadImageA( hModule, - MAKEINTRESOURCE( pMyItem->iconId ), - IMAGE_ICON, cx, cy, - LR_DEFAULTCOLOR | LR_SHARED ); } - else - hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ), - IMAGE_ICON, cx, cy, - LR_DEFAULTCOLOR | LR_SHARED ); + + hIcon = (HICON) LoadImageA( hModule, MAKEINTRESOURCE( pMyItem->iconId ), + IMAGE_ICON, cx, cy, + LR_DEFAULTCOLOR | LR_SHARED ); // DrawIconEx( lpdis->hDC, x, y+(height-cy)/2, hIcon, cx, cy, 0, NULL, DI_NORMAL ); -- cgit v1.2.3 From 76cbcd8c887875eed798fbf1210a5fefc3e28302 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 1 Apr 2010 16:20:29 +0200 Subject: nativea: #161779# Exchange icon for sweb application --- desktop/win32/source/applauncher/ooo/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/win32/source/applauncher/ooo/makefile.mk b/desktop/win32/source/applauncher/ooo/makefile.mk index 9c60ad1b48..02f240cce9 100644 --- a/desktop/win32/source/applauncher/ooo/makefile.mk +++ b/desktop/win32/source/applauncher/ooo/makefile.mk @@ -116,7 +116,7 @@ APP7DEPN=verinfo.rc APP7VERINFO=verinfo.rc APP7NOSAL=TRUE APP7LINKRES=$(MISC)$/$(TARGET)7.res -APP7ICON=$(SOLARRESDIR)$/icons/ooo3_html_doc.ico +APP7ICON=$(SOLARRESDIR)$/icons/ooo3_writer_app.ico APP7OBJS = \ $(OBJ)$/launcher.obj\ $(OBJ)$/sweb.obj -- cgit v1.2.3 From 8344464a90c9ecdf4ce8913c1daf4eb144c359cc Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Thu, 1 Apr 2010 13:41:17 +0200 Subject: nativea: #i110248# changed Sun Microsystems, Inc. to Oracle --- basic/source/app/basic.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/source/app/basic.src b/basic/source/app/basic.src index 1e520add50..d93ca2fa23 100644 --- a/basic/source/app/basic.src +++ b/basic/source/app/basic.src @@ -87,7 +87,7 @@ ModalDialog IDD_ABOUT_DIALOG { FixedText { Pos = MAP_APPFONT( 40, 60 ); Size = MAP_APPFONT( 110, 10 ); - TEXT = "®1995 Sun Microsystems, Inc."; + TEXT = "®1995-2010 Oracle"; CENTER = TRUE; }; }; @@ -127,7 +127,7 @@ ModalDialog IDD_TT_ABOUT_DIALOG { Pos = MAP_APPFONT( 5, 40 ); Size = MAP_APPFONT( 110, 10 ); CENTER = TRUE; - TEXT[ en-US ] = "©1995-2005 Sun Microsystems, Inc."; + TEXT[ en-US ] = "©1995-2010 Oracle"; }; OKButton RID_OK { Pos = MAP_APPFONT( 40, 60 ); -- cgit v1.2.3 From 3d3f2bfef58542a3ba8a98d1c8fd23be5e7fbcd6 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 1 Apr 2010 13:45:19 +0200 Subject: #i10000# corrected include header --- svx/source/sdr/primitive2d/sdrattributecreator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 6b0102d637..d18345dd0b 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -71,7 +71,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3 From b90b03e6d52d9627a59724125ef705181f57caf8 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 1 Apr 2010 14:16:22 +0200 Subject: #i10000# Fixed missing includes and xProp variable --- desktop/source/app/langselect.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 9904b98a3c..f5cdc3e307 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -30,15 +30,14 @@ #include "app.hxx" #include "langselect.hxx" +#include "cmdlineargs.hxx" #include -#ifndef _RTL_STRING_HXX #include -#endif -#ifndef _SVTOOLS_PATHOPTIONS_HXX +#include #include -#endif #include +#include #include #include #include @@ -224,10 +223,10 @@ bool LanguageSelection::prepareLanguage() flush(); theConfigProvider->setLocale(loc); + Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW); if ( !bCmdLanguage ) { // Store language only - Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW); xProp->setPropertyValue(OUString::createFromAscii("ooLocale"), makeAny(aLocaleString)); Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges(); } @@ -235,9 +234,9 @@ bool LanguageSelection::prepareLanguage() if ( bIniLanguage ) { // Store language only - Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW); - xProp->setPropertyValue(OUString::createFromAscii("UILocale"), makeAny(aLocaleString)); - Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges(); + Reference< XPropertySet > xProp2(getConfigAccess("org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW); + xProp2->setPropertyValue(OUString::createFromAscii("UILocale"), makeAny(aLocaleString)); + Reference< XChangesBatch >(xProp2, UNO_QUERY_THROW)->commitChanges(); } MsLangId::setConfiguredSystemUILanguage( MsLangId::convertLocaleToLanguage(loc) ); -- cgit v1.2.3 From 51d4dae136f639e199dd5acea5e4c06e68339b06 Mon Sep 17 00:00:00 2001 From: Martin Hollmichel Date: Thu, 1 Apr 2010 17:16:51 +0200 Subject: nativea: #i110249# chg copyright in license --- readlicense_oo/source/license/license_en-US.html | 6 +- readlicense_oo/source/license/license_en-US.rtf | 645 +++++++++++++---------- readlicense_oo/source/license/license_en-US.txt | 4 +- 3 files changed, 379 insertions(+), 276 deletions(-) diff --git a/readlicense_oo/source/license/license_en-US.html b/readlicense_oo/source/license/license_en-US.html index 58ff877904..d11c348ee9 100644 --- a/readlicense_oo/source/license/license_en-US.html +++ b/readlicense_oo/source/license/license_en-US.html @@ -19,10 +19,10 @@ in the THIRDPARTYLICENSEREADME.html file.

All trademarks and registered trademarks mentioned herein are the property of their respective owners.


-

Copyright 2002-2008 Sun Microsystems, Inc.

+

Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.

This product has been created with contributions from the -OpenOffice.org community, of which Sun Microsystems Inc. is the -founding member. OpenOffice.org acknowledges all community members, +OpenOffice.org community, of which Oracle is a +principal member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html.


diff --git a/readlicense_oo/source/license/license_en-US.rtf b/readlicense_oo/source/license/license_en-US.rtf index 1a8ef275f9..56792a79cd 100644 --- a/readlicense_oo/source/license/license_en-US.rtf +++ b/readlicense_oo/source/license/license_en-US.rtf @@ -1,271 +1,374 @@ -{\rtf1\ansi\ansicpg1252\deff0\deftab709{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset0 Thorndale;}} -{\colortbl ;\red0\green0\blue255;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;} -{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang1033\b\i\f0\fs24 License\par -\pard\sa283\b0\i0\f1 This product is made available subject to the terms of GNU Lesser General Public License Version 3. A copy of the LGPL license can be found at http://www.openoffice.org/license.html\par -\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par -\pard\sa283\fs24 Third Party Code. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html file.\par -\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par -\pard\sa283\fs24 All trademarks and registered trademarks mentioned herein are the property of their respective owners.\par -\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par -\pard\sa283\fs24 Copyright 2002,2008 Sun Microsystems, Inc.\par -\cf2 This product has been created with contributions from the OpenOffice.org community, of which Sun Microsystems Inc. is the founding member. OpenOffice.org acknowledges all community members, especially those mentioned at\cf3\ul \cf0\ulnone http://www.openoffice.org/welcome/credits.html\par -\par -GNU LESSER GENERAL PUBLIC LICENSE\par -\par -Version 3, 29 June 2007\par -\par -Copyright (C) 2007 Free Software Foundation, Inc. \par -\par -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par -\par -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.\par -0. Additional Definitions.\par -\par -As used herein, \ldblquote this License\rdblquote refers to version 3 of the GNU Lesser General Public License, and the \ldblquote GNU GPL\rdblquote refers to version 3 of the GNU General Public License.\par -\par -\ldblquote The Library\rdblquote refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.\par -\par -An \ldblquote Application\rdblquote is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.\par -\par -A \ldblquote Combined Work\rdblquote is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \ldblquote Linked Version\rdblquote .\par -\par -The \ldblquote Minimal Corresponding Source\rdblquote for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.\par -\par -The \ldblquote Corresponding Application Code\rdblquote for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.\par -1. Exception to Section 3 of the GNU GPL.\par -\par -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.\par -2. Conveying Modified Versions.\par -\par -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:\par -\par - * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or\par - * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.\par -\par -3. Object Code Incorporating Material from Library Header Files.\par -\par -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:\par -\par - * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.\par - * b) Accompany the object code with a copy of the GNU GPL and this license document.\par -\par -4. Combined Works.\par -\par -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:\par -\par - * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.\par - * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.\par - * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.\par - * d) Do one of the following:\par - o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.\par - o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.\par - * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)\par -\par -5. Combined Libraries.\par -\par -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:\par -\par - * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.\par - * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\par -\par -6. Revised Versions of the GNU Lesser General Public License.\par -\par -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par -\par -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.\par -\par -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.\par -\par -GNU GENERAL PUBLIC LICENSE\par -\par -Version 3, 29 June 2007\par -\par -Copyright \'a9 2007 Free Software Foundation, Inc. \par -\par -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par -Preamble\par -\par -The GNU General Public License is a free, copyleft license for software and other kinds of works.\par -\par -The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par -\par -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par -\par -To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par -\par -For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par -\par -Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par -\par -For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par -\par -Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par -\par -Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par -\par -The precise terms and conditions for copying, distribution and modification follow.\par -TERMS AND CONDITIONS\par -0. Definitions.\par -\par -\ldblquote This License\rdblquote refers to version 3 of the GNU General Public License.\par -\par -\ldblquote Copyright\rdblquote also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par -\par -\ldblquote The Program\rdblquote refers to any copyrightable work licensed under this License. Each licensee is addressed as \ldblquote you\rdblquote . \ldblquote Licensees\rdblquote and \ldblquote recipients\rdblquote may be individuals or organizations.\par -\par -To \ldblquote modify\rdblquote a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \ldblquote modified version\rdblquote of the earlier work or a work \ldblquote based on\rdblquote the earlier work.\par -\par -A \ldblquote covered work\rdblquote means either the unmodified Program or a work based on the Program.\par -\par -To \ldblquote propagate\rdblquote a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par -\par -To \ldblquote convey\rdblquote a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par -\par -An interactive user interface displays \ldblquote Appropriate Legal Notices\rdblquote to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par -1. Source Code.\par -\par -The \ldblquote source code\rdblquote for a work means the preferred form of the work for making modifications to it. \ldblquote Object code\rdblquote means any non-source form of a work.\par -\par -A \ldblquote Standard Interface\rdblquote means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par -\par -The \ldblquote System Libraries\rdblquote of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \ldblquote Major Component\rdblquote , in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par -\par -The \ldblquote Corresponding Source\rdblquote for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par -\par -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par -\par -The Corresponding Source for a work in source code form is that same work.\par -2. Basic Permissions.\par -\par -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par -\par -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par -\par -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par -3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par -\par -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par -\par -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\par -4. Conveying Verbatim Copies.\par -\par -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par -\par -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par -5. Conveying Modified Source Versions.\par -\par -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par -\par - * a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\par - * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \ldblquote keep intact all notices\rdblquote .\par - * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\par - * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\par -\par -A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \ldblquote aggregate\rdblquote if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par -6. Conveying Non-Source Forms.\par -\par -You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par -\par - * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\par - * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\par - * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\par - * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\par - * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\par -\par -A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par -\par -A \ldblquote User Product\rdblquote is either (1) a \ldblquote consumer product\rdblquote , which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \ldblquote normally used\rdblquote refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par -\par -\ldblquote Installation Information\rdblquote for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par -\par -If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par -\par -The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par -\par -Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par -7. Additional Terms.\par -\par -\ldblquote Additional permissions\rdblquote are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par -\par -When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par -\par -Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par -\par - * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\par - * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\par - * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\par - * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\par - * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\par - * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\par -\par -All other non-permissive additional terms are considered \ldblquote further restrictions\rdblquote within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par -\par -If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par -\par -Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par -8. Termination.\par -\par -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par -\par -However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par -\par -Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par -\par -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par -9. Acceptance Not Required for Having Copies.\par -\par -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par -10. Automatic Licensing of Downstream Recipients.\par -\par -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par -\par -An \ldblquote entity transaction\rdblquote is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par -\par -You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par -11. Patents.\par -\par -A \ldblquote contributor\rdblquote is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \ldblquote contributor version\rdblquote .\par -\par -A contributor's \ldblquote essential patent claims\rdblquote are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \ldblquote control\rdblquote includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par -\par -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par -\par -In the following three paragraphs, a \ldblquote patent license\rdblquote is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \ldblquote grant\rdblquote such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par -\par -If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \ldblquote Knowingly relying\rdblquote means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par -\par -If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par -\par -A patent license is \ldblquote discriminatory\rdblquote if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par -\par -Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par -12. No Surrender of Others' Freedom.\par -\par -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par -13. Use with the GNU Affero General Public License.\par -\par -Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par -14. Revised Versions of this License.\par -\par -The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par -\par -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par -\par -If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par -\par -Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par -15. Disclaimer of Warranty.\par -\par -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \ldblquote AS IS\rdblquote WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par -16. Limitation of Liability.\par -\par -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par -17. Interpretation of Sections 15 and 16.\par -\par -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par -\par -END OF TERMS AND CONDITIONS\par -\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par -\par -} - \ No newline at end of file +{\rtf1\ansi\deff1\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fprq2\fcharset0 Tahoma;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq2\fcharset0 Tahoma;}{\f4\froman\fprq2\fcharset0 Thorndale{\*\falt Times New Roman};}{\f5\fnil\fprq2\fcharset0 HG Mincho Light J{\*\falt msmincho};}{\f6\fnil\fprq2\fcharset0 LucidaSans;}{\f7\fnil\fprq0\fcharset0 LucidaSans;}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;} +{\stylesheet{\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\snext1 Normal;} +{\s2\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af6\afs28\lang255\ltrch\dbch\af5\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;} +{\s3\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext3 Body Text;} +{\s4\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon3\snext4 List;} +{\s5\sb120\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ai\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\i\loch\f1\fs24\lang1033\i\sbasedon1\snext5 caption;} +{\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext6 Index;} +} +{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3100}}\deftab709 +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ai\ab\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\i\b\loch\f1\fs24\lang1033\i\b {\rtlch \ltrch\loch\f1\fs24\lang1033\i\b License} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This product is made available subject to the terms of GNU Lesser General Public License Version 3. A copy of the LGPL license can be found at http://www.openoffice.org/license.html} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Third Party Code. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html file.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All trademarks and registered trademarks mentioned herein are the property of their respective owners.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright \'a9 2000,2010 Oracle and/or its affiliates.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\cf1\rtlch\ltrch\dbch\hich\f4\loch\f4 This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f4\loch\f4 }{\rtlch\ltrch\dbch\hich\f4\loch\f4 http://www.openoffice.org/welcome/credits.html}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 GNU LESSER GENERAL PUBLIC LICENSE} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Version 3, 29 June 2007} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright (C) 2007 Free Software Foundation, Inc. } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 0. Additional Definitions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 As used herein, \'93this License\'94 refers to version 3 of the GNU Lesser General Public License, and the \'93GNU GPL\'94 refers to version 3 of the GNU General Public License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Library\'94 refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An \'93Application\'94 is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93Combined Work\'94 is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \'93Linked Version\'94.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Minimal Corresponding Source\'94 for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Vers +ion.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Corresponding Application Code\'94 for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries + of the Combined Work.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 1. Exception to Section 3 of the GNU GPL.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 2. Conveying Modified Versions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of +the modified version:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 3. Object Code Incorporating Material from Library Header Files.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, +data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Accompany the object code with a copy of the GNU GPL and this license document.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 4. Combined Works.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do +each of the following:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Do one of the following:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of t +he Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified ve +rsion of the Library that is interface-compatible with the Linked Version.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Co +mbined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you +use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 5. Combined Libraries.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of y +our choice, if you do both of the following:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 6. Revised Versions of the GNU Lesser General Public License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concern +s.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \'93or any later version\'94 applies to it, you have the option of following the terms and + conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the +GNU Lesser General Public License ever published by the Free Software Foundation.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that v +ersion for the Library.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 GNU GENERAL PUBLIC LICENSE} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Version 3, 29 June 2007} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright \'a9 2007 Free Software Foundation, Inc. } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Preamble} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The GNU General Public License is a free, copyleft license for software and other kinds of works.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program-- +to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, t +oo.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or + can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect t +he freedom of others.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them thes +e terms so they know their rights.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attr +ibuted erroneously to authors of previous versions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The sy +stematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise +substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to + a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The precise terms and conditions for copying, distribution and modification follow.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 TERMS AND CONDITIONS} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 0. Definitions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This License\'94 refers to version 3 of the GNU General Public License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright\'94 also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Program\'94 refers to any copyrightable work licensed under this License. Each licensee is addressed as \'93you\'94. \'93Licensees\'94 and \'93recipients\'94 may be individuals or organizations.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93modify\'94 a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \'93modified version\'94 of the earlier work or a work \'93based on\'94 the earli +er work.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93covered work\'94 means either the unmodified Program or a work based on the Program.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93propagate\'94 a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes +copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93convey\'94 a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An interactive user interface displays \'93Appropriate Legal Notices\'94 to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work +(except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list m +eets this criterion.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 1. Source Code.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93source code\'94 for a work means the preferred form of the work for making modifications to it. \'93Object code\'94 means any non-source form of a work.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93Standard Interface\'94 means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that la +nguage.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93System Libraries\'94 of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the w +ork with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \'93Major Component\'94, in this context, means a major essential component (kernel, window system, and so on) of th +e specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Corresponding Source\'94 for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not in +clude the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition fi +les associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms a +nd other parts of the work.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Corresponding Source for a work in source code form is that same work.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 2. Basic Permissions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from + running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, +or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively +on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 3. Protecting Users' Legal Rights From Anti-Circumvention Law.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention o +f such measures.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intentio +n to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 4. Conveying Verbatim Copies.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 5. Conveying Modified Source Versions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) The work must carry prominent notices stating that you modified it, and giving a relevant date.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \'93keep intact all notices\'94.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, r +egardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution med +ium, is called an \'93aggregate\'94 if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause thi +s License to apply to the other parts of the aggregate.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 6. Conveying Non-Source Forms.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that pr +oduct model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price + no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in ac +cord with subsection 6b.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to cop +y the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided +you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requir +ements.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93User Product\'94 is either (1) a \'93consumer product\'94, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a + product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \'93normally used\'94 refers to a typical or common use of that class of product, regardless of the status of the parti +cular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such u +ses represent the only significant mode of use of the product.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Installation Information\'94 for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Sour +ce. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in +perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third +party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been mo +dified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password + or key for unpacking, reading or copying.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 7. Additional Terms.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Additional permissions\'94 are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this Lic +ense, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to t +he additional permissions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You m +ay place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions di +rectly impose on those licensors and authors.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All other non-permissive additional terms are considered \'93further restrictions\'94 within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is +a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided t +hat the further restriction does not survive such relicensing or conveying.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 8. Termination.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted +under the third paragraph of section 11).} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the cop +yright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) +from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new l +icenses for the same material under section 10.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 9. Acceptance Not Required for Having Copies.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptanc +e. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptan +ce of this License to do so.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 10. Automatic Licensing of Downstream Recipients.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this Li +cense.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An \'93entity transaction\'94 is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party +to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the +predecessor in interest, if the predecessor has it or can get it with reasonable efforts.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not ini +tiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 11. Patents.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93contributor\'94 is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \'93contributor version\'94.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A contributor's \'93essential patent claims\'94 are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its cont +ributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \'93control\'94 includes the right to grant patent sublicenses in a manner consistent wi +th the requirements of this License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. +} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 In the following three paragraphs, a \'93patent license\'94 is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \'93grant\'94 such +a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other read +ily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream recipients. \'93Knowingly relying\'94 means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a co +untry, would infringe one or more identifiable patents in that country that you have reason to believe are valid.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A patent license is \'93discriminatory\'94 if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey + a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third +party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection wi +th specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 12. No Surrender of Others' Freedom.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneousl +y your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the + Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 13. Use with the GNU Affero General Public License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The te +rms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 14. Revised Versions of this License.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \'93or any later version\'94 applies to it, you have the option of following the terms and conditions either of that + numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 15. Disclaimer of Warranty.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \'93AS IS\'94 WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLU +DING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY + SERVICING, REPAIR OR CORRECTION.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 16. Limitation of Liability.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONS +EQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS +), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 17. Interpretation of Sections 15 and 16.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connect +ion with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 END OF TERMS AND CONDITIONS} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par } \ No newline at end of file diff --git a/readlicense_oo/source/license/license_en-US.txt b/readlicense_oo/source/license/license_en-US.txt index 6e80610260..52fd9d1cfc 100644 --- a/readlicense_oo/source/license/license_en-US.txt +++ b/readlicense_oo/source/license/license_en-US.txt @@ -7,9 +7,9 @@ Third Party Code. Additional copyright notices and license terms applicable to p All trademarks and registered trademarks mentioned herein are the property of their respective owners. ------------------------------------ -Copyright 2002,2008 Sun Microsystems, Inc. +Copyright (c) 2000,2010 Oracle and/or it affiliates. All rights reserved. -This product has been created with contributions from the OpenOffice.org community, of which Sun Microsystems Inc. is the founding member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html. +This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html. ------------------------------------ -- cgit v1.2.3 From 9adb28e4d81ed76a88c1cad03bf023d26dcfe28e Mon Sep 17 00:00:00 2001 From: Martin Hollmichel Date: Tue, 6 Apr 2010 14:25:52 +0200 Subject: nativea: #i110249# chg copyright --- desktop/source/app/copyright_ascii_ooo.c | 8 +------- desktop/source/app/copyright_ascii_sun.c | 14 +------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/desktop/source/app/copyright_ascii_ooo.c b/desktop/source/app/copyright_ascii_ooo.c index 8d9d821e19..4224419e99 100644 --- a/desktop/source/app/copyright_ascii_ooo.c +++ b/desktop/source/app/copyright_ascii_ooo.c @@ -5,12 +5,6 @@ */ extern const char copyright_text_1[]; -extern const char copyright_text_2[]; -extern const char copyright_text_21[]; -extern const char copyright_text_22[]; -const char copyright_text_1[] = "Copyright © 2010 Sun Microsystems, Inc., All rights reserved."; -const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries."; -const char copyright_text_21[] = "Copyright © 2010 Sun Microsystems, Tous droits réservés."; -const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans ce produit. En particulier, et sans la limitation, ces droits de propriété intellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents et un ou les brevets plus supplémentaires ou les applications de brevet en attente dans les États - Unis et les autres pays."; +const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved."; diff --git a/desktop/source/app/copyright_ascii_sun.c b/desktop/source/app/copyright_ascii_sun.c index 3d437af856..f9950118e8 100644 --- a/desktop/source/app/copyright_ascii_sun.c +++ b/desktop/source/app/copyright_ascii_sun.c @@ -4,17 +4,5 @@ * */ -const char copyright_text_1[] = "Copyright © 2010 Sun Microsystems, Inc., All rights reserved."; -const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries."; -const char copyright_text_3[] = "U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms."; -const char copyright_text_4[] = "This distribution may include materials developed by third parties.Sun, Sun Microsystems, the Sun logo, Java, Solaris and StarOffice are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries."; -const char copyright_text_5[] = "UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd."; -const char copyright_text_21[] = "Copyright © 2010 Sun Microsystems, Tous droits réservés."; -const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans ce produit. En particulier, et sans la limitation, ces droits de propriété intellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents et un ou les brevets plus supplémentaires ou les applications de brevet en attente dans les États - Unis et les autres pays."; -const char copyright_text_23[] = "Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation préalable et écrite de Sun et de ses bailleurs de licence, s'il y ena."; -const char copyright_text_24[] = "L'utilisation est soumise aux termes du contrat de licence."; -const char copyright_text_25[] = "Cette distribution peut comprendre des composants développés par des tierces parties."; -const char copyright_text_26[] = "Sun, Sun Microsystems, le logo Sun, Java, Solaris et StarOffice sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pay"; -const char copyright_text_27[] = "Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pay"; -const char copyright_text_28[] = "UNIX est une marque déposée aux Etats-Unis et dans d'autres pays et licenciée exlusivement par X/Open Company, Ltd."; +const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved."; -- cgit v1.2.3 From 034e90fcd72cad5accf2abe5a7319c63dbf7ac05 Mon Sep 17 00:00:00 2001 From: Martin Hollmichel Date: Tue, 6 Apr 2010 14:40:41 +0200 Subject: nativea: #i110249# chg copyright --- idl/util/svidl.hdb | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 idl/util/svidl.hdb diff --git a/idl/util/svidl.hdb b/idl/util/svidl.hdb deleted file mode 100644 index d57bedb453..0000000000 --- a/idl/util/svidl.hdb +++ /dev/null @@ -1,25 +0,0 @@ -write "/*************************************************************************" -write "* SV.HXX" -write "* __DATE__" -write "* (c) 1992-1994 STAR DIVISION" -write "*************************************************************************/" -write "#ifndef _SVIDL_HXX" -write "#define _SVIDL_HXX" -write "#ifndef _PSTREAM_HXX" -write "#include " -write "#endif" -write "#ifndef _SBX_HXX" -write "#include " -write "#endif" -write "#define IDL_COMPILER /*vorlaeufig immer */" -file char.hxx -file hash.hxx -file lex.hxx -file bastype.hxx -file basobj.hxx -file types.hxx -file object.hxx -file slot.hxx -file module.hxx -file database.hxx -write "#endif" -- cgit v1.2.3 From 1b94e1230e1cc759672a1281fbfc7a7972f6327e Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 14 Apr 2010 16:13:17 +0200 Subject: #i10000# remove dublicate method declaration ControlHolder::invalidate --- svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 955aed7001..1e8f4c79de 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -237,8 +237,6 @@ namespace sdr { namespace contact { void invalidate() const; - void invalidate() const; - public: inline const Reference< XControl >& getControl() const { return m_xControl; } }; @@ -307,15 +305,6 @@ namespace sdr { namespace contact { pWindow->Invalidate(); } - //-------------------------------------------------------------------- - void ControlHolder::invalidate() const - { - Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() ); - OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" ); - if ( pWindow ) - pWindow->Invalidate(); - } - //-------------------------------------------------------------------- ::basegfx::B2DVector ControlHolder::getZoom() const { -- cgit v1.2.3 From 85dd8cc9165428d986599a80207a9e63e4848510 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Wed, 14 Apr 2010 17:20:22 +0200 Subject: masterfix: #i10000# remove incorrect line in buildlists --- officecfg/prj/build.lst | 1 - 1 file changed, 1 deletion(-) diff --git a/officecfg/prj/build.lst b/officecfg/prj/build.lst index dba837c643..04d2cfd87a 100644 --- a/officecfg/prj/build.lst +++ b/officecfg/prj/build.lst @@ -1,5 +1,4 @@ oc officecfg : l10n soltools solenv LIBXSLT:libxslt NULL -oc officecfg usr30073 - none NULL oc officecfg usr1 - all oc_mkout NULL oc officecfg\registry\schema nmake - all oc_reg_schema NULL oc officecfg\registry nmake - all oc_reg NULL -- cgit v1.2.3 From eeaf2f34f56d815040b0e80b5e3abd6b08400bdc Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Tue, 20 Apr 2010 12:17:55 +0200 Subject: DEV300 masterfix: #i10000#: adapt call to SfxViewFrame::GetNext() to changes from CWS autorecovery, 1c65617f50ee@DEV300 --- sfx2/source/doc/printhelper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index eef8373568..fee1e4df3c 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -273,7 +273,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro while ( pViewFrm && !pPrinter ) { pPrinter = pViewFrm->GetViewShell()->GetActivePrinter(); - pViewFrm = SfxViewFrame::GetNext( *pViewFrm, m_pData->m_pObjectShell, 0, sal_False ); + pViewFrm = SfxViewFrame::GetNext( *pViewFrm, m_pData->m_pObjectShell, sal_False ); } // if no view is printing currently, use the permanent SfxPrinter instance -- cgit v1.2.3