diff options
49 files changed, 203 insertions, 277 deletions
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx index 35e3f9210563..77cc0e18fab0 100644 --- a/accessibility/source/standard/vclxaccessiblebox.cxx +++ b/accessibility/source/standard/vclxaccessiblebox.cxx @@ -489,10 +489,6 @@ sal_Bool VCLXAccessibleBox::setCurrentValue( const Any& aNumber ) OUString fValue; bool bValid = (aNumber >>= fValue); - if( bValid ) - { - - } return bValid; } diff --git a/avmedia/source/viewer/mediaevent_impl.cxx b/avmedia/source/viewer/mediaevent_impl.cxx index fac08d070870..100bb0d83466 100644 --- a/avmedia/source/viewer/mediaevent_impl.cxx +++ b/avmedia/source/viewer/mediaevent_impl.cxx @@ -125,23 +125,11 @@ void SAL_CALL MediaEventListenersImpl::mouseReleased( const css::awt::MouseEvent void SAL_CALL MediaEventListenersImpl::mouseEntered( const css::awt::MouseEvent& ) { - const ::osl::MutexGuard aGuard( maMutex ); - const SolarMutexGuard aAppGuard; - - if( mpNotifyWindow ) - { - } } void SAL_CALL MediaEventListenersImpl::mouseExited( const css::awt::MouseEvent& ) { - const ::osl::MutexGuard aGuard( maMutex ); - const SolarMutexGuard aAppGuard; - - if( mpNotifyWindow ) - { - } } diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx index 6af00166696e..3efa5d01a8b6 100644 --- a/basctl/source/basicide/basicbox.cxx +++ b/basctl/source/basicide/basicbox.cxx @@ -484,12 +484,6 @@ bool LanguageBox::PreNotify( NotifyEvent& rNEvt ) break; } } - else if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS ) - { - } - else if( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS ) - { - } return bDone || ListBox::PreNotify( rNEvt ); } diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 00135960566a..5dde5c181cdb 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -285,11 +285,7 @@ namespace basctl ,m_bDocumentClosed( false ) { if ( _rxDocument.is() ) - { - if ( impl_initDocument_nothrow( _rxDocument ) ) - { - } - } + impl_initDocument_nothrow( _rxDocument ); } ScriptDocument::Impl::~Impl() diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx index bee658a586d5..1831eb71d1e3 100644 --- a/basic/qa/cppunit/basic_coverage.cxx +++ b/basic/qa/cppunit/basic_coverage.cxx @@ -127,9 +127,6 @@ void Coverage::process_directory(const OUString& sDirName) } } } - else - { - } fprintf(stderr,"end process directory\n"); } diff --git a/compilerplugins/clang/emptyif.cxx b/compilerplugins/clang/emptyif.cxx new file mode 100644 index 000000000000..d9348e660378 --- /dev/null +++ b/compilerplugins/clang/emptyif.cxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <cassert> +#include <string> +#include <iostream> +#include <fstream> +#include <set> +#include "plugin.hxx" + +/** + Check for places where we do + if (xxx) ; + or + if (xxx) {} + */ +namespace +{ +class EmptyIf : public RecursiveASTVisitor<EmptyIf>, public loplugin::RewritePlugin +{ +public: + explicit EmptyIf(loplugin::InstantiationData const& data) + : RewritePlugin(data) + { + } + + virtual void run() override + { + StringRef fn(compiler.getSourceManager() + .getFileEntryForID(compiler.getSourceManager().getMainFileID()) + ->getName()); + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } + + bool VisitIfStmt(IfStmt const*); + +private: + bool ContainsComment(Stmt const*); +}; + +static bool empty(Stmt const* stmt) +{ + if (isa<NullStmt>(stmt)) + return true; + auto compoundStmt = dyn_cast<CompoundStmt>(stmt); + if (!compoundStmt) + return false; + return compoundStmt->size() == 0; +} + +bool EmptyIf::ContainsComment(Stmt const* stmt) +{ + auto range = stmt->getSourceRange(); + SourceManager& SM = compiler.getSourceManager(); + SourceLocation startLoc = range.getBegin(); + SourceLocation endLoc = range.getEnd(); + char const* p1 = SM.getCharacterData(startLoc); + char const* p2 = SM.getCharacterData(endLoc); + p2 += Lexer::MeasureTokenLength(endLoc, SM, compiler.getLangOpts()); + auto s = llvm::StringRef(p1, p2 - p1); + return s.find("//") != llvm::StringRef::npos || s.find("/*") != llvm::StringRef::npos + || s.find("#if") != llvm::StringRef::npos; +} + +bool EmptyIf::VisitIfStmt(IfStmt const* ifStmt) +{ + if (ignoreLocation(ifStmt)) + return true; + + if (ifStmt->getElse() && empty(ifStmt->getElse()) && !ContainsComment(ifStmt->getElse())) + { + report(DiagnosticsEngine::Warning, "empty else body", ifStmt->getElse()->getLocStart()) + << ifStmt->getElse()->getSourceRange(); + return true; + } + + if (!ifStmt->getElse() && empty(ifStmt->getThen()) && !ContainsComment(ifStmt->getThen())) + { + report(DiagnosticsEngine::Warning, "empty if body", ifStmt->getLocStart()) + << ifStmt->getSourceRange(); + } + + return true; +} + +loplugin::Plugin::Registration<EmptyIf> X("emptyif", true); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/compilerplugins/clang/test/emptyif.cxx b/compilerplugins/clang/test/emptyif.cxx new file mode 100644 index 000000000000..15dd79627b1f --- /dev/null +++ b/compilerplugins/clang/test/emptyif.cxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +int main() +{ + int x = 1; + + if (x == 1) // expected-error {{empty if body [loplugin:emptyif]}} + ; + + if (x == 1) + { + } + // expected-error@-3 {{empty if body [loplugin:emptyif]}} + + if (x == 1) + { + } + else + { + } + // expected-error@-2 {{empty else body [loplugin:emptyif]}} + + if (x == 1) + { + } + else + ; // expected-error {{empty else body [loplugin:emptyif]}} + + if (x == 1) + { + } + else + { + x = 2; + } + + // no warning expected + if (x == 1) + { + x = 3; + } + if (x == 1) + x = 3; + if (x == 1) + { + // + } + if (x == 1) + { + /* */ + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 2124e3366b08..b94ab42d4617 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -382,11 +382,6 @@ void OTableHelper::refreshForeignKeys(::std::vector< OUString>& _rNames) const sal_Int32 nDeleteRule = xRow->getInt(11); const OUString sFkName = xRow->getString(12); - if ( pKeyProps.get() ) - { - } - - if ( !sFkName.isEmpty() && !xRow->wasNull() ) { if ( sOldFKName != sFkName ) diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index ac64032aaa7b..d1cf3b4673dd 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -305,13 +305,6 @@ namespace dbtools OUString sSql = "SELECT * FROM x WHERE " + sField + _rPredicateValue; std::unique_ptr<OSQLParseNode> pParseNode( const_cast< OSQLParser& >( m_aParser ).parseTree( sError, sSql, true ) ); nType = DataType::DOUBLE; - if ( pParseNode.get() ) - { - OSQLParseNode* pColumnRef = pParseNode->getByRule(OSQLParseNode::column_ref); - if ( pColumnRef ) - { - } - } } Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index 49dd1ae14d09..3cba65cbf1af 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -166,9 +166,6 @@ BackendImpl::BackendImpl( "Scripting Framework Script Library" ) ) { - if (! transientMode()) - { - } } diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 2320e7cd993b..522587dea6b7 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -498,9 +498,6 @@ void UpdateHandler::updateState( UpdateState eState ) if ( meLastState == eState ) return; - if ( isVisible() ) - {} // ToTop(); - OUString sText; switch ( eState ) diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index 5fe936c0384c..5e066bc65127 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -457,11 +457,6 @@ void CGM::ImplMapDouble( double& nNumb ) break; } } - else - { - - - } } void CGM::ImplMapX( double& nNumb ) @@ -497,11 +492,6 @@ void CGM::ImplMapX( double& nNumb ) break; } } - else - { - - - } } void CGM::ImplMapY( double& nNumb ) @@ -537,11 +527,6 @@ void CGM::ImplMapY( double& nNumb ) break; } } - else - { - - - } } // convert a point to the current VC mapmode (1/100TH mm) @@ -582,11 +567,6 @@ void CGM::ImplMapPoint( FloatPoint& rFloatPoint ) break; } } - else - { - - - } } void CGM::ImplDoClass() diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx index 177a7de9abeb..a22968e5be7a 100644 --- a/hwpfilter/source/lexer.cxx +++ b/hwpfilter/source/lexer.cxx @@ -1011,7 +1011,7 @@ YY_MALLOC_DECL /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (false) +#define ECHO do { fwrite( yytext, yyleng, 1, yyout ); } while (false) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx index 2c40821cc179..553f2369a244 100644 --- a/lotuswordpro/source/filter/lwpmarker.cxx +++ b/lotuswordpro/source/filter/lwpmarker.cxx @@ -261,9 +261,7 @@ void LwpCHBlkMarker::ProcessKeylist(XFContentContainer* pXFPara,sal_uInt8 nType) pList->SetLabels(m_Keylist); pXFPara->Add(pList); } - else if (nType == MARKER_END)//skip - { - } + // else skip MARKER_END } else { diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx index 0f21f6449a7e..b220755984c5 100644 --- a/oox/source/ppt/buildlistcontext.cxx +++ b/oox/source/ppt/buildlistcontext.cxx @@ -59,9 +59,6 @@ namespace oox { namespace ppt { } return this; case PPT_TOKEN( bldSub ): - if( mbInBldGraphic ) - { - } return this; case PPT_TOKEN( bldGraphic ): { diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 943d6ecbdf34..120d00537962 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -890,9 +890,6 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) { eToken = XML_SUB_DOCUMENT; } - else if ( xSection.is() ) - { - } if ( bExportData ) { diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index e14c979ea9e5..08e4dda48eb0 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -1578,11 +1578,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > break; case SID_EXPORTDOC: case SID_EXPORTDOCASPDF: - break; case SID_PRINTPREVIEW: - if ( m_xReportDefinition.is() ) - { - } break; case SID_EDITDOC: if(isEditable()) diff --git a/sc/source/core/opencl/op_addin.cxx b/sc/source/core/opencl/op_addin.cxx index 6a9ef06ed9a1..8b906ae5938a 100644 --- a/sc/source/core/opencl/op_addin.cxx +++ b/sc/source/core/opencl/op_addin.cxx @@ -220,9 +220,7 @@ void OpGestep::GenSlidingWindowFunction( { ss << " {\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index cec37d9a5dd0..3d4691f26047 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -124,9 +124,7 @@ vSubArguments) { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss <<" temp="<<vSubArguments[i]->GenSlidingWindowDeclRef(); @@ -2334,9 +2332,7 @@ void OpPMT::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss <<" temp="<<vSubArguments[i]->GenSlidingWindowDeclRef(); @@ -2528,9 +2524,7 @@ void OpPrice::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -2626,9 +2620,7 @@ void OpOddlprice::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -2725,9 +2717,7 @@ void OpOddlyield::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -2805,9 +2795,7 @@ void OpPriceDisc::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -2867,9 +2855,7 @@ void OpNper::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -2944,9 +2930,7 @@ void OpPPMT::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " arg="; diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index eb9a740bb09a..04ca06b2e27d 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -159,9 +159,7 @@ void OpMROUND::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " tmp="; diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx index 762ab2a275a5..524eb5ca012e 100644 --- a/sc/source/core/opencl/op_statistical.cxx +++ b/sc/source/core/opencl/op_statistical.cxx @@ -1156,9 +1156,7 @@ void OpExponDist::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -1245,9 +1243,7 @@ void OpFdist::GenSlidingWindowFunction(std::stringstream &ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -3198,9 +3194,7 @@ void OpNegbinomdist::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -3694,9 +3688,7 @@ void OpConfidence::GenSlidingWindowFunction(std::stringstream& ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -3768,9 +3760,7 @@ void OpCritBinom::GenSlidingWindowFunction(std::stringstream& ss, { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -3996,9 +3986,7 @@ void OpChiInv::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << "if (isnan("; @@ -4121,9 +4109,7 @@ void OpNormsdist::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -4181,9 +4167,7 @@ void OpPermut::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -4291,9 +4275,7 @@ void OpPhi::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -4350,9 +4332,7 @@ void OpNorminv::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -4562,9 +4542,7 @@ void OpNormsinv:: GenSlidingWindowFunction { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -5761,9 +5739,7 @@ void OpChiDist::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -5871,9 +5847,7 @@ void OpBinomdist::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -6803,9 +6777,7 @@ void OpPoisson::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -7347,10 +7319,7 @@ void OpBetainv::GenSlidingWindowFunction( { ss << "{\n"; } - else - { - } if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { ss << " if (isnan("; @@ -7771,9 +7740,6 @@ void OpMinA::GenSlidingWindowFunction( ss << " {\n"; isMixed = svDoubleDouble; } - else - { - } if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { @@ -7921,9 +7887,6 @@ vSubArguments) ss << " {\n"; isMixed = svDoubleDouble; } - else - { - } if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { @@ -8060,9 +8023,6 @@ vSubArguments) ss << " {\n"; isMixed = svDoubleDouble; } - else - { - } if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { @@ -8210,9 +8170,6 @@ vSubArguments) ss << " {\n"; isMixed = svDoubleDouble; } - else - { - } if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) { diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 7576c3b9f020..37d04b4e432e 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1851,9 +1851,7 @@ void ScRange::ParseRows( const OUString& rStr, { if( p[0] == ':') { - if( nullptr != (p = lcl_a1_get_row( p+1, &aEnd, &ignored, nullptr))) - { - } + p = lcl_a1_get_row( p+1, &aEnd, &ignored, nullptr); } else { @@ -1868,9 +1866,9 @@ void ScRange::ParseRows( const OUString& rStr, { if( p[0] == ':') { - if( (p[1] == 'R' || p[1] == 'r') && - nullptr != (p = lcl_r1c1_get_row( p+1, rDetails, &aEnd, &ignored ))) + if( p[1] == 'R' || p[1] == 'r' ) { + p = lcl_r1c1_get_row( p+1, rDetails, &aEnd, &ignored ); } } else diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 3f29d5256688..b5b39510ed76 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -171,11 +171,6 @@ void ExtConditionalFormattingContext::onEndElement() rExtFormats.push_back(o3tl::make_unique<ExtCfCondFormat>(aRange, maEntries)); } break; - case XLS14_TOKEN(cfRule): - if (mpCurrentRule) - { - } - break; default: break; } diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index 8d0f4591d4f3..14d2f613b464 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -62,7 +62,6 @@ private: protected: virtual void Activate(bool bMDI) override; - virtual void Deactivate(bool bMDI) override; virtual void AdjustPosSizePixel( const Point &rPos, const Size &rSize ) override; virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override; diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 2bab27e4f3c1..bf6f282aa4e1 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -543,15 +543,6 @@ void ScPreviewShell::Activate(bool bMDI) } } -void ScPreviewShell::Deactivate(bool bMDI) -{ - SfxViewShell::Deactivate(bMDI); - - if (bMDI) - { - } -} - void ScPreviewShell::Execute( SfxRequest& rReq ) { sal_uInt16 nSlot = rReq.GetSlot(); diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index 1aba21d2cf9a..874a22464c7a 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -398,9 +398,6 @@ void ScTabControl::UpdateStatus() for (i=0; i<nCount; i++) SelectPage( static_cast<sal_uInt16>(i)+1, rMark.GetTableSelect(i) ); } - else - { - } } void ScTabControl::SetSheetLayoutRTL( bool bSheetRTL ) diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 2b31c3024800..f7503752280d 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -113,10 +113,6 @@ void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialog* pDialog) SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); } - else - { - - } } VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 01bdde01703a..3c39ec67961f 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -915,13 +915,6 @@ void AnimationImporter::fillNode( Reference< XAnimationNode > const & xNode, con } // TODO: DFF_ANIM_PATH_EDIT_MODE - if( rSet.hasProperty( DFF_ANIM_PATH_EDIT_MODE ) ) - { - sal_Int32 nPathEditMode ; - if( rSet.getProperty( DFF_ANIM_PATH_EDIT_MODE ) >>= nPathEditMode ) - { - } - } // set user data Sequence< NamedValue > aUserData; diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index 6f1116916cd3..b9b52738a0b1 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -491,9 +491,6 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj) OUString aStr(SdResId(STR_LAYER_MEASURELINES)); pObj->SetLayer(rAdmin.GetLayerID(aStr)); } - else if (nSlotId == OBJ_CUSTOMSHAPE ) - { - } } /** diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 34b25bea7e16..a7f8412d5d82 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -365,9 +365,6 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) pPresDlg.disposeAndReset(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), bBackground, *pStyleSheet, ePO, pSSPool ) : nullptr); } } - else if (eFamily == SD_STYLE_FAMILY_CELL) - { - } sal_uInt16 nResult = RET_CANCEL; const SfxItemSet* pOutSet = nullptr; diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index bd5271954aa8..7652ee526694 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -343,11 +343,6 @@ SdPage* SlideSorterViewShell::GetActualPage() pCurrentPage = pDescriptor->GetPage(); } - if (pCurrentPage == nullptr) - { - - } - return pCurrentPage; } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index dc2e7e47e882..fc1e0753c308 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1842,10 +1842,8 @@ void SfxCommonTemplateDialog_Impl::EditHdl() sal_uInt16 nFilter = nActFilter; OUString aTemplName(GetSelectedEntry()); GetSelectedStyle(); // -Wall required?? - if ( Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(), - static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()), 0, &nFilter ) ) - { - } + Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(), + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()), 0, &nFilter ); } } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index a9692634b662..328f3e353b07 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -821,9 +821,6 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed ) ) FinishedLoading( SfxLoadedFlags::MAINDOCUMENT ); - if( IsOwnStorageFormat(*pMed) && pMed->GetFilter() ) - { - } Broadcast( SfxHint(SfxHintId::NameChanged) ); if ( SfxObjectCreateMode::EMBEDDED != eCreateMode ) diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk index 29a6651cdb79..2e5d878a9be6 100644 --- a/solenv/CompilerTest_compilerplugins_clang.mk +++ b/solenv/CompilerTest_compilerplugins_clang.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \ compilerplugins/clang/test/cstylecast \ compilerplugins/clang/test/datamembershadow \ compilerplugins/clang/test/dodgyswitch \ + compilerplugins/clang/test/emptyif \ compilerplugins/clang/test/externvar \ compilerplugins/clang/test/expressionalwayszero \ compilerplugins/clang/test/faileddyncast \ diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index be6aa1bf2d36..31382eed3f42 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -843,9 +843,6 @@ namespace // continue with children traverse(xStorage, rBuf); } - else - { - } } } } diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 6088a65e266b..551687c6f4ab 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -1000,20 +1000,17 @@ Any SAL_CALL ImplIntrospectionAccess::queryInterface( const Type& rType ) if( !aRet.hasValue() ) { // Wrapper for the object interfaces - if( ( mpStaticImpl->mbElementAccess && (aRet = ::cppu::queryInterface + ( mpStaticImpl->mbElementAccess && (aRet = ::cppu::queryInterface ( rType, static_cast< XElementAccess* >( static_cast< XNameAccess* >( this ) ) ) ).hasValue() ) - || ( mpStaticImpl->mbNameAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XNameAccess* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbNameReplace && (aRet = ::cppu::queryInterface( rType, static_cast< XNameReplace* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbNameContainer && (aRet = ::cppu::queryInterface( rType, static_cast< XNameContainer* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbIndexAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexAccess* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbIndexReplace && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexReplace* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbIndexContainer && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexContainer* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbEnumerationAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XEnumerationAccess* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbIdlArray && (aRet = ::cppu::queryInterface( rType, static_cast< XIdlArray* >( this ) ) ).hasValue() ) - || ( mpStaticImpl->mbUnoTunnel && (aRet = ::cppu::queryInterface( rType, static_cast< XUnoTunnel* >( this ) ) ).hasValue() ) - ) - { - } + || ( mpStaticImpl->mbNameAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XNameAccess* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbNameReplace && (aRet = ::cppu::queryInterface( rType, static_cast< XNameReplace* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbNameContainer && (aRet = ::cppu::queryInterface( rType, static_cast< XNameContainer* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbIndexAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexAccess* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbIndexReplace && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexReplace* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbIndexContainer && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexContainer* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbEnumerationAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XEnumerationAccess* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbIdlArray && (aRet = ::cppu::queryInterface( rType, static_cast< XIdlArray* >( this ) ) ).hasValue() ) + || ( mpStaticImpl->mbUnoTunnel && (aRet = ::cppu::queryInterface( rType, static_cast< XUnoTunnel* >( this ) ) ).hasValue() ); } return aRet; } diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 2d1036918eb0..71fb67b21a3f 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -868,8 +868,6 @@ bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) rAny >>= nSet; if(nSet < css::style::NumberingType::NUMBER_NONE ) SetFormat(nSet); - else { - } } break; case FIELD_PROP_FORMAT: diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 47a7463b298e..8bc6e6912543 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -275,8 +275,6 @@ bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) // TODO: where do the defines come from? if(nSet <= SVX_NUM_PAGEDESC ) SetFormat(nSet); - else { - } break; case FIELD_PROP_USHORT1: rAny >>= nSet; @@ -2381,8 +2379,6 @@ bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) rAny >>= nSet; if(nSet <= SVX_NUM_PAGEDESC ) SetFormat(nSet); - else { - } } break; case FIELD_PROP_PAR1: diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx index 52d5172b08ff..68dc9bd1c5df 100644 --- a/sw/source/core/para/paratr.cxx +++ b/sw/source/core/para/paratr.cxx @@ -179,8 +179,6 @@ bool SwFormatDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) nChars = pDrop->Count; nDistance = convertMm100ToTwip(pDrop->Distance); } - else { - } } break; case MID_DROPCAP_WHOLE_WORD: diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 757a08378df4..cece99430a9a 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -2008,10 +2008,6 @@ void SwHTMLWriter::AddLinkTarget( const OUString& rURL ) m_aOutlineMarks.insert( m_aOutlineMarks.begin()+nIns, aURL ); } } - else if( sCmp == "text" ) - { - - } } void SwHTMLWriter::CollectLinkTargets() diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 3782b92bf1c1..77890e3b27fc 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -453,13 +453,10 @@ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, Button*, pButton, void) // will automatically close if it was the las reference VclPtr<SwCreateAddressListDialog> pDlg( VclPtr<SwCreateAddressListDialog>::Create( - pButton, pUserData->sURL, m_pAddressPage->GetWizard()->GetConfigItem())); - if(RET_OK == pDlg->Execute()) - { - } + pDlg->Execute(); } }; diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 0cd368d5eb98..cfd94f281ef1 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -72,10 +72,6 @@ void SwInsFootNoteDlg::Apply() rSh.EndUndo( SwUndoId::END ); rSh.EndAction(); } - else - { - - } bFootnote = m_pFootnoteBtn->IsChecked(); } diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 6fee4959d27c..76d2a0eee08b 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -812,9 +812,6 @@ bool NavElementBox_Impl::EventNotify( NotifyEvent& rNEvt ) break; } } - else if( MouseNotifyEvent::LOSEFOCUS == rNEvt.GetType() ) - { - } return bHandled || ListBox::EventNotify( rNEvt ); } diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index 70cbb0994e6b..849511797d45 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -320,8 +320,6 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void ) { pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_IMAGE1)); } - else - {} } while(pSh->Right(sal_uInt16(1), sal_uInt16(1), true)); } diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index e080dcdb51a8..c092ecd7ae72 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -1603,10 +1603,6 @@ void TextView::ImpShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bSpec TETextPortion* pTextPortion = pParaPortion->GetTextPortions()[ nTextPortion ]; if ( pTextPortion->GetKind() == PORTIONKIND_TAB ) { - if ( mpImpl->mpTextEngine->IsRightToLeft() ) - { - - } aEditCursor.Right() += pTextPortion->GetWidth(); } else diff --git a/vcl/source/filter/jpeg/transupp.c b/vcl/source/filter/jpeg/transupp.c index 72dba281b578..aa126f03f9be 100644 --- a/vcl/source/filter/jpeg/transupp.c +++ b/vcl/source/filter/jpeg/transupp.c @@ -1533,7 +1533,7 @@ jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, * But to avoid confusion, we do not output JFIF and Adobe APP14 markers * if the encoder library already wrote one. */ - if (option) {} + (void)option; for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) { if (dstinfo->write_JFIF_header && diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 2e404df6c2d7..7b8d0b287b18 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -832,7 +832,7 @@ void TabPageUIObject::execute(const OUString& rAction, { if (rAction == "SELECT") { - + /* code */ } } @@ -999,6 +999,7 @@ void SpinUIObject::execute(const OUString& rAction, } else if (rAction == "DOWN") { + /* code */ } } diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 58914dd83fdc..5cf138c4f2e7 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -977,11 +977,6 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) { maFrameData.mnHelpState &= ~DrawButtonFlags::Pressed; pBorderWindow->InvalidateBorder(); - - // do not call a Click-Handler when aborting - if ( !rTEvt.IsTrackingCanceled() ) - { - } } } else diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 44287d6ee681..ee3533bc134e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3462,11 +3462,7 @@ void DomainMapper_Impl::handleToc } } // \p Defines the separator between the table entry and its page number - if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue )) - { } // \s Builds a table of contents by using a sequence type - if( lcl_FindInCommand( pContext->GetCommand(), 's', sValue )) - { } // \t Builds a table of contents by using style names other than the standard outline styles if( lcl_FindInCommand( pContext->GetCommand(), 't', sValue )) { |