sw/source/filter/ww8/attributeoutputbase.hxx | 2 sw/source/filter/ww8/docxattributeoutput.cxx | 10 ---- sw/source/filter/ww8/docxattributeoutput.hxx | 2 sw/source/filter/ww8/wrtw8nds.cxx | 58 +-------------------------- sw/source/filter/ww8/wrtww8.hxx | 1 5 files changed, 6 insertions(+), 67 deletions(-)
New commits: commit 1dfaa049a08c616feba2a744ec37614c46c945c1 Author: Justin Luth <[email protected]> AuthorDate: Mon Feb 2 11:34:18 2026 -0500 Commit: Justin Luth <[email protected]> CommitDate: Thu Feb 5 14:51:49 2026 +0100 NFC tdf#170516 cleanup: remove unused m_bAnchorLinkedToNode This variable is obsolete since the previous patch. It was never set to true anymore. IsAnchorLinkedToThisNode is also never called anymore. Change-Id: Iebe51865cdc512ffb15cab8c1f47d34c0d3ca4e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198363 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 0f30865b0425..162c414c0a57 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -300,8 +300,6 @@ public: /// Set the state of the Fly at current position virtual void SetStateOfFlyFrame( FlyProcessingState /*nStateOfFlyFrame*/ ){}; - /// If the node has an anchor linked. - virtual void SetAnchorIsLinkedToNode( bool /*bAnchorLinkedToNode*/){}; /// Is processing of fly postponed ? virtual bool IsFlyProcessingPostponed(){ return false; }; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 362bca82f87c..32da12ed3218 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1266,7 +1266,7 @@ void DocxAttributeOutput::EndParagraph( const ww8::WW8TableNodeInfoInner::Pointe m_pSerializer->endElementNS( XML_w, XML_p ); // on export sdt blocks are never nested ATM - if (!m_bAnchorLinkedToNode && !m_aParagraphSdt.m_bStartedSdt) + if (!m_aParagraphSdt.m_bStartedSdt) { m_aParagraphSdt.WriteSdtBlock(m_pSerializer, m_bRunTextIsOn, m_rExport.SdrExporter().IsParagraphHasDrawing()); @@ -1796,11 +1796,6 @@ void DocxAttributeOutput::SetStateOfFlyFrame( FlyProcessingState nStateOfFlyFram m_nStateOfFlyFrame = nStateOfFlyFrame; } -void DocxAttributeOutput::SetAnchorIsLinkedToNode( bool bAnchorLinkedToNode ) -{ - m_bAnchorLinkedToNode = bAnchorLinkedToNode ; -} - void DocxAttributeOutput::ResetFlyProcessingFlag() { m_bPostponedProcessingFly = false ; @@ -2119,7 +2114,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, sal_In // enclose in a sdt block, if necessary: if one is already started, then don't do it for now // (so on export sdt blocks are never nested ATM) - if ( !m_bAnchorLinkedToNode && !m_aRunSdt.m_bStartedSdt) + if (!m_aRunSdt.m_bStartedSdt) { m_aRunSdt.WriteSdtBlock(m_pSerializer, m_bRunTextIsOn, m_rExport.SdrExporter().IsParagraphHasDrawing()); } @@ -10698,7 +10693,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, const FSHelperPtr m_bOpenedParaPr( false ), m_bRunTextIsOn( false ), m_bWritingHeaderFooter( false ), - m_bAnchorLinkedToNode(false), m_bWritingField( false ), m_bPreventDoubleFieldsHandling( false ), m_nNextBookmarkId( 0 ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index cfe93a2d7467..26391b2d8c80 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -278,7 +278,6 @@ public: void EndRedline(const SwRedlineData* pRedlineData, bool bLastRun, bool bParagraphProps = false); virtual void SetStateOfFlyFrame( FlyProcessingState nStateOfFlyFrame ) override; - virtual void SetAnchorIsLinkedToNode( bool bAnchorLinkedToNode ) override; virtual bool IsFlyProcessingPostponed() override; virtual void ResetFlyProcessingFlag() override; @@ -873,7 +872,6 @@ private: /// Flag indicating that the header \ footer are being written bool m_bWritingHeaderFooter; - bool m_bAnchorLinkedToNode; /// Flag indicating that multiple runs of a field are being written bool m_bWritingField; diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 629e13a414bd..9e43abc64fa4 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -717,17 +717,6 @@ bool SwWW8AttrIter::IsWatermarkFrame() return false; } -bool SwWW8AttrIter::IsAnchorLinkedToThisNode( SwNodeOffset nNodePos ) -{ - if ( maFlyIter == maFlyFrames.end() ) - return false; - - /* if current node position and the anchor position are the same - then the frame anchor is linked to this node - */ - return nNodePos == maFlyIter->GetPosition().GetNodeIndex(); -} - bool SwWW8AttrIter::HasFlysAt(sal_Int32 nSwPos, const ww8::Frame** pInlineHeading) const { for (const auto& rFly : maFlyFrames) @@ -2539,7 +2528,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) FlyProcessingState nStateOfFlyFrame = aAttrIter.OutFlys( nCurrentPos ); AttrOutput().SetStateOfFlyFrame( nStateOfFlyFrame ); - AttrOutput().SetAnchorIsLinkedToNode(false); + // Append bookmarks in this range after flys, exclusive of final // position of this range AppendBookmarks( rNode, nCurrentPos, nNextAttr - nCurrentPos, pRedlineData ); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 08906ab7fb73..edfec130f8f6 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1598,7 +1598,6 @@ public: const SwFormatDrop& GetSwFormatDrop() const { return mrSwFormatDrop; } bool IsWatermarkFrame(); - bool IsAnchorLinkedToThisNode( SwNodeOffset nNodePos ); void SplitRun( sal_Int32 nSplitEndPos ); commit 1a7ed0d623dee1907530e72f2d1748eab0c6a77b Author: Justin Luth <[email protected]> AuthorDate: Mon Feb 2 11:31:58 2026 -0500 Commit: Justin Luth <[email protected]> CommitDate: Thu Feb 5 14:51:33 2026 +0100 NFC tdf#170516 cleanup: remove unused bPostponeWritingText and the two variables that the compiler complained about now. -bool bStartedPostponedRunProperties -OUString aSavedSnippet No Functional Change intended My recent patch (boldly) stopped setting this variable to true in the only place where it was ever set to true. So all of this was now dead code. A follow-up deals with SetAnchorIsLinkedToNode now always being false... Change-Id: If366698bf907760e8e3f76ad2ade612656925403 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198459 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index ec7ea0ffef3a..629e13a414bd 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2501,9 +2501,6 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) do { const SwRedlineData* pRedlineData = aAttrIter.GetRunLevelRedline( nCurrentPos ); - bool bPostponeWritingText = false ; - bool bStartedPostponedRunProperties = false; - OUString aSavedSnippet ; // Don't redline content-controls--Word doesn't do them. SwTextAttr* pAttr = rNode.GetTextAttrAt(nCurrentPos, RES_TXTATR_CONTENTCONTROL, @@ -2542,7 +2539,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) FlyProcessingState nStateOfFlyFrame = aAttrIter.OutFlys( nCurrentPos ); AttrOutput().SetStateOfFlyFrame( nStateOfFlyFrame ); - AttrOutput().SetAnchorIsLinkedToNode( bPostponeWritingText && (FLY_POSTPONED != nStateOfFlyFrame) ); + AttrOutput().SetAnchorIsLinkedToNode(false); // Append bookmarks in this range after flys, exclusive of final // position of this range AppendBookmarks( rNode, nCurrentPos, nNextAttr - nCurrentPos, pRedlineData ); @@ -2749,15 +2746,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), rNode, nCurrentPos + ofs, nCurrentPos + ofs + nLen); - if ( bPostponeWritingText && ( FLY_POSTPONED != nStateOfFlyFrame ) ) - { - aSavedSnippet = aSnippet ; - } - else - { - bPostponeWritingText = false ; - AttrOutput().RunText( aSnippet, eChrSet, aSymbolFont ); - } + AttrOutput().RunText( aSnippet, eChrSet, aSymbolFont ); if (ofs == 1 && nNextAttr == nEnd) { @@ -2771,13 +2760,10 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) if ( aAttrIter.IsDropCap( nNextAttr ) ) AttrOutput().FormatDrop( rNode, aAttrIter.GetSwFormatDrop(), nStyle, pTextNodeInfo, pTextNodeInfoInner ); - // Only output character attributes if this is not a postponed text run. - if (0 != nEnd && !(bPostponeWritingText - && (FLY_PROCESSED == nStateOfFlyFrame || FLY_NONE == nStateOfFlyFrame))) + if (0 != nEnd) { // Output the character attributes // #i51277# do this before writing flys at end of paragraph - bStartedPostponedRunProperties = true; AttrOutput().StartRunProperties(); aAttrIter.OutAttr(nCurrentPos, false); AttrOutput().EndRunProperties( pRedlineData ); @@ -2883,32 +2869,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), rNode, nCurrentPos, nCurrentPos + nLen); - if (bPostponeWritingText) - { - if (FLY_PROCESSED == nStateOfFlyFrame || FLY_NONE == nStateOfFlyFrame) - { - AttrOutput().EndRun(&rNode, nCurrentPos, -1, /*bLastRun=*/false); - if (!aSavedSnippet.isEmpty()) - bStartedPostponedRunProperties = false; - - AttrOutput().StartRun( pRedlineData, nCurrentPos, bSingleEmptyRun ); - AttrOutput().SetAnchorIsLinkedToNode( false ); - AttrOutput().ResetFlyProcessingFlag(); - } - if (0 != nEnd && !bStartedPostponedRunProperties) - { - AttrOutput().StartRunProperties(); - aAttrIter.OutAttr( nCurrentPos, false ); - AttrOutput().EndRunProperties( pRedlineData ); - - // OutAttr may have introduced new comments, so write them out now - AttrOutput().WritePostitFieldReference(); - } - AttrOutput().RunText( aSavedSnippet, eChrSet, aSymbolFont ); - AttrOutput().EndRun(&rNode, nCurrentPos, nLen, nNextAttr == nEnd); - } - else - AttrOutput().EndRun(&rNode, nCurrentPos, nLen, nNextAttr == nEnd); + AttrOutput().EndRun(&rNode, nCurrentPos, nLen, nNextAttr == nEnd); nCurrentPos = nNextAttr; UpdatePosition( &aAttrIter, nCurrentPos );
