[Libreoffice-commits] core.git: sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 12 16:19:24 UTC 2021


 sw/source/filter/xml/xmlimp.cxx |    3 ++-
 sw/source/ui/config/optcomp.cxx |    1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a1d6701105456248f6ff39766a6699f26a8f3d60
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Thu Dec 31 18:24:48 2020 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jan 12 17:18:44 2021 +0100

    tdf#138544 sw LoadUserSettings: default DoNotJustifyLinesWithManualBreak
    
    This is the second patch in the series.
    When you start a new document, Writer compat setting
    "Expand word space on lines with manual breaks
    in justified paragraphs" is on.
    Now, when saving and reloading it with LoadUserSettings disabled,
    it is still the program default of "on", instead of "off".
    
    So this one is slightly more dangerous because it will prevent
    setting old behaviours for MULTIPLE settings which are
    not listed in the UI.
    (Anything that trusts that ConsiderWrapOnObjPos to indicate a
    very old document.)
    
    The fact that we are explicitly not loading ConsiderWrapOnObjPos
    from the document should not imply that this document is an old one.
    At this far point away from StarOffice 8, it is probably safer
    to assume the document is new, not old.
    
    
    P.S. I'm pretty sure the reset of ExpandWordSpace was a complete
    error during a refactor.
    (At that point, it was the only item that defaulted to true.)
    The only scenario I can imagine is that at one point in time,
    ExpandWordSpace was not part of the SvtCompatibilityOptions,
    and so this would add it. But now it certainly is one of the
    options, and so this pointless pre-init is simply overwritten.
    
    Change-Id: Ibe160099839bcf40d5659f7d5246854c7c4fb5e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108546
    Tested-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index d0266ef31c28..e164da851430 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1450,7 +1450,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
 
     // finally, treat the non-default cases
     // introduce boolean, that indicates a document, written by version prior SO8.
-    const bool bDocumentPriorSO8 = !bConsiderWrapOnObjPos;
+    // If user settings are not loaded, we can't know if this is an old document. Better to assume no?
+    const bool bDocumentPriorSO8 = !bConsiderWrapOnObjPos && bAreUserSettingsFromDocument;
 
     // Use old behaviour if this setting didn't exist, but only if this setting is being read from the document.
     // (Obviously the setting doesn't exist if we are explicitly ignoring it, so then stick with program/user defaults)
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index a3c3837006ce..2cb5a8558eb3 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -208,7 +208,6 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
     const Sequence< Sequence< PropertyValue > > aList = m_aConfigItem.GetList();
 
     SvtCompatibilityEntry aEntry;
-    aEntry.setValue<bool>( SvtCompatibilityEntry::Index::ExpandWordSpace, false );
 
     for ( const Sequence< PropertyValue >& rEntry : aList )
     {


More information about the Libreoffice-commits mailing list