summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/laycache.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-05-12 15:32:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-05-15 08:45:17 +0200
commit5e7583fe864c4491c5a19d2896b6555448146ad8 (patch)
treed7b34190055d5d2348346cdeaf139f5318ba5e78 /sw/source/core/layout/laycache.cxx
parent4582acb3eeb2af0411ab8598ec17d74381225acf (diff)
loplugin:useuniqueptr
ignore SAL_LOG type stuff in the destructor Change-Id: If014382ca0c96edd3f2b325a28451d83b3d1f278 Reviewed-on: https://gerrit.libreoffice.org/37539 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/layout/laycache.cxx')
-rw-r--r--sw/source/core/layout/laycache.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 251651fdbbe4..ab8f0e361841 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -47,6 +47,8 @@
using namespace ::com::sun::star;
+SwLayoutCache::SwLayoutCache() : nLockCount( 0 ) {}
+
/*
* Reading and writing of the layout cache.
* The layout cache is not necessary, but it improves
@@ -62,11 +64,10 @@ void SwLayoutCache::Read( SvStream &rStream )
{
if( !pImpl )
{
- pImpl = new SwLayCacheImpl;
+ pImpl.reset( new SwLayCacheImpl );
if( !pImpl->Read( rStream ) )
{
- delete pImpl;
- pImpl = nullptr;
+ pImpl.reset();
}
}
}
@@ -429,15 +430,13 @@ void SwLayoutCache::ClearImpl()
{
if( !IsLocked() )
{
- delete pImpl;
- pImpl = nullptr;
+ pImpl.reset();
}
}
SwLayoutCache::~SwLayoutCache()
{
OSL_ENSURE( !nLockCount, "Deleting a locked SwLayoutCache!?" );
- delete pImpl;
}
/// helper class to create not nested section frames for nested sections.