Kaydet (Commit) 832584ea authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up loplugin:unnecessaryparen blacklist

* rsc/source/parser/rscyacc.cxx no longer exists

* writerfilter/source/rtftok/rtftokenizer.cxx appears to be just fine nowadays?

* sw/source/filter/html/htmltab.cxx used redundant parentheses around a comma
  operator in a while condition, and I see no reason not to remove them (the
  result requires a---reasonable---tweak to loplugin:commaoperator, though)

Change-Id: I451132c700b0ae5a43b03d704156484df897ad5c
Reviewed-on: https://gerrit.libreoffice.org/45213Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 4bae4ebd
......@@ -50,6 +50,14 @@ public:
return ret;
}
bool TraverseWhileStmt(WhileStmt * stmt) {
auto const saved1 = ignore1_;
ignore1_ = lookThroughExprWithCleanups(stmt->getCond());
auto const ret = RecursiveASTVisitor::TraverseWhileStmt(stmt);
ignore1_ = saved1;
return ret;
}
bool TraverseParenExpr(ParenExpr * expr) {
auto const saved1 = ignore1_;
ignore1_ = expr->getSubExpr();
......
......@@ -22,6 +22,7 @@ int main() {
S s;
(s = S(), s = S(), s = S());
for (s = S(), f(); f(); s = S(), f()) {}
while (s = S(), f()) {}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -67,14 +67,6 @@ public:
return;
if (loplugin::isSamePathname(fn, WORKDIR "/YaccTarget/idlc/source/parser.cxx"))
return;
if (loplugin::isSamePathname(fn, WORKDIR "/YaccTarget/rsc/source/parser/rscyacc.cxx"))
return;
// TODO yuck, comma operator at work
if (loplugin::isSamePathname(fn, SRCDIR "/writerfilter/source/rtftok/rtftokenizer.cxx"))
return;
if (loplugin::isSamePathname(fn, SRCDIR "/sw/source/filter/html/htmltab.cxx"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
......
......@@ -1142,7 +1142,7 @@ void HTMLTable::FixRowSpan( sal_uInt16 nRow, sal_uInt16 nCol,
{
sal_uInt16 nRowSpan=1;
HTMLTableCell *pCell;
while( ( pCell=GetCell(nRow,nCol), pCell->GetContents()==pCnts ) )
while( pCell=GetCell(nRow,nCol), pCell->GetContents()==pCnts )
{
pCell->SetRowSpan( nRowSpan );
if( m_pLayoutInfo )
......@@ -1404,7 +1404,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
: (nInnerFrameWidth / 2) );
// We only set the item if there's a border or a border distance
// If the latter is missing, there's gonna be a border and we'll have to set the distance
aBoxItem.SetAllDistances((nBDist) ? nBDist : MIN_BORDER_DIST);
aBoxItem.SetAllDistances(nBDist ? nBDist : MIN_BORDER_DIST);
pFrameFormat->SetFormatAttr( aBoxItem );
}
else
......
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