[Libreoffice-commits] core.git: writerfilter/source xmlsecurity/source

Noel Grandin noel at peralex.com
Mon Jan 18 00:38:23 PST 2016


 writerfilter/source/dmapper/DomainMapper_Impl.cxx          |    6 ---
 writerfilter/source/dmapper/DomainMapper_Impl.hxx          |    2 -
 writerfilter/source/dmapper/FormControlHelper.cxx          |   22 ++++---------
 writerfilter/source/dmapper/FormControlHelper.hxx          |    4 +-
 writerfilter/source/ooxml/OOXMLPropertySet.cxx             |   17 ----------
 writerfilter/source/ooxml/OOXMLPropertySet.hxx             |    6 ---
 writerfilter/source/rtftok/rtfsprm.cxx                     |    5 +-
 writerfilter/source/rtftok/rtfsprm.hxx                     |    2 -
 xmlsecurity/source/component/documentdigitalsignatures.cxx |    4 +-
 xmlsecurity/source/component/documentdigitalsignatures.hxx |    2 -
 10 files changed, 18 insertions(+), 52 deletions(-)

New commits:
commit c13f13feadcb86c2afb6b433124eb37497240962
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jan 18 09:35:53 2016 +0200

    loplugin: unused return values in writerfilter/
    
    Change-Id: I048fba90319bd164ddd7bf0078b4615092d5f33a
    Reviewed-on: https://gerrit.libreoffice.org/21567
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index dd51988..651fb27 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4849,12 +4849,10 @@ void DomainMapper_Impl::RegisterFrameConversion(
 }
 
 
-bool DomainMapper_Impl::ExecuteFrameConversion()
+void DomainMapper_Impl::ExecuteFrameConversion()
 {
-    bool bRet = false;
     if( m_xFrameStartRange.is() && m_xFrameEndRange.is() && !m_bDiscardHeaderFooter )
     {
-        bRet = true;
         try
         {
             uno::Reference< text::XTextAppendAndConvert > xTextAppendAndConvert( GetTopTextAppend(), uno::UNO_QUERY_THROW );
@@ -4866,13 +4864,11 @@ bool DomainMapper_Impl::ExecuteFrameConversion()
         catch( const uno::Exception& rEx)
         {
             SAL_WARN( "writerfilter", "Exception caught when converting to frame: " + rEx.Message );
-            bRet = false;
         }
     }
     m_xFrameStartRange = nullptr;
     m_xFrameEndRange = nullptr;
     m_aFrameProperties.clear();
-    return bRet;
 }
 
 void DomainMapper_Impl::AddNewRedline( sal_uInt32 sprmId )
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 7aace41..a5e495a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -753,7 +753,7 @@ public:
     void RegisterFrameConversion(css::uno::Reference<css::text::XTextRange> const& xFrameStartRange,
                                  css::uno::Reference<css::text::XTextRange> const& xFrameEndRange,
                                  const std::vector<css::beans::PropertyValue>& aFrameProperties);
-    bool ExecuteFrameConversion();
+    void ExecuteFrameConversion();
 
     void AddNewRedline( sal_uInt32 sprmId );
 
diff --git a/writerfilter/source/dmapper/FormControlHelper.cxx b/writerfilter/source/dmapper/FormControlHelper.cxx
index abcdc9f..22f7bb6 100644
--- a/writerfilter/source/dmapper/FormControlHelper.cxx
+++ b/writerfilter/source/dmapper/FormControlHelper.cxx
@@ -206,9 +206,8 @@ bool FormControlHelper::createCheckbox(uno::Reference<text::XTextRange> const& x
     return true;
 }
 
-bool FormControlHelper::processField(uno::Reference<text::XFormField> const& xFormField)
+void FormControlHelper::processField(uno::Reference<text::XFormField> const& xFormField)
 {
-    bool bRes = true;
     uno::Reference<container::XNameContainer> xNameCont = xFormField->getParameters();
     uno::Reference<container::XNamed> xNamed( xFormField, uno::UNO_QUERY );
     if ( m_pFFData && xNamed.is() && xNameCont.is() )
@@ -255,20 +254,17 @@ bool FormControlHelper::processField(uno::Reference<text::XFormField> const& xFo
             }
         }
     }
-    else
-        bRes = false;
-    return bRes;
 }
 
-bool FormControlHelper::insertControl(uno::Reference<text::XTextRange> const& xTextRange)
+void FormControlHelper::insertControl(uno::Reference<text::XTextRange> const& xTextRange)
 {
     bool bCreated = false;
     if ( !m_pFFData )
-        return false;
+        return;
     uno::Reference<container::XNameContainer> xFormCompsByName(m_pImpl->getForm(), uno::UNO_QUERY);
     uno::Reference<container::XIndexContainer> xFormComps(m_pImpl->getFormComps());
     if (! xFormComps.is())
-        return false;
+        return;
 
     static const char sControl[] = "Control";
 
@@ -300,23 +296,23 @@ bool FormControlHelper::insertControl(uno::Reference<text::XTextRange> const& xT
     }
 
     if (!bCreated)
-        return false;
+        return;
 
     uno::Any aAny(m_pImpl->rFormComponent);
     xFormComps->insertByIndex(xFormComps->getCount(), aAny);
 
     if (! m_pImpl->getServiceFactory().is())
-        return false;
+        return;
 
     uno::Reference<uno::XInterface> xInterface = m_pImpl->getServiceFactory()->createInstance("com.sun.star.drawing.ControlShape");
 
     if (! xInterface.is())
-        return false;
+        return;
 
     uno::Reference<drawing::XShape> xShape(xInterface, uno::UNO_QUERY);
 
     if (! xShape.is())
-        return false;
+        return;
 
     xShape->setSize(m_pImpl->aSize);
 
@@ -340,8 +336,6 @@ bool FormControlHelper::insertControl(uno::Reference<text::XTextRange> const& xT
     xControlShape->setControl(xControlModel);
 
     m_pImpl->getDrawPage()->add(xShape);
-
-    return true;
 }
 
 }}
diff --git a/writerfilter/source/dmapper/FormControlHelper.hxx b/writerfilter/source/dmapper/FormControlHelper.hxx
index ab70695..1e6b858 100644
--- a/writerfilter/source/dmapper/FormControlHelper.hxx
+++ b/writerfilter/source/dmapper/FormControlHelper.hxx
@@ -37,8 +37,8 @@ public:
                       FFDataHandler::Pointer_t pFFData);
     ~FormControlHelper();
 
-    bool insertControl(css::uno::Reference<css::text::XTextRange> const& xTextRange);
-    bool processField(css::uno::Reference<css::text::XFormField> const& xFormField);
+    void insertControl(css::uno::Reference<css::text::XTextRange> const& xTextRange);
+    void processField(css::uno::Reference<css::text::XFormField> const& xFormField);
     bool hasFFDataHandler() const { return (m_pFFData != nullptr); }
 private:
     FFDataHandler::Pointer_t m_pFFData;
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index 9ca93cd..82c6cfd 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -335,23 +335,6 @@ OOXMLValue * OOXMLInputStreamValue::clone() const
     return new OOXMLInputStreamValue(mxInputStream);
 }
 
-/*
-  struct OOXMLPropertySetImplCompare
- */
-
-bool OOXMLPropertySetCompare::operator()(const OOXMLProperty::Pointer_t& x,
-                                         const OOXMLProperty::Pointer_t& y) const
-{
-    bool bResult = false;
-
-    if (x.get() == nullptr && y.get() != nullptr)
-        bResult = true;
-    else if (x.get() != nullptr && y.get() != nullptr)
-        bResult = x->getId() < y->getId();
-
-    return bResult;
-}
-
 /**
    class OOXMLPropertySet
 */
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.hxx b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
index 4af5aec..c7deb52 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.hxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
@@ -138,12 +138,6 @@ public:
     virtual OOXMLValue * clone() const override;
 };
 
-struct OOXMLPropertySetCompare
-{
-    bool operator()(const OOXMLProperty::Pointer_t& x,
-                    const OOXMLProperty::Pointer_t& y) const;
-};
-
 class OOXMLPropertySet : public writerfilter::Reference<Properties>
 {
 public:
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index e19d27e..12d90d4 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -124,7 +124,7 @@ bool RTFSprms::erase(Id nKeyword)
     return false;
 }
 
-bool RTFSprms::eraseLast(Id nKeyword)
+void RTFSprms::eraseLast(Id nKeyword)
 {
     ensureCopyBeforeWrite();
     for (RTFSprms::ReverseIterator_t i = m_pSprms->rbegin(); i != m_pSprms->rend(); ++i)
@@ -132,10 +132,9 @@ bool RTFSprms::eraseLast(Id nKeyword)
         if (i->first == nKeyword)
         {
             m_pSprms->erase(std::next(i).base());
-            return true;
+            return;
         }
     }
-    return false;
 }
 
 static RTFValue::Pointer_t getDefaultSPRM(Id const id)
diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx
index 79b6b38..2479b40 100644
--- a/writerfilter/source/rtftok/rtfsprm.hxx
+++ b/writerfilter/source/rtftok/rtfsprm.hxx
@@ -65,7 +65,7 @@ public:
     /// Does the same as ->push_back(), except that it can overwrite or ignore existing entries.
     void set(Id nKeyword, RTFValue::Pointer_t pValue, RTFOverwrite eOverwrite = RTFOverwrite::YES);
     bool erase(Id nKeyword);
-    bool eraseLast(Id nKeyword);
+    void eraseLast(Id nKeyword);
     /// Removes elements which are already in the reference set.
     /// Also insert default values to override attributes of style
     /// (yes, really; that's what Word does).
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 728c345..754f343 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -204,7 +204,7 @@ OUString DocumentDigitalSignatures::getPackageSignatureDefaultStreamName(  )
 }
 
 
-bool DocumentDigitalSignatures::ImplViewSignatures(
+void DocumentDigitalSignatures::ImplViewSignatures(
     const Reference< css::embed::XStorage >& rxStorage,
     const Reference< css::io::XInputStream >& xSignStream,
     DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException, std::exception)
@@ -212,7 +212,7 @@ bool DocumentDigitalSignatures::ImplViewSignatures(
     Reference< io::XStream > xStream;
     if ( xSignStream.is() )
         xStream.set( xSignStream, UNO_QUERY );
-    return ImplViewSignatures( rxStorage, xStream, eMode, bReadOnly );
+    ImplViewSignatures( rxStorage, xStream, eMode, bReadOnly );
 }
 
 bool DocumentDigitalSignatures::ImplViewSignatures(
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.hxx b/xmlsecurity/source/component/documentdigitalsignatures.hxx
index 1030b6e..9752566 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.hxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.hxx
@@ -53,7 +53,7 @@ private:
     bool m_bHasDocumentSignature;
 
     bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (css::uno::RuntimeException, std::exception);
-    bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException, std::exception);
+    void ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException, std::exception);
     com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > ImplVerifySignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode ) throw (::com::sun::star::uno::RuntimeException);
 
 public:


More information about the Libreoffice-commits mailing list