Borders: first attempt to fix the ww8 borders import with the new types

This commit is contained in:
Cédric Bosdonnat 2010-11-08 16:28:10 +01:00
parent 0f0896c26f
commit 4b5bd335f1
3 changed files with 6 additions and 20 deletions

View file

@ -1491,7 +1491,9 @@ const WW8_BordersSO &WW8_BordersSO::Get0x01LineMatch(eBorderCode eCode)
/*15*/ { DEF_DOUBLE_LINE9_OUT, DEF_DOUBLE_LINE9_IN, DEF_DOUBLE_LINE9_DIST, SOLID },
/*16*/ { DEF_DOUBLE_LINE10_OUT,DEF_DOUBLE_LINE10_IN,DEF_DOUBLE_LINE10_DIST, SOLID},
/*17*/ { DEF_LINE_WIDTH_5, 0, 0, DASHED },
/*18*/ { DEF_LINE_WIDTH_5, 0, 0, DOTTED }
/*18*/ { DEF_LINE_WIDTH_5, 0, 0, DOTTED },
/*19*/ { DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, EMBOSSED },
/*20*/ { DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, ENGRAVED }
};
size_t nPos = static_cast<size_t>(eCode);
OSL_ENSURE(nPos < sizeof(aLineTabVer8), "Impossible");

View file

@ -1325,25 +1325,9 @@ void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt
case 22:
// or if in necessary by a double line
case 24:
eCodeIdx = WW8_BordersSO::emboss;
case 25:
if( nLineThickness < 10)
eCodeIdx = WW8_BordersSO::single0;// 1 Twip for us
else if( nLineThickness < 20)
eCodeIdx = WW8_BordersSO::single5;// 10 Twips for us
else if (nLineThickness < 50)
eCodeIdx = WW8_BordersSO::single1;// 20 Twips
else if (nLineThickness < 80)
eCodeIdx = WW8_BordersSO::single2;// 50
else if (nLineThickness < 100)
eCodeIdx = WW8_BordersSO::single3;// 80
else if (nLineThickness < 150)
eCodeIdx = WW8_BordersSO::single4;// 100
// Hack: for the quite thick lines we must paint double lines,
// because our singles lines don't come thicker than 5 points.
else if (nLineThickness < 180)
eCodeIdx = WW8_BordersSO::double2;// 150
else
eCodeIdx = WW8_BordersSO::double5;// 180
eCodeIdx = WW8_BordersSO::engrave;
break;
// then the shading beams which we represent by a double line
case 23:

View file

@ -297,7 +297,7 @@ public:
single0, single1, single2, single3, single4, single5,
double0, double1, double2, double3, double4, double5, double6,
double7, double8, double9, double10,
dashed, dotted,
dashed, dotted, emboss, engrave,
none
};
static const WW8_BordersSO &Get0x01LineMatch(eBorderCode nIdx);