diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-07-27 16:24:52 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-07-27 16:24:52 +0000 |
commit | 3160055c323a9bcdc304b62d12b019d98da3218d (patch) | |
tree | 14ce46c45f4457c4da81642da218888d97aa05b5 /drawinglayer | |
parent | CWS-TOOLING: integrate CWS kso32fixes (diff) | |
download | core-3160055c323a9bcdc304b62d12b019d98da3218d.tar.gz core-3160055c323a9bcdc304b62d12b019d98da3218d.zip |
CWS-TOOLING: integrate CWS aw073
2009-07-16 11:21:19 +0200 aw r274036 : corrections after resync
2009-07-15 13:34:18 +0200 aw r274009 : CWS-TOOLING: rebase CWS aw073 to trunk@273858 (milestone: DEV300:m52)
2009-07-01 20:04:27 +0200 aw r273613 : CWS-TOOLING: rebase CWS aw073 to trunk@273468 (milestone: DEV300:m51)
2009-06-24 11:51:03 +0200 aw r273324 : #i102062# added using statement for solaris compiler
2009-06-23 12:53:50 +0200 aw r273278 : #i100158# force filled polygons to closed state
2009-06-23 12:28:33 +0200 aw r273276 : #i100158#, #i102371# corrected all (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) shortcuts to support line/fill and to be not used when FillMode is not overpaint
2009-06-23 12:15:14 +0200 aw r273274 : #i100158# added PolyPolygon support for snapPointsOfHorizontalOrVerticalEdges helper
2009-06-22 17:28:33 +0200 aw r273244 : #i101508# added taking care of cell's distance-to-border values for cell text primitive creation
2009-06-22 12:59:10 +0200 aw r273218 : #i102253# applied patch from OD (see task)
2009-06-18 17:00:52 +0200 aw r273125 : #i102251# added EE_CNTRL_ONLINESPELLING switch off at DrawOutliner during GraphicExporter::GetGraphic
2009-06-18 14:35:57 +0200 aw r273120 : #i102241# added mergeToSinglePolyPolygon usage to SdrObject::ImpConvertToContourObj
2009-06-18 14:35:20 +0200 aw r273119 : #i102241# improved PolygonStrokePrimitive2D::createLocalDecomposition
2009-06-18 14:34:49 +0200 aw r273118 : #i102241# Made B2DCubicBezier::testAndSolveTrivialBezier() numerically more stable
2009-06-17 16:11:21 +0200 aw r273078 : #i102062# added compare support for OutlireParaObject's WrongList in an extra method; using in primitive comparators
2009-06-16 19:10:18 +0200 aw r273037 : #i101957# corrected: offset needs to be added before rotation and shear
2009-06-16 18:58:43 +0200 aw r273035 : #i101957# added needed offset by object width to SdrTextObj::impDecomposeStretchTextPrimitive for vertical texts
2009-06-16 18:35:55 +0200 aw r273034 : #i101941# corrected object initialisation for 3D Scenes on Clone operator
2009-06-16 16:07:30 +0200 aw r273024 : #i101811# extended renderChartPrimitive2D to create a correct embedding in a new MapMode
2009-06-12 19:38:07 +0200 aw r272940 : #i101734# added test code to experiment on demand with more complex transformations for virtual objects than only translations
2009-06-12 19:37:07 +0200 aw r272939 : #i101734# corrected SvtGraphicStroke preparation in MetaFile renderer (AFAP)
2009-06-12 16:31:55 +0200 aw r272931 : #i101648# re-enabled object creation with objecttype OBJ_NONE for SW Frame creation
2009-06-12 13:59:05 +0200 aw r272917 : #i101598# supported AAed single line paint in VCL
2009-06-12 11:34:25 +0200 aw r272907 : #i101598# adapted Graphic::GetBitmap() usage
2009-06-10 16:34:19 +0200 aw r272830 : #i101598# added VCL_DLLPUBLIC to parameter class
2009-06-10 16:30:27 +0200 aw r272829 : #i101598# extended calls to Graphic::GetBitmap/Ex where conversions to Bitmap objects is needed to user defined parameters like AntiAlisasing
2009-06-10 16:28:44 +0200 aw r272828 : #i101598# extended Graphic::GetBitmap/Ex interfaces to transport raster conversion parameters since these calls potentially need to rasterconvert a contained MetaFile
2009-06-09 16:26:40 +0200 aw r272781 : #i100945# checked in proposed patch for now
2009-06-08 18:01:42 +0200 aw r272742 : #i101239# teached BinTextObject to register at EditEngineItemPool sub-pool, not on given pool directly
Diffstat (limited to 'drawinglayer')
9 files changed, 125 insertions, 35 deletions
diff --git a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx index bcd321d2fab3..b2697abece66 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx @@ -48,8 +48,8 @@ namespace drawinglayer class LineGeometryExtractor2D : public BaseProcessor2D { private: - basegfx::B2DPolyPolygon maExtractedHairlines; - basegfx::B2DPolyPolygon maExtractedLineFills; + std::vector< basegfx::B2DPolygon > maExtractedHairlines; + std::vector< basegfx::B2DPolyPolygon > maExtractedLineFills; // bitfield unsigned mbInLineGeometry : 1; @@ -61,8 +61,8 @@ namespace drawinglayer LineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation); virtual ~LineGeometryExtractor2D(); - const basegfx::B2DPolyPolygon& getExtractedHairlines() const { return maExtractedHairlines; } - const basegfx::B2DPolyPolygon& getExtractedLineFills() const { return maExtractedLineFills; } + const std::vector< basegfx::B2DPolygon >& getExtractedHairlines() const { return maExtractedHairlines; } + const std::vector< basegfx::B2DPolyPolygon >& getExtractedLineFills() const { return maExtractedLineFills; } }; } // end of namespace processor2d } // end of namespace drawinglayer diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index b1f42b5a4eff..b5212da54688 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -239,17 +239,19 @@ namespace drawinglayer { if(getB2DPolygon().count()) { + // #i102241# try to simplify before usage + const basegfx::B2DPolygon aB2DPolygon(basegfx::tools::simplifyCurveSegments(getB2DPolygon())); basegfx::B2DPolyPolygon aHairLinePolyPolygon; if(0.0 == getStrokeAttribute().getFullDotDashLen()) { // no line dashing, just copy - aHairLinePolyPolygon.append(getB2DPolygon()); + aHairLinePolyPolygon.append(aB2DPolygon); } else { // apply LineStyle - basegfx::tools::applyLineDashing(getB2DPolygon(), getStrokeAttribute().getDotDashArray(), &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen()); + basegfx::tools::applyLineDashing(aB2DPolygon, getStrokeAttribute().getDotDashArray(), &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen()); } const sal_uInt32 nCount(aHairLinePolyPolygon.count()); @@ -263,12 +265,9 @@ namespace drawinglayer for(sal_uInt32 a(0L); a < nCount; a++) { - // AW: New version of createAreaGeometry; now creates bezier polygons + // New version of createAreaGeometry; now creates bezier polygons aAreaPolyPolygon.append(basegfx::tools::createAreaGeometry( aHairLinePolyPolygon.getB2DPolygon(a), fHalfLineWidth, aLineJoin)); - //const basegfx::B2DPolyPolygon aNewPolyPolygon(basegfx::tools::createAreaGeometryForPolygon( - // aHairLinePolyPolygon.getB2DPolygon(a), fHalfLineWidth, aLineJoin, fMiterMinimumAngle)); - //aAreaPolyPolygon.append(aNewPolyPolygon); } // prepare return value diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx index f4a8a7b5282d..a60162de6ee0 100644 --- a/drawinglayer/source/processor2d/canvasprocessor.cxx +++ b/drawinglayer/source/processor2d/canvasprocessor.cxx @@ -2106,7 +2106,10 @@ namespace drawinglayer mpOutputDevice->Push(PUSH_MAPMODE); mpOutputDevice->SetMapMode(maOriginalMapMode); - if(!renderChartPrimitive2D(rChartPrimitive, *mpOutputDevice)) + if(!renderChartPrimitive2D( + rChartPrimitive, + *mpOutputDevice, + getViewInformation2D())) { // fallback to decomposition (MetaFile) process(rChartPrimitive.get2DDecomposition(getViewInformation2D())); diff --git a/drawinglayer/source/processor2d/helperchartrenderer.cxx b/drawinglayer/source/processor2d/helperchartrenderer.cxx index c2d99604469b..ffa8917ddec8 100644 --- a/drawinglayer/source/processor2d/helperchartrenderer.cxx +++ b/drawinglayer/source/processor2d/helperchartrenderer.cxx @@ -41,6 +41,7 @@ #include <svtools/chartprettypainter.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <drawinglayer/geometry/viewinformation2d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -50,7 +51,10 @@ using namespace com::sun::star; namespace drawinglayer { - bool renderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate, OutputDevice& rOutputDevice) + bool renderChartPrimitive2D( + const primitive2d::ChartPrimitive2D& rChartCandidate, + OutputDevice& rOutputDevice, + const geometry::ViewInformation2D& rViewInformation2D) { bool bChartRendered(false); @@ -73,14 +77,74 @@ namespace drawinglayer if( pPrettyPainter ) { - // create logic object range + // create logic object range; do NOT use ObjectTransformation for this + // (rViewInformation2D.getObjectTransformation()), only the logic object + // size is wanted basegfx::B2DRange aObjectRange(0.0, 0.0, 1.0, 1.0); aObjectRange.transform(rChartCandidate.getTransformation()); const Rectangle aRectangle( (sal_Int32)aObjectRange.getMinX(), (sal_Int32)aObjectRange.getMinY(), (sal_Int32)aObjectRange.getMaxX(), (sal_Int32)aObjectRange.getMaxY()); - bChartRendered = pPrettyPainter->DoPaint(&rOutputDevice, aRectangle); + // #i101811# + if(rViewInformation2D.getObjectTransformation().isIdentity()) + { + // no embedding in another transfromation, just paint with existing + // MapMode. This is just a shortcut; using the below code will also + // work; it has just a neutral ObjectTransformation + bChartRendered = pPrettyPainter->DoPaint(&rOutputDevice, aRectangle); + } + else + { + // rViewInformation2D.getObjectTransformation() is used and + // needs to be expressed in the MapMode for the PrettyPainter; + // else it would call ChartModelHelper::setPageSize(...) with the + // changed size what really will change the chart model and leads + // to re-layouts and re-formattings + const MapMode aOldMapMode(rOutputDevice.GetMapMode()); + basegfx::B2DVector aVTScale, aScale, aTranslate; + double fRotate, fShearX; + + // get basic scaling with current MapMode (aVTScale), containing + // mapping for set MapUnit (e.g. for 100th mm, the basic scale is + // not 1.0, 1.0). This is needed since this scale is included in + // the ObjectToView Transformation and needs to be removed (see + // correction below) to re-create a MapMode + rOutputDevice.SetMapMode(aOldMapMode.GetMapUnit()); + rOutputDevice.GetViewTransformation().decompose(aVTScale, aTranslate, fRotate, fShearX); + + // get complete ObjectToView Transformation scale and translate from current + // transformation chain (combined view and object transform) + rViewInformation2D.getObjectToViewTransformation().decompose(aScale, aTranslate, fRotate, fShearX); + + // assert when shear and/or rotation is used + OSL_ENSURE(basegfx::fTools::equalZero(fRotate), "Chart PrettyPrinting with unsupportable rotation (!)"); + OSL_ENSURE(basegfx::fTools::equalZero(fShearX), "Chart PrettyPrinting with unsupportable shear (!)"); + + // clean scale and translate from basic scaling (DPI, etc...) + // since this will implicitely be part of the to-be-created MapMode + const basegfx::B2DTuple aBasicCleaner( + basegfx::fTools::equalZero(aVTScale.getX()) ? 1.0 : 1.0 / aVTScale.getX(), + basegfx::fTools::equalZero(aVTScale.getY()) ? 1.0 : 1.0 / aVTScale.getY()); + aScale *= aBasicCleaner; + aTranslate *= aBasicCleaner; + + // for MapMode, take scale out of translation + const basegfx::B2DTuple aScaleRemover( + basegfx::fTools::equalZero(aScale.getX()) ? 1.0 : 1.0 / aScale.getX(), + basegfx::fTools::equalZero(aScale.getY()) ? 1.0 : 1.0 / aScale.getY()); + aTranslate *= aScaleRemover; + + // build new MapMode + const MapMode aNewMapMode(aOldMapMode.GetMapUnit(), + Point(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY())), + Fraction(aScale.getX()), Fraction(aScale.getY())); + + // use, paint, restore + rOutputDevice.SetMapMode(aNewMapMode); + bChartRendered = pPrettyPainter->DoPaint(&rOutputDevice, aRectangle); + rOutputDevice.SetMapMode(aOldMapMode); + } } } } diff --git a/drawinglayer/source/processor2d/helperchartrenderer.hxx b/drawinglayer/source/processor2d/helperchartrenderer.hxx index de13431c79c0..4677698129c2 100644 --- a/drawinglayer/source/processor2d/helperchartrenderer.hxx +++ b/drawinglayer/source/processor2d/helperchartrenderer.hxx @@ -43,16 +43,21 @@ class OutputDevice; -namespace drawinglayer { namespace primitive2d { - class ChartPrimitive2D; -}} +namespace drawinglayer { namespace primitive2d { class ChartPrimitive2D; }} +namespace drawinglayer { namespace geometry { class ViewInformation2D; }} ////////////////////////////////////////////////////////////////////////////// // support chart PrettyPrinter usage from primitives namespace drawinglayer { - bool renderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate, OutputDevice& rOutputDevice); + // #i101811# + // Added current ViewInformation2D to take evtl. changed + // ObjectTransformation into account + bool renderChartPrimitive2D( + const primitive2d::ChartPrimitive2D& rChartCandidate, + OutputDevice& rOutputDevice, + const geometry::ViewInformation2D& rViewInformation2D); } // end of namespace drawinglayer diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx index 89e0999d361d..5f0ab63ee1b3 100644 --- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx +++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx @@ -86,7 +86,7 @@ namespace drawinglayer const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate)); basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon()); aLocalPolygon.transform(getViewInformation2D().getObjectTransformation()); - maExtractedHairlines.append(aLocalPolygon); + maExtractedHairlines.push_back(aLocalPolygon); } break; } @@ -98,7 +98,7 @@ namespace drawinglayer const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate)); basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon()); aLocalPolyPolygon.transform(getViewInformation2D().getObjectTransformation()); - maExtractedLineFills.append(aLocalPolyPolygon); + maExtractedLineFills.push_back(aLocalPolyPolygon); } break; } diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 172413105b1c..cc51ebf6371e 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -247,8 +247,8 @@ namespace drawinglayer if(rB2DPolygon.count() && !mnSvtGraphicStrokeCount) { basegfx::BColor aStrokeColor; - PolyPolygon aStartPolyPolygon; - PolyPolygon aEndPolyPolygon; + basegfx::B2DPolyPolygon aStartArrow; + basegfx::B2DPolyPolygon aEndArrow; if(pColor) { @@ -271,11 +271,9 @@ namespace drawinglayer { fPolyLength = basegfx::tools::getLength(rB2DPolygon); - const basegfx::B2DPolyPolygon aStartArrow(basegfx::tools::createAreaGeometryForLineStartEnd( + aStartArrow = basegfx::tools::createAreaGeometryForLineStartEnd( rB2DPolygon, pStart->getB2DPolyPolygon(), true, pStart->getWidth(), - fPolyLength, pStart->isCentered() ? 0.5 : 0.0, 0)); - - aStartPolyPolygon = PolyPolygon(aStartArrow); + fPolyLength, pStart->isCentered() ? 0.5 : 0.0, 0); } if(pEnd && pEnd->isActive()) @@ -285,11 +283,9 @@ namespace drawinglayer fPolyLength = basegfx::tools::getLength(rB2DPolygon); } - const basegfx::B2DPolyPolygon aEndArrow(basegfx::tools::createAreaGeometryForLineStartEnd( + aEndArrow = basegfx::tools::createAreaGeometryForLineStartEnd( rB2DPolygon, pEnd->getB2DPolyPolygon(), false, pEnd->getWidth(), - fPolyLength, pEnd->isCentered() ? 0.5 : 0.0, 0)); - - aEndPolyPolygon = PolyPolygon(aEndArrow); + fPolyLength, pEnd->isCentered() ? 0.5 : 0.0, 0); } } @@ -341,10 +337,23 @@ namespace drawinglayer aDashArray = pStrokeAttribute->getDotDashArray(); } + // #i101734# apply current object transformation to created geometry. + // This is a partial fix. When a object transformation is used which + // e.g. contains a scaleX != scaleY, an unproportional scaling would + // have to be applied to the evtl. existing fat line. The current + // concept of PDF export and SvtGraphicStroke usage does simply not + // allow handling such definitions. The only clean way would be to + // add the transformation to SvtGraphicStroke and to handle it there + basegfx::B2DPolygon aB2DPolygon(rB2DPolygon); + + aB2DPolygon.transform(maCurrentTransformation); + aStartArrow.transform(maCurrentTransformation); + aEndArrow.transform(maCurrentTransformation); + pRetval = new SvtGraphicStroke( - Polygon(rB2DPolygon), - aStartPolyPolygon, - aEndPolyPolygon, + Polygon(aB2DPolygon), + PolyPolygon(aStartArrow), + PolyPolygon(aEndArrow), mfCurrentUnifiedTransparence, fLineWidth, SvtGraphicStroke::capButt, @@ -1623,7 +1632,10 @@ namespace drawinglayer // ChartPrimitive2D const primitive2d::ChartPrimitive2D& rChartPrimitive = static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate); - if(!renderChartPrimitive2D(rChartPrimitive, *mpOutputDevice)) + if(!renderChartPrimitive2D( + rChartPrimitive, + *mpOutputDevice, + getViewInformation2D())) { // fallback to decomposition (MetaFile) process(rChartPrimitive.get2DDecomposition(getViewInformation2D())); diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 229319f11f75..8e2f89bb82a6 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -426,7 +426,10 @@ namespace drawinglayer mpOutputDevice->Push(PUSH_MAPMODE); mpOutputDevice->SetMapMode(maOriginalMapMode); - if(!renderChartPrimitive2D(rChartPrimitive, *mpOutputDevice)) + if(!renderChartPrimitive2D( + rChartPrimitive, + *mpOutputDevice, + getViewInformation2D())) { // fallback to decomposition (MetaFile) process(rChartPrimitive.get2DDecomposition(getViewInformation2D())); diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index 24015903de4c..0a15ff224073 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -141,6 +141,10 @@ namespace } aRetval = BitmapEx(aContent, aAlpha); + + // #i101811# set PrefMapMode and PrefSize at newly created Bitmap + aRetval.SetPrefMapMode(MAP_100TH_MM); + aRetval.SetPrefSize(Size(nWidth, nHeight)); } return aRetval; |