summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-27 14:30:16 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-11 20:25:50 +0200
commit0b8e6b2ba733719fc09dfe379b0d6b738723cdee (patch)
tree6dea1910ed0616803ea1e0aa8f85ca74b639abf0
parent15e3ecfcf24ff86290d3d24b456252afe17d5af1 (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). (cherry picked from commit e652ba3c7357e0396498629891a1391ace67c4d7) Signed-off-by: Michael Stahl <mstahl@redhat.com>
-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 7aec55a324af..5ac204bb8ac4 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1569,7 +1569,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)
@@ -1626,7 +1626,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;
@@ -1641,7 +1642,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);