[Libreoffice-commits] core.git: include/vcl vcl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Feb 24 10:59:44 UTC 2021
include/vcl/splitwin.hxx | 2 +-
vcl/source/window/splitwin.cxx | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
New commits:
commit bcb15a129d8befa5df5767b09e93b5003332ae71
Author: Noel Grandin <noel at peralex.com>
AuthorDate: Wed Feb 24 10:05:00 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Feb 24 11:59:01 2021 +0100
use unique_ptr in SplitWindow
Change-Id: Ic17c5a8923190d3be99105cbf47de6b83009145e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111443
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/vcl/splitwin.hxx b/include/vcl/splitwin.hxx
index c88f015a9471..c41376109b87 100644
--- a/include/vcl/splitwin.hxx
+++ b/include/vcl/splitwin.hxx
@@ -48,7 +48,7 @@ private:
std::unique_ptr<ImplSplitSet> mpMainSet;
ImplSplitSet* mpBaseSet;
ImplSplitSet* mpSplitSet;
- tools::Long* mpLastSizes;
+ std::unique_ptr<tools::Long[]> mpLastSizes;
tools::Rectangle maDragRect;
tools::Long mnDX;
tools::Long mnDY;
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index d43eccb2725c..ad7ae0f981f6 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1762,7 +1762,7 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
{
std::vector< ImplSplitItem >& rItems = mpSplitSet->mvItems;
sal_uInt16 nItems = mpSplitSet->mvItems.size();
- mpLastSizes = new tools::Long[nItems*2];
+ mpLastSizes.reset(new tools::Long[nItems*2]);
for ( sal_uInt16 i = 0; i < nItems; i++ )
{
mpLastSizes[i*2] = rItems[i].mnSize;
@@ -2012,8 +2012,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
- delete [] mpLastSizes;
- mpLastSizes = nullptr;
+ mpLastSizes.reset();
mpSplitSet = nullptr;
mnMouseOff = 0;
mnMStartPos = 0;
More information about the Libreoffice-commits
mailing list