docx export: remove rather odd lcl_isOnelinerSdt

This early SDT patch (from 2014) is just plain WRONG.

The unit test from that patch still passes.
It is all related to table cells,
so I'm sure that later patches have solved the complication
in a saner fashion.

Change-Id: Ic2793c8796f122a3748f809d0876f0bc31a0c898
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198848
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This commit is contained in:
Justin Luth
2026-02-06 21:23:56 +01:00
parent e2aa2ec47d
commit df4b3e9d42
2 changed files with 1 additions and 13 deletions
+1 -10
View File
@@ -448,12 +448,6 @@ void DocxAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 /*nScript*/ )
m_pSerializer->singleElementNS(XML_w, XML_rtl, FSNS(XML_w, XML_val), "true");
}
/// Are multiple paragraphs disallowed inside this type of SDT?
static bool lcl_isOnelinerSdt(std::u16string_view rName)
{
return rName == u"Title" || rName == u"Subtitle" || rName == u"Company";
}
// write a floating table directly to docx without the surrounding frame
void DocxAttributeOutput::WriteFloatingTable(ww8::Frame const* pParentFrame)
{
@@ -617,12 +611,10 @@ sal_Int32 DocxAttributeOutput::StartParagraph(const ww8::WW8TableNodeInfo::Point
}
}
// TODO also avoid multiline paragraphs in those SDT types for shape text
bool bOneliner = m_aParagraphSdt.m_bStartedSdt && !m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen() && lcl_isOnelinerSdt(m_aStartedParagraphSdtPrAlias);
if (bEndParaSdt || (m_aParagraphSdt.m_bStartedSdt && m_bHadSectPr) || bOneliner)
if (bEndParaSdt || (m_aParagraphSdt.m_bStartedSdt && m_bHadSectPr))
{
// This is the common case: "close sdt before the current paragraph" was requested by the next paragraph.
m_aParagraphSdt.EndSdtBlock(m_pSerializer);
m_aStartedParagraphSdtPrAlias.clear();
}
m_bHadSectPr = false;
@@ -10545,7 +10537,6 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
const uno::Sequence<beans::PropertyValue> aGrabBagSdt =
rGrabBagElement.second.get< uno::Sequence<beans::PropertyValue> >();
m_aParagraphSdt.GetSdtParamsFromGrabBag(aGrabBagSdt);
m_aStartedParagraphSdtPrAlias = m_aParagraphSdt.m_aAlias;
}
else if (rGrabBagElement.first == "ParaCnfStyle")
{
@@ -1085,9 +1085,6 @@ private:
SdtBlockHelper m_aParagraphSdt;
SdtBlockHelper m_aRunSdt;
/// Same as m_aParagraphSdtPrAlias, but its content is available till the SDT is closed.
OUString m_aStartedParagraphSdtPrAlias;
std::vector<std::map<SvxBoxItemLine, css::table::BorderLine2>> m_aTableStyleConfs;
std::optional<SwLineBreakClear> m_oLineBreakClear;