diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/engine3d/dragmt3d.cxx | 6 | ||||
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 10 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlayobjectlist.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdcrtv.cxx | 24 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 14 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 84 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdsnpv.cxx | 12 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 6 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/tablehandles.cxx | 14 |
12 files changed, 99 insertions, 103 deletions
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index dd53fed14666..f03ef825a3c5 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -248,10 +248,10 @@ void E3dDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay if(aResult.count()) { - sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled( - aResult); + std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled( + aResult)); rOverlayManager.add(*pNew); - addToOverlayObjectList(pNew); + addToOverlayObjectList(std::move(pNew)); } } diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index a048fce616d3..e976aab5962d 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -200,10 +200,10 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aContent, 0.5)); aContent = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparencePrimitive2D }; - sdr::overlay::OverlayPrimitive2DSequenceObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent); + std::unique_ptr<sdr::overlay::OverlayPrimitive2DSequenceObject> pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent)); xTargetOverlay->add(*pNew); - maObjects.append(pNew); + maObjects.append(std::move(pNew)); } } else @@ -214,10 +214,10 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr basegfx::B2DPolyPolygon aPolyPolygon(mpPolygons[b]); aPolyPolygon.transform(aMatrixTransform); - sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled( - aPolyPolygon); + std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled( + aPolyPolygon)); xTargetOverlay->add(*pNew); - maObjects.append(pNew); + maObjects.append(std::move(pNew)); } } } diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index 706bc692c6e6..8b92e076eda2 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -41,27 +41,25 @@ namespace sdr void OverlayObjectList::clear() { - for(OverlayObject* pCandidate : maVector) + for(auto & pCandidate : maVector) { if(pCandidate->getOverlayManager()) pCandidate->getOverlayManager()->remove(*pCandidate); - - delete pCandidate; } maVector.clear(); } - void OverlayObjectList::append(OverlayObject* pOverlayObject) + void OverlayObjectList::append(std::unique_ptr<OverlayObject> pOverlayObject) { assert(pOverlayObject && "tried to add invalid OverlayObject to OverlayObjectList"); - maVector.push_back(pOverlayObject); + maVector.push_back(std::move(pOverlayObject)); } bool OverlayObjectList::isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance) const { if(!maVector.empty()) { - OverlayObject* pFirst = maVector.front(); + OverlayObject* pFirst = maVector.front().get(); OverlayManager* pManager = pFirst->getOverlayManager(); if(pManager) @@ -89,7 +87,7 @@ namespace sdr fLogicTolerance, false); - for(OverlayObject* pCandidate : maVector) + for(auto & pCandidate : maVector) { if(pCandidate->isHittable()) { @@ -117,7 +115,7 @@ namespace sdr sal_uInt32 nDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL; if(!maVector.empty()) { - OverlayObject* pCandidate = maVector.front(); + OverlayObject* pCandidate = maVector.front().get(); OverlayManager* pManager = pCandidate->getOverlayManager(); if(pManager) @@ -137,7 +135,7 @@ namespace sdr { basegfx::B2DRange aRetval; - for(OverlayObject* pCandidate : maVector) + for(auto & pCandidate : maVector) { aRetval.expand(pCandidate->getBaseRange()); } diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index fac7c2a28245..051866a9b27d 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -77,10 +77,10 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S Size aHalfLogicSize(xTargetOverlay->getOutputDevice().PixelToLogic(Size(4 * fScalingFactor, 4 * fScalingFactor))); // object - sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled( - aB2DPolyPolygon); + std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled( + aB2DPolyPolygon)); xTargetOverlay->add(*pNew); - maObjects.append(pNew); + maObjects.append(std::move(pNew)); // glue points for(sal_uInt16 i(0); i < 4; i++) @@ -101,10 +101,10 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S basegfx::B2DPolyPolygon aTempPolyPoly; aTempPolyPoly.append(aTempPoly); - pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled( - aTempPolyPoly); - xTargetOverlay->add(*pNew); - maObjects.append(pNew); + std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew2(new sdr::overlay::OverlayPolyPolygonStripedAndFilled( + aTempPolyPoly)); + xTargetOverlay->add(*pNew2); + maObjects.append(std::move(pNew2)); } } } @@ -145,18 +145,18 @@ void ImpSdrCreateViewExtraData::CreateAndShowOverlay(const SdrCreateView& rView, { const sdr::contact::ViewContact& rVC = pObject->GetViewContact(); const drawinglayer::primitive2d::Primitive2DContainer aSequence = rVC.getViewIndependentPrimitive2DContainer(); - sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence); + std::unique_ptr<sdr::overlay::OverlayObject> pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence)); xOverlayManager->add(*pNew); - maObjects.append(pNew); + maObjects.append(std::move(pNew)); } if(rPolyPoly.count()) { - sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled( - rPolyPoly); + std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled( + rPolyPoly)); xOverlayManager->add(*pNew); - maObjects.append(pNew); + maObjects.append(std::move(pNew)); } } } diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 46dfcc322ab7..30269bf5344b 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -769,9 +769,9 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay if(!aResult.empty()) { - sdr::overlay::OverlayObject* pNewOverlayObject = new sdr::overlay::OverlayPrimitive2DSequenceObject(aResult); + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(new sdr::overlay::OverlayPrimitive2DSequenceObject(aResult)); rOverlayManager.add(*pNewOverlayObject); - addToOverlayObjectList(pNewOverlayObject); + addToOverlayObjectList(std::move(pNewOverlayObject)); } if(!aResultTransparent.empty()) @@ -779,9 +779,9 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aResultTransparent, 0.5)); aResultTransparent = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparencePrimitive2D }; - sdr::overlay::OverlayObject* pNewOverlayObject = new sdr::overlay::OverlayPrimitive2DSequenceObject(aResultTransparent); + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(new sdr::overlay::OverlayPrimitive2DSequenceObject(aResultTransparent)); rOverlayManager.add(*pNewOverlayObject); - addToOverlayObjectList(pNewOverlayObject); + addToOverlayObjectList(std::move(pNewOverlayObject)); } } @@ -793,11 +793,11 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay const basegfx::B2DPoint aTopLeft(aActionRectangle.Left(), aActionRectangle.Top()); const basegfx::B2DPoint aBottomRight(aActionRectangle.Right(), aActionRectangle.Bottom()); - sdr::overlay::OverlayRollingRectangleStriped* pNew = new sdr::overlay::OverlayRollingRectangleStriped( - aTopLeft, aBottomRight, true, false); + std::unique_ptr<sdr::overlay::OverlayRollingRectangleStriped> pNew(new sdr::overlay::OverlayRollingRectangleStriped( + aTopLeft, aBottomRight, true, false)); rOverlayManager.add(*pNew); - addToOverlayObjectList(pNew); + addToOverlayObjectList(std::move(pNew)); } } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index e6616c0247e0..bfe91b5268b8 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1190,15 +1190,15 @@ bool SdrObjEditView::SdrBeginTextEdit( rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); if (xManager.is()) { - TextEditOverlayObject* pNewTextEditOverlayObject = new TextEditOverlayObject( + std::unique_ptr<TextEditOverlayObject> pNewTextEditOverlayObject(new TextEditOverlayObject( aHilightColor, *pTextEditOutlinerView, - bVisualizeSurroundingFrame); + bVisualizeSurroundingFrame)); xManager->add(*pNewTextEditOverlayObject); xManager->add(const_cast<sdr::overlay::OverlaySelection&>(*pNewTextEditOverlayObject->getOverlaySelection())); - maTEOverlayGroup.append(pNewTextEditOverlayObject); + maTEOverlayGroup.append(std::move(pNewTextEditOverlayObject)); } } } diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 68052c193e7f..a0b0291e02b0 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -565,7 +565,7 @@ void SdrHdl::CreateB2dIAObject() if (xManager.is()) { basegfx::B2DPoint aPosition(aPos.X(), aPos.Y()); - sdr::overlay::OverlayObject* pNewOverlayObject = nullptr; + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject; if (getenv ("SVX_DRAW_HANDLES") && (eKindOfMarker == BitmapMarkerKind::Rect_7x7 || eKindOfMarker == BitmapMarkerKind::Rect_9x9 || eKindOfMarker == BitmapMarkerKind::Rect_11x11)) { double fSize = 7.0; @@ -604,19 +604,19 @@ void SdrHdl::CreateB2dIAObject() default: break; } - pNewOverlayObject = new sdr::overlay::OverlayHandle(aPosition, aB2DSize, /*HandleStrokeColor*/COL_BLACK, aHandleFillColor); + pNewOverlayObject.reset(new sdr::overlay::OverlayHandle(aPosition, aB2DSize, /*HandleStrokeColor*/COL_BLACK, aHandleFillColor)); } else { - pNewOverlayObject = CreateOverlayObject( + pNewOverlayObject.reset(CreateOverlayObject( aPosition, eColIndex, eKindOfMarker, - aMoveOutsideOffset); + aMoveOutsideOffset)); } // OVERLAYMANAGER if (pNewOverlayObject) { xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1112,17 +1112,17 @@ void SdrHdlColor::CreateB2dIAObject() { BitmapEx aBmpCol(CreateColorDropper(aMarkerColor)); basegfx::B2DPoint aPosition(aPos.X(), aPos.Y()); - sdr::overlay::OverlayObject* pNewOverlayObject = new + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(new sdr::overlay::OverlayBitmapEx( aPosition, aBmpCol, static_cast<sal_uInt16>(aBmpCol.GetSizePixel().Width() - 1) >> 1, static_cast<sal_uInt16>(aBmpCol.GetSizePixel().Height() - 1) >> 1 - ); + )); // OVERLAYMANAGER xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1274,15 +1274,14 @@ void SdrHdlGradient::CreateB2dIAObject() basegfx::B2DPoint aPosition(aPos.X(), aPos.Y()); basegfx::B2DPoint aMidPos(aMidPoint.X(), aMidPoint.Y()); - sdr::overlay::OverlayObject* pNewOverlayObject = new + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(new sdr::overlay::OverlayLineStriped( aPosition, aMidPos - ); - DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!"); + )); pNewOverlayObject->setBaseColor(IsGradient() ? COL_BLACK : COL_BLUE); xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); // arrowhead Point aLeft(aMidPoint.X() + static_cast<sal_Int32>(aPerpend.getX() * fHalfArrowWidth), @@ -1294,17 +1293,16 @@ void SdrHdlGradient::CreateB2dIAObject() basegfx::B2DPoint aPositionRight(aRight.X(), aRight.Y()); basegfx::B2DPoint aPosition2(a2ndPos.X(), a2ndPos.Y()); - pNewOverlayObject = new + pNewOverlayObject.reset(new sdr::overlay::OverlayTriangle( aPositionLeft, aPosition2, aPositionRight, IsGradient() ? COL_BLACK : COL_BLUE - ); - DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!"); + )); xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1421,18 +1419,18 @@ void SdrHdlLine::CreateB2dIAObject() basegfx::B2DPoint aPosition1(pHdl1->GetPos().X(), pHdl1->GetPos().Y()); basegfx::B2DPoint aPosition2(pHdl2->GetPos().X(), pHdl2->GetPos().Y()); - sdr::overlay::OverlayObject* pNewOverlayObject = new + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(new sdr::overlay::OverlayLineStriped( aPosition1, aPosition2 - ); + )); // OVERLAYMANAGER // color(?) pNewOverlayObject->setBaseColor(COL_LIGHTRED); xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1479,11 +1477,11 @@ void SdrHdlBezWgt::CreateB2dIAObject() if(!aPosition1.equal(aPosition2)) { - sdr::overlay::OverlayObject* pNewOverlayObject = new + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(new sdr::overlay::OverlayLineStriped( aPosition1, aPosition2 - ); + )); // OVERLAYMANAGER // line part is not hittable pNewOverlayObject->setHittable(false); @@ -1492,7 +1490,7 @@ void SdrHdlBezWgt::CreateB2dIAObject() pNewOverlayObject->setBaseColor(COL_LIGHTBLUE); xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1530,15 +1528,15 @@ void E3dVolumeMarker::CreateB2dIAObject() rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); if (xManager.is() && aWireframePoly.count()) { - sdr::overlay::OverlayObject* pNewOverlayObject = new - sdr::overlay::OverlayPolyPolygonStripedAndFilled( - aWireframePoly); + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(new + sdr::overlay::OverlayPolyPolygonStripedAndFilled( + aWireframePoly)); // OVERLAYMANAGER pNewOverlayObject->setBaseColor(COL_BLACK); xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1593,16 +1591,16 @@ void ImpEdgeHdl::CreateB2dIAObject() if (xManager.is()) { basegfx::B2DPoint aPosition(aPos.X(), aPos.Y()); - sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject( + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(CreateOverlayObject( aPosition, eColIndex, - eKindOfMarker); + eKindOfMarker)); // OVERLAYMANAGER if (pNewOverlayObject) { xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1709,16 +1707,16 @@ void ImpMeasureHdl::CreateB2dIAObject() if (xManager.is()) { basegfx::B2DPoint aPosition(aPos.X(), aPos.Y()); - sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject( + std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(CreateOverlayObject( aPosition, eColIndex, - eKindOfMarker); + eKindOfMarker)); // OVERLAYMANAGER if (pNewOverlayObject) { xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -1776,7 +1774,7 @@ void ImpTextframeHdl::CreateB2dIAObject() const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor()); const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01); - sdr::overlay::OverlayRectangle* pNewOverlayObject = new sdr::overlay::OverlayRectangle( + std::unique_ptr<sdr::overlay::OverlayRectangle> pNewOverlayObject(new sdr::overlay::OverlayRectangle( aTopLeft, aBottomRight, aHilightColor, @@ -1784,12 +1782,12 @@ void ImpTextframeHdl::CreateB2dIAObject() 3.0, 3.0, nRotationAngle * -F_PI18000, - true); // allow animation; the Handle is not shown at text edit time + true)); // allow animation; the Handle is not shown at text edit time // OVERLAYMANAGER pNewOverlayObject->setHittable(false); xManager->add(*pNewOverlayObject); - maOverlayGroup.append(pNewOverlayObject); + maOverlayGroup.append(std::move(pNewOverlayObject)); } } } @@ -2364,7 +2362,7 @@ void SdrCropHdl::CreateB2dIAObject() { basegfx::B2DPoint aPosition(aPos.X(), aPos.Y()); - sdr::overlay::OverlayObject* pOverlayObject = nullptr; + std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject; // animate focused handles if(IsFocusHdl() && (pHdlList->GetFocusHdl() == this)) @@ -2376,7 +2374,7 @@ void SdrCropHdl::CreateB2dIAObject() const sal_uInt64 nBlinkTime = rStyleSettings.GetCursorBlinkTime(); - pOverlayObject = new sdr::overlay::OverlayAnimatedBitmapEx( + pOverlayObject.reset(new sdr::overlay::OverlayAnimatedBitmapEx( aPosition, aBmpEx1, aBmpEx2, @@ -2386,26 +2384,26 @@ void SdrCropHdl::CreateB2dIAObject() static_cast<sal_uInt16>(aBmpEx2.GetSizePixel().Width() - 1) >> 1, static_cast<sal_uInt16>(aBmpEx2.GetSizePixel().Height() - 1) >> 1, mfShearX, - mfRotation); + mfRotation)); } else { // create centered handle as default - pOverlayObject = new sdr::overlay::OverlayBitmapEx( + pOverlayObject.reset(new sdr::overlay::OverlayBitmapEx( aPosition, aBmpEx1, static_cast<sal_uInt16>(aBmpEx1.GetSizePixel().Width() - 1) >> 1, static_cast<sal_uInt16>(aBmpEx1.GetSizePixel().Height() - 1) >> 1, 0.0, mfShearX, - mfRotation); + mfRotation)); } // OVERLAYMANAGER if(pOverlayObject) { xManager->add(*pOverlayObject); - maOverlayGroup.append(pOverlayObject); + maOverlayGroup.append(std::move(pOverlayObject)); } } } @@ -2613,13 +2611,13 @@ void SdrCropViewHdl::CreateB2dIAObject() rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); if(xManager.is()) { - sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence); + std::unique_ptr<sdr::overlay::OverlayObject> pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence)); // only informative object, no hit pNew->setHittable(false); xManager->add(*pNew); - maOverlayGroup.append(pNew); + maOverlayGroup.append(std::move(pNew)); } } } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index c4eca039c19d..084d936e1baa 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -94,10 +94,10 @@ ImplMarkingOverlay::ImplMarkingOverlay(const SdrPaintView& rView, const basegfx: if (xTargetOverlay.is()) { - sdr::overlay::OverlayRollingRectangleStriped* pNew = new sdr::overlay::OverlayRollingRectangleStriped( - rStartPos, rStartPos, false); + std::unique_ptr<sdr::overlay::OverlayRollingRectangleStriped> pNew(new sdr::overlay::OverlayRollingRectangleStriped( + rStartPos, rStartPos, false)); xTargetOverlay->add(*pNew); - maObjects.append(pNew); + maObjects.append(std::move(pNew)); } } } diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx index 1dc96f0c6a51..55664027168a 100644 --- a/svx/source/svdraw/svdsnpv.cxx +++ b/svx/source/svdraw/svdsnpv.cxx @@ -62,10 +62,10 @@ ImplPageOriginOverlay::ImplPageOriginOverlay(const SdrPaintView& rView, const ba if (xTargetOverlay.is()) { - sdr::overlay::OverlayCrosshairStriped* aNew = new sdr::overlay::OverlayCrosshairStriped( - maPosition); + std::unique_ptr<sdr::overlay::OverlayCrosshairStriped> aNew(new sdr::overlay::OverlayCrosshairStriped( + maPosition)); xTargetOverlay->add(*aNew); - maObjects.append(aNew); + maObjects.append(std::move(aNew)); } } } @@ -136,10 +136,10 @@ ImplHelpLineOverlay::ImplHelpLineOverlay( if (xTargetOverlay.is()) { - sdr::overlay::OverlayHelplineStriped* aNew = new sdr::overlay::OverlayHelplineStriped( - maPosition, meHelpLineKind); + std::unique_ptr<sdr::overlay::OverlayHelplineStriped> aNew(new sdr::overlay::OverlayHelplineStriped( + maPosition, meHelpLineKind)); xTargetOverlay->add(*aNew); - maObjects.append(aNew); + maObjects.append(std::move(aNew)); } } } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 3cdbec76c362..f428714e8b81 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -96,11 +96,11 @@ void SdrDropMarkerOverlay::ImplCreateOverlays( if (xTargetOverlay.is()) { - sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled( - rLinePolyPolygon); + std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled( + rLinePolyPolygon)); xTargetOverlay->add(*pNew); - maObjects.append(pNew); + maObjects.append(std::move(pNew)); } } } diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 317e12efb62c..c5992a7b197b 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2190,11 +2190,11 @@ void SvxTableController::updateSelectionOverlay() rtl::Reference < sdr::overlay::OverlayManager > xOverlayManager = pPaintWindow->GetOverlayManager(); if( xOverlayManager.is() ) { - sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( aHighlight, aRanges ); + std::unique_ptr<sdr::overlay::OverlayObjectCell> pOverlay(new sdr::overlay::OverlayObjectCell( aHighlight, aRanges )); xOverlayManager->add(*pOverlay); mpSelectionOverlay.reset(new sdr::overlay::OverlayObjectList); - mpSelectionOverlay->append(pOverlay); + mpSelectionOverlay->append(std::move(pOverlay)); } } } diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 5acff4be8417..c3671dc0c92b 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -174,9 +174,9 @@ void TableEdgeHdl::CreateB2dIAObject() if(aVisible.count()) { // create overlay object for visible parts - sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aVisible, true); + std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject(new OverlayTableEdge(aVisible, true)); xManager->add(*pOverlayObject); - maOverlayGroup.append(pOverlayObject); + maOverlayGroup.append(std::move(pOverlayObject)); } if(aInvisible.count()) @@ -184,9 +184,9 @@ void TableEdgeHdl::CreateB2dIAObject() // also create overlay object for invisible parts to allow // a standard HitTest using the primitives from that overlay object // (see OverlayTableEdge implementation) - sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aInvisible, false); + std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject(new OverlayTableEdge(aInvisible, false)); xManager->add(*pOverlayObject); - maOverlayGroup.append(pOverlayObject); + maOverlayGroup.append(std::move(pOverlayObject)); } } } @@ -288,12 +288,12 @@ void TableBorderHdl::CreateB2dIAObject() float fScaleFactor = rOutDev.GetDPIScaleFactor(); double fWidth = fScaleFactor * 6.0; - sdr::overlay::OverlayObject* pOverlayObject = + std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject( new sdr::overlay::OverlayRectangle(aRange.getMinimum(), aRange.getMaximum(), aHilightColor, fTransparence, - fWidth, 0.0, 0.0, bAnimate); + fWidth, 0.0, 0.0, bAnimate)); xManager->add(*pOverlayObject); - maOverlayGroup.append(pOverlayObject); + maOverlayGroup.append(std::move(pOverlayObject)); } } } |