diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2023-04-18 15:36:35 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2023-04-19 20:43:45 +0200 |
commit | 4409cd197dfb1fab05c0285f3ae17a107c99b77e (patch) | |
tree | c89a73f29f03d4e656042f0b8b88e329b16fd5de /include | |
parent | 730b329b51797254aca58843ad7937ee7662cf7f (diff) |
MCGR: 2nd corrections/adaptions to MCGR
Adapted handling of 'border' argument from our gradients
for oox export, so that it looks the same.
Also added quite some cases to peserve in-between
GradientStops for current UI implementations to be
able to edit the gradients as usual without losing
the in-between GradientStops.
While we will not be able to modify these, we are
at least able to modify all the other gradient
attributes, including start/endColor.
Done this for TransparencyGradients, too.
Also moved more stuff to the gradient tooling in
basegfx.
Change-Id: I6e94011bbf3715baa1401ab97e5b59811298342f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150577
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/basegfx/utils/gradienttools.hxx | 5 | ||||
-rw-r--r-- | include/oox/export/drawingml.hxx | 5 | ||||
-rw-r--r-- | include/svx/sidebar/AreaPropertyPanelBase.hxx | 6 | ||||
-rw-r--r-- | include/svx/sidebar/AreaTransparencyGradientPopup.hxx | 4 |
4 files changed, 15 insertions, 5 deletions
diff --git a/include/basegfx/utils/gradienttools.hxx b/include/basegfx/utils/gradienttools.hxx index acc33f179104..502ef190b8ce 100644 --- a/include/basegfx/utils/gradienttools.hxx +++ b/include/basegfx/utils/gradienttools.hxx @@ -214,6 +214,11 @@ namespace basegfx namespace utils { + /// Tooling method to fill awt::Gradient2 from data contained in the given Any + BASEGFX_DLLPUBLIC bool fillGradient2FromAny( + com::sun::star::awt::Gradient2& rGradient, + const com::sun::star::uno::Any& rVal); + /* Tooling method to extract data from given awt::Gradient2 to ColorStops, doing some corrections, partially based on given SingleColor. diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 4bd3802a7820..946afbf5d57b 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -107,11 +107,6 @@ 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: diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index 75675ca140fa..6cf613cad26d 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -151,6 +151,9 @@ protected: std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; std::unique_ptr< SfxUInt16Item > mpTransparenceItem; + // MCGR: Preserve in-between ColorStops until we have an UI to edit these + basegfx::ColorStops maColorStops; + DECL_DLLPRIVATE_LINK(SelectFillTypeHdl, weld::ComboBox&, void ); DECL_DLLPRIVATE_LINK(SelectFillAttrHdl, weld::ComboBox&, void ); DECL_DLLPRIVATE_LINK(SelectFillColorHdl, ColorListBox&, void); @@ -165,6 +168,9 @@ protected: void SetTransparency(sal_uInt16 nVal); void SelectFillAttrHdl_Impl(); void FillStyleChanged(bool bUpdateModel); + + // MCGR: Preserve in-between ColorStops until we have an UI to edit these + basegfx::ColorStops createColorStops(); }; } // end of namespace svx::sidebar diff --git a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx index 18891e0e2348..78848246c75e 100644 --- a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx +++ b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx @@ -21,6 +21,7 @@ #include <vcl/weld.hxx> #include <svtools/toolbarmenu.hxx> +#include <basegfx/utils/gradienttools.hxx> class XFillFloatTransparenceItem; @@ -44,6 +45,9 @@ private: std::unique_ptr<weld::MetricSpinButton> mxMtrTrgrEndValue; std::unique_ptr<weld::MetricSpinButton> mxMtrTrgrBorder; + // MCGR: Preserve in-between ColorStops until we have an UI to edit these + basegfx::ColorStops maColorStops; + void InitStatus(XFillFloatTransparenceItem const* pGradientItem); void ExecuteValueModify(sal_uInt8 nStartCol, sal_uInt8 nEndCol); DECL_LINK(ModifiedTrgrHdl_Impl, weld::MetricSpinButton&, void); |