[Libreoffice-commits] core.git: basegfx/source basegfx/test include/vcl sot/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Oct 26 10:45:06 UTC 2017


 basegfx/source/polygon/b2dtrapezoid.cxx  |    2 +-
 basegfx/source/range/b2drangeclipper.cxx |    2 +-
 basegfx/test/basegfx2d.cxx               |    4 ++--
 basegfx/test/boxclipper.cxx              |    8 ++++----
 basegfx/test/clipstate.cxx               |    2 +-
 basegfx/test/genericclipper.cxx          |    4 ++--
 include/vcl/errcode.hxx                  |    2 +-
 sot/source/sdstor/stgcache.cxx           |    2 +-
 sot/source/sdstor/stgcache.hxx           |    8 ++++----
 sot/source/sdstor/stgdir.cxx             |    2 +-
 sot/source/sdstor/stgdir.hxx             |    2 +-
 sot/source/sdstor/stgio.cxx              |   14 +++++++-------
 sot/source/sdstor/stgio.hxx              |    2 +-
 sot/source/sdstor/stgstrms.hxx           |    2 +-
 sot/source/sdstor/ucbstorage.cxx         |   14 +++++++-------
 15 files changed, 35 insertions(+), 35 deletions(-)

New commits:
commit db04585533cc0f5971f6238c18ae7cadcf31d930
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Oct 25 16:11:34 2017 +0200

    loplugin:constmethod in basegfx,sot
    
    Change-Id: I05d2cdefb7faf489ec29ba28dc5e3c28d08b9780
    Reviewed-on: https://gerrit.libreoffice.org/43863
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx
index 3e3c1c9d6b8c..76f4700c2b79 100644
--- a/basegfx/source/polygon/b2dtrapezoid.cxx
+++ b/basegfx/source/polygon/b2dtrapezoid.cxx
@@ -167,7 +167,7 @@ namespace basegfx
             }
 
             // method for cut support
-            B2DPoint getCutPointForGivenY(double fGivenY)
+            B2DPoint getCutPointForGivenY(double fGivenY) const
             {
                 // Calculate cut point locally (do not use interpolate) since it is numerically
                 // necessary to guarantee the new, equal Y-coordinate
diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx
index e38a9132ec80..639d3886e40a 100644
--- a/basegfx/source/range/b2drangeclipper.cxx
+++ b/basegfx/source/range/b2drangeclipper.cxx
@@ -339,7 +339,7 @@ namespace basegfx
 
         private:
             void handleInitialOwnEdge(SweepLineEvent const & rEvent,
-                                      ActiveEdge&            rActiveEdge)
+                                      ActiveEdge&            rActiveEdge) const
             {
                 const bool isActiveEdgeProceedLeft(
                     rActiveEdge.getEdgeDirection() == ActiveEdge::PROCEED_LEFT);
diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx
index 6dbd6e0708d9..516e57ba1f86 100644
--- a/basegfx/test/basegfx2d.cxx
+++ b/basegfx/test/basegfx2d.cxx
@@ -573,7 +573,7 @@ public:
         CPPUNIT_ASSERT_EQUAL_MESSAGE("multiply: none compact", perspectivePerspectiveProd, temp);
     }
 
-    void impFillMatrix(B2DHomMatrix& rSource, double fScaleX, double fScaleY, double fShearX, double fRotate)
+    void impFillMatrix(B2DHomMatrix& rSource, double fScaleX, double fScaleY, double fShearX, double fRotate) const
     {
         // fill rSource with a linear combination of scale, shear and rotate
         rSource.identity();
@@ -582,7 +582,7 @@ public:
         rSource.rotate(fRotate);
     }
 
-    bool impDecomposeComposeTest(double fScaleX, double fScaleY, double fShearX, double fRotate)
+    bool impDecomposeComposeTest(double fScaleX, double fScaleY, double fShearX, double fRotate) const
     {
         // linear combine matrix with given values
         B2DHomMatrix aSource;
diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx
index d497077c125a..90dbad7d5066 100644
--- a/basegfx/test/boxclipper.cxx
+++ b/basegfx/test/boxclipper.cxx
@@ -167,7 +167,7 @@ public:
 #endif
     }
 
-    B2DPolyPolygon normalizePoly( const B2DPolyPolygon& rPoly )
+    B2DPolyPolygon normalizePoly( const B2DPolyPolygon& rPoly ) const
     {
         B2DPolyPolygon aRes;
         for( sal_uInt32 i=0; i<rPoly.count(); ++i )
@@ -214,7 +214,7 @@ public:
         return aRes;
     }
 
-    void verifyPoly(const char* sName, const char* sSvg, const B2DPolyRange& toTest)
+    void verifyPoly(const char* sName, const char* sSvg, const B2DPolyRange& toTest) const
     {
         B2DPolyPolygon aTmp1;
         CPPUNIT_ASSERT_MESSAGE(sName,
@@ -293,7 +293,7 @@ public:
     }
 
     void dumpSvg(const char* pName,
-                 const ::basegfx::B2DPolyPolygon& rPoly)
+                 const ::basegfx::B2DPolyPolygon& rPoly) const
     {
         (void)pName; (void)rPoly;
 #if OSL_DEBUG_LEVEL > 2
@@ -325,7 +325,7 @@ public:
         CPPUNIT_ASSERT_MESSAGE("getPolyPolygon", true );
     }
 
-    void validatePoly( const char* pName, const B2DPolyRange& rRange )
+    void validatePoly( const char* pName, const B2DPolyRange& rRange ) const
     {
         B2DPolyPolygon genericClip;
         const sal_uInt32 nCount=rRange.count();
diff --git a/basegfx/test/clipstate.cxx b/basegfx/test/clipstate.cxx
index 898b616c57a5..5a8409bf39d5 100644
--- a/basegfx/test/clipstate.cxx
+++ b/basegfx/test/clipstate.cxx
@@ -86,7 +86,7 @@ public:
         aSubtract.subtractRange(aEast);
     }
 
-    void verifyPoly(const char* sName, const char* sSvg, const utils::B2DClipState& toTest)
+    void verifyPoly(const char* sName, const char* sSvg, const utils::B2DClipState& toTest) const
     {
 #if OSL_DEBUG_LEVEL > 2
         fprintf(stderr, "%s - svg:d=\"%s\"\n",
diff --git a/basegfx/test/genericclipper.cxx b/basegfx/test/genericclipper.cxx
index 44aad203390b..dcd912f5dd5c 100644
--- a/basegfx/test/genericclipper.cxx
+++ b/basegfx/test/genericclipper.cxx
@@ -66,7 +66,7 @@ public:
 
     void validate(const char* pName,
                   const char* pValidSvgD,
-                  B2DPolyPolygon (*pFunc)(const B2DPolyPolygon&, const B2DPolyPolygon&))
+                  B2DPolyPolygon (*pFunc)(const B2DPolyPolygon&, const B2DPolyPolygon&)) const
     {
         const B2DPolyPolygon aSelfIntersect(
             utils::prepareForPolygonOperation(aSelfIntersecting));
@@ -127,7 +127,7 @@ public:
 
     void validateCrossover(const char* pName,
                            const char* pInputSvgD,
-                           const char* pValidSvgD)
+                           const char* pValidSvgD) const
     {
         OUString aInput=OUString::createFromAscii(pInputSvgD);
         OUString aValid=OUString::createFromAscii(pValidSvgD);
diff --git a/include/vcl/errcode.hxx b/include/vcl/errcode.hxx
index 6b6ffdede306..9db4587baae0 100644
--- a/include/vcl/errcode.hxx
+++ b/include/vcl/errcode.hxx
@@ -100,7 +100,7 @@ public:
         return ErrCode(m_value | ERRCODE_WARNING_MASK);
     }
 
-    bool IsError() {
+    bool IsError() const {
         return m_value && !IsWarning();
     }
 
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index 7dd4a73d7bb5..8387f0290765 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -416,7 +416,7 @@ void StgCache::MoveError( StorageBase const & r )
 
 // Utility functions
 
-sal_Int32 StgCache::Page2Pos( sal_Int32 nPage )
+sal_Int32 StgCache::Page2Pos( sal_Int32 nPage ) const
 {
     if( nPage < 0 ) nPage = 0;
     return( nPage * m_nPageSize ) + m_nPageSize;
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index 8698efd66b05..8c9cdb7cf315 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -60,7 +60,7 @@ protected:
     SvStream* m_pStrm;                        // physical stream
     bool  m_bMyStream;                        // true: delete stream in dtor
     bool  m_bFile;                            // true: file stream
-    sal_Int32 Page2Pos( sal_Int32 );        // page address --> file position
+    sal_Int32 Page2Pos( sal_Int32 ) const;    // page address --> file position
 public:
     StgCache();
     ~StgCache();
@@ -73,7 +73,7 @@ public:
     void  SetStrm( SvStream*, bool );
     void  SetStrm( UCBStorageStream* );
     bool  Good() const                      { return m_nError == ERRCODE_NONE; }
-    ErrCode GetError()                      { return m_nError;    }
+    ErrCode GetError() const                { return m_nError;    }
     void  MoveError( StorageBase const & );
     void  SetError( ErrCode );
     void  ResetError();
@@ -108,9 +108,9 @@ public:
     StgPage& operator=(const StgPage&) = delete;
     static rtl::Reference< StgPage > Create( short nData, sal_Int32 nPage );
 
-    sal_Int32 GetPage()  { return mnPage; }
+    sal_Int32 GetPage() const { return mnPage; }
     void*     GetData()  { return mpData.get(); }
-    short     GetSize()  { return mnSize; }
+    short     GetSize() const { return mnSize; }
 
 public:
     static bool IsPageGreater( const StgPage *pA, const StgPage *pB );
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 8c2a6d6be846..4852108cfb0c 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -290,7 +290,7 @@ void StgDirEntry::Close()
 
 // Get the current stream size
 
-sal_Int32 StgDirEntry::GetSize()
+sal_Int32 StgDirEntry::GetSize() const
 {
     sal_Int32 n;
     if( m_pTmpStrm )
diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx
index b4f1a763bf8b..7559d6882110 100644
--- a/sot/source/sdstor/stgdir.hxx
+++ b/sot/source/sdstor/stgdir.hxx
@@ -77,7 +77,7 @@ public:
 
     void  OpenStream( StgIo& );     // set up an appropriate stream
     void  Close();
-    sal_Int32 GetSize();
+    sal_Int32 GetSize() const;
     bool  SetSize( sal_Int32 );
     sal_Int32 Seek( sal_Int32 );
     sal_Int32 Read( void*, sal_Int32 );
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index f00595aeda7e..fc7c5a9def55 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -122,7 +122,7 @@ void StgIo::SetupStreams()
 
 // get the logical data page size
 
-short StgIo::GetDataPageSize()
+short StgIo::GetDataPageSize() const
 {
     return 1 << m_aHdr.GetDataPageSize();
 }
@@ -166,10 +166,10 @@ class EasyFat
 public:
     EasyFat( StgIo & rIo, StgStrm *pFatStream, sal_Int32 nPSize );
 
-    sal_Int32 GetPageSize() { return nPageSize; }
+    sal_Int32 GetPageSize() const { return nPageSize; }
 
     FatError Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect );
-    bool HasUnrefChains();
+    bool HasUnrefChains() const;
 };
 
 EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, sal_Int32 nPSize )
@@ -196,7 +196,7 @@ EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, sal_Int32 nPSize )
     }
 }
 
-bool EasyFat::HasUnrefChains()
+bool EasyFat::HasUnrefChains() const
 {
     for( sal_Int32 nPage = 0; nPage < nPages; nPage++ )
     {
@@ -247,12 +247,12 @@ class Validator
 
     FatError ValidateMasterFATs();
     FatError ValidateDirectoryEntries();
-    FatError FindUnrefedChains();
+    FatError FindUnrefedChains() const;
     FatError MarkAll( StgDirEntry *pEntry );
 
 public:
     explicit Validator( StgIo &rIo );
-    bool IsError() { return nError != FatError::Ok; }
+    bool IsError() const { return nError != FatError::Ok; }
 };
 
 Validator::Validator( StgIo &rIoP )
@@ -344,7 +344,7 @@ FatError Validator::ValidateDirectoryEntries()
     return nErr;
 }
 
-FatError Validator::FindUnrefedChains()
+FatError Validator::FindUnrefedChains() const
 {
     if( aSmallFat.HasUnrefChains() ||
         aFat.HasUnrefChains() )
diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx
index 3511ad10be44..d73db29cfb01 100644
--- a/sot/source/sdstor/stgio.hxx
+++ b/sot/source/sdstor/stgio.hxx
@@ -57,7 +57,7 @@ public:
     StgDirStrm*  m_pTOC;              // TOC stream
     StgDataStrm* m_pDataFAT;          // small data FAT stream
     StgDataStrm* m_pDataStrm;         // small data stream
-    short        GetDataPageSize(); // get the logical data page size
+    short        GetDataPageSize() const; // get the logical data page size
     bool Load();                    // load a storage file
     bool Init();                    // set up an empty file
     bool CommitAll();               // commit everything (root commit)
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index c8432e212e49..45c9a71aa8a6 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -53,7 +53,7 @@ public:
     sal_Int32 GetNextPage( sal_Int32 nPg );
     sal_Int32 AllocPages( sal_Int32 nStart, sal_Int32 nPages );
     bool  FreePages( sal_Int32 nStart, bool bAll );
-    sal_Int32 GetMaxPage() { return m_nMaxPage; }
+    sal_Int32 GetMaxPage() const { return m_nMaxPage; }
     void  SetLimit( sal_Int32 n ) { m_nLimit = n; }
 };
 
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index ee92acc43a5c..6568d5c20f56 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -558,11 +558,11 @@ struct UCBStorageElement_Impl
                                 }
 
     ::ucbhelper::Content*       GetContent();
-    bool                        IsModified();
-    OUString                    GetContentType();
+    bool                        IsModified() const;
+    OUString                    GetContentType() const;
     void                        SetContentType( const OUString& );
-    OUString                    GetOriginalContentType();
-    bool                        IsLoaded()
+    OUString                    GetOriginalContentType() const;
+    bool                        IsLoaded() const
                                 { return m_xStream.is() || m_xStorage.is(); }
 };
 
@@ -576,7 +576,7 @@ struct UCBStorageElement_Impl
         return nullptr;
 }
 
-OUString UCBStorageElement_Impl::GetContentType()
+OUString UCBStorageElement_Impl::GetContentType() const
 {
     if ( m_xStream.is() )
         return m_xStream->m_aContentType;
@@ -602,7 +602,7 @@ void UCBStorageElement_Impl::SetContentType( const OUString& rType )
     }
 }
 
-OUString UCBStorageElement_Impl::GetOriginalContentType()
+OUString UCBStorageElement_Impl::GetOriginalContentType() const
 {
     if ( m_xStream.is() )
         return m_xStream->m_aOriginalContentType;
@@ -612,7 +612,7 @@ OUString UCBStorageElement_Impl::GetOriginalContentType()
         return OUString();
 }
 
-bool UCBStorageElement_Impl::IsModified()
+bool UCBStorageElement_Impl::IsModified() const
 {
     bool bModified = m_bIsRemoved || m_bIsInserted || m_aName != m_aOriginalName;
     if ( bModified )


More information about the Libreoffice-commits mailing list