diff options
author | Noel Grandin <noel@peralex.com> | 2016-06-01 16:22:29 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-06 07:01:34 +0000 |
commit | 0323253a7c67316cb96e4a64792ab4fe74aac1ca (patch) | |
tree | 81787c4ae44ff778aa41e12574cd60a624c9277b /svtools/source/uno/unoiface.cxx | |
parent | 4d666f5092d7c4f2ece9702dda4d874e44cdc6f7 (diff) |
remove some manual ref-counting
triggered when I noticed a class doing acquire() in the
constructor and then release() in the destructor.
found mostly by
git grep -n -B5 -e '->release()'
Change-Id: I96e43a3d30ffd9ae9a34275f24cd914d8f7b026f
Reviewed-on: https://gerrit.libreoffice.org/25806
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source/uno/unoiface.cxx')
-rw-r--r-- | svtools/source/uno/unoiface.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index 595106ee2f7c..0e14c9a78375 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -810,8 +810,7 @@ void VCLXFileControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) SVTXFormattedField::SVTXFormattedField() - :m_pCurrentSupplier(nullptr) - ,bIsStandardSupplier(true) + :bIsStandardSupplier(true) ,nKeyToSetDelayed(-1) { } @@ -819,11 +818,6 @@ SVTXFormattedField::SVTXFormattedField() SVTXFormattedField::~SVTXFormattedField() { - if (m_pCurrentSupplier) - { - m_pCurrentSupplier->release(); - m_pCurrentSupplier = nullptr; - } } @@ -1029,7 +1023,7 @@ css::uno::Any SVTXFormattedField::getProperty( const OUString& PropertyName ) th css::uno::Reference< css::util::XNumberFormatsSupplier > SVTXFormattedField::getFormatsSupplier() const { - return css::uno::Reference< css::util::XNumberFormatsSupplier > (m_pCurrentSupplier); + return m_xCurrentSupplier.get(); } css::uno::Any SVTXFormattedField::convertEffectiveValue(const css::uno::Any& rValue) @@ -1317,15 +1311,12 @@ void SVTXFormattedField::setFormatsSupplier(const css::uno::Reference< css::util if (!pNew) return; // TODO : how to process ? - if (m_pCurrentSupplier) - m_pCurrentSupplier->release(); - m_pCurrentSupplier = pNew; - m_pCurrentSupplier->acquire(); + m_xCurrentSupplier = pNew; if (pField) { // save the actual value css::uno::Any aCurrent = GetValue(); - pField->SetFormatter(m_pCurrentSupplier->GetNumberFormatter(), false); + pField->SetFormatter(m_xCurrentSupplier->GetNumberFormatter(), false); if (nKeyToSetDelayed != -1) { pField->SetFormatKey(nKeyToSetDelayed); |