From 74d545ee8e4f8c9a1317decd3352ce97e0e24913 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 22 Jun 2022 19:26:59 +0100 Subject: lingucomponent: use comphelper::makePropertyValue() in languagetoolimp This allows giving aColor an actual type. Change-Id: If51ec4028b712166094c3f24a2e1d7643ff0136d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136295 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- .../source/spellcheck/languagetool/languagetoolimp.cxx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'lingucomponent') diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index d4f73c8ee4bc..ef56578c9825 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -40,6 +40,7 @@ #include #include #include +#include using namespace osl; using namespace com::sun::star; @@ -53,28 +54,23 @@ using namespace linguistic; namespace { -PropertyValue lcl_MakePropertyValue(const OUString& rName, uno::Any& rValue) -{ - return PropertyValue(rName, -1, rValue, css::beans::PropertyState_DIRECT_VALUE); -} - Sequence lcl_GetLineColorPropertyFromErrorId(const std::string& rErrorId) { - uno::Any aColor; + Color aColor; if (rErrorId == "TYPOS") { - aColor <<= COL_LIGHTRED; + aColor = COL_LIGHTRED; } else if (rErrorId == "STYLE") { - aColor <<= COL_LIGHTBLUE; + aColor = COL_LIGHTBLUE; } else { // Same color is used for other errorId's such as GRAMMAR, TYPOGRAPHY.. - aColor <<= COL_ORANGE; + aColor = COL_ORANGE; } - Sequence aProperties{ lcl_MakePropertyValue("LineColor", aColor) }; + Sequence aProperties{ comphelper::makePropertyValue("LineColor", aColor) }; return aProperties; } } -- cgit v1.2.3