diff options
29 files changed, 462 insertions, 99 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; diff --git a/svx/inc/edtspell.hxx b/svx/inc/edtspell.hxx index f3d55ee87841..15e180342d85 100644 --- a/svx/inc/edtspell.hxx +++ b/svx/inc/edtspell.hxx @@ -133,6 +133,9 @@ public: void MarkWrongsInvalid(); WrongList* Clone() const; + + // #i102062# + bool operator==(const WrongList& rCompare) const; }; inline void WrongList::InsertWrong( const WrongRange& rWrong, USHORT nPos ) diff --git a/svx/inc/svx/editobj.hxx b/svx/inc/svx/editobj.hxx index eb304425f09d..f291adefcf71 100644 --- a/svx/inc/svx/editobj.hxx +++ b/svx/inc/svx/editobj.hxx @@ -121,6 +121,9 @@ public: virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName ); bool operator==( const EditTextObject& rCompare ) const; + + // #i102062# + bool isWrongListEqual(const EditTextObject& rCompare) const; }; #endif // _EDITOBJ_HXX diff --git a/svx/inc/svx/outlobj.hxx b/svx/inc/svx/outlobj.hxx index 9a8efeaaddc1..0311fa914422 100644 --- a/svx/inc/svx/outlobj.hxx +++ b/svx/inc/svx/outlobj.hxx @@ -67,6 +67,9 @@ public: bool operator==(const OutlinerParaObject& rCandidate) const; bool operator!=(const OutlinerParaObject& rCandidate) const { return !operator==(rCandidate); } + // #i102062# + bool isWrongListEqual(const OutlinerParaObject& rCompare) const; + // outliner mode access sal_uInt16 GetOutlinerMode() const; void SetOutlinerMode(sal_uInt16 nNew); diff --git a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx index a9b3767c3c32..e4a8fa01902f 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx @@ -71,7 +71,16 @@ namespace drawinglayer attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth); attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet); attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet); - attribute::SdrTextAttribute* createNewSdrTextAttribute(const SfxItemSet& rSet, const SdrText& rText); + + // #i101508# Support handing over given text-to-border distances + attribute::SdrTextAttribute* createNewSdrTextAttribute( + const SfxItemSet& rSet, + const SdrText& rText, + const sal_Int32* pLeft = 0, + const sal_Int32* pUpper = 0, + 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( @@ -83,7 +92,15 @@ namespace drawinglayer attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill); attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet); attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet); - attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(const SfxItemSet& rSet, const SdrText* pSdrText); + + // #i101508# Support handing over given text-to-border distances + attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute( + const SfxItemSet& rSet, + const SdrText* pSdrText, + const sal_Int32* pLeft = 0, + const sal_Int32* pUpper = 0, + const sal_Int32* pRight = 0, + const sal_Int32* pLower = 0); // helpers void calculateRelativeCornerRadius(sal_Int32 nRadius, const ::basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY); diff --git a/svx/source/editeng/editobj.cxx b/svx/source/editeng/editobj.cxx index d0170e507060..fb5e921f60f0 100644 --- a/svx/source/editeng/editobj.cxx +++ b/svx/source/editeng/editobj.cxx @@ -253,6 +253,18 @@ void ContentInfo::DestroyLoadStoreTempInfos() } */ +// #i102062# +bool ContentInfo::isWrongListEqual(const ContentInfo& rCompare) const +{ + if(GetWrongList() == rCompare.GetWrongList()) + return true; + + if(!GetWrongList() || !rCompare.GetWrongList()) + return false; + + return (*GetWrongList() == *rCompare.GetWrongList()); +} + bool ContentInfo::operator==( const ContentInfo& rCompare ) const { if( (aText == rCompare.aText) && @@ -566,6 +578,12 @@ bool EditTextObject::operator==( const EditTextObject& rCompare ) const return static_cast< const BinTextObject* >( this )->operator==( static_cast< const BinTextObject& >( rCompare ) ); } +// #i102062# +bool EditTextObject::isWrongListEqual(const EditTextObject& rCompare) const +{ + return static_cast< const BinTextObject* >(this)->isWrongListEqual(static_cast< const BinTextObject& >(rCompare)); +} + // from SfxItemPoolUser void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) { @@ -599,6 +617,23 @@ void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) } } +EditEngineItemPool* getEditEngineItemPool(SfxItemPool* pPool) +{ + EditEngineItemPool* pRetval = dynamic_cast< EditEngineItemPool* >(pPool); + + while(!pRetval && pPool && pPool->GetSecondaryPool()) + { + pPool = pPool->GetSecondaryPool(); + + if(pPool) + { + pRetval = dynamic_cast< EditEngineItemPool* >(pPool); + } + } + + return pRetval; +} + BinTextObject::BinTextObject( SfxItemPool* pP ) : EditTextObject( EE_FORMAT_BIN ), SfxItemPoolUser() @@ -608,9 +643,17 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : nUserType = 0; nObjSettings = 0; pPortionInfo = 0; - if ( pP ) + + // #i101239# ensure target is a EditEngineItemPool, else + // fallback to pool ownership. This is needed to ensure that at + // pool destruction time of an alien pool, the pool is still alive. + // When registering would happen at an alien pool which just uses an + // EditEngineItemPool as some sub-pool, that pool could already + // be decoupled and deleted whcih would lead to crashes. + pPool = getEditEngineItemPool(pP); + + if ( pPool ) { - pPool = pP; bOwnerOfPool = FALSE; } else @@ -621,6 +664,7 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : if(!bOwnerOfPool && pPool) { + // it is sure now that the pool is an EditEngineItemPool pPool->AddSfxItemPoolUser(*this); } @@ -641,9 +685,12 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : nScriptType = r.nScriptType; pPortionInfo = NULL; // PortionInfo nicht kopieren bStoreUnicodeStrings = FALSE; + if ( !r.bOwnerOfPool ) { - // Dann den Pool mitverwenden + // reuse alien pool; this must be a EditEngineItemPool + // since there is no other way to construct a BinTextObject + // than it's regular constructor where that is ensured pPool = r.pPool; bOwnerOfPool = FALSE; } @@ -656,6 +703,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : if(!bOwnerOfPool && pPool) { + // it is sure now that the pool is an EditEngineItemPool pPool->AddSfxItemPoolUser(*this); } @@ -1589,6 +1637,28 @@ bool BinTextObject::operator==( const BinTextObject& rCompare ) const return true; } +// #i102062# +bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const +{ + if(GetContents().Count() != rCompare.GetContents().Count()) + { + return false; + } + + for(USHORT a(0); a < GetContents().Count(); a++) + { + const ContentInfo& rCandA(*GetContents().GetObject(a)); + const ContentInfo& rCandB(*rCompare.GetContents().GetObject(a)); + + if(!rCandA.isWrongListEqual(rCandB)) + { + return false; + } + } + + return true; +} + #define CHARSETMARKER 0x9999 void __EXPORT BinTextObject::CreateData300( SvStream& rIStream ) diff --git a/svx/source/editeng/editobj2.hxx b/svx/source/editeng/editobj2.hxx index 51a044575dd2..2ed9c8b3e6d8 100644 --- a/svx/source/editeng/editobj2.hxx +++ b/svx/source/editeng/editobj2.hxx @@ -181,13 +181,10 @@ public: WrongList* GetWrongList() const { return pWrongs; } void SetWrongList( WrongList* p ) { pWrongs = p; } - -/* cl removed because not needed anymore since binfilter - LoadStoreTempInfos* GetLoadStoreTempInfos() const { return pTempLoadStoreInfos; } - void CreateLoadStoreTempInfos(); - void DestroyLoadStoreTempInfos(); -*/ bool operator==( const ContentInfo& rCompare ) const; + + // #i102062# + bool isWrongListEqual(const ContentInfo& rCompare) const; }; typedef ContentInfo* ContentInfoPtr; @@ -198,6 +195,7 @@ SV_DECL_PTRARR( ContentInfoList, ContentInfoPtr, 1, 4 ) class BinTextObject : public EditTextObject, public SfxItemPoolUser { using EditTextObject::operator==; + using EditTextObject::isWrongListEqual; private: ContentInfoList aContents; @@ -303,6 +301,9 @@ public: bool operator==( const BinTextObject& rCompare ) const; + // #i102062# + bool isWrongListEqual(const BinTextObject& rCompare) const; + // from SfxItemPoolUser virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool); }; diff --git a/svx/source/editeng/edtspell.cxx b/svx/source/editeng/edtspell.cxx index 25cf685a5df7..df6725cff00f 100644 --- a/svx/source/editeng/edtspell.cxx +++ b/svx/source/editeng/edtspell.cxx @@ -476,6 +476,31 @@ WrongList* WrongList::Clone() const return pNew; } +// #i102062# +bool WrongList::operator==(const WrongList& rCompare) const +{ + // cleck direct members + if(GetInvalidStart() != rCompare.GetInvalidStart() + || GetInvalidEnd() != rCompare.GetInvalidEnd() + || Count() != rCompare.Count()) + { + return false; + } + + for(USHORT a(0); a < Count(); a++) + { + const WrongRange& rCandA(GetObject(a)); + const WrongRange& rCandB(rCompare.GetObject(a)); + + if(rCandA.nStart != rCandB.nStart + || rCandA.nEnd != rCandB.nEnd) + { + return false; + } + } + + return true; +} #ifdef DBG_UTIL sal_Bool WrongList::DbgIsBuggy() const diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index ebd11f87c477..22ef5777f730 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -538,6 +538,19 @@ void E3dScene::operator=(const SdrObject& rObj) // #110988# ImpCleanup3DDepthMapper(); + + // #i101941# + // After a Scene as model object is cloned, the used + // ViewContactOfE3dScene is created and partially used + // to calculate Bound/SnapRects, but - since quite some + // values are buffered at the VC - not really well + // initialized. It would be possible to always watch for + // preconditions of buffered data, but this would be expensive + // and would create a lot of short living data structures. + // It is currently better to flush that data, e.g. by using + // ActionChanged at the VC which will for this class + // flush that cached data and initalize it's valid reconstruction + GetViewContact().ActionChanged(); } /************************************************************************* diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 25992ad607dd..b5cdd332362d 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -134,7 +134,8 @@ BOOL SgaObject::CreateThumb( const Graphic& rGraphic ) else aSize.Height() = (sal_Int32)( S_THUMB / fFactor ); - aThumbBmp = rGraphic.GetBitmap( &aSize ); + const GraphicConversionParameters aParameters(aSize); + aThumbBmp = rGraphic.GetBitmap(aParameters); if( !aThumbBmp.IsEmpty() ) { diff --git a/svx/source/outliner/outlobj.cxx b/svx/source/outliner/outlobj.cxx index b76f3a8c366e..0e319ad1be81 100644 --- a/svx/source/outliner/outlobj.cxx +++ b/svx/source/outliner/outlobj.cxx @@ -77,6 +77,12 @@ public: && maParagraphDataVector == rCandidate.maParagraphDataVector && mbIsEditDoc == rCandidate.mbIsEditDoc); } + + // #i102062# + bool isWrongListEqual(const ImplOutlinerParaObject& rCompare) const + { + return mpEditTextObject->isWrongListEqual(*rCompare.mpEditTextObject); + } }; ////////////////////////////////////////////////////////////////////////////// @@ -147,6 +153,17 @@ bool OutlinerParaObject::operator==(const OutlinerParaObject& rCandidate) const return (*rCandidate.mpImplOutlinerParaObject == *mpImplOutlinerParaObject); } +// #i102062# +bool OutlinerParaObject::isWrongListEqual(const OutlinerParaObject& rCompare) const +{ + if(rCompare.mpImplOutlinerParaObject == mpImplOutlinerParaObject) + { + return true; + } + + return mpImplOutlinerParaObject->isWrongListEqual(*rCompare.mpImplOutlinerParaObject); +} + sal_uInt16 OutlinerParaObject::GetOutlinerMode() const { return mpImplOutlinerParaObject->mpEditTextObject->GetUserType(); diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 37215a794d06..f6bf7b528c08 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -148,6 +148,11 @@ namespace drawinglayer bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const { return (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() diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 0b8245b91060..277ee70f82ca 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -473,7 +473,14 @@ namespace drawinglayer return pRetval; } - attribute::SdrTextAttribute* createNewSdrTextAttribute(const SfxItemSet& rSet, const SdrText& rText) + // #i101508# Support handing over given text-to-border distances + attribute::SdrTextAttribute* createNewSdrTextAttribute( + const SfxItemSet& rSet, + const SdrText& rText, + const sal_Int32* pLeft, + const sal_Int32* pUpper, + const sal_Int32* pRight, + const sal_Int32* pLower) { attribute::SdrTextAttribute* pRetval(0); const SdrTextObj& rTextObj = rText.GetObject(); @@ -519,10 +526,10 @@ namespace drawinglayer rText, aOutlinerParaObject, ((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue(), - rTextObj.GetTextLeftDistance(), - rTextObj.GetTextUpperDistance(), - rTextObj.GetTextRightDistance(), - rTextObj.GetTextLowerDistance(), + pLeft ? *pLeft : rTextObj.GetTextLeftDistance(), + pUpper ? *pUpper : rTextObj.GetTextUpperDistance(), + pRight ? *pRight : rTextObj.GetTextRightDistance(), + pLower ? *pLower : rTextObj.GetTextLowerDistance(), ((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(), (SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit), ((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(), @@ -1031,7 +1038,14 @@ namespace drawinglayer } } - attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(const SfxItemSet& rSet, const SdrText* pSdrText) + // #i101508# Support handing over given text-to-border distances + attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute( + const SfxItemSet& rSet, + const SdrText* pSdrText, + const sal_Int32* pLeft, + const sal_Int32* pUpper, + const sal_Int32* pRight, + const sal_Int32* pLower) { attribute::SdrFillTextAttribute* pRetval(0L); attribute::SdrFillAttribute* pFill(0L); @@ -1042,7 +1056,7 @@ namespace drawinglayer // look for text first if(pSdrText) { - pText = createNewSdrTextAttribute(rSet, *pSdrText); + pText = createNewSdrTextAttribute(rSet, *pSdrText, pLeft, pUpper, pRight, pLower); } // when object has text and text is fontwork and hide contour is set for fontwork, force diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 6845ce6bb619..41666f86a740 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -793,6 +793,15 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/) // overlay objects instead. sal_Bool bUseSolidDragging(IsSolidDragging()); + // #i101648# check if dragged object is a naked SdrObject (no + // derivation of). This is e.g. used in SW Frame construction + // as placeholder. Do not use SolidDragging for naked SDrObjects, + // they cannot have a valid optical representation + if(bUseSolidDragging && OBJ_NONE == pAktCreate->GetObjIdentifier()) + { + bUseSolidDragging = false; + } + // check for objects with no fill and no line if(bUseSolidDragging) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 263279691979..570043c33209 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1392,8 +1392,15 @@ FASTBOOL SdrObject::MovCreate(SdrDragStat& rStat) rStat.TakeCreateRect(aOutRect); rStat.SetActionRect(aOutRect); aOutRect.Justify(); - SetBoundRectDirty(); - bSnapRectDirty=TRUE; + + // #i101648# for naked (non-derived) SdrObjects, do not invalidate aOutRect + // by calling SetBoundRectDirty(); aOutRect IS the geometry for such objects. + // No derivation implementation calls the parent implementation, so this will + // cause no further prolems + // + // SetBoundRectDirty(); + // bSnapRectDirty=TRUE; + return TRUE; } @@ -1401,7 +1408,11 @@ FASTBOOL SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { rStat.TakeCreateRect(aOutRect); aOutRect.Justify(); - SetRectsDirty(); + + // #i101648# see description at MovCreate + // + // SetRectsDirty(); + return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2); } @@ -2376,8 +2387,8 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas if(pRet->LineGeometryUsageIsNecessary()) { - basegfx::B2DPolyPolygon aAreaPolyPolygon; - basegfx::B2DPolyPolygon aLinePolyPolygon; + basegfx::B2DPolyPolygon aMergedLineFillPolyPolygon; + basegfx::B2DPolyPolygon aMergedHairlinePolyPolygon; const drawinglayer::primitive2d::Primitive2DSequence xSequence(pRet->GetViewContact().getViewIndependentPrimitive2DSequence()); if(xSequence.hasElements()) @@ -2389,36 +2400,31 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D); aExtractor.process(xSequence); - aAreaPolyPolygon = aExtractor.getExtractedLineFills(); - aLinePolyPolygon = aExtractor.getExtractedHairlines(); - } + // #i102241# check for line results + const std::vector< basegfx::B2DPolygon >& rHairlineVector = aExtractor.getExtractedHairlines(); - // Since this may in some cases lead to a count of 0 after - // the merge i moved the merge to the front. - if(aAreaPolyPolygon.count()) - { - // bezier geometry got created, even for straight edges since the given - // object is a result of DoConvertToPolyObj. For conversion to contour - // this is not really needed and can be reduced again AFAP - aAreaPolyPolygon = basegfx::tools::simplifyCurveSegments(aAreaPolyPolygon); + if(rHairlineVector.size()) + { + // for SdrObject creation, just copy all to a single Hairline-PolyPolygon + for(sal_uInt32 a(0); a < rHairlineVector.size(); a++) + { + aMergedHairlinePolyPolygon.append(rHairlineVector[a]); + } + } - // merge all to a decent result (try to use AND, but remember original) - const basegfx::B2DPolyPolygon aTemp(aAreaPolyPolygon); - aAreaPolyPolygon = basegfx::tools::solveCrossovers(aAreaPolyPolygon); - aAreaPolyPolygon = basegfx::tools::stripNeutralPolygons(aAreaPolyPolygon); - aAreaPolyPolygon = basegfx::tools::stripDispensablePolygons(aAreaPolyPolygon, false); + // #i102241# check for fill rsults + const std::vector< basegfx::B2DPolyPolygon >& rLineFillVector(aExtractor.getExtractedLineFills()); - if(!aAreaPolyPolygon.count()) + if(rLineFillVector.size()) { - // OOps, AND is empty, this means there were no overlapping parts. Use - // remembered parts as result - aAreaPolyPolygon = aTemp; + // merge to a single PolyPolygon (OR) + aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(rLineFillVector); } } - // || aLinePolyPolygon.Count() removed; the conversion is ONLY + // || aMergedHairlinePolyPolygon.Count() removed; the conversion is ONLY // useful when new closed filled polygons are created - if(aAreaPolyPolygon.count() || (bForceLineDash && aLinePolyPolygon.count())) + if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count())) { SfxItemSet aSet(pRet->GetMergedItemSet()); XFillStyle eOldFillStyle = ((const XFillStyleItem&)(aSet.Get(XATTR_FILLSTYLE))).GetValue(); @@ -2426,10 +2432,10 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas SdrPathObj* aLineHairlinePart = NULL; bool bBuildGroup(false); - if(aAreaPolyPolygon.count()) + if(aMergedLineFillPolyPolygon.count()) { // create SdrObject for filled line geometry - aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aAreaPolyPolygon); + aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aMergedLineFillPolyPolygon); aLinePolygonPart->SetModel(pRet->GetModel()); // correct item properties @@ -2444,13 +2450,13 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas aLinePolygonPart->SetMergedItemSet(aSet); } - if(aLinePolyPolygon.count()) + if(aMergedHairlinePolyPolygon.count()) { // create SdrObject for hairline geometry // OBJ_PATHLINE is necessary here, not OBJ_PATHFILL. This is intended // to get a non-filled object. If the poly is closed, the PathObj takes care for // the correct closed state. - aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aLinePolyPolygon); + aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aMergedHairlinePolyPolygon); aLineHairlinePart->SetModel(pRet->GetModel()); aSet.Put(XLineWidthItem(0L)); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 4831945dfcf3..1e9c9b57c52d 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -1749,7 +1749,10 @@ void SdrPathObj::ImpForceKind() // was called, once here below and once on a 2nd place below. // #i10659# for SdrTextObj, keep aRect up to date - aRect = ImpGetBoundRect(GetPathPoly()); + if(GetPathPoly().count()) + { + aRect = ImpGetBoundRect(GetPathPoly()); + } } // #i75974# adapt polygon state to object type. This may include a reinterpretation @@ -2382,7 +2385,10 @@ void SdrPathObj::TakeUnrotatedSnapRect(Rectangle& rRect) const void SdrPathObj::RecalcSnapRect() { - maSnapRect = ImpGetBoundRect(GetPathPoly()); + if(GetPathPoly().count()) + { + maSnapRect = ImpGetBoundRect(GetPathPoly()); + } } void SdrPathObj::NbcSetSnapRect(const Rectangle& rRect) @@ -2472,8 +2478,11 @@ void SdrPathObj::NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum) } else { - // #i10659# for SdrTextObj, keep aRect up to date - aRect = ImpGetBoundRect(GetPathPoly()); // fuer SdrTextObj + if(GetPathPoly().count()) + { + // #i10659# for SdrTextObj, keep aRect up to date + aRect = ImpGetBoundRect(GetPathPoly()); // fuer SdrTextObj# + } } SetRectsDirty(); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 673b7432f662..8d27914422ae 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -657,7 +657,11 @@ namespace bool SdrTextObj::impCheckSpellCheckForDecomposeTextPrimitive() const { - return false; + // #i102062# asked TL who killed this feature (CWS tl56). Obviously, there + // is no more support for EE_CNTRL_NOREDLINES anymore; redlining is always + // on nowadays. Unfortunately, not false, but true should be returned then. + // Trying if this is all... + return true; } bool SdrTextObj::impDecomposeContourTextPrimitive( @@ -931,6 +935,16 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive( 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 + // it relative to the topper right instead of the topper left + const bool bVertical(rSdrStretchTextPrimitive.getOutlinerParaObject().IsVertical()); + + if(bVertical) + { + aNewTransformA.translate(aScale.getX(), 0.0); + } + // calculate global char stretching scale parameters. Use non-mirrored sizes // to layout without mirroring const double fScaleX(fabs(aScale.getX()) / aOutlinerScale.getX()); diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx index 772811f6ccec..038eb96b35e6 100644 --- a/svx/source/svdraw/svdtext.cxx +++ b/svx/source/svdraw/svdtext.cxx @@ -61,10 +61,19 @@ void SdrText::CheckPortionInfo( SdrOutliner& rOutliner ) { if(!mbPortionInfoChecked) { + // #i102062# no action when the Outliner is the HitTestOutliner, + // this will remove WrongList info at the OPO + if(mpModel && &rOutliner == &mpModel->GetHitTestOutliner()) + return; + // Optimierung: ggf. BigTextObject erzeugen mbPortionInfoChecked=true; if(mpOutlinerParaObject!=NULL && rOutliner.ShouldCreateBigTextObject()) - mpOutlinerParaObject= rOutliner.CreateParaObject(); + { + // #i102062# MemoryLeak closed + delete mpOutlinerParaObject; + mpOutlinerParaObject = rOutliner.CreateParaObject(); + } } } diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 9a6958b34c4d..23f3981228e1 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -554,7 +554,17 @@ Bitmap SdrExchangeView::GetMarkedObjBitmap( BOOL bNoVDevIfOneBmpMarked ) const if( !aBmp ) { const Graphic aGraphic( GetMarkedObjMetaFile( bNoVDevIfOneBmpMarked ) ); - aBmp = aGraphic.GetBitmap(); + + // #i102089# support user's settings of AA and LineSnap when the MetaFile gets + // rasterconverted to a bitmap + const SvtOptionsDrawinglayer aDrawinglayerOpt; + const GraphicConversionParameters aParameters( + Size(), + false, + aDrawinglayerOpt.IsAntiAliasing(), + aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete()); + + aBmp = aGraphic.GetBitmap(aParameters); } } diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index c1c58977be64..f740bf60258c 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -599,7 +599,30 @@ 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 = drawinglayer::primitive2d::createNewSdrFillTextAttribute(rCellItemSet, pSdrText); + drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0; + + if(pSdrText) + { + // #i101508# take cell's local text frame distances into account + const sal_Int32 nLeft(xCurrentCell->GetTextLeftDistance()); + const sal_Int32 nRight(xCurrentCell->GetTextRightDistance()); + const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance()); + const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance()); + + pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + rCellItemSet, + pSdrText, + &nLeft, + &nUpper, + &nRight, + &nLower); + } + else + { + pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + rCellItemSet, + pSdrText); + } if(pAttribute) { diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index b5f3e5c6ec5f..098ddb6c31c0 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -104,6 +104,9 @@ using namespace ::com::sun::star::task; #include <svx/sdr/contact/viewobjectcontact.hxx> #include <svx/sdr/contact/viewcontact.hxx> +// #i102251# +#include <editstat.hxx> + ////////////////////////////////////////////////////////////////////////////// namespace svx @@ -225,16 +228,27 @@ namespace svx Graphic aGraphic( rMtf ); BitmapEx aBmpEx; + // #i102089# support user's settings of AA and LineSnap when the MetaFile gets + // rasterconverted to a bitmap + const SvtOptionsDrawinglayer aDrawinglayerOpt; + const GraphicConversionParameters aParameters( + pSize ? *pSize : Size(0, 0), + true, // allow unlimited size + aDrawinglayerOpt.IsAntiAliasing(), + aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete()); + if( bTransparent ) { - Graphic aMaskGraphic( rMtf.GetMonochromeMtf( COL_BLACK ) ); - Bitmap aMaskBmp( aMaskGraphic.GetUnlimitedBitmap( pSize ) ); + Graphic aMaskGraphic(rMtf.GetMonochromeMtf(COL_BLACK)); + Bitmap aMaskBmp(aMaskGraphic.GetBitmap(aParameters)); - aMaskBmp.Convert( BMP_CONVERSION_1BIT_THRESHOLD ); - aBmpEx = BitmapEx( aGraphic.GetUnlimitedBitmap( pSize ), aMaskBmp ); + aMaskBmp.Convert(BMP_CONVERSION_1BIT_THRESHOLD); + aBmpEx = BitmapEx(aGraphic.GetBitmap(aParameters), aMaskBmp); } else - aBmpEx = BitmapEx( aGraphic.GetUnlimitedBitmap( pSize ) ); + { + aBmpEx = BitmapEx(aGraphic.GetBitmap(aParameters)); + } aBmpEx.SetPrefMapMode( rMtf.GetPrefMapMode() ); aBmpEx.SetPrefSize( rMtf.GetPrefSize() ); @@ -625,8 +639,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) ); rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) ); - std::vector< SdrObject* > aShapes; + // #i102251# + const sal_uInt32 nOldCntrl(rOutl.GetControlWord()); + sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING; + rOutl.SetControlWord(nCntrl); + std::vector< SdrObject* > aShapes; bool bRet = true; // export complete page? @@ -977,6 +995,9 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl ); + // #i102251# + rOutl.SetControlWord(nOldCntrl); + return bRet; } |