diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2018-01-31 21:27:44 -0500 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2018-02-02 03:41:15 +0100 |
commit | 20945a9a4de6684010fd5b3603595e6da543807d (patch) | |
tree | 718340831385b1775d6d3e84c018bf1d50c3d5d8 /sc | |
parent | 8cf603b4c5a22f1b1cde1614c2c587a061d3ee9c (diff) |
Correctly import solid fill color.
In orcus, a solid fill type uses the foreground color only and ignores
the background color. Also, let's not use the alpha component as it
would cause the color to not get rendered at all.
Some patches are applied against liborcus in order to adjust the ODF
styles import code for this change. These changes will be incorporated
in 0.13.3.
Change-Id: I9e8c243cc6a7f366de2393e7b7ecf77366f5f9ea
Reviewed-on: https://gerrit.libreoffice.org/49071
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index e40a71b446cb..4cfd8447e2d5 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -1148,7 +1148,8 @@ void ScOrcusStyles::fill::applyToItemSet(SfxItemSet& rSet) const return; } - rSet.Put(SvxBrushItem(maBgColor, ATTR_BACKGROUND)); + if (maPattern.equalsIgnoreAsciiCase("solid")) + rSet.Put(SvxBrushItem(maFgColor, ATTR_BACKGROUND)); } ScOrcusStyles::protection::protection(): @@ -1574,15 +1575,19 @@ void ScOrcusStyles::set_fill_pattern_type(const char* s, size_t n) maCurrentFill.mbHasFillAttr = true; } -void ScOrcusStyles::set_fill_fg_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) +void ScOrcusStyles::set_fill_fg_color( + orcus::spreadsheet::color_elem_t /*alpha*/, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) { - maCurrentFill.maFgColor = Color(alpha, red, green, blue); + // Ignore the alpha element for now. + maCurrentFill.maFgColor = Color(red, green, blue); maCurrentFill.mbHasFillAttr = true; } -void ScOrcusStyles::set_fill_bg_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) +void ScOrcusStyles::set_fill_bg_color( + orcus::spreadsheet::color_elem_t /*alpha*/, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) { - maCurrentFill.maBgColor = Color(alpha, red, green, blue); + // Ignore the alpha element for now. + maCurrentFill.maBgColor = Color(red, green, blue); maCurrentFill.mbHasFillAttr = true; } |