Kaydet (Commit) e725836e authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unused-returns in filter,tools,xmloff

Change-Id: I7a57be7e241883adac4417baa699a97d6304a631
Reviewed-on: https://gerrit.libreoffice.org/48188Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 73139fe6
......@@ -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 );
}
......
......@@ -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>
......
......@@ -56,8 +56,6 @@ public:
OUString PlainTextFilterDetect_getImplementationName();
bool PlainTextFilterDetect_supportsService(const OUString& ServiceName);
css::uno::Sequence<OUString> PlainTextFilterDetect_getSupportedServiceNames();
#endif
......
......@@ -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) &&
......
......@@ -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
......
......@@ -55,7 +55,7 @@ public:
XMLDashStyleExport( SvXMLExport& rExport );
~XMLDashStyleExport();
bool exportXML( const OUString& rStrName,
void exportXML( const OUString& rStrName,
const css::uno::Any& rValue );
};
......
......@@ -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
......
......@@ -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();
......
......@@ -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
......
......@@ -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 )
......
......@@ -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
......
......@@ -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: */
......@@ -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(
......
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