summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-07-09 11:22:00 +0200
committerNoel Grandin <noel@peralex.com>2014-07-10 11:04:13 +0200
commit0ae79a13686f2c17e6e4bda89b21fe78b5466201 (patch)
treeb3bc5466963f24ba753a6075d3c102bba6545017 /sot
parente656d583e7fd9b7d2b1bbe2d8716e75ab2023c2c (diff)
use SimpleReferenceObject in StgPage
to replace hand-rolled version Change-Id: I5301ef1df786b08b3c5d585a366d95722506f220
Diffstat (limited to 'sot')
-rw-r--r--sot/Library_sot.mk1
-rw-r--r--sot/source/sdstor/stgcache.cxx3
-rw-r--r--sot/source/sdstor/stgcache.hxx18
3 files changed, 5 insertions, 17 deletions
diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk
index d741127e3e30..97381d0a88f5 100644
--- a/sot/Library_sot.mk
+++ b/sot/Library_sot.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_Library_use_libraries,sot,\
cppu \
cppuhelper \
sal \
+ salhelper \
i18nlangtag \
tl \
ucbhelper \
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index e82adf31920a..661f1554d050 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -37,8 +37,7 @@
// the correctness of the I/O.
StgPage::StgPage( short nSize, sal_Int32 nPage )
- : mnRefCount( 0 )
- , mnPage( nPage )
+ : mnPage( nPage )
, mpData( new sal_uInt8[ nSize ] )
, mnSize( nSize )
{
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index 79d28409d77b..4a71279d4e5c 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -27,6 +27,7 @@
#include <stgelem.hxx>
#include <boost/noncopyable.hpp>
#include <boost/unordered_map.hpp>
+#include <salhelper/simplereferenceobject.hxx>
class UCBStorageStream;
class StgPage;
@@ -95,8 +96,8 @@ public:
void Clear(); // clear the cache
};
-class StgPage : public rtl::IReference, private boost::noncopyable {
- sal_uInt32 mnRefCount;
+class StgPage : public salhelper::SimpleReferenceObject, private boost::noncopyable
+{
const sal_Int32 mnPage; // page index
sal_uInt8* mpData; // nSize bytes
short mnSize; // size of this page
@@ -110,19 +111,6 @@ public:
short GetSize() { return mnSize; }
public:
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE
- {
- return ++mnRefCount;
- }
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE
- {
- if ( --mnRefCount == 0)
- {
- delete this;
- return 0;
- }
- return mnRefCount;
- }
static bool IsPageGreater( const StgPage *pA, const StgPage *pB );
};