cppcheck: duplicate branch for ParaPropertyPanel (svx)
Ivan Timofeev
timofeev.i.s at gmail.com
Fri Sep 27 23:57:09 PDT 2013
On 28.09.2013 01:52, julien2412 wrote:
> svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
> 309 duplicateBranch style Found duplicate branches for 'if' and 'else'.
> 328 duplicateBranch style Found duplicate branches for 'if' and 'else'.
> Indeed:
> 309 if( Application::GetSettings().GetLayoutRTL())
> 310 {
> 311 mpTbxIndent_IncDec->SetItemImage(nIdIncrement,
> maIncIndentControl.GetIcon());
> 312 mpTbxIndent_IncDec->SetItemImage(nIdDecrement,
> maDecIndentControl.GetIcon());
> 313 }
> 314 else
> 315 {
> 316 mpTbxIndent_IncDec->SetItemImage(nIdIncrement,
> maIncIndentControl.GetIcon());
> 317 mpTbxIndent_IncDec->SetItemImage(nIdDecrement,
> maDecIndentControl.GetIcon());
> 318 }
>
> (the same for part around line 328)
> See
> http://opengrok.libreoffice.org/xref/core/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx#309
Hi Julien,
The condition does not make sense - it should check for a text
direction, not UI direction. The code itself does not make sense too -
the images are swapped, but the tooltips are not... :)
So you can remove the duplicate branches.
Regards,
Ivan
More information about the LibreOffice
mailing list