[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - vcl/unx

Takeshi Abe tabe at fixedpoint.jp
Sat Jan 14 23:17:52 UTC 2017


 vcl/unx/gtk/a11y/atktextattributes.cxx |   32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

New commits:
commit f6b6feb435ac5420559f8dd6cbb09421ba90e5a7
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Sun Jan 15 06:10:49 2017 +0900

    vcl: Fix string comparison for reading text attributes
    
    The original code seems to do the opposite.
    
    Change-Id: Ib112bcd14338cef84c562e4a670bcb1fcc06583e
    Reviewed-on: https://gerrit.libreoffice.org/33080
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 99eed82939999d9a9689788a4134dd05d5c20c5a)
    Reviewed-on: https://gerrit.libreoffice.org/33081

diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx
index c31fccd..51c9618 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.cxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.cxx
@@ -339,15 +339,15 @@ Style2FontSlant( uno::Any& rAny, const gchar * value )
 {
     awt::FontSlant aFontSlant;
 
-    if( strncmp( value, STRNCMP_PARAM( "normal" ) ) )
+    if( strncmp( value, STRNCMP_PARAM( "normal" ) ) == 0 )
         aFontSlant = awt::FontSlant_NONE;
-    else if( strncmp( value, STRNCMP_PARAM( "oblique" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "oblique" ) ) == 0 )
         aFontSlant = awt::FontSlant_OBLIQUE;
-    else if( strncmp( value, STRNCMP_PARAM( "italic" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "italic" ) ) == 0 )
         aFontSlant = awt::FontSlant_ITALIC;
-    else if( strncmp( value, STRNCMP_PARAM( "reverse oblique" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "reverse oblique" ) ) == 0 )
         aFontSlant = awt::FontSlant_REVERSE_OBLIQUE;
-    else if( strncmp( value, STRNCMP_PARAM( "reverse italic" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "reverse italic" ) ) == 0 )
         aFontSlant = awt::FontSlant_REVERSE_ITALIC;
     else
         return false;
@@ -417,13 +417,13 @@ Justification2Adjust( uno::Any& rAny, const gchar * value )
 {
     short nParagraphAdjust;
 
-    if( strncmp( value, STRNCMP_PARAM( "left" ) ) )
+    if( strncmp( value, STRNCMP_PARAM( "left" ) ) == 0 )
         nParagraphAdjust = style::ParagraphAdjust_LEFT;
-    else if( strncmp( value, STRNCMP_PARAM( "right" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "right" ) ) == 0 )
         nParagraphAdjust = style::ParagraphAdjust_RIGHT;
-    else if( strncmp( value, STRNCMP_PARAM( "fill" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "fill" ) ) == 0 )
         nParagraphAdjust = style::ParagraphAdjust_BLOCK;
-    else if( strncmp( value, STRNCMP_PARAM( "center" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "center" ) ) == 0 )
         nParagraphAdjust = style::ParagraphAdjust_CENTER;
     else
         return false;
@@ -509,11 +509,11 @@ String2Underline( uno::Any& rAny, const gchar * value )
 {
     short nUnderline;
 
-    if( strncmp( value, STRNCMP_PARAM( "none" ) ) )
+    if( strncmp( value, STRNCMP_PARAM( "none" ) ) == 0 )
         nUnderline = awt::FontUnderline::NONE;
-    else if( strncmp( value, STRNCMP_PARAM( "single" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "single" ) ) == 0 )
         nUnderline = awt::FontUnderline::SINGLE;
-    else if( strncmp( value, STRNCMP_PARAM( "double" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "double" ) ) == 0 )
         nUnderline = awt::FontUnderline::DOUBLE;
     else
         return false;
@@ -597,9 +597,9 @@ String2Bool( uno::Any& rAny, const gchar * value )
 {
     bool bValue;
 
-    if( strncmp( value, STRNCMP_PARAM( "true" ) ) )
+    if( strncmp( value, STRNCMP_PARAM( "true" ) ) == 0 )
         bValue = true;
-    else if( strncmp( value, STRNCMP_PARAM( "false" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "false" ) ) == 0 )
         bValue = false;
     else
         return false;
@@ -654,9 +654,9 @@ String2CaseMap( uno::Any& rAny, const gchar * value )
 {
     short nCaseMap;
 
-    if( strncmp( value, STRNCMP_PARAM( "normal" ) ) )
+    if( strncmp( value, STRNCMP_PARAM( "normal" ) ) == 0 )
         nCaseMap = style::CaseMap::NONE;
-    else if( strncmp( value, STRNCMP_PARAM( "small_caps" ) ) )
+    else if( strncmp( value, STRNCMP_PARAM( "small_caps" ) ) == 0 )
         nCaseMap = style::CaseMap::SMALLCAPS;
     else
         return false;


More information about the Libreoffice-commits mailing list