summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-03-13 19:39:34 +0100
committerAndras Timar <andras.timar@collabora.com>2023-05-15 21:38:53 +0200
commit6f700c779cb084c605c9f0c56b4c66a17aef1d8d (patch)
treeaf382d0ad009ba8d628e2191dc1d2b1245322aa8 /reportdesign
parent2f2e108b37589c47bf666d84322cf4e9e700c204 (diff)
MCGR: Model data changes for ColorSteps
Added tooling replaceStart/EndColor to allow simple transition for code that does not immediately adapt to multi color gradients. Also added createColorStepsFromStartEndColor for the same purpose. Adapted XGradient to no longer have Start/EndColor at all, but only use ColorSteps. Adapted all usages of XGradient to no longer use Get/Set/Start/EndColor, but access the ColorSteps instead. Replaced quite some XGradient constructors that used XGradient() as Start/EndColor since this is already the default. Adapted ColorBlending to black AKA Start/EndIntens in XGradient to work now on all ColorSteps in the required linearly-scaled manner. UNO API changes: Added com::sun::star::awt::ColorStep as basic data element that holds a pair of Offset and Color. Added com::sun::star::awt::ColorStepSequence to handle an array of sorted entries. Added com::sun::star::awt::Gradient2 derived from com::sun::star::awt::Gradient, extended by the needed com::sun::star::awt::ColorStepSequence. Added MID_GRADIENT_COLORSTEPSEQUENCE to UNO API to provide access to ColorSteps directly. Adapted XFillGradientItem::QueryValue/PutValue to make use of new UNO API data structures. To do so, added tooling methods for data transition: - fillColorStepSequenceFromColorSteps - fillGradient2FromXGradient - fillColorStepsFromAny - fillXGradientFromAny and adapted - case '0' (all data) - MID_FILLGRADIENT - MID_GRADIENT_COLORSTEPSEQUENCE - MID_GRADIENT_START/ENDCOLOR to make use of these. Tested usage of these in the office. Renamed from GradientStep to GradientStop after discussions with members on the list to make this closer related to other norms/definitions. Also renamed classes and class members to better reflect to GradientStop, so grepping/finding will be easier (e.g. 'Color' just exists pretty often, but 'StopColor' is more precise). Changed the used UNO API class for reprsenting the Color to better reflect to ranges [0.0 .. 1.0] and usage of RGB. Change-Id: I1eeb3e97e81d6785967615d1ff256551fc3b882d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148849 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx3
2 files changed, 5 insertions, 2 deletions
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index ae54ed3a6c56..e928bbd7cf2b 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -625,7 +625,9 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
XColorListRef pColorList( XColorList::CreateStdColorList() );
const ::Color aNullLineCol(COL_DEFAULT_SHAPE_STROKE); // #i121448# Use defined default color
const ::Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING); // #i121448# Use defined default color
- const XGradient aNullGrad(COL_BLACK, COL_WHITE);
+ // XGradient() default already creates [COL_BLACK, COL_WHITE] as defaults
+ const XGradient aNullGrad;
+
const XHatch aNullHatch(aNullLineCol);
std::vector<SfxPoolItem*> pDefaults
{
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index fb389172985e..b83cc4de160a 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2373,7 +2373,8 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
const ::Color aNullLineCol(COL_DEFAULT_SHAPE_STROKE); // #i121448# Use defined default color
const ::Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING); // #i121448# Use defined default color
- const XGradient aNullGrad(COL_BLACK, COL_WHITE);
+ // XGradient() default already creates [COL_BLACK, COL_WHITE] as defaults
+ const XGradient aNullGrad;
const XHatch aNullHatch(aNullLineCol);
std::vector<SfxPoolItem*> pDefaults