summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/items/textitem.cxx38
-rw-r--r--include/editeng/memberids.h4
2 files changed, 38 insertions, 4 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index ef0a416324a0..2ca24b9f2c6c 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1442,15 +1442,45 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const
return mColor == static_cast<const SvxColorItem&>( rAttr ).mColor;
}
-bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
+bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
- rVal <<= mColor;
+ nMemberId &= ~CONVERT_TWIPS;
+ switch (nMemberId)
+ {
+ case MID_COLOR_ALPHA:
+ {
+ rVal <<= mColor.GetTransparency();
+ break;
+ }
+ default:
+ {
+ rVal <<= mColor;
+ break;
+ }
+ }
return true;
}
-bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
+bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- return (rVal >>= mColor);
+ nMemberId &= ~CONVERT_TWIPS;
+ switch(nMemberId)
+ {
+ case MID_COLOR_ALPHA:
+ {
+ sal_Int16 nTransparency = 0;
+ bool bRet = rVal >>= nTransparency;
+ if (bRet)
+ {
+ mColor.SetTransparency(nTransparency);
+ }
+ return bRet;
+ }
+ default:
+ {
+ return rVal >>= mColor;
+ }
+ }
}
SfxPoolItem* SvxColorItem::Clone( SfxItemPool * ) const
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index c41b45af9cb9..98023e39d3fa 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -175,6 +175,10 @@
// SvxShadowItem
#define MID_SHADOW_TRANSPARENCE 1
+// SvxColorItem
+#define MID_COLOR_RGB 0
+#define MID_COLOR_ALPHA 1
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */