these methods can take a const argument

Change-Id: I0ec68d40dcc34075c72c0d60d3a4b6e8262a8e0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91152
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2020-03-26 17:21:33 +00:00
parent 52a06aeb4d
commit 9b784a74a2
10 changed files with 25 additions and 25 deletions

View file

@ -147,13 +147,13 @@ void OCreationList::ExecuteSearchEntry( const void* _pEntry ) const
onSelected( pEntry );
}
tools::Rectangle OCreationList::GetFocusRect( SvTreeListEntry* _pEntry, long _nLine )
tools::Rectangle OCreationList::GetFocusRect(const SvTreeListEntry* _pEntry, long _nLine)
{
tools::Rectangle aRect = SvTreeListBox::GetFocusRect( _pEntry, _nLine );
aRect.SetLeft( 0 );
// try to let the focus rect start before the bitmap item - this looks better
SvLBoxItem* pBitmapItem = _pEntry->GetFirstItem(SvLBoxItemType::ContextBmp);
const SvLBoxItem* pBitmapItem = _pEntry->GetFirstItem(SvLBoxItemType::ContextBmp);
SvLBoxTab* pTab = pBitmapItem ? GetTab( _pEntry, pBitmapItem ) : nullptr;
SvViewDataItem* pItemData = pBitmapItem ? GetViewDataItem( _pEntry, pBitmapItem ) : nullptr;
OSL_ENSURE( pTab && pItemData, "OCreationList::GetFocusRect: could not find the first bitmap item!" );

View file

@ -71,7 +71,7 @@ namespace dbaui
protected:
virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry& rEntry) override;
virtual tools::Rectangle GetFocusRect( SvTreeListEntry* _pEntry, long _nLine ) override;
virtual tools::Rectangle GetFocusRect(const SvTreeListEntry* _pEntry, long _nLine) override;
virtual void ModelHasCleared() override;
// IMnemonicEntryList

View file

@ -485,7 +485,7 @@ public:
@param pEntry
The entry.
@return The bounding rectangle of an entry. */
tools::Rectangle GetBoundingRect( SvTreeListEntry* pEntry );
tools::Rectangle GetBoundingRect(const SvTreeListEntry* pEntry);
SvTreeFlags GetTreeFlags() const {return nTreeFlags;}
@ -650,7 +650,7 @@ public:
// Place the expander checkitem at the optimal indent for hierarchical lists
void SetOptimalImageIndent() { SetIndent(12); }
void SetSpaceBetweenEntries( short nSpace );
Point GetEntryPosition( SvTreeListEntry* ) const;
Point GetEntryPosition(const SvTreeListEntry*) const;
void MakeVisible( SvTreeListEntry* pEntry );
void MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop );
@ -665,9 +665,9 @@ public:
SvTreeListEntry* GetEntry( const Point& rPos, bool bHit = false ) const;
virtual tools::Rectangle GetFocusRect( SvTreeListEntry*, long nLine );
virtual tools::Rectangle GetFocusRect(const SvTreeListEntry*, long nLine );
// Respects indentation
virtual sal_IntPtr GetTabPos( SvTreeListEntry*, SvLBoxTab* );
virtual sal_IntPtr GetTabPos(const SvTreeListEntry*, SvLBoxTab*);
void InvalidateEntry( SvTreeListEntry* );
SvLBoxItem* GetItem( SvTreeListEntry*, long nX, SvLBoxTab** ppTab);
SvLBoxItem* GetItem( SvTreeListEntry*, long nX );

View file

@ -29,7 +29,7 @@ public:
virtual void Resize() override;
virtual tools::Rectangle GetFocusRect( SvTreeListEntry*, long nEntryPos ) override;
virtual tools::Rectangle GetFocusRect(const SvTreeListEntry*, long nEntryPos) override;
void PaintEntry( SvTreeListEntry&, long nX, long nY, vcl::RenderContext& rRenderContext);
};

View file

@ -218,7 +218,7 @@ protected:
long m_nNextVerVisSize;
long m_nNodeBmpTabDistance; // typical smaller than 0
virtual long GetEntryLine( SvTreeListEntry* pEntry ) const;
virtual long GetEntryLine(const SvTreeListEntry* pEntry) const;
virtual void CursorDown();
virtual void CursorUp();
virtual void PageDown( sal_uInt16 nDelta );
@ -285,7 +285,7 @@ public:
virtual SvTreeListEntry* GetClickedEntry( const Point& ) const;
SvTreeListEntry* GetCurEntry() const { return m_pCursor; }
void SetCurEntry( SvTreeListEntry* );
virtual Point GetEntryPosition( SvTreeListEntry* ) const;
virtual Point GetEntryPosition(const SvTreeListEntry*) const;
void MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop = false );
void ScrollToAbsPos( long nPos );
@ -386,9 +386,9 @@ inline const Image& SvImpLBox::GetDefaultEntryColBmp( )
return implGetImageLocation( ImageType::EntryDefCollapsed );
}
inline Point SvImpLBox::GetEntryPosition( SvTreeListEntry* pEntry ) const
inline Point SvImpLBox::GetEntryPosition(const SvTreeListEntry* pEntry) const
{
return Point( 0, GetEntryLine( pEntry ) );
return Point(0, GetEntryLine(pEntry));
}
inline bool SvImpLBox::IsLineVisible( long nY ) const

View file

@ -47,7 +47,7 @@ void IconView::Resize()
SvTreeListBox::Resize();
}
tools::Rectangle IconView::GetFocusRect( SvTreeListEntry*, long nEntryPos )
tools::Rectangle IconView::GetFocusRect(const SvTreeListEntry*, long nEntryPos)
{
Size aSize;
aSize.setHeight( nEntryHeight );

View file

@ -207,7 +207,7 @@ void IconViewImpl::KeyUp( bool bPageUp )
EndScroll();
}
long IconViewImpl::GetEntryLine( SvTreeListEntry* pEntry ) const
long IconViewImpl::GetEntryLine(const SvTreeListEntry* pEntry) const
{
if(!m_pStartEntry )
return -1; // invisible position
@ -219,7 +219,7 @@ long IconViewImpl::GetEntryLine( SvTreeListEntry* pEntry ) const
return nFirstVisPos;
}
Point IconViewImpl::GetEntryPosition( SvTreeListEntry* pEntry ) const
Point IconViewImpl::GetEntryPosition(const SvTreeListEntry* pEntry) const
{
const int pos = m_pView->GetAbsPos( pEntry );

View file

@ -34,7 +34,7 @@ public:
void KeyUp( bool bPageUp ) override;
Point GetEntryPosition( SvTreeListEntry* pEntry ) const override;
Point GetEntryPosition(const SvTreeListEntry* pEntry) const override;
SvTreeListEntry* GetClickedEntry( const Point& rPoint ) const override;
@ -52,7 +52,7 @@ public:
void InvalidateEntry( long nId ) const override;
protected:
long GetEntryLine( SvTreeListEntry* pEntry ) const override;
long GetEntryLine(const SvTreeListEntry* pEntry) const override;
void CursorUp() override;
void CursorDown() override;

View file

@ -1437,7 +1437,7 @@ bool SvImpLBox::IsEntryInView( SvTreeListEntry* pEntry ) const
}
long SvImpLBox::GetEntryLine( SvTreeListEntry* pEntry ) const
long SvImpLBox::GetEntryLine(const SvTreeListEntry* pEntry) const
{
if(!m_pStartEntry )
return -1; // invisible position
@ -3292,8 +3292,8 @@ void SvImpLBox::ShowFocusRect( const SvTreeListEntry* pEntry )
{
if( pEntry )
{
long nY = GetEntryLine( const_cast<SvTreeListEntry*>(pEntry) );
tools::Rectangle aRect = m_pView->GetFocusRect( const_cast<SvTreeListEntry*>(pEntry), nY );
long nY = GetEntryLine(pEntry);
tools::Rectangle aRect = m_pView->GetFocusRect(pEntry, nY);
vcl::Region aOldClip( m_pView->GetClipRegion());
vcl::Region aClipRegion( GetClipRegionRect() );
m_pView->SetClipRegion( aClipRegion );

View file

@ -2374,7 +2374,7 @@ Image const & SvTreeListBox::GetExpandedNodeBmp( ) const
return pImpl->GetExpandedNodeBmp( );
}
Point SvTreeListBox::GetEntryPosition( SvTreeListEntry* pEntry ) const
Point SvTreeListBox::GetEntryPosition(const SvTreeListEntry* pEntry) const
{
return pImpl->GetEntryPosition( pEntry );
}
@ -2890,7 +2890,7 @@ void SvTreeListBox::PreparePaint(vcl::RenderContext& /*rRenderContext*/, SvTreeL
{
}
tools::Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLine )
tools::Rectangle SvTreeListBox::GetFocusRect(const SvTreeListEntry* pEntry, long nLine )
{
pImpl->UpdateContextBmpWidthMax( pEntry );
@ -2925,7 +2925,7 @@ tools::Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLin
{
if( pTab && nCurTab < pEntry->ItemCount() )
{
SvLBoxItem& rItem = pEntry->GetItem( nCurTab );
const SvLBoxItem& rItem = pEntry->GetItem( nCurTab );
aSize.setWidth(rItem.GetWidth(this, pEntry));
if( !aSize.Width() )
aSize.setWidth( 15 );
@ -2986,7 +2986,7 @@ tools::Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLin
return aRect;
}
sal_IntPtr SvTreeListBox::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
sal_IntPtr SvTreeListBox::GetTabPos(const SvTreeListEntry* pEntry, SvLBoxTab* pTab)
{
assert(pTab);
sal_IntPtr nPos = pTab->GetPos();
@ -3586,7 +3586,7 @@ void SvTreeListBox::FillAccessibleEntryStateSet( SvTreeListEntry* pEntry, ::utl:
}
}
tools::Rectangle SvTreeListBox::GetBoundingRect( SvTreeListEntry* pEntry )
tools::Rectangle SvTreeListBox::GetBoundingRect(const SvTreeListEntry* pEntry)
{
Point aPos = GetEntryPosition( pEntry );
tools::Rectangle aRect = GetFocusRect( pEntry, aPos.Y() );