summaryrefslogtreecommitdiff
path: root/framework/source/uielement
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-03-29 14:20:59 +0000
committerRüdiger Timm <rt@openoffice.org>2005-03-29 14:20:59 +0000
commita7350ec02a1943ee216874e0693a7fe5eceb088b (patch)
tree2952d636dd727f9d7be5176768904cab8617c882 /framework/source/uielement
parent5458d21d11e41e5d29d92930ea912107ce353f7e (diff)
INTEGRATION: CWS sj17 (1.8.22); FILE MERGED
2005/03/09 17:06:52 sj 1.8.22.1: #i37687# fixed status update for master/slave commandos
Diffstat (limited to 'framework/source/uielement')
-rw-r--r--framework/source/uielement/generictoolbarcontroller.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx
index ff658b630620..30eb82720280 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: generictoolbarcontroller.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: kz $ $Date: 2005-03-21 13:27:57 $
+ * last change: $Author: rt $ $Date: 2005-03-29 15:20:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -151,6 +151,22 @@ static rtl::OUString getEnumCommand( const rtl::OUString& rCommand )
return aEnumCommand;
}
+static rtl::OUString getMasterCommand( const rtl::OUString& rCommand )
+{
+ rtl::OUString aMasterCommand( rCommand );
+ INetURLObject aURL( rCommand );
+ if ( aURL.GetProtocol() == INET_PROT_UNO )
+ {
+ sal_Int32 nIndex = aURL.GetURLPath().indexOf( '.' );
+ if ( nIndex )
+ {
+ aURL.SetURLPath( aURL.GetURLPath().copy( 0, nIndex ) );
+ aMasterCommand = aURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ }
+ return aMasterCommand;
+}
+
struct ExecuteInfo
{
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
@@ -170,6 +186,8 @@ GenericToolbarController::GenericToolbarController( const Reference< XMultiServi
, m_bMadeInvisible( sal_False )
, m_aEnumCommand( getEnumCommand( aCommand ))
{
+ if ( m_bEnumCommand )
+ addStatusListener( getMasterCommand( aCommand ) );
}
GenericToolbarController::~GenericToolbarController()