summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-06-22 19:26:59 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-06-23 15:13:31 +0200
commit74d545ee8e4f8c9a1317decd3352ce97e0e24913 (patch)
treed2d6d15d39844bbe9401b0e90d40ed51e65f622e /lingucomponent
parent0d0469b4302dfe95b016a6f04b145834b79d5ed3 (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx16
1 files changed, 6 insertions, 10 deletions
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 <tools/color.hxx>
#include <tools/long.hxx>
#include <com/sun/star/uno/Any.hxx>
+#include <comphelper/propertyvalue.hxx>
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<PropertyValue> 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<PropertyValue> aProperties{ lcl_MakePropertyValue("LineColor", aColor) };
+ Sequence<PropertyValue> aProperties{ comphelper::makePropertyValue("LineColor", aColor) };
return aProperties;
}
}