summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/items/textitem.cxx6
-rw-r--r--include/editeng/unoprnms.hxx1
-rw-r--r--include/editeng/unotext.hxx1
-rw-r--r--offapi/com/sun/star/style/CharacterProperties.idl8
4 files changed, 14 insertions, 2 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 2ca24b9f2c6c..34b6ac42d8ec 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1449,7 +1449,8 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
case MID_COLOR_ALPHA:
{
- rVal <<= mColor.GetTransparency();
+ auto fTransparency = static_cast<double>(mColor.GetTransparency()) * 100 / 255;
+ rVal <<= static_cast<sal_Int16>(basegfx::fround(fTransparency));
break;
}
default:
@@ -1472,7 +1473,8 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
bool bRet = rVal >>= nTransparency;
if (bRet)
{
- mColor.SetTransparency(nTransparency);
+ auto fTransparency = static_cast<double>(nTransparency) * 255 / 100;
+ mColor.SetTransparency(static_cast<sal_uInt8>(basegfx::fround(fTransparency)));
}
return bRet;
}
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index ca3b977afeee..c9952340519d 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -320,6 +320,7 @@
#define UNO_NAME_EDIT_CHAR_LOCALE_COMPLEX "CharLocaleComplex"
#define UNO_NAME_EDIT_CHAR_COLOR "CharColor"
+#define UNO_NAME_EDIT_CHAR_TRANSPARENCE "CharTransparence"
#define UNO_NAME_EDIT_CHAR_CROSSEDOUT "CharCrossedOut"
#define UNO_NAME_EDIT_CHAR_STRIKEOUT "CharStrikeout"
#define UNO_NAME_EDIT_CHAR_CASEMAP "CharCaseMap"
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index c442fa731384..203bf309809d 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -87,6 +87,7 @@ struct SfxItemPropertySimpleEntry;
{ OUString(UNO_NAME_EDIT_CHAR_WEIGHT), EE_CHAR_WEIGHT, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
{ OUString(UNO_NAME_EDIT_CHAR_LOCALE), EE_CHAR_LANGUAGE, ::cppu::UnoType<css::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
{ OUString(UNO_NAME_EDIT_CHAR_COLOR), EE_CHAR_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0 }, \
+ { OUString(UNO_NAME_EDIT_CHAR_TRANSPARENCE),EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_ALPHA }, \
{ OUString("CharBackColor"), EE_CHAR_BKGCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0 }, \
{ OUString("CharBackTransparent"), EE_CHAR_BKGCOLOR, ::cppu::UnoType<bool>::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
{ OUString(UNO_NAME_EDIT_CHAR_ESCAPEMENT), EE_CHAR_ESCAPEMENT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_ESC }, \
diff --git a/offapi/com/sun/star/style/CharacterProperties.idl b/offapi/com/sun/star/style/CharacterProperties.idl
index 010dab9acb53..f213bf0c4f12 100644
--- a/offapi/com/sun/star/style/CharacterProperties.idl
+++ b/offapi/com/sun/star/style/CharacterProperties.idl
@@ -460,6 +460,14 @@ published service CharacterProperties
*/
[optional, property] short RubyPosition;
+ /** This is the transparency of the character text.
+
+ @since LibreOffice 6.5
+
+ <p>The value 100 means entirely transparent, while 0 means not transparent at all.</p>
+ */
+ [optional, property] short CharTransparence;
+
};
}; }; }; };