diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-01-19 14:37:38 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-01-19 14:37:38 +0000 |
commit | 6c2d5a2f59fd725ef2c279eaf74a606052d080da (patch) | |
tree | 6d760f8b6e56e2d8ca67e12605467fd39084059c /forms/source/component/FormattedFieldWrapper.cxx | |
parent | a925efdce202032d2e97bb8b00e46ca93130d788 (diff) |
INTEGRATION: CWS dba202e (1.10.38); FILE MERGED
2006/01/04 11:01:27 fs 1.10.38.2: #i59877# read: ensure that temporary reader objects are not destroyed too early
2005/12/08 13:44:42 fs 1.10.38.1: #114920# write: recognize inconsistencies between m_pEditPart and m_xFormattedPart, even if they should never happen ...
Diffstat (limited to 'forms/source/component/FormattedFieldWrapper.cxx')
-rw-r--r-- | forms/source/component/FormattedFieldWrapper.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx index 3ce6a4108971..a29a3a7fa92d 100644 --- a/forms/source/component/FormattedFieldWrapper.cxx +++ b/forms/source/component/FormattedFieldWrapper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: FormattedFieldWrapper.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: rt $ $Date: 2005-09-08 22:41:04 $ + * last change: $Author: obo $ $Date: 2006-01-19 15:37:38 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -149,7 +149,10 @@ OFormattedFieldWrapper::OFormattedFieldWrapper( const OFormattedFieldWrapper* _p query_interface( Reference< XInterface >( xClone.get() ), m_xFormattedPart ); if ( _pCloneSource->m_pEditPart ) + { m_pEditPart = new OEditModel( _pCloneSource->m_pEditPart, _pCloneSource->m_xServiceFactory ); + m_pEditPart->acquire(); + } } if ( m_xAggregate.is() ) { // has to be in it's own block because of the temporary variable created by *this @@ -271,6 +274,8 @@ void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream> // else we have to write an edit part first DBG_ASSERT(m_pEditPart, "OFormattedFieldWrapper::write : formatted part without edit part ?"); + if ( !m_pEditPart ) + throw RuntimeException( ::rtl::OUString(), *this ); // for this we transfer the current props of the formatted part to the edit part Reference<XPropertySet> xFormatProps(m_xFormattedPart, UNO_QUERY); @@ -333,6 +338,7 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>& // let an OEditModel do the reading OEditModel* pBasicReader = new OEditModel(m_xServiceFactory); + Reference< XInterface > xHoldBasicReaderAlive( *pBasicReader ); pBasicReader->read(_rxInStream); // was it really an edit model ? @@ -344,6 +350,7 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>& // let the formmatted model do the reading OFormattedModel* pFormattedReader = new OFormattedModel(m_xServiceFactory); + Reference< XInterface > xHoldAliveWhileRead( *pFormattedReader ); pFormattedReader->read(_rxInStream); // for the next write (if any) : the FormattedModel and the EditModel parts @@ -401,7 +408,7 @@ void OFormattedFieldWrapper::ensureAggregate() Reference< XServiceInfo > xSI(m_xAggregate, UNO_QUERY); if (!xSI.is()) { - DBG_ERROR("OFormattedFieldWrapper::ensureAggregate: the aggregate has nbo XServiceInfo!"); + DBG_ERROR("OFormattedFieldWrapper::ensureAggregate: the aggregate has no XServiceInfo!"); m_xAggregate.clear(); } } |