summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx7
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx13
2 files changed, 13 insertions, 7 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index fac212c3cfe9..fcfea4083551 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -983,12 +983,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf90810, "tdf90810short.docx")
uno::Reference<text::XFootnote> xFootnote(xFootnoteIdxAcc->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XText> xFootnoteText(xFootnote, uno::UNO_QUERY);
rtl::OUString sFootnoteText = xFootnoteText->getString();
- // Original document doesn't have a leading tab in the footnote, but the
- // export adds one unconditionally.
- if (mbExported)
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(90), sFootnoteText.getLength());
- else
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(89), sFootnoteText.getLength());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(89), sFootnoteText.getLength());
}
DECLARE_OOXMLEXPORT_TEST(testTdf89165, "tdf89165.docx")
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 143dd510ab2e..fb8454dd1b83 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2433,8 +2433,19 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
OUString aSnippet( aAttrIter.GetSnippet( aStr, nAktPos + ofs, nLen ) );
if ( ( m_nTextTyp == TXT_EDN || m_nTextTyp == TXT_FTN ) && nAktPos == 0 && nLen > 0 )
{
+ // Allow MSO to emulate LO footnote text starting at left margin - only meaningful with hanging indent
+ sal_Int32 nFirstLineIndent=0;
+ SfxItemSet aSet( m_pDoc->GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} );
+ const SwTextNode* pTextNode( rNode.GetTextNode() );
+ if ( pTextNode && pTextNode->GetAttr(aSet) )
+ {
+ const SvxLRSpaceItem* pLRSpace = aSet.GetItem<SvxLRSpaceItem>(RES_LR_SPACE);
+ if ( pLRSpace )
+ nFirstLineIndent = pLRSpace->GetTextFirstLineOfst();
+ }
+
// Insert tab for aesthetic purposes #i24762#
- if ( m_bAddFootnoteTab && aSnippet[0] != 0x09 )
+ if ( m_bAddFootnoteTab && nFirstLineIndent < 0 && aSnippet[0] != 0x09 )
aSnippet = "\x09" + aSnippet;
m_bAddFootnoteTab = false;
}