diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2023-04-13 12:13:19 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2023-04-14 11:56:46 +0200 |
commit | 70684ab604c5fb32a16614c708f986671dd2da3c (patch) | |
tree | 50b68b1256983c0fffa7d5efdd275d09b8bcc8d8 /include/oox | |
parent | 8b8a2844addbd262befb1a2d193dfb590dfa20be (diff) |
MCGR: Adaptions to oox export
This is a 1st version and might need more fine-tuning,
so it is still 'hidden' behind the MCGR_TEST env var
being set (as the import is, too).
Still, when used, it can now import a MCGR with
transparence and export it again. I will now do extended
testing/experimenting, fine-tuning where needed and
prepare final change/drive forward.
The current state in master should not be changed as
long as the mentioned env var is not set, but this
will need to be checked, too, due to changes to the
export api in oox.
Corrected an error in GetAlphaFromTransparenceGradient
method(s), css::rendering::RGBColor is [0.0 .. 1.0]
Corercted an error in WriteSolidFill where transparence
gradient gets checked. This should really check if
TrGr is used, but only checks for 'empty/unused'
color instead (assuming COL_BLACK is 'unused').
All usages of GetAlphaFromTransparenceGradient should
be checked and adapted.
Change-Id: If59d7a06b9207e2efe9e71f3f8ddeca4476408f3
Change-Id: If97f8abdd0e1597aa1fd865b7e884e06a22b71f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150391
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'include/oox')
-rw-r--r-- | include/oox/export/drawingml.hxx | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 9179625bd6b7..bfab16f12aff 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -58,7 +58,7 @@ enum class SvxTimeFormat; namespace com::sun::star { namespace awt { struct FontDescriptor; - struct Gradient; + struct Gradient2; } namespace beans { struct PropertyValue; @@ -107,6 +107,11 @@ namespace core { namespace drawingml { +/// Tooling method to fill awt::Gradient2 from data contained in the given Any +bool fillGradient2FromAny( + css::awt::Gradient2& rGradient, + const css::uno::Any& rVal); + class OOX_DLLPUBLIC URLTransformer { public: @@ -198,7 +203,7 @@ protected: const char* GetComponentDir() const; const char* GetRelationCompPrefix() const; - static bool EqualGradients( css::awt::Gradient aGradient1, css::awt::Gradient aGradient2 ); + static bool EqualGradients( const css::awt::Gradient2& rGradient1, const css::awt::Gradient2& rGradient2 ); bool IsFontworkShape(const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet); void WriteGlowEffect(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet); @@ -244,10 +249,20 @@ public: void WriteSolidFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WriteGradientFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); - void WriteGradientFill( css::awt::Gradient rGradient, css::awt::Gradient rTransparenceGradient, - const css::uno::Reference<css::beans::XPropertySet>& rXPropSet = css::uno::Reference<css::beans::XPropertySet>()); - - void WriteGrabBagGradientFill( const css::uno::Sequence< css::beans::PropertyValue >& aGradientStops, css::awt::Gradient rGradient); + /* New API for WriteGradientFill: + If a awt::Gradient2 is given, it will be used. Else, the 'Fix' entry will be used for + Color or Transparency. That way, less Pseudo(Color|Transparency)Gradients have to be + created at caller side. + NOTE: Giving no Gradient at all (both nullptr) is an error. + */ + void WriteGradientFill( + const css::awt::Gradient2* pColorGradient, sal_Int32 nFixColor, + const css::awt::Gradient2* pTransparenceGradient, sal_Int32 nFixTransparence); + void WriteGradientFill2( + const css::awt::Gradient2* pColorGradient, sal_Int32 nFixColor, + const css::awt::Gradient2* pTransparenceGradient, sal_Int32 nFixTransparence); + + void WriteGrabBagGradientFill( const css::uno::Sequence< css::beans::PropertyValue >& aGradientStops, const css::awt::Gradient2& rGradient); void WriteBlipOrNormalFill(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet, const OUString& rURLPropName, const css::awt::Size& rSize = {}); |