[Libreoffice-commits] core.git: 2 commits - editeng/source embeddedobj/source extensions/source filter/qa filter/source forms/source formula/source framework/source sc/inc sc/source

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


 editeng/source/items/textitem.cxx                     |    2 -
 embeddedobj/source/msole/oleembed.cxx                 |    2 -
 extensions/source/propctrlr/defaultforminspection.cxx |    8 +++----
 filter/qa/cppunit/priority-test.cxx                   |    2 -
 filter/source/msfilter/msdffimp.cxx                   |    2 -
 filter/source/msfilter/msoleexp.cxx                   |    2 -
 forms/source/richtext/richtextvclcontrol.cxx          |    4 +--
 forms/source/solar/control/navtoolbar.cxx             |    8 +++----
 formula/source/core/api/services.cxx                  |    2 -
 framework/source/accelerators/keymapping.cxx          |    2 -
 framework/source/inc/accelerators/keymapping.hxx      |    2 -
 sc/inc/table.hxx                                      |    4 +--
 sc/source/core/data/documen2.cxx                      |    3 +-
 sc/source/core/data/document.cxx                      |   19 ++++++++++++------
 14 files changed, 35 insertions(+), 27 deletions(-)

New commits:
commit ef5b895afe63eae029363ddb5d7960d7e34e5e35
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Oct 17 09:31:51 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Oct 17 12:07:46 2018 +0200

    loplugin:staticvar in editeng..framework
    
    Change-Id: I8e555a98f74f61e6e40122564b7ad19ca07a8a91
    Reviewed-on: https://gerrit.libreoffice.org/61866
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index e995a7ba5796..9c397090454a 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2970,7 +2970,7 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo
         DefaultFontType nFontType;
         LanguageType    nLanguage;
     }
-    aOutTypeArr[ nItemCnt ] =
+    const aOutTypeArr[ nItemCnt ] =
     {
         {  DefaultFontType::LATIN_TEXT, LANGUAGE_ENGLISH_US },
         {  DefaultFontType::CJK_TEXT, LANGUAGE_ENGLISH_US },
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index 0a51bdd7253e..7f84b91ead18 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -703,7 +703,7 @@ namespace
 
         //various stream names that can contain the real document contents for
         //this object in a straightforward direct way
-        const OUStringLiteral aStreamNames[] =
+        static const OUStringLiteral aStreamNames[] =
         {
             "CONTENTS",
             "Package",
diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx
index 999798518417..42d166e86545 100644
--- a/extensions/source/propctrlr/defaultforminspection.cxx
+++ b/extensions/source/propctrlr/defaultforminspection.cxx
@@ -102,11 +102,11 @@ namespace pcr
         ::osl::MutexGuard aGuard( m_aMutex );
 
         // service names for all our handlers
-        struct
+        static struct
         {
             const sal_Char* serviceName;
             bool            isFormOnly;
-        } aFactories[] = {
+        } const aFactories[] = {
 
             // a generic handler for form component properties (must precede the ButtonNavigationHandler)
             { "com.sun.star.form.inspection.FormComponentPropertyHandler", false },
@@ -156,12 +156,12 @@ namespace pcr
     {
         ::osl::MutexGuard aGuard( m_aMutex );
 
-        struct
+        static struct
         {
             const sal_Char* programmaticName;
             const char* uiNameResId;
             const sal_Char* helpId;
-        } aCategories[] = {
+        } const aCategories[] = {
             { "General",    RID_STR_PROPPAGE_DEFAULT,   HID_FM_PROPDLG_TAB_GENERAL },
             { "Data",       RID_STR_PROPPAGE_DATA,      HID_FM_PROPDLG_TAB_DATA },
             { "Events",     RID_STR_EVENTS,             HID_FM_PROPDLG_TAB_EVT }
diff --git a/filter/qa/cppunit/priority-test.cxx b/filter/qa/cppunit/priority-test.cxx
index 9eff49ffc2f2..cc2bf2b28ead 100644
--- a/filter/qa/cppunit/priority-test.cxx
+++ b/filter/qa/cppunit/priority-test.cxx
@@ -50,7 +50,7 @@ void PriorityFilterTest::testPriority()
     static struct {
         const char *pURL;
         const char *pFormat;
-    } aToCheck[] = {
+    } const aToCheck[] = {
         { "file:///tmp/foo.xls", "calc_MS_Excel_97" }
         // TODO: expand this to check more of these priorities
     };
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index ef8ab1e9e7d7..70a30e3eaa84 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -7018,7 +7018,7 @@ css::uno::Reference < css::embed::XEmbeddedObject >  SvxMSDffManager::CheckForCo
             sal_uInt32 n1;
             sal_uInt16 n2, n3;
             sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
-        } aArr[] = {
+        } const aArr[] = {
             { OLE_MATHTYPE_2_STARMATH, "smath", MSO_EQUATION3_CLASSID },
             { OLE_MATHTYPE_2_STARMATH, "smath", MSO_EQUATION2_CLASSID },
             { OLE_WINWORD_2_STARWRITER, "swriter", MSO_WW8_CLASSID },
diff --git a/filter/source/msfilter/msoleexp.cxx b/filter/source/msfilter/msoleexp.cxx
index 43652af5f7ea..1c2ae74e39fa 100644
--- a/filter/source/msfilter/msoleexp.cxx
+++ b/filter/source/msfilter/msoleexp.cxx
@@ -136,7 +136,7 @@ void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef const & rObj
                 sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
             }
             aGlNmIds[4];
-        } aArr[] = {
+        } const aArr[] = {
             { OLE_STARMATH_2_MATHTYPE, "MathType 3.x",
                 {{SO3_SM_CLASSID_60}, {SO3_SM_CLASSID_50},
                  {SO3_SM_CLASSID_40}, {SO3_SM_CLASSID_30 }}},
diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx
index dbfa228d7c14..8d16ce737fc6 100644
--- a/forms/source/richtext/richtextvclcontrol.cxx
+++ b/forms/source/richtext/richtextvclcontrol.cxx
@@ -220,12 +220,12 @@ namespace frm
                     )
                 {
                     bool bLoad = KEY_F11 == nCode;
-                    struct
+                    static struct
                     {
                         const sal_Char* pDescription;
                         const sal_Char* pExtension;
                         EETextFormat    eFormat;
-                    } aExportFormats[] =
+                    } const aExportFormats[] =
                     {
                         { "OASIS OpenDocument (*.xml)", "*.xml", EETextFormat::Xml },
                         { "HyperText Markup Language (*.html)", "*.html", EETextFormat::Html },
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index af5428305c70..74c3461d47c9 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -238,12 +238,12 @@ namespace frm
         // items. We could duplicate all the information here in our lib
         // (such as the item text and the image), but why should we?
 
-        struct FeatureDescription
+        static struct FeatureDescription
         {
             sal_uInt16      nId;
             bool        bRepeat;
             bool        bItemWindow;
-        } aSupportedFeatures[] =
+        } const aSupportedFeatures[] =
         {
             { LID_RECORD_LABEL,                     false, true },
             { FormFeature::MoveAbsolute,            false, true },
@@ -270,8 +270,8 @@ namespace frm
             { FormFeature::RemoveFilterAndSort,     false, false },
         };
 
-        FeatureDescription* pSupportedFeatures = aSupportedFeatures;
-        FeatureDescription* pSupportedFeaturesEnd = aSupportedFeatures + SAL_N_ELEMENTS( aSupportedFeatures );
+        FeatureDescription const * pSupportedFeatures = aSupportedFeatures;
+        FeatureDescription const * pSupportedFeaturesEnd = aSupportedFeatures + SAL_N_ELEMENTS( aSupportedFeatures );
         for ( ; pSupportedFeatures < pSupportedFeaturesEnd; ++pSupportedFeatures )
         {
             if ( pSupportedFeatures->nId )
diff --git a/formula/source/core/api/services.cxx b/formula/source/core/api/services.cxx
index 9010ee8be870..2e885fea41cd 100644
--- a/formula/source/core/api/services.cxx
+++ b/formula/source/core/api/services.cxx
@@ -33,7 +33,7 @@ using namespace ::com::sun::star::registry;
 namespace
 {
 
-cppu::ImplementationEntry entries[] = {
+cppu::ImplementationEntry const entries[] = {
     { &FormulaOpCodeMapperObj::create, &FormulaOpCodeMapperObj::getImplementationName_Static, &FormulaOpCodeMapperObj::getSupportedServiceNames_Static,
         &cppu::createSingleComponentFactory, nullptr, 0 },
     { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
diff --git a/framework/source/accelerators/keymapping.cxx b/framework/source/accelerators/keymapping.cxx
index 8b1bc1307b17..b1bbe79cc858 100644
--- a/framework/source/accelerators/keymapping.cxx
+++ b/framework/source/accelerators/keymapping.cxx
@@ -27,7 +27,7 @@ namespace framework
 
 // helper
 
-KeyMapping::KeyIdentifierInfo KeyMapping::KeyIdentifierMap[] =
+KeyMapping::KeyIdentifierInfo const KeyMapping::KeyIdentifierMap[] =
 {
     {css::awt::Key::NUM0          , "KEY_0"          },
     {css::awt::Key::NUM1          , "KEY_1"          },
diff --git a/framework/source/inc/accelerators/keymapping.hxx b/framework/source/inc/accelerators/keymapping.hxx
index 0f610e599e3a..9ce8cdcd8ed7 100644
--- a/framework/source/inc/accelerators/keymapping.hxx
+++ b/framework/source/inc/accelerators/keymapping.hxx
@@ -61,7 +61,7 @@ class KeyMapping
 
     private:
 
-        static KeyIdentifierInfo KeyIdentifierMap[];
+        static KeyIdentifierInfo const KeyIdentifierMap[];
 
         /** @short  hash to map identifier to key codes. */
         Identifier2CodeHash m_lIdentifierHash;
commit 48b41d73cb62dc89fc0594ccfd6fa664a460d142
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Oct 17 09:27:17 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Oct 17 12:07:34 2018 +0200

    ScTable::CopyTable drop defaults from params
    
    so I can change the signature of this method safely
    
    Change-Id: I91574cc1660c14408f2dcd9dbd18c0faa1a1e5c5
    Reviewed-on: https://gerrit.libreoffice.org/61864
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 85699da8c890..50dd96be4a3b 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -520,8 +520,8 @@ public:
     void CopyToTable(
         sc::CopyToDocContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
         InsertDeleteFlags nFlags, bool bMarked, ScTable* pDestTab,
-        const ScMarkData* pMarkData = nullptr, bool bAsLink = false, bool bColRowFlags = true,
-        bool bGlobalNamesToLocal = false, bool bCopyCaptions = true );
+        const ScMarkData* pMarkData, bool bAsLink, bool bColRowFlags,
+        bool bGlobalNamesToLocal, bool bCopyCaptions );
 
     void CopyCaptionsToTable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pDestTab, bool bCloneCaption );
 
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 83adb2fecd0e..f2c317026f8e 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -962,7 +962,8 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
                 }
                 pSrcDoc->maTabs[nSrcPos]->CopyToTable(aCxt, 0, 0, MAXCOL, MAXROW,
                         ( bResultsOnly ? InsertDeleteFlags::ALL & ~InsertDeleteFlags::FORMULA : InsertDeleteFlags::ALL),
-                        false, maTabs[nDestPos].get() );
+                        false, maTabs[nDestPos].get(), /*pMarkData*/nullptr, /*bAsLink*/false, /*bColRowFlags*/true,
+                        /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true );
             }
         }
         maTabs[nDestPos]->SetTabNo(nDestPos);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 230891d2d402..490cb93e59a4 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2075,7 +2075,7 @@ void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
             if (maTabs[i] && rDestDoc.maTabs[i])
                 maTabs[i]->CopyToTable(aCxt, nCol1, nRow1, nCol2, nRow2, nFlags,
                                       bOnlyMarked, rDestDoc.maTabs[i].get(), pMarks,
-                                      false, bColRowFlags );
+                                      false, bColRowFlags, /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true );
         }
         rDestDoc.SetAutoCalc(bOldAutoCalc);
     }
@@ -2134,7 +2134,8 @@ void ScDocument::CopyToDocument(const ScRange& rRange,
 
         pTab->CopyToTable(
             aCxt, aNewRange.aStart.Col(), aNewRange.aStart.Row(), aNewRange.aEnd.Col(), aNewRange.aEnd.Row(),
-            nFlags, bOnlyMarked, pDestTab, pMarks, false, bColRowFlags);
+            nFlags, bOnlyMarked, pDestTab, pMarks, false, bColRowFlags,
+            /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true);
     }
 
     rDestDoc.StartAllListeners(aNewRange);
@@ -3263,11 +3264,14 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
                     // context used for copying content to the temporary mix document.
                     sc::CopyToDocContext aMixCxt(*pMixDoc);
                     maTabs[i]->CopyToTable(aMixCxt, nStartCol,nStartRow, nEndCol,nEndRow,
-                                            InsertDeleteFlags::CONTENTS, false, pMixDoc->maTabs[i].get() );
+                                           InsertDeleteFlags::CONTENTS, false, pMixDoc->maTabs[i].get(),
+                                           /*pMarkData*/nullptr, /*bAsLink*/false, /*bColRowFlags*/true,
+                                           /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true );
                 }
                 maTabs[i]->DeleteArea( nStartCol,nStartRow, nEndCol,nEndRow, nDelFlags);
                 maTabs[nSrcTab]->CopyToTable(aCxt, nStartCol,nStartRow, nEndCol,nEndRow,
-                                                 nFlags, false, maTabs[i].get(), nullptr, bAsLink );
+                                             nFlags, false, maTabs[i].get(), nullptr, bAsLink,
+                                             /*bColRowFlags*/true, /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true );
 
                 if (bDoMix)
                     maTabs[i]->MixData(aMixDocCxt, nStartCol,nStartRow, nEndCol,nEndRow,
@@ -3325,12 +3329,15 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
 
                     sc::CopyToDocContext aMixCxt(*pMixDoc);
                     maTabs[i]->CopyToTable(aMixCxt, nStartCol,nStartRow, nEndCol,nEndRow,
-                                            InsertDeleteFlags::CONTENTS, true, pMixDoc->maTabs[i].get(), &rMark );
+                                            InsertDeleteFlags::CONTENTS, true, pMixDoc->maTabs[i].get(), &rMark,
+                                            /*bAsLink*/false, /*bColRowFlags*/true, /*bGlobalNamesToLocal*/false,
+                                            /*bCopyCaptions*/true );
                 }
 
                 maTabs[i]->DeleteSelection( nDelFlags, rMark );
                 maTabs[nSrcTab]->CopyToTable(aCxt, nStartCol,nStartRow, nEndCol,nEndRow,
-                                             nFlags, true, maTabs[i].get(), &rMark, bAsLink );
+                                             nFlags, true, maTabs[i].get(), &rMark, bAsLink,
+                                             /*bColRowFlags*/true, /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true );
 
                 if (bDoMix)
                     maTabs[i]->MixMarked(aMixDocCxt, rMark, nFunction, bSkipEmpty, pMixDoc->maTabs[i].get());


More information about the Libreoffice-commits mailing list