Fix font weight comparisons

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 11 October 2021 11:38 UTC

...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

57ffa96d413d Fix font weight comparisons
sdext/source/pdfimport/wrapper/wrapper.cxx | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

Upstream: cgit.freedesktop.org


  • Share