[Libreoffice-commits] core.git: Branch 'feature/orcus-odf' - sc/source

Jaskaran Singh jvsg1303 at gmail.com
Sun Jul 17 08:20:48 UTC 2016


 sc/source/filter/orcus/interface.cxx |   28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

New commits:
commit bd5473e3e3ecd0d2dd7e6f5254fd4086ec3145de
Author: Jaskaran Singh <jvsg1303 at gmail.com>
Date:   Sun Jul 17 13:48:45 2016 +0530

    Add diagonal borders to calc orcus interface
    
    Change-Id: Ia0d41baa4e4d6fdb5872c8ec3f462ff02a32f518

diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 86e04f0..b4a210e 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -36,6 +36,7 @@
 #include <editeng/prntitem.hxx>
 #include <editeng/fontitem.hxx>
 #include <editeng/fhgtitem.hxx>
+#include <editeng/lineitem.hxx>
 
 #include <formula/token.hxx>
 #include <tools/datetime.hxx>
@@ -877,16 +878,33 @@ SvxBoxItemLine getDirection(os::border_direction_t dir)
 
 void ScOrcusStyles::border::applyToItemSet(SfxItemSet& rSet) const
 {
-    SvxBoxItem aItem(ATTR_BORDER);
+    SvxBoxItem aBoxItem(ATTR_BORDER);
+    SvxLineItem aDiagonal_TLBR(ATTR_BORDER_TLBR);
+    SvxLineItem aDiagonal_BLTR(ATTR_BORDER_BLTR);
 
     for (auto& current_border_line : border_lines)
     {
         SvxBoxItemLine eDir = getDirection(current_border_line.first);
-        editeng::SvxBorderLine aLine(&current_border_line.second.maColor, current_border_line.second.mnWidth, current_border_line.second.mestyle);
-        aItem.SetLine(&aLine, eDir);
-    }
 
-    rSet.Put(aItem);
+        if (current_border_line.first == orcus::spreadsheet::border_direction_t::diagonal_tl_br)
+        {
+            editeng::SvxBorderLine aLine(&current_border_line.second.maColor, current_border_line.second.mnWidth, current_border_line.second.mestyle);
+            aDiagonal_BLTR.SetLine(&aLine);
+        }
+        if (current_border_line.first == orcus::spreadsheet::border_direction_t::diagonal_bl_tr)
+        {
+            editeng::SvxBorderLine aLine(&current_border_line.second.maColor, current_border_line.second.mnWidth, current_border_line.second.mestyle);
+            aDiagonal_TLBR.SetLine(&aLine);
+        }
+        else
+        {
+            editeng::SvxBorderLine aLine(&current_border_line.second.maColor, current_border_line.second.mnWidth, current_border_line.second.mestyle);
+            aBoxItem.SetLine(&aLine, eDir);
+        }
+    }
+    rSet.Put(aDiagonal_BLTR);
+    rSet.Put(aDiagonal_TLBR);
+    rSet.Put(aBoxItem);
 }
 
 void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& rSet) const


More information about the Libreoffice-commits mailing list