[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 2 commits - editeng/source include/editeng svx/source svx/uiconfig
Katarina Behrens
Katarina.Behrens at cib.de
Thu Jun 11 04:15:14 PDT 2015
editeng/source/items/textitem.cxx | 45 ++++++++++++++++++++++++++++++++++++++
include/editeng/colritem.hxx | 2 +
include/editeng/unotext.hxx | 1
svx/source/unodraw/unoprov.cxx | 1
svx/source/unodraw/unoshap2.cxx | 1
svx/uiconfig/ui/sidebararea.ui | 7 +++++
6 files changed, 57 insertions(+)
New commits:
commit 0957fd55a62056d4417aacd52c4f0a42c6698232
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Tue Jun 9 11:53:12 2015 +0200
tdf#88295: Don't export transparent background colour as white
The fix is twofold:
1. retrieve transparency from colour in SvxBackgroundColorItem
(add QueryValue, PutValue methods, use additional memberID to
retrieve alpha channel as a bool property)
2. add CharBackTransparent bool property to Draw [text] shapes
Change-Id: I6e14b81cc82f6b4d7fdd4756ff2e4f75e9270361
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index dd7f4e0..40bf333 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1871,6 +1871,51 @@ SfxPoolItem* SvxBackgroundColorItem::Create(SvStream& rStrm, sal_uInt16 ) const
return new SvxBackgroundColorItem( rStrm, Which() );
}
+bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+{
+ nMemberId &= ~CONVERT_TWIPS;
+ Color aColor = SvxColorItem::GetValue();
+
+ switch( nMemberId )
+ {
+ case MID_GRAPHIC_TRANSPARENT:
+ {
+ rVal <<= Bool2Any (aColor.GetTransparency() == 0xff);
+ break;
+ }
+ default:
+ {
+ rVal <<= (sal_Int32)(aColor.GetColor());
+ break;
+ }
+ }
+ return true;
+}
+
+bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+{
+ nMemberId &= ~CONVERT_TWIPS;
+ sal_Int32 nColor = 0;
+ Color aColor = SvxColorItem::GetValue();
+
+ switch( nMemberId )
+ {
+ case MID_GRAPHIC_TRANSPARENT:
+ {
+ aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 );
+ SvxColorItem::SetValue( aColor );
+ break;
+ }
+ default:
+ {
+ if(!(rVal >>= nColor))
+ return false;
+ SvxColorItem::SetValue( Color(nColor) );
+ break;
+ }
+ }
+ return true;
+}
// class SvxColorItem ----------------------------------------------------
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index 64d8a56..dadd495 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -83,6 +83,8 @@ class EDITENG_DLLPUBLIC SvxBackgroundColorItem : public SvxColorItem
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const SAL_OVERRIDE;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const SAL_OVERRIDE;
+ virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
+ virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
};
#endif
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index f3d2396..2bc45c2 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -91,6 +91,7 @@ class SvxItemPropertySet;
{ OUString(UNO_NAME_EDIT_CHAR_LOCALE), EE_CHAR_LANGUAGE, ::cppu::UnoType<com::sun::star::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
{ OUString(UNO_NAME_EDIT_CHAR_COLOR), EE_CHAR_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0 }, \
{ 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 }, \
{ OUString(UNO_NAME_EDIT_CHAR_UNDERLINE), EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int16>::get(), 0, MID_TL_STYLE }, \
{ OUString("CharUnderlineColor"), EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TL_COLOR }, \
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 2d092a0..80bf3e7 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -588,6 +588,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxControlShapePropertyMap()
{ OUString(UNO_NAME_EDIT_CHAR_CASEMAP), 0, cppu::UnoType<sal_Int16>::get(), 0, 0 },
{ OUString(UNO_NAME_EDIT_CHAR_COLOR), 0, cppu::UnoType<sal_Int32>::get(), 0, 0 },
{ OUString("CharBackColor"), 0, cppu::UnoType<sal_Int32>::get(), 0, 0 },
+ { OUString("CharBackTransparent"), 0, cppu::UnoType<bool>::get(), 0, 0 },
{ OUString("CharRelief"), 0, cppu::UnoType<sal_Int16>::get(), 0, 0 },
{ OUString("CharUnderlineColor"), 0, cppu::UnoType<sal_Int32>::get(), 0, 0 },
{ OUString("CharKerning"), 0, cppu::UnoType<sal_Int16>::get(), 0, 0 },
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index ccd5515..f01fe9e 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -669,6 +669,7 @@ SvxShapeControlPropertyMapping[] =
{ RTL_CONSTASCII_STRINGPARAM("CharWordMode"), RTL_CONSTASCII_STRINGPARAM("FontWordLineMode" ) },
{ RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_COLOR), RTL_CONSTASCII_STRINGPARAM("TextColor") },
{ RTL_CONSTASCII_STRINGPARAM("CharBackColor"), RTL_CONSTASCII_STRINGPARAM("CharBackColor") },
+ { RTL_CONSTASCII_STRINGPARAM("CharBackTransparent"), RTL_CONSTASCII_STRINGPARAM("CharBackTransparent") },
{ RTL_CONSTASCII_STRINGPARAM("CharRelief"), RTL_CONSTASCII_STRINGPARAM("FontRelief") },
{ RTL_CONSTASCII_STRINGPARAM("CharUnderlineColor"), RTL_CONSTASCII_STRINGPARAM("TextLineColor") },
{ RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_PARA_ADJUST), RTL_CONSTASCII_STRINGPARAM("Align") },
commit 780684cc38d718745da1eb790321bf910a04addc
Author: Rishabh Kumar <kris.kr296 at gmail.com>
Date: Mon Jun 8 16:35:05 2015 +0530
Setting Maximum Value for Transparency spin button in area sidebar tab
Change-Id: Idb1c5051de5ddb0501b8d1440f8abe62074296bc
Reviewed-on: https://gerrit.libreoffice.org/16144
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
Tested-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/svx/uiconfig/ui/sidebararea.ui b/svx/uiconfig/ui/sidebararea.ui
index adad038..708533c 100644
--- a/svx/uiconfig/ui/sidebararea.ui
+++ b/svx/uiconfig/ui/sidebararea.ui
@@ -3,6 +3,12 @@
<interface>
<requires lib="gtk+" version="3.0"/>
<requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="lower">0</property>
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkGrid" id="AreaPropertyPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -185,6 +191,7 @@
<property name="hexpand">True</property>
<property name="max_length">100</property>
<property name="invisible_char">•</property>
+ <property name="adjustment">adjustment1</property>
<property name="secondary_icon_activatable">False</property>
<property name="climb_rate">5</property>
<property name="numeric">True</property>
More information about the Libreoffice-commits
mailing list