Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hello,

Cppcheck reported this:
sc/source/core/tool/interpr7.cxx
94      duplicateBranch style   Found duplicate branches for 'if' and 'else'.

     87                         if(pNodeSet->nodeTab[0]->type ==
XML_NAMESPACE_DECL)
     88                         {
     89                             xmlNsPtr ns =
(xmlNsPtr)pNodeSet->nodeTab[0];
     90                             xmlNodePtr cur = (xmlNodePtr)ns->next;
     91                             boost::shared_ptr<xmlChar>
pChar2(xmlNodeGetContent(cur), xmlFree);
     92                             aResult =
OUString::createFromAscii((char*)pChar2.get());
     93                         }
     94                         else if(pNodeSet->nodeTab[0]->type ==
XML_ELEMENT_NODE)
     95                         {
     96                             xmlNodePtr cur = pNodeSet->nodeTab[0];
     97                             boost::shared_ptr<xmlChar>
pChar2(xmlNodeGetContent(cur), xmlFree);
     98                             aResult =
OUString::createFromAscii((char*)pChar2.get());
     99                         }
    100                         else
    101                         {
    102                             xmlNodePtr cur = pNodeSet->nodeTab[0];
    103                             boost::shared_ptr<xmlChar>
pChar2(xmlNodeGetContent(cur), xmlFree);
    104                             aResult =
OUString::createFromAscii((char*)pChar2.get());
    105                         }

See
http://opengrok.libreoffice.org/xref/core/sc/source/core/tool/interpr7.cxx#87

and this:
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

I suppose it should be fixed but I don't know how.
Any idea?

Julien




--
View this message in context: 
http://nabble.documentfoundation.org/cppcheck-duplicate-branch-for-ParaPropertyPanel-svx-interpr7-cxx-sc-tp4075486.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.