sdext/source/pdfimport/wrapper/wrapper.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 57ffa96d413df2712b15355f49294e564bd0d996
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Oct 11 12:11:40 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Oct 11 13:38:25 2021 +0200

    Fix font weight comparisons
    
    ...after 2d486bac81e06c64d13c647f35d3f4affbeb183e "tdf#143959 
sdext.pdfimport:
    call vcl::Font::identifyFont directly" changed the left-hand sides from
    aFontDescriptor.Weight of type float to aFontReadResult.GetWeight() of type
    FontWeight from include/tools/fontenum.hxx.  (Diagnosed as
    
    > sdext/source/pdfimport/wrapper/wrapper.cxx:624:45: error: comparison of 
enumeration type 'FontWeight' with floating-point type 'float' is deprecated 
[-Werror,-Wdeprecated-enum-float-conversion]
    >               if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::THIN)
    >                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    in a --with-latest-c++ build.)
    
    Change-Id: I0c661fc27eefa478808f796ffb9a7586e1e671c3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123375
    Reviewed-by: Kevin Suo <suokunl...@126.com>
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    Tested-by: Jenkins

diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx 
b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 4d1f328d6f34..3553a588802c 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -621,22 +621,22 @@ void LineParser::readFont()
             }
 
             // Font weight
-            if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::THIN)
+            if (aFontReadResult.GetWeight() == WEIGHT_THIN)
                 aResult.fontWeight = u"100";
-            else if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::ULTRALIGHT)
+            else if (aFontReadResult.GetWeight() == WEIGHT_ULTRALIGHT)
                 aResult.fontWeight = u"200";
-            else if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::LIGHT)
+            else if (aFontReadResult.GetWeight() == WEIGHT_LIGHT)
                 aResult.fontWeight = u"300";
-            else if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::SEMILIGHT)
+            else if (aFontReadResult.GetWeight() == WEIGHT_SEMILIGHT)
                 aResult.fontWeight = u"350";
             // no need to check "normal" here as this is default in 
nFontWeight above
-            else if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::SEMIBOLD)
+            else if (aFontReadResult.GetWeight() == WEIGHT_SEMIBOLD)
                 aResult.fontWeight = u"600";
-            else if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::BOLD)
+            else if (aFontReadResult.GetWeight() == WEIGHT_BOLD)
                 aResult.fontWeight = u"bold";
-            else if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::ULTRABOLD)
+            else if (aFontReadResult.GetWeight() == WEIGHT_ULTRABOLD)
                 aResult.fontWeight = u"800";
-            else if (aFontReadResult.GetWeight() == 
com::sun::star::awt::FontWeight::BLACK)
+            else if (aFontReadResult.GetWeight() == WEIGHT_BLACK)
                 aResult.fontWeight = u"900";
             SAL_INFO("sdext.pdfimport", aResult.fontWeight);
 

Reply via email to