diff options
author | Justin Luth <justin_luth@sil.org> | 2016-09-01 11:19:56 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-02 12:36:41 +0000 |
commit | 52b29c60801cf75364fd8275a22e812797cb184d (patch) | |
tree | 3943f82d250b0b8adeb6cb555edf58dd1c061285 /sw/source/filter | |
parent | 91733eff7fba157daf88b092189d842f9d6f1b68 (diff) |
tdf#76349 SpacingWithoutBorders: enable .doc RT
Microsoft allows spacing in textboxes even if the borders are not
shown, but LO does not. Added a compatible setting, used an existing
setting to allow the spacing, and changed .doc export not to zero
out the spacing if the border was zero-width.
Using the compatible setting in the export code is almost redundant,
but it does require that the document was LOADED as .doc, and not
"save as" from another format.
This patch simply allows round-tripping - any user attempt to modify the
border settings will enforce normal LO border rules.
Change-Id: I60ac036e1bfac381eea15e33c21495ad3800277a
Reviewed-on: https://gerrit.libreoffice.org/28601
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 1 |
2 files changed, 13 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 2df3fe2ef0e2..0aa62eb85f57 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1967,6 +1967,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, sal_Int32 nLineWidth=0; const SfxPoolItem* pItem; bool bFirstLine = true; + const bool bAllowSpacingWithoutBorders = rFormat.getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_SPACING_WITHOUT_BORDERS); if (SfxItemState::SET == rFormat.GetItemState(RES_BOX, true, &pItem)) { static const o3tl::enumarray<SvxBoxItemLine, sal_uInt16> aExhperProp = @@ -2034,6 +2035,10 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu( static_cast<const SvxBoxItem*>(pItem)->GetDistance( n ) )); } + else if( bAllowSpacingWithoutBorders ) + { + 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)); @@ -2041,10 +2046,13 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, if( bFirstLine ) // no valid line found { rPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 ); - rPropOpt.AddOpt( ESCHER_Prop_dyTextTop, 0 ); - rPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, 0 ); - rPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, 0 ); - rPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 ); + if( !bAllowSpacingWithoutBorders ) + { + 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)) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0c95f2227827..f1b7c73ee2e8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1959,6 +1959,7 @@ void SwWW8ImplReader::ImportDop() m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_MARGIN, true); m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL, true); m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE, true); + m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_SPACING_WITHOUT_BORDERS, true); // COMPATIBILITY FLAGS END |