sw/qa/extras/ww8export/ww8export4.cxx |    7 ++++++-
 sw/source/filter/ww8/wrtww8.cxx       |    2 --
 sw/source/filter/ww8/ww8par.cxx       |    3 +--
 3 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 384d3b319185f352771fea049b67e7f9df96ac09
Author:     Jonathan Clark <jonat...@libreoffice.org>
AuthorDate: Wed Jul 23 10:14:23 2025 -0600
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Jul 31 17:05:09 2025 +0200

    tdf#167552 sw: Disable DOC handling of fDntBlnSbDbWid compat flag
    
    This change partially reverts the following commit:
    
    commit 6818bc55ff248c59f12b2e090139eff30fe949dd
        tdf#88908 sw: Add BalanceSpacesAndIdeographicSpaces compat option
    
    Specifically, this change disables the actual handling of the compat
    flag for DOC files. It continues to work correctly for DOCX files.
    
    We were parsing the compatibility flag correctly. However, there is some
    undocumented and as-yet unknown mechanism Word uses to control whether
    or not the fDntBlnSbDbWid value is effective for a particular document.
    I looked at all of the likely Dop fields across the sample documents I
    have available, but I couldn't see a pattern. Possibly this is based on
    a version field located elsewhere, or maybe it's even based on the size
    of the Dop structure itself.
    
    After spending time trying to reverse engineer this, I'm growing
    concerned that this hints at a general Copts masking mechanism built
    into Word that we don't implement, rather than something that affects
    this one compat flag in particular.
    
    Change-Id: I021c636c0a9c72c5489960221f5ecec7823bf566
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188247
    Reviewed-by: Jonathan Clark <jonat...@libreoffice.org>
    Tested-by: Jenkins
    (cherry picked from commit 510cdadd6199c19406a021e1fb0cc29ce21b5e29)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188293
    Reviewed-by: Justin Luth <jl...@mail.com>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index f9aad0a27f1a..1ded08b4a40d 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -693,6 +693,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80596Hanging)
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf88908)
 {
+    // tdf#167552: There is some as-yet unknown mechanism Word uses to control 
whether or
+    // not the fDntBlnSbDbWid compat flag should be effective. Until this 
mechanism is
+    // understood, handling the flag as-written in DOC files is destructive to 
layout in
+    // many documents. Ignore it for now and default to unbalanced spaces.
+
     createSwDoc();
 
     {
@@ -716,7 +721,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88908)
     {
         SwDoc* pDoc = getSwDoc();
         IDocumentSettingAccess& rIDSA = pDoc->getIDocumentSettingAccess();
-        
CPPUNIT_ASSERT(rIDSA.get(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES));
+        
CPPUNIT_ASSERT(!rIDSA.get(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES));
     }
 }
 
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f59a749b3ca0..d06267a7f2a3 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -572,8 +572,6 @@ static void WriteDop( WW8Export& rWrt )
     rDop.fDontUseHTMLAutoSpacing = 
rWrt.m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::PARA_SPACE_MAX);
 
     rDop.fExpShRtn = 
!rWrt.m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
 // #i56856#
-    rDop.fDntBlnSbDbWid = !rWrt.m_rDoc.getIDocumentSettingAccess().get(
-        DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES); // tdf#88908
 
     IDocumentSettingAccess& rIDSA = rWrt.m_rDoc.getIDocumentSettingAccess();
     rDop.fDontBreakWrappedTables = 
rIDSA.get(DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES);
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 1aa3a963fece..9476e055c954 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1932,8 +1932,7 @@ void SwWW8ImplReader::ImportDop()
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING,
 false); // #i47448#
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::NO_GAP_AFTER_NOTE_NUMBER,
 true); // tdf#159382
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,
 !m_xWDop->fExpShRtn); // #i49277#, #i56856#
-    
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES,
-                                           !m_xWDop->fDntBlnSbDbWid); // 
tdf#88908
+    
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES,
 false); // tdf#167552
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
 false);  // #i53199#
     
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::OLD_LINE_SPACING, 
false);
 

Reply via email to