summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-04-26 14:41:07 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-04-26 14:41:07 -0400
commit109e2a783d029de8828cb980fd55441749e4a3f7 (patch)
tree50bfaebdf8d0f9e571f73777dca18c9a6618ca5e /sc
parent69da3e140d58a524ab43c8fbbadbd8b8bf9de262 (diff)
Ditto. Use rtl::Reference.
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/cellsuno.hxx3
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx32
2 files changed, 16 insertions, 19 deletions
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index c631569e24d0..9bf0b3b7460a 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -33,6 +33,7 @@
#include "rangelst.hxx" // ScRangeList
#include "formula/grammar.hxx"
+#include "rtl/ref.hxx"
#include <tools/link.hxx>
#include <svl/lstner.hxx>
#include <svl/listener.hxx>
@@ -833,7 +834,7 @@ class SC_DLLPUBLIC ScCellObj : public ScCellRangeObj,
public com::sun::star::document::XActionLockable
{
private:
- SvxUnoText* pUnoText;
+ rtl::Reference<SvxUnoText> mxUnoText;
const SfxItemPropertySet* pCellPropSet;
ScAddress aCellPos;
sal_Int16 nActionLockCount;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index dde5a44d5238..a916c6d48979 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -6107,7 +6107,6 @@ const SfxItemPropertyMap& ScCellObj::GetCellPropertyMap()
ScCellObj::ScCellObj(ScDocShell* pDocSh, const ScAddress& rP) :
ScCellRangeObj( pDocSh, ScRange(rP,rP) ),
- pUnoText( NULL ),
pCellPropSet( lcl_GetCellPropertySet() ),
aCellPos( rP ),
nActionLockCount( 0 )
@@ -6118,25 +6117,22 @@ ScCellObj::ScCellObj(ScDocShell* pDocSh, const ScAddress& rP) :
SvxUnoText& ScCellObj::GetUnoText()
{
- if (!pUnoText)
+ if (!mxUnoText.is())
{
- pUnoText = new ScCellTextObj( GetDocShell(), aCellPos );
- pUnoText->acquire();
+ mxUnoText.set(new ScCellTextObj(GetDocShell(), aCellPos));
if (nActionLockCount)
{
ScCellEditSource* pEditSource =
- static_cast<ScCellEditSource*> (pUnoText->GetEditSource());
+ static_cast<ScCellEditSource*> (mxUnoText->GetEditSource());
if (pEditSource)
pEditSource->SetDoUpdateData(false);
}
}
- return *pUnoText;
+ return *mxUnoText;
}
ScCellObj::~ScCellObj()
{
- if (pUnoText)
- pUnoText->release();
}
void ScCellObj::RefChanged()
@@ -6390,8 +6386,8 @@ void SAL_CALL ScCellObj::setString( const rtl::OUString& aText ) throw(uno::Runt
SetString_Impl(aString, false, false); // immer Text
// don't create pUnoText here if not there
- if (pUnoText)
- pUnoText->SetSelection(ESelection( 0,0, 0,aString.Len() ));
+ if (mxUnoText.is())
+ mxUnoText->SetSelection(ESelection( 0,0, 0,aString.Len() ));
}
void SAL_CALL ScCellObj::insertString( const uno::Reference<text::XTextRange>& xRange,
@@ -6831,10 +6827,10 @@ void SAL_CALL ScCellObj::addActionLock() throw(uno::RuntimeException)
SolarMutexGuard aGuard;
if (!nActionLockCount)
{
- if (pUnoText)
+ if (mxUnoText.is())
{
ScCellEditSource* pEditSource =
- static_cast<ScCellEditSource*> (pUnoText->GetEditSource());
+ static_cast<ScCellEditSource*> (mxUnoText->GetEditSource());
if (pEditSource)
pEditSource->SetDoUpdateData(false);
}
@@ -6850,10 +6846,10 @@ void SAL_CALL ScCellObj::removeActionLock() throw(uno::RuntimeException)
nActionLockCount--;
if (!nActionLockCount)
{
- if (pUnoText)
+ if (mxUnoText.is())
{
ScCellEditSource* pEditSource =
- static_cast<ScCellEditSource*> (pUnoText->GetEditSource());
+ static_cast<ScCellEditSource*> (mxUnoText->GetEditSource());
if (pEditSource)
{
pEditSource->SetDoUpdateData(sal_True);
@@ -6868,10 +6864,10 @@ void SAL_CALL ScCellObj::removeActionLock() throw(uno::RuntimeException)
void SAL_CALL ScCellObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
- if (pUnoText)
+ if (mxUnoText.is())
{
ScCellEditSource* pEditSource =
- static_cast<ScCellEditSource*> (pUnoText->GetEditSource());
+ static_cast<ScCellEditSource*> (mxUnoText->GetEditSource());
if (pEditSource)
{
pEditSource->SetDoUpdateData(nLock == 0);
@@ -6886,10 +6882,10 @@ sal_Int16 SAL_CALL ScCellObj::resetActionLocks() throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
sal_uInt16 nRet(nActionLockCount);
- if (pUnoText)
+ if (mxUnoText.is())
{
ScCellEditSource* pEditSource =
- static_cast<ScCellEditSource*> (pUnoText->GetEditSource());
+ static_cast<ScCellEditSource*> (mxUnoText->GetEditSource());
if (pEditSource)
{
pEditSource->SetDoUpdateData(sal_True);