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
commit5dc5148288d2ae23dcdc53a6407ee8d4913300b7 (patch)
tree31f86f1924a54fdefb939d853ee111eab5e2d8c2 /framework/source/uielement/menubarmanager.cxx
parentfa248971c9c71a6596d4021fc00415da3763789e (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.cxx91
1 files changed, 51 insertions, 40 deletions
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 1f5669c136..0f59a8cf8f 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,7 +166,10 @@
#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 )