summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-08-26 15:18:19 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-09 18:48:44 +0100
commit596aa54b860cf08e046a9e21a75a23e073af7900 (patch)
treeaa2940aa6ff8c691e876e2fd1f1b714bcf22648d
parent5d226d978ceb335edad7016d4aa651fda0a525d3 (diff)
import cell fill color
Change-Id: Icbc6ef69a00f05ffa7bb78227968c13a16cdc7a0
-rw-r--r--sc/source/filter/inc/orcusinterface.hxx2
-rw-r--r--sc/source/filter/orcus/interface.cxx21
2 files changed, 19 insertions, 4 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 2f84f3a0ba31..0ef0d7db6bcc 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -183,6 +183,8 @@ private:
OUString maPattern;
Color maFgColor;
Color maBgColor;
+
+ void applyToItemSet(SfxItemSet& rSet) const;
};
fill maCurrentFill;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 155dcf4cd366..d96ae7716a49 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -24,6 +24,7 @@
#include <editeng/postitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/colritem.hxx>
+#include <editeng/brushitem.hxx>
#include <editeng/udlnitem.hxx>
#include <formula/token.hxx>
@@ -494,6 +495,14 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
rSet.Put(SvxUnderlineItem(meUnderline, ATTR_FONT_UNDERLINE));
}
+void ScOrcusStyles::fill::applyToItemSet(SfxItemSet& rSet) const
+{
+ if (maPattern.equalsIgnoreAsciiCase("none"))
+ return;
+
+ rSet.Put(SvxBrushItem(maFgColor, ATTR_BACKGROUND));
+}
+
ScOrcusStyles::protection::protection():
mbHidden(false),
mbLocked(false)
@@ -627,22 +636,26 @@ void ScOrcusStyles::set_fill_count(size_t /*n*/)
// needed at all?
}
-void ScOrcusStyles::set_fill_pattern_type(const char* /*s*/, size_t /*n*/)
+void ScOrcusStyles::set_fill_pattern_type(const char* s, size_t n)
{
+ maCurrentFill.maPattern = OUString(s, n, RTL_TEXTENCODING_UTF8);
}
-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);
}
-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);
}
size_t ScOrcusStyles::commit_fill()
{
SAL_INFO("sc.orcus.style", "commit fill");
- return 0;
+ maFills.push_back(maCurrentFill);
+ return maFills.size() - 1;
}
// border