diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-30 15:28:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-30 19:00:57 +0200 |
commit | 7183b3ba237dc7718501acb512d5ae1c5d0d5f6b (patch) | |
tree | ea8b5535f6dbed45f54fa27c8dd492a327644626 /vcl/source | |
parent | b1f085d66c1d354485edec527fda6abf539af325 (diff) |
loplugin:constmethod handle more cases
remove some of the naming limitations, and handle pointer parameters
better.
I only let the plugin run up till vcl/
Change-Id: Ice916e0157031ab531c47f10778f406b07966251
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122892
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
39 files changed, 86 insertions, 85 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 9b56472a4241..9d565b40f1eb 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -536,7 +536,7 @@ vcl::Window* SalInstanceWidget::getWidget() const { return m_xWidget; } void SalInstanceWidget::disable_notify_events() { ++m_nBlockNotify; } -bool SalInstanceWidget::notify_events_disabled() { return m_nBlockNotify != 0; } +bool SalInstanceWidget::notify_events_disabled() const { return m_nBlockNotify != 0; } void SalInstanceWidget::enable_notify_events() { --m_nBlockNotify; } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 07b06bb86dcd..2eae233d5c7c 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -188,7 +188,7 @@ void Button::ImplSetSeparatorX( tools::Long nX ) mpButtonData->mnSeparatorX = nX; } -DrawTextFlags Button::ImplGetTextStyle( WinBits nWinStyle, SystemTextColorFlags nSystemTextColorFlags ) +DrawTextFlags Button::ImplGetTextStyle( WinBits nWinStyle, SystemTextColorFlags nSystemTextColorFlags ) const { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle(nWinStyle & ~WB_DEFBUTTON); @@ -1868,7 +1868,7 @@ void RadioButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) ImplInitSettings( true ); } -WinBits RadioButton::ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle ) +WinBits RadioButton::ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle ) const { if ( !(nStyle & WB_NOGROUP) && (!pPrevWindow || (pPrevWindow->GetType() != WindowType::RADIOBUTTON)) ) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 8bb8e15f0834..ece46f6ae3a2 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -285,7 +285,7 @@ void Edit::ImplInitEditData() mxDnDListener = new vcl::unohelper::DragAndDropWrapper( this ); } -bool Edit::ImplUseNativeBorder(vcl::RenderContext const & rRenderContext, WinBits nStyle) +bool Edit::ImplUseNativeBorder(vcl::RenderContext const & rRenderContext, WinBits nStyle) const { bool bRet = rRenderContext.IsNativeControlSupported(ImplGetNativeControlType(), ControlPart::HasBackgroundTexture) diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx index 01baaf575b16..f5d49057228d 100644 --- a/vcl/source/control/fixedhyper.cxx +++ b/vcl/source/control/fixedhyper.cxx @@ -58,7 +58,7 @@ void FixedHyperlink::Initialize() SetClickHdl(LINK(this, FixedHyperlink, HandleClick)); } -bool FixedHyperlink::ImplIsOverText(Point aPosition) +bool FixedHyperlink::ImplIsOverText(Point aPosition) const { Size aSize = GetOutputSizePixel(); diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index a1bcceaf26cb..b613a533fb44 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -416,7 +416,7 @@ bool ImplEntryList::IsEntrySelectable( sal_Int32 nPos ) const return pImplEntry == nullptr || ((pImplEntry->mnFlags & ListBoxEntryFlags::DisableSelection) == ListBoxEntryFlags::NONE); } -sal_Int32 ImplEntryList::FindFirstSelectable( sal_Int32 nPos, bool bForward /* = true */ ) +sal_Int32 ImplEntryList::FindFirstSelectable( sal_Int32 nPos, bool bForward /* = true */ ) const { if( IsEntrySelectable( nPos ) ) return nPos; @@ -2877,7 +2877,7 @@ void ImplListBoxFloatingWindow::Resize() FloatingWindow::Resize(); } -Size ImplListBoxFloatingWindow::CalcFloatSize() +Size ImplListBoxFloatingWindow::CalcFloatSize() const { Size aFloatSz( maPrefSz ); diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 3091d62fe9ab..dc55deed29d4 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -603,7 +603,7 @@ sal_uInt16 VerticalTabControl::GetPagePos(std::string_view rPageId) const return m_xChooser->GetEntryListPos(pData->pEntry); } -VclPtr<vcl::Window> VerticalTabControl::GetPage(std::string_view rPageId) +VclPtr<vcl::Window> VerticalTabControl::GetPage(std::string_view rPageId) const { VerticalTabPageData* pData = GetPageData(rPageId); if (!pData) diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 87385872c0de..844f80b02d56 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -200,7 +200,7 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) } } -tools::Long ScrollBar::ImplCalcThumbPos( tools::Long nPixPos ) +tools::Long ScrollBar::ImplCalcThumbPos( tools::Long nPixPos ) const { // Calculate position tools::Long nCalcThumbPos; @@ -210,7 +210,7 @@ tools::Long ScrollBar::ImplCalcThumbPos( tools::Long nPixPos ) return nCalcThumbPos; } -tools::Long ScrollBar::ImplCalcThumbPosPix( tools::Long nPos ) +tools::Long ScrollBar::ImplCalcThumbPosPix( tools::Long nPos ) const { tools::Long nCalcThumbPos; diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 3ec5bdb949ae..819b833e7fa2 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -202,7 +202,7 @@ void Slider::ImplUpdateRects( bool bUpdate ) } } -tools::Long Slider::ImplCalcThumbPos( tools::Long nPixPos ) +tools::Long Slider::ImplCalcThumbPos( tools::Long nPixPos ) const { // calculate position tools::Long nCalcThumbPos; @@ -211,7 +211,7 @@ tools::Long Slider::ImplCalcThumbPos( tools::Long nPixPos ) return nCalcThumbPos; } -tools::Long Slider::ImplCalcThumbPosPix( tools::Long nPos ) +tools::Long Slider::ImplCalcThumbPosPix( tools::Long nPos ) const { // calculate position tools::Long nCalcThumbPos; @@ -461,7 +461,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) } } -bool Slider::ImplIsPageUp( const Point& rPos ) +bool Slider::ImplIsPageUp( const Point& rPos ) const { Size aSize = GetOutputSizePixel(); tools::Rectangle aRect = maChannel1Rect; @@ -478,7 +478,7 @@ bool Slider::ImplIsPageUp( const Point& rPos ) return aRect.Contains( rPos ); } -bool Slider::ImplIsPageDown( const Point& rPos ) +bool Slider::ImplIsPageDown( const Point& rPos ) const { Size aSize = GetOutputSizePixel(); tools::Rectangle aRect = maChannel2Rect; @@ -884,7 +884,7 @@ void Slider::SetThumbPos( tools::Long nNewThumbPos ) } } -Size Slider::CalcWindowSizePixel() +Size Slider::CalcWindowSizePixel() const { tools::Long nWidth = mnMaxRange - mnMinRange + mnThumbSize + 1; tools::Long nHeight = SLIDER_HEIGHT; diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx index 040bf5476489..b68d876b5abb 100644 --- a/vcl/source/control/wizardmachine.cxx +++ b/vcl/source/control/wizardmachine.cxx @@ -217,7 +217,8 @@ namespace vcl nViewPosFlags ); } - tools::Long RoadmapWizard::LogicalCoordinateToPixel(int iCoordinate){ + tools::Long RoadmapWizard::LogicalCoordinateToPixel(int iCoordinate) const + { Size aLocSize = LogicToPixel(Size(iCoordinate, 0), MapMode(MapUnit::MapAppFont)); int iPixelCoordinate = aLocSize.Width(); return iPixelCoordinate; diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 594439666238..028ca5a897b0 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -1156,7 +1156,7 @@ tools::Long TextEngine::CalcTextWidth() return mnCurTextWidth+1;// wider by 1, as CreateLines breaks at >= } -tools::Long TextEngine::CalcTextHeight() +tools::Long TextEngine::CalcTextHeight() const { SAL_WARN_IF( !GetUpdateMode(), "vcl", "CalcTextHeight: GetUpdateMode()" ); diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index e816be4537fd..3c94e6fa6e1e 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -959,12 +959,12 @@ void TextView::Paste() Paste( aClipboard ); } -OUString TextView::GetSelected() +OUString TextView::GetSelected() const { return GetSelected( GetSystemLineEnd() ); } -OUString TextView::GetSelected( LineEnd aSeparator ) +OUString TextView::GetSelected( LineEnd aSeparator ) const { return mpImpl->mpTextEngine->GetText( mpImpl->maSelection, aSeparator ); } @@ -1607,7 +1607,7 @@ bool TextView::IsSelectionAtPoint( const Point& rPosPixel ) return IsInSelection( aPaM ); } -bool TextView::IsInSelection( const TextPaM& rPaM ) +bool TextView::IsInSelection( const TextPaM& rPaM ) const { TextSelection aSel = mpImpl->maSelection; aSel.Justify(); @@ -1699,7 +1699,7 @@ bool TextView::ImplTruncateNewText( OUString& rNewText ) const return bTruncated; } -bool TextView::ImplCheckTextLen( const OUString& rNewText ) +bool TextView::ImplCheckTextLen( const OUString& rNewText ) const { bool bOK = true; if ( mpImpl->mpTextEngine->GetMaxTextLen() ) diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx index ae9335232679..106ad69bf425 100644 --- a/vcl/source/edit/xtextedt.cxx +++ b/vcl/source/edit/xtextedt.cxx @@ -137,7 +137,7 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const return aSel; } -bool ExtTextEngine::Search( TextSelection& rSel, const i18nutil::SearchOptions& rSearchOptions, bool bForward ) +bool ExtTextEngine::Search( TextSelection& rSel, const i18nutil::SearchOptions& rSearchOptions, bool bForward ) const { TextSelection aSel( rSel ); aSel.Justify(); diff --git a/vcl/source/filter/idxf/dxf2mtf.cxx b/vcl/source/filter/idxf/dxf2mtf.cxx index 06aebc3da16b..a8504c0d4c53 100644 --- a/vcl/source/filter/idxf/dxf2mtf.cxx +++ b/vcl/source/filter/idxf/dxf2mtf.cxx @@ -38,7 +38,7 @@ sal_uInt64 DXF2GDIMetaFile::CountEntities(const DXFEntities & rEntities) return nRes; } -Color DXF2GDIMetaFile::ConvertColor(sal_uInt8 nColor) +Color DXF2GDIMetaFile::ConvertColor(sal_uInt8 nColor) const { return Color( pDXF->aPalette.GetRed( nColor ), @@ -46,7 +46,7 @@ Color DXF2GDIMetaFile::ConvertColor(sal_uInt8 nColor) pDXF->aPalette.GetBlue( nColor ) ); } -tools::Long DXF2GDIMetaFile::GetEntityColor(const DXFBasicEntity & rE) +tools::Long DXF2GDIMetaFile::GetEntityColor(const DXFBasicEntity & rE) const { tools::Long nColor; @@ -64,7 +64,7 @@ tools::Long DXF2GDIMetaFile::GetEntityColor(const DXFBasicEntity & rE) return nColor; } -DXFLineInfo DXF2GDIMetaFile::LTypeToDXFLineInfo(std::string_view rLineType) +DXFLineInfo DXF2GDIMetaFile::LTypeToDXFLineInfo(std::string_view rLineType) const { const DXFLType * pLT; DXFLineInfo aDXFLineInfo; diff --git a/vcl/source/filter/idxf/dxf2mtf.hxx b/vcl/source/filter/idxf/dxf2mtf.hxx index 6d383dae1005..d8a935b51bdf 100644 --- a/vcl/source/filter/idxf/dxf2mtf.hxx +++ b/vcl/source/filter/idxf/dxf2mtf.hxx @@ -55,11 +55,11 @@ private: static sal_uInt64 CountEntities(const DXFEntities & rEntities); - Color ConvertColor(sal_uInt8 nColor); + Color ConvertColor(sal_uInt8 nColor) const; - tools::Long GetEntityColor(const DXFBasicEntity & rE); + tools::Long GetEntityColor(const DXFBasicEntity & rE) const; - DXFLineInfo LTypeToDXFLineInfo(std::string_view rLineType); + DXFLineInfo LTypeToDXFLineInfo(std::string_view rLineType) const; DXFLineInfo GetEntityDXFLineInfo(const DXFBasicEntity & rE); diff --git a/vcl/source/filter/imet/ios2met.cxx b/vcl/source/filter/imet/ios2met.cxx index 39d48deecfaa..e762785f4d4c 100644 --- a/vcl/source/filter/imet/ios2met.cxx +++ b/vcl/source/filter/imet/ios2met.cxx @@ -401,10 +401,10 @@ private: void SetRasterOp(RasterOp eROP); void SetPalette0RGB(sal_uInt16 nIndex, sal_uInt32 nCol); - sal_uInt32 GetPalette0RGB(sal_uInt32 nIndex); + sal_uInt32 GetPalette0RGB(sal_uInt32 nIndex) const; // gets color from palette, or, if it doesn't exist, // interprets nIndex as immediate RGB value. - Color GetPaletteColor(sal_uInt32 nIndex); + Color GetPaletteColor(sal_uInt32 nIndex) const; bool IsLineInfo() const; @@ -806,14 +806,14 @@ void OS2METReader::SetPalette0RGB(sal_uInt16 nIndex, sal_uInt32 nCol) pPaletteStack->p0RGB[nIndex]=nCol; } -sal_uInt32 OS2METReader::GetPalette0RGB(sal_uInt32 nIndex) +sal_uInt32 OS2METReader::GetPalette0RGB(sal_uInt32 nIndex) const { if (pPaletteStack!=nullptr && pPaletteStack->p0RGB!=nullptr && pPaletteStack->nSize>nIndex) nIndex=pPaletteStack->p0RGB[nIndex]; return nIndex; } -Color OS2METReader::GetPaletteColor(sal_uInt32 nIndex) +Color OS2METReader::GetPaletteColor(sal_uInt32 nIndex) const { nIndex=GetPalette0RGB(nIndex); return Color(sal::static_int_cast< sal_uInt8 >((nIndex>>16)&0xff), diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx index 906826ae9e55..ae797aa978a5 100644 --- a/vcl/source/filter/itiff/itiff.cxx +++ b/vcl/source/filter/itiff/itiff.cxx @@ -114,7 +114,7 @@ private: bool ReadMap(); // reads/decompress the bitmap data and fills aMap - sal_uInt32 GetBits(const sal_uInt8 * pSrc, sal_uInt32 nBitsPos, sal_uInt32 nBitsCount); + sal_uInt32 GetBits(const sal_uInt8 * pSrc, sal_uInt32 nBitsPos, sal_uInt32 nBitsCount) const; // fetches BitsCount bits from pSrc[..] at the position nBitsPos void MakePalCol(); @@ -771,7 +771,7 @@ bool TIFFReader::ReadMap() return true; } -sal_uInt32 TIFFReader::GetBits( const sal_uInt8 * pSrc, sal_uInt32 nBitsPos, sal_uInt32 nBitsCount) +sal_uInt32 TIFFReader::GetBits( const sal_uInt8 * pSrc, sal_uInt32 nBitsPos, sal_uInt32 nBitsCount) const { sal_uInt32 nRes; if ( bByteSwap ) diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx index b0904eea6b3a..2e3859b1f941 100644 --- a/vcl/source/font/fontmetric.cxx +++ b/vcl/source/font/fontmetric.cxx @@ -298,7 +298,7 @@ void ImplFontMetricData::ImplInitFlags( const OutputDevice* pDev ) SetFullstopCenteredFlag( bCentered ); } -bool ImplFontMetricData::ShouldUseWinMetrics(const vcl::TTGlobalFontInfo& rInfo) +bool ImplFontMetricData::ShouldUseWinMetrics(const vcl::TTGlobalFontInfo& rInfo) const { if (utl::ConfigManager::IsFuzzing()) return false; diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index cc5386039e3a..147f89febc85 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -110,7 +110,7 @@ void GfxLink::SetPrefMapMode( const MapMode& rPrefMapMode ) mbPrefMapModeValid = true; } -bool GfxLink::LoadNative( Graphic& rGraphic ) +bool GfxLink::LoadNative( Graphic& rGraphic ) const { bool bRet = false; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 9c6df8648276..a4d020008f30 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1425,7 +1425,7 @@ const PaperInfo& Printer::GetPaperInfo( int nPaper ) const return mpInfoPrinter->m_aPaperFormats[nPaper]; } -Size Printer::GetPaperSize( int nPaper ) +Size Printer::GetPaperSize( int nPaper ) const { PaperInfo aInfo = GetPaperInfo( nPaper ); return PixelToLogic( Size( aInfo.getWidth(), aInfo.getHeight() ) ); diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx index 9d79fcc6c5cc..86b49077804a 100644 --- a/vcl/source/graphic/GraphicObject.cxx +++ b/vcl/source/graphic/GraphicObject.cxx @@ -458,7 +458,7 @@ void GraphicObject::SetUserData( const OUString& rUserData ) } bool GraphicObject::Draw(OutputDevice& rOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr) + const GraphicAttr* pAttr) const { GraphicAttr aAttr( pAttr ? *pAttr : GetAttr() ); Point aPt( rPt ); diff --git a/vcl/source/graphic/GraphicObject2.cxx b/vcl/source/graphic/GraphicObject2.cxx index cfd343346b84..89af907e2b9d 100644 --- a/vcl/source/graphic/GraphicObject2.cxx +++ b/vcl/source/graphic/GraphicObject2.cxx @@ -379,7 +379,7 @@ bool GraphicObject::ImplDrawTiled(OutputDevice& rOut, const tools::Rectangle& rA bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, int nNumTilesX, int nNumTilesY, - const Size& rTileSizePixel, const GraphicAttr* pAttr ) + const Size& rTileSizePixel, const GraphicAttr* pAttr ) const { Point aCurrPos( rPosPixel ); Size aTileSizeLogic( rOut.PixelToLogic( rTileSizePixel ) ); diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index dd73cfb4007d..ce10f5520e28 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1356,7 +1356,7 @@ sal_Int32 OutputDevice::ValidateKashidas ( const OUString& rTxt, } bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, - int nIndex, int nLen, std::vector< tools::Rectangle >& rVector ) + int nIndex, int nLen, std::vector< tools::Rectangle >& rVector ) const { rVector.clear(); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index bab6b14cf53c..50ee3ce917f0 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -184,7 +184,7 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout ) mpFontInstance->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent ); } -tools::Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout ) +tools::Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout ) const { Point aPoint = rSalLayout.GetDrawPosition(); tools::Long nX = aPoint.X(); diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 7bec7d5fe4ec..fd0410f0e9e6 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -1214,7 +1214,7 @@ tools::Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic 0, rTextAct.GetDXArray() ); if( pSalLayout ) { - tools::Rectangle aBoundRect( const_cast<OutputDevice&>(rOut).ImplGetTextBoundRect( *pSalLayout ) ); + tools::Rectangle aBoundRect( rOut.ImplGetTextBoundRect( *pSalLayout ) ); aActionBounds = rOut.PixelToLogic( aBoundRect ); } } @@ -1243,7 +1243,7 @@ tools::Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic rTextAct.GetWidth() ); if( pSalLayout ) { - tools::Rectangle aBoundRect( const_cast<OutputDevice&>(rOut).ImplGetTextBoundRect( *pSalLayout ) ); + tools::Rectangle aBoundRect( rOut.ImplGetTextBoundRect( *pSalLayout ) ); aActionBounds = rOut.PixelToLogic( aBoundRect ); } } diff --git a/vcl/source/treelist/imap.cxx b/vcl/source/treelist/imap.cxx index 175fcbb8ff33..c0dd97770a27 100644 --- a/vcl/source/treelist/imap.cxx +++ b/vcl/source/treelist/imap.cxx @@ -123,7 +123,7 @@ void IMapObject::Read( SvStream& rIStm ) } } -bool IMapObject::IsEqual( const IMapObject& rEqObj ) +bool IMapObject::IsEqual( const IMapObject& rEqObj ) const { return ( ( aURL == rEqObj.aURL ) && ( aAltText == rEqObj.aAltText ) && @@ -230,7 +230,7 @@ void IMapRectangleObject::Scale( const Fraction& rFracX, const Fraction& rFracY aRect = tools::Rectangle( aTL, aBR ); } -bool IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) +bool IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) const { return ( IMapObject::IsEqual( rEqObj ) && ( aRect == rEqObj.aRect ) ); } @@ -372,7 +372,7 @@ void IMapCircleObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) nRadius = double(nRadius * aAverage); } -bool IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj ) +bool IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj ) const { return ( IMapObject::IsEqual( rEqObj ) && ( aCenter == rEqObj.aCenter ) && diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index cdbc4b98578e..e0fd310139fc 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -3120,7 +3120,7 @@ void SvImpLBox::CallEventListeners( VclEventId nEvent, void* pData ) } -bool SvImpLBox::IsSelectable( const SvTreeListEntry* pEntry ) +bool SvImpLBox::IsSelectable( const SvTreeListEntry* pEntry ) const { if( pEntry ) { diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx index 57f1ce2f36df..b116c95d2e37 100644 --- a/vcl/source/treelist/svtabbx.cxx +++ b/vcl/source/treelist/svtabbx.cxx @@ -580,7 +580,7 @@ void SvHeaderTabListBox::RecalculateAccessibleChildren() } } -bool SvHeaderTabListBox::IsCellCheckBox( sal_Int32 _nRow, sal_uInt16 _nColumn, TriState& _rState ) +bool SvHeaderTabListBox::IsCellCheckBox( sal_Int32 _nRow, sal_uInt16 _nColumn, TriState& _rState ) const { bool bRet = false; SvTreeListEntry* pEntry = GetEntry( _nRow ); diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index 5483fb32a4a2..4c2ce3195169 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -1476,14 +1476,14 @@ Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor, const OUString& r } -bool TransferableDataHelper::GetString( SotClipboardFormatId nFormat, OUString& rStr ) +bool TransferableDataHelper::GetString( SotClipboardFormatId nFormat, OUString& rStr ) const { DataFlavor aFlavor; return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetString( aFlavor, rStr ) ); } -bool TransferableDataHelper::GetString( const DataFlavor& rFlavor, OUString& rStr ) +bool TransferableDataHelper::GetString( const DataFlavor& rFlavor, OUString& rStr ) const { Any aAny = GetAny(rFlavor, OUString()); bool bRet = false; @@ -1518,7 +1518,7 @@ bool TransferableDataHelper::GetString( const DataFlavor& rFlavor, OUString& rSt } -bool TransferableDataHelper::GetBitmapEx( SotClipboardFormatId nFormat, BitmapEx& rBmpEx ) +bool TransferableDataHelper::GetBitmapEx( SotClipboardFormatId nFormat, BitmapEx& rBmpEx ) const { if(SotClipboardFormatId::BITMAP == nFormat) { @@ -1548,7 +1548,7 @@ bool TransferableDataHelper::GetBitmapEx( SotClipboardFormatId nFormat, BitmapEx } -bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapEx& rBmpEx ) +bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapEx& rBmpEx ) const { tools::SvRef<SotTempStream> xStm; DataFlavor aSubstFlavor; @@ -1650,7 +1650,7 @@ bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapEx& r } -bool TransferableDataHelper::GetGDIMetaFile(SotClipboardFormatId nFormat, GDIMetaFile& rMtf, size_t nMaxActions) +bool TransferableDataHelper::GetGDIMetaFile(SotClipboardFormatId nFormat, GDIMetaFile& rMtf, size_t nMaxActions) const { DataFlavor aFlavor; return SotExchange::GetFormatDataFlavor(nFormat, aFlavor) && @@ -1659,7 +1659,7 @@ bool TransferableDataHelper::GetGDIMetaFile(SotClipboardFormatId nFormat, GDIMet } -bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIMetaFile& rMtf ) +bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIMetaFile& rMtf ) const { tools::SvRef<SotTempStream> xStm; DataFlavor aSubstFlavor; @@ -1704,7 +1704,7 @@ bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIMetaF } -bool TransferableDataHelper::GetGraphic( SotClipboardFormatId nFormat, Graphic& rGraphic ) +bool TransferableDataHelper::GetGraphic( SotClipboardFormatId nFormat, Graphic& rGraphic ) const { if(SotClipboardFormatId::BITMAP == nFormat) { @@ -1725,7 +1725,7 @@ bool TransferableDataHelper::GetGraphic( SotClipboardFormatId nFormat, Graphic& } -bool TransferableDataHelper::GetGraphic( const css::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic ) +bool TransferableDataHelper::GetGraphic( const css::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic ) const { DataFlavor aFlavor; bool bRet = false; @@ -1796,14 +1796,14 @@ bool TransferableDataHelper::GetGraphic( const css::datatransfer::DataFlavor& rF } -bool TransferableDataHelper::GetImageMap( SotClipboardFormatId nFormat, ImageMap& rIMap ) +bool TransferableDataHelper::GetImageMap( SotClipboardFormatId nFormat, ImageMap& rIMap ) const { DataFlavor aFlavor; return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetImageMap( aFlavor, rIMap ) ); } -bool TransferableDataHelper::GetImageMap( const css::datatransfer::DataFlavor& rFlavor, ImageMap& rIMap ) +bool TransferableDataHelper::GetImageMap( const css::datatransfer::DataFlavor& rFlavor, ImageMap& rIMap ) const { tools::SvRef<SotTempStream> xStm; bool bRet = GetSotStorageStream( rFlavor, xStm ); @@ -1832,14 +1832,14 @@ bool TransferableDataHelper::GetTransferableObjectDescriptor( TransferableObject } -bool TransferableDataHelper::GetINetBookmark( SotClipboardFormatId nFormat, INetBookmark& rBmk ) +bool TransferableDataHelper::GetINetBookmark( SotClipboardFormatId nFormat, INetBookmark& rBmk ) const { DataFlavor aFlavor; return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetINetBookmark( aFlavor, rBmk ) ); } -bool TransferableDataHelper::GetINetBookmark( const css::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk ) +bool TransferableDataHelper::GetINetBookmark( const css::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk ) const { bool bRet = false; if( HasFormat( rFlavor )) @@ -1975,7 +1975,7 @@ bool TransferableDataHelper::GetINetBookmark( const css::datatransfer::DataFlavo bool TransferableDataHelper::GetINetImage( SotClipboardFormatId nFormat, - INetImage& rINtImg ) + INetImage& rINtImg ) const { DataFlavor aFlavor; return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetINetImage( aFlavor, rINtImg ) ); @@ -1984,7 +1984,7 @@ bool TransferableDataHelper::GetINetImage( SotClipboardFormatId nFormat, bool TransferableDataHelper::GetINetImage( const css::datatransfer::DataFlavor& rFlavor, - INetImage& rINtImg ) + INetImage& rINtImg ) const { tools::SvRef<SotTempStream> xStm; bool bRet = GetSotStorageStream( rFlavor, xStm ); @@ -1996,14 +1996,14 @@ bool TransferableDataHelper::GetINetImage( bool TransferableDataHelper::GetFileList( SotClipboardFormatId nFormat, - FileList& rFileList ) + FileList& rFileList ) const { DataFlavor aFlavor; return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetFileList( rFileList ) ); } -bool TransferableDataHelper::GetFileList( FileList& rFileList ) +bool TransferableDataHelper::GetFileList( FileList& rFileList ) const { tools::SvRef<SotTempStream> xStm; bool bRet = false; @@ -2036,7 +2036,7 @@ bool TransferableDataHelper::GetFileList( FileList& rFileList ) } -Sequence<sal_Int8> TransferableDataHelper::GetSequence( SotClipboardFormatId nFormat, const OUString& rDestDoc ) +Sequence<sal_Int8> TransferableDataHelper::GetSequence( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const { DataFlavor aFlavor; if (!SotExchange::GetFormatDataFlavor(nFormat, aFlavor)) @@ -2045,7 +2045,7 @@ Sequence<sal_Int8> TransferableDataHelper::GetSequence( SotClipboardFormatId nFo return GetSequence(aFlavor, rDestDoc); } -Sequence<sal_Int8> TransferableDataHelper::GetSequence( const DataFlavor& rFlavor, const OUString& rDestDoc ) +Sequence<sal_Int8> TransferableDataHelper::GetSequence( const DataFlavor& rFlavor, const OUString& rDestDoc ) const { const Any aAny = GetAny(rFlavor, rDestDoc); Sequence<sal_Int8> aSeq; @@ -2056,14 +2056,14 @@ Sequence<sal_Int8> TransferableDataHelper::GetSequence( const DataFlavor& rFlavo } -bool TransferableDataHelper::GetSotStorageStream( SotClipboardFormatId nFormat, tools::SvRef<SotTempStream>& rxStream ) +bool TransferableDataHelper::GetSotStorageStream( SotClipboardFormatId nFormat, tools::SvRef<SotTempStream>& rxStream ) const { DataFlavor aFlavor; return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetSotStorageStream( aFlavor, rxStream ) ); } -bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, tools::SvRef<SotTempStream>& rxStream ) +bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, tools::SvRef<SotTempStream>& rxStream ) const { Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString()); @@ -2077,7 +2077,7 @@ bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, too return aSeq.hasElements(); } -Reference<XInputStream> TransferableDataHelper::GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc ) +Reference<XInputStream> TransferableDataHelper::GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const { DataFlavor aFlavor; if (!SotExchange::GetFormatDataFlavor(nFormat, aFlavor)) @@ -2086,7 +2086,7 @@ Reference<XInputStream> TransferableDataHelper::GetInputStream( SotClipboardForm return GetInputStream(aFlavor, rDestDoc); } -Reference<XInputStream> TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, const OUString& rDestDoc ) +Reference<XInputStream> TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, const OUString& rDestDoc ) const { Sequence<sal_Int8> aSeq = GetSequence(rFlavor, rDestDoc); diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 35eb3271f403..8782547f4c92 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -353,7 +353,7 @@ int SvLBoxItem::GetHeight(const SvTreeListBox* pView, const SvTreeListEntry* pEn return pViewData->mnHeight; } -int SvLBoxItem::GetWidth(const SvTreeListBox* pView, const SvViewDataEntry* pData, sal_uInt16 nItemPos) +int SvLBoxItem::GetWidth(const SvTreeListBox* pView, const SvViewDataEntry* pData, sal_uInt16 nItemPos) const { const SvViewDataItem& rIData = pData->GetItem(nItemPos); int nWidth = rIData.mnWidth; @@ -2846,7 +2846,7 @@ void SvTreeListBox::DrawCustomEntry(vcl::RenderContext& rRenderContext, const to aCustomRenderHdl.Call(std::tuple<vcl::RenderContext&, const tools::Rectangle&, const SvTreeListEntry&>(rRenderContext, rRect, rEntry)); } -Size SvTreeListBox::MeasureCustomEntry(vcl::RenderContext& rRenderContext, const SvTreeListEntry& rEntry) +Size SvTreeListBox::MeasureCustomEntry(vcl::RenderContext& rRenderContext, const SvTreeListEntry& rEntry) const { return aCustomMeasureHdl.Call(std::pair<vcl::RenderContext&, const SvTreeListEntry&>(rRenderContext, rEntry)); } @@ -2947,7 +2947,7 @@ tools::Rectangle SvTreeListBox::GetFocusRect(const SvTreeListEntry* pEntry, tool return aRect; } -sal_IntPtr SvTreeListBox::GetTabPos(const SvTreeListEntry* pEntry, const SvLBoxTab* pTab) +sal_IntPtr SvTreeListBox::GetTabPos(const SvTreeListEntry* pEntry, const SvLBoxTab* pTab) const { assert(pTab); sal_IntPtr nPos = pTab->GetPos(); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 0feb6e1689bf..b29d58455f5f 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -3025,7 +3025,7 @@ void VclBuilder::handleListStore(xmlreader::XmlReader &reader, const OString &rI } } -VclBuilder::stringmap VclBuilder::handleAtkObject(xmlreader::XmlReader &reader) +VclBuilder::stringmap VclBuilder::handleAtkObject(xmlreader::XmlReader &reader) const { int nLevel = 1; diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 4ac2211b8864..f63c0b4127f4 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -207,7 +207,7 @@ void MenuBarWindow::ShowButtons( bool bClose, bool bFloat, bool bHide ) Resize(); } -Size const & MenuBarWindow::MinCloseButtonSize() +Size const & MenuBarWindow::MinCloseButtonSize() const { return m_aCloseBtn->getMinSize(); } @@ -670,7 +670,7 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 } } -tools::Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos ) +tools::Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos ) const { tools::Rectangle aRect; if( m_pMenu ) diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx index 469c141cae92..144607cce2d6 100644 --- a/vcl/source/window/menubarwindow.hxx +++ b/vcl/source/window/menubarwindow.hxx @@ -89,7 +89,7 @@ private: sal_uInt16 ImplFindEntry( const Point& rMousePos ) const; void ImplCreatePopup( bool bPreSelectFirst ); bool HandleKeyEvent(const KeyEvent& rKEvent, bool bFromMenu = true); - tools::Rectangle ImplGetItemRect( sal_uInt16 nPos ); + tools::Rectangle ImplGetItemRect( sal_uInt16 nPos ) const; void ImplInitStyleSettings(); @@ -128,7 +128,7 @@ public: void SetAutoPopup(bool bAuto) { mbAutoPopup = bAuto; } void LayoutChanged(); - Size const & MinCloseButtonSize(); + Size const & MinCloseButtonSize() const; /// Add an arbitrary button to the menubar that will appear next to the close button. sal_uInt16 AddMenuBarButton(const Image&, const Link<MenuBar::MenuBarButtonCallbackArg&,bool>&, const OUString&); diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 85478ac64764..cfd6a6ae190e 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -910,7 +910,7 @@ void MenuFloatingWindow::RenderHighlightItem(vcl::RenderContext& rRenderContext, } } -tools::Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos ) +tools::Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos ) const { if( ! pMenu ) return tools::Rectangle(); diff --git a/vcl/source/window/menufloatingwindow.hxx b/vcl/source/window/menufloatingwindow.hxx index 2fbc19f2d4d3..f26fb50373ca 100644 --- a/vcl/source/window/menufloatingwindow.hxx +++ b/vcl/source/window/menufloatingwindow.hxx @@ -77,7 +77,7 @@ protected: void ImplCursorUpDown( bool bUp, bool bHomeEnd = false ); void ImplHighlightItem( const MouseEvent& rMEvt, bool bMBDown ); tools::Long ImplGetStartY() const; - tools::Rectangle ImplGetItemRect( sal_uInt16 nPos ); + tools::Rectangle ImplGetItemRect( sal_uInt16 nPos ) const; void RenderHighlightItem( vcl::RenderContext& rRenderContext, sal_uInt16 nPos ); tools::Long GetInitialItemY( tools::Long *pOptStartY = nullptr ) const; void InvalidateItem( sal_uInt16 nPos ); diff --git a/vcl/source/window/menuitemlist.hxx b/vcl/source/window/menuitemlist.hxx index b2f4ca62a488..25af6fc6db8e 100644 --- a/vcl/source/window/menuitemlist.hxx +++ b/vcl/source/window/menuitemlist.hxx @@ -141,7 +141,7 @@ public: ) const; size_t GetItemCount( sal_Unicode cSelectChar ) const; size_t GetItemCount( vcl::KeyCode aKeyCode ) const; - size_t size() + size_t size() const { return maItemList.size(); } diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index 21bbb7f787de..6376ea0bebb9 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -223,7 +223,7 @@ void ImplWheelWindow::ImplRecalcScrollValues() } } -PointerStyle ImplWheelWindow::ImplGetMousePointer( tools::Long nDistX, tools::Long nDistY ) +PointerStyle ImplWheelWindow::ImplGetMousePointer( tools::Long nDistX, tools::Long nDistY ) const { PointerStyle eStyle; const StartAutoScrollFlags nFlags = ImplGetSVData()->mpWinData->mnAutoScrollFlags; diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 58e6dda127b4..755bf9643585 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -96,7 +96,7 @@ static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize, return Point( nX, nY ); } -bool StatusBar::ImplIsItemUpdate() +bool StatusBar::ImplIsItemUpdate() const { return !mbProgressMode && IsReallyVisible() && IsUpdateMode(); } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 82d301840e9a..37f9595561cd 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -434,7 +434,7 @@ void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext) } -bool ToolBox::ImplDrawNativeBackground(vcl::RenderContext& rRenderContext) +bool ToolBox::ImplDrawNativeBackground(vcl::RenderContext& rRenderContext) const { // use NWF tools::Rectangle aCtrlRegion(Point(), GetOutputSizePixel()); diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index ad4668e6ce86..ba9fce890110 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -857,7 +857,7 @@ tools::Rectangle const & ToolBox::GetOverflowRect() const return mpData->maMenubuttonItem.maRect; } -bool ToolBox::ImplHasExternalMenubutton() +bool ToolBox::ImplHasExternalMenubutton() const { // check if the borderwindow (i.e. the decoration) provides the menu button bool bRet = false; |