summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-10-11 12:11:40 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-10-11 13:38:25 +0200
commit57ffa96d413df2712b15355f49294e564bd0d996 (patch)
tree935ce7158d6329ad343b8413e64ab73ef59c74a7
parente7c22593d16d304264d3a343b549bf188975cdd6 (diff)
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 <suokunlong@126.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx16
1 files changed, 8 insertions, 8 deletions
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);