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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 2 06:03:39 UTC 2018


 cui/source/customize/cfg.cxx                       |    5 ++---
 cui/source/inc/cfg.hxx                             |    2 +-
 desktop/source/deployment/gui/dp_gui_dialog2.cxx   |   18 +++++++-----------
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx |   10 ----------
 desktop/source/deployment/gui/dp_gui_theextmgr.hxx |    1 -
 desktop/source/migration/migration.cxx             |    4 +---
 desktop/source/migration/migration_impl.hxx        |    2 +-
 7 files changed, 12 insertions(+), 30 deletions(-)

New commits:
commit df6270e9c1d75a4865bf79043190669b74de71d3
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 1 16:13:29 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 2 08:03:16 2018 +0200

    loplugin:returnconstant in cui,desktop
    
    Change-Id: Ieec9e3d9e2e18add9a1bc7e0e15bb8435ea51954
    Reviewed-on: https://gerrit.libreoffice.org/58428
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 29f8641eacef..e7e4565e5d8b 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -449,14 +449,14 @@ MenuSaveInData::SetEntries( std::unique_ptr<SvxEntries> pNewEntries )
     pRootEntry->SetEntries( std::move(pNewEntries) );
 }
 
-bool SaveInData::LoadSubMenus( const uno::Reference< container::XIndexAccess >& xMenuSettings,
+void SaveInData::LoadSubMenus( const uno::Reference< container::XIndexAccess >& xMenuSettings,
     const OUString& rBaseTitle, SvxConfigEntry const * pParentData, bool bContextMenu )
 {
     SvxEntries* pEntries = pParentData->GetEntries();
 
     // Don't access non existing menu configuration!
     if ( !xMenuSettings.is() )
-        return true;
+        return;
 
     for ( sal_Int32 nIndex = 0; nIndex < xMenuSettings->getCount(); ++nIndex )
     {
@@ -559,7 +559,6 @@ bool SaveInData::LoadSubMenus( const uno::Reference< container::XIndexAccess >&
             }
         }
     }
-    return true;
 }
 
 bool MenuSaveInData::Apply()
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 5d85a87408b3..00ef79f0f552 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -122,7 +122,7 @@ protected:
         css::uno::Reference< css::lang::XSingleComponentFactory >& rFactory,
         SvxConfigEntry *pMenuData );
 
-    bool LoadSubMenus(
+    void LoadSubMenus(
         const css::uno::Reference< css::container::XIndexAccess >& xMenuSettings,
         const OUString& rBaseTitle, SvxConfigEntry const * pParentData, bool bContextMenu );
 
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 6d60fdf5d36f..c31088a88a8f 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -1026,19 +1026,15 @@ IMPL_STATIC_LINK(ExtMgrDialog, Restart, void*, pParent, void)
 
 bool ExtMgrDialog::Close()
 {
-    bool bRet = TheExtensionManager::queryTermination();
-    if ( bRet )
+    bool bRet = ModelessDialog::Close();
+    m_pManager->terminateDialog();
+    //only suggest restart if modified and this is the first close attempt
+    if (!m_bClosed && m_pManager->isModified())
     {
-        bRet = ModelessDialog::Close();
-        m_pManager->terminateDialog();
-        //only suggest restart if modified and this is the first close attempt
-        if (!m_bClosed && m_pManager->isModified())
-        {
-            m_pManager->clearModified();
-            Application::PostUserEvent(LINK(nullptr, ExtMgrDialog, Restart), m_xRestartParent);
-        }
-        m_bClosed = true;
+        m_pManager->clearModified();
+        Application::PostUserEvent(LINK(nullptr, ExtMgrDialog, Restart), m_xRestartParent);
     }
+    m_bClosed = true;
     return bRet;
 }
 
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index ae743357aa7f..407cf042fa64 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -250,16 +250,6 @@ bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWar
 }
 
 
-bool TheExtensionManager::queryTermination()
-{
-    if ( dp_misc::office_is_running() )
-        return true;
-    // the standalone application unopkg must not close ( and quit ) the dialog
-    // when there are still actions in the queue
-    return true;
-}
-
-
 void TheExtensionManager::terminateDialog()
 {
     if ( ! dp_misc::office_is_running() )
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index d6755d83d135..4980458f0dfd 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -96,7 +96,6 @@ public:
     bool installPackage( const OUString &rPackageURL, bool bWarnUser = false );
     void createPackageList();
 
-    static bool queryTermination();
     void terminateDialog();
 
     // Tools
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index c40993338e46..622515d3e179 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -351,7 +351,7 @@ static void insertSorted(migrations_available& rAvailableMigrations, supported_m
         rAvailableMigrations.push_back( aSupportedMigration );
 }
 
-bool MigrationImpl::readAvailableMigrations(migrations_available& rAvailableMigrations)
+void MigrationImpl::readAvailableMigrations(migrations_available& rAvailableMigrations)
 {
     // get supported version names
     uno::Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration/SupportedVersions"), uno::UNO_QUERY_THROW);
@@ -375,8 +375,6 @@ bool MigrationImpl::readAvailableMigrations(migrations_available& rAvailableMigr
         insertSorted( rAvailableMigrations, aSupportedMigration );
         SAL_INFO( "desktop.migration", " available migration '" << aSupportedMigration.name << "'" );
     }
-
-    return true;
 }
 
 migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName)
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index 70ff0000b9cb..c32d77eee1e2 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -165,7 +165,7 @@ private:
      MigrationHashMap     m_aOldVersionItemsHashMap;
 
     // functions to control the migration process
-    static bool   readAvailableMigrations(migrations_available&);
+    static void   readAvailableMigrations(migrations_available&);
     bool          alreadyMigrated();
     static migrations_vr readMigrationSteps(const OUString& rMigrationName);
     sal_Int32     findPreferredMigrationProcess(const migrations_available&);


More information about the Libreoffice-commits mailing list