From 3dfc17ed6334c619228668ffeff591bc75d32025 Mon Sep 17 00:00:00 2001
From: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Tue, 28 Aug 2018 14:43:10 +0200
Subject: loplugin:constantparam (3)

Change-Id: Ifc47bb8e096c9a8563021b2fcb44199577740746
Reviewed-on: https://gerrit.libreoffice.org/59747
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
---
 sfx2/inc/guisaveas.hxx                   |  3 +--
 sfx2/inc/preventduplicateinteraction.hxx |  5 ++---
 sfx2/source/appl/appopen.cxx             |  2 +-
 sfx2/source/doc/guisaveas.cxx            | 11 +++++------
 4 files changed, 9 insertions(+), 12 deletions(-)

(limited to 'sfx2')

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index fb93a33c5328..ac9df75aea61 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -70,8 +70,7 @@ public:
 
     static void SetDocInfoState(
         const css::uno::Reference< css::frame::XModel >& xModel,
-        const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo,
-        bool bNoModify );
+        const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo );
 
     static bool WarnUnacceptableFormat(
                                     const css::uno::Reference< css::frame::XModel >& xModel,
diff --git a/sfx2/inc/preventduplicateinteraction.hxx b/sfx2/inc/preventduplicateinteraction.hxx
index 46e998a213e7..8fdf8f79ea22 100644
--- a/sfx2/inc/preventduplicateinteraction.hxx
+++ b/sfx2/inc/preventduplicateinteraction.hxx
@@ -182,10 +182,9 @@ class PreventDuplicateInteraction : private ThreadHelpBase2
 
             public:
 
-                InteractionInfo(const css::uno::Type& aInteraction,
-                                      sal_Int32       nMaxCount   )
+                InteractionInfo(const css::uno::Type& aInteraction)
                     : m_aInteraction(aInteraction)
-                    , m_nMaxCount   (nMaxCount   )
+                    , m_nMaxCount   (1   )
                     , m_nCallCount  (0           )
                 {}
         };
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index ad839b0ccb24..632a2f985268 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -686,7 +686,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 
             // define rules for this handler
             css::uno::Type                                            aInteraction = ::cppu::UnoType<css::task::ErrorCodeRequest>::get();
-            ::sfx2::PreventDuplicateInteraction::InteractionInfo aRule        (aInteraction, 1);
+            ::sfx2::PreventDuplicateInteraction::InteractionInfo aRule(aInteraction);
             pHandler->addInteractionRule(aRule);
 
             if (!aDocService.isEmpty())
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index f4427d0f2035..acab90b6cd4a 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1654,7 +1654,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
 
             if ( nStoreMode & EXPORT_REQUESTED )
             {
-                SfxStoringHelper::SetDocInfoState(aModel.GetModel(), xOldDocProps, true);
+                SfxStoringHelper::SetDocInfoState(aModel.GetModel(), xOldDocProps);
             }
         };
 
@@ -1728,8 +1728,7 @@ bool SfxStoringHelper::CheckFilterOptionsAppearance(
 // static
 void SfxStoringHelper::SetDocInfoState(
         const uno::Reference< frame::XModel >& xModel,
-        const uno::Reference< document::XDocumentProperties>& i_xOldDocProps,
-        bool bNoModify )
+        const uno::Reference< document::XDocumentProperties>& i_xOldDocProps )
 {
     uno::Reference<document::XDocumentPropertiesSupplier> const
         xModelDocPropsSupplier(xModel, uno::UNO_QUERY_THROW);
@@ -1739,10 +1738,10 @@ void SfxStoringHelper::SetDocInfoState(
             i_xOldDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
 
     uno::Reference< util::XModifiable > xModifiable( xModel, uno::UNO_QUERY );
-    if ( bNoModify && !xModifiable.is() )
+    if ( !xModifiable.is() )
         throw uno::RuntimeException();
 
-    bool bIsModified = bNoModify && xModifiable->isModified();
+    bool bIsModified = xModifiable->isModified();
 
     try
     {
@@ -1799,7 +1798,7 @@ void SfxStoringHelper::SetDocInfoState(
     }
 
     // set the modified flag back if required
-    if ( (bNoModify && bIsModified) != bool(xModifiable->isModified()) )
+    if ( bIsModified != bool(xModifiable->isModified()) )
         xModifiable->setModified( bIsModified );
 }
 
-- 
cgit