summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-10-09 17:27:52 +0200
committerMichael Stahl <mstahl@redhat.com>2012-10-09 18:00:36 +0200
commitecd70a727d7f559ebda1dd726cea1be472948270 (patch)
treea7ffb138a80b3aa88600a57cd58f0e3f39b2967c /writerfilter/source/dmapper
parentc1d2eed375293d7c27bb885f344cc24ec0cd40ca (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
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.cxx69
1 files changed, 4 insertions, 65 deletions
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index d428fc118fe4..40ea9bdc2674 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -133,77 +133,16 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineType,
if(!bIsOOXML && sal::static_int_cast<sal_uInt32>(nLineColor) < SAL_N_ELEMENTS(aBorderDefColor))
nLineColor = aBorderDefColor[nLineColor];
- sal_Int16 nLineStyle = NONE;
// Map to our border types, we should use of one equal line
// thickness, or one of smaller thickness. If too small we
// can make the defecit up in additional white space or
// object size
- switch(nLineType)
- {
- // First the single lines
- case 1:
- case 2:
- case 5:
- nLineStyle = SOLID;
- break;
- // Dotted and dashed lines
- case 6:
- nLineStyle = DOTTED;
- break;
- case 7:
- case 22:
- nLineStyle = DASHED;
- break;
- // and the unsupported special cases which we map to a single line
- case 8:
- case 9:
- case 20:
- nLineStyle = SOLID;
- break;
- // Double line
- case 3:
- case 10: //Don't have tripple so use double
- case 21:
- case 23:
- nLineStyle = DOUBLE;
- break;
- case 11:
- case 13: //Don't have thin thick thin, so use thick thin
- nLineStyle = THINTHICK_SMALLGAP;
- break;
- case 12:
- nLineStyle = THICKTHIN_SMALLGAP;
- break;
- case 14:
- nLineStyle = THINTHICK_MEDIUMGAP;
- break;
- case 15:
- case 16: //Don't have thin thick thin, so use thick thin
- nLineStyle = THICKTHIN_MEDIUMGAP;
- break;
- case 17:
- nLineStyle = THINTHICK_LARGEGAP;
- break;
- case 18:
- case 19: //Don't have thin thick thin, so use thick thin
- nLineStyle = THICKTHIN_LARGEGAP;
- break;
- // Embossed and engraved lines
- case 24:
- nLineStyle = EMBOSSED;
- break;
- case 25:
- nLineStyle = ENGRAVED;
- break;
- case 0:
- case 255:
- default:
- break;
- }
-
+ ::editeng::SvxBorderStyle const nLineStyle(
+ ::editeng::ConvertBorderStyleFromWord(nLineType));
rToFill.LineStyle = nLineStyle;
double const fConverted( (NONE == nLineStyle) ? 0.0 :
- ::editeng::ConvertBorderWidthFromWord(nLineStyle, nLineThickness));
+ ::editeng::ConvertBorderWidthFromWord(nLineStyle, nLineThickness,
+ nLineType));
rToFill.LineWidth = convertTwipToMM100(fConverted);
rToFill.Color = nLineColor;
}