MS formats allow padding without borders, regardless of display.

AllowPaddingWithoutBorders is about display / UI settings. Whether LO
displays them or not, the border distance should be saved for proper
round-tripping, so no need to test for compat setting (and which is
always true anyway in this code segment).

related to tdf#41542 and commit 52b29c6080

Change-Id: I3822d9ea50376b50b89dff37b7394286cab76fff
Reviewed-on: https://gerrit.libreoffice.org/30426
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
This commit is contained in:
Justin Luth
2016-10-31 08:16:53 +03:00
parent 442eacc4e1
commit 21f6bf2d17

View File

@@ -1967,7 +1967,6 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
sal_Int32 nLineWidth=0;
const SfxPoolItem* pItem;
bool bFirstLine = true;
const bool bAllowPaddingWithoutBorders = rFormat.getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS);
if (SfxItemState::SET == rFormat.GetItemState(RES_BOX, true, &pItem))
{
static const o3tl::enumarray<SvxBoxItemLine, sal_uInt16> aExhperProp =
@@ -2035,13 +2034,8 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu(
static_cast<const SvxBoxItem*>(pItem)->GetDistance( n ) ));
}
else if( bAllowPaddingWithoutBorders )
{
rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu(static_cast<const SvxBoxItem*>(pItem)->GetDistance( n )) );
}
else
// MM If there is no line the distance should be set to 0
rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu(0));
rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu(static_cast<const SvxBoxItem*>(pItem)->GetDistance( n )) );
}
else
{
@@ -2054,13 +2048,6 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
if( bFirstLine ) // no valid line found
{
rPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
if( !bAllowPaddingWithoutBorders )
{
rPropOpt.AddOpt( ESCHER_Prop_dyTextTop, 0 );
rPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, 0 );
rPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, 0 );
rPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 );
}
}
const SwAttrSet& rAttrSet = rFormat.GetAttrSet();
if (SfxItemState::SET == rAttrSet.GetItemState(RES_BOX, false, &pItem))