[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

Justin L  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Assignee|[email protected] |[email protected]
   |desktop.org |
 Status|UNCONFIRMED |RESOLVED

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

--- Comment #10 from Commit Notification 
 ---
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3957b11722291d7284bc3c30913572fd696fba47

tdf#170602 docx export: write bookmarkEnd after blockSdt

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

--- Comment #9 from Commit Notification 
 ---
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2f9f82f364517968d216ad5205b0f4c368a3ce89

tdf#170602 docx export: Revise how SdtBlockHelper is cleared

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

--- Comment #8 from Commit Notification 
 ---
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d2767db09c5608d2f4edc6c2c7a3c4d0e92192cf

NFC tdf#170602 docx export: always use EndParaSdtBlock()

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

--- Comment #7 from Commit Notification 
 ---
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/67b49e7a5c35617b68b41f9cc2b1fefcb4820c39

tdf#170602 docx export: remove obsolete bCloseEarlierSdt

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

--- Comment #6 from Commit Notification 
 ---
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8fc23c6d7d34d344b2014491d8696c618ff6d04b

tdf#170602 docxexport BlockSdtHelper: make optional nId/nSdtPrToken

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

Commit Notification  changed:

   What|Removed |Added

 Whiteboard| QA:needsComment| QA:needsComment
   ||target:26.8.0

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-19 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

QA Administrators  changed:

   What|Removed |Added

 Whiteboard|| QA:needsComment

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-05 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

--- Comment #5 from Justin L  ---
This is going to be extremely tricky.

IIUC, SdtBlockHelper m_aParagraphSdt only handles these grabbagged SDTs. It
STARTS on the paragraph that has the SdtPr grabbag property. However, since
blockSDTs can contain multiple paragraphs, it does not necessarily end in that
paragraph. (Rather, we have m_aParagraphSdt.m_bStartedSdt as the only flag that
this w:sdt needs to be closed.)

It ends when we get to a paragraph that contains the grabbag property
'ParaSdtEndBefore' (or we reach something that scares us and we end it early).
So before starting that w:p, we call EndParaSdtBlock.

Nested SDTs cause a bit of a problem with this. We'll start at the initial SDT,
and end at the earliest nested SDT I expect. (Further 'ParaSdtEndBefore' are
ignored because m_bStartedSdt is no longer true.)

I also expect that a grabbag-SDT containing a fly-with-a-nested-grabbag-SDT
will end up creating a corrupt result, but that is a teeny edge-case.

So, based on this logic, we need something like this:
-when m_bSdtStarted becomes true, cache the m_nSdtPrToken
-any bookmarkEnds not allowed for nSdtPrToken get stored while m_bSdtStarted
-and written when EndParaSdtBlock

That sounds good in theory, but the problem is that (for the first paragraph)
we have already processed ALL of the bookmarks even before we check for
'SdtPr'. So that means I also need to re-write the entire caching mechanism.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

--- Comment #4 from Justin L  ---
(In reply to Justin L from comment #0)
> we are outputting an empty w:r because of the bookmarkEnd attr, so our 
> bookmark
> gets written before the empty w:r.
I'm pretty sure this was just lucky. Having a bookmark at the end of the
paragraph stops the run at the content control end marker. So we get an extra
run containing only the end marker - which of course results in an empty w:r.
(Otherwise the last run also contains the end marker

OK - take that as a lucky win.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 170602] FILESAVE DOCX: corrupt document reported by MS Word when certain content controls (w:sdt) contain a bookmark

2026-02-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=170602

Justin L  changed:

   What|Removed |Added

Summary|FILESAVE DOCX: corrupt  |FILESAVE DOCX: corrupt
   |document reported by MS |document reported by MS
   |Word when content control   |Word when certain content
   |(Sdt) ends in a bookmark|controls (w:sdt) contain a
   ||bookmark

-- 
You are receiving this mail because:
You are the assignee for the bug.