sw/source/uibase/shells/translatehelper.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a6b3eb3fbcccdc4873f10c946313f12712b3b231
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Nov 30 17:53:34 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Fri Feb 3 21:59:42 2023 +0100

    deepl: don't introduce new bullets
    
    Used HTML should be free from new line characters and also <ul>
    marks so we don't generate new lines.
    
    Change-Id: I02b8f9a9af9f93e8d90a7f4a22ea02c8e1f47651
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143507
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144948
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sw/source/uibase/shells/translatehelper.cxx 
b/sw/source/uibase/shells/translatehelper.cxx
index 8933d22db27f..507c2812a675 100644
--- a/sw/source/uibase/shells/translatehelper.cxx
+++ b/sw/source/uibase/shells/translatehelper.cxx
@@ -45,7 +45,7 @@ OString ExportPaMToHTML(SwPaM* pCursor, bool bReplacePTag)
     SolarMutexGuard gMutex;
     OString aResult;
     WriterRef xWrt;
-    GetHTMLWriter(u"NoLineLimit,SkipHeaderFooter", OUString(), xWrt);
+    GetHTMLWriter(u"NoLineLimit,SkipHeaderFooter,NoPrettyPrint", OUString(), 
xWrt);
     if (pCursor != nullptr)
     {
         SvMemoryStream aMemoryStream;
@@ -63,6 +63,13 @@ OString ExportPaMToHTML(SwPaM* pCursor, bool bReplacePTag)
             aResult = aResult.replaceAll("<p", "<span");
             aResult = aResult.replaceAll("</p>", "</span>");
         }
+
+        // HTML has for that <br> and <p> also does new line
+        aResult = aResult.replaceAll("<ul>", "");
+        aResult = aResult.replaceAll("</ul>", "");
+        aResult = aResult.replaceAll("<ol>", "");
+        aResult = aResult.replaceAll("</ol>", "");
+        aResult = aResult.replaceAll("\n", "").trim();
         return aResult;
     }
     return {};

Reply via email to