Kaydet (Commit) c13f13fe authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin: unused return values in writerfilter/

Change-Id: I048fba90319bd164ddd7bf0078b4615092d5f33a
Reviewed-on: https://gerrit.libreoffice.org/21567Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst aa6c54f3
......@@ -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 )
......
......@@ -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 );
......
......@@ -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;
}
}}
......
......@@ -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;
......
......@@ -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
*/
......
......@@ -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:
......
......@@ -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)
......
......@@ -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).
......
......@@ -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(
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment