[Libreoffice-commits] core.git: svx/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 29 13:43:48 UTC 2021
svx/source/svdraw/svdedxv.cxx | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
New commits:
commit 610d8d3ca470d13159c017cdc3f86310bf5cd1ef
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Apr 29 13:13:20 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Apr 29 15:43:02 2021 +0200
use unique_ptr in TextEditOverlayObject
Change-Id: I0deb52ee36a16aad91a5f945a6d92c1aa18a58a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114878
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index fa04f309e86d..e3c5379e54a5 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -394,7 +394,7 @@ class TextEditOverlayObject : public sdr::overlay::OverlayObject
{
protected:
/// local access to associated sdr::overlay::OverlaySelection
- sdr::overlay::OverlaySelection* mpOverlaySelection;
+ std::unique_ptr<sdr::overlay::OverlaySelection> mxOverlaySelection;
/// local definition depends on active OutlinerView
OutlinerView& mrOutlinerView;
@@ -420,7 +420,10 @@ public:
virtual ~TextEditOverlayObject() override;
// data read access
- const sdr::overlay::OverlaySelection* getOverlaySelection() const { return mpOverlaySelection; }
+ const sdr::overlay::OverlaySelection* getOverlaySelection() const
+ {
+ return mxOverlaySelection.get();
+ }
const OutlinerView& getOutlinerView() const { return mrOutlinerView; }
/// override to check conditions for last createOverlayObjectPrimitive2DSequence
@@ -460,7 +463,6 @@ TextEditOverlayObject::createOverlayObjectPrimitive2DSequence()
TextEditOverlayObject::TextEditOverlayObject(const Color& rColor, OutlinerView& rOutlinerView,
bool bVisualizeSurroundingFrame)
: OverlayObject(rColor)
- , mpOverlaySelection(nullptr)
, mrOutlinerView(rOutlinerView)
, maLastRange()
, maRange()
@@ -474,17 +476,13 @@ TextEditOverlayObject::TextEditOverlayObject(const Color& rColor, OutlinerView&
// create local OverlaySelection - this is an integral part of EditText
// visualization
const std::vector<basegfx::B2DRange> aEmptySelection{};
- mpOverlaySelection = new sdr::overlay::OverlaySelection(sdr::overlay::OverlayType::Transparent,
- rColor, aEmptySelection, true);
+ mxOverlaySelection.reset(new sdr::overlay::OverlaySelection(
+ sdr::overlay::OverlayType::Transparent, rColor, aEmptySelection, true));
}
TextEditOverlayObject::~TextEditOverlayObject()
{
- if (getOverlaySelection())
- {
- delete mpOverlaySelection;
- mpOverlaySelection = nullptr;
- }
+ mxOverlaySelection.reset();
if (getOverlayManager())
{
@@ -604,7 +602,7 @@ void TextEditOverlayObject::checkSelectionChange()
aRect.Right() + aLogicPixel.Width(), aRect.Bottom() + aLogicPixel.Height());
}
- mpOverlaySelection->setRanges(aLogicRanges);
+ mxOverlaySelection->setRanges(aLogicRanges);
}
} // end of anonymous namespace
More information about the Libreoffice-commits
mailing list