From 6b36e9cc9577bd97786f11ff1c3694cee2c0a9a3 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 4 Nov 2005 14:49:23 +0000 Subject: INTEGRATION: CWS fwk25 (1.98.16); FILE MERGED 2005/11/01 17:36:52 mba 1.98.16.3: #i55787#: storage change wasn't notified 2005/10/31 16:21:09 mba 1.98.16.2: #i55787#: no OwnerLock used anymore for hidden documents 2005/10/17 09:31:52 mba 1.98.16.1: #i55787#: SID_OPENDOC can return two types of items --- sfx2/source/appl/appopen.cxx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index fe5a3aadf40f..b44a8b5883c5 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -4,9 +4,9 @@ * * $RCSfile: appopen.cxx,v $ * - * $Revision: 1.98 $ + * $Revision: 1.99 $ * - * last change: $Author: hr $ $Date: 2005-09-23 15:51:06 $ + * last change: $Author: kz $ $Date: 2005-11-04 15:49:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -181,6 +181,7 @@ #include "objface.hxx" #include "filedlghelper.hxx" #include "docfac.hxx" +#include "event.hxx" #define _SVSTDARR_STRINGSDTOR #include @@ -466,10 +467,21 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil SfxBoolItem aHidden( SID_HIDDEN, TRUE ); const SfxPoolItem *pRet = GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aName, &aHidden, &aReferer, &aFlags, 0L ); const SfxObjectItem *pObj = PTR_CAST( SfxObjectItem, pRet ); - xDoc = PTR_CAST( SfxObjectShell, pObj->GetShell() ); + if ( pObj ) + xDoc = PTR_CAST( SfxObjectShell, pObj->GetShell() ); + else + { + const SfxViewFrameItem *pView = PTR_CAST( SfxViewFrameItem, pRet ); + if ( pView ) + { + SfxViewFrame *pFrame = pView->GetFrame(); + if ( pFrame ) + xDoc = pFrame->GetObjectShell(); + } + } + if ( !xDoc.Is() ) return ERRCODE_SFX_DOLOADFAILED; - xDoc->OwnerLock( FALSE ); // lock was set by hidden load } else { @@ -502,6 +514,7 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil //REMOVE xDoc->DoHandsOff(); if ( !xDoc->DoSaveCompleted( new SfxMedium( xTempStorage, String() ) ) ) throw uno::RuntimeException(); + NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, xDoc ) ); } catch( uno::Exception& ) { -- cgit v1.2.3