[Libreoffice-commits] core.git: cppuhelper/source cui/source dbaccess/source desktop/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 17 08:46:59 UTC 2018


 cppuhelper/source/servicemanager.cxx                   |    2 
 cui/source/inc/swpossizetabpage.hxx                    |    4 -
 cui/source/options/cfgchart.cxx                        |    2 
 cui/source/options/optfltr.cxx                         |    4 -
 cui/source/tabpages/border.cxx                         |    4 -
 cui/source/tabpages/swpossizetabpage.cxx               |   54 ++++++++---------
 cui/source/uno/services.cxx                            |    2 
 dbaccess/source/ext/macromigration/migrationengine.cxx |    2 
 dbaccess/source/sdbtools/connection/tablename.cxx      |    2 
 dbaccess/source/ui/app/AppIconControl.cxx              |    2 
 dbaccess/source/ui/browser/dbloader.cxx                |    2 
 desktop/unx/source/args.c                              |    2 
 12 files changed, 41 insertions(+), 41 deletions(-)

New commits:
commit bb480f77b8a65e7e52b53e601e536f55fa55f44b
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Oct 17 09:30:11 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Oct 17 10:46:12 2018 +0200

    loplugin:staticvar in cppuhelper..desktop
    
    Change-Id: I21cf6bafab6e865b90b29caa73183a8e00b538d1
    Reviewed-on: https://gerrit.libreoffice.org/61865
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 6c64911a5270..3fac957ebc3a 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1993,7 +1993,7 @@ void cppuhelper::ServiceManager::preloadImplementations() {
     std::cerr << std::endl;
 
     // Various rather important uno mappings.
-    struct {
+    static struct {
         const char *mpFrom;
         const char *mpTo;
         const char *mpPurpose;
diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx
index a00e7b579031..a33f411d6915 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -40,8 +40,8 @@ class SvxSwPosSizeTabPage : public SfxTabPage
     ::tools::Rectangle           m_aWorkArea;
     Point               m_aAnchorPos;
 
-    FrmMap* m_pVMap;
-    FrmMap* m_pHMap;
+    FrmMap const * m_pVMap;
+    FrmMap const * m_pHMap;
     const SdrView*      m_pSdrView;
 
     // initial values
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 8ac51f0ba678..5d97a788fa2f 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -88,7 +88,7 @@ void SvxChartColorTable::replace( size_t _nIndex, const XColorEntry & _rEntry )
 
 void SvxChartColorTable::useDefault()
 {
-    Color aColors[] = {
+    static const Color aColors[] = {
         Color( 0x00, 0x45, 0x86 ),
         Color( 0xff, 0x42, 0x0e ),
         Color( 0xff, 0xd3, 0x20 ),
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 2e917cf10b4c..f2ede6f28b29 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -202,7 +202,7 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
         MSFltrPg2_CheckBoxEntries eType;
         bool (SvtFilterOptions:: *FnIs)() const;
         void (SvtFilterOptions:: *FnSet)( bool bFlag );
-    } aChkArr[] = {
+    } const aChkArr[] = {
         { Math,     &SvtFilterOptions::IsMathType2Math,
                         &SvtFilterOptions::SetMathType2Math },
         { Math,     &SvtFilterOptions::IsMath2MathType,
@@ -279,7 +279,7 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
     static struct ChkCBoxEntries{
         MSFltrPg2_CheckBoxEntries eType;
         bool (SvtFilterOptions:: *FnIs)() const;
-    } aChkArr[] = {
+    } const aChkArr[] = {
         { Math,     &SvtFilterOptions::IsMathType2Math },
         { Math,     &SvtFilterOptions::IsMath2MathType },
         { Writer,   &SvtFilterOptions::IsWinWord2Writer },
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 414c8a2a05a6..17c6417f778b 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1265,13 +1265,13 @@ void SvxBorderTabPage::FillLineListBox_Impl()
 {
     using namespace ::com::sun::star::table::BorderLineStyle;
 
-    struct {
+    static struct {
         SvxBorderLineStyle mnStyle;
         long mnMinWidth;
         LineListBox::ColorFunc mpColor1Fn;
         LineListBox::ColorFunc mpColor2Fn;
         LineListBox::ColorDistFunc mpColorDistFn;
-    } aLines[] = {
+    } const aLines[] = {
         // Simple lines
         { SvxBorderLineStyle::SOLID,        0, &sameColor, &sameColor, &sameDistColor },
         { SvxBorderLineStyle::DOTTED,       0, &sameColor, &sameColor, &sameDistColor },
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 5dd07ce9ff4b..aa97613bf731 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -97,7 +97,7 @@ namespace o3tl {
     template<> struct typed_flags<LB> : is_typed_flags<LB, 0x0fffff> {};
 }
 
-static RelationMap aRelationMap[] =
+static RelationMap const aRelationMap[] =
 {
     {SwFPos::FRAME,         SwFPos::FRAME,             LB::Frame,           RelOrientation::FRAME},
     {SwFPos::PRTAREA,       SwFPos::PRTAREA,           LB::PrintArea,         RelOrientation::PRINT_AREA},
@@ -125,7 +125,7 @@ static RelationMap aRelationMap[] =
     {SwFPos::REL_LINE,  SwFPos::REL_LINE,   LB::VertLine,   RelOrientation::TEXT_LINE}
 };
 
-static RelationMap aAsCharRelationMap[] =
+static RelationMap const aAsCharRelationMap[] =
 {
     {SwFPos::REL_BASE,  SwFPos::REL_BASE,   LB::RelBase,   RelOrientation::FRAME},
     {SwFPos::REL_CHAR,  SwFPos::REL_CHAR,   LB::RelChar,   RelOrientation::FRAME},
@@ -139,7 +139,7 @@ static RelationMap aAsCharRelationMap[] =
 #define HORI_PAGE_REL   (LB::RelPageFrame|LB::RelPagePrintArea|LB::RelPageLeft| \
                         LB::RelPageRight)
 
-static FrmMap aHPageMap[] =
+static FrmMap const aHPageMap[] =
 {
     {SwFPos::LEFT,       SwFPos::MIR_LEFT,       HoriOrientation::LEFT,      HORI_PAGE_REL},
     {SwFPos::RIGHT,      SwFPos::MIR_RIGHT,      HoriOrientation::RIGHT,     HORI_PAGE_REL},
@@ -147,14 +147,14 @@ static FrmMap aHPageMap[] =
     {SwFPos::FROMLEFT,   SwFPos::MIR_FROMLEFT,   HoriOrientation::NONE,      HORI_PAGE_REL}
 };
 
-static FrmMap aHPageHtmlMap[] =
+static FrmMap const aHPageHtmlMap[] =
 {
     {SwFPos::FROMLEFT,      SwFPos::MIR_FROMLEFT,   HoriOrientation::NONE,      LB::RelPageFrame}
 };
 
 #define VERT_PAGE_REL   (LB::RelPageFrame|LB::RelPagePrintArea)
 
-static FrmMap aVPageMap[] =
+static FrmMap const aVPageMap[] =
 {
     {SwFPos::TOP,           SwFPos::TOP,            VertOrientation::TOP,       VERT_PAGE_REL},
     {SwFPos::BOTTOM,        SwFPos::BOTTOM,         VertOrientation::BOTTOM,    VERT_PAGE_REL},
@@ -162,7 +162,7 @@ static FrmMap aVPageMap[] =
     {SwFPos::FROMTOP,       SwFPos::FROMTOP,        VertOrientation::NONE,      VERT_PAGE_REL}
 };
 
-static FrmMap aVPageHtmlMap[] =
+static FrmMap const aVPageHtmlMap[] =
 {
     {SwFPos::FROMTOP, SwFPos::FROMTOP,        VertOrientation::NONE,      LB::RelPageFrame}
 };
@@ -174,7 +174,7 @@ static FrmMap aVPageHtmlMap[] =
 #define HORI_FRAME_REL  (LB::FlyRelPageFrame|LB::FlyRelPagePrintArea| \
                         LB::FlyRelPageLeft|LB::FlyRelPageRight)
 
-static FrmMap aHFrameMap[] =
+static FrmMap const aHFrameMap[] =
 {
     {SwFPos::LEFT,          SwFPos::MIR_LEFT,       HoriOrientation::LEFT,  HORI_FRAME_REL},
     {SwFPos::RIGHT,         SwFPos::MIR_RIGHT,      HoriOrientation::RIGHT,     HORI_FRAME_REL},
@@ -182,7 +182,7 @@ static FrmMap aHFrameMap[] =
     {SwFPos::FROMLEFT,      SwFPos::MIR_FROMLEFT,   HoriOrientation::NONE,      HORI_FRAME_REL}
 };
 
-static FrmMap aHFlyHtmlMap[] =
+static FrmMap const aHFlyHtmlMap[] =
 {
     {SwFPos::LEFT,          SwFPos::MIR_LEFT,       HoriOrientation::LEFT,      LB::FlyRelPageFrame},
     {SwFPos::FROMLEFT,      SwFPos::MIR_FROMLEFT,   HoriOrientation::NONE,      LB::FlyRelPageFrame}
@@ -192,7 +192,7 @@ static FrmMap aHFlyHtmlMap[] =
 // #i22305#
 #define VERT_FRAME_REL   (LB::VertFrame|LB::FlyVertPrintArea)
 
-static FrmMap aVFrameMap[] =
+static FrmMap const aVFrameMap[] =
 {
     {SwFPos::TOP,           SwFPos::TOP,            VertOrientation::TOP,       VERT_FRAME_REL},
     {SwFPos::BOTTOM,        SwFPos::BOTTOM,         VertOrientation::BOTTOM,    VERT_FRAME_REL},
@@ -200,17 +200,17 @@ static FrmMap aVFrameMap[] =
     {SwFPos::FROMTOP,       SwFPos::FROMTOP,        VertOrientation::NONE,      VERT_FRAME_REL}
 };
 
-static FrmMap aVFlyHtmlMap[] =
+static FrmMap const aVFlyHtmlMap[] =
 {
     {SwFPos::TOP,           SwFPos::TOP,            VertOrientation::TOP,       LB::FlyVertFrame},
     {SwFPos::FROMTOP,       SwFPos::FROMTOP,        VertOrientation::NONE,      LB::FlyVertFrame}
 };
 
-static FrmMap aVMultiSelectionMap[] =
+static FrmMap const aVMultiSelectionMap[] =
 {
     {SwFPos::FROMTOP,       SwFPos::FROMTOP,        VertOrientation::NONE,      LB::NONE}
 };
-static FrmMap aHMultiSelectionMap[] =
+static FrmMap const aHMultiSelectionMap[] =
 {
     {SwFPos::FROMLEFT,      SwFPos::FROMLEFT,       HoriOrientation::NONE,      LB::NONE}
 };
@@ -223,7 +223,7 @@ static FrmMap aHMultiSelectionMap[] =
                         LB::RelPageFrame|LB::RelPagePrintArea|LB::RelFrameLeft| \
                         LB::RelFrameRight)
 
-static FrmMap aHParaMap[] =
+static FrmMap const aHParaMap[] =
 {
     {SwFPos::LEFT,          SwFPos::MIR_LEFT,       HoriOrientation::LEFT,      HORI_PARA_REL},
     {SwFPos::RIGHT,         SwFPos::MIR_RIGHT,      HoriOrientation::RIGHT,     HORI_PARA_REL},
@@ -233,13 +233,13 @@ static FrmMap aHParaMap[] =
 
 #define HTML_HORI_PARA_REL  (LB::Frame|LB::PrintArea)
 
-static FrmMap aHParaHtmlMap[] =
+static FrmMap const aHParaHtmlMap[] =
 {
     {SwFPos::LEFT,  SwFPos::LEFT,   HoriOrientation::LEFT,      HTML_HORI_PARA_REL},
     {SwFPos::RIGHT, SwFPos::RIGHT,  HoriOrientation::RIGHT,     HTML_HORI_PARA_REL}
 };
 
-static FrmMap aHParaHtmlAbsMap[] =
+static FrmMap const aHParaHtmlAbsMap[] =
 {
     {SwFPos::LEFT,          SwFPos::MIR_LEFT,       HoriOrientation::LEFT,      HTML_HORI_PARA_REL},
     {SwFPos::RIGHT,         SwFPos::MIR_RIGHT,      HoriOrientation::RIGHT,     HTML_HORI_PARA_REL}
@@ -249,7 +249,7 @@ static FrmMap aHParaHtmlAbsMap[] =
 #define VERT_PARA_REL   (LB::VertFrame|LB::VertPrintArea| \
                          LB::RelPageFrame|LB::RelPagePrintArea)
 
-static FrmMap aVParaMap[] =
+static FrmMap const aVParaMap[] =
 {
     {SwFPos::TOP,           SwFPos::TOP,            VertOrientation::TOP,       VERT_PARA_REL},
     {SwFPos::BOTTOM,        SwFPos::BOTTOM,         VertOrientation::BOTTOM,    VERT_PARA_REL},
@@ -257,7 +257,7 @@ static FrmMap aVParaMap[] =
     {SwFPos::FROMTOP,       SwFPos::FROMTOP,        VertOrientation::NONE,      VERT_PARA_REL}
 };
 
-static FrmMap aVParaHtmlMap[] =
+static FrmMap const aVParaHtmlMap[] =
 {
     {SwFPos::TOP,           SwFPos::TOP,            VertOrientation::TOP,       LB::VertPrintArea}
 };
@@ -319,12 +319,12 @@ static FrmMap aVCharMap[] =
 };
 
 
-static FrmMap aVCharHtmlMap[] =
+static FrmMap const aVCharHtmlMap[] =
 {
     {SwFPos::BELOW,         SwFPos::BELOW,          VertOrientation::CHAR_BOTTOM,   LB::RelChar}
 };
 
-static FrmMap aVCharHtmlAbsMap[] =
+static FrmMap const aVCharHtmlAbsMap[] =
 {
     {SwFPos::TOP,    SwFPos::TOP,            VertOrientation::TOP,           LB::RelChar},
     {SwFPos::BELOW,  SwFPos::BELOW,          VertOrientation::CHAR_BOTTOM,   LB::RelChar}
@@ -333,7 +333,7 @@ static FrmMap aVCharHtmlAbsMap[] =
     anchored as character
  --------------------------------------------------------------------*/
 
-static FrmMap aVAsCharMap[] =
+static FrmMap const aVAsCharMap[] =
 {
     {SwFPos::TOP,           SwFPos::TOP,            VertOrientation::TOP,           LB::RelBase},
     {SwFPos::BOTTOM,        SwFPos::BOTTOM,         VertOrientation::BOTTOM,        LB::RelBase},
@@ -350,7 +350,7 @@ static FrmMap aVAsCharMap[] =
     {SwFPos::FROMBOTTOM,    SwFPos::FROMBOTTOM,     VertOrientation::NONE,          LB::RelBase}
 };
 
-static FrmMap aVAsCharHtmlMap[] =
+static FrmMap const aVAsCharHtmlMap[] =
 {
     {SwFPos::TOP,           SwFPos::TOP,            VertOrientation::TOP,           LB::RelBase},
     {SwFPos::CENTER_VERT,   SwFPos::CENTER_VERT,    VertOrientation::CENTER,        LB::RelBase},
@@ -477,7 +477,7 @@ static LB lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel )
 {
     LB nLBRelations = LB::NONE;
 
-    for (RelationMap & nRelMapPos : aRelationMap)
+    for (RelationMap const & nRelMapPos : aRelationMap)
     {
         if ( nRelMapPos.nRelation == _nRel )
         {
@@ -611,14 +611,14 @@ namespace
 {
     struct FrmMaps
     {
-        FrmMap *pMap;
+        FrmMap const *pMap;
         size_t nCount;
     };
 }
 
 void SvxSwPosSizeTabPage::setOptimalFrmWidth()
 {
-    const FrmMaps aMaps[] = {
+    static const FrmMaps aMaps[] = {
         { aHPageMap, SAL_N_ELEMENTS(aHPageMap) },
         { aHPageHtmlMap, SAL_N_ELEMENTS(aHPageHtmlMap) },
         { aVPageMap, SAL_N_ELEMENTS(aVPageMap) },
@@ -670,14 +670,14 @@ namespace
 {
     struct RelationMaps
     {
-        RelationMap *pMap;
+        RelationMap const *pMap;
         size_t nCount;
     };
 }
 
 void SvxSwPosSizeTabPage::setOptimalRelWidth()
 {
-    const RelationMaps aMaps[] = {
+    static const RelationMaps aMaps[] = {
         { aRelationMap, SAL_N_ELEMENTS(aRelationMap) },
         { aAsCharRelationMap, SAL_N_ELEMENTS(aAsCharRelationMap) }
     };
@@ -1249,7 +1249,7 @@ IMPL_LINK(SvxSwPosSizeTabPage, PosHdl, weld::ComboBox&, rLB, void)
     bool bHori = &rLB == m_xHoriLB.get();
     weld::ComboBox* pRelLB = bHori ? m_xHoriToLB.get() : m_xVertToLB.get();
     weld::Label* pRelFT = bHori ? m_xHoriToFT.get() : m_xVertToFT.get();
-    FrmMap *pMap = bHori ? m_pHMap : m_pVMap;
+    FrmMap const *pMap = bHori ? m_pHMap : m_pVMap;
 
 
     sal_uInt16 nMapPos = GetMapPos(pMap, rLB);
diff --git a/cui/source/uno/services.cxx b/cui/source/uno/services.cxx
index af06b9d07659..2b29158f9fb3 100644
--- a/cui/source/uno/services.cxx
+++ b/cui/source/uno/services.cxx
@@ -28,7 +28,7 @@ using namespace com::sun::star;
 
 namespace
 {
-    cppu::ImplementationEntry entries[] = {
+    cppu::ImplementationEntry const entries[] = {
         { &::cui::ColorPicker_createInstance, &::cui::ColorPicker_getImplementationName, &::cui::ColorPicker_getSupportedServiceNames, &cppu::createSingleComponentFactory, nullptr, 0 },
         { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
     };
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index 8e17e81c6f58..c6ab355c5c72 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -184,7 +184,7 @@ namespace dbmm
                 {
                 }
             };
-            const LanguageMapping aLanguageMapping[] =
+            static const LanguageMapping aLanguageMapping[] =
             {
                 LanguageMapping( "JavaScript", eJavaScript ),
                 LanguageMapping( "BeanShell",  eBeanShell ),
diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx
index c3ceb906b052..b151030cfd2f 100644
--- a/dbaccess/source/sdbtools/connection/tablename.cxx
+++ b/dbaccess/source/sdbtools/connection/tablename.cxx
@@ -177,7 +177,7 @@ namespace sdbtools
         */
         EComposeRule lcl_translateCompositionType_throw( sal_Int32 _nType )
         {
-            const struct
+            static const struct
             {
                 sal_Int32       nCompositionType;
                 EComposeRule    eComposeRule;
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx
index cc4f67c969ec..489b9fe19388 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -35,7 +35,7 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent)
     ,m_pActionListener(nullptr)
 {
 
-    const struct CategoryDescriptor
+    static const struct CategoryDescriptor
     {
         const char* pLabelResId;
         ElementType eType;
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index 2836c3bfd6af..8772bc983731 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -147,7 +147,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
     m_aURL      = rURL;
     m_aArgs     = rArgs;
 
-    const struct ServiceNameToImplName
+    static const struct ServiceNameToImplName
     {
         const char*     pAsciiServiceName;
         const char*     pAsciiImplementationName;
diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c
index 9a9b8f913d5d..199b58a8e50e 100644
--- a/desktop/unx/source/args.c
+++ b/desktop/unx/source/args.c
@@ -19,7 +19,7 @@ is_env_arg (rtl_uString const *str)
     return !rtl_ustr_ascii_compare_WithLength (str->buffer, 5, "-env:");
 }
 
-static struct {
+static const struct {
     const char   *name;
     unsigned int  bInhibitSplash : 1;
     unsigned int  bInhibitPagein : 1;


More information about the Libreoffice-commits mailing list