diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-06 11:17:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-06 12:57:25 +0200 |
commit | 22d94ce0abef7cdd5e344a28e1b1ee4caf6cd8f8 (patch) | |
tree | 0e54d0721723336daf26493f85e7be8f07431286 | |
parent | d34e969c888219bd3739fc4a8ef330c77f7e7adf (diff) |
loplugin:const* make some params and methods const
Change-Id: If7fbb25037343e18081a8ee7064840d75e9a45a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104010
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
43 files changed, 87 insertions, 81 deletions
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 720fb7a10e23..12401ac9756a 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -1150,7 +1150,7 @@ namespace basegfx::utils static void implHandleSnippet( const B2DPolygon& rSnippet, - std::function<void(const basegfx::B2DPolygon& rSnippet)>& rTargetCallback, + const std::function<void(const basegfx::B2DPolygon& rSnippet)>& rTargetCallback, B2DPolygon& rFirst, B2DPolygon& rLast) { @@ -1177,7 +1177,7 @@ namespace basegfx::utils } static void implHandleFirstLast( - std::function<void(const basegfx::B2DPolygon& rSnippet)>& rTargetCallback, + const std::function<void(const basegfx::B2DPolygon& rSnippet)>& rTargetCallback, B2DPolygon& rFirst, B2DPolygon& rLast) { diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx index bf982f9c3e22..ac1f3a5a8d7e 100644 --- a/basegfx/source/polygon/b3dpolygontools.cxx +++ b/basegfx/source/polygon/b3dpolygontools.cxx @@ -119,7 +119,7 @@ namespace basegfx::utils static void implHandleSnippet( const B3DPolygon& rSnippet, - std::function<void(const basegfx::B3DPolygon& rSnippet)>& rTargetCallback, + const std::function<void(const basegfx::B3DPolygon& rSnippet)>& rTargetCallback, B3DPolygon& rFirst, B3DPolygon& rLast) { @@ -146,7 +146,7 @@ namespace basegfx::utils } static void implHandleFirstLast( - std::function<void(const basegfx::B3DPolygon& rSnippet)>& rTargetCallback, + const std::function<void(const basegfx::B3DPolygon& rSnippet)>& rTargetCallback, B3DPolygon& rFirst, B3DPolygon& rLast) { diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index 8f26be08c49d..c0e0726b7440 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -51,7 +51,7 @@ public: , maLocaleLanguageTag(LANGUAGE_NONE) {} - const LanguageTag& getLanguage() + const LanguageTag& getLanguage() const { return maLanguageTag; } @@ -65,7 +65,7 @@ public: } } - const LanguageTag& getLocale() + const LanguageTag& getLocale() const { return maLocaleLanguageTag; } diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx index 76eb45e2648e..3c81c41e077f 100644 --- a/include/registry/registry.hxx +++ b/include/registry/registry.hxx @@ -316,7 +316,7 @@ private: @param pValueList points to a value list. @param length specifies the length of the list. */ - void setValueList(Registry& registry, RegValueType valueType, + void setValueList(const Registry& registry, RegValueType valueType, ValueType* pValueList, sal_uInt32 length) { m_length = length; diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 3309c7bbc0f4..c1a6f7388ec9 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -106,7 +106,7 @@ public: void Enlarge(sal_uInt16 nCount); // Init of arrays to the right size // if pSc is set, it is used to get the Color pointer - void Copy( const ImpSvNumFor& rNumFor, ImpSvNumberformatScan* pSc ); + void Copy( const ImpSvNumFor& rNumFor, const ImpSvNumberformatScan* pSc ); // Access to Info; call Enlarge before! ImpSvNumberformatInfo& Info() { return aI;} diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx index 7997fabcec67..c900bb02cbf7 100644 --- a/include/vcl/GraphicObject.hxx +++ b/include/vcl/GraphicObject.hxx @@ -269,7 +269,7 @@ public: OutputDevice* pFirstFrameOutDev = nullptr ); - void StopAnimation( OutputDevice* pOut = nullptr, long nExtraData = 0 ); + void StopAnimation( const OutputDevice* pOut = nullptr, long nExtraData = 0 ); static bool isGraphicObjectUniqueIdURL(OUString const & rURL); diff --git a/include/vcl/WeldedTabbedNotebookbar.hxx b/include/vcl/WeldedTabbedNotebookbar.hxx index d0549d25d019..59190425ecfe 100644 --- a/include/vcl/WeldedTabbedNotebookbar.hxx +++ b/include/vcl/WeldedTabbedNotebookbar.hxx @@ -25,7 +25,8 @@ class VCL_DLLPUBLIC WeldedTabbedNotebookbar std::unique_ptr<weld::Notebook> m_xNotebook; public: - WeldedTabbedNotebookbar(VclPtr<vcl::Window>& pContainerWindow, const OUString& rUIFilePath, + WeldedTabbedNotebookbar(const VclPtr<vcl::Window>& pContainerWindow, + const OUString& rUIFilePath, const css::uno::Reference<css::frame::XFrame>& rFrame, sal_uInt64 nWindowId); }; diff --git a/include/vcl/animate/Animation.hxx b/include/vcl/animate/Animation.hxx index c606fb7a85fe..e355d7d1e2a1 100644 --- a/include/vcl/animate/Animation.hxx +++ b/include/vcl/animate/Animation.hxx @@ -44,7 +44,7 @@ public: bool Start(OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData, OutputDevice* pFirstFrameOutDev); - void Stop(OutputDevice* pOutDev = nullptr, long nExtraData = 0); + void Stop(const OutputDevice* pOutDev = nullptr, long nExtraData = 0); void Draw(OutputDevice* pOutDev, const Point& rDestPt) const; void Draw(OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz) const; diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index 205f8cc62ca6..6f3d94925122 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -51,7 +51,7 @@ public: PDFium(); ~PDFium(); - OUString getLastError() { return maLastError; } + OUString getLastError() const { return maLastError; } std::unique_ptr<PDFiumDocument> openDocument(const void* pData, int nSize); }; @@ -95,10 +95,10 @@ public: PDFiumPathSegment(FPDF_PATHSEGMENT pPathSegment); ~PDFiumPathSegment(); - FPDF_PATHSEGMENT getPointer() { return mpPathSegment; } - basegfx::B2DPoint getPoint(); - bool isClosed(); - int getType(); + FPDF_PATHSEGMENT getPointer() const { return mpPathSegment; } + basegfx::B2DPoint getPoint() const; + bool isClosed() const; + int getType() const; }; class VCL_DLLPUBLIC PDFiumPageObject final diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 1880041b4ba5..0a8ddaf0173d 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -160,7 +160,7 @@ public: const Size& rDestSize, long nExtraData = 0, OutputDevice* pFirstFrameOutDev = nullptr ); - void StopAnimation( OutputDevice* pOutputDevice, + void StopAnimation( const OutputDevice* pOutputDevice, long nExtraData ); void SetAnimationNotifyHdl( const Link<Animation*,void>& rLink ); diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index f69acab4b1b1..e15f49b96d58 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -805,7 +805,7 @@ public: { m_aStartDragHdl = rLink; } - void SetDragHelper(rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants) + void SetDragHelper(const rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants) { m_xTransferHelper = rHelper; m_nDragAction = eDNDConstants; @@ -866,7 +866,7 @@ Size getLegacyBestSizeForChildren(const vcl::Window &rWindow); vcl::Window* getNonLayoutParent(vcl::Window *pParent); //Sort ok/cancel etc buttons in platform order -void sort_native_button_order(VclBox& rContainer); +void sort_native_button_order(const VclBox& rContainer); #endif diff --git a/include/vcl/notebookbar.hxx b/include/vcl/notebookbar.hxx index 75383b9d2d7c..fa58dda4bbbf 100644 --- a/include/vcl/notebookbar.hxx +++ b/include/vcl/notebookbar.hxx @@ -48,9 +48,9 @@ public: void ControlListenerForCurrentController(bool bListen); void StopListeningAllControllers(); - bool IsWelded() { return m_bIsWelded; } + bool IsWelded() const { return m_bIsWelded; } VclPtr<vcl::Window>& GetMainContainer() { return m_xVclContentArea; } - OUString GetUIFilePath() { return m_sUIXMLDescription; } + OUString GetUIFilePath() const { return m_sUIXMLDescription; } void SetDisposeCallback(const Link<const SfxViewShell*, void> rDisposeCallback, const SfxViewShell* pViewShell); private: diff --git a/include/vcl/toolkit/treelistbox.hxx b/include/vcl/toolkit/treelistbox.hxx index ea1038edeb09..3ef56b39d67c 100644 --- a/include/vcl/toolkit/treelistbox.hxx +++ b/include/vcl/toolkit/treelistbox.hxx @@ -435,14 +435,14 @@ public: // Return value: TRISTATE_TRUE == Ok, TRISTATE_FALSE == Cancel, TRISTATE_INDET == Ok and Make visible moved entry TriState NotifyMoving( SvTreeListEntry* pTarget, // D'n'D DropPosition in GetModel() - SvTreeListEntry* pEntry, // Entry to be moved from GetSourceListBox()->GetModel() + const SvTreeListEntry* pEntry, // Entry to be moved from GetSourceListBox()->GetModel() SvTreeListEntry*& rpNewParent, // New TargetParent sal_uLong& rNewChildPos); // The TargetParent's position in Childlist // Return value: TRISTATE_TRUE == Ok, TRISTATE_FALSE == Cancel, TRISTATE_INDET == Ok and Make visible moved entry TriState NotifyCopying( SvTreeListEntry* pTarget, // D'n'D DropPosition in GetModel() - SvTreeListEntry* pEntry, // Entry to be copied from GetSourceListBox()->GetModel() + const SvTreeListEntry* pEntry, // Entry to be copied from GetSourceListBox()->GetModel() SvTreeListEntry*& rpNewParent, // New TargetParent sal_uLong& rNewChildPos); // The TargetParent's position in Childlist @@ -631,7 +631,7 @@ public: virtual tools::Rectangle GetFocusRect(const SvTreeListEntry*, long nLine ); // Respects indentation - sal_IntPtr GetTabPos(const SvTreeListEntry*, SvLBoxTab*); + sal_IntPtr GetTabPos(const SvTreeListEntry*, const SvLBoxTab*); void InvalidateEntry( SvTreeListEntry* ); SvLBoxItem* GetItem( SvTreeListEntry*, long nX, SvLBoxTab** ppTab); SvLBoxItem* GetItem( SvTreeListEntry*, long nX ); @@ -684,7 +684,7 @@ public: virtual FactoryFunction GetUITestFactory() const override; - void SetDragHelper(rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants); + void SetDragHelper(const rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e12ef94eb71f..6f227c7cbb6a 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1903,7 +1903,7 @@ public: { m_xSpinButton->connect_focus_out(rLink); } - OString get_buildable_name() { return m_xSpinButton->get_buildable_name(); } + OString get_buildable_name() const { return m_xSpinButton->get_buildable_name(); } void set_help_id(const OString& rName) { m_xSpinButton->set_help_id(rName); } void set_position(int nCursorPos) { m_xSpinButton->set_position(nCursorPos); } // set the width of the underlying widget in characters, this setting is diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx index 0c892427f45d..9a29e89d7b5f 100644 --- a/include/vcl/weldutils.hxx +++ b/include/vcl/weldutils.hxx @@ -183,7 +183,7 @@ public: void SAL_CALL disposing(const css::lang::EventObject& /*Source*/) override; - const css::uno::Reference<css::frame::XFrame>& getFrame() { return mxFrame; } + const css::uno::Reference<css::frame::XFrame>& getFrame() const { return mxFrame; } void startListening(); diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index b7df3a6a9ca4..550fdd8695fb 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -237,7 +237,7 @@ void ImpSvNumFor::Enlarge(sal_uInt16 nCnt) } } -void ImpSvNumFor::Copy( const ImpSvNumFor& rNumFor, ImpSvNumberformatScan* pSc ) +void ImpSvNumFor::Copy( const ImpSvNumFor& rNumFor, const ImpSvNumberformatScan* pSc ) { Enlarge( rNumFor.nStringsCnt ); aI.Copy( rNumFor.aI, nStringsCnt ); diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 9a55831e26f2..249af86fc90f 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -42,7 +42,7 @@ struct LockMutex : public rtl::Static< osl::Mutex, LockMutex > {}; struct Locks : public rtl::Static< std::map<SvFileStream const *, osl::DirectoryItem>, Locks > {}; -bool lockFile( SvFileStream* pStream ) +bool lockFile( const SvFileStream* pStream ) { osl::DirectoryItem aItem; if (osl::DirectoryItem::get( pStream->GetFileName(), aItem) != osl::FileBase::E_None ) diff --git a/vcl/backendtest/outputdevice/bitmap.cxx b/vcl/backendtest/outputdevice/bitmap.cxx index 79cd3d3795cd..657f840ef178 100644 --- a/vcl/backendtest/outputdevice/bitmap.cxx +++ b/vcl/backendtest/outputdevice/bitmap.cxx @@ -175,7 +175,7 @@ TestResult OutputDeviceTestBitmap::checkMask(Bitmap& rBitmap) return checkRectangle(rBitmap); } -TestResult OutputDeviceTestBitmap::checkBlend(BitmapEx& rBitmapEx) +TestResult OutputDeviceTestBitmap::checkBlend(const BitmapEx& rBitmapEx) { const Color aBlendedColor(0xEE, 0xEE, 0x33); diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 9a82caade324..aee0d1839b31 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -159,7 +159,7 @@ private: const Size& rDestSize, long nExtraData, OutputDevice* pFirstFrameOutDev ); - void ImplStopAnimation( OutputDevice* pOutputDevice, + void ImplStopAnimation( const OutputDevice* pOutputDevice, long nExtraData ); void ImplSetAnimationNotifyHdl( const Link<Animation*,void>& rLink ); @@ -206,7 +206,7 @@ public: bool swapIn(); bool swapOut(); bool isSwappedOut() const { return mbSwapOut; } - OUString getSwapFileURL(); + OUString getSwapFileURL() const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx index 8711364ed46f..6a844002711d 100644 --- a/vcl/inc/sft.hxx +++ b/vcl/inc/sft.hxx @@ -680,7 +680,7 @@ class TrueTypeFont; * @return true, if table data could be decoded * @ingroup sft */ - VCL_DLLPUBLIC bool GetTTGlobalFontHeadInfo(AbstractTrueTypeFont *ttf, int& xMin, int& yMin, int& xMax, int& yMax, sal_uInt16& macStyle); + VCL_DLLPUBLIC bool GetTTGlobalFontHeadInfo(const AbstractTrueTypeFont *ttf, int& xMin, int& yMin, int& xMax, int& yMax, sal_uInt16& macStyle); /** * Returns fonts metrics. diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx index 473edfdf0d3f..b3a2045eea96 100644 --- a/vcl/inc/skia/utils.hxx +++ b/vcl/inc/skia/utils.hxx @@ -64,7 +64,7 @@ void removeCachedImage(sk_sp<SkImage> image); constexpr int MAX_CACHE_SIZE = 4 * 2000 * 2000 * 4; // 4x 2000px 32bpp images, 64MiB #ifdef DBG_UTIL -void prefillSurface(sk_sp<SkSurface>& surface); +void prefillSurface(const sk_sp<SkSurface>& surface); VCL_DLLPUBLIC void dump(const SkBitmap& bitmap, const char* file); VCL_DLLPUBLIC void dump(const sk_sp<SkImage>& image, const char* file); VCL_DLLPUBLIC void dump(const sk_sp<SkSurface>& surface, const char* file); diff --git a/vcl/inc/svimpbox.hxx b/vcl/inc/svimpbox.hxx index 3def46700396..92d5754387c7 100644 --- a/vcl/inc/svimpbox.hxx +++ b/vcl/inc/svimpbox.hxx @@ -300,7 +300,7 @@ public: void ShowCursor( bool bShow ); bool RequestHelp( const HelpEvent& rHEvt ); - bool IsNodeButton( const Point& rPosPixel, SvTreeListEntry* pEntry ) const; + bool IsNodeButton( const Point& rPosPixel, const SvTreeListEntry* pEntry ) const; void SetUpdateMode( bool bMode ); bool GetUpdateMode() const { return m_bUpdateMode; } tools::Rectangle GetClipRegionRect() const; diff --git a/vcl/inc/test/outputdevice.hxx b/vcl/inc/test/outputdevice.hxx index 293e817d35e9..c0d9a61cdb10 100644 --- a/vcl/inc/test/outputdevice.hxx +++ b/vcl/inc/test/outputdevice.hxx @@ -102,7 +102,7 @@ public: static TestResult checkTransformedBitmap(Bitmap& rBitmap); static TestResult checkBitmapExWithAlpha(Bitmap& rBitmap); static TestResult checkMask(Bitmap& rBitmap); - static TestResult checkBlend(BitmapEx& rBitmap); + static TestResult checkBlend(const BitmapEx& rBitmap); }; class VCL_DLLPUBLIC OutputDeviceTestAnotherOutDev : public OutputDeviceTestCommon diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx index 993a0cf49a22..4e409560a981 100644 --- a/vcl/inc/unx/glyphcache.hxx +++ b/vcl/inc/unx/glyphcache.hxx @@ -141,7 +141,7 @@ private: friend class FreetypeFontInstance; friend class FreetypeManager; - explicit FreetypeFont(FreetypeFontInstance&, std::shared_ptr<FreetypeFontInfo>& rFontInfo); + explicit FreetypeFont(FreetypeFontInstance&, const std::shared_ptr<FreetypeFontInfo>& rFontInfo); void ApplyGlyphTransform(bool bVertical, FT_Glyph) const; diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index b5bed8e60b54..660a87ac47f7 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -325,7 +325,7 @@ public: #ifdef DBG_UTIL void PrintInfo() const; - void DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const; + void DbgPrintDisplayEvent(const char *pComment, const XEvent *pEvent) const; #endif void Beep() const; diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx index f9b231d87ce6..2d185bab149b 100644 --- a/vcl/skia/SkiaHelper.cxx +++ b/vcl/skia/SkiaHelper.cxx @@ -573,7 +573,7 @@ void prepareSkia(std::unique_ptr<sk_app::WindowContext> (*createVulkanWindowCont } #ifdef DBG_UTIL -void prefillSurface(sk_sp<SkSurface>& surface) +void prefillSurface(const sk_sp<SkSurface>& surface) { // Pre-fill the surface with deterministic garbage. SkBitmap bitmap; diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index 2b799dabf3af..f788c7be123f 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -215,7 +215,7 @@ bool Animation::Start(OutputDevice* pOut, const Point& rDestPt, const Size& rDes return bRet; } -void Animation::Stop(OutputDevice* pOut, long nExtraData) +void Animation::Stop(const OutputDevice* pOut, long nExtraData) { maViewList.erase(std::remove_if(maViewList.begin(), maViewList.end(), [=](const std::unique_ptr<ImplAnimView>& pAnimView) -> bool { diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 3670f5a1f709..40f5ef8be163 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3424,7 +3424,7 @@ private: void do_insert(const weld::TreeIter* pParent, int pos, const OUString* pStr, const OUString* pId, const OUString* pIconName, - VirtualDevice* pImageSurface, bool bChildrenOnDemand, + const VirtualDevice* pImageSurface, bool bChildrenOnDemand, weld::TreeIter* pRet, bool bIsSeparator) { disable_notify_events(); diff --git a/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx b/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx index 5cf24ec2f101..9ee1ad3822b4 100644 --- a/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx +++ b/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx @@ -74,13 +74,13 @@ template <typename MorphologyOp, int nComponentWidth> struct Value bLookOutside ? rShared.mnOutsideVal : MorphologyOp::initVal); } - void apply(BitmapReadAccess* pReadAccess, long x, long y, sal_uInt8* pHint = nullptr) + void apply(const BitmapReadAccess* pReadAccess, long x, long y, sal_uInt8* pHint = nullptr) { sal_uInt8* pSource = (pHint ? pHint : pReadAccess->GetScanline(y)) + nWidthBytes * x; std::transform(pSource, pSource + nWidthBytes, aResult, aResult, MorphologyOp::apply); } - void copy(BitmapWriteAccess* pWriteAccess, long x, long y, sal_uInt8* pHint = nullptr) + void copy(const BitmapWriteAccess* pWriteAccess, long x, long y, sal_uInt8* pHint = nullptr) { sal_uInt8* pDest = (pHint ? pHint : pWriteAccess->GetScanline(y)) + nWidthBytes * x; std::copy_n(aResult, nWidthBytes, pDest); @@ -102,7 +102,7 @@ template <typename MorphologyOp> struct Value<MorphologyOp, 0> { } - void apply(BitmapReadAccess* pReadAccess, long x, long y, sal_uInt8* /*pHint*/ = nullptr) + void apply(const BitmapReadAccess* pReadAccess, long x, long y, sal_uInt8* /*pHint*/ = nullptr) { const auto& rSource = pReadAccess->GetColor(y, x); aResult = Color(MorphologyOp::apply(rSource.GetTransparency(), aResult.GetTransparency()), diff --git a/vcl/source/bitmap/BitmapFilterStackBlur.cxx b/vcl/source/bitmap/BitmapFilterStackBlur.cxx index a9e17eee2cd2..6883808ebe4a 100644 --- a/vcl/source/bitmap/BitmapFilterStackBlur.cxx +++ b/vcl/source/bitmap/BitmapFilterStackBlur.cxx @@ -101,9 +101,12 @@ struct BlurArrays } } - long getMultiplyValue() { return static_cast<long>(constMultiplyTable[maShared.mnRadius]); } + long getMultiplyValue() const + { + return static_cast<long>(constMultiplyTable[maShared.mnRadius]); + } - long getShiftValue() { return static_cast<long>(constShiftTable[maShared.mnRadius]); } + long getShiftValue() const { return static_cast<long>(constShiftTable[maShared.mnRadius]); } }; typedef void (*BlurRangeFn)(BlurSharedData const& rShared, long nStartY, long nEndY); @@ -145,42 +148,43 @@ struct SumFunction24 pValue1[2] = nConstant; } - static inline void add(long*& pValue1, sal_uInt8*& pValue2) + static inline void add(long*& pValue1, const sal_uInt8* pValue2) { pValue1[0] += pValue2[0]; pValue1[1] += pValue2[1]; pValue1[2] += pValue2[2]; } - static inline void add(long*& pValue1, long*& pValue2) + static inline void add(long*& pValue1, const long* pValue2) { pValue1[0] += pValue2[0]; pValue1[1] += pValue2[1]; pValue1[2] += pValue2[2]; } - static inline void sub(long*& pValue1, sal_uInt8*& pValue2) + static inline void sub(long*& pValue1, const sal_uInt8* pValue2) { pValue1[0] -= pValue2[0]; pValue1[1] -= pValue2[1]; pValue1[2] -= pValue2[2]; } - static inline void sub(long*& pValue1, long*& pValue2) + static inline void sub(long*& pValue1, const long* pValue2) { pValue1[0] -= pValue2[0]; pValue1[1] -= pValue2[1]; pValue1[2] -= pValue2[2]; } - static inline void assignPtr(sal_uInt8*& pValue1, sal_uInt8*& pValue2) + static inline void assignPtr(sal_uInt8*& pValue1, const sal_uInt8* pValue2) { pValue1[0] = pValue2[0]; pValue1[1] = pValue2[1]; pValue1[2] = pValue2[2]; } - static inline void assignMulAndShr(sal_uInt8*& result, long*& sum, long multiply, long shift) + static inline void assignMulAndShr(sal_uInt8*& result, const long* sum, long multiply, + long shift) { result[0] = (multiply * sum[0]) >> shift; result[1] = (multiply * sum[1]) >> shift; @@ -194,20 +198,21 @@ struct SumFunction8 static inline void set(long*& pValue1, long nConstant) { pValue1[0] = nConstant; } - static inline void add(long*& pValue1, sal_uInt8*& pValue2) { pValue1[0] += pValue2[0]; } + static inline void add(long*& pValue1, const sal_uInt8* pValue2) { pValue1[0] += pValue2[0]; } - static inline void add(long*& pValue1, long*& pValue2) { pValue1[0] += pValue2[0]; } + static inline void add(long*& pValue1, const long* pValue2) { pValue1[0] += pValue2[0]; } - static inline void sub(long*& pValue1, sal_uInt8*& pValue2) { pValue1[0] -= pValue2[0]; } + static inline void sub(long*& pValue1, const sal_uInt8* pValue2) { pValue1[0] -= pValue2[0]; } - static inline void sub(long*& pValue1, long*& pValue2) { pValue1[0] -= pValue2[0]; } + static inline void sub(long*& pValue1, const long* pValue2) { pValue1[0] -= pValue2[0]; } - static inline void assignPtr(sal_uInt8*& pValue1, sal_uInt8*& pValue2) + static inline void assignPtr(sal_uInt8*& pValue1, const sal_uInt8* pValue2) { pValue1[0] = pValue2[0]; } - static inline void assignMulAndShr(sal_uInt8*& result, long*& sum, long multiply, long shift) + static inline void assignMulAndShr(sal_uInt8*& result, const long* sum, long multiply, + long shift) { result[0] = (multiply * sum[0]) >> shift; } diff --git a/vcl/source/control/WeldedTabbedNotebookbar.cxx b/vcl/source/control/WeldedTabbedNotebookbar.cxx index 3f701d08109c..e0089c604271 100644 --- a/vcl/source/control/WeldedTabbedNotebookbar.cxx +++ b/vcl/source/control/WeldedTabbedNotebookbar.cxx @@ -12,7 +12,7 @@ #include <jsdialog/jsdialogbuilder.hxx> WeldedTabbedNotebookbar::WeldedTabbedNotebookbar( - VclPtr<vcl::Window>& pContainerWindow, const OUString& rUIFilePath, + const VclPtr<vcl::Window>& pContainerWindow, const OUString& rUIFilePath, const css::uno::Reference<css::frame::XFrame>& rFrame, sal_uInt64 nWindowId) : m_xBuilder(new JSInstanceBuilder(pContainerWindow, AllSettings::GetUIRootDir(), rUIFilePath, rFrame, nWindowId)) diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 8df442fff60b..7fbeed108d99 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -785,7 +785,7 @@ static bool ImplPatternProcessKeyInput( IEditImplementation& rEdit, const KeyEve namespace { - bool ImplSetMask(OString& rEditMask, OUString& rLiteralMask) + bool ImplSetMask(const OString& rEditMask, OUString& rLiteralMask) { bool bSameMask = true; diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index a9b079a75bc3..5e113ff2aba8 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -244,8 +244,8 @@ bool ImportPDF(SvStream& rStream, Graphic& rGraphic) #if HAVE_FEATURE_PDFIUM namespace { -std::vector<PDFGraphicAnnotation> findAnnotations(std::unique_ptr<vcl::pdf::PDFiumPage>& pPage, - basegfx::B2DSize aPageSize) +std::vector<PDFGraphicAnnotation> +findAnnotations(const std::unique_ptr<vcl::pdf::PDFiumPage>& pPage, basegfx::B2DSize aPageSize) { std::vector<PDFGraphicAnnotation> aPDFGraphicAnnotations; for (int nAnnotation = 0; nAnnotation < pPage->getAnnotationCount(); nAnnotation++) diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 6aba6d6d48d2..9fcf26f97d9c 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -2004,7 +2004,7 @@ void GetTTFontMetrics(const uint8_t *pHhea, size_t nHhea, } } -bool GetTTGlobalFontHeadInfo(AbstractTrueTypeFont *ttf, int& xMin, int& yMin, int& xMax, int& yMax, sal_uInt16& macStyle) +bool GetTTGlobalFontHeadInfo(const AbstractTrueTypeFont *ttf, int& xMin, int& yMin, int& xMax, int& yMax, sal_uInt16& macStyle) { sal_uInt32 table_size; const sal_uInt8* table = ttf->table(O_head, table_size); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index b88aaf0e9f3f..1fe6dac8cc10 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -448,7 +448,7 @@ void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt, mxImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ); } -void Graphic::StopAnimation( OutputDevice* pOutDev, long nExtraData ) +void Graphic::StopAnimation( const OutputDevice* pOutDev, long nExtraData ) { ImplTestRefCount(); mxImpGraphic->ImplStopAnimation( pOutDev, nExtraData ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 979166f118aa..f9afa788973e 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -85,17 +85,17 @@ public: utl::UCBContentHelper::Kill(maSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } - INetURLObject getSwapURL() + INetURLObject getSwapURL() const { return maSwapURL; } - OUString getSwapURLString() + OUString getSwapURLString() const { return maSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); } - OUString const & getOriginURL() { return maOriginURL; } + OUString const & getOriginURL() const { return maOriginURL; } std::unique_ptr<SvStream> openOutputStream() { @@ -114,7 +114,7 @@ public: } }; -OUString ImpGraphic::getSwapFileURL() +OUString ImpGraphic::getSwapFileURL() const { if (mpSwapFile) return mpSwapFile->getSwapURL().GetMainURL(INetURLObject::DecodeMechanism::NONE); @@ -1091,7 +1091,7 @@ void ImpGraphic::ImplStartAnimation( OutputDevice* pOutDev, const Point& rDestPt mpAnimation->Start( pOutDev, rDestPt, rDestSize, nExtraData, pFirstFrameOutDev ); } -void ImpGraphic::ImplStopAnimation( OutputDevice* pOutDev, long nExtraData ) +void ImpGraphic::ImplStopAnimation( const OutputDevice* pOutDev, long nExtraData ) { ensureAvailable(); diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx index 1e83722a559b..d44a4bdafe78 100644 --- a/vcl/source/graphic/GraphicObject.cxx +++ b/vcl/source/graphic/GraphicObject.cxx @@ -591,7 +591,7 @@ bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const return bRet; } -void GraphicObject::StopAnimation( OutputDevice* pOut, long nExtraData ) +void GraphicObject::StopAnimation( const OutputDevice* pOut, long nExtraData ) { if (mxSimpleCache) mxSimpleCache->maGraphic.StopAnimation(pOut, nExtraData); diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index dc31eb4fb952..d790fb1b9c01 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -387,7 +387,7 @@ PDFiumPathSegment::PDFiumPathSegment(FPDF_PATHSEGMENT pPathSegment) PDFiumPathSegment::~PDFiumPathSegment() {} -basegfx::B2DPoint PDFiumPathSegment::getPoint() +basegfx::B2DPoint PDFiumPathSegment::getPoint() const { basegfx::B2DPoint aPoint; float fx, fy; @@ -396,9 +396,9 @@ basegfx::B2DPoint PDFiumPathSegment::getPoint() return aPoint; } -bool PDFiumPathSegment::isClosed() { return FPDFPathSegment_GetClose(mpPathSegment); } +bool PDFiumPathSegment::isClosed() const { return FPDFPathSegment_GetClose(mpPathSegment); } -int PDFiumPathSegment::getType() { return FPDFPathSegment_GetType(mpPathSegment); } +int PDFiumPathSegment::getType() const { return FPDFPathSegment_GetType(mpPathSegment); } PDFiumAnnotation::PDFiumAnnotation(FPDF_ANNOTATION pAnnotation) : mpAnnotation(pAnnotation) diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index eb69c9d5d295..689bce430dab 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -1894,7 +1894,7 @@ bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) // ******* Control plus/minus button for expanding/collapsing // false == no expand/collapse button hit -bool SvImpLBox::IsNodeButton( const Point& rPosPixel, SvTreeListEntry* pEntry ) const +bool SvImpLBox::IsNodeButton( const Point& rPosPixel, const SvTreeListEntry* pEntry ) const { if( !pEntry->HasChildren() && !pEntry->HasChildrenOnDemand() ) return false; diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 05b3d9d2a891..b3f9506f5839 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -507,7 +507,7 @@ bool SvTreeListBox::CheckDragAndDropMode( SvTreeListBox const * pSource, sal_Int */ TriState SvTreeListBox::NotifyMoving( SvTreeListEntry* pTarget, // D&D dropping position in GetModel() - SvTreeListEntry* pEntry, // entry that we want to move, from + const SvTreeListEntry* pEntry, // entry that we want to move, from // GetSourceListBox()->GetModel() SvTreeListEntry*& rpNewParent, // new target parent sal_uLong& rNewChildPos) // position in childlist of target parent @@ -541,7 +541,7 @@ TriState SvTreeListBox::NotifyMoving( TriState SvTreeListBox::NotifyCopying( SvTreeListEntry* pTarget, // D&D dropping position in GetModel() - SvTreeListEntry* pEntry, // entry that we want to move, from + const SvTreeListEntry* pEntry, // entry that we want to move, from // GetSourceListBox()->GetModel() SvTreeListEntry*& rpNewParent, // new target parent sal_uLong& rNewChildPos) // position in childlist of target parent @@ -1158,7 +1158,7 @@ void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel ) xContainer->StartDrag(this, mnDragAction, GetDragFinishedHdl()); } -void SvTreeListBox::SetDragHelper(rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants) +void SvTreeListBox::SetDragHelper(const rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants) { m_xTransferHelper = rHelper; mnDragAction = eDNDConstants; @@ -2941,7 +2941,7 @@ tools::Rectangle SvTreeListBox::GetFocusRect(const SvTreeListEntry* pEntry, long return aRect; } -sal_IntPtr SvTreeListBox::GetTabPos(const SvTreeListEntry* pEntry, SvLBoxTab* pTab) +sal_IntPtr SvTreeListBox::GetTabPos(const SvTreeListEntry* pEntry, const SvLBoxTab* pTab) { assert(pTab); sal_IntPtr nPos = pTab->GetPos(); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 9e4831789f8d..ea9a0bb7f064 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -793,7 +793,7 @@ bool sortButtons::operator()(const vcl::Window *pA, const vcl::Window *pB) const return getButtonPriority(pA->GetHelpId()) < getButtonPriority(pB->GetHelpId()); } -void sort_native_button_order(VclBox& rContainer) +void sort_native_button_order(const VclBox& rContainer) { std::vector<vcl::Window*> aChilds; for (vcl::Window* pChild = rContainer.GetWindow(GetWindowType::FirstChild); pChild; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 1b029e031f64..29035742fd99 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -2044,7 +2044,7 @@ bool SalX11Display::Dispatch( XEvent *pEvent ) } #ifdef DBG_UTIL -void SalDisplay::DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const +void SalDisplay::DbgPrintDisplayEvent(const char *pComment, const XEvent *pEvent) const { static const char* const EventNames[] = { diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 6d8fec490c11..9b3f8dc5c6f1 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -399,7 +399,7 @@ rtl::Reference<LogicalFontInstance> FreetypeFontFace::CreateFontInstance(const F // FreetypeFont -FreetypeFont::FreetypeFont(FreetypeFontInstance& rFontInstance, std::shared_ptr<FreetypeFontInfo>& rFI) +FreetypeFont::FreetypeFont(FreetypeFontInstance& rFontInstance, const std::shared_ptr<FreetypeFontInfo>& rFI) : mrFontInstance(rFontInstance), mnCos( 0x10000), mnSin( 0 ), |