diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-06-09 16:06:37 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-06-14 08:33:12 +0200 |
commit | 81ae86d5f9e6d06300a2d6cf160de004c881ade5 (patch) | |
tree | 8b735e05fa29c631f671bc21ef412b7bf4c16934 /editeng | |
parent | c93d88a7d321483e9d040fad17394a738f8cde7c (diff) |
fix wrong transform type, error handling when JSON parsing
Change-Id: Id5435d59cd51352efc4a4a8e333ec1ff45847a6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152781
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/textitem.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 3e7cc6c6a736..f4194da865a6 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1555,11 +1555,11 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) return false; if (sComplexColorJson.isEmpty()) - { return false; - } + OString aJSON = OUStringToOString(sComplexColorJson, RTL_TEXTENCODING_ASCII_US); - model::color::convertFromJSON(aJSON, maComplexColor); + if (!model::color::convertFromJSON(aJSON, maComplexColor)) + return false; } break; case MID_COMPLEX_COLOR: @@ -1575,7 +1575,8 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_COLOR_RGB: default: { - return rVal >>= mColor; + if (!(rVal >>= mColor)) + return false; } break; } |