[Libreoffice-commits] core.git: framework/inc framework/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jul 27 10:26:45 UTC 2018


 framework/inc/dispatch/startmoduledispatcher.hxx      |    5 -
 framework/inc/uielement/toolbarmerger.hxx             |    8 +-
 framework/source/dispatch/startmoduledispatcher.cxx   |    8 +-
 framework/source/uiconfiguration/imagemanagerimpl.cxx |    6 --
 framework/source/uiconfiguration/imagemanagerimpl.hxx |    2 
 framework/source/uielement/toolbarmerger.cxx          |   52 +++++-------------
 6 files changed, 28 insertions(+), 53 deletions(-)

New commits:
commit a4901e73b7ec1acab95fec7a04b688368786a234
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 26 14:36:12 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 27 12:24:04 2018 +0200

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

diff --git a/framework/inc/dispatch/startmoduledispatcher.hxx b/framework/inc/dispatch/startmoduledispatcher.hxx
index 6dc49f794135..8c5dc34dace6 100644
--- a/framework/inc/dispatch/startmoduledispatcher.hxx
+++ b/framework/inc/dispatch/startmoduledispatcher.hxx
@@ -105,11 +105,8 @@ class StartModuleDispatcher : public  ::cppu::WeakImplHelper<
         bool implts_isBackingModePossible();
 
         /** @short  open the special BackingComponent (now StartModule)
-
-            @return [bool]
-                    sal_True if operation was successfully.
          */
-        bool implts_establishBackingMode();
+        void implts_establishBackingMode();
 
         /** @short  notify a DispatchResultListener.
 
diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx
index 2c2890fb4e1d..802b9bd080cb 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -72,7 +72,7 @@ class ToolBarMerger
     public:
         static bool       IsCorrectContext( const OUString& aContext, const OUString& aModuleIdentifier );
 
-        static bool       ConvertSeqSeqToVector( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rSequence,
+        static void       ConvertSeqSeqToVector( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rSequence,
                                                  AddonToolbarItemContainer& rContainer );
 
         static void       ConvertSequenceToValues( const css::uno::Sequence< css::beans::PropertyValue >& rSequence,
@@ -104,7 +104,7 @@ class ToolBarMerger
                                                 const OUString&           rMergeFallback,
                                                 const AddonToolbarItemContainer& rItems );
 
-        static bool       MergeItems( ToolBox*                  pToolbar,
+        static void       MergeItems( ToolBox*                  pToolbar,
                                       ToolBox::ImplToolItems::size_type nPos,
                                       sal_uInt16                nModIndex,
                                       sal_uInt16&               rItemId,
@@ -112,14 +112,14 @@ class ToolBarMerger
                                       const OUString&           rModuleIdentifier,
                                       const AddonToolbarItemContainer& rAddonToolbarItems );
 
-        static bool       ReplaceItem( ToolBox*                  pToolbar,
+        static void       ReplaceItem( ToolBox*                  pToolbar,
                                        ToolBox::ImplToolItems::size_type nPos,
                                        sal_uInt16&               rItemId,
                                        CommandToInfoMap&         rCommandMap,
                                        const OUString&           rModuleIdentifier,
                                        const AddonToolbarItemContainer& rAddonToolbarItems );
 
-        static bool       RemoveItems( ToolBox*           pToolbar,
+        static void       RemoveItems( ToolBox*           pToolbar,
                                        ToolBox::ImplToolItems::size_type nPos,
                                        const OUString&    rMergeCommandParameter );
 
diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx
index 69dadf214b6d..f6538f701be3 100644
--- a/framework/source/dispatch/startmoduledispatcher.cxx
+++ b/framework/source/dispatch/startmoduledispatcher.cxx
@@ -67,8 +67,8 @@ void SAL_CALL StartModuleDispatcher::dispatchWithNotification(const css::util::U
         nResult = css::frame::DispatchResultState::FAILURE;
         if (implts_isBackingModePossible ())
         {
-            if (implts_establishBackingMode ())
-                nResult = css::frame::DispatchResultState::SUCCESS;
+            implts_establishBackingMode ();
+            nResult = css::frame::DispatchResultState::SUCCESS;
         }
     }
 
@@ -119,7 +119,7 @@ bool StartModuleDispatcher::implts_isBackingModePossible()
     return bIsPossible;
 }
 
-bool StartModuleDispatcher::implts_establishBackingMode()
+void StartModuleDispatcher::implts_establishBackingMode()
 {
     css::uno::Reference< css::frame::XDesktop2> xDesktop       = css::frame::Desktop::create( m_xContext );
     css::uno::Reference< css::frame::XFrame > xFrame           = xDesktop->findFrame(SPECIALTARGET_BLANK, 0);
@@ -130,8 +130,6 @@ bool StartModuleDispatcher::implts_establishBackingMode()
     xFrame->setComponent(xComponentWindow, xStartModule);
     xStartModule->attachFrame(xFrame);
     xContainerWindow->setVisible(true);
-
-    return true;
 }
 
 void StartModuleDispatcher::implts_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener >& xListener,
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index dfaf13572044..6f243811c883 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -309,7 +309,7 @@ void ImageManagerImpl::implts_initialize()
     }
 }
 
-bool ImageManagerImpl::implts_loadUserImages(
+void ImageManagerImpl::implts_loadUserImages(
     vcl::ImageType nImageType,
     const uno::Reference< XStorage >& xUserImageStorage,
     const uno::Reference< XStorage >& xUserBitmapsStorage )
@@ -358,7 +358,7 @@ bool ImageManagerImpl::implts_loadUserImages(
                     m_pUserImageList[nImageType].reset(new ImageList());
                     m_pUserImageList[nImageType]->InsertFromHorizontalStrip
                         ( aUserBitmap, aUserImagesVector );
-                    return true;
+                    return;
                 }
             }
         }
@@ -381,8 +381,6 @@ bool ImageManagerImpl::implts_loadUserImages(
 
     // Destroy old image list - create a new empty one
     m_pUserImageList[nImageType].reset(new ImageList);
-
-    return true;
 }
 
 bool ImageManagerImpl::implts_storeUserImages(
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.hxx b/framework/source/uiconfiguration/imagemanagerimpl.hxx
index 21b4ac342a2d..27835e87fca1 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.hxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.hxx
@@ -161,7 +161,7 @@ namespace framework
             void                                      implts_initialize();
             void                                      implts_notifyContainerListener( const css::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
             ImageList*                                implts_getUserImageList( vcl::ImageType nImageType );
-            bool                                      implts_loadUserImages( vcl::ImageType nImageType,
+            void                                      implts_loadUserImages( vcl::ImageType nImageType,
                                                                              const css::uno::Reference< css::embed::XStorage >& xUserImageStorage,
                                                                              const css::uno::Reference< css::embed::XStorage >& xUserBitmapsStorage );
             bool                                      implts_storeUserImages( vcl::ImageType nImageType,
diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx
index 62367c4e3a01..75cce49b15a2 100644
--- a/framework/source/uielement/toolbarmerger.cxx
+++ b/framework/source/uielement/toolbarmerger.cxx
@@ -99,13 +99,8 @@ bool ToolBarMerger::IsCorrectContext(
 
      A vector of AddonToolbarItems which will hold the
      conversion from the rSequence argument.
-
- @result
-     The result is true if the sequence, sequence of property
-     values could be converted to a vector of structs.
-
 */
-bool ToolBarMerger::ConvertSeqSeqToVector(
+void ToolBarMerger::ConvertSeqSeqToVector(
     const uno::Sequence< uno::Sequence< beans::PropertyValue > >& rSequence,
     AddonToolbarItemContainer& rContainer )
 {
@@ -123,8 +118,6 @@ bool ToolBarMerger::ConvertSeqSeqToVector(
                                  aAddonToolbarItem.nWidth );
         rContainer.push_back( aAddonToolbarItem );
     }
-
-    return true;
 }
 
 /**
@@ -316,15 +309,16 @@ bool ToolBarMerger::ProcessMergeOperation(
     const AddonToolbarItemContainer&       rItems )
 {
     if ( rMergeCommand == MERGECOMMAND_ADDAFTER )
-        return MergeItems( pToolbar, nPos, 1, rItemId, rCommandMap, rModuleIdentifier, rItems );
+        MergeItems( pToolbar, nPos, 1, rItemId, rCommandMap, rModuleIdentifier, rItems );
     else if ( rMergeCommand == MERGECOMMAND_ADDBEFORE )
-        return MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
+        MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
     else if ( rMergeCommand == MERGECOMMAND_REPLACE )
-        return ReplaceItem( pToolbar, nPos, rItemId, rCommandMap, rModuleIdentifier, rItems );
+        ReplaceItem( pToolbar, nPos, rItemId, rCommandMap, rModuleIdentifier, rItems );
     else if ( rMergeCommand == MERGECOMMAND_REMOVE )
-        return RemoveItems( pToolbar, nPos, rMergeCommandParameter );
-
-    return false;
+        RemoveItems( pToolbar, nPos, rMergeCommandParameter );
+    else
+        return false;
+    return true;
 }
 
 /**
@@ -387,9 +381,12 @@ bool ToolBarMerger::ProcessMergeFallback(
              ( rMergeCommand == MERGECOMMAND_ADDAFTER ) )
     {
         if ( rMergeFallback == MERGEFALLBACK_ADDFIRST )
-            return MergeItems( pToolbar, 0, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
+            MergeItems( pToolbar, 0, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
         else if ( rMergeFallback == MERGEFALLBACK_ADDLAST )
-            return MergeItems( pToolbar, ToolBox::APPEND, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
+            MergeItems( pToolbar, ToolBox::APPEND, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
+        else
+            return false;
+        return true;
     }
 
     return false;
@@ -426,12 +423,8 @@ bool ToolBarMerger::ProcessMergeFallback(
 
      Toolbar items which are associated to the merge
      command.
-
- @result
-     Returns true for a successful operation otherwise
-     false.
 */
-bool ToolBarMerger::MergeItems(
+void ToolBarMerger::MergeItems(
     ToolBox*                               pToolbar,
     ToolBox::ImplToolItems::size_type      nPos,
     sal_uInt16                             nModIndex,
@@ -480,8 +473,6 @@ bool ToolBarMerger::MergeItems(
             ++rItemId;
         }
     }
-
-    return true;
 }
 
 /**
@@ -516,12 +507,8 @@ bool ToolBarMerger::MergeItems(
 
      Toolbar items which are associated to the merge
      command.
-
- @result
-     Returns true for a successful operation otherwise
-     false.
 */
-bool ToolBarMerger::ReplaceItem(
+void ToolBarMerger::ReplaceItem(
     ToolBox*                               pToolbar,
     ToolBox::ImplToolItems::size_type      nPos,
     sal_uInt16&                            rItemId,
@@ -530,7 +517,7 @@ bool ToolBarMerger::ReplaceItem(
     const AddonToolbarItemContainer&       rAddonToolbarItems )
 {
     pToolbar->RemoveItem( nPos );
-    return MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rAddonToolbarItems );
+    MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rAddonToolbarItems );
 }
 
 /**
@@ -553,12 +540,8 @@ bool ToolBarMerger::ReplaceItem(
      rMergeCommandParameter.
 
      An optional argument for the merge command.
-
- @result
-     Returns true for a successful operation otherwise
-     false.
 */
-bool ToolBarMerger::RemoveItems(
+void ToolBarMerger::RemoveItems(
     ToolBox*                  pToolbar,
     ToolBox::ImplToolItems::size_type nPos,
     const OUString&    rMergeCommandParameter )
@@ -572,7 +555,6 @@ bool ToolBarMerger::RemoveItems(
                 pToolbar->RemoveItem( nPos );
         }
     }
-    return true;
 }
 
 /**


More information about the Libreoffice-commits mailing list