Cppcheck: duplicateBranch in ParaPropertyPanel.cxx (svx module)

classic Classic list List threaded Threaded
2 messages Options
julien2412 julien2412
Reply | Threaded
Open this post in threaded view
|

Cppcheck: duplicateBranch in ParaPropertyPanel.cxx (svx module)

Hello,

Cppcheck reported this:
<error file="svx/source/sidebar/paragraph/ParaPropertyPanel.cxx" line="309" id="duplicateBranch" severity="style" msg="Found duplicate branches for 'if' and 'else'."/>
<error file="svx/source/sidebar/paragraph/ParaPropertyPanel.cxx" line="328" id="duplicateBranch" severity="style" msg="Found duplicate branches for 'if' and 'else'."/>
Indeed, see http://opengrok.libreoffice.org/xref/core/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx#309
    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     }

    328     if( Application::GetSettings().GetLayoutRTL())
    329     {
    330         mpTbxProDemote->SetItemImage(nIdPromote, maOutLineLeftControl.GetIcon());
    331         mpTbxProDemote->SetItemImage(nIdDemote, maOutLineRightControl.GetIcon());
    332     }
    333     else
    334     {
    335         mpTbxProDemote->SetItemImage(nIdPromote, maOutLineLeftControl.GetIcon());
    336         mpTbxProDemote->SetItemImage(nIdDemote, maOutLineRightControl.GetIcon());
    337     }

Any idea how it should be?

Julien
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: Cppcheck: duplicateBranch in ParaPropertyPanel.cxx (svx module)

On Mon, 2013-07-29 at 13:12 -0700, julien2412 wrote:

> Hello,
>
> Cppcheck reported this:
> <error file="svx/source/sidebar/paragraph/ParaPropertyPanel.cxx" line="309"
> id="duplicateBranch" severity="style" msg="Found duplicate branches for 'if'
> and 'else'."/>
> <error file="svx/source/sidebar/paragraph/ParaPropertyPanel.cxx" line="328"
> id="duplicateBranch" severity="style" msg="Found duplicate branches for 'if'
> and 'else'."/>
> Any idea how it should be?

Now having checked in LTR mode and RTL mode I'm happy enough to just
remove the duplication of the branches and I checked that in now.

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice