From a8f1ad65612c0e54969cabc541b183062ae3d905 Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Wed, 28 Jul 2010 14:17:26 +0200 Subject: [PATCH 1/2] writerfilter08ooo330: applied patch for writerfilter08 --- sfx2/source/doc/sfxbasemodel.cxx | 6 ++++++ sfx2/source/view/frame2.cxx | 5 +---- sfx2/source/view/viewfrm.cxx | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b5a9536b12c5..7ef9fe0d2f19 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -977,6 +977,8 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& aArgs.remove( "BreakMacroSignature" ); aArgs.remove( "Stream" ); aArgs.remove( "InputStream" ); + aArgs.remove( "URL" ); + aArgs.remove( "Frame" ); // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here @@ -988,6 +990,10 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& SfxAllItemSet aSet( pObjectShell->GetPool() ); TransformParameters( SID_OPENDOC, rArgs, aSet ); + // the arguments are not allowed to reach the medium + aSet.ClearItem( SID_FILE_NAME ); + aSet.ClearItem( SID_FILLFRAME ); + pMedium->GetItemSet()->Put( aSet ); SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False ); if ( pItem ) diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index d99ad8733e03..d43512ac791d 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -280,10 +280,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI aLoadArgs = aArgs.getPropertyValues(); // load the doc into that frame - ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() ); - if ( sLoaderURL.getLength() == 0 ) - sLoaderURL = rDoc.GetFactory().GetFactoryURL(); - + ::rtl::OUString sLoaderURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sLoaderURL, diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 035fd3f794de..feced28efb11 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2144,6 +2144,8 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc aTransformLoadArgs.remove( "Hidden" ); ::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); + if ( !sURL.getLength() ) + sURL = i_rDoc.GetFactory().GetFactoryURL(); Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0, From a18c6fe8f3f353d78f58563d8d39bf4c922712ac Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 29 Jul 2010 13:49:40 +0200 Subject: [PATCH 2/2] writerfilter08ooo300: #i112415# on reload the filter should not set document readonly --- sfx2/source/view/viewfrm.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index feced28efb11..ed924623c700 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -813,6 +813,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) xNewObj->SetModifyPasswordEntered( sal_False ); xNewObj->SetReadOnly(); } + else if ( rReq.GetSlot() == SID_EDITDOC && bForEdit && !xNewObj->IsReadOnlyMedium() ) + { + // the filter might request setting of the document to readonly state + // but in case of SID_EDITDOC it should not happen if the document + // can be opened for editing + xNewObj->SetReadOnlyUI( sal_False ); + } if ( xNewObj->IsDocShared() ) {