diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-10-09 17:27:52 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2012-10-10 10:41:40 +0000 |
commit | 0820afc00b2ab647413c3118ad75fdddecf505e0 (patch) | |
tree | b378fa4a1cb949fdca2a428c225e62bfb8435a88 /sw | |
parent | 2570fa3ca70a1634b8c45a0b9e796af80616d71f (diff) |
add editeng::ConvertBorderWidthFromWord:
Replace the 2 duplicate implementations of this in ww8 and writerfilter
with a common one. Differences were:
2) ww8 doubles the with, writerfilter does not
13) unsupported, mapped to THINTHICK_SMALLGAP vs. THICKTHIN_SMALLGAP
22) unsupported, mapped to DASHED vs. SOLID
26) INSET not supported in writerfilter
27) OUTSET not supported in writerfilter
Change-Id: I533b77394388e736f38d70284a6a11061d81e813
(cherry picked from commit ecd70a727d7f559ebda1dd726cea1be472948270)
Reviewed-on: https://gerrit.libreoffice.org/846
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 76 |
1 files changed, 3 insertions, 73 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 786bc00278a5..a74c4d0692c8 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1279,83 +1279,13 @@ sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRC* brc, WW8PLCFx_Cp_FKP* pPap, void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt8 nCol, short nIdx, sal_uInt16 nOOIndex, sal_uInt16 nWWIndex, short *pSize=0) { - ::editeng::SvxBorderStyle eStyle = table::BorderLineStyle::SOLID; - switch (nIdx) - { - // First the single lines - case 1: - case 5: - // and the unsupported special cases which we map to a single line - case 8: - case 9: - case 20: - case 22: - eStyle = table::BorderLineStyle::SOLID; - break; - case 2: - { - eStyle = table::BorderLineStyle::SOLID; - nLineThickness *= 2; - } - break; - case 6: - eStyle = table::BorderLineStyle::DOTTED; - break; - case 7: - eStyle = table::BorderLineStyle::DASHED; - break; - // then the shading beams which we represent by a double line - case 23: - eStyle = table::BorderLineStyle::DOUBLE; - break; - // then the double lines, for which we have good matches - case 3: - case 10: //Don't have tripple so use double - case 21: //Don't have double wave: use double instead - eStyle = table::BorderLineStyle::DOUBLE; - break; - case 11: - eStyle = table::BorderLineStyle::THINTHICK_SMALLGAP; - break; - case 12: - case 13: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_SMALLGAP; - break; - case 14: - eStyle = table::BorderLineStyle::THINTHICK_MEDIUMGAP; - break; - case 15: - case 16: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_MEDIUMGAP; - break; - case 17: - eStyle = table::BorderLineStyle::THINTHICK_LARGEGAP; - break; - case 18: - case 19: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_LARGEGAP; - break; - case 24: - eStyle = table::BorderLineStyle::EMBOSSED; - break; - case 25: - eStyle = table::BorderLineStyle::ENGRAVED; - break; - case 26: - eStyle = table::BorderLineStyle::OUTSET; - break; - case 27: - eStyle = table::BorderLineStyle::INSET; - break; - default: - eStyle = table::BorderLineStyle::NONE; - break; - } + ::editeng::SvxBorderStyle const eStyle( + ::editeng::ConvertBorderStyleFromWord(nIdx)); ::editeng::SvxBorderLine aLine; aLine.SetBorderLineStyle( eStyle ); double const fConverted( (table::BorderLineStyle::NONE == eStyle) ? 0.0 : - ::editeng::ConvertBorderWidthFromWord(eStyle, nLineThickness)); + ::editeng::ConvertBorderWidthFromWord(eStyle, nLineThickness, nIdx)); aLine.SetWidth(fConverted); //No AUTO for borders as yet, so if AUTO, use BLACK |