[Libreoffice-commits] core.git: compilerplugins/clang cui/source dbaccess/source sc/inc sc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 3 12:41:20 UTC 2020


 compilerplugins/clang/unusedfields.cxx         |    5 +++-
 cui/source/customize/cfgutil.cxx               |   28 ++++---------------------
 cui/source/inc/cfgutil.hxx                     |    1 
 dbaccess/source/ui/uno/ColumnModel.cxx         |   17 +++++++++------
 dbaccess/source/ui/uno/ColumnModel.hxx         |    6 +----
 sc/inc/PivotTableDataSequence.hxx              |    3 --
 sc/inc/chart2uno.hxx                           |    2 -
 sc/source/ui/unoobj/PivotTableDataProvider.cxx |    8 +++----
 sc/source/ui/unoobj/PivotTableDataSequence.cxx |    5 +---
 sc/source/ui/unoobj/chart2uno.cxx              |   18 +++++++---------
 10 files changed, 37 insertions(+), 56 deletions(-)

New commits:
commit 9f5eb314b0fc74d3779a8ce8116aa219ab82d5aa
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Feb 3 13:09:57 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Feb 3 13:40:39 2020 +0100

    loplugin:unusedfields
    
    tweak plugin with the name of another clone method
    
    Change-Id: I47193d31f53f48297c9e773da375c7255ddde282
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87852
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/unusedfields.cxx b/compilerplugins/clang/unusedfields.cxx
index fb1a16a0c13f..98c5a30d6a1d 100644
--- a/compilerplugins/clang/unusedfields.cxx
+++ b/compilerplugins/clang/unusedfields.cxx
@@ -398,7 +398,10 @@ bool UnusedFields::TraverseCXXMethodDecl(CXXMethodDecl* cxxMethodDecl)
     {
         if (cxxMethodDecl->isCopyAssignmentOperator()
             || cxxMethodDecl->isMoveAssignmentOperator()
-            || (cxxMethodDecl->getIdentifier() && (cxxMethodDecl->getName().startswith("Clone") || cxxMethodDecl->getName().startswith("clone"))))
+            || (cxxMethodDecl->getIdentifier()
+                && (cxxMethodDecl->getName().startswith("Clone")
+                    || cxxMethodDecl->getName().startswith("clone")
+                    || cxxMethodDecl->getName().startswith("createClone"))))
             insideMoveOrCopyOrCloneDeclParent = cxxMethodDecl->getParent();
         // these are similar in that they tend to simply enumerate all the fields of an object without putting
         // them to some useful purpose
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 6cac6c02ee35..9b3e9ecdc4f0 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -1066,7 +1066,6 @@ void CuiConfigGroupListBox::SelectMacro( const OUString& rBasic,
 SvxScriptSelectorDialog::SvxScriptSelectorDialog(
     weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& xFrame)
     : GenericDialogController(pParent, "cui/ui/macroselectordialog.ui", "MacroSelectorDialog")
-    , m_bShowSlots(false)
     , m_xDialogDescription(m_xBuilder->weld_label("helpmacro"))
     , m_xCategories(new CuiConfigGroupListBox(m_xBuilder->weld_tree_view("categories")))
     , m_xCommands(new CuiConfigFunctionListBox(m_xBuilder->weld_tree_view("commands")))
@@ -1078,19 +1077,14 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
     , m_xCancelButton(m_xBuilder->weld_button("cancel"))
     , m_xDescriptionText(m_xBuilder->weld_text_view("description"))
 {
-    if (m_bShowSlots)
-    {
-        // If we are showing Slot API commands update labels in the UI
-        m_xDialog->set_title(CuiResId(RID_SVXSTR_SELECTOR_ADD_COMMANDS));
-    }
     m_xCancelButton->show();
     m_xDialogDescription->show();
     m_xOKButton->show();
 
-    m_xLibraryFT->set_visible(!m_bShowSlots);
-    m_xCategoryFT->set_visible(m_bShowSlots);
-    m_xMacronameFT->set_visible(!m_bShowSlots);
-    m_xCommandsFT->set_visible(m_bShowSlots);
+    m_xLibraryFT->set_visible(true);
+    m_xCategoryFT->set_visible(false);
+    m_xMacronameFT->set_visible(true);
+    m_xCommandsFT->set_visible(false);
 
     const OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame));
     m_xCategories->SetFunctionListBox(m_xCommands.get());
@@ -1168,19 +1162,7 @@ IMPL_LINK(SvxScriptSelectorDialog, ClickHdl, weld::Button&, rButton, void)
     }
     else if (&rButton == m_xOKButton.get())
     {
-        // If we are displaying Slot API commands then this the dialog is being
-        // run from Tools/Configure and we should not close it
-        if ( !m_bShowSlots )
-        {
-            m_xDialog->response(RET_OK);
-        }
-        else
-        {
-            // Select the next entry in the list if possible
-            std::unique_ptr<weld::TreeIter> xIter = m_xCommands->make_iterator();
-            if (m_xCommands->get_selected(xIter.get()) && m_xCommands->iter_next_sibling(*xIter))
-                m_xCommands->select(*xIter);
-        }
+        m_xDialog->response(RET_OK);
     }
 }
 
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 229f5c8b04ed..944ab68e871f 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -237,7 +237,6 @@ class SvxScriptSelectorDialog : public weld::GenericDialogController
 {
     OUString                               m_sDefaultDesc;
     SfxStylesInfo_Impl                     m_aStylesInfo;
-    bool                                   m_bShowSlots;
 
     std::unique_ptr<weld::Label> m_xDialogDescription;
     std::unique_ptr<CuiConfigGroupListBox> m_xCategories;
diff --git a/dbaccess/source/ui/uno/ColumnModel.cxx b/dbaccess/source/ui/uno/ColumnModel.cxx
index 63799e50dabf..b0c7b854263b 100644
--- a/dbaccess/source/ui/uno/ColumnModel.cxx
+++ b/dbaccess/source/ui/uno/ColumnModel.cxx
@@ -43,10 +43,9 @@ using namespace ::com::sun::star::io;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::util;
 
-OColumnControlModel::OColumnControlModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OColumnControlModel::OColumnControlModel()
     :OPropertyContainer(m_aBHelper)
     ,OColumnControlModel_BASE(m_aMutex)
-    ,m_xORB(_rxFactory)
     ,m_sDefaultControl(SERVICE_CONTROLDEFAULT)
     ,m_bEnable(true)
     ,m_nBorder(0)
@@ -55,10 +54,9 @@ OColumnControlModel::OColumnControlModel(const Reference<XMultiServiceFactory>&
     registerProperties();
 }
 
-OColumnControlModel::OColumnControlModel(const OColumnControlModel* _pSource,const Reference<XMultiServiceFactory>& _rxFactory)
+OColumnControlModel::OColumnControlModel(const OColumnControlModel* _pSource)
     :OPropertyContainer(m_aBHelper)
     ,OColumnControlModel_BASE(m_aMutex)
-    ,m_xORB(_rxFactory)
     ,m_sDefaultControl(_pSource->m_sDefaultControl)
     ,m_aTabStop(_pSource->m_aTabStop)
     ,m_bEnable(_pSource->m_bEnable)
@@ -101,7 +99,7 @@ void OColumnControlModel::registerProperties()
 // XCloneable
 Reference< XCloneable > SAL_CALL OColumnControlModel::createClone( )
 {
-    return new OColumnControlModel( this, m_xORB );
+    return new OColumnControlModel( this );
 }
 
 css::uno::Sequence<sal_Int8> OColumnControlModel::getImplementationId()
@@ -111,7 +109,14 @@ css::uno::Sequence<sal_Int8> OColumnControlModel::getImplementationId()
 
 IMPLEMENT_GETTYPES2(OColumnControlModel,OColumnControlModel_BASE,comphelper::OPropertyContainer)
 IMPLEMENT_PROPERTYCONTAINER_DEFAULTS(OColumnControlModel)
-IMPLEMENT_SERVICE_INFO2_STATIC(OColumnControlModel,"com.sun.star.comp.dbu.OColumnControlModel","com.sun.star.awt.UnoControlModel","com.sun.star.sdb.ColumnDescriptorControlModel")
+IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(OColumnControlModel, "com.sun.star.comp.dbu.OColumnControlModel")
+IMPLEMENT_SERVICE_INFO_SUPPORTS(OColumnControlModel)
+IMPLEMENT_SERVICE_INFO_GETSUPPORTED2_STATIC(OColumnControlModel, "com.sun.star.awt.UnoControlModel","com.sun.star.sdb.ColumnDescriptorControlModel")
+css::uno::Reference< css::uno::XInterface >
+    OColumnControlModel::Create(const css::uno::Reference< css::lang::XMultiServiceFactory >& )
+{
+    return static_cast< XServiceInfo* >(new OColumnControlModel());
+}
 IMPLEMENT_FORWARD_REFCOUNT( OColumnControlModel, OColumnControlModel_BASE )
 Any SAL_CALL OColumnControlModel::queryInterface( const Type& _rType )
 {
diff --git a/dbaccess/source/ui/uno/ColumnModel.hxx b/dbaccess/source/ui/uno/ColumnModel.hxx
index 705f9166376d..f3bbb7aec199 100644
--- a/dbaccess/source/ui/uno/ColumnModel.hxx
+++ b/dbaccess/source/ui/uno/ColumnModel.hxx
@@ -49,7 +49,6 @@ class OColumnControlModel :  public ::comphelper::OMutexAndBroadcastHelper
                             ,public OColumnControlModel_BASE
 {
 
-    css::uno::Reference< css::lang::XMultiServiceFactory> m_xORB;
 // [properties]
     css::uno::Reference< css::sdbc::XConnection>          m_xConnection;
     css::uno::Reference< css::beans::XPropertySet >       m_xColumn;
@@ -64,10 +63,9 @@ class OColumnControlModel :  public ::comphelper::OMutexAndBroadcastHelper
 protected:
 
     virtual ~OColumnControlModel() override;
-    OColumnControlModel(const OColumnControlModel* _pSource
-                        ,const css::uno::Reference< css::lang::XMultiServiceFactory>& _rxFactory);
+    OColumnControlModel(const OColumnControlModel* _pSource);
 public:
-    explicit OColumnControlModel(const css::uno::Reference< css::lang::XMultiServiceFactory>& _rxFactory);
+    explicit OColumnControlModel();
 
 // UNO binding
     DECLARE_XINTERFACE( )
diff --git a/sc/inc/PivotTableDataSequence.hxx b/sc/inc/PivotTableDataSequence.hxx
index 7d6d04d4c3f1..5d6ab2403057 100644
--- a/sc/inc/PivotTableDataSequence.hxx
+++ b/sc/inc/PivotTableDataSequence.hxx
@@ -82,7 +82,7 @@ typedef cppu::WeakImplHelper<css::chart2::data::XDataSequence,
 class PivotTableDataSequence final : public PivotTableDataSequence_Base, public SfxListener
 {
 public:
-    explicit PivotTableDataSequence(ScDocument* pDocument, OUString const & sPivotTableName,
+    explicit PivotTableDataSequence(ScDocument* pDocument,
                                     OUString const & sID, std::vector<ValueAndFormat> const & rData);
 
     virtual ~PivotTableDataSequence() override;
@@ -156,7 +156,6 @@ public:
 
 private:
     ScDocument* m_pDocument;
-    OUString const m_sPivotTableName;
     OUString const m_aID;
     std::vector<ValueAndFormat> m_aData;
     SfxItemPropertySet const m_aPropSet;
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index ca5c1f7ffe6d..dd9af3d09b66 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -201,7 +201,6 @@ class ScChart2DataSequence final : public
 {
 public:
     explicit ScChart2DataSequence( ScDocument* pDoc,
-            const css::uno::Reference< css::chart2::data::XDataProvider >& xDP,
             ::std::vector<ScTokenRef>&& rTokens, bool bIncludeHiddenCells );
 
     virtual ~ScChart2DataSequence() override;
@@ -375,7 +374,6 @@ private:
     std::vector<ScTokenRef>     m_aTokens;
     RangeIndexMapPtr            m_pRangeIndices;
     ExtRefListenerPtr           m_pExtRefListener;
-    css::uno::Reference < css::chart2::data::XDataProvider > m_xDataProvider;
     SfxItemPropertySet const    m_aPropSet;
 
     std::unique_ptr<HiddenRangeListener> m_pHiddenListener;
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 859ef12208cb..dafac1918735 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -256,7 +256,7 @@ PivotTableDataProvider::createCategoriesDataSource(bool bOrientationIsColumn)
     {
         uno::Reference<chart2::data::XLabeledDataSequence> xResult = newLabeledDataSequence();
         std::unique_ptr<PivotTableDataSequence> pSequence;
-        pSequence.reset(new PivotTableDataSequence(m_pDocument, m_sPivotTableName,
+        pSequence.reset(new PivotTableDataSequence(m_pDocument,
                                                    lcl_identifierForCategories(), rCategories));
         pSequence->setRole("categories");
         xResult->setValues(uno::Reference<chart2::data::XDataSequence>(pSequence.release()));
@@ -588,7 +588,7 @@ PivotTableDataProvider::assignValuesToDataSequence(size_t nIndex)
 
     std::vector<ValueAndFormat> const & rRowOfData = m_aDataRowVector[nIndex];
     std::unique_ptr<PivotTableDataSequence> pSequence;
-    pSequence.reset(new PivotTableDataSequence(m_pDocument, m_sPivotTableName, sDataID, rRowOfData));
+    pSequence.reset(new PivotTableDataSequence(m_pDocument, sDataID, rRowOfData));
     pSequence->setRole("values-y");
     xDataSequence.set(pSequence.release());
     return xDataSequence;
@@ -627,7 +627,7 @@ PivotTableDataProvider::assignLabelsToDataSequence(size_t nIndex)
     std::vector<ValueAndFormat> aLabelVector { ValueAndFormat(aLabel.makeStringAndClear()) };
 
     std::unique_ptr<PivotTableDataSequence> pSequence;
-    pSequence.reset(new PivotTableDataSequence(m_pDocument, m_sPivotTableName,
+    pSequence.reset(new PivotTableDataSequence(m_pDocument,
                                                sLabelID, aLabelVector));
     pSequence->setRole("values-y");
     xDataSequence.set(pSequence.release());
@@ -645,7 +645,7 @@ css::uno::Reference<css::chart2::data::XDataSequence>
     std::vector<ValueAndFormat> const & rCategories = m_aCategoriesColumnOrientation.back();
 
     std::unique_ptr<PivotTableDataSequence> pSequence;
-    pSequence.reset(new PivotTableDataSequence(m_pDocument, m_sPivotTableName,
+    pSequence.reset(new PivotTableDataSequence(m_pDocument,
                                                lcl_identifierForCategories(), rCategories));
     pSequence->setRole("categories");
     xDataSequence.set(uno::Reference<chart2::data::XDataSequence>(pSequence.release()));
diff --git a/sc/source/ui/unoobj/PivotTableDataSequence.cxx b/sc/source/ui/unoobj/PivotTableDataSequence.cxx
index ad198c190452..c32bb0ab437a 100644
--- a/sc/source/ui/unoobj/PivotTableDataSequence.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataSequence.cxx
@@ -39,10 +39,9 @@ static const SfxItemPropertyMapEntry* lcl_GetDataSequencePropertyMap()
     return aDataSequencePropertyMap_Impl;
 }
 
-PivotTableDataSequence::PivotTableDataSequence(ScDocument* pDocument, OUString const & sPivotTableName, OUString const & sID,
+PivotTableDataSequence::PivotTableDataSequence(ScDocument* pDocument, OUString const & sID,
                                                std::vector<ValueAndFormat> const & rData)
     : m_pDocument(pDocument)
-    , m_sPivotTableName(sPivotTableName)
     , m_aID(sID)
     , m_aData(rData)
     , m_aPropSet(lcl_GetDataSequencePropertyMap())
@@ -167,7 +166,7 @@ uno::Reference<util::XCloneable> SAL_CALL PivotTableDataSequence::createClone()
     SolarMutexGuard aGuard;
 
     std::unique_ptr<PivotTableDataSequence> pClone;
-    pClone.reset(new PivotTableDataSequence(m_pDocument, m_sPivotTableName, m_aID, m_aData));
+    pClone.reset(new PivotTableDataSequence(m_pDocument, m_aID, m_aData));
     pClone->setRole(m_aRole);
 
     uno::Reference<util::XCloneable> xClone(pClone.release());
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index b1cbba83bb77..01dfcdbc2ed6 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1011,7 +1011,7 @@ namespace
 
 uno::Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequenceFromTokens(
     vector< ScTokenRef > && aValueTokens, vector< ScTokenRef > && aLabelTokens,
-    ScDocument* pDoc, const uno::Reference< chart2::data::XDataProvider >& xDP, bool bIncludeHiddenCells )
+    ScDocument* pDoc, bool bIncludeHiddenCells )
 {
     uno::Reference< chart2::data::XLabeledDataSequence >  xResult;
     bool bHasValues = !aValueTokens.empty();
@@ -1027,12 +1027,12 @@ uno::Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequen
             }
             if ( bHasValues )
             {
-                uno::Reference< chart2::data::XDataSequence > xSeq( new ScChart2DataSequence( pDoc, xDP, std::move(aValueTokens), bIncludeHiddenCells ) );
+                uno::Reference< chart2::data::XDataSequence > xSeq( new ScChart2DataSequence( pDoc, std::move(aValueTokens), bIncludeHiddenCells ) );
                 xResult->setValues( xSeq );
             }
             if ( bHasLabel )
             {
-                uno::Reference< chart2::data::XDataSequence > xLabelSeq( new ScChart2DataSequence( pDoc, xDP, std::move(aLabelTokens), bIncludeHiddenCells ) );
+                uno::Reference< chart2::data::XDataSequence > xLabelSeq( new ScChart2DataSequence( pDoc, std::move(aLabelTokens), bIncludeHiddenCells ) );
                 xResult->setLabel( xLabelSeq );
             }
         }
@@ -1493,7 +1493,7 @@ ScChart2DataProvider::createDataSource(
                 pChartMap->getLeftUpperCornerRanges());
 
         uno::Reference< chart2::data::XLabeledDataSequence > xCategories = lcl_createLabeledDataSequenceFromTokens(
-            std::move(aValueTokens), std::move(aLabelTokens), m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred!
+            std::move(aValueTokens), std::move(aLabelTokens), m_pDocument, m_bIncludeHiddenCells ); //ownership of pointers is transferred!
         if ( xCategories.is() )
         {
             aSeqs.push_back( xCategories );
@@ -1517,7 +1517,7 @@ ScChart2DataProvider::createDataSource(
             aLabelTokens = pChartMap->getRowHeaderRanges(static_cast<SCROW>(i));
         }
         uno::Reference< chart2::data::XLabeledDataSequence > xChartSeries = lcl_createLabeledDataSequenceFromTokens(
-            std::move(aValueTokens), std::move(aLabelTokens), m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred!
+            std::move(aValueTokens), std::move(aLabelTokens), m_pDocument, m_bIncludeHiddenCells ); //ownership of pointers is transferred!
         if ( xChartSeries.is() && xChartSeries->getValues().is() && xChartSeries->getValues()->getData().hasElements() )
         {
             aSeqs.push_back( xChartSeries );
@@ -2001,7 +2001,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL
 
     shrinkToDataRange(m_pDocument, aRefTokens);
 
-    xResult.set(new ScChart2DataSequence(m_pDocument, this, std::move(aRefTokens), m_bIncludeHiddenCells));
+    xResult.set(new ScChart2DataSequence(m_pDocument, std::move(aRefTokens), m_bIncludeHiddenCells));
 
     return xResult;
 }
@@ -2146,7 +2146,7 @@ ScChart2DataProvider::createDataSequenceByFormulaTokens(
 
     shrinkToDataRange(m_pDocument, aRefTokens);
 
-    xResult.set(new ScChart2DataSequence(m_pDocument, this, std::move(aRefTokens), m_bIncludeHiddenCells));
+    xResult.set(new ScChart2DataSequence(m_pDocument, std::move(aRefTokens), m_bIncludeHiddenCells));
     return xResult;
 }
 
@@ -2343,14 +2343,12 @@ void ScChart2DataSequence::HiddenRangeListener::notify()
 }
 
 ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
-        const uno::Reference < chart2::data::XDataProvider >& xDP,
         vector<ScTokenRef>&& rTokens,
         bool bIncludeHiddenCells )
     : m_bIncludeHiddenCells( bIncludeHiddenCells)
     , m_nObjectId( 0 )
     , m_pDocument( pDoc)
     , m_aTokens(std::move(rTokens))
-    , m_xDataProvider( xDP)
     , m_aPropSet(lcl_GetDataSequencePropertyMap())
     , m_bGotDataChangedHint(false)
     , m_bExtDataRebuildQueued(false)
@@ -3158,7 +3156,7 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2DataSequence::createClone()
         aTokensNew.push_back(p);
     }
 
-    rtl::Reference<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, m_xDataProvider, std::move(aTokensNew), m_bIncludeHiddenCells));
+    rtl::Reference<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, std::move(aTokensNew), m_bIncludeHiddenCells));
     p->CopyData(*this);
     uno::Reference< util::XCloneable > xClone(p.get());
 


More information about the Libreoffice-commits mailing list