[Libreoffice-commits] core.git: compilerplugins/clang include/sax reportdesign/inc reportdesign/source sal/cppunittester sal/osl sal/qa sal/rtl sal/textenc sax/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 12 10:47:17 UTC 2018


 compilerplugins/clang/constfieldsrewrite.cxx            |   33 +++++
 include/sax/fastattribs.hxx                             |    8 -
 reportdesign/inc/RptObject.hxx                          |    8 -
 reportdesign/inc/UndoActions.hxx                        |    8 -
 reportdesign/source/core/api/ReportDefinition.cxx       |    2 
 reportdesign/source/core/inc/ReportControlModel.hxx     |    2 
 reportdesign/source/core/inc/Shape.hxx                  |    2 
 reportdesign/source/core/sdr/UndoEnv.cxx                |    2 
 reportdesign/source/filter/xml/xmlFunction.hxx          |    2 
 reportdesign/source/filter/xml/xmlStyleImport.hxx       |    2 
 reportdesign/source/ui/inc/ColorListener.hxx            |    4 
 reportdesign/source/ui/inc/ColumnInfo.hxx               |    4 
 reportdesign/source/ui/inc/DesignView.hxx               |    4 
 reportdesign/source/ui/inc/Formula.hxx                  |    2 
 reportdesign/source/ui/inc/FunctionHelper.hxx           |    4 
 reportdesign/source/ui/inc/GroupsSorting.hxx            |    2 
 reportdesign/source/ui/inc/RptUndo.hxx                  |    6 -
 reportdesign/source/ui/inc/ViewsWindow.hxx              |    4 
 reportdesign/source/ui/inc/dlgedclip.hxx                |    2 
 reportdesign/source/ui/inspection/DefaultInspection.cxx |    2 
 reportdesign/source/ui/misc/UITools.cxx                 |    4 
 reportdesign/source/ui/report/ViewsWindow.cxx           |    2 
 sal/cppunittester/cppunittester.cxx                     |    2 
 sal/osl/unx/backtraceapi.cxx                            |    2 
 sal/osl/unx/file.cxx                                    |    4 
 sal/osl/unx/file_impl.hxx                               |    4 
 sal/osl/unx/file_path_helper.cxx                        |    2 
 sal/osl/unx/file_url.cxx                                |    4 
 sal/osl/unx/pipe.cxx                                    |    2 
 sal/osl/unx/signal.cxx                                  |    2 
 sal/osl/unx/socket.cxx                                  |    4 
 sal/osl/unx/thread.cxx                                  |   12 +-
 sal/qa/osl/condition/osl_Condition.cxx                  |    2 
 sal/qa/rtl/strings/test_oustring_convert.cxx            |    8 -
 sal/qa/rtl/strings/test_oustring_endswith.cxx           |    6 -
 sal/rtl/bootstrap.cxx                                   |    4 
 sal/textenc/convertbig5hkscs.hxx                        |    2 
 sal/textenc/convertgb18030.hxx                          |   16 +-
 sal/textenc/convertsimple.cxx                           |    8 -
 sal/textenc/convertsinglebytetobmpunicode.hxx           |   10 -
 sal/textenc/tenchelp.hxx                                |   94 ++++++++--------
 sal/textenc/tencinfo.cxx                                |    2 
 sax/source/expatwrap/sax_expat.cxx                      |   10 -
 sax/source/fastparser/fastparser.cxx                    |    6 -
 sax/source/tools/fastserializer.cxx                     |   14 --
 sax/source/tools/fastserializer.hxx                     |    5 
 46 files changed, 172 insertions(+), 162 deletions(-)

New commits:
commit d4d37662b090cb237585156a47cd8e1f1cbe2656
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Oct 11 15:51:08 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Oct 12 12:46:45 2018 +0200

    loplugin:constfields in reportdesign,sal,sax
    
    and improve the rewriter so I spend less time fixing formatting
    
    Change-Id: Ic2a6e5e31a5a202d2d02a47d77c484a57a5ec514
    Reviewed-on: https://gerrit.libreoffice.org/61676
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/constfieldsrewrite.cxx b/compilerplugins/clang/constfieldsrewrite.cxx
index cff211665ddf..209d97423a23 100644
--- a/compilerplugins/clang/constfieldsrewrite.cxx
+++ b/compilerplugins/clang/constfieldsrewrite.cxx
@@ -122,11 +122,38 @@ bool ConstFieldsRewrite::VisitFieldDecl(const FieldDecl* fieldDecl)
     if (!(found < mmappedData + mmapFilesize))
         return true;
 
+    SourceManager& SM = compiler.getSourceManager();
     auto endLoc = fieldDecl->getTypeSourceInfo()->getTypeLoc().getEndLoc();
-    endLoc = endLoc.getLocWithOffset(
-        Lexer::MeasureTokenLength(endLoc, compiler.getSourceManager(), compiler.getLangOpts()));
+    endLoc = endLoc.getLocWithOffset(Lexer::MeasureTokenLength(endLoc, SM, compiler.getLangOpts()));
 
-    if (!insertText(endLoc, " const"))
+    // Calculate how much space is available after the type declaration that we can use to
+    // overwrite with the " const". This reduces the amount of formatting fixups I need to do.
+    char const* p1 = SM.getCharacterData(endLoc);
+    bool success = false;
+    if (*p1 != ' ')
+    {
+        // Sometimes there is no space at all e.g. in
+        //     FastTokenHandlerBase *mpTokenHandler;
+        // between the "*" and the "mpTokenHandler", so add an extra space.
+        success = insertText(endLoc, " const ");
+    }
+    else
+    {
+        int spaceAvailable = 1;
+        ++p1;
+        for (; spaceAvailable < 6; ++spaceAvailable)
+        {
+            if (*p1 != ' ')
+                break;
+            ++p1;
+        }
+        if (spaceAvailable < 6)
+            success = replaceText(endLoc, spaceAvailable - 1, " const");
+        else
+            success = replaceText(endLoc, spaceAvailable, " const");
+    }
+
+    if (!success)
     {
         report(DiagnosticsEngine::Warning, "Could not mark field as const",
                compat::getBeginLoc(fieldDecl))
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 029f3a12f780..a0f552226fe6 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -36,9 +36,9 @@ namespace sax_fastparser
 
 struct UnknownAttribute
 {
-    OUString maNamespaceURL;
-    OString maName;
-    OString maValue;
+    OUString const maNamespaceURL;
+    OString const maName;
+    OString const maValue;
 
     UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, const OString& value );
     UnknownAttribute( const OString& rName, const OString& value );
@@ -204,7 +204,7 @@ private:
     std::vector< sal_Int32 > maAttributeTokens;
     UnknownAttributeList maUnknownAttributes;
     css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler;
-    FastTokenHandlerBase *mpTokenHandler;
+    FastTokenHandlerBase * const mpTokenHandler;
 };
 
 }
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index 31e3346c074d..f663a59787f7 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -46,7 +46,7 @@ typedef ::std::multimap< sal_Int16, OUString > IndexToNameMap;
     class REPORTDESIGN_DLLPUBLIC DlgEdHint: public SfxHint
     {
     private:
-        DlgEdHintKind   eHintKind;
+        DlgEdHintKind const eHintKind;
 
         DlgEdHint(DlgEdHint&) = delete;
         void operator =(DlgEdHint&) = delete;
@@ -68,7 +68,7 @@ protected:
     mutable css::uno::Reference< css::beans::XPropertyChangeListener> m_xPropertyChangeListener;
     mutable css::uno::Reference< css::report::XReportComponent>       m_xReportComponent;
     css::uno::Reference< css::uno::XInterface >                       m_xKeepShapeAlive;
-    OUString m_sComponentName;
+    OUString const m_sComponentName;
     bool        m_bIsListening;
 
     OObjectBase(const css::uno::Reference< css::report::XReportComponent>& _xComponent);
@@ -215,7 +215,7 @@ private:
     void impl_createDataProvider_nothrow( const css::uno::Reference< css::frame::XModel>& _xModel);
     virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override;
 
-    sal_uInt16 m_nType;
+    sal_uInt16 const m_nType;
     bool    m_bOnlyOnce;
 };
 
@@ -228,7 +228,7 @@ class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase
     friend class OObjectBase;
     friend class DlgEdFactory;
 
-    sal_uInt16   m_nObjectType;
+    sal_uInt16 const m_nObjectType;
     // tdf#118730 remember if this object was created interactively (due to ::EndCreate being called)
     bool         m_bSetDefaultLabel;
 
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
index 9088eb693202..0219c9e39e45 100644
--- a/reportdesign/inc/UndoActions.hxx
+++ b/reportdesign/inc/UndoActions.hxx
@@ -170,7 +170,7 @@ namespace rptui
                         m_xOwnElement;  // object owned by the action
         css::uno::Reference< css::container::XIndexContainer >
                         m_xContainer;
-        Action          m_eAction;
+        Action const    m_eAction;
 
     public:
         OUndoContainerAction(SdrModel& rMod
@@ -231,9 +231,9 @@ namespace rptui
     class REPORTDESIGN_DLLPUBLIC ORptUndoPropertyAction: public OCommentUndoAction
     {
         css::uno::Reference< css::beans::XPropertySet> m_xObj;
-        OUString               m_aPropertyName;
-        css::uno::Any          m_aNewValue;
-        css::uno::Any          m_aOldValue;
+        OUString const         m_aPropertyName;
+        css::uno::Any const    m_aNewValue;
+        css::uno::Any const    m_aOldValue;
 
         /** sets either the old value or the new value again at the property set.
          *
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 6b273ea26fc4..de9df0d5a02d 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -2262,7 +2262,7 @@ class OStylesHelper:
     typedef ::std::map< OUString, uno::Any  , ::comphelper::UStringMixLess> TStyleElements;
     TStyleElements                                  m_aElements;
     ::std::vector<TStyleElements::iterator>         m_aElementsPos;
-    uno::Type                                       m_aType;
+    uno::Type const                                 m_aType;
 
 protected:
     virtual ~OStylesHelper() override {}
diff --git a/reportdesign/source/core/inc/ReportControlModel.hxx b/reportdesign/source/core/inc/ReportControlModel.hxx
index 72dc147aabb3..1154446671dc 100644
--- a/reportdesign/source/core/inc/ReportControlModel.hxx
+++ b/reportdesign/source/core/inc/ReportControlModel.hxx
@@ -77,7 +77,7 @@ namespace reportdesign
         ::comphelper::OInterfaceContainerHelper2                  aContainerListeners;
         OReportComponentProperties                          aComponent;
         OFormatProperties                                   aFormatProperties;
-        css::container::XContainer*                         m_pOwner;
+        css::container::XContainer* const                   m_pOwner;
         ::std::vector< css::uno::Reference< css::report::XFormatCondition> >
                                                             m_aFormatConditions;
         osl::Mutex&                                         m_rMutex;
diff --git a/reportdesign/source/core/inc/Shape.hxx b/reportdesign/source/core/inc/Shape.hxx
index b7c9e6d882f9..2fd6d6c32041 100644
--- a/reportdesign/source/core/inc/Shape.hxx
+++ b/reportdesign/source/core/inc/Shape.hxx
@@ -50,7 +50,7 @@ namespace reportdesign
         sal_Int32                                                       m_nZOrder;
         bool                                                            m_bOpaque;
 
-        OUString                                                        m_sServiceName;
+        OUString const                                                  m_sServiceName;
         OUString                                                        m_CustomShapeEngine;
         OUString                                                        m_CustomShapeData;
         css::uno::Sequence< css::beans::PropertyValue >                 m_CustomShapeGeometry;
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index db5398ffd7dc..5d6b46cff3a6 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -61,7 +61,7 @@ namespace rptui
 
 struct PropertyInfo
 {
-    bool    bIsReadonlyOrTransient;
+    bool const bIsReadonlyOrTransient;
 
     explicit PropertyInfo( const bool i_bIsTransientOrReadOnly )
         :bIsReadonlyOrTransient( i_bIsTransientOrReadOnly )
diff --git a/reportdesign/source/filter/xml/xmlFunction.hxx b/reportdesign/source/filter/xml/xmlFunction.hxx
index 6f03bfa58133..1f1fe3e94d30 100644
--- a/reportdesign/source/filter/xml/xmlFunction.hxx
+++ b/reportdesign/source/filter/xml/xmlFunction.hxx
@@ -32,7 +32,7 @@ namespace rptxml
     {
         css::uno::Reference< css::report::XFunctions >    m_xFunctions;
         css::uno::Reference< css::report::XFunction >     m_xFunction;
-        bool                                              m_bAddToReport;
+        bool const                                        m_bAddToReport;
 
         ORptFilter& GetOwnImport();
 
diff --git a/reportdesign/source/filter/xml/xmlStyleImport.hxx b/reportdesign/source/filter/xml/xmlStyleImport.hxx
index 28641a8b8f59..8ae7335f0006 100644
--- a/reportdesign/source/filter/xml/xmlStyleImport.hxx
+++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx
@@ -77,7 +77,7 @@ namespace rptxml
     {
         ORptFilter&           m_rImport;
         sal_Int32 m_nNumberFormatIndex;
-        bool bAutoStyles : 1;
+        bool const bAutoStyles : 1;
 
         //mutable rtl::Reference < SvXMLImportPropertyMapper > m_xControlImpPropMapper;
         mutable rtl::Reference < SvXMLImportPropertyMapper > m_xCellImpPropMapper;
diff --git a/reportdesign/source/ui/inc/ColorListener.hxx b/reportdesign/source/ui/inc/ColorListener.hxx
index 0f8a89acad9e..2958437fe72b 100644
--- a/reportdesign/source/ui/inc/ColorListener.hxx
+++ b/reportdesign/source/ui/inc/ColorListener.hxx
@@ -32,9 +32,9 @@ namespace rptui
         void operator =(const OColorListener&) = delete;
     protected:
         Link<OColorListener&,void>          m_aCollapsedLink;
-        svtools::ColorConfig                m_aColorConfig;
+        svtools::ColorConfig const          m_aColorConfig;
         svtools::ExtendedColorConfig        m_aExtendedColorConfig;
-        OUString                            m_sColorEntry;
+        OUString const                      m_sColorEntry;
         Color                               m_nColor;
         Color                               m_nTextBoundaries;
         bool                            m_bCollapsed;
diff --git a/reportdesign/source/ui/inc/ColumnInfo.hxx b/reportdesign/source/ui/inc/ColumnInfo.hxx
index 65062f9dc136..6a9a2e360960 100644
--- a/reportdesign/source/ui/inc/ColumnInfo.hxx
+++ b/reportdesign/source/ui/inc/ColumnInfo.hxx
@@ -25,8 +25,8 @@ namespace rptui
 {
     struct ColumnInfo
     {
-        OUString sColumnName;
-        OUString sLabel;
+        OUString const sColumnName;
+        OUString const sLabel;
         ColumnInfo(const OUString& i_sColumnName,const OUString& i_sLabel)
             : sColumnName(i_sColumnName)
             , sLabel(i_sLabel)
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
index fe9f7b20554e..1b09ff7f896f 100644
--- a/reportdesign/source/ui/inc/DesignView.hxx
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -70,8 +70,8 @@ namespace rptui
         Idle                                m_aMarkIdle;
         DlgEdMode                           m_eMode;
         sal_uInt16                          m_eActObj;
-        Size                                m_aGridSizeCoarse;
-        Size                                m_aGridSizeFine;
+        Size const                          m_aGridSizeCoarse;
+        Size const                          m_aGridSizeFine;
         bool                                m_bDeleted;
 
 
diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx
index a2f4aa707692..68c20917af4f 100644
--- a/reportdesign/source/ui/inc/Formula.hxx
+++ b/reportdesign/source/ui/inc/Formula.hxx
@@ -46,7 +46,7 @@ class FormulaDialog : public formula::FormulaModalDialog,
                       public formula::IControlReferenceHandler
 {
     std::shared_ptr< formula::IFunctionManager > m_aFunctionManager;
-    formula::FormEditData*             m_pFormulaData;
+    formula::FormEditData* const       m_pFormulaData;
     VclPtr<OAddFieldWindow>            m_pAddField;
     css::uno::Reference < css::beans::XPropertySet >          m_xRowSet;
     css::uno::Reference< css::report::meta::XFormulaParser>   m_xParser;
diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx b/reportdesign/source/ui/inc/FunctionHelper.hxx
index df18ed34cb36..4d94f6f40bd9 100644
--- a/reportdesign/source/ui/inc/FunctionHelper.hxx
+++ b/reportdesign/source/ui/inc/FunctionHelper.hxx
@@ -83,8 +83,8 @@ class FunctionCategory : public formula::IFunctionCategory
 {
     mutable ::std::vector< std::shared_ptr< FunctionDescription > > m_aFunctions;
     css::uno::Reference< css::report::meta::XFunctionCategory> m_xCategory;
-    sal_uInt32 m_nFunctionCount;
-    sal_uInt32 m_nNumber;
+    sal_uInt32 const m_nFunctionCount;
+    sal_uInt32 const m_nNumber;
     const FunctionManager* m_pFunctionManager;
 public:
     FunctionCategory(const FunctionManager* _pFMgr,sal_uInt32 _nPos,const css::uno::Reference< css::report::meta::XFunctionCategory>& _xCategory);
diff --git a/reportdesign/source/ui/inc/GroupsSorting.hxx b/reportdesign/source/ui/inc/GroupsSorting.hxx
index baa187dccb31..f8979053de55 100644
--- a/reportdesign/source/ui/inc/GroupsSorting.hxx
+++ b/reportdesign/source/ui/inc/GroupsSorting.hxx
@@ -80,7 +80,7 @@ class OGroupsSortingDialog :    public FloatingWindow
     ::rtl::Reference< comphelper::OPropertyChangeMultiplexer>                       m_pReportListener;
     css::uno::Reference< css::report::XGroups>            m_xGroups;
     css::uno::Reference< css::container::XNameAccess >    m_xColumns;
-    bool                                                  m_bReadOnly;
+    bool const                                            m_bReadOnly;
 private:
     DECL_LINK( OnControlFocusLost, Control&, void );
     DECL_LINK( OnControlFocusGot, Control&, void );
diff --git a/reportdesign/source/ui/inc/RptUndo.hxx b/reportdesign/source/ui/inc/RptUndo.hxx
index 9c125121b9e1..cf2bd6e50196 100644
--- a/reportdesign/source/ui/inc/RptUndo.hxx
+++ b/reportdesign/source/ui/inc/RptUndo.hxx
@@ -42,8 +42,8 @@ namespace rptui
                                                     m_aControls;
         ::std::vector< ::std::pair< OUString ,css::uno::Any> >
                                                     m_aValues;
-        Action                                      m_eAction;
-        sal_uInt16                                  m_nSlot;
+        Action const                                m_eAction;
+        sal_uInt16 const                            m_nSlot;
         bool                                        m_bInserted;
 
         virtual void    implReInsert( ) = 0;
@@ -114,7 +114,7 @@ namespace rptui
     {
         css::uno::Reference< css::report::XGroup>             m_xGroup; ///<! the group for the undo redo action
         css::uno::Reference< css::report::XReportDefinition > m_xReportDefinition; ///<! the parent report definition
-        Action                                                                          m_eAction; ///<! the current action
+        Action const                                                                    m_eAction; ///<! the current action
         sal_Int32                                                                       m_nLastPosition; ///<! the last position of the group
 
         void    implReInsert( );
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
index 1ac0e712632b..3a05a2ad7cd3 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -47,8 +47,8 @@ namespace rptui
     struct RectangleLess
     {
         enum CompareMode { POS_LEFT,POS_RIGHT,POS_UPPER,POS_DOWN,POS_CENTER_HORIZONTAL,POS_CENTER_VERTICAL };
-        CompareMode m_eCompareMode;
-        Point       m_aRefPoint;
+        CompareMode const m_eCompareMode;
+        Point const m_aRefPoint;
         RectangleLess(CompareMode _eCompareMode,const Point& _rRefPoint ) : m_eCompareMode(_eCompareMode),m_aRefPoint(_rRefPoint){}
         bool operator() (const tools::Rectangle& lhs, const tools::Rectangle& rhs) const
         {
diff --git a/reportdesign/source/ui/inc/dlgedclip.hxx b/reportdesign/source/ui/inc/dlgedclip.hxx
index e9965a2b8d0c..75ebfacf1785 100644
--- a/reportdesign/source/ui/inc/dlgedclip.hxx
+++ b/reportdesign/source/ui/inc/dlgedclip.hxx
@@ -72,7 +72,7 @@ protected:
     virtual void        AddSupportedFormats() override;
     virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
 private:
-    TSectionElements    m_aCopyElements;
+    TSectionElements const m_aCopyElements;
 };
 }
 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DLGEDCLIP_HXX
diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx
index b1479e1401a2..20ca09cc0d31 100644
--- a/reportdesign/source/ui/inspection/DefaultInspection.cxx
+++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx
@@ -199,7 +199,7 @@ namespace rptui
         {
             const sal_Char* programmaticName;
             const char* uiNameResId;
-            OString    helpId;
+            OString const helpId;
         } aCategories[] = {
             { "General",    RID_STR_PROPPAGE_DEFAULT,   HID_RPT_PROPDLG_TAB_GENERAL },
             { "Data",       RID_STR_PROPPAGE_DATA,      HID_RPT_PROPDLG_TAB_DATA },
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 48b509663757..e11ba27ccf19 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -532,8 +532,8 @@ namespace
             lcl_pushBack( _out_rProperties, PROPERTY_CHARCASEMAP, uno::makeAny( pFontItem->GetEnumValue() ) );
         }
         struct Items {
-                sal_uInt16 nWhich;
-                OUString sPropertyName;
+                sal_uInt16 const nWhich;
+                OUString const sPropertyName;
         };
         const Items pItems[] = { {ITEMID_LANGUAGE,OUString(PROPERTY_CHARLOCALE)}
                                 ,{ITEMID_LANGUAGE_ASIAN,OUString(PROPERTY_CHARLOCALEASIAN)}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 766e2ce045f1..d5b6261b9bf5 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -957,7 +957,7 @@ namespace
     class ApplySectionViewAction
     {
     private:
-        SectionViewAction   m_eAction;
+        SectionViewAction const m_eAction;
 
     public:
         explicit ApplySectionViewAction()
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index b4c15ea434a5..3ff102f18410 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -196,7 +196,7 @@ struct test_name_compare
         return nEndPos == maName.size();
     }
 
-    std::string maName;
+    std::string const maName;
 };
 
 bool addRecursiveTests(const std::vector<std::string>& test_names, CppUnit::Test* pTest, CppUnit::TestRunner& rRunner)
diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx
index 9edeef9fd7d9..07a315f36be2 100644
--- a/sal/osl/unx/backtraceapi.cxx
+++ b/sal/osl/unx/backtraceapi.cxx
@@ -30,7 +30,7 @@ struct FreeGuard {
 
     ~FreeGuard() { std::free(buffer); }
 
-    char ** buffer;
+    char ** const buffer;
 };
 
 }
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 71f53470dd0e..c3c5cd7fd655 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -69,7 +69,7 @@ struct FileHandle_Impl
         KIND_FD = 1,
         KIND_MEM = 2
     };
-    int          m_kind;
+    int const    m_kind;
     /** State
      */
     enum StateBits
@@ -144,7 +144,7 @@ struct FileHandle_Impl
 
     class Guard
     {
-        pthread_mutex_t *m_mutex;
+        pthread_mutex_t * const m_mutex;
 
     public:
         explicit Guard(pthread_mutex_t *pMutex);
diff --git a/sal/osl/unx/file_impl.hxx b/sal/osl/unx/file_impl.hxx
index f0718e236f6f..de7a450e478d 100644
--- a/sal/osl/unx/file_impl.hxx
+++ b/sal/osl/unx/file_impl.hxx
@@ -28,8 +28,8 @@ struct DirectoryItem_Impl
 {
     sal_Int32     m_RefCount;
 
-    rtl_uString * m_ustrFilePath;       /* holds native file name */
-    unsigned char m_DType;
+    rtl_uString * const m_ustrFilePath;       /* holds native file name */
+    unsigned char const m_DType;
 
     explicit DirectoryItem_Impl(
         rtl_uString * ustrFilePath, unsigned char DType = 0);
diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx
index 89969c1c40af..923b588a20c9 100644
--- a/sal/osl/unx/file_path_helper.cxx
+++ b/sal/osl/unx/file_path_helper.cxx
@@ -211,7 +211,7 @@ private:
     }
 
 private:
-    rtl::OUString       m_path_list;
+    rtl::OUString const m_path_list;
     const sal_Unicode*  m_end;
     const sal_Unicode   m_separator;
     const sal_Unicode*  m_path_segment_begin;
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 428bfec90e3f..8e6f30f839d1 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -724,7 +724,7 @@ namespace
 {
     class UnicodeToTextConverter_Impl
     {
-        rtl_UnicodeToTextConverter m_converter;
+        rtl_UnicodeToTextConverter const m_converter;
 
         UnicodeToTextConverter_Impl()
             : m_converter (rtl_createUnicodeToTextConverter (osl_getThreadTextEncoding()))
@@ -776,7 +776,7 @@ namespace
 {
     class TextToUnicodeConverter_Impl
     {
-        rtl_TextToUnicodeConverter m_converter;
+        rtl_TextToUnicodeConverter const m_converter;
 
         TextToUnicodeConverter_Impl()
             : m_converter (rtl_createTextToUnicodeConverter (osl_getThreadTextEncoding()))
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index 1c470b7fe3cd..feeca628762f 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -43,7 +43,7 @@ static oslPipe osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Op
 
 static struct
 {
-    int            errcode;
+    int const      errcode;
     oslPipeError   error;
 } PipeError[]= {
     { 0,               osl_Pipe_E_None              },  /* no error */
diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx
index c742634fc190..3ea564e14736 100644
--- a/sal/osl/unx/signal.cxx
+++ b/sal/osl/unx/signal.cxx
@@ -78,7 +78,7 @@ extern "C" using Handler1 = void (*)(int);
 extern "C" using Handler2 = void (*)(int, siginfo_t *, void *);
 struct SignalAction
 {
-    int Signal;
+    int const Signal;
     int Action;
     Handler1 Handler;
     bool siginfo; // Handler's type is Handler2
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index b73ce1966847..05a6234f64df 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -201,8 +201,8 @@ static const sal_uInt32 SocketDirection[]= {
 
 static const struct
 {
-    int            errcode;
-    oslSocketError error;
+    int const      errcode;
+    oslSocketError const error;
 } SocketError[]= {
     { 0,               osl_Socket_E_None              }, /* no error */
     { ENOTSOCK,        osl_Socket_E_NotSocket         }, /* Socket operation on non-socket */
diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx
index 1cac41ce717b..a47ab7d317c5 100644
--- a/sal/osl/unx/thread.cxx
+++ b/sal/osl/unx/thread.cxx
@@ -87,11 +87,11 @@ typedef struct osl_thread_impl_st
 
 struct osl_thread_priority_st
 {
-    int m_Highest;
-    int m_Above_Normal;
-    int m_Normal;
-    int m_Below_Normal;
-    int m_Lowest;
+    int const m_Highest;
+    int const m_Above_Normal;
+    int const m_Normal;
+    int const m_Below_Normal;
+    int const m_Lowest;
 };
 
 #define OSL_THREAD_PRIORITY_INITIALIZER { 127, 96, 64, 32, 0 }
@@ -109,7 +109,7 @@ static void osl_thread_textencoding_init_Impl();
 struct osl_thread_global_st
 {
     pthread_once_t                    m_once;
-    struct osl_thread_priority_st     m_priority;
+    struct osl_thread_priority_st const m_priority;
     struct osl_thread_textencoding_st m_textencoding;
 };
 
diff --git a/sal/qa/osl/condition/osl_Condition.cxx b/sal/qa/osl/condition/osl_Condition.cxx
index cac87532b8d8..e2c50fb309e6 100644
--- a/sal/qa/osl/condition/osl_Condition.cxx
+++ b/sal/qa/osl/condition/osl_Condition.cxx
@@ -39,7 +39,7 @@ public:
 
 protected:
     ::osl::Condition& m_MyCon;
-    ConditionType m_MyType;
+    ConditionType const m_MyType;
 
     void SAL_CALL run() override
     {
diff --git a/sal/qa/rtl/strings/test_oustring_convert.cxx b/sal/qa/rtl/strings/test_oustring_convert.cxx
index f1992d4295c9..b80c446936dd 100644
--- a/sal/qa/rtl/strings/test_oustring_convert.cxx
+++ b/sal/qa/rtl/strings/test_oustring_convert.cxx
@@ -45,10 +45,10 @@ namespace {
 
 struct TestConvertToString
 {
-    sal_Unicode aSource[100];
-    sal_Int32 nLength;
-    rtl_TextEncoding nEncoding;
-    sal_uInt32 nFlags;
+    sal_Unicode const aSource[100];
+    sal_Int32 const nLength;
+    rtl_TextEncoding const nEncoding;
+    sal_uInt32 const nFlags;
     char const * pStrict;
     char const * pRelaxed;
 };
diff --git a/sal/qa/rtl/strings/test_oustring_endswith.cxx b/sal/qa/rtl/strings/test_oustring_endswith.cxx
index d4e7bfcd0038..22c68abd1d2e 100644
--- a/sal/qa/rtl/strings/test_oustring_endswith.cxx
+++ b/sal/qa/rtl/strings/test_oustring_endswith.cxx
@@ -71,10 +71,10 @@ void test::oustring::EndsWith::endsWith()
 {
     struct Data {
         char const * str1;
-        sal_Int32 str1Len;
+        sal_Int32 const str1Len;
         char const * str2;
-        sal_Int32 str2Len;
-        bool endsWith;
+        sal_Int32 const str2Len;
+        bool const endsWith;
     };
     Data const data[] = {
         { RTL_CONSTASCII_STRINGPARAM(""), RTL_CONSTASCII_STRINGPARAM(""),
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index 108420dd0cc2..b63557375fe5 100644
--- a/sal/rtl/bootstrap.cxx
+++ b/sal/rtl/bootstrap.cxx
@@ -92,7 +92,7 @@ enum LookupMode {
 struct ExpandRequestLink {
     ExpandRequestLink const * next;
     Bootstrap_Impl const * file;
-    rtl::OUString key;
+    rtl::OUString const key;
 };
 
 rtl::OUString expandMacros(
@@ -314,7 +314,7 @@ struct Bootstrap_Impl
     Bootstrap_Impl * _base_ini;
 
     NameValueVector _nameValueVector;
-    OUString      _iniName;
+    OUString const _iniName;
 
     explicit Bootstrap_Impl (OUString const & rIniName);
     ~Bootstrap_Impl();
diff --git a/sal/textenc/convertbig5hkscs.hxx b/sal/textenc/convertbig5hkscs.hxx
index 089ac5845c95..1a2d1d689e47 100644
--- a/sal/textenc/convertbig5hkscs.hxx
+++ b/sal/textenc/convertbig5hkscs.hxx
@@ -34,7 +34,7 @@ struct ImplBig5HkscsConverterData
     sal_Int32 const * m_pUnicodeToBig5Hkscs2001PlaneOffsets;
     ImplUniToDBCSHighTab const * m_pUnicodeToBig5Data;
     ImplDBCSEUDCData const * m_pEudcData;
-    int m_nEudcCount;
+    int const m_nEudcCount;
 };
 
 void * ImplCreateBig5HkscsToUnicodeContext();
diff --git a/sal/textenc/convertgb18030.hxx b/sal/textenc/convertgb18030.hxx
index 680384794eb4..d3b3621dab24 100644
--- a/sal/textenc/convertgb18030.hxx
+++ b/sal/textenc/convertgb18030.hxx
@@ -26,18 +26,18 @@
 
 struct ImplGb180302000ToUnicodeRange
 {
-    sal_Int32 m_nNonRangeDataIndex;
-    sal_uInt32 m_nFirstLinear;
-    sal_uInt32 m_nPastLinear;
-    sal_Unicode m_nFirstUnicode;
+    sal_Int32 const m_nNonRangeDataIndex;
+    sal_uInt32 const m_nFirstLinear;
+    sal_uInt32 const m_nPastLinear;
+    sal_Unicode const m_nFirstUnicode;
 };
 
 struct ImplUnicodeToGb180302000Range
 {
-    sal_Int32 m_nNonRangeDataIndex;
-    sal_Unicode m_nFirstUnicode;
-    sal_Unicode m_nLastUnicode;
-    sal_uInt32 m_nFirstLinear;
+    sal_Int32 const m_nNonRangeDataIndex;
+    sal_Unicode const m_nFirstUnicode;
+    sal_Unicode const m_nLastUnicode;
+    sal_uInt32 const m_nFirstLinear;
 };
 
 struct ImplGb18030ConverterData
diff --git a/sal/textenc/convertsimple.cxx b/sal/textenc/convertsimple.cxx
index 635a881432fd..9eb6b928021c 100644
--- a/sal/textenc/convertsimple.cxx
+++ b/sal/textenc/convertsimple.cxx
@@ -22,8 +22,8 @@ namespace {
 
 struct ImplReplaceCharData
 {
-    sal_uInt16      mnUniChar;
-    sal_uInt16      mnReplaceChar;
+    sal_uInt16 const mnUniChar;
+    sal_uInt16 const mnReplaceChar;
 };
 
 static ImplReplaceCharData const aImplRepCharTab[] =
@@ -353,8 +353,8 @@ sal_uInt16 ImplGetReplaceChar( sal_Unicode c )
 
 struct ImplReplaceCharStrData
 {
-    sal_uInt16      mnUniChar;
-    sal_uInt16      maReplaceChars[IMPL_MAX_REPLACECHAR];
+    sal_uInt16 const mnUniChar;
+    sal_uInt16 const maReplaceChars[IMPL_MAX_REPLACECHAR];
 };
 
 static ImplReplaceCharStrData const aImplRepCharStrTab[] =
diff --git a/sal/textenc/convertsinglebytetobmpunicode.hxx b/sal/textenc/convertsinglebytetobmpunicode.hxx
index 2a22ce82026b..53749db49d46 100644
--- a/sal/textenc/convertsinglebytetobmpunicode.hxx
+++ b/sal/textenc/convertsinglebytetobmpunicode.hxx
@@ -40,7 +40,7 @@ struct BmpUnicodeToSingleByteRange {
     /**
        The start of the range of BMP Unicode code points.
      */
-    sal_Unicode unicode;
+    sal_Unicode const unicode;
 
     /**
        The extend of the range of BMP Unicode code points.
@@ -49,7 +49,7 @@ struct BmpUnicodeToSingleByteRange {
        inclusive.  It is an error if <code>unicode + range</code> is greater
        than <code>0xFFFF</code>.</p>
      */
-    sal_uInt8 range;
+    sal_uInt8 const range;
 
     /**
        The start of the corresponding range of individual bytes.
@@ -57,7 +57,7 @@ struct BmpUnicodeToSingleByteRange {
        <p>It is an error if <code>byte + range</code> is greater than
        <code>0xFF</code>.</p>
      */
-    sal_uInt8 byte;
+    sal_uInt8 const byte;
 };
 
 /**
@@ -77,12 +77,12 @@ struct BmpUnicodeToSingleByteConverterData {
        <p>Illegal units from the single-byte character set are mapped to
        <code>0xFFFF</code>.</p>
      */
-    sal_Unicode byteToUnicode[256];
+    sal_Unicode const byteToUnicode[256];
 
     /**
        The number of Unicode-to-byte conversion ranges.
      */
-    std::size_t unicodeToByteEntries;
+    std::size_t const unicodeToByteEntries;
 
     /**
        The array of Unicode-to-byte conversion ranges, sorted by increasing
diff --git a/sal/textenc/tenchelp.hxx b/sal/textenc/tenchelp.hxx
index 901156730da5..655641ab606c 100644
--- a/sal/textenc/tenchelp.hxx
+++ b/sal/textenc/tenchelp.hxx
@@ -73,14 +73,14 @@ typedef void (* ImplResetUnicodeContextProc)(void * pContext);
 struct ImplTextConverter
 {
     void const * mpConvertData;
-    ImplConvertToUnicodeProc mpConvertTextToUnicodeProc;
-    ImplConvertToTextProc mpConvertUnicodeToTextProc;
-    ImplCreateTextContextProc mpCreateTextToUnicodeContext;
-    ImplDestroyTextContextProc mpDestroyTextToUnicodeContext;
-    ImplResetTextContextProc mpResetTextToUnicodeContext;
-    ImplCreateUnicodeContextProc mpCreateUnicodeToTextContext;
-    ImplDestroyUnicodeContextProc mpDestroyUnicodeToTextContext;
-    ImplResetUnicodeContextProc mpResetUnicodeToTextContext;
+    ImplConvertToUnicodeProc const mpConvertTextToUnicodeProc;
+    ImplConvertToTextProc const mpConvertUnicodeToTextProc;
+    ImplCreateTextContextProc const mpCreateTextToUnicodeContext;
+    ImplDestroyTextContextProc const mpDestroyTextToUnicodeContext;
+    ImplResetTextContextProc const mpResetTextToUnicodeContext;
+    ImplCreateUnicodeContextProc const mpCreateUnicodeToTextContext;
+    ImplDestroyUnicodeContextProc const mpDestroyUnicodeToTextContext;
+    ImplResetUnicodeContextProc const mpResetUnicodeToTextContext;
 };
 
 /* ----------------------------- */
@@ -90,13 +90,13 @@ struct ImplTextConverter
 struct SAL_DLLPUBLIC_RTTI ImplTextEncodingData
 {
     ImplTextConverter maConverter;
-    sal_uInt8 mnMinCharSize;
-    sal_uInt8 mnMaxCharSize;
-    sal_uInt8 mnAveCharSize;
-    sal_uInt8 mnBestWindowsCharset;
+    sal_uInt8 const mnMinCharSize;
+    sal_uInt8 const mnMaxCharSize;
+    sal_uInt8 const mnAveCharSize;
+    sal_uInt8 const mnBestWindowsCharset;
     char const * mpBestUnixCharset;
     char const * mpBestMimeCharset;
-    sal_uInt32 mnInfoFlags;
+    sal_uInt32 const mnInfoFlags;
 };
 
 /* ----------------------------------- */
@@ -105,9 +105,9 @@ struct SAL_DLLPUBLIC_RTTI ImplTextEncodingData
 
 struct ImplUniCharTabData
 {
-    sal_uInt16                      mnUniChar;
-    unsigned char                       mnChar;
-    unsigned char                       mnChar2;
+    sal_uInt16 const                mnUniChar;
+    unsigned char const                 mnChar;
+    unsigned char const                 mnChar2;
         // to cater for mappings like MS1258 with 1--2 bytes per Unicode char,
         // 0 if unused
 };
@@ -116,18 +116,18 @@ struct ImplByteConvertData
 {
     const sal_uInt16*               mpToUniTab1;
     const sal_uInt16*               mpToUniTab2;
-    unsigned char                       mnToUniStart1;
-    unsigned char                       mnToUniEnd1;
-    unsigned char                       mnToUniStart2;
-    unsigned char                       mnToUniEnd2;
+    unsigned char const                 mnToUniStart1;
+    unsigned char const                 mnToUniEnd1;
+    unsigned char const                 mnToUniStart2;
+    unsigned char const                 mnToUniEnd2;
     const unsigned char*                mpToCharTab1;
     const unsigned char*                mpToCharTab2;
     const ImplUniCharTabData*       mpToCharExTab;
-    sal_uInt16                      mnToCharStart1;
-    sal_uInt16                      mnToCharEnd1;
-    sal_uInt16                      mnToCharStart2;
-    sal_uInt16                      mnToCharEnd2;
-    sal_uInt16                      mnToCharExCount;
+    sal_uInt16 const                mnToCharStart1;
+    sal_uInt16 const                mnToCharEnd1;
+    sal_uInt16 const                mnToCharStart2;
+    sal_uInt16 const                mnToCharEnd2;
+    sal_uInt16 const                mnToCharExCount;
 };
 
 /* ----------------------------------- */
@@ -136,32 +136,32 @@ struct ImplByteConvertData
 
 struct ImplDBCSEUDCData
 {
-    unsigned char                       mnLeadStart;
-    unsigned char                       mnLeadEnd;
-    unsigned char                       mnTrail1Start;
-    unsigned char                       mnTrail1End;
-    unsigned char                       mnTrail2Start;
-    unsigned char                       mnTrail2End;
-    unsigned char                       mnTrail3Start;
-    unsigned char                       mnTrail3End;
-    unsigned char                       mnTrailCount;
-    sal_uInt16                      mnTrailRangeCount;
-    sal_uInt16                      mnUniStart;
-    sal_uInt16                      mnUniEnd;
+    unsigned char const                 mnLeadStart;
+    unsigned char const                 mnLeadEnd;
+    unsigned char const                 mnTrail1Start;
+    unsigned char const                 mnTrail1End;
+    unsigned char const                 mnTrail2Start;
+    unsigned char const                 mnTrail2End;
+    unsigned char const                 mnTrail3Start;
+    unsigned char const                 mnTrail3End;
+    unsigned char const                 mnTrailCount;
+    sal_uInt16 const                mnTrailRangeCount;
+    sal_uInt16 const                mnUniStart;
+    sal_uInt16 const                mnUniEnd;
 };
 
 struct ImplDBCSToUniLeadTab
 {
-    sal_uInt16                      mnUniChar;
-    sal_uInt8                       mnTrailStart;
-    sal_uInt8                       mnTrailEnd;
+    sal_uInt16 const                mnUniChar;
+    sal_uInt8 const                 mnTrailStart;
+    sal_uInt8 const                 mnTrailEnd;
     const sal_uInt16*               mpToUniTrailTab;
 };
 
 struct ImplUniToDBCSHighTab
 {
-    sal_uInt8                       mnLowStart;
-    sal_uInt8                       mnLowEnd;
+    sal_uInt8 const                 mnLowStart;
+    sal_uInt8 const                 mnLowEnd;
     const sal_uInt16*               mpToUniTrailTab;
 };
 
@@ -169,12 +169,12 @@ struct ImplDBCSConvertData
 {
     const ImplDBCSToUniLeadTab*     mpToUniLeadTab;
     const ImplUniToDBCSHighTab*     mpToDBCSHighTab;
-    unsigned char                       mnLeadStart;
-    unsigned char                       mnLeadEnd;
-    unsigned char                       mnTrailStart;
-    unsigned char                       mnTrailEnd;
+    unsigned char const                 mnLeadStart;
+    unsigned char const                 mnLeadEnd;
+    unsigned char const                 mnTrailStart;
+    unsigned char const                 mnTrailEnd;
     const ImplDBCSEUDCData*         mpEUDCTab;
-    sal_uInt16                      mnEUDCCount;
+    sal_uInt16 const                mnEUDCCount;
 };
 
 /* ---------------------------------- */
diff --git a/sal/textenc/tencinfo.cxx b/sal/textenc/tencinfo.cxx
index 1e285652e080..91b98c056f68 100644
--- a/sal/textenc/tencinfo.cxx
+++ b/sal/textenc/tencinfo.cxx
@@ -105,7 +105,7 @@ static bool Impl_matchString( const char* pCompStr, const char* pMatchStr )
 struct ImplStrCharsetDef
 {
     const char*             mpCharsetStr;
-    rtl_TextEncoding            meTextEncoding;
+    rtl_TextEncoding const  meTextEncoding;
 };
 
 struct ImplStrFirstPartCharsetDef
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index b7e76d4eb207..57437b093442 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -140,11 +140,12 @@ struct Entity
 };
 
 
+static constexpr OUStringLiteral gsCDATA = "CDATA";
+
 class SaxExpatParser_Impl
 {
 public: // module scope
     Mutex               aMutex;
-    OUString            sCDATA;
     bool m_bEnableDoS; // fdo#60471 thank you Adobe Illustrator
 
     css::uno::Reference< XDocumentHandler >   rDocumentHandler;
@@ -179,8 +180,7 @@ public: // module scope
 
 public:
     SaxExpatParser_Impl()
-        : sCDATA("CDATA")
-        , m_bEnableDoS(false)
+        : m_bEnableDoS(false)
         , bExceptionWasThrown(false)
         , bRTExceptionWasThrown(false)
     {
@@ -389,7 +389,7 @@ class ParserCleanup
 {
 private:
     SaxExpatParser_Impl& m_rParser;
-    XML_Parser m_xmlParser;
+    XML_Parser const m_xmlParser;
 public:
     ParserCleanup(SaxExpatParser_Impl& rParser, XML_Parser xmlParser)
         : m_rParser(rParser)
@@ -711,7 +711,7 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis ,
             assert(awAttributes[i+1]);
             pImpl->rAttrList->AddAttribute(
                 XML_CHAR_TO_OUSTRING( awAttributes[i] ) ,
-                pImpl->sCDATA,  // expat doesn't know types
+                gsCDATA,  // expat doesn't know types
                 XML_CHAR_TO_OUSTRING( awAttributes[i+1] ) );
             i +=2;
         }
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 447acdc68274..3d53147d9382 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -92,8 +92,8 @@ struct Event
 
 struct NameWithToken
 {
-    OUString msName;
-    sal_Int32 mnToken;
+    OUString const msName;
+    sal_Int32 const mnToken;
 
     NameWithToken(const OUString& sName, sal_Int32 nToken) :
         msName(sName), mnToken(nToken) {}
@@ -102,7 +102,7 @@ struct NameWithToken
 struct SaxContext
 {
     Reference< XFastContextHandler > mxContext;
-    sal_Int32 mnElementToken;
+    sal_Int32 const mnElementToken;
     OUString  maNamespace;
     OUString  maElementName;
 
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index b232d0b3abf0..590c0167a29e 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -59,7 +59,6 @@ namespace sax_fastparser {
         , mbMarkStackEmpty(true)
         , mpDoubleStr(nullptr)
         , mnDoubleStrCapacity(RTL_STR_MAX_VALUEOFDOUBLE)
-        , mbXescape(true)
     {
         rtl_string_new_WithLength(&mpDoubleStr, mnDoubleStrCapacity);
         mxFastTokenHandler = css::xml::sax::FastTokenHandler::create(
@@ -197,7 +196,6 @@ namespace sax_fastparser {
                             }
                 break;
                 default:
-                            if (mbXescape)
                             {
                                 // Escape characters not valid in XML 1.0 as
                                 // _xHHHH_. A literal "_xHHHH_" has to be
@@ -242,18 +240,6 @@ namespace sax_fastparser {
                                  * scanning for both encoded sequences and
                                  * write as _xHHHH_? */
                             }
-#if OSL_DEBUG_LEVEL > 0
-                            else
-                            {
-                                if (bGood && invalidChar(pStr[i]))
-                                {
-                                    bGood = false;
-                                    // The SAL_WARN() for the single character is
-                                    // issued in writeBytes(), just gather for the
-                                    // SAL_WARN_IF() below.
-                                }
-                            }
-#endif
                             writeBytes( &c, 1 );
                 break;
             }
diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx
index c166f38f0b8c..f450580ff3e5 100644
--- a/sax/source/tools/fastserializer.hxx
+++ b/sax/source/tools/fastserializer.hxx
@@ -35,7 +35,7 @@ namespace sax_fastparser {
 
 struct TokenValue
 {
-    sal_Int32   nToken;
+    sal_Int32 const nToken;
     const char *pValue;
     TokenValue(sal_Int32 _nToken, const char *_pValue) : nToken(_nToken), pValue(_pValue) {}
 };
@@ -228,9 +228,6 @@ private:
     rtl_String *mpDoubleStr;
     sal_Int32 mnDoubleStrCapacity;
     TokenValueList maTokenValues;
-    bool mbXescape;     ///< whether to escape invalid XML characters as _xHHHH_ in write(const char*,sal_Int32,true)
-                        /* TODO: make that configurable from the outside for
-                         * some specific cases? */
 
 #ifdef DBG_UTIL
     std::stack<sal_Int32> m_DebugStartedElements;


More information about the Libreoffice-commits mailing list