lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx |   16 
+++-------
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 74d545ee8e4f8c9a1317decd3352ce97e0e24913
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Jun 22 19:26:59 2022 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Jun 23 15:13:31 2022 +0200

    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 <vmik...@collabora.com>

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;
 }
 }

Reply via email to