Bug 92965 - support some of the optional css::drawing::FillProperties properties in chart2
Summary: support some of the optional css::drawing::FillProperties properties in chart2
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillCpp
Depends on:
Blocks: Chart-Enhancements
  Show dependency treegraph
 
Reported: 2015-07-27 22:17 UTC by Markus Mohrhard
Modified: 2021-03-28 05:26 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Mohrhard 2015-07-27 22:17:59 UTC
Currently chart2 stores the gradient name and you have to look the gradient up in a table when you want to use it.

This is crazy API design as it adds a level of indirection that makes it difficult to resolve for the normal user. We should instead store the css::awt::XGradient directly in the FillProperties class.

This would be trivial if we would not need to care about keeping the old string based property in sync. So now we need to add the new property and write some code that makes sure that the two stay in sync.

For that we need to make the setPropertyValue method explicit in all classes that use FillProperties and handle when either the old or the new property are set to also set the other one.
Comment 1 Markus Mohrhard 2015-07-27 23:25:22 UTC
Let us make it more generic.

So the properties:

FillTransparenceGradient
FillGradient
FillHatch
FillBitmap

are defined as optional in css::drawing::FillProperties.

We should implement them in chart2/source/tools/FillProperties.cxx and make sure that the non-optional name property is handled correctly. The name and the new property always need to be in sync.

See the first post for some more details.
Comment 2 Robinson Tryon (qubit) 2015-12-13 10:58:00 UTC Comment hidden (obsolete)
Comment 3 Robinson Tryon (qubit) 2016-02-18 14:52:35 UTC Comment hidden (obsolete)
Comment 4 jani 2016-04-29 06:05:01 UTC
Missing code pointers (mandatory for easy hacks)
Comment 5 jani 2016-07-06 06:03:54 UTC
(In reply to jan iversen from comment #4)
> Missing code pointers (mandatory for easy hacks)

See comment #1
Comment 6 Ekansh Jha 2017-10-16 06:09:29 UTC
(In reply to Markus Mohrhard from comment #1)

Hi, I would like to work on this issue.
> Let us make it more generic.
> 
> So the properties:
> 
> FillTransparenceGradient
> FillGradient
> FillHatch
> FillBitmap
> 
> are defined as optional in css::drawing::FillProperties.

defined optional in FillProperties.cxx?
> 
> We should implement them in chart2/source/tools/FillProperties.cxx and make
got that

> sure that the non-optional name property is handled correctly. The name and
> the new property always need to be in sync.
I didn't really get what this line says.
> 
> See the first post for some more details.

Help will be really appreciated.
Comment 7 Ekansh Jha 2018-01-27 10:42:29 UTC
@Markus, I looked into some files but I am getting little problem in implementing, as I am not sure what should be the cppu::UnoType
for above mentioned "optional function". I think it should be sal_Int32 but to make sure, Could you please tell me How to find this.
Comment 8 Xisco Faulí 2018-01-29 08:58:21 UTC
(In reply to Ekansh Jha from comment #7)
> @Markus, I looked into some files but I am getting little problem in
> implementing, as I am not sure what should be the cppu::UnoType
> for above mentioned "optional function". I think it should be sal_Int32 but
> to make sure, Could you please tell me How to find this.

@Markus, Could you please help Ekansh Jha here?
Comment 9 Felipe Lema 2021-03-28 05:26:16 UTC
I was looking into this from the EasyHacks wiki page and it would be helpful (for all beginners) if someone could clear the question of whether the `cppu::UnoType` of the "optional" should be `sal_Int32` in comment #7

TL;DR: friendly ping