Kaydet (Commit) 9e6b3a07 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up odd non-static member functions with pThis paramter

...and get member function const'ness right overall

Change-Id: Idb422039108d1dde9f6a8b881f6dff742030f6f0
üst eba8515c
...@@ -187,7 +187,7 @@ private: ...@@ -187,7 +187,7 @@ private:
SAL_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); SAL_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
SAL_DLLPRIVATE ImplToolItem* ImplGetItem( sal_uInt16 nId ) const; SAL_DLLPRIVATE ImplToolItem* ImplGetItem( sal_uInt16 nId ) const;
SAL_DLLPRIVATE bool ImplCalcItem(); SAL_DLLPRIVATE bool ImplCalcItem();
SAL_DLLPRIVATE sal_uInt16 ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalcHorz ); SAL_DLLPRIVATE sal_uInt16 ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalcHorz ) const;
SAL_DLLPRIVATE void ImplFormat( bool bResize = false ); SAL_DLLPRIVATE void ImplFormat( bool bResize = false );
SAL_DLLPRIVATE void ImplDrawSpin(vcl::RenderContext& rRenderContext); SAL_DLLPRIVATE void ImplDrawSpin(vcl::RenderContext& rRenderContext);
SAL_DLLPRIVATE void ImplDrawSeparator(vcl::RenderContext& rRenderContext, ImplToolItems::size_type nPos, const Rectangle& rRect); SAL_DLLPRIVATE void ImplDrawSeparator(vcl::RenderContext& rRenderContext, ImplToolItems::size_type nPos, const Rectangle& rRect);
...@@ -206,7 +206,7 @@ private: ...@@ -206,7 +206,7 @@ private:
SAL_DLLPRIVATE void ImplShowFocus(); SAL_DLLPRIVATE void ImplShowFocus();
SAL_DLLPRIVATE void ImplHideFocus(); SAL_DLLPRIVATE void ImplHideFocus();
SAL_DLLPRIVATE void ImplUpdateInputEnable(); SAL_DLLPRIVATE void ImplUpdateInputEnable();
SAL_DLLPRIVATE void ImplFillLayoutData() const; SAL_DLLPRIVATE void ImplFillLayoutData();
SAL_DLLPRIVATE bool ImplHasClippedItems(); SAL_DLLPRIVATE bool ImplHasClippedItems();
SAL_DLLPRIVATE Point ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) const; SAL_DLLPRIVATE Point ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) const;
SAL_DLLPRIVATE bool ImplIsFloatingMode() const; SAL_DLLPRIVATE bool ImplIsFloatingMode() const;
...@@ -228,12 +228,13 @@ public: ...@@ -228,12 +228,13 @@ public:
SAL_DLLPRIVATE void ImplFloatControl( bool bStart, FloatingWindow* pWindow ); SAL_DLLPRIVATE void ImplFloatControl( bool bStart, FloatingWindow* pWindow );
SAL_DLLPRIVATE void ImplDisableFlatButtons(); SAL_DLLPRIVATE void ImplDisableFlatButtons();
static SAL_DLLPRIVATE int ImplGetDragWidth( ToolBox* pThis ); SAL_DLLPRIVATE int ImplGetDragWidth() const;
static SAL_DLLPRIVATE int ImplGetDragWidth( const vcl::RenderContext& rRenderContext, static SAL_DLLPRIVATE int ImplGetDragWidth( const vcl::RenderContext& rRenderContext,
bool bHorz ); bool bHorz );
static SAL_DLLPRIVATE void ImplUpdateDragArea( ToolBox *pThis ); SAL_DLLPRIVATE void ImplUpdateDragArea() const;
static SAL_DLLPRIVATE void ImplCalcBorder( WindowAlign eAlign, long& rLeft, long& rTop, SAL_DLLPRIVATE void ImplCalcBorder( WindowAlign eAlign, long& rLeft, long& rTop,
long& rRight, long& rBottom, const ToolBox *pThis ); long& rRight, long& rBottom ) const;
SAL_DLLPRIVATE void ImplCheckUpdate();
static SAL_DLLPRIVATE void ImplDrawGrip(vcl::RenderContext& rRenderContext, static SAL_DLLPRIVATE void ImplDrawGrip(vcl::RenderContext& rRenderContext,
const Rectangle &aDragArea, int nDragWidth, const Rectangle &aDragArea, int nDragWidth,
WindowAlign eAlign, bool bHorz); WindowAlign eAlign, bool bHorz);
...@@ -248,20 +249,20 @@ public: ...@@ -248,20 +249,20 @@ public:
SAL_DLLPRIVATE void ImplErase(vcl::RenderContext& rRenderContext, const Rectangle &rRect, bool bHighlight, bool bHasOpenPopup = false ); SAL_DLLPRIVATE void ImplErase(vcl::RenderContext& rRenderContext, const Rectangle &rRect, bool bHighlight, bool bHasOpenPopup = false );
SAL_DLLPRIVATE void ImplDrawBorder(vcl::RenderContext& rRenderContext); SAL_DLLPRIVATE void ImplDrawBorder(vcl::RenderContext& rRenderContext);
static SAL_DLLPRIVATE const ImplToolItem *ImplGetFirstClippedItem( const ToolBox* pThis ); SAL_DLLPRIVATE const ImplToolItem *ImplGetFirstClippedItem() const;
static SAL_DLLPRIVATE Size ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode = 0 ); SAL_DLLPRIVATE Size ImplCalcSize( sal_uInt16 nCalcLines, sal_uInt16 nCalcMode = 0 );
static SAL_DLLPRIVATE void ImplCalcFloatSizes( ToolBox* pThis ); SAL_DLLPRIVATE void ImplCalcFloatSizes();
static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines ); SAL_DLLPRIVATE Size ImplCalcFloatSize( sal_uInt16& rLines );
static SAL_DLLPRIVATE void ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMaxSize ); SAL_DLLPRIVATE void ImplCalcMinMaxFloatSize( Size& rMinSize, Size& rMaxSize );
static SAL_DLLPRIVATE void ImplSetMinMaxFloatSize( ToolBox *pThis ); SAL_DLLPRIVATE void ImplSetMinMaxFloatSize();
static SAL_DLLPRIVATE sal_uInt16 ImplCalcLines( ToolBox* pThis, long nToolSize ); SAL_DLLPRIVATE sal_uInt16 ImplCalcLines( long nToolSize ) const;
static SAL_DLLPRIVATE sal_uInt16 ImplTestLineSize( ToolBox* pThis, const Point& rPos ); SAL_DLLPRIVATE sal_uInt16 ImplTestLineSize( const Point& rPos ) const;
static SAL_DLLPRIVATE void ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect, sal_uInt16 nLineMode ); SAL_DLLPRIVATE void ImplLineSizing( const Point& rPos, Rectangle& rRect, sal_uInt16 nLineMode );
static SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( ToolBox* pBox, const Point& rPos ); SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( const Point& rPos ) const;
static SAL_DLLPRIVATE ImplToolItems::size_type ImplFindItemPos( const ImplToolItem* pItem, const ImplToolItems& rList ); static SAL_DLLPRIVATE ImplToolItems::size_type ImplFindItemPos( const ImplToolItem* pItem, const ImplToolItems& rList );
SAL_DLLPRIVATE void ImplDrawMenuButton(vcl::RenderContext& rRenderContext, bool bHighlight); SAL_DLLPRIVATE void ImplDrawMenuButton(vcl::RenderContext& rRenderContext, bool bHighlight);
SAL_DLLPRIVATE void ImplDrawButton(vcl::RenderContext& rRenderContext, const Rectangle &rRect, sal_uInt16 highlight, bool bChecked, bool bEnabled, bool bIsWindow); SAL_DLLPRIVATE void ImplDrawButton(vcl::RenderContext& rRenderContext, const Rectangle &rRect, sal_uInt16 highlight, bool bChecked, bool bEnabled, bool bIsWindow);
static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis ); SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks() const;
SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; } SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; }
protected: protected:
...@@ -359,12 +360,12 @@ public: ...@@ -359,12 +360,12 @@ public:
sal_uInt16 GetItemId( const Point& rPos ) const; sal_uInt16 GetItemId( const Point& rPos ) const;
/// Map the command name (like .uno:Save) back to item id. /// Map the command name (like .uno:Save) back to item id.
sal_uInt16 GetItemId( const OUString& rCommand ) const; sal_uInt16 GetItemId( const OUString& rCommand ) const;
Rectangle GetItemRect( sal_uInt16 nItemId ) const; Rectangle GetItemRect( sal_uInt16 nItemId );
Rectangle GetItemPosRect( ImplToolItems::size_type nPos ) const; Rectangle GetItemPosRect( ImplToolItems::size_type nPos );
Rectangle GetOverflowRect() const; Rectangle GetOverflowRect() const;
/// Returns size of the bitmap / text that is inside this toolbox item. /// Returns size of the bitmap / text that is inside this toolbox item.
Size GetItemContentSize( sal_uInt16 nItemId ) const; Size GetItemContentSize( sal_uInt16 nItemId );
sal_uInt16 GetCurItemId() const { return mnCurItemId; } sal_uInt16 GetCurItemId() const { return mnCurItemId; }
sal_uInt16 GetDownItemId() const { return mnDownItemId; } sal_uInt16 GetDownItemId() const { return mnDownItemId; }
...@@ -429,20 +430,20 @@ public: ...@@ -429,20 +430,20 @@ public:
OString GetHelpId( sal_uInt16 nItemId ) const; OString GetHelpId( sal_uInt16 nItemId ) const;
// window size according to current alignment, floating state and number of lines // window size according to current alignment, floating state and number of lines
Size CalcWindowSizePixel() const; Size CalcWindowSizePixel();
// window size according to current alignment, floating state and a given number of lines // window size according to current alignment, floating state and a given number of lines
Size CalcWindowSizePixel( sal_uInt16 nCalcLines ) const; Size CalcWindowSizePixel( sal_uInt16 nCalcLines );
// window size according to current floating state and a given number of lines and a given alignment // window size according to current floating state and a given number of lines and a given alignment
Size CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const; Size CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign );
// floating window size according to number of lines (uses the number of line breaks) // floating window size according to number of lines (uses the number of line breaks)
Size CalcFloatingWindowSizePixel() const; Size CalcFloatingWindowSizePixel();
// floating window size with a given number of lines // floating window size with a given number of lines
Size CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const; Size CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines );
// automatic window size for popup mode // automatic window size for popup mode
Size CalcPopupWindowSizePixel() const; Size CalcPopupWindowSizePixel();
// computes the smallest useful size when docked, ie with the first item visible only (+drag area and menu button) // computes the smallest useful size when docked, ie with the first item visible only (+drag area and menu button)
Size CalcMinimumWindowSizePixel() const; Size CalcMinimumWindowSizePixel();
sal_uInt16 GetFloatingLines() const; sal_uInt16 GetFloatingLines() const;
...@@ -507,10 +508,10 @@ public: ...@@ -507,10 +508,10 @@ public:
// returns the bounding box for the character at index nIndex // returns the bounding box for the character at index nIndex
// where nIndex is relative to the starting index of the item // where nIndex is relative to the starting index of the item
// with id nItemId (in coordinates of the displaying window) // with id nItemId (in coordinates of the displaying window)
Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const; Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex );
// -1 is returned if no character is at that point // -1 is returned if no character is at that point
// if an index is found the corresponding item id is filled in (else 0) // if an index is found the corresponding item id is filled in (else 0)
long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const; long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID );
static Size GetDefaultImageSize(ToolBoxButtonSize eToolBoxButtonSize); static Size GetDefaultImageSize(ToolBoxButtonSize eToolBoxButtonSize);
Size GetDefaultImageSize() const; Size GetDefaultImageSize() const;
...@@ -532,7 +533,7 @@ inline bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const ...@@ -532,7 +533,7 @@ inline bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const
return (GetItemState( nItemId ) == TRISTATE_TRUE); return (GetItemState( nItemId ) == TRISTATE_TRUE);
} }
inline Size ToolBox::CalcWindowSizePixel() const inline Size ToolBox::CalcWindowSizePixel()
{ {
return CalcWindowSizePixel( mnLines ); return CalcWindowSizePixel( mnLines );
} }
......
This diff is collapsed.
...@@ -775,10 +775,10 @@ sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const ...@@ -775,10 +775,10 @@ sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
return 0; return 0;
} }
Size ToolBox::GetItemContentSize( sal_uInt16 nItemId ) const Size ToolBox::GetItemContentSize( sal_uInt16 nItemId )
{ {
if ( mbCalc || mbFormat ) if ( mbCalc || mbFormat )
(const_cast<ToolBox*>(this))->ImplFormat(); ImplFormat();
ImplToolItems::size_type nPos = GetItemPos( nItemId ); ImplToolItems::size_type nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() ) if ( nPos < mpData->m_aItems.size() )
...@@ -855,19 +855,19 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) ...@@ -855,19 +855,19 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize )
return aPos; return aPos;
} }
Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId ) const Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId )
{ {
if ( mbCalc || mbFormat ) if ( mbCalc || mbFormat )
const_cast<ToolBox*>(this)->ImplFormat(); ImplFormat();
ImplToolItems::size_type nPos = GetItemPos( nItemId ); ImplToolItems::size_type nPos = GetItemPos( nItemId );
return GetItemPosRect( nPos ); return GetItemPosRect( nPos );
} }
Rectangle ToolBox::GetItemPosRect( ImplToolItems::size_type nPos ) const Rectangle ToolBox::GetItemPosRect( ImplToolItems::size_type nPos )
{ {
if ( mbCalc || mbFormat ) if ( mbCalc || mbFormat )
const_cast<ToolBox*>(this)->ImplFormat(); ImplFormat();
if ( nPos < mpData->m_aItems.size() ) if ( nPos < mpData->m_aItems.size() )
return mpData->m_aItems[nPos].maRect; return mpData->m_aItems[nPos].maRect;
...@@ -1471,7 +1471,7 @@ void ToolBox::ImplUpdateInputEnable() ...@@ -1471,7 +1471,7 @@ void ToolBox::ImplUpdateInputEnable()
mpData->mbKeyInputDisabled = true; mpData->mbKeyInputDisabled = true;
} }
void ToolBox::ImplFillLayoutData() const void ToolBox::ImplFillLayoutData()
{ {
mpData->m_pLayoutData = new ToolBoxLayoutData; mpData->m_pLayoutData = new ToolBoxLayoutData;
...@@ -1482,18 +1482,18 @@ void ToolBox::ImplFillLayoutData() const ...@@ -1482,18 +1482,18 @@ void ToolBox::ImplFillLayoutData() const
// only draw, if the rectangle is within PaintRectangle // only draw, if the rectangle is within PaintRectangle
if (!pItem->maRect.IsEmpty()) if (!pItem->maRect.IsEmpty())
const_cast<ToolBox*>(this)->InvalidateItem(i); InvalidateItem(i);
} }
} }
OUString ToolBox::GetDisplayText() const OUString ToolBox::GetDisplayText() const
{ {
if( ! mpData->m_pLayoutData ) if( ! mpData->m_pLayoutData )
ImplFillLayoutData(); const_cast<ToolBox *>(this)->ImplFillLayoutData();
return mpData->m_pLayoutData ? OUString(mpData->m_pLayoutData->m_aDisplayText) : OUString(); return mpData->m_pLayoutData ? OUString(mpData->m_pLayoutData->m_aDisplayText) : OUString();
} }
Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex )
{ {
long nItemIndex = -1; long nItemIndex = -1;
if( ! mpData->m_pLayoutData ) if( ! mpData->m_pLayoutData )
...@@ -1512,7 +1512,7 @@ Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const ...@@ -1512,7 +1512,7 @@ Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
return (mpData->m_pLayoutData && nItemIndex != -1) ? mpData->m_pLayoutData->GetCharacterBounds( nItemIndex+nIndex ) : Rectangle(); return (mpData->m_pLayoutData && nItemIndex != -1) ? mpData->m_pLayoutData->GetCharacterBounds( nItemIndex+nIndex ) : Rectangle();
} }
long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID )
{ {
long nIndex = -1; long nIndex = -1;
rItemID = 0; rItemID = 0;
...@@ -1555,7 +1555,7 @@ void ToolBox::SetMenuType( ToolBoxMenuType aType ) ...@@ -1555,7 +1555,7 @@ void ToolBox::SetMenuType( ToolBoxMenuType aType )
mbFormat = true; mbFormat = true;
ImplFormat(); ImplFormat();
ImplSetMinMaxFloatSize( this ); ImplSetMinMaxFloatSize();
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment