sw/source/filter/ww8/wrtw8nds.cxx | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-)
New commits: commit 155f2ec1b390152ecc6c3fa6e9cd1ba5e6c04c78 Author: Justin Luth <jl...@mail.com> AuthorDate: Sat Aug 23 11:22:22 2025 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Sun Aug 24 03:13:30 2025 +0200 NFC wrtw8nds.cxx: SwTextNode& rNode IsTextNode by definition Change-Id: I7a7c45bde0a65d0036abf08450b9f71aea3a5a56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190106 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index a1cf6ad15833..f713f4eceda6 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2306,10 +2306,10 @@ bool MSWordExportBase::NeedTextNodeSplit( const SwTextNode& rNd, SwSoftPageBreak } namespace { -OUString lcl_GetSymbolFont(SwAttrPool& rPool, const SwTextNode* pTextNode, int nStart, int nEnd) +OUString lcl_GetSymbolFont(SwAttrPool& rPool, const SwTextNode& rTextNode, int nStart, int nEnd) { SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet( rPool ); - if ( pTextNode && pTextNode->GetParaAttr(aSet, nStart, nEnd) ) + if (rTextNode.GetParaAttr(aSet, nStart, nEnd)) { SfxPoolItem const* pPoolItem = aSet.GetItem(RES_CHRATR_FONT); if (pPoolItem) @@ -2553,8 +2553,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) 2) Ensure that it is a text node and not in a fly. 3) If the anchor is associated with a text node with empty text then we ignore. */ - if( rNode.IsTextNode() - && GetExportFormat() == MSWordExportBase::ExportFormat::DOCX + if (GetExportFormat() == MSWordExportBase::ExportFormat::DOCX && aStr != OUStringChar(CH_TXTATR_BREAKWORD) && !aStr.isEmpty() && !rNode.GetFlyFormat() && aAttrIter.IsAnchorLinkedToThisNode(rNode.GetIndex()) ) @@ -2755,28 +2754,20 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) assert(0 <= nLen); OUString aSnippet( aAttrIter.GetSnippet( aStr, nCurrentPos + ofs, nLen ) ); - const SwTextNode* pTextNode( rNode.GetTextNode() ); if (m_bAddFootnoteTab && (m_nTextTyp == TXT_EDN || m_nTextTyp == TXT_FTN) && nCurrentPos == 0 && nLen > 0 && aSnippet[0] != 0x09) { // Allow MSO to emulate LO footnote text starting at left margin - only meaningful with hanging indent - sal_Int32 nFirstLineIndent=0; - SfxItemSetFixed<RES_MARGIN_FIRSTLINE, RES_MARGIN_FIRSTLINE> aSet( m_rDoc.GetAttrPool() ); - - if ( pTextNode && pTextNode->GetAttr(aSet) ) - { - const SvxFirstLineIndentItem *const pFirstLine(aSet.GetItem<SvxFirstLineIndentItem>(RES_MARGIN_FIRSTLINE)); - if (pFirstLine) - nFirstLineIndent = pFirstLine->ResolveTextFirstLineOffset({}); - } + const SvxFirstLineIndentItem& rFirstLine = rNode.GetAttr(RES_MARGIN_FIRSTLINE); // Insert tab for aesthetic purposes #i24762# - if (nFirstLineIndent < 0) + if (rFirstLine.ResolveTextFirstLineOffset({}) < 0) aSnippet = "\x09" + aSnippet; m_bAddFootnoteTab = false; } - aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), pTextNode, nCurrentPos + ofs, nCurrentPos + ofs + nLen); + aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), rNode, nCurrentPos + ofs, + nCurrentPos + ofs + nLen); if ( bPostponeWritingText && ( FLY_POSTPONED != nStateOfFlyFrame ) ) { @@ -2910,7 +2901,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) AttrOutput().WritePostitFieldReference(); - aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), &rNode, nCurrentPos, nCurrentPos + nLen); + aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), rNode, nCurrentPos, nCurrentPos + nLen); if (bPostponeWritingText) {