diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-18 23:28:42 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-19 00:28:16 -0400 |
commit | 402fffa1b42e8b54704bab5442590d192dea67ca (patch) | |
tree | 441a1df96a103551ee949942516b3328059c3cc9 /sc | |
parent | 22c7da0ca5438b69165609db2a1ef219aa167dc2 (diff) |
Add dash-dot and dash-dot-dot line styles.
We need these for Excel interop.
Change-Id: I91450c1d205f28636edfb4392aa6ae5091b1d7b7
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 44 | ||||
-rw-r--r-- | sc/source/filter/excel/xistyle.cxx | 28 | ||||
-rw-r--r-- | sc/source/filter/html/htmlexp.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/xlstyle.hxx | 23 | ||||
-rw-r--r-- | sc/source/filter/oox/stylesbuffer.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 2 |
7 files changed, 75 insertions, 36 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index defacfbb0cff..ce1e9d59a286 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -1022,6 +1022,8 @@ const char* toBorderName( sal_Int16 eStyle ) case table::BorderLineStyle::SOLID: return "SOLID"; case table::BorderLineStyle::DOTTED: return "DOTTED"; case table::BorderLineStyle::DASHED: return "DASHED"; + case table::BorderLineStyle::DASH_DOT: return "DASH_DOT"; + case table::BorderLineStyle::DASH_DOT_DOT: return "DASH_DOT_DOT"; case table::BorderLineStyle::DOUBLE_THIN: return "DOUBLE_THIN"; case table::BorderLineStyle::FINE_DASHED: return "FINE_DASHED"; default: diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index fcf9e690d6c1..573ca8aac387 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1561,8 +1561,20 @@ void lclGetBorderLine( else if( nOuterWidth >= EXC_BORDER_MEDIUM ) { rnXclLine = EXC_LINE_MEDIUM; - if (pLine->GetBorderLineStyle( ) == table::BorderLineStyle::DASHED) - rnXclLine = EXC_LINE_MEDIUMDASHED; + switch (pLine->GetBorderLineStyle()) + { + case table::BorderLineStyle::DASHED: + rnXclLine = EXC_LINE_MEDIUM_DASHED; + break; + case table::BorderLineStyle::DASH_DOT: + rnXclLine = EXC_LINE_MEDIUM_DASHDOT; + break; + case table::BorderLineStyle::DASH_DOT_DOT: + rnXclLine = EXC_LINE_MEDIUM_DASHDOTDOT; + break; + default: + ; + } } else if( nOuterWidth >= EXC_BORDER_THIN ) { @@ -1573,6 +1585,12 @@ void lclGetBorderLine( case table::BorderLineStyle::FINE_DASHED: rnXclLine = EXC_LINE_DASHED; break; + case table::BorderLineStyle::DASH_DOT: + rnXclLine = EXC_LINE_THIN_DASHDOT; + break; + case table::BorderLineStyle::DASH_DOT_DOT: + rnXclLine = EXC_LINE_THIN_DASHDOTDOT; + break; case table::BorderLineStyle::DOTTED: rnXclLine = EXC_LINE_DOTTED; break; @@ -1718,15 +1736,19 @@ static const char* ToLineStyle( sal_uInt8 nLineStyle ) { switch( nLineStyle ) { - case EXC_LINE_NONE: return "none"; - case EXC_LINE_THIN: return "thin"; - case EXC_LINE_MEDIUM: return "medium"; - case EXC_LINE_THICK: return "thick"; - case EXC_LINE_DOUBLE: return "double"; - case EXC_LINE_HAIR: return "hair"; - case EXC_LINE_DOTTED: return "dotted"; - case EXC_LINE_DASHED: return "dashed"; - case EXC_LINE_MEDIUMDASHED: return "mediumDashed"; + case EXC_LINE_NONE: return "none"; + case EXC_LINE_THIN: return "thin"; + case EXC_LINE_MEDIUM: return "medium"; + case EXC_LINE_THICK: return "thick"; + case EXC_LINE_DOUBLE: return "double"; + case EXC_LINE_HAIR: return "hair"; + case EXC_LINE_DOTTED: return "dotted"; + case EXC_LINE_DASHED: return "dashed"; + case EXC_LINE_MEDIUM_DASHED: return "mediumDashed"; + case EXC_LINE_THIN_DASHDOT: return "dashDot"; + case EXC_LINE_THIN_DASHDOTDOT: return "dashDotDot"; + case EXC_LINE_MEDIUM_DASHDOT: return "mediumDashDot"; + case EXC_LINE_MEDIUM_DASHDOTDOT: return "mediumDashDotDot"; } return "*unknown*"; } diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index f1cae7f5b90d..9afaf913872a 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -897,20 +897,20 @@ bool lclConvertBorderLine( ::editeng::SvxBorderLine& rLine, const XclImpPalette& static const sal_uInt16 ppnLineParam[][ 4 ] = { // outer width, type - { 0, table::BorderLineStyle::SOLID }, // 0 = none - { EXC_BORDER_THIN, table::BorderLineStyle::SOLID }, // 1 = thin - { EXC_BORDER_MEDIUM, table::BorderLineStyle::SOLID }, // 2 = medium - { EXC_BORDER_THIN, table::BorderLineStyle::FINE_DASHED }, // 3 = dashed - { EXC_BORDER_THIN, table::BorderLineStyle::DOTTED }, // 4 = dotted - { EXC_BORDER_THICK, table::BorderLineStyle::SOLID }, // 5 = thick - { EXC_BORDER_THICK, table::BorderLineStyle::DOUBLE_THIN }, // 6 = double - { EXC_BORDER_HAIR, table::BorderLineStyle::SOLID }, // 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 - { EXC_BORDER_THIN, table::BorderLineStyle::SOLID }, // B = thin dashdotdot - { EXC_BORDER_MEDIUM, table::BorderLineStyle::SOLID }, // C = med dashdotdot - { EXC_BORDER_MEDIUM, table::BorderLineStyle::SOLID } // D = med slant dashdot + { 0, table::BorderLineStyle::SOLID }, // 0 = none + { EXC_BORDER_THIN, table::BorderLineStyle::SOLID }, // 1 = thin + { EXC_BORDER_MEDIUM, table::BorderLineStyle::SOLID }, // 2 = medium + { EXC_BORDER_THIN, table::BorderLineStyle::FINE_DASHED }, // 3 = dashed + { EXC_BORDER_THIN, table::BorderLineStyle::DOTTED }, // 4 = dotted + { EXC_BORDER_THICK, table::BorderLineStyle::SOLID }, // 5 = thick + { EXC_BORDER_THICK, table::BorderLineStyle::DOUBLE_THIN }, // 6 = double + { EXC_BORDER_HAIR, table::BorderLineStyle::SOLID }, // 7 = hair + { EXC_BORDER_MEDIUM, table::BorderLineStyle::DASHED }, // 8 = med dash + { EXC_BORDER_THIN, table::BorderLineStyle::DASH_DOT }, // 9 = thin dashdot + { EXC_BORDER_MEDIUM, table::BorderLineStyle::DASH_DOT }, // A = med dashdot + { EXC_BORDER_THIN, table::BorderLineStyle::DASH_DOT_DOT }, // B = thin dashdotdot + { EXC_BORDER_MEDIUM, table::BorderLineStyle::DASH_DOT_DOT }, // C = med dashdotdot + { EXC_BORDER_MEDIUM, table::BorderLineStyle::DASH_DOT } // D = med slant dashdot }; if( nXclLine == EXC_LINE_NONE ) diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 00e160d40144..0787d204803b 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -510,6 +510,8 @@ OString ScHTMLExport::BorderToStyle(const char* pBorderName, aOut.append("dotted"); break; case table::BorderLineStyle::DASHED: + case table::BorderLineStyle::DASH_DOT: + case table::BorderLineStyle::DASH_DOT_DOT: aOut.append("dashed"); break; case table::BorderLineStyle::DOUBLE: diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx index f389b0549010..76caec779092 100644 --- a/sc/source/filter/inc/xlstyle.hxx +++ b/sc/source/filter/inc/xlstyle.hxx @@ -37,15 +37,20 @@ class XclRoot; // Line styles ---------------------------------------------------------------- -const sal_uInt8 EXC_LINE_NONE = 0x00; -const sal_uInt8 EXC_LINE_THIN = 0x01; -const sal_uInt8 EXC_LINE_MEDIUM = 0x02; -const sal_uInt8 EXC_LINE_DASHED = 0x03; -const sal_uInt8 EXC_LINE_DOTTED = 0x04; -const sal_uInt8 EXC_LINE_THICK = 0x05; -const sal_uInt8 EXC_LINE_DOUBLE = 0x06; -const sal_uInt8 EXC_LINE_HAIR = 0x07; -const sal_uInt8 EXC_LINE_MEDIUMDASHED = 0x08; +const sal_uInt8 EXC_LINE_NONE = 0x00; +const sal_uInt8 EXC_LINE_THIN = 0x01; +const sal_uInt8 EXC_LINE_MEDIUM = 0x02; +const sal_uInt8 EXC_LINE_DASHED = 0x03; +const sal_uInt8 EXC_LINE_DOTTED = 0x04; +const sal_uInt8 EXC_LINE_THICK = 0x05; +const sal_uInt8 EXC_LINE_DOUBLE = 0x06; +const sal_uInt8 EXC_LINE_HAIR = 0x07; +const sal_uInt8 EXC_LINE_MEDIUM_DASHED = 0x08; +const sal_uInt8 EXC_LINE_THIN_DASHDOT = 0x09; +const sal_uInt8 EXC_LINE_MEDIUM_DASHDOT = 0x0A; +const sal_uInt8 EXC_LINE_THIN_DASHDOTDOT = 0x0B; +const sal_uInt8 EXC_LINE_MEDIUM_DASHDOTDOT = 0x0C; +const sal_uInt8 EXC_LINE_MEDIUM_SLANT_DASHDOT = 0x0D; // Background patterns -------------------------------------------------------- diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index dfa5570afa2b..ee0542e24ee7 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -1725,8 +1725,14 @@ bool Border::convertBorderLine( BorderLine2& rBorderLine, const BorderLineModel& rBorderLine.Color = rModel.maColor.getColor( getBaseFilter().getGraphicHelper(), API_RGB_BLACK ); switch( rModel.mnStyle ) { - case XML_dashDot: lclSetBorderLineWidth( rBorderLine, API_LINE_THIN ); break; - case XML_dashDotDot: lclSetBorderLineWidth( rBorderLine, API_LINE_THIN ); break; + case XML_dashDot: + lclSetBorderLineWidth( rBorderLine, API_LINE_THIN ); + rBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT; + break; + case XML_dashDotDot: + lclSetBorderLineWidth( rBorderLine, API_LINE_THIN ); + rBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT_DOT; + break; case XML_dashed: lclSetBorderLineWidth( rBorderLine, API_LINE_THIN ); rBorderLine.LineStyle = table::BorderLineStyle::FINE_DASHED; diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 7dae366edba2..af5cd662785c 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -490,6 +490,8 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName aBorderStyles.push_back(table::BorderLineStyle::DOTTED); aBorderStyles.push_back(table::BorderLineStyle::DASHED); aBorderStyles.push_back(table::BorderLineStyle::FINE_DASHED); + aBorderStyles.push_back(table::BorderLineStyle::DASH_DOT); + aBorderStyles.push_back(table::BorderLineStyle::DASH_DOT_DOT); aBorderStyles.push_back(table::BorderLineStyle::DOUBLE_THIN); SfxIntegerListItem aBorderStylesItem(SID_ATTR_BORDER_STYLES, aBorderStyles); |