[Libreoffice-commits] core.git: basctl/source basic/source chart2/qa chart2/source codemaker/source comphelper/source compilerplugins/clang cppuhelper/qa cui/source dbaccess/source desktop/qa editeng/source embeddedobj/source extensions/source forms/source framework/source io/source jvmfwk/plugins jvmfwk/source libreofficekit/source linguistic/source lotuswordpro/source mysqlc/source o3tl/qa oox/source opencl/source package/source sc/qa scripting/source sc/source sdext/source sd/source sfx2/source shell/source starmath/source svl/qa svl/source svtools/source svx/source sw/qa sw/source test/source tools/source ucb/qa unotools/source vcl/opengl vcl/qa vcl/source vcl/unx vcl/workben writerfilter/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Jul 31 06:26:09 UTC 2017


 basctl/source/basicide/doceventnotifier.cxx             |    4 -
 basctl/source/basicide/moduldl2.cxx                     |    6 -
 basic/source/uno/namecont.cxx                           |   21 ++----
 chart2/qa/extras/chart2export.cxx                       |    4 -
 chart2/qa/extras/chart2import.cxx                       |    2 
 chart2/source/view/main/GL3DRenderer.cxx                |   18 ++---
 chart2/source/view/main/OpenGLRender.cxx                |   52 ++++++++--------
 codemaker/source/cppumaker/cppuoptions.cxx              |    9 --
 comphelper/source/misc/storagehelper.cxx                |    2 
 compilerplugins/clang/oncevar.cxx                       |   23 +++----
 compilerplugins/clang/test/oncevar.cxx                  |    6 +
 cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx          |    4 -
 cui/source/dialogs/SpellDialog.cxx                      |    2 
 cui/source/dialogs/cuifmsearch.cxx                      |    2 
 cui/source/options/certpath.cxx                         |    4 -
 cui/source/options/optjava.cxx                          |    2 
 cui/source/options/webconninfo.cxx                      |    2 
 cui/source/tabpages/border.cxx                          |    2 
 dbaccess/source/core/dataaccess/documentdefinition.cxx  |    2 
 desktop/qa/desktop_lib/test_desktop_lib.cxx             |    8 +-
 editeng/source/editeng/eertfpar.cxx                     |    2 
 editeng/source/items/frmitems.cxx                       |    4 -
 embeddedobj/source/msole/ownview.cxx                    |    4 -
 extensions/source/bibliography/datman.cxx               |    3 
 extensions/source/propctrlr/eformshelper.cxx            |   16 ++--
 extensions/source/scanner/sane.cxx                      |    2 
 forms/source/misc/limitedformats.cxx                    |    3 
 framework/source/fwe/xml/xmlnamespaces.cxx              |   12 +--
 framework/source/services/substitutepathvars.cxx        |    3 
 io/source/acceptor/acc_socket.cxx                       |    8 --
 io/source/connector/ctr_socket.cxx                      |    8 --
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx            |    6 -
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx     |    3 
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx        |    4 -
 jvmfwk/source/fwkbase.cxx                               |    8 --
 libreofficekit/source/gtk/lokdocview.cxx                |    2 
 linguistic/source/lngsvcmgr.cxx                         |    6 -
 lotuswordpro/source/filter/lwplayout.cxx                |    4 -
 lotuswordpro/source/filter/lwpsilverbullet.cxx          |    6 -
 mysqlc/source/mysqlc_databasemetadata.cxx               |    4 -
 o3tl/qa/test-array_view.cxx                             |    6 -
 oox/source/drawingml/misccontexts.cxx                   |    2 
 oox/source/vml/vmldrawing.cxx                           |    2 
 opencl/source/opencl_device.cxx                         |    2 
 package/source/manifest/ManifestExport.cxx              |    3 
 sc/qa/unit/filters-test.cxx                             |    8 +-
 sc/qa/unit/subsequent_export-test.cxx                   |    4 -
 sc/qa/unit/ucalc_formula.cxx                            |    2 
 sc/qa/unit/ucalc_pivottable.cxx                         |    2 
 sc/qa/unit/ucalc_sort.cxx                               |    2 
 sc/source/core/data/conditio.cxx                        |    2 
 sc/source/core/opencl/formulagroupcl.cxx                |    8 +-
 sc/source/core/tool/typedstrdata.cxx                    |    9 --
 sc/source/filter/xml/xmlfonte.cxx                       |   12 +--
 sc/source/ui/miscdlgs/conflictsdlg.cxx                  |    2 
 sc/source/ui/miscdlgs/sharedocdlg.cxx                   |    2 
 sc/source/ui/unoobj/cellsuno.cxx                        |    3 
 sc/source/ui/vba/vbaworkbooks.cxx                       |    2 
 sc/source/ui/view/gridwin.cxx                           |    3 
 scripting/source/protocolhandler/scripthandler.cxx      |    5 -
 scripting/source/provider/ActiveMSPList.cxx             |    3 
 scripting/source/provider/ProviderCache.cxx             |   10 +--
 scripting/source/stringresource/stringresource.cxx      |   27 ++------
 sd/source/core/sdpage.cxx                               |    3 
 sd/source/core/stlsheet.cxx                             |   18 +++--
 sd/source/filter/ppt/pptin.cxx                          |    9 +-
 sd/source/ui/sidebar/MasterPageContainer.cxx            |    3 
 sd/source/ui/unoidl/unomodel.cxx                        |    4 -
 sd/source/ui/view/drviews2.cxx                          |    2 
 sdext/source/minimizer/optimizerdialog.cxx              |    2 
 sdext/source/presenter/PresenterSlideShowView.cxx       |    2 
 sfx2/source/appl/newhelp.cxx                            |    2 
 sfx2/source/doc/SfxDocumentMetaData.cxx                 |    2 
 shell/source/tools/lngconvex/lngconvex.cxx              |    2 
 starmath/source/mathmlexport.cxx                        |    6 -
 svl/qa/unit/items/test_itempool.cxx                     |    2 
 svl/source/numbers/zforlist.cxx                         |    2 
 svtools/source/dialogs/addresstemplate.cxx              |    2 
 svx/source/accessibility/svxrectctaccessiblecontext.cxx |    4 -
 svx/source/dialog/srchdlg.cxx                           |    5 -
 svx/source/gallery2/galobj.cxx                          |    2 
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx               |    6 -
 sw/qa/extras/rtfexport/rtfexport.cxx                    |   10 +--
 sw/qa/extras/ww8import/ww8import.cxx                    |    4 -
 sw/source/core/doc/DocumentFieldsManager.cxx            |    2 
 sw/source/core/doc/docfmt.cxx                           |    2 
 sw/source/core/docnode/ndtbl.cxx                        |    2 
 sw/source/core/layout/paintfrm.cxx                      |    8 +-
 sw/source/filter/html/htmldrawreader.cxx                |    8 +-
 sw/source/filter/ww8/wrtww8.cxx                         |    6 -
 sw/source/filter/ww8/ww8atr.cxx                         |    2 
 sw/source/filter/ww8/ww8par.cxx                         |    4 -
 sw/source/filter/xml/xmlfonte.cxx                       |    4 -
 sw/source/ui/dbui/selectdbtabledialog.cxx               |    2 
 sw/source/ui/frmdlg/frmpage.cxx                         |    4 -
 sw/source/ui/misc/srtdlg.cxx                            |    2 
 sw/source/uibase/app/docsh2.cxx                         |    6 +
 sw/source/uibase/lingu/hhcwrp.cxx                       |    4 -
 sw/source/uibase/ribbar/workctrl.cxx                    |    2 
 sw/source/uibase/shells/drwtxtsh.cxx                    |    3 
 test/source/sheet/xcellrangesquery.cxx                  |    2 
 tools/source/generic/config.cxx                         |    4 -
 ucb/qa/cppunit/webdav/webdav_local_neon.cxx             |    3 
 unotools/source/config/lingucfg.cxx                     |    8 --
 unotools/source/i18n/localedatawrapper.cxx              |   27 ++------
 unotools/source/misc/fontdefs.cxx                       |    2 
 vcl/opengl/gdiimpl.cxx                                  |    4 -
 vcl/opengl/x11/gdiimpl.cxx                              |    2 
 vcl/qa/cppunit/svm/svmtest.cxx                          |    2 
 vcl/source/filter/ixpm/xpmread.cxx                      |    2 
 vcl/source/font/fontcache.cxx                           |    3 
 vcl/source/fontsubset/sft.cxx                           |    2 
 vcl/source/gdi/CommonSalLayout.cxx                      |    4 -
 vcl/source/window/debugevent.cxx                        |    2 
 vcl/unx/generic/dtrans/X11_selection.cxx                |    5 -
 vcl/workben/vcldemo.cxx                                 |   14 ++--
 writerfilter/source/dmapper/DomainMapper.cxx            |    4 -
 writerfilter/source/dmapper/GraphicImport.cxx           |    4 -
 writerfilter/source/dmapper/NumberingManager.cxx        |    7 --
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx         |   12 +--
 writerfilter/source/rtftok/rtfdispatchsymbol.cxx        |    4 -
 writerfilter/source/rtftok/rtfdocumentimpl.cxx          |    2 
 122 files changed, 305 insertions(+), 371 deletions(-)

New commits:
commit c9253818ec8252169c20450b41878be459568d95
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Sun Jul 30 12:16:31 2017 +0200

    loplugin:oncevar
    
    extend oncevar to any POD type
    
    Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0
    Reviewed-on: https://gerrit.libreoffice.org/40564
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx
index 90e55e00ee18..66b44fcba789 100644
--- a/basctl/source/basicide/doceventnotifier.cxx
+++ b/basctl/source/basicide/doceventnotifier.cxx
@@ -133,7 +133,7 @@ namespace basctl
             const sal_Char* pEventName;
             void (DocumentEventListener::*listenerMethod)( const ScriptDocument& _rDocument );
         };
-        EventEntry aEvents[] = {
+        EventEntry const aEvents[] = {
             { "OnNew",          &DocumentEventListener::onDocumentCreated },
             { "OnLoad",         &DocumentEventListener::onDocumentOpened },
             { "OnSave",         &DocumentEventListener::onDocumentSave },
@@ -145,7 +145,7 @@ namespace basctl
             { "OnModeChanged",  &DocumentEventListener::onDocumentModeChanged }
         };
 
-        for (EventEntry & aEvent : aEvents)
+        for (EventEntry const & aEvent : aEvents)
         {
             if ( !_rEvent.EventName.equalsAscii( aEvent.pEventName ) )
                 continue;
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 778c38e5e96c..fd78b185e7eb 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -149,8 +149,8 @@ CheckBox::CheckBox(vcl::Window* pParent, WinBits nStyle)
     , eMode(ObjectMode::Module)
     , m_aDocument(ScriptDocument::getApplicationScriptDocument())
 {
-    long aTabs_[] = { 1, 12 };  // TabPos needs at least one...
-                                // 12 because of the CheckBox
+    long const aTabs_[] = { 1, 12 };  // TabPos needs at least one...
+                                      // 12 because of the CheckBox
     SetTabs( aTabs_ );
     Init();
 }
@@ -499,7 +499,7 @@ LibPage::LibPage(vcl::Window * pParent)
     m_pLibBox->EnableInplaceEditing(true);
     m_pLibBox->SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
 
-    long aTabs[] = { 2, 30, 120 };
+    long const aTabs[] = { 2, 30, 120 };
     m_pLibBox->SetTabs( aTabs, MapUnit::MapPixel );
 
     FillListBox();
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 5c8f0c29dda2..64de45125e2b 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1098,11 +1098,6 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
                 mxSFI->move( aFolderUserBasic, aPrevFolder );
                 mxSFI->move( aFolderTmp, aFolderUserBasic );
 
-                OUString aUserSearchStr("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE");
-                OUString aSharedSearchStr("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE");
-                OUString const aBundledSearchStr("vnd.sun.star.expand:$BUNDLED_EXTENSIONS");
-                OUString const aInstSearchStr("$(INST)");
-
                 Sequence< OUString > aNames = pPrevCont->getElementNames();
                 const OUString* pNames = aNames.getConstArray();
                 sal_Int32 nNameCount = aNames.getLength();
@@ -1129,10 +1124,10 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
                     {
                         OUString aStorageURL = pImplLib->maUnexpandedStorageURL;
                         bool bCreateLink = true;
-                        if( aStorageURL.indexOf( aUserSearchStr   ) != -1 ||
-                            aStorageURL.indexOf( aSharedSearchStr ) != -1 ||
-                            aStorageURL.indexOf( aBundledSearchStr ) != -1 ||
-                            aStorageURL.indexOf( aInstSearchStr   ) != -1 )
+                        if( aStorageURL.indexOf( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"   ) != -1 ||
+                            aStorageURL.indexOf( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" ) != -1 ||
+                            aStorageURL.indexOf( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" ) != -1 ||
+                            aStorageURL.indexOf( "$(INST)"   ) != -1 )
                         {
                             bCreateLink = false;
                         }
@@ -2207,14 +2202,12 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink
     maNameContainer->insertByName( Name, aElement );
     maModifiable.setModified( true );
 
-    OUString aUserSearchStr("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE");
-    OUString aSharedSearchStr("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE");
-    OUString const aBundledSearchStr("vnd.sun.star.expand:$BUNDLED_EXTENSIONS");
-    if( StorageURL.indexOf( aUserSearchStr ) != -1 )
+    if( StorageURL.indexOf( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" ) != -1 )
     {
         pNewLib->mbExtension = true;
     }
-    else if( StorageURL.indexOf( aSharedSearchStr ) != -1 || StorageURL.indexOf( aBundledSearchStr ) != -1 )
+    else if( StorageURL.indexOf( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" ) != -1
+           || StorageURL.indexOf( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" ) != -1 )
     {
         pNewLib->mbExtension = true;
         pNewLib->mbReadOnly = true;
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 11f37235835b..d9050f858c2c 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -596,7 +596,7 @@ void Chart2ExportTest::testEmbeddingsGrabBag()
    xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
    CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
    bool bEmbeddings = false;
-   const char* testEmbeddedFileNames[3] = {"word/embeddings/Microsoft_Excel_Worksheet3.xlsx",
+   const char* const testEmbeddedFileNames[] {"word/embeddings/Microsoft_Excel_Worksheet3.xlsx",
                                         "word/embeddings/Microsoft_Excel_Worksheet2.xlsx",
                                         "word/embeddings/Microsoft_Excel_Worksheet1.xlsx"};
    for(int i = 0; i < aGrabBag.getLength(); ++i)
@@ -1121,7 +1121,7 @@ void Chart2ExportTest::testEmbeddingsOleObjectGrabBag()
    xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
    CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
    bool bEmbeddings = false;
-   const char* testEmbeddedFileNames[1] = {"word/embeddings/oleObject1.bin"};
+   const char* const testEmbeddedFileNames[] = {"word/embeddings/oleObject1.bin"};
    for(int i = 0; i < aGrabBag.getLength(); ++i)
    {
        if (aGrabBag[i].Name == "OOXEmbeddings")
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 2399cf7f5034..e81a6e4d347d 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -268,7 +268,7 @@ void Chart2ImportTest::testErrorBarFormatting()
 void Chart2ImportTest::testSteppedLines()
 {
     const sal_Int32 MAXSHEET = 14;
-    chart2::CurveStyle curveStyle[] = {
+    chart2::CurveStyle const curveStyle[] = {
         chart2::CurveStyle_LINES,
         chart2::CurveStyle_CUBIC_SPLINES,
         chart2::CurveStyle_B_SPLINES,
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 3ff7939aba2f..5ab1f6b73d44 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -840,9 +840,9 @@ void OpenGL3DRenderer::RenderLine3D(const Polygon3DInfo& polygon)
 {
     CHECK_GL_ERROR();
     glUseProgram(maResources.m_CommonProID);
-    PosVecf3 trans = {0.0f, 0, 0.0};
-    PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-    PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+    PosVecf3 const trans = {0.0f, 0, 0.0};
+    PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+    PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
     MoveModelf(trans, angle, scale);
     m_Model = m_GlobalScaleMatrix * m_Model;
     m_3DMVP = m_3DProjection * m_3DView * m_Model;
@@ -959,9 +959,9 @@ void OpenGL3DRenderer::RenderPolygon3D(const Polygon3DInfo& polygon)
         //move the circle to the pos, and scale using the xScale and Y scale
         Vertices3D *pointList = polygon.verticesList[i];
         Normals3D *normalList = polygon.normalsList[i];
-        PosVecf3 trans = {0.0f, 0.0f, 0.0};
-        PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-        PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+        PosVecf3 const trans = {0.0f, 0.0f, 0.0};
+        PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+        PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
         MoveModelf(trans, angle, scale);
         m_Model = m_GlobalScaleMatrix * m_Model;
         glm::mat3 normalMatrix(m_Model);
@@ -2059,9 +2059,9 @@ void OpenGL3DRenderer::RenderTextShape()
     CHECK_GL_ERROR();
     for (TextInfo & textInfo : m_TextInfoList)
     {
-        PosVecf3 trans = {0, 0, 0};
-        PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-        PosVecf3 scale = {1.0, 1.0, 1.0f};
+        PosVecf3 const trans = {0, 0, 0};
+        PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+        PosVecf3 const scale = {1.0, 1.0, 1.0f};
         MoveModelf(trans, angle, scale);
         m_Model = m_GlobalScaleMatrix * m_Model;
         glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index c3a2c489efb5..42e716496f1c 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -159,8 +159,8 @@ int OpenGLRender::InitOpenGL()
     glBindBuffer(GL_ARRAY_BUFFER, 0);
 
     glEnable(GL_LIGHTING);
-    GLfloat light_direction[] = { 0.0 , 0.0 , 1.0 };
-    GLfloat materialDiffuse[] = { 1.0 , 1.0 , 1.0 , 1.0};
+    GLfloat const light_direction[] = { 0.0 , 0.0 , 1.0 };
+    GLfloat const materialDiffuse[] = { 1.0 , 1.0 , 1.0 , 1.0};
     glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, light_direction);
     glMaterialfv(GL_FRONT,GL_DIFFUSE,materialDiffuse);
     glEnable(GL_LIGHT0);
@@ -192,9 +192,9 @@ int OpenGLRender::RenderLine2FBO()
     CHECK_GL_ERROR();
     glLineWidth(m_fLineWidth);
     size_t listNum = m_Line2DShapePointList.size();
-    PosVecf3 trans = {0.0f, 0.0f, 0.0f};
-    PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-    PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+    PosVecf3 const trans = {0.0f, 0.0f, 0.0f};
+    PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+    PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
     MoveModelf(trans, angle, scale);
     m_MVP = m_Projection * m_View * m_Model;
     for (size_t i = 0; i < listNum; i++)
@@ -421,9 +421,9 @@ int OpenGLRender::RenderBubble2FBO()
     {
         //move the circle to the pos, and scale using the xScale and Y scale
         Bubble2DPointList &pointList = m_Bubble2DShapePointList.front();
-        PosVecf3 trans = {pointList.x, pointList.y, m_fZStep};
-        PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-        PosVecf3 scale = {pointList.xScale / 2, pointList.yScale / 2 , 1.0f};
+        PosVecf3 const trans = {pointList.x, pointList.y, m_fZStep};
+        PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+        PosVecf3 const scale = {pointList.xScale / 2, pointList.yScale / 2 , 1.0f};
         MoveModelf(trans, angle, scale);
         m_MVP = m_Projection * m_View * m_Model;
         //render to fbo
@@ -520,9 +520,9 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
         //move the circle to the pos, and scale using the xScale and Y scale
         RectanglePointList &pointList = m_RectangleShapePointList.front();
         {
-            PosVecf3 trans = {0, 0, 0};
-            PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-            PosVecf3 scale = {1, 1, 1.0f};
+            PosVecf3 const trans = {0, 0, 0};
+            PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+            PosVecf3 const scale = {1, 1, 1.0f};
             MoveModelf(trans, angle, scale);
             m_MVP = m_Projection * m_View * m_Model;
         }
@@ -570,9 +570,9 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
         {
             if(bFill)
             {
-                PosVecf3 trans = {0.0, 0.0, Z_STEP };
-                PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-                PosVecf3 scale = {1, 1, 1.0f};
+                PosVecf3 const trans = {0.0, 0.0, Z_STEP };
+                PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+                PosVecf3 const scale = {1, 1, 1.0f};
                 MoveModelf(trans, angle, scale);
                 m_MVP = m_Projection * m_View * m_Model;
 
@@ -704,9 +704,9 @@ int OpenGLRender::RenderTextShape()
     for (size_t i = 0; i < listNum; i++)
     {
         TextInfo &textInfo = m_TextInfoList.front();
-        PosVecf3 trans = { textInfo.nDx, textInfo.nDy, 0};
-        PosVecf3 angle = {0.0f, 0.0f, float(textInfo.rotation)};
-        PosVecf3 scale = {1.0, 1.0, 1.0f};
+        PosVecf3 const trans = { textInfo.nDx, textInfo.nDy, 0};
+        PosVecf3 const angle = {0.0f, 0.0f, float(textInfo.rotation)};
+        PosVecf3 const scale = {1.0, 1.0, 1.0f};
         MoveModelf(trans, angle, scale);
         m_MVP = m_Projection * m_View * m_Model;
         glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
@@ -813,9 +813,9 @@ int OpenGLRender::RenderArea2DShape()
 
     glDisable(GL_MULTISAMPLE);
     size_t listNum = m_Area2DShapePointList.size();
-    PosVecf3 trans = {0.0f, 0.0f, 0.0f};
-    PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-    PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+    PosVecf3 const trans = {0.0f, 0.0f, 0.0f};
+    PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+    PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
     MoveModelf(trans, angle, scale);
     m_MVP = m_Projection * m_View * m_Model;
     for (size_t i = 0; i < listNum; ++i)
@@ -945,9 +945,9 @@ void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadiu
 int OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY)
 {
     int listNum = m_PieSegment2DShapePointList.size();
-    PosVecf3 trans = {fPosX, fPosY, 0.0f};
-    PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-    PosVecf3 scale = {fSize, fSize, 1.0f};
+    PosVecf3 const trans = {fPosX, fPosY, 0.0f};
+    PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+    PosVecf3 const scale = {fSize, fSize, 1.0f};
     MoveModelf(trans, angle, scale);
     m_MVP = m_Projection * m_View * m_Model;
 
@@ -994,9 +994,9 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, sal_Int32 nSymbol)
 
     glPointSize(20.f);
     CHECK_GL_ERROR();
-    PosVecf3 trans = {0.0, 0.0, 0.0};
-    PosVecf3 angle = {0.0f, 0.0f, 0.0f};
-    PosVecf3 scale = {1.0, 1.0, 1.0f};
+    PosVecf3 const trans = {0.0, 0.0, 0.0};
+    PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+    PosVecf3 const scale = {1.0, 1.0, 1.0f};
     MoveModelf(trans, angle, scale);
     m_MVP = m_Projection * m_View * m_Model;
 
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx
index ea15907cc1e5..d6f31e89aeee 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -149,8 +149,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile)
 
                     if (isValid("-C") || isValid("-CS"))
                     {
-                        OString tmp("'-L' could not be combined with '-C' or '-CS' option");
-                        throw IllegalArgument(tmp);
+                        throw IllegalArgument("'-L' could not be combined with '-C' or '-CS' option");
                     }
                     m_options["-L"] = OString();
                     break;
@@ -170,8 +169,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile)
 
                         if (isValid("-L") || isValid("-C"))
                         {
-                            OString tmp("'-CS' could not be combined with '-L' or '-C' option");
-                            throw IllegalArgument(tmp);
+                            throw IllegalArgument("'-CS' could not be combined with '-L' or '-C' option");
                         }
                         m_options["-CS"] = OString();
                         break;
@@ -189,8 +187,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile)
 
                     if (isValid("-L") || isValid("-CS"))
                     {
-                        OString tmp("'-C' could not be combined with '-L' or '-CS' option");
-                        throw IllegalArgument(tmp);
+                        throw IllegalArgument("'-C' could not be combined with '-L' or '-CS' option");
                     }
                     m_options["-C"] = OString();
                     break;
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index c4cc8178e298..ed55fe219e52 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -378,7 +378,7 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData(
         aEncryptionData[nSha1Ind].Name = PACKAGE_ENCRYPTIONDATA_SHA1UTF8;
         aEncryptionData[nSha1Ind + 1].Name = PACKAGE_ENCRYPTIONDATA_SHA1MS1252;
 
-        rtl_TextEncoding pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
+        rtl_TextEncoding const pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
 
         for ( sal_Int32 nInd = 0; nInd < 2; nInd++ )
         {
diff --git a/compilerplugins/clang/oncevar.cxx b/compilerplugins/clang/oncevar.cxx
index 00ecb1b6003a..052a448b0325 100644
--- a/compilerplugins/clang/oncevar.cxx
+++ b/compilerplugins/clang/oncevar.cxx
@@ -114,6 +114,9 @@ public:
         // macros managing to generate to a valid warning
         if (fn == SRCDIR "/solenv/bin/concat-deps.c")
              return;
+        // TODO bug in the plugin
+        if (fn == SRCDIR "/vcl/unx/generic/app/saldisp.cxx")
+            return;
 
         TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
 
@@ -220,6 +223,9 @@ public:
                     if (loplugin::TypeCheck(qt).LvalueReference().NonConst()) {
                         recordIgnore(expr->getArg(i));
                     }
+                    if (loplugin::TypeCheck(qt).Pointer().NonConst()) {
+                        recordIgnore(expr->getArg(i));
+                    }
                 }
             }
         }
@@ -235,6 +241,9 @@ public:
                 if (loplugin::TypeCheck(qt).LvalueReference().NonConst()) {
                     recordIgnore(expr->getArg(i));
                 }
+                if (loplugin::TypeCheck(qt).Pointer().NonConst()) {
+                    recordIgnore(expr->getArg(i));
+                }
             }
         }
         return true;
@@ -321,9 +330,7 @@ bool OnceVar::VisitVarDecl( const VarDecl* varDecl )
         return true;
     }
     auto const tc = loplugin::TypeCheck(varDecl->getType());
-    if (!varDecl->getType()->isScalarType()
-        && !varDecl->getType()->isBooleanType()
-        && !varDecl->getType()->isEnumeralType()
+    if (!varDecl->getType().isCXX11PODType(compiler.getASTContext())
         && !tc.Class("OString").Namespace("rtl").GlobalNamespace()
         && !tc.Class("OUString").Namespace("rtl").GlobalNamespace()
         && !tc.Class("OStringBuffer").Namespace("rtl").GlobalNamespace()
@@ -346,22 +353,14 @@ bool OnceVar::VisitVarDecl( const VarDecl* varDecl )
     if (auto e = dyn_cast<ExprWithCleanups>(initExpr)) {
         initExpr = e->getSubExpr();
     }
-    if (auto stringLit = dyn_cast<clang::StringLiteral>(initExpr)) {
+    if (isa<clang::StringLiteral>(initExpr)) {
         foundStringLiteral = true;
-        // ignore long literals, helps to make the code more legible
-        if (stringLit->getLength() > 40) {
-            return true;
-        }
     } else if (auto constructExpr = dyn_cast<CXXConstructExpr>(initExpr)) {
         if (constructExpr->getNumArgs() == 0) {
             foundStringLiteral = true; // i.e., empty string
         } else {
             auto stringLit2 = dyn_cast<clang::StringLiteral>(constructExpr->getArg(0));
             foundStringLiteral = stringLit2 != nullptr;
-            // ignore long literals, helps to make the code more legible
-            if (stringLit2 && stringLit2->getLength() > 40) {
-                return true;
-            }
         }
     }
     if (!foundStringLiteral) {
diff --git a/compilerplugins/clang/test/oncevar.cxx b/compilerplugins/clang/test/oncevar.cxx
index 5e01d1b98a21..c8cc7bc1390d 100644
--- a/compilerplugins/clang/test/oncevar.cxx
+++ b/compilerplugins/clang/test/oncevar.cxx
@@ -24,6 +24,9 @@ template<typename T> void f() {
 }
 template void f<int>(); // needed for clang-cl
 
+class Foo;
+void method1(const Foo**);
+
 int main() {
 /* TODO
     int i;
@@ -55,6 +58,9 @@ int main() {
     call_ref(s3);
     OUString const s4("xxx");
     call_value(s4);
+
+    const Foo* pInternalArgs[] = { nullptr };
+    method1(pInternalArgs);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
index a535d3c7283c..9110cc680476 100644
--- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
+++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
@@ -218,7 +218,7 @@ namespace cppu_ifcontainer
 
         void testOMultiTypeInterfaceContainerHelperInt32()
         {
-            sal_Int32 pTypes[nTests] =
+            sal_Int32 const pTypes[nTests] =
             {
                 0,
                 -1,
@@ -239,7 +239,7 @@ namespace cppu_ifcontainer
             typedef cppu::OMultiTypeInterfaceContainerHelperVar<
                 char const *, void, rtl::CStringEqual> StrContainer;
 
-            const char *pTypes[nTests] =
+            const char * const pTypes[nTests] =
             {
                 "this_is", "such", "fun", "writing", "unit", "tests", "when", "it", "works", "anyway"
             };
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 3803c68731bd..d9fb7043e246 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -488,7 +488,7 @@ IMPL_LINK( SpellDialog, CheckGrammarHdl, Button*, pBox, void )
 
 void SpellDialog::StartSpellOptDlg_Impl()
 {
-    sal_uInt16 aSpellInfos[] =
+    sal_uInt16 const aSpellInfos[] =
     {
         SID_ATTR_SPELL,SID_ATTR_SPELL,
         SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index f8e6e46026e1..961e02dc93e1 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -238,7 +238,7 @@ void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sIni
 
     // fill the listboxes
     // method of field comparison
-    const char* aResIds[] = {
+    const char* const aResIds[] = {
         RID_STR_SEARCH_ANYWHERE,
         RID_STR_SEARCH_BEGINNING,
         RID_STR_SEARCH_END,
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 202866e284f9..d41a7e77b8aa 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -57,11 +57,11 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
 
     try
     {
-        mozilla::MozillaProductType productTypes[3] = {
+        mozilla::MozillaProductType const productTypes[3] = {
             mozilla::MozillaProductType_Thunderbird,
             mozilla::MozillaProductType_Firefox,
             mozilla::MozillaProductType_Mozilla };
-        const char* productNames[3] = {
+        const char* const productNames[3] = {
             "thunderbird",
             "firefox",
             "mozilla" };
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 1fc450aa1217..f8345e7b93fb 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -136,7 +136,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
     pJavaListContainer->set_height_request(aControlSize.Height());
     m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText);
 
-    long aStaticTabs[]= { 4, 0, 0, 0, 0 };
+    long const aStaticTabs[]= { 4, 0, 0, 0, 0 };
 
     m_pJavaList->SvSimpleTable::SetTabs( aStaticTabs );
 
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index f6b3aa614f80..afa01a2c7a52 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -112,7 +112,7 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(vcl::Window* pParent)
     SvSimpleTableContainer *pPasswordsLBContainer = get<SvSimpleTableContainer>("logins");
     m_pPasswordsLB = VclPtr<PasswordTable>::Create(*pPasswordsLBContainer, 0);
 
-    long aStaticTabs[]= { 2, 0, 0 };
+    long const aStaticTabs[]= { 2, 0, 0 };
     m_pPasswordsLB->SetTabs( aStaticTabs );
     m_pPasswordsLB->InsertHeaderItem( 1, get<FixedText>("website")->GetText(),
         HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW );
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 5dde954380bb..4a49061026c9 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1235,7 +1235,7 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset )
         { svx::FrameBorderType::Left,SvxBoxInfoItemValidFlags::LEFT },
         { svx::FrameBorderType::Right,SvxBoxInfoItemValidFlags::RIGHT },
     };
-    SvxBoxItemLine eTypes2[] = {
+    SvxBoxItemLine const eTypes2[] = {
         SvxBoxItemLine::TOP,
         SvxBoxItemLine::BOTTOM,
         SvxBoxItemLine::LEFT,
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 4c7fd57ab7d3..ed8f2b0aa045 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1445,7 +1445,7 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
 {
     ::comphelper::NamedValueCollection aOpenCommandArguments( i_rOpenCommandArguments );
 
-    const char* pObjectDescriptorArgs[] =
+    const char* const pObjectDescriptorArgs[] =
     {
         "RecoveryStorage"
     };
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 58aea8beb431..a269f9c639e4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -782,7 +782,7 @@ void DesktopLOKTest::testWriterComments()
 
     // Insert a comment at the beginning of the document and wait till the main
     // loop grabs the focus, so characters end up in the annotation window.
-    TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+    TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
     m_aCommandResultCondition.reset();
     pDocument->pClass->postUnoCommand(pDocument, ".uno:InsertAnnotation", nullptr, true);
     Scheduler::ProcessEventsToIdle();
@@ -1064,7 +1064,7 @@ void DesktopLOKTest::testContextMenuCalc()
                                       1, 4, 0);
     Scheduler::ProcessEventsToIdle();
 
-    TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+    TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
     m_aContextMenuCondition.wait(aTimeValue);
 
     CPPUNIT_ASSERT( !m_aContextMenuResult.empty() );
@@ -1174,7 +1174,7 @@ void DesktopLOKTest::testContextMenuWriter()
                                       1, 4, 0);
     Scheduler::ProcessEventsToIdle();
 
-    TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+    TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
     m_aContextMenuCondition.wait(aTimeValue);
 
     CPPUNIT_ASSERT( !m_aContextMenuResult.empty() );
@@ -1230,7 +1230,7 @@ void DesktopLOKTest::testContextMenuImpress()
                                       1, 4, 0);
     Scheduler::ProcessEventsToIdle();
 
-    TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+    TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
     m_aContextMenuCondition.wait(aTimeValue);
 
     CPPUNIT_ASSERT( !m_aContextMenuResult.empty() );
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 96dac9e61b63..97b0ce9a38f8 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -318,7 +318,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
     const MapUnit eSrcUnit  = aRTFMapMode.GetMapUnit();
     if (eDestUnit != eSrcUnit)
     {
-        sal_uInt16 aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL };
+        sal_uInt16 const aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL };
         for (unsigned short aFntHeightIem : aFntHeightIems)
         {
             if (SfxItemState::SET == rSet.GetAttrSet().GetItemState( aFntHeightIem, false, &pItem ))
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 35e5937caca9..ec920d1cdde6 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1877,7 +1877,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 }
 
                 // WTH are the borders and the distances saved in different order?
-                SvxBoxItemLine nLines[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT };
+                SvxBoxItemLine const nLines[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT };
                 for ( sal_Int32 n = 4; n < 9; n++ )
                 {
                     sal_Int32 nDist = 0;
@@ -4028,7 +4028,7 @@ sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const
 
 const char* getFrmDirResId(size_t nIndex)
 {
-    const char* RID_SVXITEMS_FRMDIR[] =
+    const char* const RID_SVXITEMS_FRMDIR[] =
     {
         RID_SVXITEMS_FRMDIR_HORI_LEFT_TOP,
         RID_SVXITEMS_FRMDIR_HORI_RIGHT_TOP,
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index 0ba477264e20..2add5c4f3201 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -412,9 +412,9 @@ void OwnView_Impl::CreateNative()
 
         if ( xNameAccess->hasByName( aSubStreamName ) )
         {
-            sal_uInt8 aClassID[] =
+            sal_uInt8 const aClassID[] =
                 { 0x00, 0x03, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 };
-            uno::Sequence< sal_Int8 > aPackageClassID( reinterpret_cast<sal_Int8*>(aClassID), 16 );
+            uno::Sequence< sal_Int8 > aPackageClassID( reinterpret_cast<sal_Int8 const *>(aClassID), 16 );
 
             uno::Reference< io::XStream > xSubStream;
             xNameAccess->getByName( aSubStreamName ) >>= xSubStream;
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 9ae2804a36b3..54a00a7462a2 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -1206,8 +1206,7 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const OUString&
         xPropSet->setPropertyValue( "Name", makeAny( rName ) );
 
         // set the name of the to-be-created control
-        OUString aControlName("com.sun.star.form.control.InteractionGridControl");
-        Any aAny; aAny <<= aControlName;
+        Any aAny(OUString("com.sun.star.form.control.InteractionGridControl"));
         xPropSet->setPropertyValue( "DefaultControl",aAny );
 
         // the helpURL
diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx
index 0704887e0d1c..54720f479054 100644
--- a/extensions/source/propctrlr/eformshelper.cxx
+++ b/extensions/source/propctrlr/eformshelper.cxx
@@ -123,14 +123,14 @@ namespace pcr
             OSL_VERIFY( m_xControlModel->getPropertyValue( PROPERTY_CLASSID ) >>= nControlType );
 
             // some lists
-            sal_Int16 nNumericCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, 0 };
-            sal_Int16 nDateCompatibleTypes[] = { DataTypeClass::DATE, 0 };
-            sal_Int16 nTimeCompatibleTypes[] = { DataTypeClass::TIME, 0 };
-            sal_Int16 nCheckboxCompatibleTypes[] = { DataTypeClass::BOOLEAN, DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
-            sal_Int16 nRadiobuttonCompatibleTypes[] = { DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
-            sal_Int16 nFormattedCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, DataTypeClass::DATETIME, DataTypeClass::DATE, DataTypeClass::TIME, 0 };
-
-            sal_Int16* pCompatibleTypes = nullptr;
+            sal_Int16 const nNumericCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, 0 };
+            sal_Int16 const nDateCompatibleTypes[] = { DataTypeClass::DATE, 0 };
+            sal_Int16 const nTimeCompatibleTypes[] = { DataTypeClass::TIME, 0 };
+            sal_Int16 const nCheckboxCompatibleTypes[] = { DataTypeClass::BOOLEAN, DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
+            sal_Int16 const nRadiobuttonCompatibleTypes[] = { DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
+            sal_Int16 const nFormattedCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, DataTypeClass::DATETIME, DataTypeClass::DATE, DataTypeClass::TIME, 0 };
+
+            sal_Int16 const * pCompatibleTypes = nullptr;
             switch ( nControlType )
             {
             case FormComponentType::SPINBUTTON:
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 976d76aefbe3..db8ef50d186c 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -619,7 +619,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
                 break;
             }
 #if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
-            const char* ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB",
+            const char* const ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB",
                                   "SANE_FRAME_RED", "SANE_FRAME_GREEN",
                                   "SANE_FRAME_BLUE", "Unknown !!!" };
             fprintf( stderr, "Parameters for frame %d:\n", nStream );
diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx
index 06aa1a3a18d6..1a416c7c3f64 100644
--- a/forms/source/misc/limitedformats.cxx
+++ b/forms/source/misc/limitedformats.cxx
@@ -325,8 +325,7 @@ namespace frm
 
             if (!bFoundIt)
             {   // somebody gave us a format which we can't translate
-                OUString sMessage ("This control supports only a very limited number of formats.");
-                throw IllegalArgumentException(sMessage, nullptr, 2);
+                throw IllegalArgumentException("This control supports only a very limited number of formats.", nullptr, 2);
             }
 
             return bModified;
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index a658cf12961e..6909508f78a5 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -60,8 +60,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
         else
         {
             // a xml namespace without name is not allowed (e.g. "xmlns:" )
-            OUString aErrorMessage( "A xml namespace without name is not allowed!" );
-            throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+            throw SAXException( "A xml namespace without name is not allowed!", Reference< XInterface >(), Any() );
         }
     }
 
@@ -69,8 +68,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
     {
         // namespace should be reseted - as xml draft states this is only allowed
         // for the default namespace - check and throw exception if check fails
-        OUString aErrorMessage( "Clearing xml namespace only allowed for default namespace!" );
-        throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+        throw SAXException( "Clearing xml namespace only allowed for default namespace!", Reference< XInterface >(), Any() );
     }
     else
     {
@@ -108,8 +106,7 @@ OUString XMLNamespaces::applyNSToAttributeName( const OUString& aName ) const
         else
         {
             // attribute with namespace but without name "namespace:" is not allowed!!
-            OUString aErrorMessage( "Attribute has no name only preceding namespace!" );
-            throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+            throw SAXException( "Attribute has no name only preceding namespace!", Reference< XInterface >(), Any() );
         }
     }
 
@@ -143,8 +140,7 @@ OUString XMLNamespaces::applyNSToElementName( const OUString& aName ) const
         else
         {
             // attribute with namespace but without a name is not allowed (e.g. "cfg:" )
-            OUString aErrorMessage( "Attribute has no name only preceding namespace!" );
-            throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+            throw SAXException( "Attribute has no name only preceding namespace!", Reference< XInterface >(), Any() );
         }
     }
     else
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index a266af912c8f..ee5fcaffdb64 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -477,8 +477,7 @@ OUString SubstitutePathVariables::impl_substituteVariable( const OUString& rText
             // recursion depth reached!
             if ( bSubstRequired )
             {
-                OUString aMsg( "Endless recursion detected. Cannot substitute variables!" );
-                throw NoSuchElementException( aMsg, static_cast<cppu::OWeakObject *>(this) );
+                throw NoSuchElementException( "Endless recursion detected. Cannot substitute variables!", static_cast<cppu::OWeakObject *>(this) );
             }
             else
                 aResult = rText;
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 6446c5fa14b6..c8e85cd33185 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -206,9 +206,7 @@ namespace io_acceptor {
         }
         else
         {
-            OUString message("acc_socket.cxx:SocketConnection::read: error - connection already closed");
-
-            IOException ioException(message, static_cast<XConnection *>(this));
+            IOException ioException("acc_socket.cxx:SocketConnection::read: error - connection already closed", static_cast<XConnection *>(this));
 
             Any any;
             any <<= ioException;
@@ -240,9 +238,7 @@ namespace io_acceptor {
         }
         else
         {
-            OUString message("acc_socket.cxx:SocketConnection::write: error - connection already closed");
-
-            IOException ioException(message, static_cast<XConnection *>(this));
+            IOException ioException("acc_socket.cxx:SocketConnection::write: error - connection already closed", static_cast<XConnection *>(this));
 
             Any any;
             any <<= ioException;
diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx
index 35f4e80511a7..e5908d6e41ed 100644
--- a/io/source/connector/ctr_socket.cxx
+++ b/io/source/connector/ctr_socket.cxx
@@ -147,9 +147,7 @@ namespace stoc_connector {
         }
         else
         {
-            OUString message("ctr_socket.cxx:SocketConnection::read: error - connection already closed");
-
-            IOException ioException(message, static_cast<XConnection *>(this));
+            IOException ioException("ctr_socket.cxx:SocketConnection::read: error - connection already closed", static_cast<XConnection *>(this));
 
             Any any;
             any <<= ioException;
@@ -181,9 +179,7 @@ namespace stoc_connector {
         }
         else
         {
-            OUString message("ctr_socket.cxx:SocketConnection::write: error - connection already closed");
-
-            IOException ioException(message, static_cast<XConnection *>(this));
+            IOException ioException("ctr_socket.cxx:SocketConnection::write: error - connection already closed", static_cast<XConnection *>(this));
 
             Any any;
             any <<= ioException;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index dee43b6b6d67..4485828a8926 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -103,7 +103,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
     OUString const sJavaHomeProperty("java.home");
     OUString const sJavaLibraryPathProperty("java.library.path");
     OUString const sGNUHomeProperty("gnu.classpath.home.url");
-    OUString sAccessProperty("javax.accessibility.assistive_technologies");
+    OUString const sAccessProperty("javax.accessibility.assistive_technologies");
 
     bool bVersion = false;
     bool bVendor = false;
@@ -261,8 +261,6 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
     char const * const * arLDPaths = getLibraryPaths( & size);
     vector<OUString> ld_paths = getVectorFromCharArray(arLDPaths, size);
 
-    char arSep[]= {SAL_PATHSEPARATOR, 0};
-    OUString sPathSep= OUString::createFromAscii(arSep);
     bool bLdPath = true;
     int c = 0;
     for(i_path il = ld_paths.begin(); il != ld_paths.end(); ++il, ++c)
@@ -274,7 +272,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
         {
 
             if(c > 0)
-                m_sLD_LIBRARY_PATH+= sPathSep;
+                m_sLD_LIBRARY_PATH+= OUStringLiteral1(SAL_PATHSEPARATOR);
             m_sLD_LIBRARY_PATH+= usSysPath;
         }
         else
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 40ce22e78ea9..457c613f7db6 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -135,8 +135,7 @@ OString getPluginJarPath(
             if (osl_getSystemPathFromFileURL(sName.pData, & sPath2.pData)
                 == osl_File_E_None)
             {
-                char sep[] = {SAL_PATHSEPARATOR, 0};
-                sPath = sPath1 + OUString::createFromAscii(sep) + sPath2;
+                sPath = sPath1 + OUStringLiteral1(SAL_PATHSEPARATOR) + sPath2;
             }
         }
         OSL_ASSERT(!sPath.isEmpty());
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 1f7423045bc1..b3e5a4c43de2 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -153,8 +153,6 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
     char const * const * arLDPaths = getLibraryPaths( & size);
     vector<OUString> ld_paths = getVectorFromCharArray(arLDPaths, size);
 
-    char arSep[]= {SAL_PATHSEPARATOR, 0};
-    OUString sPathSep= OUString::createFromAscii(arSep);
     bool bLdPath = true;
     int c = 0;
     for(i_path il = ld_paths.begin(); il != ld_paths.end(); ++il, ++c)
@@ -166,7 +164,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
         {
 
             if(c > 0)
-                m_sLD_LIBRARY_PATH+= sPathSep;
+                m_sLD_LIBRARY_PATH+= OUStringLiteral1(SAL_PATHSEPARATOR);
             m_sLD_LIBRARY_PATH+= usSysPath;
         }
         else
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 2c24017f1846..155e07c813da 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -88,8 +88,6 @@ OUString getParamFirstUrl(OUString const & name)
 VendorSettings::VendorSettings():
     m_xmlDocVendorSettingsFileUrl(BootParams::getVendorSettings())
 {
-    OString sMsgExc("[Java framework] Error in constructor "
-                         "VendorSettings::VendorSettings() (fwkbase.cxx)");
     //Prepare the xml document and context
     OString sSettingsPath = getVendorSettingsPath(m_xmlDocVendorSettingsFileUrl);
     if (sSettingsPath.isEmpty())
@@ -113,7 +111,8 @@ VendorSettings::VendorSettings():
             m_xmlPathContextVendorSettings, reinterpret_cast<xmlChar const *>("jf"),
             reinterpret_cast<xmlChar const *>(NS_JAVA_FRAMEWORK));
         if (res == -1)
-            throw FrameworkException(JFW_E_ERROR, sMsgExc);
+            throw FrameworkException(JFW_E_ERROR,
+                    "[Java framework] Error in constructor VendorSettings::VendorSettings() (fwkbase.cxx)");
     }
 }
 
@@ -480,8 +479,7 @@ OString makeClassPathOption(OUString const & sUserClassPath)
     {
         if (!sUserClassPath.isEmpty())
         {
-            char szSep[] = {SAL_PATHSEPARATOR,0};
-            sBufCP.appendAscii(szSep);
+            sBufCP.append(SAL_PATHSEPARATOR);
         }
         sBufCP.append(sAppCP);
     }
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 88cf455e728c..37932525596c 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1832,7 +1832,7 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
 
     if (!isEmptyRectangle(priv->m_aGraphicSelection))
     {
-        GdkRGBA aBlack{0, 0, 0, 0};
+        GdkRGBA const aBlack{0, 0, 0, 0};
         renderGraphicHandle(pDocView, pCairo, priv->m_aGraphicSelection, aBlack);
     }
 
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 1f62ca871a81..7ee052b1ba64 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -673,9 +673,9 @@ void LngSvcMgr::UpdateAll()
     SvtLinguConfig aCfg;
 
     const int nNumServices = 4;
-    const sal_Char * apServices[nNumServices]       =  { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS };
-    const sal_Char * apCurLists[nNumServices]       =  { "ServiceManager/SpellCheckerList",       "ServiceManager/GrammarCheckerList",       "ServiceManager/HyphenatorList",       "ServiceManager/ThesaurusList" };
-    const sal_Char * apLastFoundLists[nNumServices] =  { "ServiceManager/LastFoundSpellCheckers", "ServiceManager/LastFoundGrammarCheckers", "ServiceManager/LastFoundHyphenators", "ServiceManager/LastFoundThesauri" };
+    const sal_Char * const apServices[nNumServices]       =  { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS };
+    const sal_Char * const apCurLists[nNumServices]       =  { "ServiceManager/SpellCheckerList",       "ServiceManager/GrammarCheckerList",       "ServiceManager/HyphenatorList",       "ServiceManager/ThesaurusList" };
+    const sal_Char * const apLastFoundLists[nNumServices] =  { "ServiceManager/LastFoundSpellCheckers", "ServiceManager/LastFoundGrammarCheckers", "ServiceManager/LastFoundHyphenators", "ServiceManager/LastFoundThesauri" };
 
     // usage of indices as above: 0 = spell checker, 1 = grammar checker, 2 = hyphenator, 3 = thesaurus
     std::vector< list_entry_map_t > aLastFoundSvcs(nNumServices);
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 8d157ddfb291..651cf2e1ee4d 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -814,10 +814,10 @@ XFBorders* LwpMiddleLayout::GetXFBorders()
         //copy from lwpparastyle.
         XFBorders   *pXFBorders = new XFBorders();
         // apply 4 borders respectively
-        LwpBorderStuff::BorderType pType[] = { LwpBorderStuff::LEFT, LwpBorderStuff::RIGHT,
+        LwpBorderStuff::BorderType const pType[] = { LwpBorderStuff::LEFT, LwpBorderStuff::RIGHT,
             LwpBorderStuff::TOP, LwpBorderStuff::BOTTOM };
 
-        for (LwpBorderStuff::BorderType & nC : pType)
+        for (LwpBorderStuff::BorderType nC : pType)
         {
             if (pBorderStuff->HasSide(nC))
             {
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index 9110c45cd3c9..b84eec40b62a 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -281,19 +281,19 @@ OUString LwpSilverBullet::GetNumCharByStyleID(LwpFribParaNumber* pParaNumber)
         break;
     case NUMCHAR_Chinese1:
         {
-        sal_Unicode sBuf[13] = {0x58f9,0x002c,0x0020,0x8d30,0x002c,0x0020,0x53c1,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
+        sal_Unicode const sBuf[13] = {0x58f9,0x002c,0x0020,0x8d30,0x002c,0x0020,0x53c1,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
         strNumChar = OUString(sBuf);
         }
         break;
     case NUMCHAR_Chinese2:
         {
-        sal_Unicode sBuf[13] = {0x4e00,0x002c,0x0020,0x4e8c,0x002c,0x0020,0x4e09,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
+        sal_Unicode const sBuf[13] = {0x4e00,0x002c,0x0020,0x4e8c,0x002c,0x0020,0x4e09,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
         strNumChar = OUString(sBuf);
         }
         break;
     case NUMCHAR_Chinese3:
         {
-        sal_Unicode sBuf[13] = {0x7532,0x002c,0x0020,0x4e59,0x002c,0x0020,0x4e19,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
+        sal_Unicode const sBuf[13] = {0x7532,0x002c,0x0020,0x4e59,0x002c,0x0020,0x4e19,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
         strNumChar = OUString(sBuf);
         }
         break;
diff --git a/mysqlc/source/mysqlc_databasemetadata.cxx b/mysqlc/source/mysqlc_databasemetadata.cxx
index 366b74a8e0d7..68dad0cbcf84 100644
--- a/mysqlc/source/mysqlc_databasemetadata.cxx
+++ b/mysqlc/source/mysqlc_databasemetadata.cxx
@@ -878,8 +878,8 @@ Reference< XConnection > SAL_CALL ODatabaseMetaData::getConnection()
 
 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes()
 {
-    const char * table_types[] = {"TABLE", "VIEW"};
-    sal_Int32 requiredVersion[] = {0, 50000};
+    const char * const table_types[] = {"TABLE", "VIEW"};
+    sal_Int32 const requiredVersion[] = {0, 50000};
 
     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance("org.openoffice.comp.helper.DatabaseMetaDataResultSet"),UNO_QUERY);
     std::vector< std::vector< Any > > rRows;
diff --git a/o3tl/qa/test-array_view.cxx b/o3tl/qa/test-array_view.cxx
index 3a19c093304a..ab97d7de49c5 100644
--- a/o3tl/qa/test-array_view.cxx
+++ b/o3tl/qa/test-array_view.cxx
@@ -27,7 +27,7 @@ private:
 
 
     void testOperations() {
-        int some_data[] { 1, 2, 3 };
+        int const some_data[] { 1, 2, 3 };
         o3tl::array_view<int> v(some_data);
 
         CPPUNIT_ASSERT_EQUAL(1, *v.begin());
@@ -61,8 +61,8 @@ private:
         CPPUNIT_ASSERT_EQUAL(3, v.back());
         CPPUNIT_ASSERT_EQUAL(1, *v.data());
         {
-            int d1[] { 1, 2 };
-            int d2[] { 3, 4, 5, 6 };
+            int const d1[] { 1, 2 };
+            int const d2[] { 3, 4, 5, 6 };
             o3tl::array_view<int> v1( d1 );
             o3tl::array_view<int> v2( d2 );
             v1.swap(v2);
diff --git a/oox/source/drawingml/misccontexts.cxx b/oox/source/drawingml/misccontexts.cxx
index f5dc16d19b05..431db06e6e8e 100644
--- a/oox/source/drawingml/misccontexts.cxx
+++ b/oox/source/drawingml/misccontexts.cxx
@@ -359,7 +359,7 @@ ContextHandlerRef ArtisticEffectContext::onCreateContext(
         return nullptr;
 
     // effect attributes
-    sal_Int32 aAttribs[19] = {
+    sal_Int32 const aAttribs[19] = {
             XML_visible, XML_trans, XML_crackSpacing, XML_pressure, XML_numberOfShades,
             XML_grainSize, XML_intensity, XML_smoothness, XML_gridSize, XML_pencilSize,
             XML_size, XML_brushSize, XML_scaling, XML_detail, XML_bright, XML_contrast,
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index e7d172d63dc1..34d798b62d10 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -54,7 +54,7 @@ namespace {
 OUString lclGetShapeId( sal_Int32 nShapeId )
 {
     // identifier consists of a literal NUL character, a lowercase 's', and the id
-    sal_Unicode aStr[2] = { '\0', 's' };
+    sal_Unicode const aStr[2] = { '\0', 's' };
     return OUString( aStr, 2 ) + OUString::number( nShapeId );
 }
 
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index 62f77c27f1b9..695c85505201 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -312,7 +312,7 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOffice
                 clStatus = clSetKernelArg(clKernel, 4, sizeof(cl_mem), static_cast<void*>(&clInput3));
                 DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clSetKernelArg::clInput3");
                 size_t globalWS[1] = { testData->outputSize };
-                size_t localSize[1] = { 64 };
+                size_t const localSize[1] = { 64 };
                 clStatus = clEnqueueNDRangeKernel(clQueue, clKernel, 1, nullptr, globalWS, localSize, 0, nullptr, nullptr);
                 DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clEnqueueNDRangeKernel");
                 clFinish(clQueue);
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index 915c8f243bd7..f3ee450594ba 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -187,8 +187,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
     uno::Reference < xml::sax::XExtendedDocumentHandler > xExtHandler ( xHandler, uno::UNO_QUERY );
     if ( xExtHandler.is() && bProvideDTD )
     {
-        OUString aDocType ( MANIFEST_DOCTYPE );
-        xExtHandler->unknown ( aDocType );
+        xExtHandler->unknown ( MANIFEST_DOCTYPE );
         xHandler->ignorableWhitespace ( sWhiteSpace );
     }
     xHandler->startElement( sManifestElement, xRootAttrList );
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 5b7195302d50..108c1c36029c 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -708,14 +708,14 @@ void ScFiltersTest::testSortWithSheetExternalReferencesODS_Impl( ScDocShellRef c
     // Check the original data is there.
     for (SCROW nRow=nRow1+1; nRow <= nRow2; ++nRow)
     {
-        double aCheck[] = { 1, 2, 3, 4, 5 };
+        double const aCheck[] = { 1, 2, 3, 4, 5 };
         CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(0,nRow,0)));
     }
     for (SCROW nRow=nRow1+1; nRow <= nRow2; ++nRow)
     {
         for (SCCOL nCol=1; nCol <= 3; ++nCol)
         {
-            double aCheck[] = { 1, 12, 123, 1234, 12345 };
+            double const aCheck[] = { 1, 12, 123, 1234, 12345 };
             CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(nCol,nRow,0)));
         }
     }
@@ -745,7 +745,7 @@ void ScFiltersTest::testSortWithSheetExternalReferencesODS_Impl( ScDocShellRef c
     // adjusted to point to the original location.
     for (SCROW nRow=nRow1+1; nRow <= nRow2; ++nRow)
     {
-        double aCheck[] = { 5, 4, 3, 2, 1 };
+        double const aCheck[] = { 5, 4, 3, 2, 1 };
         CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(0,nRow,0)));
     }
     // The last column (D) are in-sheet relative references.
@@ -754,7 +754,7 @@ void ScFiltersTest::testSortWithSheetExternalReferencesODS_Impl( ScDocShellRef c
     {
         for (SCCOL nCol=1; nCol <= nEndCol; ++nCol)
         {
-            double aCheck[] = { 12345, 1234, 123, 12, 1 };
+            double const aCheck[] = { 12345, 1234, 123, 12, 1 };
             CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(nCol,nRow,0)));
         }
     }
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 5a6610c72f60..8823ece151c1 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -2661,7 +2661,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
         {
             {
                 // B2:B7 should show A,B,....,F.
-                const char* expected[] = { "A", "B", "C", "D", "E", "F" };
+                const char* const expected[] = { "A", "B", "C", "D", "E", "F" };
                 for (SCROW i = 0; i <= 5; ++i)
                 {
                     ScAddress aPos(1,i+1,0);
@@ -2677,7 +2677,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
 
             {
                 // C2:C7 should show AA,BB,....,FF.
-                const char* expected[] = { "AA", "BB", "CC", "DD", "EE", "FF" };
+                const char* const expected[] = { "AA", "BB", "CC", "DD", "EE", "FF" };
                 for (SCROW i = 0; i <= 5; ++i)
                 {
                     ScAddress aPos(2,i+1,0);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index a6af03344b84..01166bf43638 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -7604,7 +7604,7 @@ void Test::testFuncMDETERM()
 #endif
     }
 
-    int aVals[] = {23, 31, 13, 12, 34, 64, 34, 31, 98, 32, 33, 63, 45, 54, 65, 76};
+    int const aVals[] = {23, 31, 13, 12, 34, 64, 34, 31, 98, 32, 33, 63, 45, 54, 65, 76};
     int nIdx = 0;
     for( SCROW nRow = 0; nRow < 4; nRow++ )
         for( SCCOL nCol = 0; nCol < 4; nCol++ )
diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
index 0b80e89f2207..d04b2e4d7249 100644
--- a/sc/qa/unit/ucalc_pivottable.cxx
+++ b/sc/qa/unit/ucalc_pivottable.cxx
@@ -481,7 +481,7 @@ void Test::testPivotTableDateLabels()
     }
 
     {
-        const char* aChecks[] = {
+        const char* const aChecks[] = {
             "2011-01-01", "2011-01-02", "2011-01-03"
         };
 
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index b057f64f2b0d..db91442be673 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -378,7 +378,7 @@ void Test::testSortWithFormulaRefs()
         "=IF($List1.A7<>\"\";$List1.A7;\"\")",
     };
 
-    const char* aTextData[4] = {
+    const char* const aTextData[4] = {
         "bob",
         "tim",
         "brian",
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index a3a7853b9c6f..4b67c4a2f3b1 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -2266,7 +2266,7 @@ void ScConditionalFormatList::RemoveFromDocument(ScDocument* pDoc) const
     ScRangeList aRange = GetCombinedRange();
     ScMarkData aMark;
     aMark.MarkFromRangeList(aRange, true);
-    sal_uInt16 pItems[2] = { ATTR_CONDITIONAL,0};
+    sal_uInt16 const pItems[2] = { ATTR_CONDITIONAL,0};
     pDoc->ClearSelectionItems(pItems, aMark);
 }
 
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 653e73da36ac..dd1933c862c2 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1499,7 +1499,7 @@ public:
 
         // set work group size and execute
         size_t global_work_size[] = { 256, (size_t)w };
-        size_t local_work_size[] = { 256, 1 };
+        size_t const local_work_size[] = { 256, 1 };
         SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
         err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
             global_work_size, local_work_size, 0, nullptr, nullptr);
@@ -1557,7 +1557,7 @@ public:
 
             // set work group size and execute
             size_t global_work_size1[] = { 256, (size_t)w };
-            size_t local_work_size1[] = { 256, 1 };
+            size_t const local_work_size1[] = { 256, 1 };
             SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
             err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
                 global_work_size1, local_work_size1, 0, nullptr, nullptr);
@@ -2268,7 +2268,7 @@ public:
 
             // set work group size and execute
             size_t global_work_size[] = { 256, (size_t)nVectorWidth };
-            size_t local_work_size[] = { 256, 1 };
+            size_t const local_work_size[] = { 256, 1 };
             SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
             err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
                 global_work_size, local_work_size, 0, nullptr, nullptr);
@@ -2352,7 +2352,7 @@ public:
                     throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
                 // set work group size and execute
                 size_t global_work_size[] = { 256, (size_t)nVectorWidth };
-                size_t local_work_size[] = { 256, 1 };
+                size_t const local_work_size[] = { 256, 1 };
                 SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
                 err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
                     global_work_size, local_work_size, 0, nullptr, nullptr);
diff --git a/sc/source/core/tool/typedstrdata.cxx b/sc/source/core/tool/typedstrdata.cxx
index 649ca160a224..b8cbcfeb6348 100644
--- a/sc/source/core/tool/typedstrdata.cxx
+++ b/sc/source/core/tool/typedstrdata.cxx
@@ -75,8 +75,7 @@ bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& lef
 bool ScTypedStrData::operator< (const ScTypedStrData& r) const
 {
     // Case insensitive comparison by default.
-    LessCaseInsensitive aHdl;
-    return aHdl(*this, r);
+    return LessCaseInsensitive()(*this, r);
 }
 
 ScTypedStrData::ScTypedStrData(
@@ -99,13 +98,11 @@ bool FindTypedStrData::operator() (const ScTypedStrData& r) const
 {
     if (mbCaseSens)
     {
-        ScTypedStrData::EqualCaseSensitive aHdl;
-        return aHdl(maVal, r);
+        return ScTypedStrData::EqualCaseSensitive()(maVal, r);
     }
     else
     {
-        ScTypedStrData::EqualCaseInsensitive aHdl;
-        return aHdl(maVal, r);
+        return ScTypedStrData::EqualCaseInsensitive()(maVal, r);
     }
 }
 
diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx
index bdf4b5537d8d..4f24fb366e0e 100644
--- a/sc/source/filter/xml/xmlfonte.cxx
+++ b/sc/source/filter/xml/xmlfonte.cxx
@@ -74,12 +74,12 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP,
     : XMLFontAutoStylePool(rExportP, bBlockFontEmbedding)
     , mpEditEnginePool(nullptr)
 {
-    sal_uInt16 aWhichIds[3] = { ATTR_FONT, ATTR_CJK_FONT,
-                                ATTR_CTL_FONT };
-    sal_uInt16 aEditWhichIds[3] = { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
-                                    EE_CHAR_FONTINFO_CTL };
-    sal_uInt16 aPageWhichIds[4] = { ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERLEFT,
-                                    ATTR_PAGE_HEADERRIGHT, ATTR_PAGE_FOOTERRIGHT };
+    sal_uInt16 const aWhichIds[]     { ATTR_FONT, ATTR_CJK_FONT,
+                                       ATTR_CTL_FONT };
+    sal_uInt16 const aEditWhichIds[] { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
+                                       EE_CHAR_FONTINFO_CTL };
+    sal_uInt16 const aPageWhichIds[] { ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERLEFT,
+                                       ATTR_PAGE_HEADERRIGHT, ATTR_PAGE_FOOTERRIGHT };
 
     const SfxItemPool* pItemPool(rExportP.GetDocument()->GetPool());
     AddFontItems(aWhichIds, 3, pItemPool, true);
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index c88ed6023e47..d57041b56e9e 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -402,7 +402,7 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD
 
     SetMinOutputSizePixel( maDialogSize );
 
-    long nTabs[] = { 3, 10, 216, 266 };
+    long const nTabs[] = { 3, 10, 216, 266 };
     m_pLbConflicts->SetTabs( nTabs );
 
     OUString aTab('\t');
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index b9b672fd2756..969a35c7c10d 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -94,7 +94,7 @@ ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewD
     m_pCbShare->SetToggleHdl( LINK( this, ScShareDocumentDlg, ToggleHandle ) );
     m_pFtWarning->Enable( bIsDocShared );
 
-    long nTabs[] = { 2, 0, 0 };
+    long const nTabs[] = { 2, 0, 0 };
     m_pLbUsers->SetTabs( nTabs );
 
     OUString aHeader(get<FixedText>("name")->GetText());
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index e5ca3cf4ca58..19e54619e45e 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -9447,8 +9447,7 @@ ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange
     // Sort the vector by first range's start position, to avoid random shuffling
     // due to using the ScPatterAttr pointers
 
-    ScUniqueFormatsOrder aComp;
-    ::std::sort( aRangeLists.begin(), aRangeLists.end(), aComp );
+    ::std::sort( aRangeLists.begin(), aRangeLists.end(), ScUniqueFormatsOrder() );
 }
 
 
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 68c0216371d7..59928983559d 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -214,7 +214,7 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
         // no format means use the current delimiter
         sProps.realloc( 3 );
         sProps[ nIndex ].Name = "FilterOptions";
-        sal_Int16 delims[] = { 0 /*default not used*/, 9/*tab*/, 44/*comma*/, 32/*space*/, 59/*semicolon*/ };
+        sal_Int16 const delims[] { 0 /*default not used*/, 9/*tab*/, 44/*comma*/, 32/*space*/, 59/*semicolon*/ };
 
         OUString sFormat;
         sal_Int16 nFormat = 0; // default indicator
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 77865b57f8e7..1de9b9533815 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1131,12 +1131,11 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
             }
             else
             {
-                ScTypedStrData::EqualCaseSensitive aHdl;
                 std::vector<ScTypedStrData>::const_iterator itBeg = aStrings.begin(), itEnd = aStrings.end();
                 std::vector<ScTypedStrData>::const_iterator it = itBeg;
                 for (; it != itEnd && LISTBOX_ENTRY_NOTFOUND == nSelPos; ++it)
                 {
-                    if (aHdl(*it, *pNew))
+                    if (ScTypedStrData::EqualCaseSensitive()(*it, *pNew))
                         nSelPos = std::distance(itBeg, it);
                 }
             }
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 7fa2a3d990b9..03e2d148bd9a 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -247,10 +247,9 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
     }
     else
     {
-        OUString reason(
-        "ScriptProtocolHandler::dispatchWithNotification failed, ScriptProtocolHandler not initialised"
+        invokeResult <<= OUString(
+            "ScriptProtocolHandler::dispatchWithNotification failed, ScriptProtocolHandler not initialised"
         );
-        invokeResult <<= reason;
     }
 
     if ( bCaughtException )
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index b5d083353f0f..3699af968a8f 100644
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -53,12 +53,11 @@ ActiveMSPList::~ActiveMSPList()
 Reference< provider::XScriptProvider >
 ActiveMSPList::createNewMSP( const uno::Any& context )
 {
-    OUString serviceName("com.sun.star.script.provider.MasterScriptProvider");
     Sequence< Any > args( &context, 1 );
 
     Reference< provider::XScriptProvider > msp(
         m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
-            serviceName, args, m_xContext ), UNO_QUERY );
+            "com.sun.star.script.provider.MasterScriptProvider", args, m_xContext ), UNO_QUERY );
     return msp;
 }
 
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index 65b4fa4f5f02..f4ad90358785 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -136,7 +136,7 @@ ProviderCache::populateCache()
     ::osl::Guard< osl::Mutex > aGuard( m_mutex );
     try
     {
-        OUString languageProviderName( "com.sun.star.script.provider.LanguageScriptProvider"  );
+        OUString const languageProviderName( "com.sun.star.script.provider.LanguageScriptProvider"  );
 
         Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMgr, UNO_QUERY_THROW );
         Reference< container::XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( languageProviderName );
@@ -151,11 +151,10 @@ ProviderCache::populateCache()
 
             if ( serviceNames.getLength() > 0 )
             {
-                OUString searchString( "com.sun.star.script.provider.ScriptProviderFor"  );
-
                 for ( sal_Int32 index = 0; index < serviceNames.getLength(); index++ )
                 {
-                    if ( serviceNames[ index ].startsWith( searchString ) && !isInBlackList(  serviceNames[ index ] ) )
+                    if ( serviceNames[ index ].startsWith( "com.sun.star.script.provider.ScriptProviderFor" )
+                         && !isInBlackList(  serviceNames[ index ] ) )
                     {
                         serviceName = serviceNames[ index ];
                         ProviderDetails details;
@@ -186,8 +185,7 @@ ProviderCache::createProvider( ProviderDetails& details )
     }
     catch ( const Exception& e )
     {
-        OUString temp("ProviderCache::createProvider() Error creating provider from factory!!!\n");
-        throw RuntimeException( temp.concat( e.Message ) );
+        throw RuntimeException( "ProviderCache::createProvider() Error creating provider from factory. " + e.Message );
     }
 
     return details.provider;
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 4d328e22d716..100af7be69ea 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -441,8 +441,7 @@ void StringResourceImpl::newLocale( const Locale& locale )
 
     if( getItemForLocale( locale, false ) != nullptr )
     {
-        OUString errorMsg("StringResourceImpl: locale already exists");
-        throw ElementExistException( errorMsg );
+        throw ElementExistException( "StringResourceImpl: locale already exists" );
     }
 
     // TODO?: Check if locale is valid? How?
@@ -593,8 +592,7 @@ sal_Int32 StringResourceImpl::getUniqueNumericId(  )
 
     if( m_nNextUniqueNumericId < UNIQUE_NUMBER_NEEDS_INITIALISATION )
     {
-        OUString errorMsg("getUniqueNumericId: Extended sal_Int32 range");
-        throw NoSupportException( errorMsg );
+        throw NoSupportException( "getUniqueNumericId: Extended sal_Int32 range" );
     }
     return m_nNextUniqueNumericId;
 }
@@ -739,23 +737,20 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters
     bool bReadOnlyOk = (aArguments[1] >>= m_bReadOnly);
     if( !bReadOnlyOk )
     {
-        OUString errorMsg("XInitialization::initialize: Expected ReadOnly flag");
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 1 );
+        throw IllegalArgumentException( "XInitialization::initialize: Expected ReadOnly flag", Reference< XInterface >(), 1 );
     }
 
     css::lang::Locale aCurrentLocale;
     bool bLocaleOk = (aArguments[2] >>= aCurrentLocale);
     if( !bLocaleOk )
     {
-        OUString errorMsg("XInitialization::initialize: Expected Locale");
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 2 );
+        throw IllegalArgumentException( "XInitialization::initialize: Expected Locale", Reference< XInterface >(), 2 );
     }
 
     bool bNameBaseOk = (aArguments[3] >>= m_aNameBase);
     if( !bNameBaseOk )
     {
-        OUString errorMsg("XInitialization::initialize: Expected NameBase string");
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 3 );
+        throw IllegalArgumentException( "XInitialization::initialize: Expected NameBase string", Reference< XInterface >(), 3 );
     }
     if( m_aNameBase.isEmpty() )
         m_aNameBase = aNameBaseDefaultStr;
@@ -763,8 +758,7 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters
     bool bCommentOk = (aArguments[4] >>= m_aComment);
     if( !bCommentOk )
     {
-        OUString errorMsg("XInitialization::initialize: Expected Comment string");
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 4 );
+        throw IllegalArgumentException( "XInitialization::initialize: Expected Comment string", Reference< XInterface >(), 4 );
     }
 
     implScanLocales();
@@ -2191,8 +2185,7 @@ void StringResourceWithStorageImpl::initialize( const Sequence< Any >& aArgument
 
     if( !bOk )
     {
-        OUString errorMsg("StringResourceWithStorageImpl::initialize: invalid storage");
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+        throw IllegalArgumentException( "StringResourceWithStorageImpl::initialize: invalid storage", Reference< XInterface >(), 0 );
     }
 
     implInitializeCommonParameters( aArguments );
@@ -2352,8 +2345,7 @@ void StringResourceWithStorageImpl::setStorage( const Reference< XStorage >& Sto
 
     if( !Storage.is() )
     {
-        OUString errorMsg( "StringResourceWithStorageImpl::setStorage: invalid storage" );
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+        throw IllegalArgumentException( "StringResourceWithStorageImpl::setStorage: invalid storage", Reference< XInterface >(), 0 );
     }
 
     implLoadAllLocales();
@@ -2660,8 +2652,7 @@ void StringResourceWithLocationImpl::setURL( const OUString& URL )
     sal_Int32 nLen = URL.getLength();
     if( nLen == 0 )
     {
-        OUString errorMsg( "StringResourceWithLocationImpl::setURL: invalid URL" );
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+        throw IllegalArgumentException( "StringResourceWithLocationImpl::setURL: invalid URL", Reference< XInterface >(), 0 );
     }
 
     implLoadAllLocales();
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 15ba3c9fb9a1..5156ca1b4272 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -241,8 +241,7 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
 
     if( aMatches.size() > 1 )
     {
-        OrdNumSorter aSortHelper;
-        std::sort( aMatches.begin(), aMatches.end(), aSortHelper );
+        std::sort( aMatches.begin(), aMatches.end(), OrdNumSorter() );
     }
 
     if( nIndex > 0 )
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 18a785284620..99639f66e672 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -213,8 +213,9 @@ SfxItemSet& SdStyleSheet::GetItemSet()
         // we create the ItemSet 'on demand' if necessary
         if (!pSet)
         {
-            sal_uInt16 nWhichPairTable[] = { XATTR_LINE_FIRST,              XATTR_LINE_LAST,
-                                         XATTR_FILL_FIRST,              XATTR_FILL_LAST,
+            sal_uInt16 const nWhichPairTable[] {
+                                        XATTR_LINE_FIRST,              XATTR_LINE_LAST,
+                                        XATTR_FILL_FIRST,              XATTR_FILL_LAST,
 
                                         SDRATTR_SHADOW_FIRST,           SDRATTR_SHADOW_LAST,
                                         SDRATTR_TEXT_MINFRAMEHEIGHT,    SDRATTR_TEXT_CONTOURFRAME,
@@ -239,8 +240,9 @@ SfxItemSet& SdStyleSheet::GetItemSet()
     {
         if (!pSet)
         {
-            sal_uInt16 nWhichPairTable[] = { XATTR_LINE_FIRST,              XATTR_LINE_LAST,
-                                         XATTR_FILL_FIRST,              XATTR_FILL_LAST,
+            sal_uInt16 const nWhichPairTable[] {
+                                        XATTR_LINE_FIRST,              XATTR_LINE_LAST,
+                                        XATTR_FILL_FIRST,              XATTR_FILL_LAST,
 
                                         SDRATTR_SHADOW_FIRST,           SDRATTR_SHADOW_LAST,
                                         SDRATTR_TEXT_MINFRAMEHEIGHT,    SDRATTR_TEXT_CONTOURFRAME,
@@ -276,7 +278,8 @@ SfxItemSet& SdStyleSheet::GetItemSet()
         {
             if (!pSet)
             {
-                sal_uInt16 nWhichPairTable[] = { XATTR_LINE_FIRST,              XATTR_LINE_LAST,
+                sal_uInt16 const nWhichPairTable[] {
+                                             XATTR_LINE_FIRST,              XATTR_LINE_LAST,
                                              XATTR_FILL_FIRST,              XATTR_FILL_LAST,
 
                                              SDRATTR_SHADOW_FIRST,          SDRATTR_SHADOW_LAST,
@@ -289,9 +292,8 @@ SfxItemSet& SdStyleSheet::GetItemSet()
 
                                              EE_PARA_START,                 EE_CHAR_END,
 
-                                            SDRATTR_XMLATTRIBUTES,          SDRATTR_TEXT_USEFIXEDCELLHEIGHT,
-
-                                            SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
+                                             SDRATTR_XMLATTRIBUTES,          SDRATTR_TEXT_USEFIXEDCELLHEIGHT,
+                                             SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
                                              0, 0 };
 
                 pSet = new SfxItemSet(GetPool().GetPool(), nWhichPairTable);
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 3fb0c9bc5a81..d2b0d7ceb0d5 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -112,7 +112,7 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SotSt
     if ( pSummaryInformation->IsValid() )
     {
         pSummaryInformation->Read();
-        sal_uInt8 aPropSetGUID[ 16 ] =
+        sal_uInt8 const aPropSetGUID[ 16 ]
         {
             0xe0, 0x85, 0x9f, 0xf2, 0xf9, 0x4f, 0x68, 0x10, 0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9
         };
@@ -265,7 +265,7 @@ bool ImplSdPPTImport::Import()
 
         pDInfoSec2->Read();
 
-        sal_uInt8 aPropSetGUID[ 16 ] =
+        sal_uInt8 const aPropSetGUID[ 16 ]
         {
             0x02, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
         };
@@ -363,7 +363,7 @@ bool ImplSdPPTImport::Import()
                 }
             }
 
-            sal_uInt8 aUserPropSetGUID[ 16 ] =
+            sal_uInt8 const aUserPropSetGUID[ 16 ]
             {
                 0x05, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
             };
@@ -1856,8 +1856,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations
             }
         }
 
-        Ppt97AnimationStlSortHelper aSortHelper;
-        std::sort( aAnimationsOnThisPage.begin(), aAnimationsOnThisPage.end(), aSortHelper );
+        std::sort( aAnimationsOnThisPage.begin(), aAnimationsOnThisPage.end(), Ppt97AnimationStlSortHelper() );
 
         tAnimationVector::iterator aIter( aAnimationsOnThisPage.begin() );
         const tAnimationVector::iterator aEnd( aAnimationsOnThisPage.end() );
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index a1d3f3f93b7b..d29ca491b166 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -820,10 +820,9 @@ Reference<frame::XModel> MasterPageContainer::Implementation::GetModel()
             ::comphelper::getProcessComponentContext() );
 
         // Create a new model.
-        OUString sModelServiceName ( "com.sun.star.presentation.PresentationDocument");
         mxModel.set(
             ::comphelper::getProcessServiceFactory()->createInstance(
-                sModelServiceName),
+                "com.sun.star.presentation.PresentationDocument"),
             uno::UNO_QUERY);
 
         // Initialize the model.
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 23b733b5caf8..352994d067da 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1359,8 +1359,8 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property
                 uno::Sequence<uno::Any> aSeq;
                 int nSeqIndex = 0;
 
-                sal_uInt16 aWhichIds[3] = { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
-                                            EE_CHAR_FONTINFO_CTL };
+                sal_uInt16 const aWhichIds[] { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
+                                               EE_CHAR_FONTINFO_CTL };
 
                 const SfxItemPool& rPool = mpDoc->GetPool();
                 const SfxPoolItem* pItem;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 47fcf8144086..15aeca53f41d 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1818,7 +1818,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
         case SID_SHOW_NEXT_LEVEL:
         {
-            const char* STR_PRESOBJ_MPOUTLINE_ARY[] =
+            const char* const STR_PRESOBJ_MPOUTLINE_ARY[]
             {
                 STR_PRESOBJ_MPOUTLINE,
                 STR_PRESOBJ_MPOUTLLAYER2,
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index 1448c31763eb..c6f07fd63840 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -110,7 +110,7 @@ void OptimizerDialog::InitRoadmap()
         InsertRoadmapItem( 3, getString( STR_OLE_OBJECTS ), ITEM_ID_OLE_OPTIMIZATION );
         InsertRoadmapItem( 4, getString( STR_SUMMARY ), ITEM_ID_SUMMARY );
 
-        OUString sURL("private:graphicrepository/" BMP_PRESENTATION_MINIMIZER);
+        OUString const sURL("private:graphicrepository/" BMP_PRESENTATION_MINIMIZER);
 
         xPropertySet->setPropertyValue( "ImageURL", Any( sURL ) );
         xPropertySet->setPropertyValue( "Activated", Any( true ) );
diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx
index acc4e9f6f7b2..197e8f2e4184 100644
--- a/sdext/source/presenter/PresenterSlideShowView.cxx
+++ b/sdext/source/presenter/PresenterSlideShowView.cxx
@@ -335,7 +335,7 @@ void SAL_CALL PresenterSlideShowView::clear()
         rendering::ViewState aViewState (
             geometry::AffineMatrix2D(1,0,0, 0,1,0),
             nullptr);
-        double aColor[4] = {0,0,0,0};
+        double const aColor[4] = {0,0,0,0};
         rendering::RenderState aRenderState(
             geometry::AffineMatrix2D(1,0,0, 0,1,0),
             nullptr,
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 1e0c55907283..21d82ea94699 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -312,7 +312,7 @@ void ContentListBox_Impl::dispose()
 
 void ContentListBox_Impl::InitRoot()
 {
-    OUString aHelpTreeviewURL( "vnd.sun.star.hier://com.sun.star.help.TreeView/" );
+    OUString const aHelpTreeviewURL( "vnd.sun.star.hier://com.sun.star.help.TreeView/" );
     std::vector< OUString > aList =
         SfxContentHelper::GetHelpTreeViewContents( aHelpTreeviewURL );
 
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index f7337558c76e..5cb9e94f42b7 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1073,7 +1073,7 @@ void SAL_CALL SfxDocumentMetaData::init(
     // NB: we do not handle the single-XML-file ODF variant, which would
     //     have the root element office:document.
     //     The root of such documents must be converted in the importer!
-    OUString prefix(
+    OUString const prefix(
         "/child::office:document-meta/child::office:meta");
     css::uno::Reference<css::xml::dom::XNode> xDocNode(
         m_xDoc, css::uno::UNO_QUERY_THROW);
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index 49edc07ad92c..61884e65a8a5 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -343,7 +343,7 @@ void read_ulf_file(const std::string& FileName, Substitutor& Substitutor)
         StreamExceptionsEnabler sexc_in(in);
 
         //skip the byte-order-mark 0xEF 0xBB 0xBF, identifying UTF8 files
-        unsigned char BOM[3] = {0xEF, 0xBB, 0xBF};
+        unsigned char const BOM[3] = {0xEF, 0xBB, 0xBF};
         char buff[3];
         in.read(&buff[0], 3);
 
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 68ba77331b7d..d63d09c3b5e2 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -707,7 +707,7 @@ void SmXMLExport::ExportBinaryDiagonal(const SmNode *pNode, int nLevel)
         { // Scoping for <mo> creation
         SvXMLElementExport aMo(*this, XML_NAMESPACE_MATH, XML_MO,
             true, true);
-        sal_Unicode nArse[2] = {MS_BACKSLASH,0x00};
+        sal_Unicode const nArse[2] = {MS_BACKSLASH,0x00};
         GetDocHandler()->characters(nArse);
         }
 
@@ -1138,7 +1138,7 @@ void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel)
             //proper entity support required
             SvXMLElementExport aMath(*this, XML_NAMESPACE_MATH, XML_MO,
                 true, true);
-            sal_Unicode nArse[2] = {0xAF,0x00};
+            sal_Unicode const nArse[2] = {0xAF,0x00};
             GetDocHandler()->characters(nArse);
             }
             break;
@@ -1147,7 +1147,7 @@ void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel)
             //proper entity support required
             SvXMLElementExport aMath(*this, XML_NAMESPACE_MATH, XML_MO,
                 true, true);
-            sal_Unicode nArse[2] = {0x0332,0x00};
+            sal_Unicode const nArse[2] = {0x0332,0x00};
             GetDocHandler()->characters(nArse);
             }
             break;
diff --git a/svl/qa/unit/items/test_itempool.cxx b/svl/qa/unit/items/test_itempool.cxx
index 00c2c2ee6eda..a3132be80b0a 100644
--- a/svl/qa/unit/items/test_itempool.cxx
+++ b/svl/qa/unit/items/test_itempool.cxx
@@ -33,7 +33,7 @@ class PoolItemTest : public CppUnit::TestFixture
 
 void PoolItemTest::testPool()
 {
-    SfxItemInfo aItems[] =
+    SfxItemInfo const aItems[] =
         { { 1, true },
           { 2, false /* not poolable */ },
           { 3, false },
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 2f3059ec4378..d22f489a8a41 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -953,7 +953,7 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge )
             const LanguageTag& rLoadedLocale = xLocaleData->getLoadedLanguageTag();
             if ( !rLoadedLocale.equals( maLanguageTag ) )
             {
-                OUString aMsg("SvNumberFormatter::ImpGenerateCL: locales don't match:");
+                OUString const aMsg("SvNumberFormatter::ImpGenerateCL: locales don't match:");
                 LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg ));
             }
             // test XML locale data FormatElement entries
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 6046e44b8c37..6a815779425d 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -157,7 +157,7 @@ namespace svt
         // first collect all known programmatic names
         StringBag aKnownNames;
 
-        OUString sLogicalFieldNames(STR_LOGICAL_FIELD_NAMES);
+        OUString const sLogicalFieldNames(STR_LOGICAL_FIELD_NAMES);
         sal_Int32 nIndex = 0;
         do
         {
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index ab060c469658..bc80c48efd79 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -499,11 +499,9 @@ Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getSelectedAccess
 
 void SAL_CALL SvxRectCtlAccessibleContext::deselectAccessibleChild( sal_Int32 /*nIndex*/ )
 {
-    OUString aMessage( "deselectAccessibleChild is not possible in this context" );
-
     SAL_WARN( "svx", "SvxRectCtlAccessibleContext::deselectAccessibleChild() is not possible!" );
 
-    throw lang::IndexOutOfBoundsException( aMessage, *this );   // never possible
+    throw lang::IndexOutOfBoundsException( "deselectAccessibleChild is not possible in this context", *this );   // never possible
 }
 
 // internals
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index f2d69f844eec..37b0b289dacf 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -506,9 +506,8 @@ void SvxSearchDialog::Construct_Impl()
         {
             uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider =
                     configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() );
-            uno::Sequence< uno::Any > aArgs(1);
-            OUString sPath( "/org.openoffice.Office.Common/SearchOptions/");
-            aArgs[0] <<= sPath;
+            uno::Sequence< uno::Any > aArgs {
+                        Any(OUString( "/org.openoffice.Office.Common/SearchOptions/")) };
 
             uno::Reference< uno::XInterface > xIFace = xConfigurationProvider->createInstanceWithArguments(
                         "com.sun.star.configuration.ConfigurationUpdateAccess",
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 8f5ea2dc91d5..8efe25d6111f 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -271,7 +271,7 @@ void SgaObjectBmp::WriteData( SvStream& rOut, const OUString& rDestDir ) const
 {
     // Set version
     SgaObject::WriteData( rOut, rDestDir );
-    char aDummy[ 10 ] = { 0 };
+    char const aDummy[ 10 ] = { 0 };
     rOut.WriteBytes(aDummy, 10);
     write_uInt16_lenPrefixed_uInt8s_FromOString(rOut, OString()); //dummy
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 370d220e6a74..17afb75359fe 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -2105,7 +2105,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99140, "tdf99140.docx")
 
 DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" )
 {
-    sal_Int32 cellLeftMarginFromOffice[] = { 250, 100, 0, 0 };
+    sal_Int32 const cellLeftMarginFromOffice[] = { 250, 100, 0, 0 };
 
     uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY );
     uno::Reference< frame::XModel >             xModel( mxComponent, uno::UNO_QUERY );
@@ -2133,7 +2133,7 @@ DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" )
 // tdf#106742 for DOCX with compatibility level <= 14 (MS Word up to and incl. ver.2010), we should use cell margins when calculating table left border position
 DECLARE_OOXMLEXPORT_TEST( testTablePosition14, "table-position-14.docx" )
 {
-    sal_Int32 aXCoordsFromOffice[] = { 2500, -1000, 0, 0 };
+    sal_Int32 const aXCoordsFromOffice[] = { 2500, -1000, 0, 0 };
 
     uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY );
     uno::Reference< frame::XModel >             xModel( mxComponent, uno::UNO_QUERY );
@@ -2157,7 +2157,7 @@ DECLARE_OOXMLEXPORT_TEST( testTablePosition14, "table-position-14.docx" )
 // tdf#106742 for DOCX with compatibility level > 14 (MS Word since ver.2013), we should NOT use cell margins when calculating table left border position
 DECLARE_OOXMLEXPORT_TEST( testTablePosition15, "table-position-15.docx" )
 {
-    sal_Int32 aXCoordsFromOffice[] = { 2751, -899, 1, 106 };
+    sal_Int32 const aXCoordsFromOffice[] = { 2751, -899, 1, 106 };
 
     uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY );
     uno::Reference< frame::XModel >             xModel( mxComponent, uno::UNO_QUERY );
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index b7745e2c659e..9f75068be62f 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -209,21 +209,21 @@ DECLARE_RTFEXPORT_TEST(testCommentsNested, "comments-nested.odt")
 DECLARE_RTFEXPORT_TEST(testMathAccents, "math-accents.rtf")
 {
     OUString aActual = getFormula(getRun(getParagraph(1), 1));
-    OUString aExpected("acute {a} grave {a} check {a} breve {a} circle {a} widevec {a} widetilde {a} widehat {a} dot {a} widevec {a} widevec {a} widetilde {a} underline {a}");
+    OUString const aExpected("acute {a} grave {a} check {a} breve {a} circle {a} widevec {a} widetilde {a} widehat {a} dot {a} widevec {a} widevec {a} widetilde {a} underline {a}");
     CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
 DECLARE_RTFEXPORT_TEST(testMathEqarray, "math-eqarray.rtf")
 {
     OUString aActual = getFormula(getRun(getParagraph(1), 1));
-    OUString aExpected("y = left lbrace stack { 0, x < 0 # 1, x = 0 # {x} ^ {2} , x > 0 } right none");
+    OUString const aExpected("y = left lbrace stack { 0, x < 0 # 1, x = 0 # {x} ^ {2} , x > 0 } right none");
     CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
 DECLARE_RTFEXPORT_TEST(testMathD, "math-d.rtf")
 {
     OUString aActual = getFormula(getRun(getParagraph(1), 1));
-    OUString aExpected("left (x mline y mline z right ) left (1 right ) left [2 right ] left ldbracket 3 right rdbracket left lline 4 right rline left ldline 5 right rdline left langle 6 right rangle left langle a mline b right rangle left ({x} over {y} right )");
+    OUString const aExpected("left (x mline y mline z right ) left (1 right ) left [2 right ] left ldbracket 3 right rdbracket left lline 4 right rline left ldline 5 right rdline left langle 6 right rangle left langle a mline b right rangle left ({x} over {y} right )");
     CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
@@ -298,7 +298,7 @@ DECLARE_RTFEXPORT_TEST(testMathMso2007, "math-mso2007.rtf")
 DECLARE_RTFEXPORT_TEST(testMathNary, "math-nary.rtf")
 {
     OUString aActual = getFormula(getRun(getParagraph(1), 1));
-    OUString aExpected("lllint from {1} to {2} {x + 1} prod from {a} {b} sum to {2} {x}");
+    OUString const aExpected("lllint from {1} to {2} {x + 1} prod from {a} {b} sum to {2} {x}");
     CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
@@ -338,7 +338,7 @@ DECLARE_RTFEXPORT_TEST(testMathSepchr, "math-sepchr.rtf")
 DECLARE_RTFEXPORT_TEST(testMathSubscripts, "math-subscripts.rtf")
 {
     OUString aActual = getFormula(getRun(getParagraph(1), 1));
-    OUString aExpected("{x} ^ {y} + {e} ^ {x} {x} ^ {b} {x} rsub {b} {a} rsub {c} rsup {b} {x} lsub {2} lsup {1} {{x csup {6} csub {3}} lsub {4} lsup {5}} rsub {2} rsup {1}");
+    OUString const aExpected("{x} ^ {y} + {e} ^ {x} {x} ^ {b} {x} rsub {b} {a} rsub {c} rsup {b} {x} lsub {2} lsup {1} {{x csup {6} csub {3}} lsub {4} lsup {5}} rsub {2} rsup {1}");
     CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 52cab54b2e61..5ea85cc7360b 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -118,8 +118,8 @@ DECLARE_WW8IMPORT_TEST( testTdf105570, "tdf105570.doc" )
 
 DECLARE_WW8IMPORT_TEST(testTdf106799, "tdf106799.doc")
 {
-    sal_Int32 nCellWidths[3][4] = { { 9530, 0, 0, 0 },{ 2382, 2382, 2382, 2384 },{ 2382, 2382, 2382, 2384 } };
-    sal_Int32 nCellTxtLns[3][4] = { { 1, 0, 0, 0 },{ 1, 0, 0, 0},{ 1, 1, 1, 1 } };
+    sal_Int32 const nCellWidths[3][4] = { { 9530, 0, 0, 0 },{ 2382, 2382, 2382, 2384 },{ 2382, 2382, 2382, 2384 } };
+    sal_Int32 const nCellTxtLns[3][4] = { { 1, 0, 0, 0 },{ 1, 0, 0, 0},{ 1, 1, 1, 1 } };
     // Table was distorted because of missing sprmPFInnerTableCell at paragraph marks (0x0D) with sprmPFInnerTtp
     for (sal_Int32 nRow : { 0, 1, 2 })
         for (sal_Int32 nCell : { 0, 1, 2, 3 })
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index 4dafcf02ff62..636325f872b5 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -1332,7 +1332,7 @@ void DocumentFieldsManager::SetFixFields( const DateTime* pNewDateTime )
         nTime = tools::Time( tools::Time::SYSTEM ).GetTime();
     }
 
-    SwFieldIds aTypes[5] = {
+    SwFieldIds const aTypes[] {
         /*0*/   SwFieldIds::DocInfo,
         /*1*/   SwFieldIds::Author,
         /*2*/   SwFieldIds::ExtUser,
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 6ce19ccd6390..42e841b080cd 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -319,7 +319,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
     sw::DocumentContentOperationsManager::ParaRstFormat aPara( pStt, pEnd, pHst );
 
     // mst: not including META here; it seems attrs with CH_TXTATR are omitted
-    sal_uInt16 aResetableSetRange[] = {
+    sal_uInt16 const aResetableSetRange[] {
         RES_FRMATR_BEGIN, RES_FRMATR_END-1,
         RES_CHRATR_BEGIN, RES_CHRATR_END-1,
         RES_PARATR_BEGIN, RES_PARATR_END-1,
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index e65d24c2692b..8b4fb2936fe2 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3082,7 +3082,7 @@ void sw_BoxSetSplitBoxFormats( SwTableBox* pBox, SwCollectTableLineBoxes* pSplPa
         }
         else
         {
-            sal_uInt16 aTableSplitBoxSetRange[] = {
+            sal_uInt16 const aTableSplitBoxSetRange[] {
                 RES_LR_SPACE,       RES_UL_SPACE,
                 RES_BACKGROUND,     RES_SHADOW,
                 RES_PROTECT,        RES_PROTECT,
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 493eb8ea3185..2bca01b9ca08 100644
--- a/sw/source/core/layout/paintfrm.cxx

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list