summaryrefslogtreecommitdiff
path: root/forms/source/richtext/richtextmodel.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2007-07-06 08:56:54 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2007-07-06 08:56:54 +0000
commit98f8b561a2dd53ac691a42e5eed2b486ee128a8d (patch)
treed69ad984226c7c3d473a7c932999c6cca9459d20 /forms/source/richtext/richtextmodel.cxx
parentd2876b50feb499e3313f67be464eeee4d0f9ceb0 (diff)
INTEGRATION: CWS oj14 (1.11.38); FILE MERGED
2007/04/18 09:12:41 oj 1.11.38.2: RESYNC: (1.11-1.12); FILE MERGED 2007/01/25 07:55:11 oj 1.11.38.1: memory leak fixed
Diffstat (limited to 'forms/source/richtext/richtextmodel.cxx')
-rw-r--r--forms/source/richtext/richtextmodel.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx
index 60dd23fd9209..32182964df97 100644
--- a/forms/source/richtext/richtextmodel.cxx
+++ b/forms/source/richtext/richtextmodel.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: richtextmodel.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: obo $ $Date: 2007-03-09 13:36:05 $
+ * last change: $Author: rt $ $Date: 2007-07-06 09:56:54 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -165,7 +165,7 @@ namespace frm
m_nMaxTextLength = _pOriginal->m_nMaxTextLength;
m_bMultiLine = _pOriginal->m_bMultiLine;
- m_pEngine = _pOriginal->m_pEngine->Clone();
+ m_pEngine.reset(_pOriginal->m_pEngine->Clone());
m_sLastKnownEngineText = m_pEngine->GetText();
implInit();
@@ -174,8 +174,8 @@ namespace frm
//------------------------------------------------------------------
void ORichTextModel::implInit()
{
- OSL_ENSURE( m_pEngine, "ORichTextModel::implInit: where's the engine?" );
- if ( m_pEngine )
+ OSL_ENSURE( m_pEngine.get(), "ORichTextModel::implInit: where's the engine?" );
+ if ( m_pEngine.get() )
{
m_pEngine->SetModifyHdl( LINK( this, ORichTextModel, OnEngineContentModified ) );
@@ -246,6 +246,12 @@ namespace frm
acquire();
dispose();
}
+ if ( m_pEngine.get() )
+ {
+ ::std::auto_ptr<SfxItemPool> pPool(m_pEngine->getPool());
+ m_pEngine.reset();
+ }
+
DBG_DTOR( ORichTextModel, NULL );
}
@@ -483,7 +489,7 @@ namespace frm
//--------------------------------------------------------------------
void ORichTextModel::impl_smlock_setEngineText( const ::rtl::OUString& _rText )
{
- if ( m_pEngine )
+ if ( m_pEngine.get() )
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
m_bSettingEngineText = true;
@@ -573,7 +579,7 @@ namespace frm
if ( ( _rId.getLength() == aEditEngineAccessId.getLength() )
&& ( 0 == rtl_compareMemory( aEditEngineAccessId.getConstArray(), _rId.getConstArray(), _rId.getLength() ) )
)
- return reinterpret_cast< sal_Int64 >( m_pEngine );
+ return reinterpret_cast< sal_Int64 >( m_pEngine.get() );
Reference< XUnoTunnel > xAggTunnel;
if ( query_aggregation( m_xAggregate, xAggTunnel ) )
@@ -598,7 +604,7 @@ namespace frm
void ORichTextModel::potentialTextChange( )
{
::rtl::OUString sCurrentEngineText;
- if ( m_pEngine )
+ if ( m_pEngine.get() )
sCurrentEngineText = m_pEngine->GetText();
if ( sCurrentEngineText != m_sLastKnownEngineText )