[Libreoffice-commits] .: vcl/inc vcl/source

Joseph Powers jpowers at kemper.freedesktop.org
Tue Aug 2 22:35:32 PDT 2011


 vcl/inc/vcl/menu.hxx       |   36 +++++----------------
 vcl/source/window/menu.cxx |   76 ---------------------------------------------
 2 files changed, 10 insertions(+), 102 deletions(-)

New commits:
commit e757c525c127d49602f5f3994e8b8617cf4b4897
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue Aug 2 22:34:22 2011 -0700

    unusedcode.easy: Removed unused code from Menu
    
    Note: ImplSelectWithStart() was listed as unused; however, it's used on
    Mac OS X. I added a comment stating that we use it, so hopefully someone
    else doesn't remove it later without checking first.

diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 6109491..fd8811f 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -145,14 +145,14 @@ private:
     Link				aDeactivateHdl; 	// Deactivate-Handler
     Link				aHighlightHdl;		// Highlight-Handler
     Link				aSelectHdl; 		// Highlight-Handler
-    
+
     VclEventListeners   maEventListeners;
     VclEventListeners   maChildEventListeners;
 
     XubString			aTitleText; 		// PopupMenu-Text
 
     sal_uLong				nEventId;
-    sal_uInt16				mnHighlightedItemPos; // for native menues: keeps track of the highlighted item 
+    sal_uInt16				mnHighlightedItemPos; // for native menues: keeps track of the highlighted item
     sal_uInt16				nMenuFlags;
     sal_uInt16				nDefaultItem;		// Id vom Default-Item
     sal_uInt16				nSelectedId;
@@ -194,9 +194,9 @@ protected:
     SAL_DLLPRIVATE SalMenu*         ImplGetSalMenu() { return mpSalMenu; }
     SAL_DLLPRIVATE void             ImplSetSalMenu( SalMenu *pMenu );
     SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
-    
+
     // returns native check and option menu symbol height;
-    // return value is Max( rCheckHeight, rRadioHeight ) 
+    // return value is Max( rCheckHeight, rRadioHeight )
     SAL_DLLPRIVATE long             ImplGetNativeCheckAndRadioSize( Window*, long& rCheckHeight, long& rRadioHeight, long &rMaxWidth ) const;
 
     // returns native submenu arrow size and spacing from right border
@@ -212,9 +212,9 @@ public:
                             Menu();
                             Menu( sal_Bool bMenuBar );
     SAL_DLLPRIVATE Window*  ImplGetWindow() const { return pWindow; }
-
-    
+    // ImplSelectWithStart() is used in vcl/aqua/source/window/salnsmenu.mm
     SAL_DLLPRIVATE void ImplSelectWithStart( Menu* pStartMenu = NULL );
+
 public:
     virtual 			~Menu();
 
@@ -279,7 +279,6 @@ public:
     void                ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
     void                HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
 
-    sal_Bool				IsItemVisible( sal_uInt16 nItemId ) const;
     sal_Bool				IsItemPosVisible( sal_uInt16 nItemPos ) const;
     sal_Bool				IsMenuVisible() const;
     sal_Bool				IsMenuBar() const { return bIsMenuBar; }
@@ -308,7 +307,7 @@ public:
 
     void                SetHelpCommand( sal_uInt16 nItemId, const XubString& rString );
     const XubString&    GetHelpCommand( sal_uInt16 nItemId ) const;
-    
+
     void				SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
     rtl::OString		GetHelpId( sal_uInt16 nItemId ) const;
 
@@ -328,12 +327,12 @@ public:
     void				SetLogo();
     sal_Bool				HasLogo() const { return pLogo ? sal_True : sal_False; }
     MenuLogo			GetLogo() const;
-    
+
     void                AddEventListener( const Link& rEventListener );
     void                RemoveEventListener( const Link& rEventListener );
     //void                AddChildEventListener( const Link& rEventListener );
     //void                RemoveChildEventListener( const Link& rEventListener );
-    
+
     Menu&				operator =( const Menu& rMenu );
 
     // Fuer Menu-'Funktionen'
@@ -345,8 +344,6 @@ public:
 
     // accessibility helpers
 
-    // gets the displayed text
-    String GetDisplayText() const;
     // returns the bounding box for the character at index nIndex
     // where nIndex is relative to the starting index of the item
     // with id nItemId (in coordinates of the displaying window)
@@ -354,18 +351,11 @@ public:
     // -1 is returned if no character is at that point
     // if an index is found the corresponding item id is filled in (else 0)
     long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
-    // returns the number of lines in the result of GetDisplayText()
-    long GetLineCount() const;
     // returns the interval [start,end] of line nLine
     // returns [-1,-1] for an invalid line
     Pair GetLineStartEnd( long nLine ) const;
-    // like GetLineStartEnd but first finds the line number for the item
-    Pair GetItemStartEnd( sal_uInt16 nItemId ) const;
-    // returns the item id for line nLine or 0 if nLine is invalid
-    sal_uInt16 GetDisplayItemId( long nLine ) const;
     // returns the bounding rectangle for an item at pos nItemPos
     Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
-    sal_Bool ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const;
 
     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible();
     void SetAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
@@ -378,17 +368,11 @@ public:
     void				SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr );
     XubString			GetAccessibleName( sal_uInt16 nItemId ) const;
 
-    void				SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr );
-    XubString			GetAccessibleDescription( sal_uInt16 nItemId ) const;
-    
     // returns whether the item a position nItemPos is highlighted or not.
     bool  IsHighlighted( sal_uInt16 nItemPos ) const;
 
     void                HighlightItem( sal_uInt16 nItemPos );
     void                DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
-    
-    
-    void doLazyDelete();
 };
 
 // -----------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a54bca9..109b72b 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -958,11 +958,6 @@ Menu::~Menu()
     ImplSetSalMenu( NULL );
 }
 
-void Menu::doLazyDelete()
-{
-    vcl::LazyDeletor<Menu>::Delete( this );
-}
-
 void Menu::ImplInit()
 {
     mnHighlightedItemPos = ITEMPOS_INVALID;
@@ -2190,11 +2185,6 @@ sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const
     return bVisible;
 }
 
-sal_Bool Menu::IsItemVisible( sal_uInt16 nItemId ) const
-{
-    return IsMenuVisible() && ImplIsVisible( GetItemPos( nItemId ) );
-}
-
 sal_Bool Menu::IsItemPosVisible( sal_uInt16 nItemPos ) const
 {
     return IsMenuVisible() && ImplIsVisible( nItemPos );
@@ -3152,13 +3142,6 @@ void Menu::ImplFillLayoutData() const
     }
 }
 
-String Menu::GetDisplayText() const
-{
-    if( ! mpLayoutData )
-        ImplFillLayoutData();
-    return mpLayoutData ? mpLayoutData->m_aDisplayText : String();
-}
-
 Rectangle Menu::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
 {
     long nItemIndex = -1;
@@ -3203,13 +3186,6 @@ long Menu::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
     return nIndex;
 }
 
-long Menu::GetLineCount() const
-{
-    if( ! mpLayoutData )
-        ImplFillLayoutData();
-    return mpLayoutData ? mpLayoutData->GetLineCount() : 0;
-}
-
 Pair Menu::GetLineStartEnd( long nLine ) const
 {
     if( ! mpLayoutData )
@@ -3217,40 +3193,6 @@ Pair Menu::GetLineStartEnd( long nLine ) const
     return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
 }
 
-Pair Menu::GetItemStartEnd( sal_uInt16 nItem ) const
-{
-    if( ! mpLayoutData )
-        ImplFillLayoutData();
-
-    for( size_t i = 0; i < mpLayoutData->m_aLineItemIds.size(); i++ )
-        if( mpLayoutData->m_aLineItemIds[i] == nItem )
-            return GetLineStartEnd( i );
-
-    return Pair( -1, -1 );
-}
-
-sal_uInt16 Menu::GetDisplayItemId( long nLine ) const
-{
-    sal_uInt16 nItemId = 0;
-    if( ! mpLayoutData )
-        ImplFillLayoutData();
-    if( mpLayoutData && ( nLine >= 0 ) && ( nLine < (long)mpLayoutData->m_aLineItemIds.size() ) )
-        nItemId = mpLayoutData->m_aLineItemIds[nLine];
-    return nItemId;
-}
-
-sal_Bool Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const
-{
-    sal_Bool bRet = sal_False;
-    if( pWindow && pReferenceWindow )
-    {
-        rPoint = pReferenceWindow->OutputToAbsoluteScreenPixel( rPoint );
-        rPoint = pWindow->AbsoluteScreenToOutputPixel( rPoint );
-        bRet = sal_True;
-    }
-    return bRet;
-}
-
 Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const
 {
     Rectangle aRet;
@@ -3288,24 +3230,6 @@ XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
         return ImplGetSVEmptyStr();
 }
 
-void Menu::SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr )
-{
-    MenuItemData* pData = pItemList->GetData( nItemId );
-
-    if ( pData )
-        pData->aAccessibleDescription = rStr;
-}
-
-XubString Menu::GetAccessibleDescription( sal_uInt16 nItemId ) const
-{
-    MenuItemData* pData = pItemList->GetData( nItemId );
-
-    if ( pData )
-        return pData->aAccessibleDescription;
-    else
-        return ImplGetSVEmptyStr();
-}
-
 void Menu::ImplSetSalMenu( SalMenu *pSalMenu )
 {
     if( mpSalMenu )


More information about the Libreoffice-commits mailing list