summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-01 23:57:46 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-01 23:58:49 +0200
commit4ab9719f15baddbc60b96d86d2e0878e79a6ddf7 (patch)
treea43b455d8bcebf87c36e3cf5e5689cf352e9dd5c
parent535ee445a213b67b4135805585427662d36b10db (diff)
use same border width information for xls import and export, fdo#44742
-rw-r--r--sc/source/filter/excel/xestyle.cxx8
-rw-r--r--sc/source/filter/excel/xistyle.cxx37
-rw-r--r--sc/source/filter/inc/xlconst.hxx10
3 files changed, 29 insertions, 26 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index ae51486356e8..bd53eefed693 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 53a75d0ddcc9..83b54c80b1d9 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 c86f1577f04d..552c2d684a94 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