[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - include/oox sc/qa sc/source

Noel Power noel.power at suse.com
Fri Jun 28 01:04:29 PDT 2013


 include/oox/helper/helper.hxx          |    1 +
 sc/qa/unit/subsequent_filters-test.cxx |    6 +++---
 sc/source/filter/excel/xestyle.cxx     |    5 +++--
 sc/source/filter/excel/xistyle.cxx     |    2 +-
 sc/source/filter/inc/xlconst.hxx       |    6 +++---
 sc/source/filter/oox/stylesbuffer.cxx  |    2 +-
 6 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit f9b7fe9140ccec30167eba861d9979b03379c121
Author: Noel Power <noel.power at suse.com>
Date:   Mon Jun 24 21:04:51 2013 +0100

    fix hair & fine cell border export ( followon fix fdo#56960 )
    
    1) align excel binary and oox import filter border thickness values
    2) use new fine-dash border style
    3) detect & determine hair vrs fine borderline on export
    
    also squashed relevant part of commit ee51444ed1f7003dafc93c8181b5f8c1b0fd165b
    ( fix borders unit test ( test values have changed ) )
    Change-Id: Ieb024bc6f4bfc87c525082c7b9a1f3c444f5c5ca
    (cherry picked from commit 1680a8cd4f4393ec15c4f85cb63b6654117d56d1)
    Reviewed-on: https://gerrit.libreoffice.org/4493
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index 4f8e738..1b85ac3 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -88,6 +88,7 @@ const sal_Int32 API_RGB_WHITE               = 0xFFFFFF;  ///< White color for AP
 const sal_Int16 API_LINE_SOLID              = 0;
 const sal_Int16 API_LINE_DOTTED             = 1;
 const sal_Int16 API_LINE_DASHED             = 2;
+const sal_Int16 API_FINE_LINE_DASHED        = 14;
 
 const sal_Int16 API_LINE_NONE               = 0;
 const sal_Int16 API_LINE_HAIR               = 2;
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 82bbbb4..6ec36e2 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -760,19 +760,19 @@ void ScFiltersTest::testBorderXLS()
     CPPUNIT_ASSERT(pRight);
     CPPUNIT_ASSERT_EQUAL(pRight->GetBorderLineStyle(),
             table::BorderLineStyle::SOLID);
-    CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),4L);
+    CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),1L);
 
     pDoc->GetBorderLines( 3, 5, 0, &pLeft, &pTop, &pRight, &pBottom );
     CPPUNIT_ASSERT(pRight);
     CPPUNIT_ASSERT_EQUAL(pRight->GetBorderLineStyle(),
             table::BorderLineStyle::SOLID);
-    CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),12L);
+    CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),20L);
 
     pDoc->GetBorderLines( 5, 7, 0, &pLeft, &pTop, &pRight, &pBottom );
     CPPUNIT_ASSERT(pRight);
     CPPUNIT_ASSERT_EQUAL(pRight->GetBorderLineStyle(),
             table::BorderLineStyle::SOLID);
-    CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),16L);
+    CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),30L);
 }
 struct Border
 {
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index b7e054d..3186cda 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1575,12 +1575,13 @@ void lclGetBorderLine(
                 case table::BorderLineStyle::DOTTED:
                     rnXclLine = EXC_LINE_DOTTED;
                     break;
+                case table::BorderLineStyle::FINE_DASHED:
+                    rnXclLine = EXC_LINE_HAIR;
+                    break;
                 default:
                     break;
             }
         }
-        else if( nOuterWidth >= EXC_BORDER_HAIR )
-            rnXclLine = EXC_LINE_HAIR;
         else
             rnXclLine = EXC_LINE_NONE;
     }
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 8158652..a22ef9b 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -904,7 +904,7 @@ bool lclConvertBorderLine( ::editeng::SvxBorderLine& rLine, const XclImpPalette&
         {   EXC_BORDER_THIN,    table::BorderLineStyle::DOTTED }, // 4 = dotted
         {   EXC_BORDER_THICK,   table::BorderLineStyle::SOLID },  // 5 = thick
         {   EXC_BORDER_THIN,    table::BorderLineStyle::DOUBLE }, // 6 = double
-        {   EXC_BORDER_HAIR,    table::BorderLineStyle::SOLID },  // 7 = hair
+        {   EXC_BORDER_HAIR,    table::BorderLineStyle::FINE_DASHED },  // 7 = hair
         {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::DASHED }, // 8 = med dash
         {   EXC_BORDER_THIN,    table::BorderLineStyle::SOLID },  // 9 = thin dashdot
         {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::SOLID },  // A = med dashdot
diff --git a/sc/source/filter/inc/xlconst.hxx b/sc/source/filter/inc/xlconst.hxx
index f8ccaec..fc7a662 100644
--- a/sc/source/filter/inc/xlconst.hxx
+++ b/sc/source/filter/inc/xlconst.hxx
@@ -254,9 +254,9 @@ const sal_uInt16 EXC_FUTUREREC_ALERT        = 0x0002;
 // TODO: These values are approximate; we should probably tweak these values
 // further to better match Excel's border thickness.
 
-const sal_uInt16 EXC_BORDER_THICK = 16;
-const sal_uInt16 EXC_BORDER_MEDIUM = 12;
-const sal_uInt16 EXC_BORDER_THIN = 4;
+const sal_uInt16 EXC_BORDER_THICK = 30;
+const sal_uInt16 EXC_BORDER_MEDIUM = 20;
+const sal_uInt16 EXC_BORDER_THIN = 1;
 const sal_uInt16 EXC_BORDER_HAIR = 1;
 
 // ============================================================================
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 827828d..96333d6 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1834,7 +1834,7 @@ bool Border::convertBorderLine( BorderLine2& rBorderLine, const BorderLineModel&
                                     break;
         }
         case XML_double:            lclSetBorderLineWidth( rBorderLine, API_LINE_THIN, API_LINE_THIN, API_LINE_THIN ); break;
-        case XML_hair:              lclSetBorderLineWidth( rBorderLine, API_LINE_HAIR );    break;
+        case XML_hair:              lclSetBorderLineWidth( rBorderLine, API_LINE_HAIR ); rBorderLine.LineStyle = API_FINE_LINE_DASHED;   break;
         case XML_medium:            lclSetBorderLineWidth( rBorderLine, API_LINE_MEDIUM );  break;
         case XML_mediumDashDot:     lclSetBorderLineWidth( rBorderLine, API_LINE_MEDIUM );  break;
         case XML_mediumDashDotDot:  lclSetBorderLineWidth( rBorderLine, API_LINE_MEDIUM );  break;


More information about the Libreoffice-commits mailing list