summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/control/bindings.cxx11
-rw-r--r--sfx2/source/control/statcach.cxx23
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/doc/objmisc.cxx23
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sfx2/source/doc/objstor.cxx8
-rw-r--r--sfx2/source/inc/statcach.hxx7
7 files changed, 57 insertions, 19 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index daa8412933..487c460de6 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1544,8 +1544,17 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
if ( pCache && pCache->GetDispatch().is() )
{
+ DBG_ASSERT( !ppInternalArgs, "Internal args get lost when dispatched!" );
+
+ SfxItemPool &rPool = GetDispatcher()->GetFrame()->GetObjectShell()->GetPool();
+ SfxRequest aReq( nId, nCallMode, rPool );
+ aReq.SetModifier( nModi );
+ if( ppItems )
+ while( *ppItems )
+ aReq.AppendItem( **ppItems++ );
+
// cache binds to an external dispatch provider
- pCache->Dispatch( nCallMode == SFX_CALLMODE_SYNCHRON );
+ pCache->Dispatch( aReq.GetArgs(), nCallMode == SFX_CALLMODE_SYNCHRON );
if ( bDeleteCache )
DELETEZ( pCache );
SfxPoolItem *pVoid = new SfxVoidItem( nId );
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index 4770c51fd9..795fb5e9be 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: statcach.cxx,v $
- * $Revision: 1.36 $
+ * $Revision: 1.36.180.1 $
*
* This file is part of OpenOffice.org.
*
@@ -44,6 +44,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/FrameActionEvent.hpp>
#include <com/sun/star/frame/FrameAction.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <cppuhelper/weak.hxx>
#include <svtools/eitem.hxx>
#include <svtools/intitem.hxx>
@@ -55,6 +56,7 @@
#endif
#include <sfx2/app.hxx>
+#include <sfx2/appuno.hxx>
#include "statcach.hxx"
#include <sfx2/msg.hxx>
#include <sfx2/ctrlitem.hxx>
@@ -65,6 +67,7 @@
#include <sfx2/msgpool.hxx>
#include <sfx2/viewfrm.hxx>
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
@@ -191,13 +194,14 @@ const ::com::sun::star::frame::FeatureStateEvent& BindDispatch_Impl::GetStatus()
return aStatus;
}
-void BindDispatch_Impl::Dispatch( sal_Bool bForceSynchron )
+void BindDispatch_Impl::Dispatch( uno::Sequence < beans::PropertyValue > aProps, sal_Bool bForceSynchron )
{
if ( xDisp.is() && aStatus.IsEnabled )
{
- ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > aProps(1);
- aProps.getArray()[0].Name = DEFINE_CONST_UNICODE("SynchronMode");
- aProps.getArray()[0].Value <<= bForceSynchron ;
+ sal_Int32 nLength = aProps.getLength();
+ aProps.realloc(nLength+1);
+ aProps[nLength].Name = DEFINE_CONST_UNICODE("SynchronMode");
+ aProps[nLength].Value <<= bForceSynchron ;
xDisp->dispatch( aURL, aProps );
}
}
@@ -560,12 +564,17 @@ void SfxStateCache::DeleteFloatingWindows()
return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > ();
}
-void SfxStateCache::Dispatch( sal_Bool bForceSynchron )
+void SfxStateCache::Dispatch( const SfxItemSet* pSet, sal_Bool bForceSynchron )
{
// protect pDispatch against destruction in the call
::com::sun::star::uno::Reference < ::com::sun::star::frame::XStatusListener > xKeepAlive( pDispatch );
if ( pDispatch )
- pDispatch->Dispatch( bForceSynchron );
+ {
+ uno::Sequence < beans::PropertyValue > aArgs;
+ if (pSet)
+ TransformItems( nId, *pSet, aArgs );
+ pDispatch->Dispatch( aArgs, bForceSynchron );
+ }
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c74072b901..7735d5acbc 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1188,7 +1188,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
}
// TODO/LATER: This implementation does not allow to detect the system lock on saving here, actually this is no big problem
- if ( bUseSystemLock && !pImp->xStream.is() && !pOutStream )
+ if ( bLoading && bUseSystemLock && !pImp->xStream.is() && !pOutStream )
pImp->m_bHandleSysLocked = sal_True; // if system lock is used the writeable stream should be available
do
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 6d843892f4..de0f50064a 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -535,10 +535,30 @@ sal_Bool SfxObjectShell::SwitchToShared( sal_Bool bShared, sal_Bool bSave )
if ( bShared != IsDocShared() )
{
+ ::rtl::OUString aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
+
+ if ( !aOrigURL.getLength() && bSave )
+ {
+ // this is a new document, let it be stored before switching to the shared mode;
+ // the storing should be done without shared flag, since it is possible that the
+ // target location does not allow to create sharing control file;
+ // the shared flag will be set later after creation of sharing control file
+ SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst( this );
+
+ if ( pViewFrame )
+ {
+ // TODO/LATER: currently the application guards against the reentrance problem
+ const SfxPoolItem* pItem = pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : SID_SAVEASDOC );
+ SfxBoolItem* pResult = PTR_CAST( SfxBoolItem, pItem );
+ bResult = ( pResult && pResult->GetValue() );
+ if ( bResult )
+ aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
+ }
+ }
+
sal_Bool bOldValue = HasSharedXMLFlagSet();
SetSharedXMLFlag( bShared );
- ::rtl::OUString aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
sal_Bool bRemoveEntryOnError = sal_False;
if ( bResult && bShared )
{
@@ -561,6 +581,7 @@ sal_Bool SfxObjectShell::SwitchToShared( sal_Bool bShared, sal_Bool bSave )
if ( pViewFrame )
{
// TODO/LATER: currently the application guards against the reentrance problem
+ SetModified( sal_True ); // the modified flag has to be set to let the document be stored with the shared flag
const SfxPoolItem* pItem = pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : SID_SAVEASDOC );
SfxBoolItem* pResult = PTR_CAST( SfxBoolItem, pItem );
bResult = ( pResult && pResult->GetValue() );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 8881ce5bf5..83dcf99202 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1304,7 +1304,7 @@ sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent )
{
*pState = SIGNATURESTATE_NOSIGNATURES;
- if ( GetMedium() && GetMedium()->GetName().Len() && GetMedium()->GetStorage().is() && IsOwnStorageFormat_Impl( *GetMedium()) )
+ if ( GetMedium() && GetMedium()->GetName().Len() && IsOwnStorageFormat_Impl( *GetMedium()) && GetMedium()->GetStorage().is() )
{
try
{
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 2b6222b189..5ec9580185 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1317,16 +1317,14 @@ sal_Bool SfxObjectShell::SaveTo_Impl
else
{
// This is SaveAs or export action, prepare the target medium
+ // the alien filters still might write directly to the file, that is of course a bug,
+ // but for now the framework has to be ready for it
+ // TODO/LATER: let the medium be prepared for alien formats as well
rMedium.CloseAndRelease();
if ( bStorageBasedTarget )
{
rMedium.GetOutputStorage();
}
- else
- {
- rMedium.CreateTempFileNoCopy();
- rMedium.GetOutStream();
- }
}
// TODO/LATER: error handling
diff --git a/sfx2/source/inc/statcach.hxx b/sfx2/source/inc/statcach.hxx
index 5a3980665b..630b4b6ee6 100644
--- a/sfx2/source/inc/statcach.hxx
+++ b/sfx2/source/inc/statcach.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: statcach.hxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.10.180.1 $
*
* This file is part of OpenOffice.org.
*
@@ -38,6 +38,7 @@
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/frame/FeatureStateEvent.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <cppuhelper/weak.hxx>
#ifndef _SFXBINDINGS_HXX
@@ -76,7 +77,7 @@ public:
void Release();
const ::com::sun::star::frame::FeatureStateEvent& GetStatus() const;
- void Dispatch( sal_Bool bForceSynchron = sal_False );
+ void Dispatch( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aProps, sal_Bool bForceSynchron = sal_False );
};
class SfxStateCache
@@ -109,7 +110,7 @@ public:
const SfxSlotServer* GetSlotServer( SfxDispatcher &rDispat )
{ return GetSlotServer( rDispat, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > () ); }
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > GetDispatch() const;
- void Dispatch( sal_Bool bForceSynchron = sal_False );
+ void Dispatch( const SfxItemSet* pSet, sal_Bool bForceSynchron = sal_False );
sal_Bool IsControllerDirty() const
{ return bCtrlDirty ? sal_True : sal_False; }
SfxPoolItem* GetItem() const { return pLastItem; }