[Libreoffice-commits] core.git: filter/source include/tools include/xmloff tools/source xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Sat Jan 20 06:41:55 UTC 2018


 filter/source/flash/swffilter.cxx                  |   20 +++++++++-----------
 filter/source/storagefilterdetect/filterdetect.hxx |    2 --
 filter/source/textfilterdetect/filterdetect.hxx    |    2 --
 include/tools/date.hxx                             |    4 +---
 include/tools/multisel.hxx                         |    2 +-
 include/xmloff/DashStyle.hxx                       |    2 +-
 include/xmloff/i18nmap.hxx                         |    2 +-
 include/xmloff/txtparae.hxx                        |    2 +-
 tools/source/datetime/tdate.cxx                    |    6 ++----
 tools/source/memtools/multisel.cxx                 |   11 ++++++-----
 xmloff/source/core/i18nmap.cxx                     |    3 +--
 xmloff/source/style/DashStyle.cxx                  |    3 +--
 xmloff/source/text/txtparae.cxx                    |    4 +---
 13 files changed, 25 insertions(+), 38 deletions(-)

New commits:
commit e725836ec19858be83bf6f7f251dd52dbcdf31d6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Jan 19 13:23:27 2018 +0200

    loplugin:unused-returns in filter,tools,xmloff
    
    Change-Id: I7a57be7e241883adac4417baa699a97d6304a631
    Reviewed-on: https://gerrit.libreoffice.org/48188
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx
index 029c84930937..8812065fd744 100644
--- a/filter/source/flash/swffilter.cxx
+++ b/filter/source/flash/swffilter.cxx
@@ -156,8 +156,8 @@ public:
     // XFilter
     virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& aDescriptor ) override;
 
-    bool ExportAsMultipleFiles( const Sequence< PropertyValue >& aDescriptor );
-    bool ExportAsSingleFile( const Sequence< PropertyValue >& aDescriptor );
+    void ExportAsMultipleFiles( const Sequence< PropertyValue >& aDescriptor );
+    void ExportAsSingleFile( const Sequence< PropertyValue >& aDescriptor );
 
     virtual void SAL_CALL cancel( ) override;
 
@@ -302,21 +302,21 @@ sal_Bool SAL_CALL FlashExportFilter::filter( const css::uno::Sequence< css::bean
 // AS: HACK!  Right now, I create a directory as a sibling to the swf file selected in the Export
 //  dialog.  This directory is called presentation.sxi-swf-files.  The name of the swf file selected
 //  in the Export dialog has no impact on this.  All files created are placed in this directory.
-bool FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue >& aDescriptor)
+void FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue >& aDescriptor)
 {
     Reference< XDrawPagesSupplier > xDrawPagesSupplier(mxDoc, UNO_QUERY);
     if(!xDrawPagesSupplier.is())
-        return false;
+        return;
 
     Reference< XIndexAccess > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY );
     if(!xDrawPages.is())
-        return false;
+        return;
 
     Reference< XDesktop2 > rDesktop = Desktop::create( mxContext );
 
     Reference< XStorable > xStorable(rDesktop->getCurrentComponent(), UNO_QUERY);
     if (!xStorable.is())
-        return false;
+        return;
 
     Reference< XDrawPage > xDrawPage;
 
@@ -438,11 +438,9 @@ bool FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue >& a
 
     if (bExportAll)
         osl_closeFile(aBackgroundConfig);
-
-    return true;
 }
 
-bool FlashExportFilter::ExportAsSingleFile(const Sequence< PropertyValue >& aDescriptor)
+void FlashExportFilter::ExportAsSingleFile(const Sequence< PropertyValue >& aDescriptor)
 {
     Reference < XOutputStream > xOutputStream = findPropertyValue<Reference<XOutputStream> >(aDescriptor, "OutputStream", nullptr);
     Sequence< PropertyValue > aFilterData;
@@ -450,7 +448,7 @@ bool FlashExportFilter::ExportAsSingleFile(const Sequence< PropertyValue >& aDes
     if (!xOutputStream.is() )
     {
         OSL_ASSERT ( false );
-        return false;
+        return;
     }
 
     FlashExporter aFlashExporter(
@@ -460,7 +458,7 @@ bool FlashExportFilter::ExportAsSingleFile(const Sequence< PropertyValue >& aDes
         findPropertyValue<sal_Int32>(aFilterData, "CompressMode", 75),
         findPropertyValue<bool>(aFilterData, "ExportOLEAsJPEG", false));
 
-    return aFlashExporter.exportAll( mxDoc, xOutputStream, mxStatusIndicator );
+    aFlashExporter.exportAll( mxDoc, xOutputStream, mxStatusIndicator );
 }
 
 
diff --git a/filter/source/storagefilterdetect/filterdetect.hxx b/filter/source/storagefilterdetect/filterdetect.hxx
index b2959851964f..8c13868ff817 100644
--- a/filter/source/storagefilterdetect/filterdetect.hxx
+++ b/filter/source/storagefilterdetect/filterdetect.hxx
@@ -55,8 +55,6 @@ public:
 
 OUString StorageFilterDetect_getImplementationName();
 
-bool StorageFilterDetect_supportsService(const OUString& ServiceName);
-
 css::uno::Sequence<OUString> StorageFilterDetect_getSupportedServiceNames();
 
 css::uno::Reference<css::uno::XInterface>
diff --git a/filter/source/textfilterdetect/filterdetect.hxx b/filter/source/textfilterdetect/filterdetect.hxx
index 6ae26db71043..173a0bf81cc9 100644
--- a/filter/source/textfilterdetect/filterdetect.hxx
+++ b/filter/source/textfilterdetect/filterdetect.hxx
@@ -56,8 +56,6 @@ public:
 
 OUString PlainTextFilterDetect_getImplementationName();
 
-bool PlainTextFilterDetect_supportsService(const OUString& ServiceName);
-
 css::uno::Sequence<OUString> PlainTextFilterDetect_getSupportedServiceNames();
 
 #endif
diff --git a/include/tools/date.hxx b/include/tools/date.hxx
index 071b3c3b765c..c70d3450399c 100644
--- a/include/tools/date.hxx
+++ b/include/tools/date.hxx
@@ -194,10 +194,8 @@ public:
         This may be necessary after Date ctors or if the SetDate(), SetDay(),
         SetMonth(), SetYear() methods set individual non-matching values.
         Adding/subtracting to/from dates never produces invalid dates.
-
-        @returns TRUE if the date was normalized, i.e. not valid before.
      */
-    bool            Normalize();
+    void            Normalize();
 
     bool            IsBetween( const Date& rFrom, const Date& rTo ) const
                         { return ((mnDate >= rFrom.mnDate) &&
diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx
index 246e30b8e5da..adb6a998fe98 100644
--- a/include/tools/multisel.hxx
+++ b/include/tools/multisel.hxx
@@ -91,7 +91,7 @@ class SAL_WARN_UNUSED TOOLS_DLLPUBLIC StringRangeEnumerator
 
     bool setRange( const OUString& i_rNewRange );
     bool insertRange( sal_Int32 nFirst, sal_Int32 nLast, bool bSequence );
-    bool insertJoinedRanges( const std::vector< sal_Int32 >& rNumbers );
+    void insertJoinedRanges( const std::vector< sal_Int32 >& rNumbers );
     bool checkValue( sal_Int32, const std::set< sal_Int32 >* i_pPossibleValues = nullptr ) const;
 public:
     class TOOLS_DLLPUBLIC Iterator
diff --git a/include/xmloff/DashStyle.hxx b/include/xmloff/DashStyle.hxx
index 04de8f1684f2..f7251ed90a79 100644
--- a/include/xmloff/DashStyle.hxx
+++ b/include/xmloff/DashStyle.hxx
@@ -55,7 +55,7 @@ public:
     XMLDashStyleExport( SvXMLExport& rExport );
     ~XMLDashStyleExport();
 
-    bool exportXML( const OUString& rStrName,
+    void exportXML( const OUString& rStrName,
                         const css::uno::Any& rValue );
 };
 
diff --git a/include/xmloff/i18nmap.hxx b/include/xmloff/i18nmap.hxx
index 3d97063a3b91..c3921281f70f 100644
--- a/include/xmloff/i18nmap.hxx
+++ b/include/xmloff/i18nmap.hxx
@@ -52,7 +52,7 @@ class XMLOFF_DLLPUBLIC SvI18NMap
 
 public:
     // Add a name mapping
-    bool Add( sal_uInt16 nKind, const OUString& rName,
+    void Add( sal_uInt16 nKind, const OUString& rName,
               const OUString& rNewName );
 
     // Return a mapped name. If the name could not be found, return the
diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index 6e65e1082e03..d59137ca977e 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -517,7 +517,7 @@ public:
 
     // It the model implements the xAutoStylesSupplier interface, the automatic
     // styles can exported without iterating over the text portions
-    bool collectTextAutoStylesOptimized( bool bIsProgress );
+    void collectTextAutoStylesOptimized( bool bIsProgress );
 
     // This method exports all automatic styles that have been collected.
     void exportTextAutoStyles();
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index f6073b85451e..8b6076c912ce 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -478,18 +478,16 @@ bool Date::IsValidDate( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear )
     return true;
 }
 
-bool Date::Normalize()
+void Date::Normalize()
 {
     sal_uInt16 nDay   = GetDay();
     sal_uInt16 nMonth = GetMonth();
     sal_Int16  nYear  = GetYear();
 
     if (!Normalize( nDay, nMonth, nYear))
-        return false;
+        return;
 
     setDateFromDMY( nDay, nMonth, nYear );
-
-    return true;
 }
 
 //static
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index cfb4137039ca..1928a6913e5a 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -539,15 +539,18 @@ bool StringRangeEnumerator::insertRange( sal_Int32 i_nFirst, sal_Int32 i_nLast,
     return bSuccess;
 }
 
-bool StringRangeEnumerator::insertJoinedRanges(
+void StringRangeEnumerator::insertJoinedRanges(
     const std::vector< sal_Int32 >& rNumbers )
 {
     size_t nCount = rNumbers.size();
     if( nCount == 0 )
-        return true;
+        return;
 
     if( nCount == 1 )
-        return insertRange( rNumbers[0], -1, false );
+    {
+        insertRange( rNumbers[0], -1, false );
+        return;
+    }
 
     for( size_t i = 0; i < nCount - 1; i++ )
     {
@@ -561,8 +564,6 @@ bool StringRangeEnumerator::insertJoinedRanges(
 
         insertRange( nFirst, nLast, nFirst != nLast );
     }
-
-    return true;
 }
 
 bool StringRangeEnumerator::setRange( const OUString& i_rNewRange )
diff --git a/xmloff/source/core/i18nmap.cxx b/xmloff/source/core/i18nmap.cxx
index cc8ad3682bbf..85bd293cb775 100644
--- a/xmloff/source/core/i18nmap.cxx
+++ b/xmloff/source/core/i18nmap.cxx
@@ -20,13 +20,12 @@
 #include <rtl/ustring.hxx>
 #include <xmloff/i18nmap.hxx>
 
-bool SvI18NMap::Add( sal_uInt16 nKind, const OUString& rName,
+void SvI18NMap::Add( sal_uInt16 nKind, const OUString& rName,
                      const OUString& rNewName )
 {
     SvI18NMapEntry_Key aKey(nKind, rName);
     bool bIsNewInsertion = m_aMap.emplace(aKey, rNewName).second;
     SAL_INFO_IF(!bIsNewInsertion, "xmloff.core", "SvI18NMap::Add: item with key \"" << rName << "\" registered already, likely invalid input file");
-    return bIsNewInsertion;
 }
 
 const OUString& SvI18NMap::Get( sal_uInt16 nKind, const OUString& rName ) const
diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx
index bba930eda041..96ee20aed5e0 100644
--- a/xmloff/source/style/DashStyle.cxx
+++ b/xmloff/source/style/DashStyle.cxx
@@ -210,7 +210,7 @@ XMLDashStyleExport::~XMLDashStyleExport()
 {
 }
 
-bool XMLDashStyleExport::exportXML(
+void XMLDashStyleExport::exportXML(
     const OUString& rStrName,
     const uno::Any& rValue )
 {
@@ -304,7 +304,6 @@ bool XMLDashStyleExport::exportXML(
                                       true, false );
         }
     }
-    return false;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 40e98eaab5d3..4a94221a9460 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1429,7 +1429,7 @@ static const enum XMLTokenEnum lcl_XmlBookmarkElements[] = {
 
 // This function replaces the text portion iteration during auto style
 // collection.
-bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
+void XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
 {
     GetExport().GetShapeExport(); // make sure the graphics styles family is added
 
@@ -1631,8 +1631,6 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
             }
         }
     }
-
-    return true;
 }
 
 void XMLTextParagraphExport::exportText(


More information about the Libreoffice-commits mailing list