INTEGRATION: CWS fwk97_DEV300 (1.76.42); FILE MERGED

2008/08/22 14:43:11 mst 1.76.42.1: workaround for 158429 (stack id 6011):
- sfx2/source/doc/doctemplates.cxx:
  + SfxDocTplService_Impl::init_Impl:
    handle exceptions thrown by failing DocumentProperties creation
    (there have been 20 crash reports on this last week)
- sfx2/source/doc/objcont.cxx:
  + SfxObjectShell::UpdateFromTemplate_Impl: handle similar case here as well
This commit is contained in:
Rüdiger Timm 2008-08-27 13:42:36 +00:00
parent 3a84f83343
commit 2964087da5

View file

@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: objcont.cxx,v $
* $Revision: 1.77 $
* $Revision: 1.78 $
*
* This file is part of OpenOffice.org.
*
@ -1266,27 +1266,27 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
// load document info of template
BOOL bOK = FALSE;
util::DateTime aTemplDate;
Reference < document::XStandaloneDocumentInfo > xDocInfo (
::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.StandaloneDocumentInfo") ) ), UNO_QUERY );
Reference < beans::XFastPropertySet > xSet( xDocInfo, UNO_QUERY );
if ( xDocInfo.is() && xSet.is() )
try
{
try
{
xDocInfo->loadFromURL( aTemplURL );
Any aAny = xSet->getFastPropertyValue( WID_DATE_MODIFIED );
::com::sun::star::util::DateTime aTmp;
if ( aAny >>= aTemplDate )
{
// get modify date from document info
bOK = TRUE;
}
}
catch ( Exception& )
Reference < document::XStandaloneDocumentInfo > xDocInfo (
::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.document.StandaloneDocumentInfo") ) ),
UNO_QUERY_THROW );
Reference < beans::XFastPropertySet > xSet( xDocInfo,
UNO_QUERY_THROW );
xDocInfo->loadFromURL( aTemplURL );
Any aAny = xSet->getFastPropertyValue( WID_DATE_MODIFIED );
::com::sun::star::util::DateTime aTmp;
if ( aAny >>= aTemplDate )
{
// get modify date from document info
bOK = TRUE;
}
}
catch ( Exception& )
{
}
// if modify date was read successfully
if ( bOK )