[Libreoffice-commits] core.git: 2 commits - chart2/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Jun 11 06:27:26 UTC 2018
chart2/source/controller/dialogs/tp_AxisLabel.cxx | 5 ++---
chart2/source/controller/dialogs/tp_AxisLabel.hxx | 2 +-
chart2/source/inc/WrappedPropertySet.hxx | 5 +++--
chart2/source/tools/WrappedPropertySet.cxx | 16 ++++++++--------
4 files changed, 14 insertions(+), 14 deletions(-)
New commits:
commit 4190daa52e6403f722bed25e16fe7bd9a199f2ab
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Jun 4 16:28:08 2018 +0200
loplugin:useuniqueptr in SchAxisLabelTabPage
Change-Id: Icf91f59f1b874820ce707317e5deaf386fb9dbe5
Reviewed-on: https://gerrit.libreoffice.org/55527
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index ae0006c53c2c..f715259c75ca 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -59,7 +59,7 @@ SchAxisLabelTabPage::SchAxisLabelTabPage( vcl::Window* pParent, const SfxItemSet
get(m_pLbTextDirection,"textdirLB");
get(m_pFtABCD,"labelABCD");
m_pCtrlDial->SetText(m_pFtABCD->GetText());
- m_pOrientHlp = new svx::OrientationHelper(*m_pCtrlDial, *m_pNfRotate, *m_pCbStacked);
+ m_pOrientHlp.reset(new svx::OrientationHelper(*m_pCtrlDial, *m_pNfRotate, *m_pCbStacked));
m_pOrientHlp->Enable();
m_pCbStacked->EnableTriState( false );
@@ -76,8 +76,7 @@ SchAxisLabelTabPage::~SchAxisLabelTabPage()
void SchAxisLabelTabPage::dispose()
{
- delete m_pOrientHlp;
- m_pOrientHlp = nullptr;
+ m_pOrientHlp.reset();
m_pCbShowDescription.clear();
m_pFlOrder.clear();
m_pRbSideBySide.clear();
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
index b260f6dba922..52137a80f5b5 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
@@ -49,7 +49,7 @@ private:
VclPtr<FixedText> m_pFtRotate;
VclPtr<NumericField> m_pNfRotate;
VclPtr<TriStateBox> m_pCbStacked;
- svx::OrientationHelper* m_pOrientHlp;
+ std::unique_ptr<svx::OrientationHelper> m_pOrientHlp;
VclPtr<FixedText> m_pFtTextDirection;
VclPtr<TextDirectionListBox> m_pLbTextDirection;
commit 8955578f2cd3b0b20247d489dbceb71abbf6adf3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Jun 4 16:27:08 2018 +0200
loplugin:useuniqueptr in WrappedPropertySet
Change-Id: I08f00c00b22c6a680ec59d2e86eb035c58b17609
Reviewed-on: https://gerrit.libreoffice.org/55526
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/chart2/source/inc/WrappedPropertySet.hxx b/chart2/source/inc/WrappedPropertySet.hxx
index dd70bed2cde2..a0398bafe180 100644
--- a/chart2/source/inc/WrappedPropertySet.hxx
+++ b/chart2/source/inc/WrappedPropertySet.hxx
@@ -30,6 +30,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/propshlp.hxx>
+#include <memory>
#include <vector>
namespace chart
@@ -105,9 +106,9 @@ protected: //methods
protected: //member
css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo;//outer PropertySetInfo
- ::cppu::OPropertyArrayHelper* m_pPropertyArrayHelper;//holds all possible outer properties
+ std::unique_ptr<::cppu::OPropertyArrayHelper> m_pPropertyArrayHelper;//holds all possible outer properties
- tWrappedPropertyMap* m_pWrappedPropertyMap;//holds all wrapped properties (containing the special mapping from inner to outer properties)
+ std::unique_ptr<tWrappedPropertyMap> m_pWrappedPropertyMap;//holds all wrapped properties (containing the special mapping from inner to outer properties)
//Container for the XProperyChangedListener. The listeners are inserted by handle.
//OMultiTypeInterfaceContainerHelperInt32 m_aBoundListenerContainer;
diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx
index 72c296ea6185..8ffe2e27b04f 100644
--- a/chart2/source/tools/WrappedPropertySet.cxx
+++ b/chart2/source/tools/WrappedPropertySet.cxx
@@ -61,8 +61,8 @@ void WrappedPropertySet::clearWrappedPropertySet()
}
}
- DELETEZ(m_pPropertyArrayHelper);
- DELETEZ(m_pWrappedPropertyMap);
+ m_pPropertyArrayHelper.reset();
+ m_pWrappedPropertyMap.reset();
m_xInfo = nullptr;
}
@@ -393,16 +393,16 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence
::cppu::IPropertyArrayHelper& WrappedPropertySet::getInfoHelper()
{
- ::cppu::OPropertyArrayHelper* p = m_pPropertyArrayHelper;
+ ::cppu::OPropertyArrayHelper* p = m_pPropertyArrayHelper.get();
if(!p)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
- p = m_pPropertyArrayHelper;
+ p = m_pPropertyArrayHelper.get();
if(!p)
{
p = new ::cppu::OPropertyArrayHelper( getPropertySequence(), true );
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- m_pPropertyArrayHelper = p;
+ m_pPropertyArrayHelper.reset(p);
}
}
else
@@ -414,11 +414,11 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence
tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap()
{
- tWrappedPropertyMap* p = m_pWrappedPropertyMap;
+ tWrappedPropertyMap* p = m_pWrappedPropertyMap.get();
if(!p)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
- p = m_pWrappedPropertyMap;
+ p = m_pWrappedPropertyMap.get();
if(!p)
{
std::vector< WrappedProperty* > aPropList( createWrappedProperties() );
@@ -447,7 +447,7 @@ tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap()
}
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- m_pWrappedPropertyMap = p;
+ m_pWrappedPropertyMap.reset(p);
}
}
else
More information about the Libreoffice-commits
mailing list