summaryrefslogtreecommitdiff
path: root/framework/source/uielement/menubarmanager.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-11-17 11:54:25 +0000
committerOliver Bolte <obo@openoffice.org>2004-11-17 11:54:25 +0000
commit68f08f698b61d2c3c2e654a82495ed7909ea2969 (patch)
tree79bf6c59f8e3c7aef8de5a5e38aad947cca50c5f /framework/source/uielement/menubarmanager.cxx
parent7f6a63f8267784699aa26d8462827334f9970bad (diff)
INTEGRATION: CWS fwkbugfix03 (1.12.12); FILE MERGED
2004/10/19 11:41:02 cd 1.12.12.1: #i30041# Added support to show/hide controllers with new status update
Diffstat (limited to 'framework/source/uielement/menubarmanager.cxx')
-rw-r--r--framework/source/uielement/menubarmanager.cxx89
1 files changed, 50 insertions, 39 deletions
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 9cde8809045d..56f2447273b2 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: menubarmanager.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: obo $ $Date: 2004-11-16 14:56:05 $
+ * last change: $Author: obo $ $Date: 2004-11-17 12:54:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -166,6 +166,9 @@
#ifndef _DRAFTS_COM_SUN_STAR_UI_XUICONFIGURATIONMANAGERSUPPLIER_HPP_
#include <drafts/com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#endif
+#ifndef _COM_SUN_STAR_FRAME_STATUS_VISIBILITY_HPP_
+#include <com/sun/star/frame/status/Visibility.hpp>
+#endif
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -827,54 +830,62 @@ throw ( RuntimeException )
{
ResetableGuard aGuard( m_aLock );
- sal_Bool bSetCheckmark = sal_False;
- sal_Bool bCheckmark = sal_False;
- sal_Bool bMenuItemEnabled = m_pVCLMenu->IsItemEnabled( pStatusChangedMenu->nItemId );
+ sal_Bool bCheckmark( sal_False );
+ sal_Bool bMenuItemEnabled( m_pVCLMenu->IsItemEnabled( pStatusChangedMenu->nItemId ));
+ rtl::OUString aItemText;
+ status::Visibility aVisibilityStatus;
+
+ if ( aFeatureURL.equalsAscii( ".uno:ChangeCaseToHalfWidth" ))
+ {
+ int a = 1;
+ }
// Enable/disable item
if ( Event.IsEnabled != bMenuItemEnabled )
m_pVCLMenu->EnableItem( pStatusChangedMenu->nItemId, Event.IsEnabled );
- // Checkmark
if ( Event.State >>= bCheckmark )
- bSetCheckmark = sal_True;
-
- if ( bSetCheckmark )
+ {
+ // Checkmark
+ m_pVCLMenu->ShowItem( pStatusChangedMenu->nItemId, TRUE );
m_pVCLMenu->CheckItem( pStatusChangedMenu->nItemId, bCheckmark );
- else
+ }
+ else if ( Event.State >>= aItemText )
{
- rtl::OUString aItemText;
-
- if ( Event.State >>= aItemText )
+ // Replacement for place holders
+ if ( aItemText.matchAsciiL( "($1)", 4 ))
{
- // Replacement for place holders
- if ( aItemText.matchAsciiL( "($1)", 4 ))
- {
- String aResStr = String( FwkResId( STR_UPDATEDOC ));
- rtl::OUString aTmp( aResStr );
- aTmp += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ));
- aTmp += aItemText.copy( 4 );
- aItemText = aTmp;
- }
- else if ( aItemText.matchAsciiL( "($2)", 4 ))
- {
- String aResStr = String( FwkResId( STR_CLOSEDOC_ANDRETURN ));
- rtl::OUString aTmp( aResStr );
- aTmp += aItemText.copy( 4 );
- aItemText = aTmp;
- }
- else if ( aItemText.matchAsciiL( "($3)", 4 ))
- {
- String aResStr = String( FwkResId( STR_SAVECOPYDOC ));
- rtl::OUString aTmp( aResStr );
- aTmp += aItemText.copy( 4 );
- aItemText = aTmp;
- }
-
- m_pVCLMenu->SetItemText( pStatusChangedMenu->nItemId, aItemText );
+ String aResStr = String( FwkResId( STR_UPDATEDOC ));
+ rtl::OUString aTmp( aResStr );
+ aTmp += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ));
+ aTmp += aItemText.copy( 4 );
+ aItemText = aTmp;
+ }
+ else if ( aItemText.matchAsciiL( "($2)", 4 ))
+ {
+ String aResStr = String( FwkResId( STR_CLOSEDOC_ANDRETURN ));
+ rtl::OUString aTmp( aResStr );
+ aTmp += aItemText.copy( 4 );
+ aItemText = aTmp;
+ }
+ else if ( aItemText.matchAsciiL( "($3)", 4 ))
+ {
+ String aResStr = String( FwkResId( STR_SAVECOPYDOC ));
+ rtl::OUString aTmp( aResStr );
+ aTmp += aItemText.copy( 4 );
+ aItemText = aTmp;
}
- }
+ m_pVCLMenu->ShowItem( pStatusChangedMenu->nItemId, TRUE );
+ m_pVCLMenu->SetItemText( pStatusChangedMenu->nItemId, aItemText );
+ }
+ else if ( Event.State >>= aVisibilityStatus )
+ {
+ // Visibility
+ m_pVCLMenu->ShowItem( pStatusChangedMenu->nItemId, aVisibilityStatus.bVisible );
+ }
+ else
+ m_pVCLMenu->ShowItem( pStatusChangedMenu->nItemId, TRUE );
}
if ( Event.Requery )