summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-06-24 21:04:51 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-06-28 08:04:09 +0000
commitf9b7fe9140ccec30167eba861d9979b03379c121 (patch)
treed6f8fc8d759bc212d8170c4ffd4c2ab513956020 /sc
parentba4ccba7cd01507560871926d3997726eceaf553 (diff)
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@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx6
-rw-r--r--sc/source/filter/excel/xestyle.cxx5
-rw-r--r--sc/source/filter/excel/xistyle.cxx2
-rw-r--r--sc/source/filter/inc/xlconst.hxx6
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx2
5 files changed, 11 insertions, 10 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 82bbbb4abb2b..6ec36e25e1c7 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 b7e054d43afb..3186cdabd927 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 81586528d819..a22ef9b08dfb 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 f8ccaeca9e3b..fc7a6627a333 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 827828d1f2d3..96333d683962 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;