summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-27 14:30:16 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-04-27 14:34:40 +0200
commite652ba3c7357e0396498629891a1391ace67c4d7 (patch)
treea6af21e03dba8b88900326598e6d3a32f8cd3fce
parent60d39b758dc9308d6ce7464875b3a17f26be3d79 (diff)
n#757910 fix WW8 import of textboxes with thin border/inner margin
There were two problems here: First, nLineThick was already in twips, so converting it again from EMU rendered thin borders invisible. Second, when the border width is set to zero, that means a minimal border, but we interpreted it as default width (which resulted in less space for the textbox contents than required).
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index b044636fd89b..65431a5e12d4 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1568,7 +1568,7 @@ sal_Int32 SwWW8ImplReader::MatchSdrBoxIntoFlyBoxItem(const Color& rLineColor,
SvxBorderLine aLine;
aLine.SetColor( rLineColor );
- aLine.SetWidth( long ( nLineThick / 65 ) ); // Convert EMUs to Twips
+ aLine.SetWidth( nLineThick ); // No conversion here, nLineThick is already in twips
aLine.SetStyle( nIdx );
for(sal_uInt16 nLine = 0; nLine < 4; ++nLine)
@@ -1625,7 +1625,8 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
// Rahmen-GROESSE benoetigt!
SvxBoxItem aBox(sw::util::ItemGet<SvxBoxItem>(rFlySet, RES_BOX));
// dashed oder solid wird zu solid
- sal_Int32 nLineThick = 0, nOutside=0;
+ // WW-default: 0.75 pt = 15 twips
+ sal_Int32 nLineThick = 15, nOutside=0;
// check if LineStyle is *really* set!
const SfxPoolItem* pItem;
@@ -1640,7 +1641,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
nLineThick = WW8ITEMVALUE(rOldSet, XATTR_LINEWIDTH, XLineWidthItem);
if( !nLineThick )
- nLineThick = 15; // WW-default: 0.75 pt
+ nLineThick = 1; // for Writer, zero is "no border", so set a minimal value
nOutside = MatchSdrBoxIntoFlyBoxItem(aLineColor, eLineStyle,
eDashing, eShapeType, nLineThick, aBox);