The problem is that if Word reads a w:sectPr that is inside a w:textbox and has a w:headerReference, then Word throws a confusing error reporting a location inside the headerN.xml file and refuses to open the file.
It looks like Word doesn't actually support sections inside text frames, although it doesn't complain if the section break doesn't contain a header/footer reference.
The WW8 export appears to avoid this by checking that TXT_MAINTEXT == m_nTextTyp and skipping sections otherwise, but the m_nTextTyp doesn't change when exporting a text frame in DOCX case, so let's change that.
Possibly this makes m_bFlyFrameGraphic variable redundant, not sure about that.
Change-Id: If862b226254983bb608bbce180f4aa2f41721273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91421
0dd48d1a9a71 sw: DOCX export: avoid section breaks in text frames
sw/source/filter/ww8/docxsdrexport.cxx | 12 ++++++++++++
1 file changed, 12 insertions(+)