summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Joachim Lankenau <hjs@openoffice.org>2010-12-17 17:08:13 +0100
committerHans-Joachim Lankenau <hjs@openoffice.org>2010-12-17 17:08:13 +0100
commite700990dc06cbfaedf796358c2acbbe9a57de276 (patch)
treeba67c07000df1bde0b28b744927b58faca6e848a
parentf2132e7a6d2207dc01a2e78cc66f2c3cc7dd69ef (diff)
parent4a10568519d12734fd6ba14bf299e40bc7e39336 (diff)
CWS-TOOLING: integrate CWS fwk160
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx2
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx9
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx16
-rw-r--r--framework/inc/jobs/jobdata.hxx10
-rw-r--r--framework/inc/jobs/jobdispatch.hxx3
-rw-r--r--framework/inc/jobs/jobexecutor.hxx4
-rw-r--r--framework/source/jobs/jobdata.cxx40
-rw-r--r--framework/source/jobs/jobdispatch.cxx37
-rw-r--r--framework/source/jobs/jobexecutor.cxx18
-rwxr-xr-x[-rw-r--r--]officecfg/registry/schema/org/openoffice/Office/Jobs.xcs5
-rw-r--r--sfx2/inc/guisaveas.hxx6
-rw-r--r--sfx2/inc/sfx2/docfilt.hxx37
-rw-r--r--sfx2/inc/sfx2/event.hxx24
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx29
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx2
-rw-r--r--sfx2/source/appl/app.cxx10
-rw-r--r--sfx2/source/config/evntconf.cxx1
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx11
-rw-r--r--sfx2/source/doc/guisaveas.cxx46
-rw-r--r--sfx2/source/doc/objmisc.cxx4
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx105
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx4
-rw-r--r--sfx2/source/view/viewsh.cxx892
-rw-r--r--ucb/source/ucp/file/shell.cxx38
-rw-r--r--uui/source/filechanged.src2
26 files changed, 786 insertions, 571 deletions
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index b267c34bb8..185f9be540 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -450,7 +450,7 @@ void BackendImpl::implProcessHelp
aJarFile, rtl_UriCharClassPchar,
rtl_UriEncodeIgnoreEscapes,
RTL_TEXTENCODING_UTF8 );
- rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" );
+ rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.zip://" );
aDestBasePath += aEncodedJarFilePath;
aDestBasePath += rtl::OUString::createFromAscii( "/" );
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index 9991e19a69..d9b590300e 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -39,6 +39,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/interfacecontainer.h>
+#include <comphelper/mimeconfighelper.hxx>
#include "closepreventer.hxx"
#include "intercept.hxx"
@@ -240,6 +241,14 @@ void OCommonEmbeddedObject::LinkInit_Impl(
OSL_ENSURE( m_aLinkURL.getLength() && m_aLinkFilterName.getLength(), "Filter and URL must be provided!\n" );
+ m_bReadOnly = sal_True;
+ if ( m_aLinkFilterName.getLength() )
+ {
+ ::comphelper::MimeConfigurationHelper aHelper( m_xFactory );
+ ::rtl::OUString aExportFilterName = aHelper.GetExportFilterFromImportFilter( m_aLinkFilterName );
+ m_bReadOnly = !( aExportFilterName.equals( m_aLinkFilterName ) );
+ }
+
m_aDocMediaDescriptor = GetValuableArgs_Impl( aMediaDescr, sal_False );
uno::Reference< frame::XDispatchProviderInterceptor > xDispatchInterceptor;
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 75a6e7f962..578874bd1f 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -978,7 +978,21 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
if ( m_bWaitSaveCompleted )
{
if ( nEntryConnectionMode == embed::EntryInitModes::NO_INIT )
- saveCompleted( ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ) );
+ {
+ // saveCompleted is expected, handle it accordingly
+ if ( m_xNewParentStorage == xStorage && m_aNewEntryName.equals( sEntName ) )
+ {
+ saveCompleted( sal_True );
+ return;
+ }
+
+ // if a completely different entry is provided, switch first back to the old persistence in saveCompleted
+ // and then switch to the target persistence
+ sal_Bool bSwitchFurther = ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) );
+ saveCompleted( sal_False );
+ if ( !bSwitchFurther )
+ return;
+ }
else
throw embed::WrongStateException(
::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ),
diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index 95233ef1eb..1f8b39f0a3 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -80,6 +80,8 @@ class JobData : private ThreadHelpBase
static const sal_Char* JOBCFG_PROP_ARGUMENTS;
/// define the cfg key "Service" of a job relativ to JOBCFG_ROOT/<job alias>
static const sal_Char* JOBCFG_PROP_SERVICE;
+ /// define the cfg key "Context" of a job relativ to JOBCFG_ROOT/<job alias>
+ static const sal_Char* JOBCFG_PROP_CONTEXT;
/// specifies the root package and key to find event registrations
static const sal_Char* EVENTCFG_ROOT;
@@ -105,6 +107,7 @@ class JobData : private ThreadHelpBase
static const sal_Char* PROP_FRAME;
static const sal_Char* PROP_MODEL;
static const sal_Char* PROP_SERVICE;
+ static const sal_Char* PROP_CONTEXT;
//___________________________________
// structs
@@ -210,6 +213,12 @@ class JobData : private ThreadHelpBase
::rtl::OUString m_sService;
/**
+ the module context list of this job.
+ It's readed from the configuration. Don't set it from outside!
+ */
+ ::rtl::OUString m_sContext;
+
+ /**
a job can be registered for an event.
It can be an empty value! But it will be set from outside any times.
Because it's not clear which job this instance should represent if an event
@@ -255,6 +264,7 @@ class JobData : private ThreadHelpBase
css::uno::Sequence< css::beans::NamedValue > getJobConfig () const;
sal_Bool hasConfig () const;
+ sal_Bool hasCorrectContext ( const ::rtl::OUString& rModuleIdent ) const;
void setEnvironment ( EEnvironment eEnvironment );
void setAlias ( const ::rtl::OUString& sAlias );
diff --git a/framework/inc/jobs/jobdispatch.hxx b/framework/inc/jobs/jobdispatch.hxx
index 1f381a3d69..a8a8faeeeb 100644
--- a/framework/inc/jobs/jobdispatch.hxx
+++ b/framework/inc/jobs/jobdispatch.hxx
@@ -101,6 +101,9 @@ class JobDispatch : public css::lang::XTypeProvider
/** reference to the frame, inside which this dispatch is used */
css::uno::Reference< css::frame::XFrame > m_xFrame;
+ /** name of module (writer, impress etc.) the frame is for */
+ ::rtl::OUString m_sModuleIdentifier;
+
//___________________________________
// native interface methods
diff --git a/framework/inc/jobs/jobexecutor.hxx b/framework/inc/jobs/jobexecutor.hxx
index 28c1426a58..5864fe6686 100644
--- a/framework/inc/jobs/jobexecutor.hxx
+++ b/framework/inc/jobs/jobexecutor.hxx
@@ -48,6 +48,7 @@
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
//_______________________________________
// other includes
@@ -85,6 +86,9 @@ class JobExecutor : public css::lang::XTypeProvider
/** reference to the uno service manager */
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+ /** reference to the module info service */
+ css::uno::Reference< css::frame::XModuleManager > m_xModuleManager;
+
/** cached list of all registered event names of cfg for call optimization. */
OUStringList m_lEvents;
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index 6d48c3c2ac..001f53ff04 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -1,4 +1,4 @@
- /*************************************************************************
+/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -61,6 +61,7 @@ namespace framework{
const sal_Char* JobData::JOBCFG_ROOT = "/org.openoffice.Office.Jobs/Jobs/" ;
const sal_Char* JobData::JOBCFG_PROP_SERVICE = "Service" ;
+const sal_Char* JobData::JOBCFG_PROP_CONTEXT = "Context" ;
const sal_Char* JobData::JOBCFG_PROP_ARGUMENTS = "Arguments" ;
const sal_Char* JobData::EVENTCFG_ROOT = "/org.openoffice.Office.Jobs/Events/" ;
@@ -79,6 +80,7 @@ const sal_Char* JobData::PROP_ENVTYPE = "EnvType"
const sal_Char* JobData::PROP_FRAME = "Frame" ;
const sal_Char* JobData::PROP_MODEL = "Model" ;
const sal_Char* JobData::PROP_SERVICE = "Service" ;
+const sal_Char* JobData::PROP_CONTEXT = "Context" ;
//________________________________
// non exported definitions
@@ -139,6 +141,7 @@ void JobData::operator=( const JobData& rCopy )
m_eEnvironment = rCopy.m_eEnvironment ;
m_sAlias = rCopy.m_sAlias ;
m_sService = rCopy.m_sService ;
+ m_sContext = rCopy.m_sContext ;
m_sEvent = rCopy.m_sEvent ;
m_lArguments = rCopy.m_lArguments ;
m_aLastExecutionResult = rCopy.m_aLastExecutionResult;
@@ -201,6 +204,10 @@ void JobData::setAlias( const ::rtl::OUString& sAlias )
aValue = xJobProperties->getPropertyValue(::rtl::OUString::createFromAscii(JOBCFG_PROP_SERVICE));
aValue >>= m_sService;
+ // read module context list
+ aValue = xJobProperties->getPropertyValue(::rtl::OUString::createFromAscii(JOBCFG_PROP_CONTEXT));
+ aValue >>= m_sContext;
+
// read whole argument list
aValue = xJobProperties->getPropertyValue(::rtl::OUString::createFromAscii(JOBCFG_PROP_ARGUMENTS));
css::uno::Reference< css::container::XNameAccess > xArgumentList;
@@ -477,7 +484,7 @@ css::uno::Sequence< css::beans::NamedValue > JobData::getConfig() const
css::uno::Sequence< css::beans::NamedValue > lConfig;
if (m_eMode==E_ALIAS)
{
- lConfig.realloc(2);
+ lConfig.realloc(3);
sal_Int32 i = 0;
lConfig[i].Name = ::rtl::OUString::createFromAscii(PROP_ALIAS);
@@ -487,6 +494,10 @@ css::uno::Sequence< css::beans::NamedValue > JobData::getConfig() const
lConfig[i].Name = ::rtl::OUString::createFromAscii(PROP_SERVICE);
lConfig[i].Value <<= m_sService;
++i;
+
+ lConfig[i].Name = ::rtl::OUString::createFromAscii(PROP_CONTEXT);
+ lConfig[i].Value <<= m_sContext;
+ ++i;
}
aReadLock.unlock();
/* } SAFE */
@@ -610,6 +621,30 @@ void JobData::appendEnabledJobsForEvent( const css::uno::Reference< css::lang::X
//________________________________
/**
*/
+sal_Bool JobData::hasCorrectContext(const ::rtl::OUString& rModuleIdent) const
+{
+ sal_Int32 nContextLen = m_sContext.getLength();
+ sal_Int32 nModuleIdLen = rModuleIdent.getLength();
+
+ if ( nContextLen == 0 )
+ return sal_True;
+
+ if ( nModuleIdLen > 0 )
+ {
+ sal_Int32 nIndex = m_sContext.indexOf( rModuleIdent );
+ if ( nIndex >= 0 && ( nIndex+nModuleIdLen <= nContextLen ))
+ {
+ ::rtl::OUString sContextModule = m_sContext.copy( nIndex, nModuleIdLen );
+ return sContextModule.equals( rModuleIdent );
+ }
+ }
+
+ return sal_False;
+}
+
+//________________________________
+/**
+ */
css::uno::Sequence< ::rtl::OUString > JobData::getEnabledJobsForEvent( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
const ::rtl::OUString& sEvent )
{
@@ -705,6 +740,7 @@ void JobData::impl_reset()
m_eEnvironment = E_UNKNOWN_ENVIRONMENT;
m_sAlias = ::rtl::OUString();
m_sService = ::rtl::OUString();
+ m_sContext = ::rtl::OUString();
m_sEvent = ::rtl::OUString();
m_lArguments = css::uno::Sequence< css::beans::NamedValue >();
aWriteLock.unlock();
diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx
index b9e7f6ee1d..5543373537 100644
--- a/framework/source/jobs/jobdispatch.cxx
+++ b/framework/source/jobs/jobdispatch.cxx
@@ -44,6 +44,7 @@
// interface includes
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
//________________________________
// includes of other projects
@@ -145,7 +146,20 @@ void SAL_CALL JobDispatch::initialize( const css::uno::Sequence< css::uno::Any >
for (int a=0; a<lArguments.getLength(); ++a)
{
if (a==0)
+ {
lArguments[a] >>= m_xFrame;
+
+ css::uno::Reference< css::frame::XModuleManager > xModuleManager(
+ m_xSMGR->createInstance(
+ SERVICENAME_MODULEMANAGER ),
+ css::uno::UNO_QUERY_THROW );
+ try
+ {
+ m_sModuleIdentifier = xModuleManager->identify( m_xFrame );
+ }
+ catch( css::uno::Exception& )
+ {}
+ }
}
aWriteLock.unlock();
@@ -289,16 +303,8 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const ::rtl::OUString&
// But a may given listener will know something ...
// I think this operaton was finished successfully.
// It's not realy an error, if no registered jobs could be located.
- if (lJobs.getLength()<1 && xListener.is())
- {
- css::frame::DispatchResultEvent aEvent;
- aEvent.Source = xThis;
- aEvent.State = css::frame::DispatchResultState::SUCCESS;
- xListener->dispatchFinished(aEvent);
- return;
- }
-
// Step over all found jobs and execute it
+ int nExecutedJobs=0;
for (int j=0; j<lJobs.getLength(); ++j)
{
/* SAFE { */
@@ -307,6 +313,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const ::rtl::OUString&
JobData aCfg(m_xSMGR);
aCfg.setEvent(sEvent, lJobs[j]);
aCfg.setEnvironment(JobData::E_DISPATCH);
+ const bool bIsEnabled=aCfg.hasCorrectContext(m_sModuleIdentifier);
/*Attention!
Jobs implements interfaces and dies by ref count!
@@ -320,6 +327,9 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const ::rtl::OUString&
aReadLock.unlock();
/* } SAFE */
+ if (!bIsEnabled)
+ continue;
+
// Special mode for listener.
// We dont notify it directly here. We delegate that
// to the job implementation. But we must set ourself there too.
@@ -328,6 +338,15 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const ::rtl::OUString&
if (xListener.is())
pJob->setDispatchResultFake(xListener, xThis);
pJob->execute(Converter::convert_seqPropVal2seqNamedVal(lArgs));
+ ++nExecutedJobs;
+ }
+
+ if (nExecutedJobs<1 && xListener.is())
+ {
+ css::frame::DispatchResultEvent aEvent;
+ aEvent.Source = xThis;
+ aEvent.State = css::frame::DispatchResultState::SUCCESS;
+ xListener->dispatchFinished(aEvent);
}
}
diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx
index 5bb7acc7c9..7a07689b05 100644
--- a/framework/source/jobs/jobexecutor.cxx
+++ b/framework/source/jobs/jobexecutor.cxx
@@ -98,6 +98,11 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE( JobExecutor ,
DEFINE_INIT_SERVICE( JobExecutor,
{
+ m_xModuleManager = css::uno::Reference< css::frame::XModuleManager >(
+ m_xSMGR->createInstance(
+ SERVICENAME_MODULEMANAGER ),
+ css::uno::UNO_QUERY_THROW );
+
/*Attention
I think we don't need any mutex or lock here ... because we are called by our own static method impl_createInstance()
to create a new instance of this class by our own supported service factory.
@@ -142,6 +147,7 @@ JobExecutor::JobExecutor( /*IN*/ const css::uno::Reference< css::lang::XMultiSer
: ThreadHelpBase (&Application::GetSolarMutex() )
, ::cppu::OWeakObject ( )
, m_xSMGR (xSMGR )
+ , m_xModuleManager ( )
, m_aConfig (xSMGR, ::rtl::OUString::createFromAscii(JobData::EVENTCFG_ROOT) )
{
// Don't do any reference related code here! Do it inside special
@@ -233,6 +239,15 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
// This optimization supress using of the cfg api for getting event and job descriptions.
// see using of m_lEvents.find() below ...
+ // retrieve event context from event source
+ rtl::OUString aModuleIdentifier;
+ try
+ {
+ aModuleIdentifier = m_xModuleManager->identify( aEvent.Source );
+ }
+ catch( css::uno::Exception& )
+ {}
+
// Special feature: If the events "OnNew" or "OnLoad" occures - we generate our own event "onDocumentOpened".
if (
(aEvent.EventName.equals(EVENT_ON_NEW )) ||
@@ -275,6 +290,9 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
aCfg.setEvent(rBinding.m_sDocEvent, rBinding.m_sJobName);
aCfg.setEnvironment(JobData::E_DOCUMENTEVENT);
+ if (!aCfg.hasCorrectContext(aModuleIdentifier))
+ continue;
+
/*Attention!
Jobs implements interfaces and dies by ref count!
And freeing of such uno object is done by uno itself.
diff --git a/officecfg/registry/schema/org/openoffice/Office/Jobs.xcs b/officecfg/registry/schema/org/openoffice/Office/Jobs.xcs
index a9b4cdc70f..f5421c8a24 100644..100755
--- a/officecfg/registry/schema/org/openoffice/Office/Jobs.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Jobs.xcs
@@ -40,6 +40,11 @@
<desc>Must contain an UNO implementation(!) name of the implemented job component.</desc>
</info>
</prop>
+ <prop oor:name="Context" oor:type="xs:string">
+ <info>
+ <desc>An property to define the context this event should be active in. It can be empty or a colon separated list of the supported application modules.</desc>
+ </info>
+ </prop>
<group oor:name="Arguments" oor:extensible="true">
<info>
<desc>Can be filled with any argument, which is under control of the job component.</desc>
diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index b3321ddc94..2b938be0bf 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -79,12 +79,6 @@ public:
::rtl::OUString aUserSelectedName,
sal_uInt16 nDocumentSignatureState = SIGNATURESTATE_NOSIGNATURES );
- static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SearchForFilter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery >& xFilterQuery,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aSearchRequest,
- sal_Int32 nMustFlags,
- sal_Int32 nDontFlags );
-
static sal_Bool CheckFilterOptionsAppearence(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xFilterCFG,
const ::rtl::OUString& aFilterName );
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index 9c6c0b18ac..030ee7dcdf 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -37,42 +37,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <tools/wldcrd.hxx>
-// TODO/LATER: The flags should be part of the UNO specification
-#define SFX_FILTER_IMPORT 0x00000001L
-#define SFX_FILTER_EXPORT 0x00000002L
-#define SFX_FILTER_TEMPLATE 0x00000004L
-#define SFX_FILTER_INTERNAL 0x00000008L
-#define SFX_FILTER_TEMPLATEPATH 0x00000010L
-#define SFX_FILTER_OWN 0x00000020L
-#define SFX_FILTER_ALIEN 0x00000040L
-#define SFX_FILTER_USESOPTIONS 0x00000080L
-
-#define SFX_FILTER_DEFAULT 0x00000100L
-#define SFX_FILTER_EXECUTABLE 0x00000200L
-#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
-#define SFX_FILTER_MAPTOAPPPLUG 0x00000800L
-#define SFX_FILTER_NOTINFILEDLG 0x00001000L
-#define SFX_FILTER_NOTINCHOOSER 0x00002000L
-#define SFX_FILTER_ASYNC 0x00004000L
-// Legt Objekt nur an, kein Laden
-#define SFX_FILTER_CREATOR 0x00008000L
-#define SFX_FILTER_OPENREADONLY 0x00010000L
-#define SFX_FILTER_MUSTINSTALL 0x00020000L
-#define SFX_FILTER_CONSULTSERVICE 0x00040000L
-
-#define SFX_FILTER_STARONEFILTER 0x00080000L
-#define SFX_FILTER_PACKED 0x00100000L
-#define SFX_FILTER_SILENTEXPORT 0x00200000L
-
-#define SFX_FILTER_BROWSERPREFERED 0x00400000L
-
-#define SFX_FILTER_ENCRYPTION 0x01000000L
-#define SFX_FILTER_PASSWORDTOMODIFY 0x02000000L
-
-#define SFX_FILTER_PREFERED 0x10000000L
-
-#define SFX_FILTER_VERSION_NONE 0
-#define SFX_FILTER_NOTINSTALLED SFX_FILTER_MUSTINSTALL | SFX_FILTER_CONSULTSERVICE
+#include <comphelper/documentconstants.hxx>
#include <sfx2/sfxdefs.hxx>
diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx
index 976fbb1666..c81329b0c5 100644
--- a/sfx2/inc/sfx2/event.hxx
+++ b/sfx2/inc/sfx2/event.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/XController2.hpp>
class SfxObjectShell;
@@ -67,6 +68,29 @@ public:
//-------------------------------------------------------------------
+class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > xViewController;
+
+public:
+ TYPEINFO();
+
+ SfxViewEventHint( USHORT nId, const ::rtl::OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
+ : SfxEventHint( nId, aName, pObj )
+ , xViewController( xController, ::com::sun::star::uno::UNO_QUERY )
+ {}
+
+ SfxViewEventHint( USHORT nId, const ::rtl::OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController )
+ : SfxEventHint( nId, aName, pObj )
+ , xViewController( xController )
+ {}
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > GetController() const
+ { return xViewController; }
+};
+
+//-------------------------------------------------------------------
+
class SfxNamedHint : public SfxHint
{
String _aEventName;
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 1f7f8da046..5a8e377b7a 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -39,7 +39,7 @@
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/document/XDocumentInfo.hpp>
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -48,6 +48,7 @@
#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
@@ -96,9 +97,9 @@
#include <com/sun/star/task/XInteractionHandler.hpp>
//________________________________________________________________________________________________________
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_30)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_30
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 30
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_31)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_31
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 31
#include <comphelper/implbase_var.hxx>
#endif
@@ -143,6 +144,7 @@
#define XDOCUMENTINFO ::com::sun::star::document::XDocumentInfo
#define XDOCUMENTINFOSUPPLIER ::com::sun::star::document::XDocumentInfoSupplier
#define XEVENTBROADCASTER ::com::sun::star::document::XEventBroadcaster
+#define XDOCUMENTEVENTBROADCASTER ::com::sun::star::document::XDocumentEventBroadcaster
#define XEVENTSSUPPLIER ::com::sun::star::document::XEventsSupplier
#define XEMBEDDEDSCRIPTS ::com::sun::star::document::XEmbeddedScripts
#define XSCRIPTINVOCATIONCONTEXT ::com::sun::star::document::XScriptInvocationContext
@@ -237,12 +239,13 @@ namespace sfx { namespace intern {
SfxListener
*/
-typedef ::comphelper::WeakImplHelper30 < XCHILD
+typedef ::comphelper::WeakImplHelper31 < XCHILD
, XDOCUMENTINFOSUPPLIER
, ::com::sun::star::document::XDocumentPropertiesSupplier
, ::com::sun::star::rdf::XDocumentMetadataAccess
, ::com::sun::star::document::XDocumentRecovery
, XEVENTBROADCASTER
+ , XDOCUMENTEVENTBROADCASTER
, XEVENTLISTENER
, XEVENTSSUPPLIER
, XEMBEDDEDSCRIPTS
@@ -1249,6 +1252,18 @@ public:
virtual void SAL_CALL removeEventListener( const REFERENCE< XDOCEVENTLISTENER >& xListener ) throw( RUNTIMEEXCEPTION );
+ //____________________________________________________________________________________________________
+ // XDocumentEventBroadcaster
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL addDocumentEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentEventListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeDocumentEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentEventListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL notifyDocumentEvent( const ::rtl::OUString& _EventName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& _ViewController, const ::com::sun::star::uno::Any& _Supplement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XUnoTunnel
+ //____________________________________________________________________________________________________
+
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
// css.frame.XModule
@@ -1531,7 +1546,9 @@ private:
SAL_DLLPRIVATE void impl_store( const OUSTRING& sURL ,
const SEQUENCE< PROPERTYVALUE >& seqArguments ,
sal_Bool bSaveTo ) ;
- SAL_DLLPRIVATE void postEvent_Impl( ::rtl::OUString );
+
+ SAL_DLLPRIVATE void postEvent_Impl( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >() );
+
SAL_DLLPRIVATE String getEventName_Impl( long nID );
SAL_DLLPRIVATE void NotifyStorageListeners_Impl();
SAL_DLLPRIVATE bool QuerySaveSizeExceededModules( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler );
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index f12b9fbadb..354edb836b 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -37,6 +37,7 @@
#include <svl/lstner.hxx>
#include <com/sun/star/ui/XContextMenuInterceptor.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
#include <cppuhelper/interfacecontainer.hxx>
#include "shell.hxx"
#include <tools/gen.hxx>
@@ -293,6 +294,7 @@ public:
void ExecPrint( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool, sal_Bool );
void AddRemoveClipboardListener( const com::sun::star::uno::Reference < com::sun::star::datatransfer::clipboard::XClipboardListener>&, BOOL );
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier();
#if _SOLAR__PRIVATE
SAL_DLLPRIVATE SfxInPlaceClient* GetUIActiveIPClient_Impl() const;
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index bc8da45c7f..0130f29f08 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -112,7 +112,7 @@
#include "sfx2/stbitem.hxx"
#include "eventsupplier.hxx"
#include <sfx2/dockwin.hxx>
-#include <tools/svlibrary.hxx>
+#include <tools/svlibrary.hxx>
#ifdef DBG_UTIL
#include <sfx2/tbxctrl.hxx>
@@ -483,7 +483,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
if ( pOldContainerFrame )
{
if ( bTaskActivate )
- NotifyEvent( SfxEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_DEACTIVATEDOC), pOldContainerFrame->GetObjectShell() ) );
+ NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_DEACTIVATEDOC), pOldContainerFrame->GetObjectShell(), pOldContainerFrame->GetFrame().GetController() ) );
pOldContainerFrame->DoDeactivate( bTaskActivate, pFrame );
if( pOldContainerFrame->GetProgress() )
@@ -507,7 +507,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
if ( bTaskActivate && pNewContainerFrame->GetObjectShell() )
{
pNewContainerFrame->GetObjectShell()->PostActivateEvent_Impl( pNewContainerFrame );
- NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_ACTIVATEDOC), pNewContainerFrame->GetObjectShell() ) );
+ NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_ACTIVATEDOC), pNewContainerFrame->GetObjectShell(), pNewContainerFrame->GetFrame().GetController() ) );
}
SfxProgress *pProgress = pNewContainerFrame->GetProgress();
@@ -726,7 +726,7 @@ extern "C" { static void SAL_CALL thisModule() {} }
IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic )
{
// get basctl dllname
- static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
+ static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
// load module
oslModule handleMod = osl_loadModuleRelative(
@@ -815,7 +815,7 @@ SfxApplication::ChooseScript()
void SfxApplication::MacroOrganizer( INT16 nTabId )
{
// get basctl dllname
- static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
+ static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
// load module
oslModule handleMod = osl_loadModuleRelative(
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 905e97d048..46a723b092 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -60,6 +60,7 @@
// -----------------------------------------------------------------------
TYPEINIT1(SfxEventHint, SfxHint);
TYPEINIT1(SfxEventNamesItem, SfxPoolItem);
+TYPEINIT1(SfxViewEventHint, SfxHint);
using namespace com::sun::star;
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 67267ff267..fba909e74d 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1892,7 +1892,16 @@ void FileDialogHelper_Impl::addFilters( sal_Int64 nFlags,
sQuery.appendAscii(":eflags=" );
sQuery.append (::rtl::OUString::valueOf((sal_Int32)m_nDontFlags));
- uno::Reference< XEnumeration > xResult = xFilterCont->createSubSetEnumerationByQuery(sQuery.makeStringAndClear());
+ uno::Reference< XEnumeration > xResult;
+ try
+ {
+ xResult = xFilterCont->createSubSetEnumerationByQuery(sQuery.makeStringAndClear());
+ }
+ catch( uno::Exception& )
+ {
+ DBG_ERRORFILE( "Could not get filters from the configuration!" );
+ }
+
TSortedFilterList aIter (xResult);
// no matcher any longer used ...
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 3e022a40d0..974af27536 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -71,6 +71,7 @@
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
+#include <comphelper/mimeconfighelper.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/window.hxx>
#include <toolkit/awt/vclxwindow.hxx>
@@ -507,7 +508,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceAnyFilter( sa
aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "DocumentService" );
aSearchRequest[0].Value <<= GetDocServiceName();
- return SfxStoringHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont );
+ return ::comphelper::MimeConfigurationHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont );
}
//-------------------------------------------------------------------------
@@ -527,7 +528,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl(
aSearchRequest[1].Name = ::rtl::OUString::createFromAscii( "DocumentService" );
aSearchRequest[1].Value <<= GetDocServiceName();
- aFilterProps = SfxStoringHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont );
+ aFilterProps = ::comphelper::MimeConfigurationHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont );
}
else
{
@@ -1650,47 +1651,6 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
//-------------------------------------------------------------------------
// static
-uno::Sequence< beans::PropertyValue > SfxStoringHelper::SearchForFilter(
- const uno::Reference< container::XContainerQuery >& xFilterQuery,
- const uno::Sequence< beans::NamedValue >& aSearchRequest,
- sal_Int32 nMustFlags,
- sal_Int32 nDontFlags )
-{
- uno::Sequence< beans::PropertyValue > aFilterProps;
- uno::Reference< container::XEnumeration > xFilterEnum =
- xFilterQuery->createSubSetEnumerationByProperties( aSearchRequest );
-
- // the first default filter will be taken,
- // if there is no filter with flag default the first acceptable filter will be taken
- if ( xFilterEnum.is() )
- {
- while ( xFilterEnum->hasMoreElements() )
- {
- uno::Sequence< beans::PropertyValue > aProps;
- if ( xFilterEnum->nextElement() >>= aProps )
- {
- ::comphelper::SequenceAsHashMap aPropsHM( aProps );
- sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ),
- (sal_Int32)0 );
- if ( ( ( nFlags & nMustFlags ) == nMustFlags ) && !( nFlags & nDontFlags ) )
- {
- if ( ( nFlags & SFX_FILTER_DEFAULT ) == SFX_FILTER_DEFAULT )
- {
- aFilterProps = aProps;
- break;
- }
- else if ( !aFilterProps.getLength() )
- aFilterProps = aProps;
- }
- }
- }
- }
-
- return aFilterProps;
-}
-
-//-------------------------------------------------------------------------
-// static
sal_Bool SfxStoringHelper::CheckFilterOptionsAppearence(
const uno::Reference< container::XNameAccess >& xFilterCFG,
const ::rtl::OUString& aFilterName )
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 524416f7e1..ffc27f1a54 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1163,9 +1163,9 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame )
sal_uInt16 nId = pImp->nEventId;
pImp->nEventId = 0;
if ( nId == SFX_EVENT_OPENDOC )
- pSfxApp->NotifyEvent(SfxEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_OPENDOC), this ), sal_False);
+ pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_OPENDOC), this, pFrame->GetFrame().GetController() ), sal_False);
else if (nId == SFX_EVENT_CREATEDOC )
- pSfxApp->NotifyEvent(SfxEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_CREATEDOC), this ), sal_False);
+ pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_CREATEDOC), this, pFrame->GetFrame().GetController() ), sal_False);
}
}
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index fc3b8f4588..7e6eab4a21 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2383,6 +2383,32 @@ void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XDOCEVENT
m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XDOCEVENTLISTENER >*)0), aListener );
}
+//--------------------------------------------------------------------------------------------------------
+// XDocumentEventBroadcaster
+//--------------------------------------------------------------------------------------------------------
+// ---------------------------------
+void SAL_CALL SfxBaseModel::addDocumentEventListener( const uno::Reference< document::XDocumentEventListener >& aListener )
+ throw ( uno::RuntimeException )
+{
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
+ m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< document::XDocumentEventListener >*)0), aListener );
+}
+
+// ---------------------------------
+void SAL_CALL SfxBaseModel::removeDocumentEventListener( const uno::Reference< document::XDocumentEventListener >& aListener )
+ throw ( uno::RuntimeException )
+{
+ SfxModelGuard aGuard( *this );
+ m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< document::XDocumentEventListener >*)0), aListener );
+}
+
+// ---------------------------------
+void SAL_CALL SfxBaseModel::notifyDocumentEvent( const ::rtl::OUString&, const uno::Reference< frame::XController2 >&, const uno::Any& )
+ throw ( lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException )
+{
+ throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SfxBaseModel controlls all the sent notifications itself!" ) ), uno::Reference< uno::XInterface >() );
+}
+
//________________________________________________________________________________________________________
// SfxListener
//________________________________________________________________________________________________________
@@ -2526,7 +2552,9 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
break;
}
- postEvent_Impl( pNamedHint->GetEventName() );
+
+ SfxViewEventHint* pViewHint = PTR_CAST( SfxViewEventHint, &rHint );
+ postEvent_Impl( pNamedHint->GetEventName(), pViewHint ? pViewHint->GetController() : uno::Reference< frame::XController2 >() );
}
if ( pSimpleHint )
@@ -2871,8 +2899,32 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
}
//********************************************************************************************************
+namespace {
+template< typename ListenerT, typename EventT >
+class NotifySingleListenerIgnoreRE
+{
+private:
+ typedef void ( SAL_CALL ListenerT::*NotificationMethod )( const EventT& );
+ NotificationMethod m_pMethod;
+ const EventT& m_rEvent;
+public:
+ NotifySingleListenerIgnoreRE( NotificationMethod method, const EventT& event ) : m_pMethod( method ), m_rEvent( event ) { }
-void SfxBaseModel::postEvent_Impl( ::rtl::OUString aName )
+ void operator()( const uno::Reference<ListenerT>& listener ) const
+ {
+ try
+ {
+ (listener.get()->*m_pMethod)( m_rEvent );
+ }
+ catch( uno::RuntimeException& )
+ {
+ // this exception is ignored to avoid problems with invalid listeners, the listener should be probably thrown away in future
+ }
+ }
+};
+} // anonymous namespace
+
+void SfxBaseModel::postEvent_Impl( const ::rtl::OUString& aName, const uno::Reference< frame::XController2 >& xController )
{
// object already disposed?
if ( impl_isDisposed() )
@@ -2882,34 +2934,41 @@ void SfxBaseModel::postEvent_Impl( ::rtl::OUString aName )
if (!aName.getLength())
return;
- ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer(
- ::getCppuType((const uno::Reference< XDOCEVENTLISTENER >*)0) );
- if( pIC )
+ ::cppu::OInterfaceContainerHelper* pIC =
+ m_pData->m_aInterfaceContainer.getContainer( ::getCppuType( (const uno::Reference< document::XDocumentEventListener >*)0 ) );
+ if ( pIC )
+ {
+#ifdef DBG_UTIL
+ ByteString aTmp( "SfxDocumentEvent: " );
+ aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
+ DBG_TRACE( aTmp.GetBuffer() );
+#endif
+
+ document::DocumentEvent aDocumentEvent( (frame::XModel*)this, aName, xController, uno::Any() );
+
+ pIC->forEach< document::XDocumentEventListener, NotifySingleListenerIgnoreRE< document::XDocumentEventListener, document::DocumentEvent > >(
+ NotifySingleListenerIgnoreRE< document::XDocumentEventListener, document::DocumentEvent >(
+ &document::XDocumentEventListener::documentEventOccured,
+ aDocumentEvent ) );
+ }
+ pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType( (const uno::Reference< document::XEventListener >*)0 ) );
+ if ( pIC )
{
#ifdef DBG_UTIL
- ByteString aTmp( "SfxEvent: ");
+ ByteString aTmp( "SfxEvent: " );
aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
DBG_TRACE( aTmp.GetBuffer() );
#endif
- document::EventObject aEvent( (frame::XModel *)this, aName );
- ::cppu::OInterfaceContainerHelper aIC( m_aMutex );
- uno::Sequence < uno::Reference < uno::XInterface > > aElements = pIC->getElements();
- for ( sal_Int32 nElem=0; nElem<aElements.getLength(); nElem++ )
- aIC.addInterface( aElements[nElem] );
- ::cppu::OInterfaceIteratorHelper aIt( aIC );
- while( aIt.hasMoreElements() )
- {
- try
- {
- ((XDOCEVENTLISTENER *)aIt.next())->notifyEvent( aEvent );
- }
- catch( uno::RuntimeException& )
- {
- aIt.remove();
- }
- }
+
+ document::EventObject aEvent( (frame::XModel*)this, aName );
+
+ pIC->forEach< document::XEventListener, NotifySingleListenerIgnoreRE< document::XEventListener, document::EventObject > >(
+ NotifySingleListenerIgnoreRE< document::XEventListener, document::EventObject >(
+ &document::XEventListener::notifyEvent,
+ aEvent ) );
}
+
}
uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() throw(::com::sun::star::uno::RuntimeException)
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 3b34d147e4..09e42563d6 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -234,7 +234,7 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing )
bOther = ( &pFrame->GetFrame() != this );
}
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur) );
+ SFX_APP()->NotifyEvent( SfxViewEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur, GetController() ) );
if ( bOther )
// if there are other views only the current view of this frame must be asked
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 886ad0f934..4d71e06955 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -639,7 +639,7 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame
ConnectSfxFrame_Impl( E_CONNECT );
// attaching the frame to the controller is the last step in the creation of a new view, so notify this
- SfxEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell() );
+ SfxViewEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), uno::Reference< frame::XController2 >( this ) );
SFX_APP()->NotifyEvent( aHint );
}
}
@@ -1069,7 +1069,7 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime
pView = SfxViewFrame::GetNext( *pView, pDoc );
}
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc ) );
+ SFX_APP()->NotifyEvent( SfxViewEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc, uno::Reference< frame::XController2 >( this ) ) );
if ( !pView )
SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) );
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index daccb1c364..9855ffcd93 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -44,7 +44,6 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
#include <cppuhelper/implbase1.hxx>
@@ -115,7 +114,9 @@ DBG_NAME(SfxViewShell)
class SfxClipboardChangeListener : public ::cppu::WeakImplHelper1<
datatransfer::clipboard::XClipboardListener >
{
- SfxViewShell* pViewShell;
+public:
+ SfxClipboardChangeListener( SfxViewShell* pView, const uno::Reference< datatransfer::clipboard::XClipboardNotifier >& xClpbrdNtfr );
+ virtual ~SfxClipboardChangeListener();
// XEventListener
virtual void SAL_CALL disposing( const lang::EventObject& rEventObject )
@@ -125,21 +126,46 @@ class SfxClipboardChangeListener : public ::cppu::WeakImplHelper1<
virtual void SAL_CALL changedContents( const datatransfer::clipboard::ClipboardEvent& rEventObject )
throw ( uno::RuntimeException );
-public:
- SfxClipboardChangeListener( SfxViewShell* pView );
- virtual ~SfxClipboardChangeListener();
+ void DisconnectViewShell() { m_pViewShell = NULL; }
+ void ChangedContents();
+
+ enum AsyncExecuteCmd
+ {
+ ASYNCEXECUTE_CMD_DISPOSING,
+ ASYNCEXECUTE_CMD_CHANGEDCONTENTS
+ };
- void DisconnectViewShell() { pViewShell = NULL; }
+ struct AsyncExecuteInfo
+ {
+ AsyncExecuteInfo( AsyncExecuteCmd eCmd, uno::Reference< datatransfer::clipboard::XClipboardListener > xThis, SfxClipboardChangeListener* pListener ) :
+ m_eCmd( eCmd ), m_xThis( xThis ), m_pListener( pListener ) {}
+
+ AsyncExecuteCmd m_eCmd;
+ uno::Reference< datatransfer::clipboard::XClipboardListener > m_xThis;
+ SfxClipboardChangeListener* m_pListener;
+ };
+
+private:
+ SfxViewShell* m_pViewShell;
+ uno::Reference< datatransfer::clipboard::XClipboardNotifier > m_xClpbrdNtfr;
+ uno::Reference< lang::XComponent > m_xCtrl;
+
+ DECL_STATIC_LINK( SfxClipboardChangeListener, AsyncExecuteHdl_Impl, AsyncExecuteInfo* );
};
-SfxClipboardChangeListener::SfxClipboardChangeListener( SfxViewShell* pView )
-: pViewShell( 0 )
+SfxClipboardChangeListener::SfxClipboardChangeListener( SfxViewShell* pView, const uno::Reference< datatransfer::clipboard::XClipboardNotifier >& xClpbrdNtfr )
+ : m_pViewShell( 0 ), m_xClpbrdNtfr( xClpbrdNtfr )
{
- uno::Reference < lang::XComponent > xCtrl( pView->GetController(), uno::UNO_QUERY );
- if ( xCtrl.is() )
+ m_xCtrl = uno::Reference < lang::XComponent >( pView->GetController(), uno::UNO_QUERY );
+ if ( m_xCtrl.is() )
{
- xCtrl->addEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this ) ) );
- pViewShell = pView;
+ m_xCtrl->addEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this ) ) );
+ m_pViewShell = pView;
+ }
+ if ( m_xClpbrdNtfr.is() )
+ {
+ m_xClpbrdNtfr->addClipboardListener( uno::Reference< datatransfer::clipboard::XClipboardListener >(
+ static_cast< datatransfer::clipboard::XClipboardListener* >( this )));
}
}
@@ -147,34 +173,68 @@ SfxClipboardChangeListener::~SfxClipboardChangeListener()
{
}
-void SAL_CALL SfxClipboardChangeListener::disposing( const lang::EventObject& /*rEventObject*/ )
-throw ( uno::RuntimeException )
+void SfxClipboardChangeListener::ChangedContents()
{
- // either clipboard or ViewShell is going to be destroyed -> no interest in listening anymore
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( pViewShell )
+ if( m_pViewShell )
{
- uno::Reference < lang::XComponent > xCtrl( pViewShell->GetController(), uno::UNO_QUERY );
- if ( xCtrl.is() )
- xCtrl->removeEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this ) ) );
- pViewShell->AddRemoveClipboardListener( uno::Reference < datatransfer::clipboard::XClipboardListener > (this), FALSE );
- pViewShell = 0;
+ SfxBindings& rBind = m_pViewShell->GetViewFrame()->GetBindings();
+ rBind.Invalidate( SID_PASTE );
+ rBind.Invalidate( SID_PASTE_SPECIAL );
+ rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
}
-void SAL_CALL SfxClipboardChangeListener::changedContents( const datatransfer::clipboard::ClipboardEvent& )
- throw ( RuntimeException )
+IMPL_STATIC_LINK_NOINSTANCE( SfxClipboardChangeListener, AsyncExecuteHdl_Impl, AsyncExecuteInfo*, pAsyncExecuteInfo )
{
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if( pViewShell )
+ if ( pAsyncExecuteInfo )
{
- SfxBindings& rBind = pViewShell->GetViewFrame()->GetBindings();
- rBind.Invalidate( SID_PASTE );
- rBind.Invalidate( SID_PASTE_SPECIAL );
- rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
+ uno::Reference< datatransfer::clipboard::XClipboardListener > xThis( pAsyncExecuteInfo->m_xThis );
+ if ( pAsyncExecuteInfo->m_pListener )
+ {
+ if ( pAsyncExecuteInfo->m_eCmd == ASYNCEXECUTE_CMD_DISPOSING )
+ pAsyncExecuteInfo->m_pListener->DisconnectViewShell();
+ else if ( pAsyncExecuteInfo->m_eCmd == ASYNCEXECUTE_CMD_CHANGEDCONTENTS )
+ pAsyncExecuteInfo->m_pListener->ChangedContents();
+ }
}
+ delete pAsyncExecuteInfo;
+
+ return 0;
+}
+
+void SAL_CALL SfxClipboardChangeListener::disposing( const lang::EventObject& /*rEventObject*/ )
+throw ( uno::RuntimeException )
+{
+ // Either clipboard or ViewShell is going to be destroyed -> no interest in listening anymore
+ uno::Reference< lang::XComponent > xCtrl( m_xCtrl );
+ uno::Reference< datatransfer::clipboard::XClipboardNotifier > xNotify( m_xClpbrdNtfr );
+
+ uno::Reference< datatransfer::clipboard::XClipboardListener > xThis( static_cast< datatransfer::clipboard::XClipboardListener* >( this ));
+ if ( xCtrl.is() )
+ xCtrl->removeEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this )));
+ if ( xNotify.is() )
+ xNotify->removeClipboardListener( xThis );
+
+ // Make asynchronous call to avoid locking SolarMutex which is the
+ // root for many deadlocks, especially in conjuction with the "Windows"
+ // based single thread apartment clipboard code!
+ AsyncExecuteInfo* pInfo = new AsyncExecuteInfo( ASYNCEXECUTE_CMD_DISPOSING, xThis, this );
+ Application::PostUserEvent( STATIC_LINK( 0, SfxClipboardChangeListener, AsyncExecuteHdl_Impl ), pInfo );
+}
+
+void SAL_CALL SfxClipboardChangeListener::changedContents( const datatransfer::clipboard::ClipboardEvent& )
+ throw ( RuntimeException )
+{
+ // Make asynchronous call to avoid locking SolarMutex which is the
+ // root for many deadlocks, especially in conjuction with the "Windows"
+ // based single thread apartment clipboard code!
+ uno::Reference< datatransfer::clipboard::XClipboardListener > xThis( static_cast< datatransfer::clipboard::XClipboardListener* >( this ));
+ AsyncExecuteInfo* pInfo = new AsyncExecuteInfo( ASYNCEXECUTE_CMD_CHANGEDCONTENTS, xThis, this );
+ Application::PostUserEvent( STATIC_LINK( 0, SfxClipboardChangeListener, AsyncExecuteHdl_Impl ), pInfo );
}
+//=========================================================================
static ::rtl::OUString RetrieveLabelFromCommand(
const ::rtl::OUString& rCommandURL,
@@ -260,7 +320,7 @@ SfxViewShell_Impl::SfxViewShell_Impl(USHORT const nFlags)
//=========================================================================
SFX_IMPL_INTERFACE(SfxViewShell,SfxShell,SfxResId(0))
{
- SFX_CHILDWINDOW_REGISTRATION( SID_MAIL_CHILDWIN );
+ SFX_CHILDWINDOW_REGISTRATION( SID_MAIL_CHILDWIN );
}
TYPEINIT2(SfxViewShell,SfxShell,SfxListener);
@@ -379,27 +439,27 @@ enum ETypeFamily
void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
{
- const USHORT nId = rReq.GetSlot();
- switch( nId )
- {
- case SID_STYLE_FAMILY :
+ const USHORT nId = rReq.GetSlot();
+ switch( nId )
{
- SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nId, FALSE);
- if (pItem)
+ case SID_STYLE_FAMILY :
+ {
+ SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nId, FALSE);
+ if (pItem)
{
pImp->m_nFamily = pItem->GetValue();
}
- break;
- }
+ break;
+ }
- case SID_STYLE_CATALOG:
- {
- SfxTemplateCatalog aCatalog(
- SFX_APP()->GetTopWindow(), &GetViewFrame()->GetBindings());
- aCatalog.Execute();
+ case SID_STYLE_CATALOG:
+ {
+ SfxTemplateCatalog aCatalog(
+ SFX_APP()->GetTopWindow(), &GetViewFrame()->GetBindings());
+ aCatalog.Execute();
rReq.Ignore();
- break;
- }
+ break;
+ }
case SID_ACTIVATE_STYLE_APPLY:
{
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame(
@@ -459,85 +519,85 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
rReq.Done();
}
break;
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_MAIL_SENDDOCASMS:
- case SID_MAIL_SENDDOCASOOO:
- case SID_MAIL_SENDDOCASPDF:
- case SID_MAIL_SENDDOC:
+ case SID_MAIL_SENDDOCASMS:
+ case SID_MAIL_SENDDOCASOOO:
+ case SID_MAIL_SENDDOCASPDF:
+ case SID_MAIL_SENDDOC:
case SID_MAIL_SENDDOCASFORMAT:
- {
- SfxObjectShell* pDoc = GetObjectShell();
- if ( pDoc && pDoc->QueryHiddenInformation(
- WhenSaving, &GetViewFrame()->GetWindow() ) != RET_YES )
- break;
+ {
+ SfxObjectShell* pDoc = GetObjectShell();
+ if ( pDoc && pDoc->QueryHiddenInformation(
+ WhenSaving, &GetViewFrame()->GetWindow() ) != RET_YES )
+ break;
- if ( SvtInternalOptions().MailUIEnabled() )
+ if ( SvtInternalOptions().MailUIEnabled() )
{
GetViewFrame()->SetChildWindow( SID_MAIL_CHILDWIN, TRUE );
}
else
{
- SfxMailModel aModel;
+ SfxMailModel aModel;
rtl::OUString aDocType;
- SFX_REQUEST_ARG(rReq, pMailSubject, SfxStringItem, SID_MAIL_SUBJECT, FALSE );
- if ( pMailSubject )
- aModel.SetSubject( pMailSubject->GetValue() );
+ SFX_REQUEST_ARG(rReq, pMailSubject, SfxStringItem, SID_MAIL_SUBJECT, FALSE );
+ if ( pMailSubject )
+ aModel.SetSubject( pMailSubject->GetValue() );
- SFX_REQUEST_ARG(rReq, pMailRecipient, SfxStringItem, SID_MAIL_RECIPIENT, FALSE );
- if ( pMailRecipient )
- {
- String aRecipient( pMailRecipient->GetValue() );
- String aMailToStr( String::CreateFromAscii( "mailto:" ));
+ SFX_REQUEST_ARG(rReq, pMailRecipient, SfxStringItem, SID_MAIL_RECIPIENT, FALSE );
+ if ( pMailRecipient )
+ {
+ String aRecipient( pMailRecipient->GetValue() );
+ String aMailToStr( String::CreateFromAscii( "mailto:" ));
- if ( aRecipient.Search( aMailToStr ) == 0 )
- aRecipient = aRecipient.Erase( 0, aMailToStr.Len() );
- aModel.AddAddress( aRecipient, SfxMailModel::ROLE_TO );
- }
+ if ( aRecipient.Search( aMailToStr ) == 0 )
+ aRecipient = aRecipient.Erase( 0, aMailToStr.Len() );
+ aModel.AddAddress( aRecipient, SfxMailModel::ROLE_TO );
+ }
SFX_REQUEST_ARG(rReq, pMailDocType, SfxStringItem, SID_TYPE_NAME, FALSE );
if ( pMailDocType )
aDocType = pMailDocType->GetValue();
uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
- SfxMailModel::SendMailResult eResult = SfxMailModel::SEND_MAIL_ERROR;
+ SfxMailModel::SendMailResult eResult = SfxMailModel::SEND_MAIL_ERROR;
if ( nId == SID_MAIL_SENDDOC )
- eResult = aModel.SaveAndSend( xFrame, rtl::OUString() );
- else
- if ( nId == SID_MAIL_SENDDOCASPDF )
+ eResult = aModel.SaveAndSend( xFrame, rtl::OUString() );
+ else
+ if ( nId == SID_MAIL_SENDDOCASPDF )
eResult = aModel.SaveAndSend( xFrame, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf_Portable_Document_Format" )));
else
- if ( nId == SID_MAIL_SENDDOCASMS )
+ if ( nId == SID_MAIL_SENDDOCASMS )
{
aDocType = impl_searchFormatTypeForApp(xFrame, E_MS_DOC);
if (aDocType.getLength() > 0)
eResult = aModel.SaveAndSend( xFrame, aDocType );
}
else
- if ( nId == SID_MAIL_SENDDOCASOOO )
+ if ( nId == SID_MAIL_SENDDOCASOOO )
{
aDocType = impl_searchFormatTypeForApp(xFrame, E_OOO_DOC);
if (aDocType.getLength() > 0)
eResult = aModel.SaveAndSend( xFrame, aDocType );
}
- if ( eResult == SfxMailModel::SEND_MAIL_ERROR )
- {
- InfoBox aBox( SFX_APP()->GetTopWindow(), SfxResId( MSG_ERROR_SEND_MAIL ));
- aBox.Execute();
+ if ( eResult == SfxMailModel::SEND_MAIL_ERROR )
+ {
+ InfoBox aBox( SFX_APP()->GetTopWindow(), SfxResId( MSG_ERROR_SEND_MAIL ));
+ aBox.Execute();
rReq.Ignore();
- }
+ }
else
rReq.Done();
- }
+ }
- break;
- }
+ break;
+ }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_WEBHTML:
- {
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_WEBHTML:
+ {
static const char HTML_DOCUMENT_TYPE[] = "writer_web_HTML";
static const char HTML_GRAPHIC_TYPE[] = "graphic_HTML";
const sal_Int32 FILTERFLAG_EXPORT = 0x00000002;
@@ -657,25 +717,25 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )),
css::uno::UNO_QUERY );
- BOOL bRet( TRUE );
+ BOOL bRet( TRUE );
if ( xSystemShellExecute.is() )
{
try
{
- xSystemShellExecute->execute(
- aFileURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
+ xSystemShellExecute->execute(
+ aFileURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
}
catch ( uno::Exception& )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window *pParent = SFX_APP()->GetTopWindow();
- ErrorBox( pParent, SfxResId( MSG_ERROR_NO_WEBBROWSER_FOUND )).Execute();
+ ErrorBox( pParent, SfxResId( MSG_ERROR_NO_WEBBROWSER_FOUND )).Execute();
bRet = FALSE;
}
}
rReq.Done(bRet);
- break;
+ break;
}
else
{
@@ -685,97 +745,97 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_PLUGINS_ACTIVE:
- {
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nId, FALSE);
+ case SID_PLUGINS_ACTIVE:
+ {
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nId, FALSE);
bool const bActive = (pShowItem)
? pShowItem->GetValue()
: !pImp->m_bPlugInsActive;
- // ggf. recorden
- if ( !rReq.IsAPI() )
- rReq.AppendItem( SfxBoolItem( nId, bActive ) );
+ // ggf. recorden
+ if ( !rReq.IsAPI() )
+ rReq.AppendItem( SfxBoolItem( nId, bActive ) );
- // Jetzt schon DONE aufrufen, da die Argumente evtl. einen Pool
- // benutzen, der demn"achst weg ist
- rReq.Done(TRUE);
+ // Jetzt schon DONE aufrufen, da die Argumente evtl. einen Pool
+ // benutzen, der demn"achst weg ist
+ rReq.Done(TRUE);
- // ausfuehren
+ // ausfuehren
if (!pShowItem || (bActive != pImp->m_bPlugInsActive))
- {
- SfxFrame* pTopFrame = &GetFrame()->GetTopFrame();
- if ( pTopFrame != &GetFrame()->GetFrame() )
- {
- // FramesetDocument
- SfxViewShell *pShell = pTopFrame->GetCurrentViewFrame()->GetViewShell();
- if ( pShell->GetInterface()->GetSlot( nId ) )
- pShell->ExecuteSlot( rReq );
- break;
- }
-
- SfxFrameIterator aIter( *pTopFrame );
- while ( pTopFrame )
- {
- if ( pTopFrame->GetCurrentViewFrame() )
- {
- SfxViewShell *pView = pTopFrame->GetCurrentViewFrame()->GetViewShell();
- if ( pView )
{
+ SfxFrame* pTopFrame = &GetFrame()->GetTopFrame();
+ if ( pTopFrame != &GetFrame()->GetFrame() )
+ {
+ // FramesetDocument
+ SfxViewShell *pShell = pTopFrame->GetCurrentViewFrame()->GetViewShell();
+ if ( pShell->GetInterface()->GetSlot( nId ) )
+ pShell->ExecuteSlot( rReq );
+ break;
+ }
+
+ SfxFrameIterator aIter( *pTopFrame );
+ while ( pTopFrame )
+ {
+ if ( pTopFrame->GetCurrentViewFrame() )
+ {
+ SfxViewShell *pView = pTopFrame->GetCurrentViewFrame()->GetViewShell();
+ if ( pView )
+ {
pView->pImp->m_bPlugInsActive = bActive;
Rectangle aVisArea = GetObjectShell()->GetVisArea();
VisAreaChanged(aVisArea);
- // the plugins might need change in their state
- SfxInPlaceClientList *pClients = pView->GetIPClientList_Impl(FALSE);
- if ( pClients )
- {
- for (USHORT n=0; n < pClients->Count(); n++)
- {
- SfxInPlaceClient* pIPClient = pClients->GetObject(n);
- if ( pIPClient )
- pView->CheckIPClient_Impl( pIPClient, aVisArea );
+ // the plugins might need change in their state
+ SfxInPlaceClientList *pClients = pView->GetIPClientList_Impl(FALSE);
+ if ( pClients )
+ {
+ for (USHORT n=0; n < pClients->Count(); n++)
+ {
+ SfxInPlaceClient* pIPClient = pClients->GetObject(n);
+ if ( pIPClient )
+ pView->CheckIPClient_Impl( pIPClient, aVisArea );
+ }
+ }
+ }
+ }
+
+ if ( !pTopFrame->GetParentFrame() )
+ pTopFrame = aIter.FirstFrame();
+ else
+ pTopFrame = aIter.NextFrame( *pTopFrame );
}
- }
}
- }
- if ( !pTopFrame->GetParentFrame() )
- pTopFrame = aIter.FirstFrame();
- else
- pTopFrame = aIter.NextFrame( *pTopFrame );
+ break;
}
- }
-
- break;
}
- }
}
//--------------------------------------------------------------------
void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
{
- DBG_CHKTHIS(SfxViewShell, 0);
+ DBG_CHKTHIS(SfxViewShell, 0);
- SfxWhichIter aIter( rSet );
- for ( USHORT nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
- {
- switch ( nSID )
+ SfxWhichIter aIter( rSet );
+ for ( USHORT nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
{
- case SID_STYLE_CATALOG:
- {
+ switch ( nSID )
+ {
+ case SID_STYLE_CATALOG:
+ {
if ( !GetViewFrame()->KnowsChildWindow( SID_STYLE_DESIGNER ) )
- rSet.DisableItem( nSID );
- break;
- }
+ rSet.DisableItem( nSID );
+ break;
+ }
- // Printer-Funktionen
- case SID_PRINTDOC:
- case SID_PRINTDOCDIRECT:
- case SID_SETUPPRINTER:
- case SID_PRINTER_NAME:
- {
+ // Printer-Funktionen
+ case SID_PRINTDOC:
+ case SID_PRINTDOCDIRECT:
+ case SID_SETUPPRINTER:
+ case SID_PRINTER_NAME:
+ {
bool bEnabled = pImp->m_bCanPrint && !pImp->m_nPrinterLocks;
- bEnabled = bEnabled && !Application::GetSettings().GetMiscSettings().GetDisablePrinting();
+ bEnabled = bEnabled && !Application::GetSettings().GetMiscSettings().GetDisablePrinting();
if ( bEnabled )
{
SfxPrinter *pPrinter = GetPrinter(FALSE);
@@ -804,68 +864,68 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
}
bEnabled = !pPrinter || !pPrinter->IsPrinting();
}
- if ( !bEnabled )
- {
- // will now be handled by requeing the request
- /* rSet.DisableItem( SID_PRINTDOC );
- rSet.DisableItem( SID_PRINTDOCDIRECT );
- rSet.DisableItem( SID_SETUPPRINTER ); */
- }
- break;
- }
+ if ( !bEnabled )
+ {
+ // will now be handled by requeing the request
+ /* rSet.DisableItem( SID_PRINTDOC );
+ rSet.DisableItem( SID_PRINTDOCDIRECT );
+ rSet.DisableItem( SID_SETUPPRINTER ); */
+ }
+ break;
+ }
- // Mail-Funktionen
- case SID_MAIL_SENDDOCASPDF:
- case SID_MAIL_SENDDOC:
+ // Mail-Funktionen
+ case SID_MAIL_SENDDOCASPDF:
+ case SID_MAIL_SENDDOC:
case SID_MAIL_SENDDOCASFORMAT:
- {
+ {
BOOL bEnable = !GetViewFrame()->HasChildWindow( SID_MAIL_CHILDWIN );
- if ( !bEnable )
- rSet.DisableItem( nSID );
- break;
- }
+ if ( !bEnable )
+ rSet.DisableItem( nSID );
+ break;
+ }
- // PlugIns running
- case SID_PLUGINS_ACTIVE:
- {
+ // PlugIns running
+ case SID_PLUGINS_ACTIVE:
+ {
rSet.Put( SfxBoolItem( SID_PLUGINS_ACTIVE,
!pImp->m_bPlugInsActive) );
- break;
- }
+ break;
+ }
/*
- // SelectionText
- case SID_SELECTION_TEXT:
- {
- rSet.Put( SfxStringItem( SID_SELECTION_TEXT, GetSelectionText() ) );
- break;
- }
+ // SelectionText
+ case SID_SELECTION_TEXT:
+ {
+ rSet.Put( SfxStringItem( SID_SELECTION_TEXT, GetSelectionText() ) );
+ break;
+ }
- // SelectionTextExt
- case SID_SELECTION_TEXT_EXT:
- {
- rSet.Put( SfxStringItem( SID_SELECTION_TEXT_EXT, GetSelectionText(TRUE) ) );
- break;
- }
+ // SelectionTextExt
+ case SID_SELECTION_TEXT_EXT:
+ {
+ rSet.Put( SfxStringItem( SID_SELECTION_TEXT_EXT, GetSelectionText(TRUE) ) );
+ break;
+ }
*/
- case SID_STYLE_FAMILY :
- {
+ case SID_STYLE_FAMILY :
+ {
rSet.Put( SfxUInt16Item( SID_STYLE_FAMILY, pImp->m_nFamily ) );
- break;
- }
+ break;
+ }
+ }
}
- }
}
//--------------------------------------------------------------------
void SfxViewShell::SetZoomFactor( const Fraction &rZoomX,
- const Fraction &rZoomY )
+ const Fraction &rZoomY )
{
- DBG_ASSERT( GetWindow(), "no window" );
- MapMode aMap( GetWindow()->GetMapMode() );
- aMap.SetScaleX( rZoomX );
- aMap.SetScaleY( rZoomY );
- GetWindow()->SetMapMode( aMap );
+ DBG_ASSERT( GetWindow(), "no window" );
+ MapMode aMap( GetWindow()->GetMapMode() );
+ aMap.SetScaleX( rZoomX );
+ aMap.SetScaleY( rZoomY );
+ GetWindow()->SetMapMode( aMap );
}
//--------------------------------------------------------------------
@@ -873,37 +933,37 @@ ErrCode SfxViewShell::DoVerb(long /*nVerb*/)
/* [Beschreibung]
- Virtuelle Methode, um am selektierten Objekt ein Verb auszuf"uhren.
+ Virtuelle Methode, um am selektierten Objekt ein Verb auszuf"uhren.
Da dieses Objekt nur den abgeleiteten Klassen bekannt ist, muss DoVerb
dort "uberschrieben werden.
*/
{
- return ERRCODE_SO_NOVERBS;
+ return ERRCODE_SO_NOVERBS;
}
//--------------------------------------------------------------------
void SfxViewShell::OutplaceActivated( sal_Bool bActive, SfxInPlaceClient* /*pClient*/ )
{
- if ( !bActive )
- GetFrame()->GetFrame().Appear();
+ if ( !bActive )
+ GetFrame()->GetFrame().Appear();
}
//--------------------------------------------------------------------
void SfxViewShell::InplaceActivating( SfxInPlaceClient* /*pClient*/ )
{
- // TODO/LATER: painting of the bitmap can be stopped, it is required if CLIPCHILDREN problem #i25788# is not solved,
- // but may be the bug will not affect the real office vcl windows, then it is not required
+ // TODO/LATER: painting of the bitmap can be stopped, it is required if CLIPCHILDREN problem #i25788# is not solved,
+ // but may be the bug will not affect the real office vcl windows, then it is not required
}
//--------------------------------------------------------------------
void SfxViewShell::InplaceDeactivated( SfxInPlaceClient* /*pClient*/ )
{
- // TODO/LATER: paint the replacement image in normal way if the painting was stopped
+ // TODO/LATER: paint the replacement image in normal way if the painting was stopped
}
//--------------------------------------------------------------------
@@ -943,26 +1003,26 @@ SfxInPlaceClient* SfxViewShell::FindIPClient
) const
{
SfxInPlaceClientList *pClients = GetIPClientList_Impl(FALSE);
- if ( !pClients )
- return 0;
+ if ( !pClients )
+ return 0;
- if( !pObjParentWin )
- pObjParentWin = GetWindow();
- for (USHORT n=0; n < pClients->Count(); n++)
- {
- SfxInPlaceClient *pIPClient = (SfxInPlaceClient*) pClients->GetObject(n);
+ if( !pObjParentWin )
+ pObjParentWin = GetWindow();
+ for (USHORT n=0; n < pClients->Count(); n++)
+ {
+ SfxInPlaceClient *pIPClient = (SfxInPlaceClient*) pClients->GetObject(n);
if ( pIPClient->GetObject() == xObj && pIPClient->GetEditWin() == pObjParentWin )
- return pIPClient;
- }
+ return pIPClient;
+ }
- return 0;
+ return 0;
}
//--------------------------------------------------------------------
SfxInPlaceClient* SfxViewShell::GetIPClient() const
{
- return GetUIActiveClient();
+ return GetUIActiveClient();
}
//--------------------------------------------------------------------
@@ -971,15 +1031,15 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const
{
// this method is needed as long as SFX still manages the border space for ChildWindows (see SfxFrame::Resize)
SfxInPlaceClientList *pClients = GetIPClientList_Impl(FALSE);
- if ( !pClients )
- return 0;
+ if ( !pClients )
+ return 0;
- for (USHORT n=0; n < pClients->Count(); n++)
- {
+ for (USHORT n=0; n < pClients->Count(); n++)
+ {
SfxInPlaceClient* pIPClient = pClients->GetObject(n);
if ( pIPClient->IsUIActive() )
return pIPClient;
- }
+ }
return NULL;
}
@@ -987,15 +1047,15 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const
SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const
{
SfxInPlaceClientList *pClients = GetIPClientList_Impl(FALSE);
- if ( !pClients )
- return 0;
+ if ( !pClients )
+ return 0;
- for (USHORT n=0; n < pClients->Count(); n++)
- {
+ for (USHORT n=0; n < pClients->Count(); n++)
+ {
SfxInPlaceClient* pIPClient = pClients->GetObject(n);
if ( pIPClient->IsObjectUIActive() )
return pIPClient;
- }
+ }
return NULL;
}
@@ -1004,34 +1064,34 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const
void SfxViewShell::Activate( BOOL bMDI )
{
- DBG_CHKTHIS(SfxViewShell, 0);
- if ( bMDI )
- {
- SfxObjectShell *pSh = GetViewFrame()->GetObjectShell();
- if ( pSh->GetModel().is() )
- pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame().GetController() );
+ DBG_CHKTHIS(SfxViewShell, 0);
+ if ( bMDI )
+ {
+ SfxObjectShell *pSh = GetViewFrame()->GetObjectShell();
+ if ( pSh->GetModel().is() )
+ pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame().GetController() );
SetCurrentDocument();
- }
+ }
}
//--------------------------------------------------------------------
void SfxViewShell::Deactivate(BOOL /*bMDI*/)
{
- DBG_CHKTHIS(SfxViewShell, 0);
+ DBG_CHKTHIS(SfxViewShell, 0);
}
//--------------------------------------------------------------------
void SfxViewShell::AdjustPosSizePixel
(
- const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
- const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
+ const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
+ const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
)
{
- DBG_CHKTHIS(SfxViewShell, 0);
+ DBG_CHKTHIS(SfxViewShell, 0);
}
//--------------------------------------------------------------------
@@ -1040,18 +1100,18 @@ void SfxViewShell::Move()
/* [Beschreibung]
- Diese virtuelle Methode wird gerufen, wenn das Fenster, in dem die
- SfxViewShell dargestellt wird eine StarView-Move() Nachricht erh"alt.
+ Diese virtuelle Methode wird gerufen, wenn das Fenster, in dem die
+ SfxViewShell dargestellt wird eine StarView-Move() Nachricht erh"alt.
- Die Basisimplementierung braucht nicht gerufen zu werden.
+ Die Basisimplementierung braucht nicht gerufen zu werden.
- [Anmerkung]
+ [Anmerkung]
- Diese Methode kann dazu verwendet werden, eine Selektion abzubrechen,
- um durch das Moven des Fensters erzeugte Maus-Bewegungen anzufangen.
+ Diese Methode kann dazu verwendet werden, eine Selektion abzubrechen,
+ um durch das Moven des Fensters erzeugte Maus-Bewegungen anzufangen.
- Zur Zeit funktioniert die Benachrichtigung nicht In-Place.
+ Zur Zeit funktioniert die Benachrichtigung nicht In-Place.
*/
{
@@ -1061,102 +1121,102 @@ void SfxViewShell::Move()
void SfxViewShell::OuterResizePixel
(
- const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
- const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
+ const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
+ const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
)
/* [Beschreibung]
Diese Methode muss ueberladen werden, um auf "Anderungen der Groesse
- der View zu reagieren. Dabei definieren wir die View als das Edit-Window
- zuz"uglich der um das Edit-Window angeordnenten Tools (z.B. Lineale).
+ der View zu reagieren. Dabei definieren wir die View als das Edit-Window
+ zuz"uglich der um das Edit-Window angeordnenten Tools (z.B. Lineale).
- Das Edit-Window darf weder in Gr"o\se noch Position ver"andert werden.
+ Das Edit-Window darf weder in Gr"o\se noch Position ver"andert werden.
- Die Vis-Area der SfxObjectShell, dessen Skalierung und Position
- d"urfen hier ver"andert werden. Der Hauptanwendungsfall ist dabei,
- das Ver"andern der Gr"o\se der Vis-Area.
+ Die Vis-Area der SfxObjectShell, dessen Skalierung und Position
+ d"urfen hier ver"andert werden. Der Hauptanwendungsfall ist dabei,
+ das Ver"andern der Gr"o\se der Vis-Area.
- "Andert sich durch die neue Berechnung der Border, so mu\s dieser
- mit <SfxViewShell::SetBorderPixel(const SvBorder&)> gesetzt werden.
- Erst nach Aufruf von 'SetBorderPixel' ist das Positionieren von
- Tools erlaubt.
+ "Andert sich durch die neue Berechnung der Border, so mu\s dieser
+ mit <SfxViewShell::SetBorderPixel(const SvBorder&)> gesetzt werden.
+ Erst nach Aufruf von 'SetBorderPixel' ist das Positionieren von
+ Tools erlaubt.
- [Beispiel]
+ [Beispiel]
- void AppViewSh::OuterViewResizePixel( const Point &rOfs, const Size &rSz )
- {
- // Tool-Positionen und Gr"o\sen von au\sen berechnen, NICHT setzen!
- // (wegen folgender Border-Berechnung)
- Point aHLinPos...; Size aHLinSz...;
- ...
-
- // Border f"ur Tools passend zu rSize berechnen und setzen
- SvBorder aBorder...
- SetBorderPixel( aBorder ); // ab jetzt sind Positionierungen erlaubt
-
- // Tools anordnen
- pHLin->SetPosSizePixel( aHLinPos, aHLinSz );
- ...
- }
+ void AppViewSh::OuterViewResizePixel( const Point &rOfs, const Size &rSz )
+ {
+ // Tool-Positionen und Gr"o\sen von au\sen berechnen, NICHT setzen!
+ // (wegen folgender Border-Berechnung)
+ Point aHLinPos...; Size aHLinSz...;
+ ...
+
+ // Border f"ur Tools passend zu rSize berechnen und setzen
+ SvBorder aBorder...
+ SetBorderPixel( aBorder ); // ab jetzt sind Positionierungen erlaubt
+
+ // Tools anordnen
+ pHLin->SetPosSizePixel( aHLinPos, aHLinSz );
+ ...
+ }
- [Querverweise]
+ [Querverweise]
- <SfxViewShell::InnerResizePixel(const Point&,const Size& rSize)>
+ <SfxViewShell::InnerResizePixel(const Point&,const Size& rSize)>
*/
{
- DBG_CHKTHIS(SfxViewShell, 0);
- SetBorderPixel( SvBorder() );
+ DBG_CHKTHIS(SfxViewShell, 0);
+ SetBorderPixel( SvBorder() );
}
//--------------------------------------------------------------------
void SfxViewShell::InnerResizePixel
(
- const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
- const Size& /*rSize*/ // dem Edit-Win zur Verf"ugung stehende Gr"o\se
+ const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
+ const Size& /*rSize*/ // dem Edit-Win zur Verf"ugung stehende Gr"o\se
)
/* [Beschreibung]
Diese Methode muss ueberladen werden, um auf "Anderungen der Groesse
- des Edit-Windows zu reagieren.
+ des Edit-Windows zu reagieren.
- Das Edit-Window darf weder in Gr"o\se noch Position ver"andert werden.
- Weder die Vis-Area der SfxObjectShell noch dessen Skalierung oder
- Position d"urfen ver"andert werden.
+ Das Edit-Window darf weder in Gr"o\se noch Position ver"andert werden.
+ Weder die Vis-Area der SfxObjectShell noch dessen Skalierung oder
+ Position d"urfen ver"andert werden.
- "Andert sich durch die neue Berechnung der Border, so mu\s dieser
- mit <SfxViewShell::SetBorderPixel(const SvBorder&)> gesetzt werden.
- Erst nach Aufruf von 'SetBorderPixel' ist das Positionieren von
- Tools erlaubt.
+ "Andert sich durch die neue Berechnung der Border, so mu\s dieser
+ mit <SfxViewShell::SetBorderPixel(const SvBorder&)> gesetzt werden.
+ Erst nach Aufruf von 'SetBorderPixel' ist das Positionieren von
+ Tools erlaubt.
- [Beispiel]
+ [Beispiel]
- void AppViewSh::InnerViewResizePixel( const Point &rOfs, const Size &rSz )
- {
- // Tool-Positionen und Gr"o\sen von innen berechnen, NICHT setzen!
- // (wegen folgender Border-Berechnung)
- Point aHLinPos...; Size aHLinSz...;
- ...
-
- // Border f"ur Tools passend zu rSz berechnen und setzen
- SvBorder aBorder...
- SetBorderPixel( aBorder ); // ab jetzt sind Positionierungen erlaubt
-
- // Tools anordnen
- pHLin->SetPosSizePixel( aHLinPos, aHLinSz );
- ...
- }
+ void AppViewSh::InnerViewResizePixel( const Point &rOfs, const Size &rSz )
+ {
+ // Tool-Positionen und Gr"o\sen von innen berechnen, NICHT setzen!
+ // (wegen folgender Border-Berechnung)
+ Point aHLinPos...; Size aHLinSz...;
+ ...
+
+ // Border f"ur Tools passend zu rSz berechnen und setzen
+ SvBorder aBorder...
+ SetBorderPixel( aBorder ); // ab jetzt sind Positionierungen erlaubt
+
+ // Tools anordnen
+ pHLin->SetPosSizePixel( aHLinPos, aHLinSz );
+ ...
+ }
- [Querverweise]
+ [Querverweise]
- <SfxViewShell::OuterResizePixel(const Point&,const Size& rSize)>
+ <SfxViewShell::OuterResizePixel(const Point&,const Size& rSize)>
*/
{
@@ -1216,11 +1276,11 @@ void SfxViewShell::SetWindow
/* [Beschreibung]
- Mit dieser Methode wird der SfxViewShell das Datenfenster mitgeteilt.
- Dieses wird f"ur den In-Place-Container und f"ur das korrekte
- Wiederherstellen des Focus ben"otigt.
+ Mit dieser Methode wird der SfxViewShell das Datenfenster mitgeteilt.
+ Dieses wird f"ur den In-Place-Container und f"ur das korrekte
+ Wiederherstellen des Focus ben"otigt.
- Selbst In-Place-aktiv ist das Umsetzen des ViewPort-Windows verboten.
+ Selbst In-Place-aktiv ist das Umsetzen des ViewPort-Windows verboten.
*/
{
@@ -1245,9 +1305,9 @@ void SfxViewShell::SetWindow
if ( bHadFocus && pWindow )
pWindow->GrabFocus();
- //TODO/CLEANUP
- //brauchen wir die Methode doch noch?!
- //SFX_APP()->GrabFocus( pWindow );
+ //TODO/CLEANUP
+ //brauchen wir die Methode doch noch?!
+ //SFX_APP()->GrabFocus( pWindow );
}
//--------------------------------------------------------------------
@@ -1262,18 +1322,17 @@ Size SfxViewShell::GetOptimalSizePixel() const
SfxViewShell::SfxViewShell
(
- SfxViewFrame* pViewFrame, /* <SfxViewFrame>, in dem diese View
- dargestellt wird */
+ SfxViewFrame* pViewFrame, /* <SfxViewFrame>, in dem diese View dargestellt wird */
USHORT nFlags /* siehe <SfxViewShell-Flags> */
)
: SfxShell(this)
, pImp( new SfxViewShell_Impl(nFlags) )
- ,pIPClientList( 0 )
- ,pFrame(pViewFrame)
- ,pSubShell(0)
- ,pWindow(0)
- ,bNoNewWindow( 0 != (nFlags & SFX_VIEW_NO_NEWWINDOW) )
+ ,pIPClientList( 0 )
+ ,pFrame(pViewFrame)
+ ,pSubShell(0)
+ ,pWindow(0)
+ ,bNoNewWindow( 0 != (nFlags & SFX_VIEW_NO_NEWWINDOW) )
{
DBG_CTOR(SfxViewShell, 0);
@@ -1382,12 +1441,12 @@ SfxViewShell* SfxViewShell::Get( const Reference< XController>& i_rController )
SdrView* SfxViewShell::GetDrawView() const
-/* [Beschreibung]
+/* [Beschreibung]
- Diese virtuelle Methode mu\s von den Subklassen "uberladen werden, wenn
- der Property-Editor zur Verf"ugung stehen soll.
+ Diese virtuelle Methode mu\s von den Subklassen "uberladen werden, wenn
+ der Property-Editor zur Verf"ugung stehen soll.
- Die Default-Implementierung liefert immer 0.
+ Die Default-Implementierung liefert immer 0.
*/
{
@@ -1398,27 +1457,27 @@ SdrView* SfxViewShell::GetDrawView() const
String SfxViewShell::GetSelectionText
(
- BOOL /*bCompleteWords*/ /* FALSE (default)
- Nur der tats"achlich selektierte Text wird
- zur"uckgegeben.
-
- TRUE
- Der selektierte Text wird soweit erweitert,
- da\s nur ganze W"orter zur"uckgegeben werden.
- Als Worttrenner gelten White-Spaces und die
+ BOOL /*bCompleteWords*/ /* FALSE (default)
+ Nur der tats"achlich selektierte Text wird
+ zur"uckgegeben.
+
+ TRUE
+ Der selektierte Text wird soweit erweitert,
+ da\s nur ganze W"orter zur"uckgegeben werden.
+ Als Worttrenner gelten White-Spaces und die
Satzzeichen ".,;" sowie einfache und doppelte
- Anf"uhrungszeichen.
- */
+ Anf"uhrungszeichen.
+ */
)
/* [Beschreibung]
- Diese Methode kann von Anwendungsprogrammierer "uberladen werden,
- um einen Text zur"uckzuliefern, der in der aktuellen Selektion
- steht. Dieser wird z.B. beim Versenden (email) verwendet.
+ Diese Methode kann von Anwendungsprogrammierer "uberladen werden,
+ um einen Text zur"uckzuliefern, der in der aktuellen Selektion
+ steht. Dieser wird z.B. beim Versenden (email) verwendet.
Mit "CompleteWords == TRUE" ger"ufen, reicht z.B. auch der Cursor,
- der in einer URL steht, um die gesamte URL zu liefern.
+ der in einer URL steht, um die gesamte URL zu liefern.
*/
{
@@ -1431,9 +1490,9 @@ BOOL SfxViewShell::HasSelection( BOOL ) const
/* [Beschreibung]
- Mit dieser virtuellen Methode kann z.B. ein Dialog abfragen, ob in der
- aktuellen View etwas selektiert ist. Wenn der Parameter <BOOL> TRUE ist,
- wird abgefragt, ob Text selektiert ist.
+ Mit dieser virtuellen Methode kann z.B. ein Dialog abfragen, ob in der
+ aktuellen View etwas selektiert ist. Wenn der Parameter <BOOL> TRUE ist,
+ wird abgefragt, ob Text selektiert ist.
*/
{
@@ -1446,16 +1505,16 @@ void SfxViewShell::SetSubShell( SfxShell *pShell )
/* [Beschreibung]
- Mit dieser Methode kann eine Selektions- oder Cursor-Shell angemeldet
- werden, die automatisch unmittelbar nach der SfxViewShell auf den
- SfxDispatcher gepusht wird, und automatisch umittelbar vor ihr
- gepoppt wird.
+ Mit dieser Methode kann eine Selektions- oder Cursor-Shell angemeldet
+ werden, die automatisch unmittelbar nach der SfxViewShell auf den
+ SfxDispatcher gepusht wird, und automatisch umittelbar vor ihr
+ gepoppt wird.
- Ist die SfxViewShell-Instanz bereits gepusht, dann wird pShell
- sofort ebenfalls gepusht. Wird mit SetSubShell eine andere SfxShell
- Instanz angemeldet, als vorher angemeldet war, wird die zuvor angemeldete
- ggf. automatisch gepoppt. Mit pShell==0 kann daher die aktuelle
- Sub-Shell abgemeldet werden.
+ Ist die SfxViewShell-Instanz bereits gepusht, dann wird pShell
+ sofort ebenfalls gepusht. Wird mit SetSubShell eine andere SfxShell
+ Instanz angemeldet, als vorher angemeldet war, wird die zuvor angemeldete
+ ggf. automatisch gepoppt. Mit pShell==0 kann daher die aktuelle
+ Sub-Shell abgemeldet werden.
*/
{
@@ -1557,6 +1616,7 @@ void SfxViewShell::ReadUserData(const String&, BOOL )
void SfxViewShell::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool )
{
}
+
void SfxViewShell::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool )
{
}
@@ -1567,8 +1627,8 @@ void SfxViewShell::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::c
SfxViewShell* SfxViewShell::GetFirst
(
- const TypeId* pType,
- BOOL bOnlyVisible
+ const TypeId* pType,
+ BOOL bOnlyVisible
)
{
// search for a SfxViewShell of the specified type
@@ -1604,9 +1664,9 @@ SfxViewShell* SfxViewShell::GetFirst
SfxViewShell* SfxViewShell::GetNext
(
- const SfxViewShell& rPrev,
- const TypeId* pType,
- BOOL bOnlyVisible
+ const SfxViewShell& rPrev,
+ const TypeId* pType,
+ BOOL bOnlyVisible
)
{
SfxViewShellArr_Impl &rShells = SFX_APP()->GetViewShells_Impl();
@@ -1702,24 +1762,24 @@ FASTBOOL SfxViewShell::KeyInput( const KeyEvent &rKeyEvent )
/* [Beschreibung]
- Diese Methode f"uhrt das KeyEvent 'rKeyEvent' "uber die an dieser
- SfxViewShell direkt oder indirekt (z.B. via Applikation) konfigurierten
- Tasten (Accelerator) aus.
+ Diese Methode f"uhrt das KeyEvent 'rKeyEvent' "uber die an dieser
+ SfxViewShell direkt oder indirekt (z.B. via Applikation) konfigurierten
+ Tasten (Accelerator) aus.
- [R"uckgabewert]
+ [R"uckgabewert]
- FASTBOOL TRUE
- die Taste ist konfiguriert, der betreffende
- Handler wurde gerufen
+ FASTBOOL TRUE
+ die Taste ist konfiguriert, der betreffende
+ Handler wurde gerufen
- FALSE
- die Taste ist nicht konfiguriert, es konnte
- also kein Handler gerufen werden
+ FALSE
+ die Taste ist nicht konfiguriert, es konnte
+ also kein Handler gerufen werden
- [Querverweise]
- <SfxApplication::KeyInput(const KeyEvent&)>
+ [Querverweise]
+ <SfxApplication::KeyInput(const KeyEvent&)>
*/
{
return ExecKey_Impl(rKeyEvent);
@@ -1736,9 +1796,9 @@ void SfxViewShell::ShowCursor( FASTBOOL /*bOn*/ )
/* [Beschreibung]
- Diese Methode mu\s von Subklassen "uberladen werden, damit vom SFx
- aus der Cursor ein- und ausgeschaltet werden kann. Dies geschieht
- z.B. bei laufendem <SfxProgress>.
+ Diese Methode mu\s von Subklassen "uberladen werden, damit vom SFx
+ aus der Cursor ein- und ausgeschaltet werden kann. Dies geschieht
+ z.B. bei laufendem <SfxProgress>.
*/
{
@@ -1750,15 +1810,15 @@ void SfxViewShell::GotFocus() const
/* [Beschreibung]
- Diese Methode mu\s vom Applikationsentwickler gerufen werden, wenn
- das Edit-Window den Focus erhalten hat. Der SFx hat so z.B. die
- M"oglichkeit, den Accelerator einzuschalten.
+ Diese Methode mu\s vom Applikationsentwickler gerufen werden, wenn
+ das Edit-Window den Focus erhalten hat. Der SFx hat so z.B. die
+ M"oglichkeit, den Accelerator einzuschalten.
- [Anmerkung]
+ [Anmerkung]
- <StarView> liefert leider keine M"oglichkeit, solche Events
- 'von der Seite' einzuh"angen.
+ <StarView> liefert leider keine M"oglichkeit, solche Events
+ 'von der Seite' einzuh"angen.
*/
{
@@ -1838,10 +1898,10 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan
// this method is called when either a client is created or the "Edit/Plugins" checkbox is checked
if ( !pIPClient->IsObjectInPlaceActive() && pImp->m_bPlugInsActive )
{
- // object in client is currently not active
- // check if the object wants to be activated always or when it becomes at least partially visible
- // TODO/LATER: maybe we should use the scaled area instead of the ObjArea?!
- if ( bAlwaysActive || (bActiveWhenVisible && rVisArea.IsOver(pIPClient->GetObjArea())) )
+ // object in client is currently not active
+ // check if the object wants to be activated always or when it becomes at least partially visible
+ // TODO/LATER: maybe we should use the scaled area instead of the ObjArea?!
+ if ( bAlwaysActive || (bActiveWhenVisible && rVisArea.IsOver(pIPClient->GetObjArea())) )
{
try
{
@@ -1854,11 +1914,11 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan
}
else if (!pImp->m_bPlugInsActive)
{
- // object in client is currently active and "Edit/Plugins" checkbox is selected
- // check if the object wants to be activated always or when it becomes at least partially visible
+ // object in client is currently active and "Edit/Plugins" checkbox is selected
+ // check if the object wants to be activated always or when it becomes at least partially visible
// in this case selecting of the "Edit/Plugin" checkbox should let such objects deactivate
- if ( bAlwaysActive || bActiveWhenVisible )
- pIPClient->GetObject()->changeState( embed::EmbedStates::RUNNING );
+ if ( bAlwaysActive || bActiveWhenVisible )
+ pIPClient->GetObject()->changeState( embed::EmbedStates::RUNNING );
}
}
@@ -1874,9 +1934,9 @@ void SfxViewShell::DiscardClients_Impl()
/* [Beschreibung]
- Diese Methode dient dazu, vor dem Schlie\sen eines Dokuments das
- Speichern der Objekte zu verhindern, wenn der Benutzer Schlie\en ohne
- Speichern gew"ahlt hatte.
+ Diese Methode dient dazu, vor dem Schlie\sen eines Dokuments das
+ Speichern der Objekte zu verhindern, wenn der Benutzer Schlie\en ohne
+ Speichern gew"ahlt hatte.
*/
{
@@ -1982,9 +2042,9 @@ void SfxViewShell::JumpToMark( const String& rMark )
{
SfxStringItem aMarkItem( SID_JUMPTOMARK, rMark );
GetViewFrame()->GetDispatcher()->Execute(
- SID_JUMPTOMARK,
- SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
- &aMarkItem, 0L );
+ SID_JUMPTOMARK,
+ SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
+ &aMarkItem, 0L );
}
//------------------------------------------------------------------------
@@ -2005,8 +2065,7 @@ void SfxViewShell::SetController( SfxBaseController* pController )
if ( pImp->xClipboardListener.is() )
pImp->xClipboardListener->DisconnectViewShell();
- pImp->xClipboardListener = new SfxClipboardChangeListener( this );
- AddRemoveClipboardListener( pImp->xClipboardListener.get(), TRUE );
+ pImp->xClipboardListener = new SfxClipboardChangeListener( this, GetClipboardNotifier() );
}
Reference < XController > SfxViewShell::GetController()
@@ -2072,19 +2131,19 @@ void Change( Menu* pMenu, SfxViewShell* pView )
}
-BOOL SfxViewShell::TryContextMenuInterception( Menu& rIn, const ::rtl::OUString& rMenuIdentifier, Menu*& rpOut, ::com::sun::star::ui::ContextMenuExecuteEvent aEvent )
+BOOL SfxViewShell::TryContextMenuInterception( Menu& rIn, const ::rtl::OUString& rMenuIdentifier, Menu*& rpOut, ui::ContextMenuExecuteEvent aEvent )
{
rpOut = NULL;
BOOL bModified = FALSE;
// create container from menu
- // #110897#
+ // #110897#
// aEvent.ActionTriggerContainer = ::framework::ActionTriggerHelper::CreateActionTriggerContainerFromMenu( &rIn );
aEvent.ActionTriggerContainer = ::framework::ActionTriggerHelper::CreateActionTriggerContainerFromMenu(
::comphelper::getProcessServiceFactory(), &rIn, &rMenuIdentifier );
// get selection from controller
- aEvent.Selection = ::com::sun::star::uno::Reference < ::com::sun::star::view::XSelectionSupplier > ( GetController(), ::com::sun::star::uno::UNO_QUERY );
+ aEvent.Selection = uno::Reference < view::XSelectionSupplier > ( GetController(), uno::UNO_QUERY );
// call interceptors
::cppu::OInterfaceIteratorHelper aIt( pImp->aInterceptorContainer );
@@ -2092,22 +2151,22 @@ BOOL SfxViewShell::TryContextMenuInterception( Menu& rIn, const ::rtl::OUString&
{
try
{
- ::com::sun::star::ui::ContextMenuInterceptorAction eAction =
- ((::com::sun::star::ui::XContextMenuInterceptor*)aIt.next())->notifyContextMenuExecute( aEvent );
+ ui::ContextMenuInterceptorAction eAction =
+ ((ui::XContextMenuInterceptor*)aIt.next())->notifyContextMenuExecute( aEvent );
switch ( eAction )
{
- case ::com::sun::star::ui::ContextMenuInterceptorAction_CANCELLED :
+ case ui::ContextMenuInterceptorAction_CANCELLED :
// interceptor does not want execution
return FALSE;
- case ::com::sun::star::ui::ContextMenuInterceptorAction_EXECUTE_MODIFIED :
+ case ui::ContextMenuInterceptorAction_EXECUTE_MODIFIED :
// interceptor wants his modified menu to be executed
bModified = TRUE;
break;
- case ::com::sun::star::ui::ContextMenuInterceptorAction_CONTINUE_MODIFIED :
+ case ui::ContextMenuInterceptorAction_CONTINUE_MODIFIED :
// interceptor has modified menu, but allows for calling other interceptors
bModified = TRUE;
continue;
- case ::com::sun::star::ui::ContextMenuInterceptorAction_IGNORED :
+ case ui::ContextMenuInterceptorAction_IGNORED :
// interceptor is indifferent
continue;
default:
@@ -2115,7 +2174,7 @@ BOOL SfxViewShell::TryContextMenuInterception( Menu& rIn, const ::rtl::OUString&
continue;
}
}
- catch( ::com::sun::star::uno::RuntimeException& )
+ catch( uno::RuntimeException& )
{
aIt.remove();
}
@@ -2154,8 +2213,8 @@ void SfxViewShell::CheckOwnerShip_Impl()
BOOL bSuccess = FALSE;
if (pImp->m_bGotOwnership)
{
- com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xModel(
- GetObjectShell()->GetModel(), com::sun::star::uno::UNO_QUERY );
+ uno::Reference < util::XCloseable > xModel(
+ GetObjectShell()->GetModel(), uno::UNO_QUERY );
if ( xModel.is() )
{
try
@@ -2164,7 +2223,7 @@ void SfxViewShell::CheckOwnerShip_Impl()
xModel->close( sal_True );
bSuccess = TRUE;
}
- catch ( com::sun::star::util::CloseVetoException& )
+ catch ( util::CloseVetoException& )
{
}
}
@@ -2173,15 +2232,15 @@ void SfxViewShell::CheckOwnerShip_Impl()
if (!bSuccess && pImp->m_bGotFrameOwnership)
{
// document couldn't be closed or it shouldn't, now try at least to close the frame
- com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xFrame(
- GetViewFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
+ uno::Reference < util::XCloseable > xFrame(
+ GetViewFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
if ( xFrame.is() )
{
try
{
xFrame->close( sal_True );
}
- catch ( com::sun::star::util::CloseVetoException& )
+ catch ( util::CloseVetoException& )
{
}
}
@@ -2191,9 +2250,7 @@ void SfxViewShell::CheckOwnerShip_Impl()
long SfxViewShell::HandleNotifyEvent_Impl( NotifyEvent& rEvent )
{
if (pImp->m_pController.is())
- {
return pImp->m_pController->HandleEvent_Impl( rEvent );
- }
return 0;
}
@@ -2212,7 +2269,7 @@ BOOL SfxViewShell::HasMouseClickListeners_Impl()
void SfxViewShell::SetAdditionalPrintOptions( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
{
pImp->aPrintOpts = rOpts;
-// GetObjectShell()->Broadcast( SfxPrintingHint( -3, NULL, NULL, rOpts ) );
+// GetObjectShell()->Broadcast( SfxPrintingHint( -3, NULL, NULL, rOpts ) );
}
BOOL SfxViewShell::Escape()
@@ -2228,11 +2285,20 @@ Reference< view::XRenderable > SfxViewShell::GetRenderable()
{
Reference< frame::XModel > xModel( pObj->GetModel() );
if( xModel.is() )
- xRender = Reference< view::XRenderable >( xModel, UNO_QUERY );
+ xRender = Reference< view::XRenderable >( xModel, UNO_QUERY );
}
return xRender;
}
+uno::Reference< datatransfer::clipboard::XClipboardNotifier > SfxViewShell::GetClipboardNotifier()
+{
+ uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClipboardNotifier;
+ if ( GetViewFrame() )
+ xClipboardNotifier = uno::Reference< datatransfer::clipboard::XClipboardNotifier >( GetViewFrame()->GetWindow().GetClipboard(), uno::UNO_QUERY );
+
+ return xClipboardNotifier;
+}
+
void SfxViewShell::AddRemoveClipboardListener( const uno::Reference < datatransfer::clipboard::XClipboardListener >& rClp, BOOL bAdd )
{
try
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index c0ce3bebad..52f88a4807 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -1805,14 +1805,26 @@ shell::write( sal_Int32 CommandId,
{
aFile.close();
err = aFile.open( OpenFlag_Write );
- }
- if( err != osl::FileBase::E_None )
- {
- installError( CommandId,
- TASKHANDLING_NO_OPEN_FILE_FOR_OVERWRITE,
- err );
- return sal_False;
+ if( err != osl::FileBase::E_None )
+ {
+ installError( CommandId,
+ TASKHANDLING_NO_OPEN_FILE_FOR_OVERWRITE,
+ err );
+ return sal_False;
+ }
+
+ // the existing file was just opened and should be overwritten now,
+ // truncate it first
+
+ err = aFile.setSize( 0 );
+ if( err != osl::FileBase::E_None )
+ {
+ installError( CommandId,
+ TASKHANDLING_FILESIZE_FOR_WRITE,
+ err );
+ return sal_False;
+ }
}
}
else
@@ -1844,7 +1856,6 @@ shell::write( sal_Int32 CommandId,
sal_Bool bSuccess = sal_True;
- sal_uInt64 nTotalNumberOfBytes = 0;
sal_uInt64 nWrittenBytes;
sal_Int32 nReadBytes = 0, nRequestedBytes = 32768 /*32k*/;
uno::Sequence< sal_Int8 > seq( nRequestedBytes );
@@ -1901,20 +1912,9 @@ shell::write( sal_Int32 CommandId,
bSuccess = sal_False;
break;
}
-
- nTotalNumberOfBytes += nWrittenBytes;
}
} while( nReadBytes == nRequestedBytes );
- err = aFile.setSize( nTotalNumberOfBytes );
- if( err != osl::FileBase::E_None )
- {
- installError( CommandId,
- TASKHANDLING_FILESIZE_FOR_WRITE,
- err );
- bSuccess = sal_False;
- }
-
err = aFile.close();
if( err != osl::FileBase::E_None )
{
diff --git a/uui/source/filechanged.src b/uui/source/filechanged.src
index b566f6344b..d538d6c445 100644
--- a/uui/source/filechanged.src
+++ b/uui/source/filechanged.src
@@ -33,7 +33,7 @@
String STR_FILECHANGED_TITLE
{
- Text = "Document Has Been Changed by Others";
+ Text [ en-US ] = "Document Has Been Changed by Others";
};
String STR_FILECHANGED_MSG
{