[Libreoffice-commits] .: 2 commits - sfx2/inc sfx2/source
David Tardon
dtardon at kemper.freedesktop.org
Tue Dec 14 11:57:10 PST 2010
sfx2/inc/sfx2/mnuitem.hxx | 28 ++++------------------------
sfx2/source/inc/virtmenu.hxx | 1 -
sfx2/source/menu/mnuitem.cxx | 29 +++++++----------------------
sfx2/source/menu/virtmenu.cxx | 39 +++++++++------------------------------
4 files changed, 20 insertions(+), 77 deletions(-)
New commits:
commit 11ca81fa6206e0f4e56258de57f8217c7ca34640
Author: David Tardon <dtardon at redhat.com>
Date: Mon Dec 13 19:04:05 2010 +0100
purge comments
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx
index f3ef0b9..092d3a5 100644
--- a/sfx2/inc/sfx2/mnuitem.hxx
+++ b/sfx2/inc/sfx2/mnuitem.hxx
@@ -44,9 +44,6 @@ struct SfxMenuCtrlFactory;
class SFX2_DLLPUBLIC SfxMenuControl: public SfxControllerItem
{
-//friend SvStream& operator<<( SvStream& rStream, const SfxMenuControl& rItem );
-//friend SvStream& operator>>( SvStream& rStream, SfxMenuControl& rItem );
-
String aTitle;
SfxVirtualMenu* pOwnMenu;
SfxVirtualMenu* pSubMenu;
@@ -70,9 +67,6 @@ public:
SfxVirtualMenu& rSubMenu,
const String& rTitle, SfxBindings& rBindings );
-// SvStream & Load(SvStream &, SfxBindings*);
-// SvStream & Store(SvStream &);
-
String GetTitle() const;
SfxVirtualMenu* GetPopupMenu() const;
virtual PopupMenu* GetPopup() const;
@@ -103,8 +97,6 @@ public:
void Select();
};
-//--------------------------------------------------------------------
-
typedef SfxMenuControl* (*SfxMenuControlCtor)( USHORT nId, Menu &, SfxBindings & );
struct SfxMenuCtrlFactory
@@ -121,21 +113,15 @@ struct SfxMenuCtrlFactory
{}
};
-//
-
inline String SfxMenuControl::GetTitle() const
{
return aTitle;
}
-//--------------------------------------------------------------------
-
-//
inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const
{
return pSubMenu;
}
-//--------------------------------------------------------------------
#define SFX_DECL_MENU_CONTROL() \
static SfxMenuControl* CreateImpl( USHORT nId, Menu &rMenu, SfxBindings &rBindings ); \
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index e742629..842f7d8 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -189,8 +189,6 @@ SfxMenuControl::SfxMenuControl( BOOL bShowStrings )
//--------------------------------------------------------------------
-// ctor for array
-
SfxMenuControl::SfxMenuControl():
pOwnMenu(0),
pSubMenu(0),
@@ -219,8 +217,6 @@ SfxMenuControl::SfxMenuControl(USHORT nSlotId, SfxBindings& rBindings):
//--------------------------------------------------------------------
-// dtor
-
SfxMenuControl::~SfxMenuControl()
{
if ( SfxMacroConfig::IsMacroSlot( GetId() ) )
@@ -244,7 +240,7 @@ 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" );
@@ -269,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) )
{
commit 4c16ed43f5a43f00fefd9b0966d892d39096635c
Author: David Tardon <dtardon at redhat.com>
Date: Mon Dec 13 18:59:56 2010 +0100
remove unused code
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx
index 82e74fc..f3ef0b9 100644
--- a/sfx2/inc/sfx2/mnuitem.hxx
+++ b/sfx2/inc/sfx2/mnuitem.hxx
@@ -48,7 +48,6 @@ class SFX2_DLLPUBLIC SfxMenuControl: public SfxControllerItem
//friend SvStream& operator>>( SvStream& rStream, SfxMenuControl& rItem );
String aTitle;
- String aHelpText;
SfxVirtualMenu* pOwnMenu;
SfxVirtualMenu* pSubMenu;
BOOL b_ShowStrings;
@@ -66,12 +65,10 @@ public:
using SfxControllerItem::Bind;
void Bind( SfxVirtualMenu* pOwnMenu, USHORT nId,
- const String& rTitle, const String &rHelpText,
- SfxBindings & );
+ const String& rTitle, SfxBindings& rBindings );
void Bind( SfxVirtualMenu* pOwnMenu, USHORT nId,
SfxVirtualMenu& rSubMenu,
- const String& rTitle, const String &rHelpText,
- SfxBindings & );
+ const String& rTitle, SfxBindings& rBindings );
// SvStream & Load(SvStream &, SfxBindings*);
// SvStream & Store(SvStream &);
@@ -82,15 +79,12 @@ public:
void SetOwnMenu( SfxVirtualMenu* pMenu );
void RemovePopup();
- const String& GetHelpText() const { return aHelpText; }
- void SetHelpText(const String &rStr) { aHelpText = rStr; }
-
virtual void StateChanged( USHORT nSID, SfxItemState eState,
const SfxPoolItem* pState );
static SfxMenuControl* CreateControl( USHORT nId, Menu &, SfxBindings & );
static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, SfxBindings&, SfxVirtualMenu* );
- static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, const String& sItemText, const String& sHelpText, SfxBindings&, SfxVirtualMenu* );
+ static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, const String& sItemText, SfxBindings&, SfxVirtualMenu* );
static BOOL IsSpecialControl( USHORT nId, SfxModule* );
static void RegisterMenuControl(SfxModule*, SfxMenuCtrlFactory*);
@@ -103,7 +97,7 @@ public:
SfxUnoMenuControl( const String&, USHORT nId, Menu&,
SfxBindings&, SfxVirtualMenu* );
SfxUnoMenuControl( const String&, USHORT nId, Menu&,
- const String&, const String&,
+ const String&,
SfxBindings&, SfxVirtualMenu* );
~SfxUnoMenuControl();
void Select();
diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx
index c9e3304..6fedf28 100644
--- a/sfx2/source/inc/virtmenu.hxx
+++ b/sfx2/source/inc/virtmenu.hxx
@@ -108,7 +108,6 @@ public:
USHORT GetItemId( USHORT nPos ) const;
SfxVirtualMenu* GetPopupMenu( USHORT nId ) const;
String GetItemText( USHORT nId ) const;
- String GetItemHelpText( USHORT nId ) const;
//void InvalidateKeyCodes();
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 49c931e..e742629 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -140,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 )
@@ -167,7 +165,6 @@ void SfxMenuControl::Bind(
USHORT nSlotId,
SfxVirtualMenu& rMenu,
const String& rTitle,
- const String &rHelpText,
SfxBindings &rBindings )
{
DBG_MEMTEST();
@@ -176,7 +173,6 @@ void SfxMenuControl::Bind(
pOwnMenu = pOwn;
pSubMenu = &rMenu;
aTitle = rTitle;
- aHelpText = rHelpText;
}
//--------------------------------------------------------------------
@@ -531,18 +527,17 @@ SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd,
}
SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd,
- USHORT nId, Menu& rMenu, const String& sItemText, const String& sHelpText,
+ USHORT nId, Menu& rMenu, const String& sItemText,
SfxBindings& rBindings, SfxVirtualMenu* pVirt)
{
- return new SfxUnoMenuControl( rCmd, nId, rMenu, sItemText, sHelpText, rBindings, pVirt);
+ return new SfxUnoMenuControl( rCmd, nId, rMenu, sItemText, rBindings, pVirt);
}
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();
@@ -551,11 +546,11 @@ SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId,
SfxUnoMenuControl::SfxUnoMenuControl(
const String& rCmd, USHORT nSlotId, Menu& /*rMenu*/,
- const String& rItemText, const String& rHelpText,
+ const String& rItemText,
SfxBindings& rBindings, SfxVirtualMenu* pVirt)
: SfxMenuControl( nSlotId, rBindings )
{
- Bind( pVirt, nSlotId, rItemText, rHelpText, rBindings);
+ Bind( pVirt, nSlotId, rItemText, rBindings);
UnBind();
pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd );
pUnoCtrl->acquire();
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 1f51b12..4d19626 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -396,7 +396,6 @@ void SfxVirtualMenu::CreateFromSVMenu()
}
const String sItemText = pSVMenu->GetItemText(nSlotId);
- const String sHelpText = pSVMenu->GetHelpText(nSlotId);
if ( pPopup )
{
@@ -416,8 +415,8 @@ void SfxVirtualMenu::CreateFromSVMenu()
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count() );
- (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
- pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings);
+ pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings);
if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() )
{
@@ -453,8 +452,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
{
pMnuCtrl->Bind( this, nSlotId,
*new SfxVirtualMenu(nSlotId, this, *pPopup, bHelpInitialized, *pBindings, bOLE, bResCtor),
- sItemText, sHelpText,
- *pBindings );
+ sItemText, *pBindings );
}
}
@@ -490,12 +488,12 @@ void SfxVirtualMenu::CreateFromSVMenu()
if ( aCmd.Len() && (( nSlotId < SID_SFX_START ) || ( nSlotId > SHRT_MAX )) )
{
// try to create control via comand name
- pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, sHelpText, *pBindings, this );
+ pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, *pBindings, this );
if ( pMnuCtrl )
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
- (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings);
}
}
@@ -507,13 +505,13 @@ void SfxVirtualMenu::CreateFromSVMenu()
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
- (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings);
}
else
// take default control
pMnuCtrl = (pItems+nPos);
- pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings);
+ pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings);
}
if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() )
@@ -798,9 +796,7 @@ bool SfxVirtualMenu::Bind_Impl( Menu *pMenu )
DBG_OUTF( ("Neues VirtualMenu %lx erzeugt", pSubMenu) );
- rCtrl.Bind( this, nSID, *pSubMenu,
- pSVMenu->GetItemText(nSID), pSVMenu->GetHelpText(nSID),
- *pBindings );
+ rCtrl.Bind( this, nSID, *pSubMenu, pSVMenu->GetItemText(nSID), *pBindings );
// Activate weiterleiten
pSubMenu->Bind_Impl( pMenu );
@@ -1207,21 +1203,6 @@ String SfxVirtualMenu::GetItemText( USHORT nSlotId ) const
}
//--------------------------------------------------------------------
-// returns the text of the item as currently shown in the menu
-
-String SfxVirtualMenu::GetItemHelpText( USHORT nSlotId ) const
-{
- DBG_MEMTEST();
- DBG_CHKTHIS(SfxVirtualMenu, 0);
-
- USHORT nPos = GetItemPos(nSlotId);
- if ( nPos != MENU_ITEM_NOTFOUND )
- return (pItems+nPos)->GetHelpText();
- return String();
-}
-
-//--------------------------------------------------------------------
-
// set the checkmark of the specified item
void SfxVirtualMenu::CheckItem( USHORT nItemId, BOOL bCheck )
@@ -1304,9 +1285,7 @@ void SfxVirtualMenu::InitPopup( USHORT nPos, BOOL /*bOLE*/ )
DBG_OUTF( ("Neues VirtualMenu %lx erzeugt", pSubMenu) );
- rCtrl.Bind( this, nSID, *pSubMenu,
- pSVMenu->GetItemText(nSID), pSVMenu->GetHelpText(nSID),
- *pBindings );
+ rCtrl.Bind( this, nSID, *pSubMenu, pSVMenu->GetItemText(nSID), *pBindings );
}
}
More information about the Libreoffice-commits
mailing list