[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-2' - officecfg/registry sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 17 11:44:42 UTC 2019


 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |   12 ++++++++++++
 sw/source/filter/html/swhtml.cxx                           |    5 +++++
 sw/source/filter/html/swhtml.hxx                           |    2 +-
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 5f16cdcd0cd8eb759472cb99a344da0fadd8860c
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon May 27 10:46:40 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Sep 17 13:44:01 2019 +0200

    sw HTML import: add an option to ignore comments by default
    
    No function change, default behavior is still mapping them to postits.
    
    Change-Id: I55041452909e9f0b83d6c5d113af3067b3c0afdb
    Reviewed-on: https://gerrit.libreoffice.org/73021
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 256107622c252afdce35d1c77fe70eb4e4bc57ce)
    Reviewed-on: https://gerrit.libreoffice.org/78699
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index a5e6a121b03b..bc1d0c0b076d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -5864,6 +5864,18 @@
             <value>true</value>
           </prop>
         </group>
+        <group oor:name="HTML">
+          <info>
+            <desc>Contains settings for importing HTML.</desc>
+          </info>
+          <prop oor:name="IgnoreComments" oor:type="xs:boolean" oor:nillable="false">
+            <info>
+              <desc>Specifies whether HTML comments should be ignored or imported as postits / annotations.</desc>
+              <label>Ignore HTML comments</label>
+            </info>
+            <value>false</value>
+          </prop>
+        </group>
       </group>
     </group>
     <group oor:name="Numbering">
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index ce6a79f8e0dd..daa5002b684c 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -116,6 +116,7 @@
 
 #include <sfx2/viewfrm.hxx>
 #include <svx/svdobj.hxx>
+#include <officecfg/Office/Writer.hxx>
 
 #include <swerror.h>
 #include <hints.hxx>
@@ -312,6 +313,10 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn,
     m_nTableDepth( 0 ),
     m_pTempViewFrame(nullptr)
 {
+    // If requested explicitly, then force ignoring of comments (don't create postits for them).
+    if (officecfg::Office::Writer::Filter::Import::HTML::IgnoreComments::get())
+        m_bIgnoreHTMLComments = true;
+
     m_nEventId = nullptr;
     m_bUpperSpace = m_bViewCreated = m_bChkJumpMark = false;
 
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 5c633f326964..c0f3523f4303 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -448,7 +448,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient
     bool m_bSelect : 1;
     bool m_bInFootEndNoteAnchor : 1;
     bool m_bInFootEndNoteSymbol : 1;
-    bool const m_bIgnoreHTMLComments : 1;
+    bool m_bIgnoreHTMLComments : 1;
     bool m_bRemoveHidden : 1; // the filter implementation might set the hidden flag
 
     bool m_bBodySeen : 1;


More information about the Libreoffice-commits mailing list