[Libreoffice-commits] core.git: 2 commits - canvas/source comphelper/source include/comphelper include/package package/inc package/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 22 07:35:34 UTC 2019


 canvas/source/cairo/cairo_canvashelper.cxx          |    2 +-
 canvas/source/cairo/cairo_canvashelper.hxx          |    2 +-
 canvas/source/cairo/cairo_devicehelper.hxx          |    2 +-
 canvas/source/cairo/cairo_spritecanvas.cxx          |    6 +++---
 canvas/source/cairo/cairo_spritecanvas.hxx          |    6 +++---
 canvas/source/cairo/cairo_spritedevicehelper.cxx    |    2 +-
 canvas/source/cairo/cairo_spritedevicehelper.hxx    |    6 +++---
 canvas/source/opengl/ogl_bitmapcanvashelper.cxx     |    2 +-
 canvas/source/opengl/ogl_bitmapcanvashelper.hxx     |    4 ++--
 canvas/source/vcl/canvasbitmaphelper.cxx            |    4 ++--
 canvas/source/vcl/canvasbitmaphelper.hxx            |    4 ++--
 comphelper/source/misc/logging.cxx                  |    2 +-
 comphelper/source/processfactory/processfactory.cxx |    2 +-
 include/comphelper/logging.hxx                      |    2 +-
 include/package/Inflater.hxx                        |    2 +-
 package/inc/CRC32.hxx                               |    2 +-
 package/inc/ZipOutputEntry.hxx                      |    2 +-
 package/inc/ZipOutputStream.hxx                     |    4 ++--
 package/inc/ZipPackageStream.hxx                    |    2 +-
 package/source/xstor/owriteablestream.hxx           |    4 ++--
 package/source/xstor/xstorage.hxx                   |    4 ++--
 package/source/zipapi/CRC32.cxx                     |    2 +-
 package/source/zipapi/MemoryByteGrabber.hxx         |    2 +-
 package/source/zipapi/XUnbufferedStream.hxx         |    2 +-
 package/source/zipapi/ZipOutputStream.cxx           |    2 +-
 package/source/zippackage/ZipPackageStream.cxx      |    2 +-
 26 files changed, 38 insertions(+), 38 deletions(-)

New commits:
commit 7a769391772b1184d801a123fb226017e8d65848
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 21 20:06:19 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 22 09:34:43 2019 +0200

    loplugin:constmethod in package
    
    Change-Id: I44bc86a179164e1d039dd3a5f2c8a23396d870b3
    Reviewed-on: https://gerrit.libreoffice.org/77931
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/package/Inflater.hxx b/include/package/Inflater.hxx
index 1e3892f83d75..1b9b134a4ff7 100644
--- a/include/package/Inflater.hxx
+++ b/include/package/Inflater.hxx
@@ -47,7 +47,7 @@ public:
     sal_Int32 doInflateSegment( css::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
     void end(  );
 
-    sal_Int32 getLastInflateError() { return nLastInflateError; }
+    sal_Int32 getLastInflateError() const { return nLastInflateError; }
 };
 
 }
diff --git a/package/inc/CRC32.hxx b/package/inc/CRC32.hxx
index e19ed60d99c3..0791875217cb 100644
--- a/package/inc/CRC32.hxx
+++ b/package/inc/CRC32.hxx
@@ -39,7 +39,7 @@ public:
     /// @throws css::uno::RuntimeException
     void update(const css::uno::Sequence< sal_Int8 > &b);
     /// @throws css::uno::RuntimeException
-    sal_Int32 getValue();
+    sal_Int32 getValue() const;
     /// @throws css::uno::RuntimeException
     void reset();
 };
diff --git a/package/inc/ZipOutputEntry.hxx b/package/inc/ZipOutputEntry.hxx
index 7234d890f4c2..3bace59698b5 100644
--- a/package/inc/ZipOutputEntry.hxx
+++ b/package/inc/ZipOutputEntry.hxx
@@ -57,7 +57,7 @@ public:
 
     ZipEntry* getZipEntry() { return m_pCurrentEntry; }
     ZipPackageStream* getZipPackageStream() { return m_pCurrentStream; }
-    bool isEncrypt() { return m_bEncryptCurrentEntry; }
+    bool isEncrypt() const { return m_bEncryptCurrentEntry; }
 
     void closeEntry();
 
diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx
index b527abde1443..aeb7ab1f86e8 100644
--- a/package/inc/ZipOutputStream.hxx
+++ b/package/inc/ZipOutputStream.hxx
@@ -63,7 +63,7 @@ public:
     /// @throws css::io::IOException
     /// @throws css::uno::RuntimeException
     void finish();
-    const css::uno::Reference< css::io::XOutputStream >& getStream();
+    const css::uno::Reference< css::io::XOutputStream >& getStream() const;
 
     static sal_uInt32 getCurrentDosTime();
     static void setEntry( ZipEntry *pEntry );
@@ -87,7 +87,7 @@ public:
     void reduceScheduledThreadTasksToGivenNumberOrLess(
         sal_Int32 nThreadTasks);
 
-    const std::shared_ptr<comphelper::ThreadTaskTag>& getThreadTaskTag() { return mpThreadTaskTag; }
+    const std::shared_ptr<comphelper::ThreadTaskTag>& getThreadTaskTag() const { return mpThreadTaskTag; }
 };
 
 #endif
diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index 7909c8818107..ffd791c8aca0 100644
--- a/package/inc/ZipPackageStream.hxx
+++ b/package/inc/ZipPackageStream.hxx
@@ -87,7 +87,7 @@ public:
 
     css::uno::Sequence<sal_Int8> GetEncryptionKey(Bugs bugs = Bugs::None);
 
-    sal_Int32 GetStartKeyGenID();
+    sal_Int32 GetStartKeyGenID() const;
 
     sal_Int32 GetEncryptionAlgorithm() const;
     sal_Int32 GetBlockSize() const;
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index 629d679fdccf..818aec0b7942 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -161,10 +161,10 @@ public:
 
     void SetToBeCommited() { m_bFlushed = true; }
 
-    bool HasCachedEncryptionData() { return m_bHasCachedEncryptionData; }
+    bool HasCachedEncryptionData() const { return m_bHasCachedEncryptionData; }
     ::comphelper::SequenceAsHashMap& GetCachedEncryptionData() { return m_aEncryptionData; }
 
-    bool IsModified() { return m_bHasDataToFlush || m_bFlushed; }
+    bool IsModified() const { return m_bHasDataToFlush || m_bFlushed; }
 
     bool IsEncrypted();
     void SetDecrypted();
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index dabdd9af049e..d4f48e282627 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -133,7 +133,7 @@ struct OStorage_Impl
 
     /// Count of registered modification listeners
     oslInterlockedCount         m_nModifiedListenerCount;
-    bool                        HasModifiedListener()
+    bool                        HasModifiedListener() const
     {
         return m_nModifiedListenerCount > 0 && m_pAntiImpl != nullptr;
     }
@@ -321,7 +321,7 @@ public:
 
     void ChildIsDisposed( const css::uno::Reference< css::uno::XInterface >& xChild );
 
-    sal_Int32 GetRefCount_Impl() { return m_refCount; }
+    sal_Int32 GetRefCount_Impl() const { return m_refCount; }
 
     //  XInterface
 
diff --git a/package/source/zipapi/CRC32.cxx b/package/source/zipapi/CRC32.cxx
index 9413a27cefd8..2440630db856 100644
--- a/package/source/zipapi/CRC32.cxx
+++ b/package/source/zipapi/CRC32.cxx
@@ -39,7 +39,7 @@ void CRC32::reset()
 {
     nCRC=0;
 }
-sal_Int32 CRC32::getValue()
+sal_Int32 CRC32::getValue() const
 {
     return nCRC;
 }
diff --git a/package/source/zipapi/MemoryByteGrabber.hxx b/package/source/zipapi/MemoryByteGrabber.hxx
index 9b1c096ae056..9f52204ead67 100644
--- a/package/source/zipapi/MemoryByteGrabber.hxx
+++ b/package/source/zipapi/MemoryByteGrabber.hxx
@@ -36,7 +36,7 @@ public:
     }
     MemoryByteGrabber(css::uno::Sequence<sal_Int8> &&) = delete;
 
-    const sal_Int8 * getCurrentPos () { return mpBuffer + mnCurrent; }
+    const sal_Int8 * getCurrentPos () const { return mpBuffer + mnCurrent; }
 
     sal_Int32 remainingSize() const { return mnEnd - mnCurrent; }
 
diff --git a/package/source/zipapi/XUnbufferedStream.hxx b/package/source/zipapi/XUnbufferedStream.hxx
index afb70cc46ba0..a864de48f2ba 100644
--- a/package/source/zipapi/XUnbufferedStream.hxx
+++ b/package/source/zipapi/XUnbufferedStream.hxx
@@ -79,7 +79,7 @@ public:
                  const css::uno::Reference < css::io::XInputStream >& xRawStream,
                  const ::rtl::Reference< EncryptionData >& rData );
 
-    sal_Int64 getSize() { return mnZipSize; }
+    sal_Int64 getSize() const { return mnZipSize; }
 
     virtual ~XUnbufferedStream() override;
 
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 8ea040bd55e3..6bf3bd33f49e 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -188,7 +188,7 @@ void ZipOutputStream::finish()
     }
 }
 
-const css::uno::Reference< css::io::XOutputStream >& ZipOutputStream::getStream()
+const css::uno::Reference< css::io::XOutputStream >& ZipOutputStream::getStream() const
 {
     return m_xStream;
 }
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 7332cdc366b6..dc49729fc1fe 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -255,7 +255,7 @@ uno::Sequence<sal_Int8> ZipPackageStream::GetEncryptionKey(Bugs const bugs)
     return aResult;
 }
 
-sal_Int32 ZipPackageStream::GetStartKeyGenID()
+sal_Int32 ZipPackageStream::GetStartKeyGenID() const
 {
     // generally should all the streams use the same Start Key
     // but if raw copy without password takes place, we should preserve the imported algorithm
commit d5b07dc9c0185e59077e54c91792476dcbba8d44
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 21 20:03:57 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 22 09:34:35 2019 +0200

    loplugin:constmethod in canvas,comphelper
    
    Change-Id: I8790355369159b2325d3992712b2f65e0401db86
    Reviewed-on: https://gerrit.libreoffice.org/77930
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 71ca12e629ef..3aa7ad8d0a5d 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -1260,7 +1260,7 @@ namespace cairocanvas
     }
 
 
-    geometry::IntegerSize2D CanvasHelper::getSize()
+    geometry::IntegerSize2D CanvasHelper::getSize() const
     {
         if( !mpSurfaceProvider )
             return geometry::IntegerSize2D(1, 1); // we're disposed
diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx
index 0ee7b1011552..0e7cef1b75ba 100644
--- a/canvas/source/cairo/cairo_canvashelper.hxx
+++ b/canvas/source/cairo/cairo_canvashelper.hxx
@@ -195,7 +195,7 @@ namespace cairocanvas
         // BitmapCanvasHelper functionality
         // ================================
 
-        css::geometry::IntegerSize2D getSize();
+        css::geometry::IntegerSize2D getSize() const;
 
         css::uno::Reference< css::rendering::XBitmap >
             getScaledBitmap( const css::geometry::RealSize2D&  newSize,
diff --git a/canvas/source/cairo/cairo_devicehelper.hxx b/canvas/source/cairo/cairo_devicehelper.hxx
index a010e5b67a6d..6e59615c32b8 100644
--- a/canvas/source/cairo/cairo_devicehelper.hxx
+++ b/canvas/source/cairo/cairo_devicehelper.hxx
@@ -90,7 +90,7 @@ namespace cairocanvas
         void dumpScreenContent() const;
 
         OutputDevice* getOutputDevice() const { return mpRefDevice; }
-        const ::cairo::SurfaceSharedPtr& getSurface() { return mpSurface; }
+        const ::cairo::SurfaceSharedPtr& getSurface() const { return mpSurface; }
         ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent );
         ::cairo::SurfaceSharedPtr createSurface( BitmapSystemData const & rData, const Size& rSize );
 
diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx
index 3b4e5aa1bb69..00ddd6c66cb7 100644
--- a/canvas/source/cairo/cairo_spritecanvas.cxx
+++ b/canvas/source/cairo/cairo_spritecanvas.cxx
@@ -176,17 +176,17 @@ namespace cairocanvas
         return maDeviceHelper.getOutputDevice();
     }
 
-    SurfaceSharedPtr const & SpriteCanvas::getBufferSurface()
+    SurfaceSharedPtr const & SpriteCanvas::getBufferSurface() const
     {
         return maDeviceHelper.getBufferSurface();
     }
 
-    SurfaceSharedPtr const & SpriteCanvas::getWindowSurface()
+    SurfaceSharedPtr const & SpriteCanvas::getWindowSurface() const
     {
         return maDeviceHelper.getWindowSurface();
     }
 
-    const ::basegfx::B2ISize& SpriteCanvas::getSizePixel()
+    const ::basegfx::B2ISize& SpriteCanvas::getSizePixel() const
     {
         return maDeviceHelper.getSizePixel();
     }
diff --git a/canvas/source/cairo/cairo_spritecanvas.hxx b/canvas/source/cairo/cairo_spritecanvas.hxx
index 4ec6e8b10522..cf5a5f4e57ab 100644
--- a/canvas/source/cairo/cairo_spritecanvas.hxx
+++ b/canvas/source/cairo/cairo_spritecanvas.hxx
@@ -143,10 +143,10 @@ namespace cairocanvas
                               const css::rendering::ViewState&   viewState,
                               const css::rendering::RenderState& renderState ) override;
 
-        ::cairo::SurfaceSharedPtr const & getWindowSurface();
-        ::cairo::SurfaceSharedPtr const & getBufferSurface();
+        ::cairo::SurfaceSharedPtr const & getWindowSurface() const;
+        ::cairo::SurfaceSharedPtr const & getBufferSurface() const;
 
-        const ::basegfx::B2ISize& getSizePixel();
+        const ::basegfx::B2ISize& getSizePixel() const;
         void setSizePixel( const ::basegfx::B2ISize& rSize );
         void flush();
 
diff --git a/canvas/source/cairo/cairo_spritedevicehelper.cxx b/canvas/source/cairo/cairo_spritedevicehelper.cxx
index a636a22f2e39..bbff8d026263 100644
--- a/canvas/source/cairo/cairo_spritedevicehelper.cxx
+++ b/canvas/source/cairo/cairo_spritedevicehelper.cxx
@@ -124,7 +124,7 @@ namespace cairocanvas
         setSize( ::basegfx::B2ISize(rBounds.Width, rBounds.Height) );
     }
 
-    SurfaceSharedPtr const & SpriteDeviceHelper::getWindowSurface()
+    SurfaceSharedPtr const & SpriteDeviceHelper::getWindowSurface() const
     {
         return DeviceHelper::getSurface();
     }
diff --git a/canvas/source/cairo/cairo_spritedevicehelper.hxx b/canvas/source/cairo/cairo_spritedevicehelper.hxx
index c541d9cf2a47..f7ad11205a67 100644
--- a/canvas/source/cairo/cairo_spritedevicehelper.hxx
+++ b/canvas/source/cairo/cairo_spritedevicehelper.hxx
@@ -59,11 +59,11 @@ namespace cairocanvas
         void notifySizeUpdate( const css::awt::Rectangle& rBounds );
         void setSize( const ::basegfx::B2ISize& rSize );
 
-        const ::cairo::SurfaceSharedPtr& getBufferSurface() { return mpBufferSurface; }
-        ::cairo::SurfaceSharedPtr const & getWindowSurface();
+        const ::cairo::SurfaceSharedPtr& getBufferSurface() const { return mpBufferSurface; }
+        ::cairo::SurfaceSharedPtr const & getWindowSurface() const;
         ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent );
         ::cairo::SurfaceSharedPtr createSurface( BitmapSystemData const & rData, const Size& rSize );
-        const ::basegfx::B2ISize& getSizePixel() { return maSize; }
+        const ::basegfx::B2ISize& getSizePixel() const { return maSize; }
         void flush();
 
     private:
diff --git a/canvas/source/opengl/ogl_bitmapcanvashelper.cxx b/canvas/source/opengl/ogl_bitmapcanvashelper.cxx
index ddf39a6bfa0f..1ed881fda5ab 100644
--- a/canvas/source/opengl/ogl_bitmapcanvashelper.cxx
+++ b/canvas/source/opengl/ogl_bitmapcanvashelper.cxx
@@ -57,7 +57,7 @@ namespace oglcanvas
         return uno::Sequence< sal_Int8 >();
     }
 
-    rendering::IntegerBitmapLayout BitmapCanvasHelper::getMemoryLayout()
+    rendering::IntegerBitmapLayout BitmapCanvasHelper::getMemoryLayout() const
     {
         return ::canvas::tools::getStdMemoryLayout(getSize());
     }
diff --git a/canvas/source/opengl/ogl_bitmapcanvashelper.hxx b/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
index b55eb4576ee9..d6e3e9695065 100644
--- a/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
+++ b/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
@@ -49,7 +49,7 @@ namespace oglcanvas
         // BitmapCanvasHelper functionality
         // ================================
 
-        const css::geometry::IntegerSize2D& getSize() { return maSize; }
+        const css::geometry::IntegerSize2D& getSize() const { return maSize; }
 
         css::uno::Reference< css::rendering::XBitmap >
             getScaledBitmap( const css::geometry::RealSize2D&  newSize,
@@ -63,7 +63,7 @@ namespace oglcanvas
             getPixel( css::rendering::IntegerBitmapLayout& bitmapLayout,
                       const css::geometry::IntegerPoint2D& pos );
 
-        css::rendering::IntegerBitmapLayout getMemoryLayout();
+        css::rendering::IntegerBitmapLayout getMemoryLayout() const;
 
     private:
         css::geometry::IntegerSize2D maSize;
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx
index 5e5e6183f911..03a0ea5274fc 100644
--- a/canvas/source/vcl/canvasbitmaphelper.cxx
+++ b/canvas/source/vcl/canvasbitmaphelper.cxx
@@ -74,7 +74,7 @@ namespace vclcanvas
         CanvasHelper::disposing();
     }
 
-    geometry::IntegerSize2D CanvasBitmapHelper::getSize()
+    geometry::IntegerSize2D CanvasBitmapHelper::getSize() const
     {
         if( !mpBackBuffer )
             return geometry::IntegerSize2D();
@@ -162,7 +162,7 @@ namespace vclcanvas
         return aRes;
     }
 
-    rendering::IntegerBitmapLayout CanvasBitmapHelper::getMemoryLayout()
+    rendering::IntegerBitmapLayout CanvasBitmapHelper::getMemoryLayout() const
     {
         if( !mpOutDevProvider.get() )
             return rendering::IntegerBitmapLayout(); // we're disposed
diff --git a/canvas/source/vcl/canvasbitmaphelper.hxx b/canvas/source/vcl/canvasbitmaphelper.hxx
index fe438a00f011..31a20d8db795 100644
--- a/canvas/source/vcl/canvasbitmaphelper.hxx
+++ b/canvas/source/vcl/canvasbitmaphelper.hxx
@@ -80,7 +80,7 @@ namespace vclcanvas
 
         void clear();
 
-        css::geometry::IntegerSize2D getSize();
+        css::geometry::IntegerSize2D getSize() const;
 
         css::uno::Reference< css::rendering::XBitmap >
             getScaledBitmap( const css::geometry::RealSize2D&  newSize,
@@ -94,7 +94,7 @@ namespace vclcanvas
             getPixel( css::rendering::IntegerBitmapLayout& bitmapLayout,
                       const css::geometry::IntegerPoint2D& pos );
 
-        css::rendering::IntegerBitmapLayout getMemoryLayout();
+        css::rendering::IntegerBitmapLayout getMemoryLayout() const;
 
         /// @internal
         BitmapEx getBitmap() const;
diff --git a/comphelper/source/misc/logging.cxx b/comphelper/source/misc/logging.cxx
index d9b7caf52634..22ff36c288bc 100644
--- a/comphelper/source/misc/logging.cxx
+++ b/comphelper/source/misc/logging.cxx
@@ -86,7 +86,7 @@ namespace comphelper
         return false;
     }
 
-    const css::uno::Reference<css::logging::XLogger> & EventLogger::getLogger()
+    const css::uno::Reference<css::logging::XLogger> & EventLogger::getLogger() const
     {
         return m_pImpl->getLogger();
     }
diff --git a/comphelper/source/processfactory/processfactory.cxx b/comphelper/source/processfactory/processfactory.cxx
index de62a651d90a..515c4b6a7476 100644
--- a/comphelper/source/processfactory/processfactory.cxx
+++ b/comphelper/source/processfactory/processfactory.cxx
@@ -46,7 +46,7 @@ public:
         xProcessFactory = xSMgr;
     }
 
-    Reference< XMultiServiceFactory > get()
+    Reference< XMultiServiceFactory > get() const
     {
         Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
 
diff --git a/include/comphelper/logging.hxx b/include/comphelper/logging.hxx
index 67898408bef6..1a9d9ac367a2 100644
--- a/include/comphelper/logging.hxx
+++ b/include/comphelper/logging.hxx
@@ -124,7 +124,7 @@ namespace comphelper
                 impl_log(_nLogLevel, nullptr, nullptr, rMessage);
         }
 
-        const css::uno::Reference<css::logging::XLogger> & getLogger();
+        const css::uno::Reference<css::logging::XLogger> & getLogger() const;
 
         /** logs a given message, replacing a placeholder in the message with an argument
 


More information about the Libreoffice-commits mailing list