[Libreoffice-commits] core.git: 2 commits - sdext/source sd/source starmath/inc starmath/source sw/inc sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 24 20:13:31 UTC 2019


 sd/source/ui/sidebar/MasterPageContainer.cxx        |   14 ++------------
 sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx  |    4 ++--
 sd/source/ui/table/TableDesignPane.cxx              |    2 +-
 sdext/source/presenter/PresenterTheme.cxx           |   10 +++++-----
 starmath/inc/document.hxx                           |    2 +-
 starmath/inc/rect.hxx                               |    4 ++--
 starmath/inc/smmod.hxx                              |    8 ++++----
 starmath/inc/symbol.hxx                             |    4 ++--
 starmath/source/cfgitem.cxx                         |   10 +++++-----
 starmath/source/cfgitem.hxx                         |   10 +++++-----
 starmath/source/document.cxx                        |    2 +-
 starmath/source/rect.cxx                            |    2 +-
 starmath/source/smmod.cxx                           |    8 ++++----
 starmath/source/symbol.cxx                          |    4 ++--
 sw/inc/AnnotationWin.hxx                            |    4 ++--
 sw/inc/SwStyleNameMapper.hxx                        |    4 ++--
 sw/inc/anchoreddrawobject.hxx                       |    4 ++--
 sw/inc/anchoredobject.hxx                           |    4 ++--
 sw/inc/docufld.hxx                                  |    4 ++--
 sw/inc/fesh.hxx                                     |    4 ++--
 sw/inc/iodetect.hxx                                 |    2 +-
 sw/inc/swabstdlg.hxx                                |    2 +-
 sw/inc/swrect.hxx                                   |   16 ++++++++--------
 sw/inc/txtfld.hxx                                   |    2 +-
 sw/inc/viewsh.hxx                                   |    2 +-
 sw/source/core/bastyp/swrect.cxx                    |   12 ++++++------
 sw/source/core/doc/DocumentListsManager.cxx         |    4 ++--
 sw/source/core/doc/SwStyleNameMapper.cxx            |    6 +++---
 sw/source/core/doc/dbgoutsw.cxx                     |   10 +++++-----
 sw/source/core/frmedt/fefly1.cxx                    |    2 +-
 sw/source/core/frmedt/feshview.cxx                  |    2 +-
 sw/source/core/inc/DocumentListsManager.hxx         |    4 ++--
 sw/source/core/inc/flyfrm.hxx                       |    4 ++--
 sw/source/core/inc/frame.hxx                        |    4 ++--
 sw/source/core/inc/pagefrm.hxx                      |    4 ++--
 sw/source/core/inc/txtfly.hxx                       |    4 ++--
 sw/source/core/layout/anchoreddrawobject.cxx        |    4 ++--
 sw/source/core/layout/fly.cxx                       |    4 ++--
 sw/source/core/layout/frmtool.cxx                   |    2 +-
 sw/source/core/layout/paintfrm.cxx                  |    2 +-
 sw/source/core/layout/ssfrm.cxx                     |    4 ++--
 sw/source/core/text/itrpaint.cxx                    |    2 +-
 sw/source/core/text/txtfly.cxx                      |    4 ++--
 sw/source/core/txtnode/atrfld.cxx                   |    2 +-
 sw/source/core/unocore/unosrch.cxx                  |    4 ++--
 sw/source/core/view/viewsh.cxx                      |    2 +-
 sw/source/filter/basflt/iodetect.cxx                |    2 +-
 sw/source/filter/ww8/WW8TableInfo.cxx               |    4 ++--
 sw/source/filter/ww8/WW8TableInfo.hxx               |    4 ++--
 sw/source/ui/dialog/swdlgfact.cxx                   |    2 +-
 sw/source/ui/dialog/swdlgfact.hxx                   |    2 +-
 sw/source/uibase/dbui/mmconfigitem.cxx              |   13 ++++++-------
 sw/source/uibase/docvw/edtwin.cxx                   |    2 +-
 sw/source/uibase/inc/mmconfigitem.hxx               |    4 ++--
 sw/source/uibase/inc/swruler.hxx                    |    2 +-
 sw/source/uibase/misc/swruler.cxx                   |    5 ++---
 sw/source/uibase/sidebar/PageMarginControl.cxx      |    5 ++---
 sw/source/uibase/sidebar/PageOrientationControl.cxx |    5 ++---
 58 files changed, 127 insertions(+), 141 deletions(-)

New commits:
commit 592c31a8fa8729259cf42440a0a26c0322bbbba5
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Aug 24 20:33:45 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Aug 24 22:12:02 2019 +0200

    loplugin:returnconstval in sw
    
    Change-Id: I15d8553bff7528f690ff92bee75d6a67037c0adf
    Reviewed-on: https://gerrit.libreoffice.org/78062
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 2af2d9e56b37..18ebe2e7f8c1 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -124,8 +124,8 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
         void            SetScrollbar();
 
         void            SetVirtualPosSize( const Point& aPoint, const Size& aSize);
-        const Point     VirtualPos()    { return mPosSize.TopLeft(); }
-        const Size      VirtualSize()   { return mPosSize.GetSize(); }
+        Point           VirtualPos()    { return mPosSize.TopLeft(); }
+        Size            VirtualSize()   { return mPosSize.GetSize(); }
 
         void            ShowAnchorOnly(const Point &aPoint);
         void            ShowNote();
diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx
index e9e2533dd6e6..79d4f1011238 100644
--- a/sw/inc/SwStyleNameMapper.hxx
+++ b/sw/inc/SwStyleNameMapper.hxx
@@ -166,9 +166,9 @@ public:
     // RES_POOLCOLL_LABEL_TABLE, RES_POOLCOLL_LABEL_FRAME
     // forth and back.
     // Non-matching names remain unchanged.
-    SW_DLLPUBLIC static const OUString GetSpecialExtraProgName(
+    SW_DLLPUBLIC static const OUString & GetSpecialExtraProgName(
                     const OUString& rExtraUIName);
-    static const OUString GetSpecialExtraUIName(const OUString& rExtraProgName);
+    static const OUString & GetSpecialExtraUIName(const OUString& rExtraProgName);
 
     static const std::vector<OUString>& GetTextUINameArray();
     static const std::vector<OUString>& GetListsUINameArray();
diff --git a/sw/inc/anchoreddrawobject.hxx b/sw/inc/anchoreddrawobject.hxx
index 5ca119f90aac..2f7a1b6a44d8 100644
--- a/sw/inc/anchoreddrawobject.hxx
+++ b/sw/inc/anchoreddrawobject.hxx
@@ -99,7 +99,7 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject
         virtual bool SetObjTop_( const SwTwips _nTop) override;
         virtual bool SetObjLeft_( const SwTwips _nLeft) override;
 
-        virtual const SwRect GetObjBoundRect() const override;
+        virtual SwRect GetObjBoundRect() const override;
 
     public:
 
@@ -119,7 +119,7 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject
         virtual const SwFrameFormat& GetFrameFormat() const override;
 
         // accessors to the object area and its position
-        virtual const SwRect GetObjRect() const override;
+        virtual SwRect GetObjRect() const override;
 
         boost::optional<tools::Rectangle> const & GetLastObjRect() const { return maLastObjRect;}
         void SetLastObjRect( const tools::Rectangle& _rNewObjRect );
diff --git a/sw/inc/anchoredobject.hxx b/sw/inc/anchoredobject.hxx
index 386cdc0f42a4..0c5c2495092a 100644
--- a/sw/inc/anchoredobject.hxx
+++ b/sw/inc/anchoredobject.hxx
@@ -189,7 +189,7 @@ class SW_DLLPUBLIC SwAnchoredObject
         virtual bool SetObjTop_( const SwTwips _nTop) = 0;
         virtual bool SetObjLeft_( const SwTwips _nLeft) = 0;
 
-        virtual const SwRect GetObjBoundRect() const = 0;
+        virtual SwRect GetObjBoundRect() const = 0;
     public:
 
         virtual ~SwAnchoredObject();
@@ -316,7 +316,7 @@ class SW_DLLPUBLIC SwAnchoredObject
         virtual const SwFrameFormat& GetFrameFormat() const = 0;
 
         // accessors to the object area and its position
-        virtual const SwRect GetObjRect() const = 0;
+        virtual SwRect GetObjRect() const = 0;
 
         void SetObjTop( const SwTwips _nTop);
         void SetObjLeft( const SwTwips _nLeft);
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index abdfe644a798..e6afd73af156 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -471,8 +471,8 @@ public:
     virtual std::unique_ptr<SwField> Copy() const override;
 
     const DateTime&         GetDateTime() const             { return m_aDateTime; }
-    const Date       GetDate() const                 { return Date(m_aDateTime.GetDate()); }
-    const tools::Time GetTime() const                 { return tools::Time(m_aDateTime.GetTime()); }
+    Date       GetDate() const                 { return Date(m_aDateTime.GetDate()); }
+    tools::Time GetTime() const                 { return tools::Time(m_aDateTime.GetTime()); }
     sal_uInt32 GetPostItId() const             { return m_nPostItId; }
 
     /// Author
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 6f6a5e860802..65732d8f384f 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -458,7 +458,7 @@ public:
     OUString GetFlyName() const;
 
     /// get reference to OLE object (if there is one) for selected FlyFrame
-    const css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef() const;
+    css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef() const;
 
     /// Created unique name for frame.
     OUString GetUniqueGrfName() const;
@@ -779,7 +779,7 @@ public:
 
         @returns an object of class Color
     */
-    const Color GetShapeBackgrd() const;
+    Color GetShapeBackgrd() const;
 
     /** Is default horizontal text direction for selected drawing object right-to-left
 
diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index e5223cdb7000..113468412282 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -106,7 +106,7 @@ public:
     static bool IsDetectableText( const sal_Char* pBuf, sal_uLong &rLen,
             rtl_TextEncoding *pCharSet, bool *pSwap, LineEnd *pLineEnd );
 
-    static const OUString GetSubStorageName( const SfxFilter& rFltr );
+    static OUString GetSubStorageName( const SfxFilter& rFltr );
 };
 
 extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportFODT(SvStream &rStream);
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index d696d9388472..37a689cce58b 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -146,7 +146,7 @@ protected:
 public:
     virtual DBManagerOptions GetMergeType() = 0;
     virtual const OUString& GetSaveFilter() const = 0;
-    virtual const css::uno::Sequence< css::uno::Any > GetSelection() const = 0;
+    virtual css::uno::Sequence< css::uno::Any > GetSelection() const = 0;
     virtual css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const = 0;
     virtual bool IsSaveSingleDoc() const = 0;
     virtual bool IsGenerateFromDataBase() const = 0;
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index a09b38e81a8c..24f87ed58fce 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -133,12 +133,12 @@ public:
     void SetUpperLeftCorner(  const Point& rNew );
     void SetUpperRightCorner(  const Point& rNew );
     void SetLowerLeftCorner(  const Point& rNew );
-    const Size  Size_() const;
-    const Point TopLeft()  const;
-    const Point TopRight()  const;
-    const Point BottomLeft()  const;
-    const Point BottomRight()  const;
-    const Size  SwappedSize() const;
+    Size  Size_() const;
+    Point TopLeft()  const;
+    Point TopRight()  const;
+    Point BottomLeft()  const;
+    Point BottomRight()  const;
+    Size  SwappedSize() const;
     long GetLeftDistance( long ) const;
     long GetBottomDistance( long ) const;
     long GetRightDistance( long ) const;
@@ -151,8 +151,8 @@ public:
 
 typedef void (SwRect:: *SwRectSet)( const long nNew );
 typedef long (SwRect:: *SwRectGet)() const;
-typedef const Point (SwRect:: *SwRectPoint)() const;
-typedef const Size (SwRect:: *SwRectSize)() const;
+typedef Point (SwRect:: *SwRectPoint)() const;
+typedef Size (SwRect:: *SwRectSize)() const;
 typedef bool (SwRect:: *SwRectMax)( long ) const;
 typedef long (SwRect:: *SwRectDist)( long ) const;
 typedef void (SwRect:: *SwRectSetTwice)( long, long );
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 0db27ba5818a..8dd16d7b84fc 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -93,7 +93,7 @@ public:
 
     void UpdateTextNodeContent( const OUString& rNewContent );
 
-    const OUString GetFieldContent() const;
+    OUString GetFieldContent() const;
     void UpdateFieldContent();
 
 private:
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 0608c17c0a03..3f11b6d6fe24 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -279,7 +279,7 @@ public:
 
     sal_uInt16 GetPageCount() const;
 
-    const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
+    Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
 
     SwDoc *GetDoc()  const { return mxDoc.get(); }  //Never 0.
 
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 8702d8f15733..b66e0d85f9e1 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -171,13 +171,13 @@ void SwRect::AddBottom( const long nAdd ){ m_Size.AdjustHeight(nAdd ); }
 void SwRect::SetPosX( const long nNew ){ m_Point.setX(nNew); }
 void SwRect::SetPosY( const long nNew ){ m_Point.setY(nNew); }
 
-const Size  SwRect::Size_() const { return SSize(); }
-const Size  SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); }
+Size  SwRect::Size_() const { return SSize(); }
+Size  SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); }
 
-const Point SwRect::TopLeft() const { return Pos(); }
-const Point SwRect::TopRight() const { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() ); }
-const Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY() + m_Size.getHeight() ); }
-const Point SwRect::BottomRight() const
+Point SwRect::TopLeft() const { return Pos(); }
+Point SwRect::TopRight() const { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() ); }
+Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY() + m_Size.getHeight() ); }
+Point SwRect::BottomRight() const
     { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() + m_Size.getHeight() ); }
 
 long SwRect::GetLeftDistance( long nLimit ) const { return m_Point.getX() - nLimit; }
diff --git a/sw/source/core/doc/DocumentListsManager.cxx b/sw/source/core/doc/DocumentListsManager.cxx
index 38efc60084a7..5fe2c0f9cad8 100644
--- a/sw/source/core/doc/DocumentListsManager.cxx
+++ b/sw/source/core/doc/DocumentListsManager.cxx
@@ -180,7 +180,7 @@ DocumentListsManager::~DocumentListsManager()
 }
 
 
-const OUString DocumentListsManager::MakeListIdUnique( const OUString& aSuggestedUniqueListId )
+OUString DocumentListsManager::MakeListIdUnique( const OUString& aSuggestedUniqueListId )
 {
     long nHitCount = 0;
     OUString aTmpStr = aSuggestedUniqueListId;
@@ -193,7 +193,7 @@ const OUString DocumentListsManager::MakeListIdUnique( const OUString& aSuggeste
     return aTmpStr;
 }
 
-const OUString DocumentListsManager::CreateUniqueListId()
+OUString DocumentListsManager::CreateUniqueListId()
 {
     static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
     if (bHack)
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index 1768a464d3da..14d89e59418f 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -356,7 +356,7 @@ lcl_NewProgNameArray(const SwTableEntry *pTable, sal_uInt8 const nCount)
     return pProgNameArray;
 }
 
-OUString
+const OUString &
 lcl_GetSpecialExtraName(const OUString& rExtraName, const bool bIsUIName )
 {
     const std::vector<OUString>& rExtraArr = bIsUIName
@@ -875,13 +875,13 @@ const std::vector<OUString>& SwStyleNameMapper::GetCellStyleProgNameArray()
     return *s_pCellStyleProgNameArray;
 }
 
-const OUString
+const OUString &
 SwStyleNameMapper::GetSpecialExtraProgName(const OUString& rExtraUIName)
 {
     return lcl_GetSpecialExtraName( rExtraUIName, true );
 }
 
-const OUString
+const OUString &
 SwStyleNameMapper::GetSpecialExtraUIName(const OUString& rExtraProgName)
 {
     return lcl_GetSpecialExtraName( rExtraProgName, false );
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 2d8ea2516fa7..afedbfdcc784 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -224,7 +224,7 @@ static map<sal_uInt16,OUString> & GetItemWhichMap()
     return aItemWhichMap;
 }
 
-static const OUString lcl_dbg_out(const SfxPoolItem & rItem)
+static OUString lcl_dbg_out(const SfxPoolItem & rItem)
 {
     OUString aStr("[ ");
 
@@ -248,7 +248,7 @@ const char * dbg_out(const SfxPoolItem * pItem)
     return dbg_out(pItem ? lcl_dbg_out(*pItem) : OUString("(nil)"));
 }
 
-static const OUString lcl_dbg_out(const SfxItemSet & rSet)
+static OUString lcl_dbg_out(const SfxItemSet & rSet)
 {
     SfxItemIter aIter(rSet);
     const SfxPoolItem * pItem;
@@ -282,7 +282,7 @@ const char * dbg_out(const SfxItemSet & rSet)
     return dbg_out(lcl_dbg_out(rSet));
 }
 
-static const OUString lcl_dbg_out(const SwTextAttr & rAttr)
+static OUString lcl_dbg_out(const SwTextAttr & rAttr)
 {
     OUString aStr("[ ");
 
@@ -302,7 +302,7 @@ const char * dbg_out(const SwTextAttr & rAttr)
     return dbg_out(lcl_dbg_out(rAttr));
 }
 
-static const OUString lcl_dbg_out(const SwpHints & rHints)
+static OUString lcl_dbg_out(const SwpHints & rHints)
 {
     OUStringBuffer aStr("[ SwpHints\n");
 
@@ -425,7 +425,7 @@ const char * dbg_out(const SwFrameFormat & rFrameFormat)
     return dbg_out(lcl_dbg_out(rFrameFormat));
 }
 
-static const OUString lcl_AnchoredFrames(const SwNode & rNode)
+static OUString lcl_AnchoredFrames(const SwNode & rNode)
 {
     OUStringBuffer aResult("[");
 
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 35931eb5cd8f..552180f46525 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1453,7 +1453,7 @@ OUString SwFEShell::GetFlyName() const
     return OUString();
 }
 
-const uno::Reference < embed::XEmbeddedObject > SwFEShell::GetOleRef() const
+uno::Reference < embed::XEmbeddedObject > SwFEShell::GetOleRef() const
 {
     uno::Reference < embed::XEmbeddedObject > xObj;
     SwFlyFrame * pFly = GetSelectedFlyFrame();
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 72c9e5443275..41b46703f017 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -3167,7 +3167,7 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
 
     @returns an object of class Color
 */
-const Color SwFEShell::GetShapeBackgrd() const
+Color SwFEShell::GetShapeBackgrd() const
 {
     Color aRetColor;
 
diff --git a/sw/source/core/inc/DocumentListsManager.hxx b/sw/source/core/inc/DocumentListsManager.hxx
index ab02ab41fe8d..2ba7ececfd9a 100644
--- a/sw/source/core/inc/DocumentListsManager.hxx
+++ b/sw/source/core/inc/DocumentListsManager.hxx
@@ -62,8 +62,8 @@ class DocumentListsManager : public IDocumentListsAccess
         // relation between list style and its default list
         std::unordered_map<OUString, SwList*> maListStyleLists;
 
-        const OUString CreateUniqueListId();
-        const OUString MakeListIdUnique( const OUString& aSuggestedUniqueListId );
+        OUString CreateUniqueListId();
+        OUString MakeListIdUnique( const OUString& aSuggestedUniqueListId );
 };
 
 }
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index b51fd502f951..18f263cfc1db 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -138,7 +138,7 @@ protected:
     virtual bool SetObjTop_( const SwTwips _nTop ) override;
     virtual bool SetObjLeft_( const SwTwips _nLeft ) override;
 
-    virtual const SwRect GetObjBoundRect() const override;
+    virtual SwRect GetObjBoundRect() const override;
     virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
     virtual void SwClientNotify(const SwModify& rMod, const SfxHint& rHint) override;
 
@@ -242,7 +242,7 @@ public:
     virtual SwFrameFormat& GetFrameFormat() override;
     virtual const SwFrameFormat& GetFrameFormat() const override;
 
-    virtual const SwRect GetObjRect() const override;
+    virtual SwRect GetObjRect() const override;
 
     /** method to determine if a format on the Writer fly frame is possible
 
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 6e0d653690c4..a966947ca94c 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -724,11 +724,11 @@ public:
 
     // PaintArea is the area where content might be displayed.
     // The margin of a page or the space between columns belongs to it.
-    const SwRect GetPaintArea() const;
+    SwRect GetPaintArea() const;
 
     // UnionFrame is the union of Frame- and PrtArea, normally identical
     // to the FrameArea except in case of negative Prt margins.
-    const SwRect UnionFrame( bool bBorder = false ) const;
+    SwRect UnionFrame( bool bBorder = false ) const;
 
     virtual Size ChgSize( const Size& aNewSize );
 
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 0a3782cca408..95d69bd699ee 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -231,7 +231,7 @@ public:
 
         @return reference to an instance of class Color
     */
-    const Color GetDrawBackgrdColor() const;
+    Color GetDrawBackgrdColor() const;
 
     /** paint margin area of a page
 
@@ -311,7 +311,7 @@ public:
 
     virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const override;
 
-    const SwRect PrtWithoutHeaderAndFooter() const;
+    SwRect PrtWithoutHeaderAndFooter() const;
 
     // in case this is an empty page, this function returns the 'reference' page
     const SwPageFrame& GetFormatPage() const;
diff --git a/sw/source/core/inc/txtfly.hxx b/sw/source/core/inc/txtfly.hxx
index 62eda5bf7df1..ff70f1d2217b 100644
--- a/sw/source/core/inc/txtfly.hxx
+++ b/sw/source/core/inc/txtfly.hxx
@@ -59,7 +59,7 @@ class SwContourCache
     };
     std::vector<CacheItem> mvItems;
     long nPntCnt;
-    const SwRect ContourRect( const SwFormat* pFormat, const SdrObject* pObj,
+    SwRect ContourRect( const SwFormat* pFormat, const SdrObject* pObj,
         const SwTextFrame* pFrame, const SwRect &rLine, const long nXPos,
         const bool bRight );
 
@@ -77,7 +77,7 @@ public:
       BoundRect (including spacing), and the line, for contour-flow,
       the tools::PolyPolygon of the object gets traversed
      */
-    static const SwRect CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
+    static SwRect CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
                                        const SwRect &rLine,
                                        const SwTextFrame* pFrame,
                                        const long nXPos,
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 630aaeccfaf8..079468fdf062 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -605,7 +605,7 @@ const SwFrameFormat& SwAnchoredDrawObject::GetFrameFormat() const
     return *(static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFormat());
 }
 
-const SwRect SwAnchoredDrawObject::GetObjRect() const
+SwRect SwAnchoredDrawObject::GetObjRect() const
 {
     // use geometry of drawing object
     //return GetDrawObj()->GetCurrentBoundRect();
@@ -613,7 +613,7 @@ const SwRect SwAnchoredDrawObject::GetObjRect() const
 }
 
 // --> #i70122#
-const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
+SwRect SwAnchoredDrawObject::GetObjBoundRect() const
 {
     bool bGroupShape = dynamic_cast<const SdrObjGroup*>( GetDrawObj() );
     // Resize objects with relative width or height
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index a2193f24d654..728c191d753f 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2756,14 +2756,14 @@ const SwFrameFormat& SwFlyFrame::GetFrameFormat() const
     return *GetFormat();
 }
 
-const SwRect SwFlyFrame::GetObjRect() const
+SwRect SwFlyFrame::GetObjRect() const
 {
     return getFrameArea();
 }
 
 // #i70122#
 // for Writer fly frames the bounding rectangle equals the object rectangles
-const SwRect SwFlyFrame::GetObjBoundRect() const
+SwRect SwFlyFrame::GetObjBoundRect() const
 {
     return GetObjRect();
 }
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 637f1576cb64..65041858c291 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3636,7 +3636,7 @@ bool IsExtraData( const SwDoc *pDoc )
 }
 
 // OD 22.09.2003 #110978#
-const SwRect SwPageFrame::PrtWithoutHeaderAndFooter() const
+SwRect SwPageFrame::PrtWithoutHeaderAndFooter() const
 {
     SwRect aPrtWithoutHeaderFooter( getFramePrintArea() );
     aPrtWithoutHeaderFooter.Pos() += getFrameArea().Pos();
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 8a99e9961360..704450f25d64 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6981,7 +6981,7 @@ void SwLayoutFrame::RefreshExtraData( const SwRect &rRect ) const
  *
  * @return Color
  */
-const Color SwPageFrame::GetDrawBackgrdColor() const
+Color SwPageFrame::GetDrawBackgrdColor() const
 {
     const SvxBrushItem* pBrushItem;
     const Color* pDummyColor;
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 66b133081cc7..fea37d6f3310 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -578,7 +578,7 @@ SwLayoutFrame::~SwLayoutFrame()
 |*  to be displayed. This region could be larger than the printarea (getFramePrintArea())
 |*  of the upper, it includes e.g. often the margin of the page.
 |*/
-const SwRect SwFrame::GetPaintArea() const
+SwRect SwFrame::GetPaintArea() const
 {
     // NEW TABLES
     // Cell frames may not leave their upper:
@@ -672,7 +672,7 @@ const SwRect SwFrame::GetPaintArea() const
 |*  The unionframe is the framearea (getFrameArea()) of a frame expanded by the
 |*  printarea, if there's a negative margin at the left or right side.
 |*/
-const SwRect SwFrame::UnionFrame( bool bBorder ) const
+SwRect SwFrame::UnionFrame( bool bBorder ) const
 {
     bool bVert = IsVertical();
     SwRectFn fnRect = bVert ? ( IsVertLR() ? (IsVertLRBT() ? fnRectVertL2RB2T : fnRectVertL2R) : fnRectVert ) : fnRectHori;
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index e9e6961e38e7..c56842f6a174 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -70,7 +70,7 @@ bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt )
            SvxCaseMap::SmallCaps == rFnt.GetCaseMap();
 }
 
-static const Color GetUnderColor( const SwFont *pFont )
+static Color GetUnderColor( const SwFont *pFont )
 {
     return pFont->GetUnderColor() == COL_AUTO ?
         pFont->GetColor() : pFont->GetUnderColor();
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 2502c025e7e6..82b16055e82a 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -158,7 +158,7 @@ void ClrContourCache()
 }
 
 // #i68520#
-const SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
+SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
                                             const SwRect &rLine,
                                             const SwTextFrame* pFrame,
                                             const long nXPos,
@@ -206,7 +206,7 @@ const SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj
     return aRet;
 }
 
-const SwRect SwContourCache::ContourRect( const SwFormat* pFormat,
+SwRect SwContourCache::ContourRect( const SwFormat* pFormat,
     const SdrObject* pObj, const SwTextFrame* pFrame, const SwRect &rLine,
     const long nXPos, const bool bRight )
 {
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index e5a09ddfb47a..fba15a6107f9 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -583,7 +583,7 @@ void SwTextInputField::NotifyContentChange( SwFormatField& rFormatField )
     }
 }
 
-const OUString SwTextInputField::GetFieldContent() const
+OUString SwTextInputField::GetFieldContent() const
 {
     return GetFormatField().GetField()->ExpandField(false, nullptr/*ignored anyway*/);
 }
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 603c4063e5d4..8926602e8a80 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -56,7 +56,7 @@ public:
     /// @throws lang::IllegalArgumentException
     /// @throws uno::RuntimeException
     void    SetProperties(const uno::Sequence< beans::PropertyValue >& aSearchAttribs);
-    const uno::Sequence< beans::PropertyValue > GetProperties() const;
+    uno::Sequence< beans::PropertyValue > GetProperties() const;
 
     void    FillItemSet(SfxItemSet& rSet, bool bIsValueSearch) const;
     bool    HasAttributes() const;
@@ -89,7 +89,7 @@ void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::Property
     }
 }
 
-const uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperties() const
+uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperties() const
 {
     sal_uInt32 nPropCount = 0;
     for( size_t i = 0; i < aPropertyEntries.size(); i++)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index d886c0642e0e..e20d7de4a4a1 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2501,7 +2501,7 @@ sal_uInt16 SwViewShell::GetPageCount() const
     return GetLayout() ? GetLayout()->GetPageNum() : 1;
 }
 
-const Size SwViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
+Size SwViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
 {
     Size aSize;
     const SwRootFrame* pTmpRoot = GetLayout();
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 741f4b4d4240..afc03351a0f0 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -52,7 +52,7 @@ SwIoDetect aFilterDetect[] =
     SwIoDetect( FILTER_DOCX )
 };
 
-const OUString SwIoSystem::GetSubStorageName( const SfxFilter& rFltr )
+OUString SwIoSystem::GetSubStorageName( const SfxFilter& rFltr )
 {
     // for StorageFilters also set the SubStorageName
     const OUString& rUserData = rFltr.GetUserData();
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index b5d4897253ea..d8b215e48a95 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -529,7 +529,7 @@ sal_uInt32 WW8TableNodeInfo::getRow() const
     return getInnerForDepth(mnDepth)->getRow();
 }
 
-const WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getFirstInner() const
+WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getFirstInner() const
 {
     WW8TableNodeInfoInner::Pointer_t pResult;
 
@@ -539,7 +539,7 @@ const WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getFirstInner() const
     return pResult;
 }
 
-const WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getInnerForDepth(sal_uInt32 nDepth) const
+WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getInnerForDepth(sal_uInt32 nDepth) const
 {
     WW8TableNodeInfoInner::Pointer_t pResult;
 
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index e9504e650420..306313485f0b 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -203,8 +203,8 @@ public:
     const SwNode * getNextNode() const { return mpNextNode;}
 
     const Inners_t & getInners() const { return mInners;}
-    const WW8TableNodeInfoInner::Pointer_t getFirstInner() const;
-    const WW8TableNodeInfoInner::Pointer_t getInnerForDepth(sal_uInt32 nDepth) const;
+    WW8TableNodeInfoInner::Pointer_t getFirstInner() const;
+    WW8TableNodeInfoInner::Pointer_t getInnerForDepth(sal_uInt32 nDepth) const;
 
     sal_uInt32 getCell() const;
     sal_uInt32 getRow() const;
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index dbcc97b426fb..db641e3dbfe8 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -636,7 +636,7 @@ const OUString& AbstractMailMergeDlg_Impl::GetSaveFilter() const
     return pDlg->GetSaveFilter();
 }
 
-const css::uno::Sequence< css::uno::Any > AbstractMailMergeDlg_Impl::GetSelection() const
+css::uno::Sequence< css::uno::Any > AbstractMailMergeDlg_Impl::GetSelection() const
 {
     return pDlg->GetSelection();
 }
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 656de1e57e3e..e9f619132948 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -527,7 +527,7 @@ class AbstractMailMergeDlg_Impl : public AbstractMailMergeDlg
     DECL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl,SwMailMergeDlg)
     virtual DBManagerOptions GetMergeType() override ;
     virtual const OUString& GetSaveFilter() const override;
-    virtual const css::uno::Sequence< css::uno::Any > GetSelection() const override ;
+    virtual css::uno::Sequence< css::uno::Any > GetSelection() const override ;
     virtual css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const override;
     virtual bool IsSaveSingleDoc() const override;
     virtual bool IsGenerateFromDataBase() const override;
diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx
index 44ca78548510..316002aedf85 100644
--- a/sw/source/uibase/dbui/mmconfigitem.cxx
+++ b/sw/source/uibase/dbui/mmconfigitem.cxx
@@ -160,12 +160,11 @@ public:
     SwMailMergeConfigItem_Impl();
 
     virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
-    const           Sequence< OUString>
-                        GetAddressBlocks(bool bConvertToConfig = false) const;
+    Sequence< OUString> GetAddressBlocks(bool bConvertToConfig = false) const;
     void                SetAddressBlocks(
                                 const Sequence< OUString>& rBlocks,
                                 bool bConvertFromConfig = false);
-    const uno::Sequence< OUString>
+    uno::Sequence< OUString>
                         GetGreetings(SwMailMergeConfigItem::Gender eType,
                                         bool bConvertToConfig = false) const;
     void                SetGreetings(SwMailMergeConfigItem::Gender eType,
@@ -580,7 +579,7 @@ void  SwMailMergeConfigItem_Impl::ImplCommit()
     m_bUserSettingWereOverwritten = false;
 }
 
-const Sequence< OUString> SwMailMergeConfigItem_Impl::GetAddressBlocks(
+Sequence< OUString> SwMailMergeConfigItem_Impl::GetAddressBlocks(
         bool bConvertToConfig) const
 {
     Sequence< OUString> aRet(m_aAddressBlocks.size());
@@ -610,7 +609,7 @@ void SwMailMergeConfigItem_Impl::SetAddressBlocks(
     SetModified();
 }
 
-const Sequence< OUString>   SwMailMergeConfigItem_Impl::GetGreetings(
+Sequence< OUString>   SwMailMergeConfigItem_Impl::GetGreetings(
         SwMailMergeConfigItem::Gender eType, bool bConvertToConfig) const
 {
     const std::vector< OUString>& rGreetings =
@@ -732,7 +731,7 @@ void SwMailMergeConfigItem::SetAddressBlocks(
     m_pImpl->SetAddressBlocks(rBlocks);
 }
 
-const Sequence< OUString> SwMailMergeConfigItem::GetAddressBlocks() const
+Sequence< OUString> SwMailMergeConfigItem::GetAddressBlocks() const
 {
     return m_pImpl->GetAddressBlocks();
 }
@@ -1085,7 +1084,7 @@ void     SwMailMergeConfigItem::SetGreetingLine(bool bSet, bool bInEMail)
     }
 }
 
-const Sequence< OUString>   SwMailMergeConfigItem::GetGreetings(
+Sequence< OUString>   SwMailMergeConfigItem::GetGreetings(
         Gender eType ) const
 {
     return m_pImpl->GetGreetings(eType);
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index d32f1212c3d5..74c52d7ff03c 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -243,7 +243,7 @@ public:
             bTopRightHandle = (pHdl->GetKind() == SdrHdlKind::Anchor_TR);
         }
     }
-    const Point GetPosForHitTest( const OutputDevice& rOut )
+    Point GetPosForHitTest( const OutputDevice& rOut )
     {
         Point aHitTestPos( pHdl->GetPos() );
         aHitTestPos = rOut.LogicToPixel( aHitTestPos );
diff --git a/sw/source/uibase/inc/mmconfigitem.hxx b/sw/source/uibase/inc/mmconfigitem.hxx
index 9b27e4092207..da02ec600e90 100644
--- a/sw/source/uibase/inc/mmconfigitem.hxx
+++ b/sw/source/uibase/inc/mmconfigitem.hxx
@@ -120,7 +120,7 @@ public:
     bool IsHideEmptyParagraphs() const;
     void SetHideEmptyParagraphs(bool bSet);
 
-    const css::uno::Sequence<OUString> GetAddressBlocks() const;
+    css::uno::Sequence<OUString> GetAddressBlocks() const;
     void SetAddressBlocks(const css::uno::Sequence< OUString>& rBlocks);
 
     void SetCurrentAddressBlockIndex( sal_Int32 nSet );
@@ -136,7 +136,7 @@ public:
     bool IsGreetingLine(bool bInEMail) const;
     void SetGreetingLine(bool bSet, bool bInEMail);
 
-    const css::uno::Sequence<OUString> GetGreetings(Gender eType) const;
+    css::uno::Sequence<OUString> GetGreetings(Gender eType) const;
     void SetGreetings(Gender eType, const css::uno::Sequence< OUString>& rBlocks);
 
     sal_Int32 GetCurrentGreeting(Gender eType) const;
diff --git a/sw/source/uibase/inc/swruler.hxx b/sw/source/uibase/inc/swruler.hxx
index 98a444eb1aae..2dac3e6c7926 100644
--- a/sw/source/uibase/inc/swruler.hxx
+++ b/sw/source/uibase/inc/swruler.hxx
@@ -42,7 +42,7 @@ public:
      * \param rRect ignored
      */
     virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    const std::string CreateJsonNotification();
+    std::string CreateJsonNotification();
 
 private:
     SwViewShell * mpViewShell;     //< Shell to check if there is any comments on doc and their visibility
diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx
index 874ab6e81e1e..0597ee1761af 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -253,7 +253,7 @@ void SwCommentRuler::MouseButtonDown( const MouseEvent& rMEvt )
     Invalidate();
 }
 
-const std::string SwCommentRuler::CreateJsonNotification()
+std::string SwCommentRuler::CreateJsonNotification()
 {
     boost::property_tree::ptree jsonNotif;
 
@@ -268,8 +268,7 @@ const std::string SwCommentRuler::CreateJsonNotification()
 
     std::stringstream aStream;
     boost::property_tree::write_json(aStream, jsonNotif);
-    std::string aPayload = aStream.str();
-    return aPayload;
+    return aStream.str();
 }
 
 void SwCommentRuler::NotifyKit()
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index 00914a59a89d..f6e389ee9ae7 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -79,7 +79,7 @@ namespace
         return rPool.GetMetric( nWhich );
     }
 
-    const css::uno::Reference< css::document::XUndoManager > getUndoManager( const css::uno::Reference< css::frame::XFrame >& rxFrame )
+    css::uno::Reference< css::document::XUndoManager > getUndoManager( const css::uno::Reference< css::frame::XFrame >& rxFrame )
     {
         const css::uno::Reference< css::frame::XController >& xController = rxFrame->getController();
         if ( xController.is() )
@@ -88,8 +88,7 @@ namespace
             if ( xModel.is() )
             {
                 const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW );
-                const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_SET_THROW );
-                return xUndoManager;
+                return css::uno::Reference< css::document::XUndoManager >( xSuppUndo->getUndoManager(), css::uno::UNO_SET_THROW );
             }
         }
 
diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx
index 01a78c3e13f9..0d9844efef36 100644
--- a/sw/source/uibase/sidebar/PageOrientationControl.cxx
+++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx
@@ -31,7 +31,7 @@
 #include <cmdid.h>
 
 namespace {
-    const css::uno::Reference< css::document::XUndoManager > getUndoManager( const css::uno::Reference< css::frame::XFrame >& rxFrame )
+    css::uno::Reference< css::document::XUndoManager > getUndoManager( const css::uno::Reference< css::frame::XFrame >& rxFrame )
     {
         const css::uno::Reference< css::frame::XController >& xController = rxFrame->getController();
         if ( xController.is() )
@@ -40,8 +40,7 @@ namespace {
             if ( xModel.is() )
             {
                 const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW );
-                const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_SET_THROW );
-                return xUndoManager;
+                return css::uno::Reference< css::document::XUndoManager >( xSuppUndo->getUndoManager(), css::uno::UNO_SET_THROW );
             }
         }
 
commit ef2e9c91d0a0483c19d0175c1b0ccb24d3f6bfbc
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Aug 24 20:32:56 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Aug 24 22:11:31 2019 +0200

    loplugin:returnconstval in sd..starmath
    
    Change-Id: Ib14f0ebef1c48a00ed09be70cb5885ccd07db762
    Reviewed-on: https://gerrit.libreoffice.org/78060
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index eda233ea18ea..4d241b86b2ab 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -92,8 +92,7 @@ public:
     const Size& GetPreviewSizePixel (PreviewSize eSize) const;
 
     bool HasToken (Token aToken) const;
-    const SharedMasterPageDescriptor GetDescriptor (MasterPageContainer::Token aToken) const;
-    SharedMasterPageDescriptor GetDescriptor (MasterPageContainer::Token aToken);
+    SharedMasterPageDescriptor GetDescriptor (MasterPageContainer::Token aToken) const;
     virtual Token PutMasterPage (const SharedMasterPageDescriptor& rDescriptor) override;
     void InvalidatePreview (Token aToken);
     Image GetPreviewForToken (
@@ -689,16 +688,7 @@ bool MasterPageContainer::Implementation::HasToken (Token aToken) const
         && maContainer[aToken].get()!=nullptr;
 }
 
-const SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescriptor (
-    Token aToken) const
-{
-    if (aToken>=0 && static_cast<unsigned>(aToken)<maContainer.size())
-        return maContainer[aToken];
-    else
-        return SharedMasterPageDescriptor();
-}
-
-SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescriptor (Token aToken)
+SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescriptor (Token aToken) const
 {
     if (aToken>=0 && static_cast<unsigned>(aToken)<maContainer.size())
         return maContainer[aToken];
diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
index 38a0aa9fec59..66f3f404722e 100644
--- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
@@ -141,8 +141,8 @@ public:
 
     const SharedLayer& back() const { return mvLayers.back(); }
 
-    const ::std::vector<SharedLayer>::const_iterator begin() const { return mvLayers.begin(); }
-    const ::std::vector<SharedLayer>::const_iterator end() const { return mvLayers.end(); }
+    ::std::vector<SharedLayer>::const_iterator begin() const { return mvLayers.begin(); }
+    ::std::vector<SharedLayer>::const_iterator end() const { return mvLayers.end(); }
 
     void clear() { mvLayers.clear(); }
 
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index fa4f4a64d37d..f44709a0a020 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -576,7 +576,7 @@ static void FillCellInfoMatrix( const CellInfoVector& rStyle, const TableStyleSe
     }
 }
 
-static const BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, const TableStyleSettings& rSettings, bool bIsPageDark )
+static BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, const TableStyleSettings& rSettings, bool bIsPageDark )
 {
     CellInfoVector aCellInfoVector(sdr::table::style_count);
     FillCellInfoVector( xTableStyle, aCellInfoVector );
diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx
index d35bc828437c..1e40213aba8b 100644
--- a/sdext/source/presenter/PresenterTheme.cxx
+++ b/sdext/source/presenter/PresenterTheme.cxx
@@ -127,7 +127,7 @@ class PaneStyle
 public:
     PaneStyle();
 
-    const SharedBitmapDescriptor GetBitmap (const OUString& sBitmapName) const;
+    SharedBitmapDescriptor GetBitmap (const OUString& sBitmapName) const;
 
     OUString msStyleName;
     std::shared_ptr<PaneStyle> mpParentStyle;
@@ -166,7 +166,7 @@ class ViewStyle
 public:
     ViewStyle();
 
-    const SharedBitmapDescriptor GetBitmap (const OUString& sBitmapName) const;
+    SharedBitmapDescriptor GetBitmap (const OUString& sBitmapName) const;
 
     PresenterTheme::SharedFontDescriptor GetFont() const;
 
@@ -902,11 +902,11 @@ PaneStyle::PaneStyle()
 {
 }
 
-const SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const
+SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const
 {
     if (mpBitmaps != nullptr)
     {
-        const SharedBitmapDescriptor pBitmap = mpBitmaps->GetBitmap(rsBitmapName);
+        SharedBitmapDescriptor pBitmap = mpBitmaps->GetBitmap(rsBitmapName);
         if (pBitmap.get() != nullptr)
             return pBitmap;
     }
@@ -1015,7 +1015,7 @@ ViewStyle::ViewStyle()
 {
 }
 
-const SharedBitmapDescriptor ViewStyle::GetBitmap (const OUString& rsBitmapName) const
+SharedBitmapDescriptor ViewStyle::GetBitmap (const OUString& rsBitmapName) const
 {
     if (rsBitmapName == "Background")
         return mpBackground;
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 6041e304e2ad..c192ef2fc655 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -161,7 +161,7 @@ public:
     SfxPrinter *GetPrinter()    { GetPrt(); return mpPrinter; }
     void        SetPrinter( SfxPrinter * );
 
-    const OUString GetComment() const;
+    OUString GetComment() const;
 
     // to replace chars that can not be saved with the document...
     void        ReplaceBadChars();
diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx
index 8d0bbe931d51..ce390b19724a 100644
--- a/starmath/inc/rect.hxx
+++ b/starmath/inc/rect.hxx
@@ -153,7 +153,7 @@ public:
 
             const Size & GetSize() const    { return aSize; }
 
-            const Size  GetItalicSize() const
+            Size  GetItalicSize() const
             {   return Size(GetItalicWidth(), GetHeight()); }
 
             void Move  (const Point &rPosition);
@@ -166,7 +166,7 @@ public:
 
             bool HasAlignInfo() const { return bHasAlignInfo; }
 
-            const Point AlignTo(const SmRect &rRect, RectPos ePos,
+            Point AlignTo(const SmRect &rRect, RectPos ePos,
                                 RectHorAlign eHor, RectVerAlign eVer) const;
 
             SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode);
diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx
index 297f8a972e50..8c33f5a76baf 100644
--- a/starmath/inc/smmod.hxx
+++ b/starmath/inc/smmod.hxx
@@ -55,11 +55,11 @@ class SmLocalizedSymbolData
 public:
     SmLocalizedSymbolData() = delete;
 
-    static const OUString GetUiSymbolName( const OUString &rExportName );
-    static const OUString GetExportSymbolName( const OUString &rUiName );
+    static OUString GetUiSymbolName( const OUString &rExportName );
+    static OUString GetExportSymbolName( const OUString &rUiName );
 
-    static const OUString GetUiSymbolSetName( const OUString &rExportName );
-    static const OUString GetExportSymbolSetName( const OUString &rUiName );
+    static OUString GetUiSymbolSetName( const OUString &rExportName );
+    static OUString GetExportSymbolSetName( const OUString &rUiName );
 };
 
 class SmModule : public SfxModule, public utl::ConfigurationListener
diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx
index cd40e245c910..9a9a595ed13d 100644
--- a/starmath/inc/symbol.hxx
+++ b/starmath/inc/symbol.hxx
@@ -82,9 +82,9 @@ public:
 
     // symbol sets are for UI purpose only, thus we assemble them here
     std::set< OUString >      GetSymbolSetNames() const;
-    const SymbolPtrVec_t    GetSymbolSet(  const OUString& rSymbolSetName );
+    SymbolPtrVec_t          GetSymbolSet(  const OUString& rSymbolSetName );
 
-    const SymbolPtrVec_t    GetSymbols() const;
+    SymbolPtrVec_t          GetSymbols() const;
     bool                    AddOrReplaceSymbol( const SmSym & rSymbol, bool bForceChange = false );
     void                    RemoveSymbol( const OUString & rSymbolName );
 
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index a8f246423c21..b77ba7b2938f 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -176,7 +176,7 @@ SmFontFormat::SmFontFormat( const vcl::Font &rFont )
 }
 
 
-const vcl::Font SmFontFormat::GetFont() const
+vcl::Font SmFontFormat::GetFont() const
 {
     vcl::Font aRes;
     aRes.SetFamilyName( aName );
@@ -280,7 +280,7 @@ const SmFontFormat * SmFontFormatList::GetFontFormat( size_t nPos ) const
 }
 
 
-const OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt ) const
+OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt ) const
 {
     OUString aRes;
 
@@ -297,7 +297,7 @@ const OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt )
 }
 
 
-const OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd )
+OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd )
 {
     OUString aRes( GetFontFormatId( rFntFmt) );
     if (aRes.isEmpty()  &&  bAdd)
@@ -309,7 +309,7 @@ const OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, b
 }
 
 
-const OUString SmFontFormatList::GetFontFormatId( size_t nPos ) const
+OUString SmFontFormatList::GetFontFormatId( size_t nPos ) const
 {
     OUString aRes;
     if (nPos < aEntries.size())
@@ -318,7 +318,7 @@ const OUString SmFontFormatList::GetFontFormatId( size_t nPos ) const
 }
 
 
-const OUString SmFontFormatList::GetNewFontFormatId() const
+OUString SmFontFormatList::GetNewFontFormatId() const
 {
     // returns first unused FormatId
 
diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx
index 4f1eabf0876d..e6f968583c1e 100644
--- a/starmath/source/cfgitem.hxx
+++ b/starmath/source/cfgitem.hxx
@@ -52,7 +52,7 @@ struct SmFontFormat
     SmFontFormat();
     explicit SmFontFormat( const vcl::Font &rFont );
 
-    const vcl::Font GetFont() const;
+    vcl::Font       GetFont() const;
     bool            operator == ( const SmFontFormat &rFntFmt ) const;
 };
 
@@ -81,10 +81,10 @@ public:
 
     const SmFontFormat *    GetFontFormat( const OUString &rFntFmtId ) const;
     const SmFontFormat *    GetFontFormat( size_t nPos ) const;
-    const OUString          GetFontFormatId( const SmFontFormat &rFntFmt ) const;
-    const OUString          GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd );
-    const OUString          GetFontFormatId( size_t nPos ) const;
-    const OUString          GetNewFontFormatId() const;
+    OUString                GetFontFormatId( const SmFontFormat &rFntFmt ) const;
+    OUString                GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd );
+    OUString                GetFontFormatId( size_t nPos ) const;
+    OUString                GetNewFontFormatId() const;
     size_t                  GetCount() const    { return aEntries.size(); }
 
     bool    IsModified() const          { return bModified; }
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index bd0c67081f51..b3c7c512e3b0 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -120,7 +120,7 @@ void SmDocShell::LoadSymbols()
 }
 
 
-const OUString SmDocShell::GetComment() const
+OUString SmDocShell::GetComment() const
 {
     uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
         GetModel(), uno::UNO_QUERY_THROW);
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index bb1a1628dd85..19ba9d1d3007 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -333,7 +333,7 @@ void SmRect::Move(const Point &rPosition)
 }
 
 
-const Point SmRect::AlignTo(const SmRect &rRect, RectPos ePos,
+Point SmRect::AlignTo(const SmRect &rRect, RectPos ePos,
                             RectHorAlign eHor, RectVerAlign eVer) const
 {   Point  aPos (GetTopLeft());
         // will become the topleft point of the new rectangle position
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index cfa7048d23a0..93a0ca2053de 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -45,7 +45,7 @@ OUString SmResId(const char* pId)
     return Translate::get(pId, SM_MOD()->GetResLocale());
 }
 
-const OUString SmLocalizedSymbolData::GetUiSymbolName( const OUString &rExportName )
+OUString SmLocalizedSymbolData::GetUiSymbolName( const OUString &rExportName )
 {
     OUString aRes;
 
@@ -61,7 +61,7 @@ const OUString SmLocalizedSymbolData::GetUiSymbolName( const OUString &rExportNa
     return aRes;
 }
 
-const OUString SmLocalizedSymbolData::GetExportSymbolName( const OUString &rUiName )
+OUString SmLocalizedSymbolData::GetExportSymbolName( const OUString &rUiName )
 {
     OUString aRes;
 
@@ -78,7 +78,7 @@ const OUString SmLocalizedSymbolData::GetExportSymbolName( const OUString &rUiNa
     return aRes;
 }
 
-const OUString SmLocalizedSymbolData::GetUiSymbolSetName( const OUString &rExportName )
+OUString SmLocalizedSymbolData::GetUiSymbolSetName( const OUString &rExportName )
 {
     OUString aRes;
 
@@ -94,7 +94,7 @@ const OUString SmLocalizedSymbolData::GetUiSymbolSetName( const OUString &rExpor
     return aRes;
 }
 
-const OUString SmLocalizedSymbolData::GetExportSymbolSetName( const OUString &rUiName )
+OUString SmLocalizedSymbolData::GetExportSymbolSetName( const OUString &rUiName )
 {
     OUString aRes;
 
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index e37c69c6726b..22f9cdc376b6 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -121,7 +121,7 @@ SmSym *SmSymbolManager::GetSymbolByName(const OUString& rSymbolName)
 }
 
 
-const SymbolPtrVec_t SmSymbolManager::GetSymbols() const
+SymbolPtrVec_t SmSymbolManager::GetSymbols() const
 {
     SymbolPtrVec_t aRes;
     for (const auto& rEntry : m_aSymbols)
@@ -187,7 +187,7 @@ std::set< OUString > SmSymbolManager::GetSymbolSetNames() const
 }
 
 
-const SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const OUString& rSymbolSetName )
+SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const OUString& rSymbolSetName )
 {
     SymbolPtrVec_t aRes;
     if (!rSymbolSetName.isEmpty())


More information about the Libreoffice-commits mailing list