diff options
author | Noel Grandin <noel@peralex.com> | 2016-01-18 09:35:53 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-01-18 08:37:55 +0000 |
commit | c13f13feadcb86c2afb6b433124eb37497240962 (patch) | |
tree | 8ceb60a57ab4159e9e5dd4328263127351e7c515 /writerfilter/source | |
parent | aa6c54f337a616c9ca6a39cfc8708657018d8613 (diff) |
loplugin: unused return values in writerfilter/
Change-Id: I048fba90319bd164ddd7bf0078b4615092d5f33a
Reviewed-on: https://gerrit.libreoffice.org/21567
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/FormControlHelper.cxx | 22 | ||||
-rw-r--r-- | writerfilter/source/dmapper/FormControlHelper.hxx | 4 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLPropertySet.cxx | 17 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLPropertySet.hxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsprm.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsprm.hxx | 2 |
8 files changed, 15 insertions, 49 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index dd51988a62d0..651fb275bae2 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 7aace410c990..a5e495a3de06 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 abcdc9f680c0..22f7bb6b29a7 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 ab70695f80d9..1e6b85877097 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 9ca93cddd1fd..82c6cfd0bf93 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 4af5aec6c1ea..c7deb523163d 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 e19d27e7b0ec..12d90d4bd921 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 79b6b38a83e8..2479b407c7ab 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). |