summaryrefslogtreecommitdiff
path: root/sfx2/source/menu/mnuitem.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/menu/mnuitem.cxx')
-rw-r--r--sfx2/source/menu/mnuitem.cxx53
1 files changed, 22 insertions, 31 deletions
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 705d4a68a5..e36d337b06 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,21 +41,15 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <com/sun/star/util/XURLTransformer.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <tools/urlobj.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <svtools/imagemgr.hxx>
#include <svtools/menuoptions.hxx>
#include <framework/menuconfiguration.hxx>
-#ifndef GCC
-#endif
#include <sfx2/app.hxx>
#include <sfx2/sfx.hrc>
@@ -145,13 +140,11 @@ void SfxMenuControl::Bind(
SfxVirtualMenu* pOwn,
USHORT nSlotId,
const String& rTitle,
- const String &rHelpText,
SfxBindings &rBindings )
{
DBG_MEMTEST();
aTitle = rTitle;
- aHelpText = rHelpText;
pOwnMenu = pOwn;
pSubMenu = 0;
if ( pOwn )
@@ -172,7 +165,6 @@ void SfxMenuControl::Bind(
USHORT nSlotId,
SfxVirtualMenu& rMenu,
const String& rTitle,
- const String &rHelpText,
SfxBindings &rBindings )
{
DBG_MEMTEST();
@@ -181,7 +173,6 @@ void SfxMenuControl::Bind(
pOwnMenu = pOwn;
pSubMenu = &rMenu;
aTitle = rTitle;
- aHelpText = rHelpText;
}
//--------------------------------------------------------------------
@@ -198,8 +189,6 @@ SfxMenuControl::SfxMenuControl( BOOL bShowStrings )
//--------------------------------------------------------------------
-// ctor for array
-
SfxMenuControl::SfxMenuControl():
pOwnMenu(0),
pSubMenu(0),
@@ -228,8 +217,6 @@ SfxMenuControl::SfxMenuControl(USHORT nSlotId, SfxBindings& rBindings):
//--------------------------------------------------------------------
-// dtor
-
SfxMenuControl::~SfxMenuControl()
{
if ( SfxMacroConfig::IsMacroSlot( GetId() ) )
@@ -253,12 +240,12 @@ void SfxMenuControl::StateChanged
const SfxPoolItem* pState
)
{
- (void)nSID; //unused
+ (void)nSID;
DBG_MEMTEST();
DBG_ASSERT( nSID == GetId(), "strange SID" );
DBG_ASSERT( pOwnMenu != 0, "setting state to dangling SfxMenuControl" );
- FASTBOOL bIsObjMenu =
+ bool bIsObjMenu =
GetId() >= SID_OBJECTMENU0 && GetId() < SID_OBJECTMENU_LAST;
// enabled/disabled-Flag pauschal korrigieren
@@ -278,19 +265,13 @@ void SfxMenuControl::StateChanged
if ( !bIsObjMenu )
pOwnMenu->CheckItem( GetId(), FALSE );
- // SetItemText flackert in MenuBar insbes. unter OS/2 (Bug #20658)
- if ( // !bIsObjMenu && nicht wegen "Format/Datenbank"
- pOwnMenu->GetSVMenu()->GetItemText( GetId() ) != GetTitle() )
+ if ( pOwnMenu->GetSVMenu()->GetItemText( GetId() ) != GetTitle() )
{
DBG_WARNING("Title of menu item changed - please check if this needs correction!");
- // pOwnMenu->SetItemText( GetId(), GetTitle() );
}
return;
}
- // ggf. das alte Enum-Menu entfernen/loeschen
- //! delete pOwnMenu->GetMenu().ChangePopupMenu( GetId(), 0 );
-
bool bCheck = false;
if ( pState->ISA(SfxBoolItem) )
{
@@ -448,7 +429,6 @@ SfxAppMenuControl_Impl::SfxAppMenuControl_Impl(
// Determine the current background color setting for menus
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
m_nSymbolsStyle = rSettings.GetSymbolsStyle();
- m_bWasHiContrastMode = rSettings.GetHighContrastMode();
m_bShowMenuImages = rSettings.GetUseImagesInMenus();
Reference<com::sun::star::lang::XMultiServiceFactory> aXMultiServiceFactory(::comphelper::getProcessServiceFactory());
@@ -474,15 +454,12 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu )
{
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
ULONG nSymbolsStyle = rSettings.GetSymbolsStyle();
- BOOL bIsHiContrastMode = rSettings.GetHighContrastMode();
BOOL bShowMenuImages = rSettings.GetUseImagesInMenus();
if (( nSymbolsStyle != m_nSymbolsStyle ) ||
- ( bIsHiContrastMode != m_bWasHiContrastMode ) ||
( bShowMenuImages != m_bShowMenuImages ))
{
m_nSymbolsStyle = nSymbolsStyle;
- m_bWasHiContrastMode = bIsHiContrastMode;
m_bShowMenuImages = bShowMenuImages;
USHORT nCount = pActMenu->GetItemCount();
@@ -504,7 +481,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu )
if ( aImageId.getLength() > 0 )
{
Reference< ::com::sun::star::frame::XFrame > xFrame;
- Image aImage = GetImage( xFrame, aImageId, FALSE, bIsHiContrastMode );
+ Image aImage = GetImage( xFrame, aImageId, FALSE );
if ( !!aImage )
{
bImageSet = sal_True;
@@ -516,7 +493,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu )
if ( !bImageSet && aCmd.Len() )
{
Image aImage = SvFileInformationManager::GetImage(
- INetURLObject(aCmd), FALSE, bIsHiContrastMode );
+ INetURLObject(aCmd), FALSE );
if ( !!aImage )
pActMenu->SetItemImage( nItemId, aImage );
}
@@ -550,8 +527,20 @@ SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId,
Menu& rMenu, SfxBindings& rBindings, SfxVirtualMenu* pVirt )
: SfxMenuControl( nSlotId, rBindings )
{
- Bind( pVirt, nSlotId, rMenu.GetItemText(nSlotId),
- rMenu.GetHelpText(nSlotId), rBindings);
+ Bind( pVirt, nSlotId, rMenu.GetItemText(nSlotId), rBindings);
+ UnBind();
+ pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd );
+ pUnoCtrl->acquire();
+ pUnoCtrl->GetNewDispatch();
+}
+
+SfxUnoMenuControl::SfxUnoMenuControl(
+ const String& rCmd, USHORT nSlotId, Menu& /*rMenu*/,
+ const String& rItemText,
+ SfxBindings& rBindings, SfxVirtualMenu* pVirt)
+ : SfxMenuControl( nSlotId, rBindings )
+{
+ Bind( pVirt, nSlotId, rItemText, rBindings);
UnBind();
pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd );
pUnoCtrl->acquire();
@@ -581,3 +570,5 @@ void SfxUnoMenuControl::Select()
{
pUnoCtrl->Execute();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */