cui/source/dialogs/scriptdlg.cxx            |    3 +--
 include/vcl/svapp.hxx                       |    3 +--
 sc/inc/validat.hxx                          |    4 ++++
 sc/source/core/data/validat.cxx             |   11 +++++++----
 sfx2/source/appl/app.cxx                    |    3 +--
 sw/source/uibase/shells/translatehelper.cxx |    9 ++++++++-
 vcl/jsdialog/jsdialogbuilder.cxx            |   10 +++++++---
 vcl/source/window/builder.cxx               |    3 +--
 8 files changed, 30 insertions(+), 16 deletions(-)

New commits:
commit ac738382d63203965e13d3fe6f7745cdea95ea38
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Fri Dec 2 16:18:02 2022 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Jan 3 06:36:09 2023 +0000

    jsdialog: fix validation error dialog in Calc
    
    Change-Id: Ie6551e386cd53f6b4bf4cceb6d7bd6170a2072ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143599
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Rashesh Padia <rashesh.pa...@collabora.com>
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144951
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index fc27b3fbf3b6..a2d798e80a78 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -1327,8 +1327,7 @@ IMPL_STATIC_LINK( SvxScriptErrorDialog, ShowDialog, 
void*, p, void )
             xData->pParent,
             VclMessageType::Warning,
             VclButtonsType::Ok,
-            message,
-            comphelper::LibreOfficeKit::isActive()));
+            message));
 
     xBox->set_title(CuiResId(RID_CUISTR_ERROR_TITLE));
 
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 398358f1bfad..55d7aa87adf2 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1348,8 +1348,7 @@ public:
     static std::unique_ptr<weld::Builder> CreateInterimBuilder(vcl::Window* 
pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 
nLOKWindowId = 0);
 
     static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, 
VclMessageType eMessageType,
-                                                    VclButtonsType 
eButtonType, const OUString& rPrimaryMessage,
-                                                    bool bMobile = false);
+                                                    VclButtonsType 
eButtonType, const OUString& rPrimaryMessage);
 
     static weld::Window* GetFrameWeld(const 
css::uno::Reference<css::awt::XWindow>& rWindow);
 
diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx
index 79eb9b75a334..f28da4a1c50b 100644
--- a/sc/inc/validat.hxx
+++ b/sc/inc/validat.hxx
@@ -30,6 +30,8 @@ struct RefUpdateContext;
 
 }
 
+namespace vcl { class ILibreOfficeKitNotifier; }
+
 class ScPatternAttr;
 class ScTokenArray;
 class ScTypedStrData;
@@ -80,6 +82,8 @@ private:
 
     using ScConditionEntry::operator==;
 
+    DECL_STATIC_LINK(ScValidationData, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
+
 public:
             ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
                                 const OUString& rExpr1, const OUString& rExpr2,
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 79f21d8de202..08f77ad4f862 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -366,6 +366,11 @@ void ScValidationData::DoCalcError( ScFormulaCell* pCell ) 
const
         DoMacro( pCell->aPos, OUString(), pCell, nullptr );
 }
 
+IMPL_STATIC_LINK_NOARG(ScValidationData, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+{
+    return SfxViewShell::Current();
+}
+
     // true -> abort
 
 bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput,
@@ -399,12 +404,10 @@ bool ScValidationData::DoError(weld::Window* pParent, 
const OUString& rInput,
             break;
     }
 
-    bool bIsMobile = comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current()
-                        && SfxViewShell::Current()->isLOKMobilePhone();
-
     std::unique_ptr<weld::MessageDialog> 
xBox(Application::CreateMessageDialog(pParent, eType,
-                                              eStyle, aMessage, bIsMobile));
+                                              eStyle, aMessage));
     xBox->set_title(aTitle);
+    xBox->SetInstallLOKNotifierHdl(LINK(nullptr, ScValidationData, 
InstallLOKNotifierHdl));
 
     switch (eErrorStyle)
     {
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 3d3adb84bfe4..f225315d6ecd 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -413,8 +413,7 @@ IMPL_STATIC_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, 
StarBASIC*, pStarBas
                            pViewFrame ? pViewFrame->GetFrameWeld() : nullptr,
                            VclMessageType::Error,
                            VclButtonsType::Ok,
-                           aError,
-                           true));
+                           aError));
 
             xBox->runAsync(xBox, [](sal_Int32 /*nResult*/) {});
         }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 51566201638d..c7885c369249 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1175,11 +1175,15 @@ weld::MessageDialog* 
JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParen
 
         std::string sWindowId = 
std::to_string(xMessageDialog->GetLOKWindowId());
         InsertWindowToMap(sWindowId);
-    }
+        xMessageDialog->SetLOKTunnelingState(false);
 
-    xMessageDialog->SetLOKTunnelingState(false);
+        return new JSMessageDialog(xMessageDialog, nullptr, true);
+    }
+    else
+        SAL_WARN("vcl", "No notifier in 
JSInstanceBuilder::CreateMessageDialog");
 
-    return new JSMessageDialog(xMessageDialog, nullptr, true);
+    // fallback
+    return new SalInstanceMessageDialog(xMessageDialog, nullptr, true);
 }
 
 JSDialog::JSDialog(JSDialogSender* pSender, ::Dialog* pDialog, 
SalInstanceBuilder* pBuilder,
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 82002d44f1d4..55c5fca696ad 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -212,8 +212,7 @@ std::unique_ptr<weld::Builder> 
Application::CreateInterimBuilder(vcl::Window* pP
 }
 
 weld::MessageDialog* Application::CreateMessageDialog(weld::Widget* pParent, 
VclMessageType eMessageType,
-                                                      VclButtonsType 
eButtonType, const OUString& rPrimaryMessage,
-                                                      bool /*bMobile*/)
+                                                      VclButtonsType 
eButtonType, const OUString& rPrimaryMessage)
 {
     if (comphelper::LibreOfficeKit::isActive())
         return JSInstanceBuilder::CreateMessageDialog(pParent, eMessageType, 
eButtonType, rPrimaryMessage);
commit cc487218ae05fd05265191253d44b098ea6ace5f
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Nov 30 17:53:34 2022 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Jan 3 06:36:00 2023 +0000

    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