Kaydet (Commit) e652ba3c authored tarafından Miklos Vajna's avatar Miklos Vajna

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).
üst 60d39b75
...@@ -1568,7 +1568,7 @@ sal_Int32 SwWW8ImplReader::MatchSdrBoxIntoFlyBoxItem(const Color& rLineColor, ...@@ -1568,7 +1568,7 @@ sal_Int32 SwWW8ImplReader::MatchSdrBoxIntoFlyBoxItem(const Color& rLineColor,
SvxBorderLine aLine; SvxBorderLine aLine;
aLine.SetColor( rLineColor ); 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 ); aLine.SetStyle( nIdx );
for(sal_uInt16 nLine = 0; nLine < 4; ++nLine) for(sal_uInt16 nLine = 0; nLine < 4; ++nLine)
...@@ -1625,7 +1625,8 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, ...@@ -1625,7 +1625,8 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
// Rahmen-GROESSE benoetigt! // Rahmen-GROESSE benoetigt!
SvxBoxItem aBox(sw::util::ItemGet<SvxBoxItem>(rFlySet, RES_BOX)); SvxBoxItem aBox(sw::util::ItemGet<SvxBoxItem>(rFlySet, RES_BOX));
// dashed oder solid wird zu solid // 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! // check if LineStyle is *really* set!
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
...@@ -1640,7 +1641,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, ...@@ -1640,7 +1641,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
nLineThick = WW8ITEMVALUE(rOldSet, XATTR_LINEWIDTH, XLineWidthItem); nLineThick = WW8ITEMVALUE(rOldSet, XATTR_LINEWIDTH, XLineWidthItem);
if( !nLineThick ) 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, nOutside = MatchSdrBoxIntoFlyBoxItem(aLineColor, eLineStyle,
eDashing, eShapeType, nLineThick, aBox); eDashing, eShapeType, nLineThick, aBox);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment