[Libreoffice-commits] core.git: Branch 'feature/orcus-continuous-integration' - 3 commits - sc/inc sc/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Tue Aug 26 06:30:01 PDT 2014


 sc/inc/stlpool.hxx                      |    3 +-
 sc/source/filter/inc/orcusinterface.hxx |    4 ++
 sc/source/filter/orcus/interface.cxx    |   43 +++++++++++++++++++++++++++-----
 3 files changed, 43 insertions(+), 7 deletions(-)

New commits:
commit 1a74981770bd97e671b1e8d425276713c7381d5a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Aug 26 15:18:19 2014 +0200

    import cell fill color
    
    Change-Id: Icbc6ef69a00f05ffa7bb78227968c13a16cdc7a0

diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 64f5e14..a9d1cd7 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -184,6 +184,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 a96a4de..cfb5782 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
commit 9c445ad35d7d21814307b9197e54d4566a98c02d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Aug 26 15:17:19 2014 +0200

    we need to create the default styles in the interface right now
    
    We should fix this but it needs some work in the import code.
    
    Change-Id: If9ce52f6aa2b30faf832a89f39abef4b853a5ec1

diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx
index e83aef0..15acaf8 100644
--- a/sc/inc/stlpool.hxx
+++ b/sc/inc/stlpool.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SC_INC_STLPOOL_HXX
 
 #include <svl/style.hxx>
+#include "scdllapi.h"
 
 class ScStyleSheet;
 class ScDocument;
@@ -42,7 +43,7 @@ public:
     SfxStyleSheetBase*  GetActualStyleSheet ()
                                 { return pActualStyleSheet; }
 
-    void                CreateStandardStyles();
+    void SC_DLLPUBLIC CreateStandardStyles();
     void                CopyStdStylesFrom( ScStyleSheetPool* pSrcPool );
 
     void                CopyStyleFrom( ScStyleSheetPool* pSrcPool,
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index a6e968f..a96a4de 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -471,6 +471,7 @@ size_t ScOrcusSharedStrings::commit_segments()
 ScOrcusStyles::ScOrcusStyles(ScDocument& rDoc):
     mrDoc(rDoc)
 {
+    mrDoc.GetStyleSheetPool()->CreateStandardStyles();
 }
 
 ScOrcusStyles::font::font():
commit b1162ea5ea886669183a8e75092a12156c2443e7
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Aug 26 15:14:41 2014 +0200

    import font underline
    
    Change-Id: I4857d9d49b9f6ef1b92a1d5f61f9f9e852620949

diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 5e7b597..64f5e14 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -14,6 +14,7 @@
 #include "documentimport.hxx"
 
 #include <tools/color.hxx>
+#include <tools/fontenum.hxx>
 
 #include "sharedformulagroups.hxx"
 
@@ -168,6 +169,7 @@ private:
         OUString maName;
         double mnSize;
         Color maColor;
+        FontUnderline meUnderline;
 
         font();
 
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index fc37cbd..a6e968f 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/udlnitem.hxx>
 
 #include <formula/token.hxx>
 #include <tools/datetime.hxx>
@@ -475,7 +476,8 @@ ScOrcusStyles::ScOrcusStyles(ScDocument& rDoc):
 ScOrcusStyles::font::font():
     mbBold(false),
     mbItalic(false),
-    mnSize(10)
+    mnSize(10),
+    meUnderline(UNDERLINE_NONE)
 {
 }
 
@@ -488,6 +490,7 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
     rSet.Put(SvxWeightItem(eWeight, ATTR_FONT_WEIGHT));
 
     rSet.Put(SvxColorItem(maColor, ATTR_FONT_COLOR));
+    rSet.Put(SvxUnderlineItem(meUnderline, ATTR_FONT_UNDERLINE));
 }
 
 ScOrcusStyles::protection::protection():
@@ -583,8 +586,22 @@ void ScOrcusStyles::set_font_size(double point)
     maCurrentFont.mnSize = point;
 }
 
-void ScOrcusStyles::set_font_underline(orcus::spreadsheet::underline_t /*e*/)
+void ScOrcusStyles::set_font_underline(orcus::spreadsheet::underline_t e)
 {
+    switch(e)
+    {
+        case orcus::spreadsheet::underline_single:
+        case orcus::spreadsheet::underline_single_accounting:
+            maCurrentFont.meUnderline = UNDERLINE_SINGLE;
+            break;
+        case orcus::spreadsheet::underline_double:
+        case orcus::spreadsheet::underline_double_accounting:
+            maCurrentFont.meUnderline = UNDERLINE_DOUBLE;
+            break;
+        case orcus::spreadsheet::underline_none:
+            maCurrentFont.meUnderline = UNDERLINE_NONE;
+            break;
+    }
 }
 
 void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t alpha,


More information about the Libreoffice-commits mailing list