diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-08-02 22:34:22 -0700 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-08-02 22:34:22 -0700 |
commit | 1c086e0a05ce76d95a5750b0b00b1cc5ff25bf83 (patch) | |
tree | 4c8111764b35fbf27ab9ae7f4915e392b58d361b /vcl | |
parent | 6692d36f1a822661c6135965e28e2eff96408cd3 (diff) |
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.
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/menu.hxx | 20 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 76 |
2 files changed, 2 insertions, 94 deletions
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx index 340311e9b55b..e162e8ea0831 100644 --- a/vcl/inc/vcl/menu.hxx +++ b/vcl/inc/vcl/menu.hxx @@ -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; } @@ -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 40e0758b2949..f978820a6551 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 ) |