[Libreoffice-commits] .: 2 commits - chart2/qa sc/qa sc/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Sun Apr 1 14:59:06 PDT 2012
chart2/qa/unit/data/ods/testChart.ods |binary
dev/null |binary
sc/qa/extras/regression-test.cxx | 4 ---
sc/source/filter/excel/xestyle.cxx | 8 +++----
sc/source/filter/excel/xistyle.cxx | 37 +++++++++++++---------------------
sc/source/filter/inc/xlconst.hxx | 10 +++++++++
6 files changed, 30 insertions(+), 29 deletions(-)
New commits:
commit 4ab9719f15baddbc60b96d86d2e0878e79a6ddf7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Apr 1 23:57:46 2012 +0200
use same border width information for xls import and export, fdo#44742
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index ae51486..bd53eef 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1547,15 +1547,15 @@ void lclGetBorderLine(
sal_uInt16 nDistance = pLine->GetDistance();
if( nDistance > 0 )
rnXclLine = EXC_LINE_DOUBLE;
- else if( nOuterWidth > DEF_LINE_WIDTH_2 )
+ else if( nOuterWidth >= EXC_BORDER_THICK )
rnXclLine = EXC_LINE_THICK;
- else if( nOuterWidth > DEF_LINE_WIDTH_1 )
+ else if( nOuterWidth >= EXC_BORDER_MEDIUM )
{
rnXclLine = EXC_LINE_MEDIUM;
if ( pLine->GetStyle( ) == ::editeng::DASHED )
rnXclLine = EXC_LINE_MEDIUMDASHED;
}
- else if( nOuterWidth > DEF_LINE_WIDTH_0 )
+ else if( nOuterWidth >= EXC_BORDER_THIN )
{
rnXclLine = EXC_LINE_THIN;
switch ( pLine->GetStyle( ) )
@@ -1570,7 +1570,7 @@ void lclGetBorderLine(
break;
}
}
- else if( nOuterWidth > 0 )
+ 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 53a75d0..83b54c8 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -890,33 +890,26 @@ bool XclImpCellBorder::HasAnyOuterBorder() const
namespace {
-// TODO: These values are approximate; we should probably tweak these values
-// further to better match Excel's border thickness.
-#define XLS_LINE_WIDTH_HAIR 1
-#define XLS_LINE_WIDTH_THIN 6
-#define XLS_LINE_WIDTH_MEDIUM 18
-#define XLS_LINE_WIDTH_THICK 24
-
/** Converts the passed line style to a ::editeng::SvxBorderLine, or returns false, if style is "no line". */
bool lclConvertBorderLine( ::editeng::SvxBorderLine& rLine, const XclImpPalette& rPalette, sal_uInt8 nXclLine, sal_uInt16 nXclColor )
{
static const sal_uInt16 ppnLineParam[][ 4 ] =
{
- // outer width, type
- { 0, ::editeng::SOLID }, // 0 = none
- { XLS_LINE_WIDTH_THIN, ::editeng::SOLID }, // 1 = thin
- { XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID }, // 2 = medium
- { XLS_LINE_WIDTH_THIN, ::editeng::DASHED }, // 3 = dashed
- { XLS_LINE_WIDTH_THIN, ::editeng::DOTTED }, // 4 = dotted
- { XLS_LINE_WIDTH_THICK, ::editeng::SOLID }, // 5 = thick
- { XLS_LINE_WIDTH_THIN, ::editeng::DOUBLE }, // 6 = double
- { XLS_LINE_WIDTH_HAIR, ::editeng::SOLID }, // 7 = hair
- { XLS_LINE_WIDTH_MEDIUM, ::editeng::DASHED }, // 8 = med dash
- { XLS_LINE_WIDTH_THIN, ::editeng::SOLID }, // 9 = thin dashdot
- { XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID }, // A = med dashdot
- { XLS_LINE_WIDTH_THIN, ::editeng::SOLID }, // B = thin dashdotdot
- { XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID }, // C = med dashdotdot
- { XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID } // D = med slant dashdot
+ // outer width, type
+ { 0, ::editeng::SOLID }, // 0 = none
+ { EXC_BORDER_THIN, ::editeng::SOLID }, // 1 = thin
+ { EXC_BORDER_MEDIUM, ::editeng::SOLID }, // 2 = medium
+ { EXC_BORDER_THIN, ::editeng::DASHED }, // 3 = dashed
+ { EXC_BORDER_THIN, ::editeng::DOTTED }, // 4 = dotted
+ { EXC_BORDER_THICK, ::editeng::SOLID }, // 5 = thick
+ { EXC_BORDER_THIN, ::editeng::DOUBLE }, // 6 = double
+ { EXC_BORDER_HAIR, ::editeng::SOLID }, // 7 = hair
+ { EXC_BORDER_MEDIUM, ::editeng::DASHED }, // 8 = med dash
+ { EXC_BORDER_THIN, ::editeng::SOLID }, // 9 = thin dashdot
+ { EXC_BORDER_MEDIUM, ::editeng::SOLID }, // A = med dashdot
+ { EXC_BORDER_THIN, ::editeng::SOLID }, // B = thin dashdotdot
+ { EXC_BORDER_MEDIUM, ::editeng::SOLID }, // C = med dashdotdot
+ { EXC_BORDER_MEDIUM, ::editeng::SOLID } // D = med slant dashdot
};
if( nXclLine == EXC_LINE_NONE )
diff --git a/sc/source/filter/inc/xlconst.hxx b/sc/source/filter/inc/xlconst.hxx
index c86f157..552c2d6 100644
--- a/sc/source/filter/inc/xlconst.hxx
+++ b/sc/source/filter/inc/xlconst.hxx
@@ -259,6 +259,16 @@ const sal_uInt16 EXC_FUTUREREC_EMPTYFLAGS = 0x0000;
const sal_uInt16 EXC_FUTUREREC_HASREF = 0x0001;
const sal_uInt16 EXC_FUTUREREC_ALERT = 0x0002;
+// Border import/export
+
+// 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 = 24;
+const sal_uInt16 EXC_BORDER_MEDIUM = 18;
+const sal_uInt16 EXC_BORDER_THIN = 6;
+const sal_uInt16 EXC_BORDER_HAIR = 1;
+
// ============================================================================
#endif
commit 535ee445a213b67b4135805585427662d36b10db
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Apr 1 23:57:18 2012 +0200
move chart regression test data files to chart2
diff --git a/chart2/qa/unit/data/ods/testChart.ods b/chart2/qa/unit/data/ods/testChart.ods
new file mode 100644
index 0000000..956f57d
Binary files /dev/null and b/chart2/qa/unit/data/ods/testChart.ods differ
diff --git a/sc/qa/extras/regression-test.cxx b/sc/qa/extras/regression-test.cxx
index 89d9d87..4041fd4 100644
--- a/sc/qa/extras/regression-test.cxx
+++ b/sc/qa/extras/regression-test.cxx
@@ -61,8 +61,6 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-/* Implementation of Macros test */
-
class ScChartRegressionTest : public test::BootstrapFixture, public unotest::MacrosTest
{
public:
@@ -135,7 +133,7 @@ void ScChartRegressionTest::test()
}
ScChartRegressionTest::ScChartRegressionTest()
- : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data"))
+ : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/chart2/qa/unit/data"))
{
}
diff --git a/sc/qa/unit/data/ods/testChart.ods b/sc/qa/unit/data/ods/testChart.ods
deleted file mode 100644
index 956f57d..0000000
Binary files a/sc/qa/unit/data/ods/testChart.ods and /dev/null differ
More information about the Libreoffice-commits
mailing list