From 31557bd63dd57b8ec5d68fe3d40f4c5c064a6dee Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 11 Oct 2001 06:47:22 +0000 Subject: #92510#: avoid element not loaded exception --- sot/source/sdstor/ucbstorage.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sot/source') diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index cba522ae8b32..18cd35c58741 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -291,6 +291,8 @@ struct UCBStorageElement_Impl String GetContentType(); void SetContentType( const String& ); String GetOriginalContentType(); + BOOL IsLoaded() + { return m_xStream.Is() || m_xStorage.Is(); } }; ::ucb::Content* UCBStorageElement_Impl::GetContent() @@ -1483,7 +1485,7 @@ sal_Int16 UCBStorage_Impl::Commit() pContent->setPropertyValue( ::rtl::OUString::createFromAscii("Title"), aAny ); } - if ( pElement->GetContentType() != pElement->GetOriginalContentType() ) + if ( pElement->IsLoaded() && pElement->GetContentType() != pElement->GetOriginalContentType() ) { // errors will be caught in the "catch" statement outside the loop nRet = COMMIT_RESULT_SUCCESS; -- cgit