[Libreoffice] Same expression on both sides of '||' in svtools/source/filter/sgvtext.cxx

julien2412 serval2412 at yahoo.fr
Mon Jan 30 11:24:18 PST 2012


Hello,

Here is a report of cppcheck :
core/svtools/source/filter/sgvtext.cxx
365	duplicateExpression	style	Same expression on both sides of '||'.

Here is the line :
            if (c==EscSet || c==EscReset || c==EscDeflt || c==EscToggl)
FlgVal=c; else {<--- Same expression on both sides of '||'.

At first sight, there's no same expression but if we go further, we can see
this :
    139 #define  EscSet    '' /* Flag setzen                                              
*/
    140 #define  EscReset  '' /* Flag loeschen                                            
*/
    141 #define  EscDeflt  '\x11' /* Flag auf default setzen                               
*/
    142 #define  EscToggl  '' /* Flag Toggeln                                             
*/
    143 #define  EscRelat  '%'
    144 #define  EscNoFlg  0
    145 #define  EscNoVal  -2147483647 /* -MaxLongInt */

Now why EscSet = EscReset = EscToggl ?
I took a look at the git history and found the commit
9e5584a82633442467a53ccc08c3380070178a38 included something about "EscSet".
I tried to copy paste here to show you and had empty values (whereas it's
not empty at all !) :
+ #define  EscSet    '
' /* Flag setzen                                              
*/
+ #define  EscReset  '' /* Flag loeschen                                            
*/
+ #define  EscDeflt  '\x11' /* Flag auf default setzen                               
*/
+ #define  EscToggl  '
' /* Flag Toggeln                                             
*/
+ #define  EscRelat  '%'
+ #define  EscNoFlg  0
+ #define  EscNoVal  -2147483647 /* -MaxLongInt */

Special characters/encoding problem ?

Julien.


--
View this message in context: http://nabble.documentfoundation.org/Same-expression-on-both-sides-of-in-svtools-source-filter-sgvtext-cxx-tp3700983p3700983.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list