Kaydet (Commit) ecf9b211 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

No need for a command ID

...as there is no infrastructure to abort ucbhelper commands anyway

Change-Id: I7796386a4b931c24ff2cc66a706d5c0182cb82e5
üst 0f599b89
...@@ -173,14 +173,13 @@ friend class ContentEventListener_Impl; ...@@ -173,14 +173,13 @@ friend class ContentEventListener_Impl;
Reference< XCommandEnvironment > m_xEnv; Reference< XCommandEnvironment > m_xEnv;
Reference< XContentEventListener > m_xContentEventListener; Reference< XContentEventListener > m_xContentEventListener;
mutable osl::Mutex m_aMutex; mutable osl::Mutex m_aMutex;
sal_Int32 m_nCommandId;
private: private:
void reinit( const Reference< XContent >& xContent ); void reinit( const Reference< XContent >& xContent );
void disposing(const EventObject& Source); void disposing(const EventObject& Source);
public: public:
Content_Impl() : m_nCommandId( 0 ) {}; Content_Impl() {};
Content_Impl( const Reference< XComponentContext >& rCtx, Content_Impl( const Reference< XComponentContext >& rCtx,
const Reference< XContent >& rContent, const Reference< XContent >& rContent,
const Reference< XCommandEnvironment >& rEnv ); const Reference< XCommandEnvironment >& rEnv );
...@@ -190,7 +189,6 @@ public: ...@@ -190,7 +189,6 @@ public:
const rtl::OUString& getURL() const; const rtl::OUString& getURL() const;
Reference< XContent > getContent(); Reference< XContent > getContent();
Reference< XCommandProcessor > getCommandProcessor(); Reference< XCommandProcessor > getCommandProcessor();
sal_Int32 getCommandId();
Reference< XComponentContext > getComponentContext() Reference< XComponentContext > getComponentContext()
{ assert(m_xCtx.is()); return m_xCtx; } { assert(m_xCtx.is()); return m_xCtx; }
...@@ -1088,8 +1086,7 @@ Content_Impl::Content_Impl( const Reference< XComponentContext >& rCtx, ...@@ -1088,8 +1086,7 @@ Content_Impl::Content_Impl( const Reference< XComponentContext >& rCtx,
const Reference< XCommandEnvironment >& rEnv ) const Reference< XCommandEnvironment >& rEnv )
: m_xCtx( rCtx ), : m_xCtx( rCtx ),
m_xContent( rContent ), m_xContent( rContent ),
m_xEnv( rEnv ), m_xEnv( rEnv )
m_nCommandId( 0 )
{ {
assert(rCtx.is()); assert(rCtx.is());
if ( m_xContent.is() ) if ( m_xContent.is() )
...@@ -1111,7 +1108,6 @@ void Content_Impl::reinit( const Reference< XContent >& xContent ) ...@@ -1111,7 +1108,6 @@ void Content_Impl::reinit( const Reference< XContent >& xContent )
osl::MutexGuard aGuard( m_aMutex ); osl::MutexGuard aGuard( m_aMutex );
m_xCommandProcessor = 0; m_xCommandProcessor = 0;
m_nCommandId = 0;
// #92581# - Don't reset m_aURL!!! // #92581# - Don't reset m_aURL!!!
...@@ -1175,7 +1171,6 @@ void Content_Impl::disposing( const EventObject& Source ) ...@@ -1175,7 +1171,6 @@ void Content_Impl::disposing( const EventObject& Source )
xContent = m_xContent; xContent = m_xContent;
m_nCommandId = 0;
m_aURL = rtl::OUString(); m_aURL = rtl::OUString();
m_xCommandProcessor = 0; m_xCommandProcessor = 0;
m_xContent = 0; m_xContent = 0;
...@@ -1266,24 +1261,6 @@ Reference< XCommandProcessor > Content_Impl::getCommandProcessor() ...@@ -1266,24 +1261,6 @@ Reference< XCommandProcessor > Content_Impl::getCommandProcessor()
return m_xCommandProcessor; return m_xCommandProcessor;
} }
//=========================================================================
sal_Int32 Content_Impl::getCommandId()
{
if ( m_nCommandId == 0 )
{
osl::MutexGuard aGuard( m_aMutex );
if ( m_nCommandId == 0 )
{
Reference< XCommandProcessor > xProc = getCommandProcessor();
if ( xProc.is() )
m_nCommandId = xProc->createCommandIdentifier();
}
}
return m_nCommandId;
}
//========================================================================= //=========================================================================
Any Content_Impl::executeCommand( const Command& rCommand ) Any Content_Impl::executeCommand( const Command& rCommand )
{ {
...@@ -1292,7 +1269,7 @@ Any Content_Impl::executeCommand( const Command& rCommand ) ...@@ -1292,7 +1269,7 @@ Any Content_Impl::executeCommand( const Command& rCommand )
return Any(); return Any();
// Execute command // Execute command
return xProc->execute( rCommand, getCommandId(), m_xEnv ); return xProc->execute( rCommand, 0, m_xEnv );
} }
//========================================================================= //=========================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment