summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-13 16:17:00 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-08-03 06:37:16 +0000
commit2660d24a07866e083c5135ea263030f3e3a2e729 (patch)
tree0089d6018d4fc33a7fde955e585e77191cdd258b /sd
parentbaba1d14766282bd2c592bffd79ed69f9078cfe1 (diff)
new loplugin: refcounting
This was a feature requested by mmeeks, as a result of tdf#92611. It validates that things that extend XInterface are not directly heap/stack-allocated, but have their lifecycle managed via css::uno::Reference or rtl::Reference. Change-Id: I28e3b8b236f6a4a56d0a6d6f26ad54e44b36e692 Reviewed-on: https://gerrit.libreoffice.org/16924 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/EventMultiplexer.hxx3
-rw-r--r--sd/source/ui/tools/EventMultiplexer.cxx6
-rw-r--r--sd/source/ui/view/drviews5.cxx2
3 files changed, 3 insertions, 8 deletions
diff --git a/sd/source/ui/inc/EventMultiplexer.hxx b/sd/source/ui/inc/EventMultiplexer.hxx
index 50ad82333628..fc1a5c9ab46d 100644
--- a/sd/source/ui/inc/EventMultiplexer.hxx
+++ b/sd/source/ui/inc/EventMultiplexer.hxx
@@ -22,6 +22,7 @@
#include <svl/lstner.hxx>
#include <tools/link.hxx>
+#include <com/sun/star/uno/Reference.hxx>
#include <set>
#include <memory>
@@ -204,7 +205,7 @@ public:
private:
class Implementation;
- ::std::unique_ptr<Implementation> mpImpl;
+ css::uno::Reference<Implementation> mpImpl;
};
} } // end of namespace ::sd::tools
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index 4ccb5ad49683..2b3d4ef0c3f7 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -174,12 +174,6 @@ EventMultiplexer::~EventMultiplexer()
try
{
mpImpl->dispose();
- // Now we call release twice. One decreases the use count of the
- // implementation object (if all goes well to zero and thus deletes
- // it.) The other releases the unique_ptr and prevents the
- // implementation object from being deleted a second time.
- mpImpl->release();
- mpImpl.release();
}
catch (const RuntimeException&)
{
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index f0f97198b312..71d60ae94c7c 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -579,7 +579,7 @@ void DrawViewShell::SetActiveTabLayerIndex (int nIndex)
// Tell the draw view and the tab control of the new active layer.
mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId ((sal_uInt16)nIndex)));
pBar->SetCurPageId (pBar->GetPageId ((sal_uInt16)nIndex));
- boost::scoped_ptr<SdUnoDrawView> pUnoDrawView(new SdUnoDrawView (
+ css::uno::Reference<SdUnoDrawView> pUnoDrawView(new SdUnoDrawView (
*this,
*GetView()));
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> rLayer = pUnoDrawView->getActiveLayer();