sc/qa/unit/tiledrendering/tiledrendering.cxx              |   25 --------------
 sc/qa/unit/tiledrendering/tiledrendering2.cxx             |   15 +++++++-
 sc/qa/unit/tiledrendering/tiledrenderingmodeltestbase.cxx |   25 ++++++++++++++
 sc/source/ui/docshell/docsh6.cxx                          |    5 ++
 4 files changed, 43 insertions(+), 27 deletions(-)

New commits:
commit d6135b62ee9716f120e6ba347503cc222e364829
Author:     Jaume Pujantell <jaume.pujant...@collabora.com>
AuthorDate: Tue Apr 1 16:02:55 2025 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Apr 2 14:12:52 2025 +0200

    cool#11497 lok: calc: update separators per locale
    
    On LOK, multiple locales might be in use at the same time, so skipping
    the update of native symbols and separators on load is not viable.
    
    I've also tested the original bug for which this code is skipped and it
    seem to not affect online in the same way.
    
    Change-Id: Ic2e6e329c9bdfb55f6a5fdd540d102c05ac168cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183594
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 8d5280ea3128..788e047eb1a9 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -28,7 +28,6 @@
 #include <sfx2/childwin.hxx>
 #include <sfx2/lokhelper.hxx>
 #include <svx/svdpage.hxx>
-#include <vcl/scheduler.hxx>
 #include <vcl/vclevent.hxx>
 #include <vcl/virdev.hxx>
 #include <sc.hrc>
@@ -1406,30 +1405,6 @@ static Bitmap getTile(ScModelObj* pModelObj, int 
nTilePosX, int nTilePosY, tools
     return xDevice->GetBitmap(Point(0, 0), Size(nTileSize, nTileSize));
 }
 
-namespace
-{
-void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, 
ScTabViewShell* pView,
-    ScModelObj* pModelObj, bool bInEdit = false, bool bCommit = true)
-{
-    if (!bInEdit)
-        pView->SetCursor(nCol, nRow);
-
-    for (const char& cChar : aStr)
-    {
-        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, cChar, 0);
-        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, cChar, 0);
-        Scheduler::ProcessEventsToIdle();
-    }
-
-    if (bCommit)
-    {
-        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
-        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
-        Scheduler::ProcessEventsToIdle();
-    }
-}
-} //namespace
-
 CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSheetChangeNoInvalidation)
 {
     const bool oldPartInInvalidation = 
comphelper::LibreOfficeKit::isPartInInvalidation();
diff --git a/sc/qa/unit/tiledrendering/tiledrendering2.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering2.cxx
index dd3529df8187..141c6f58985f 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering2.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering2.cxx
@@ -11,7 +11,6 @@
 
 #include <com/sun/star/datatransfer/XTransferable2.hpp>
 
-#include <vcl/scheduler.hxx>
 #include <comphelper/propertyvalue.hxx>
 #include <comphelper/propertysequence.hxx>
 
@@ -106,6 +105,20 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testCursorJumpOnFailedSearch)
     CPPUNIT_ASSERT_EQUAL(aInitialCursor, aFinalCursor);
 }
 
+CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testLocaleFormulaSeparator)
+{
+    ScModelObj* pModelObj = createDoc("empty.ods");
+    ScTabViewShell* pView = 
dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+    ScDocument* pDoc = pModelObj->GetDocument();
+
+    ScAddress addr(2, 0, 0);
+    lcl_typeCharsInCell("=subtotal(9,A1:A8", addr.Col(), addr.Row(), pView, 
pModelObj, false, true);
+    // Without the fix it would fail with
+    // - Expected: 0
+    // - Actual  : Err:508
+    CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(addr));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/tiledrendering/tiledrenderingmodeltestbase.cxx 
b/sc/qa/unit/tiledrendering/tiledrenderingmodeltestbase.cxx
index 9fa272789780..62187ad6a23b 100644
--- a/sc/qa/unit/tiledrendering/tiledrenderingmodeltestbase.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrenderingmodeltestbase.cxx
@@ -17,6 +17,7 @@
 #include <tabvwsh.hxx>
 #include <test/lokcallback.hxx>
 #include <docuno.hxx>
+#include <vcl/scheduler.hxx>
 
 using namespace css;
 
@@ -462,4 +463,28 @@ public:
     }
 };
 
+namespace
+{
+void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, 
ScTabViewShell* pView,
+                         ScModelObj* pModelObj, bool bInEdit = false, bool 
bCommit = true)
+{
+    if (!bInEdit)
+        pView->SetCursor(nCol, nRow);
+
+    for (const char& cChar : aStr)
+    {
+        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, cChar, 0);
+        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, cChar, 0);
+        Scheduler::ProcessEventsToIdle();
+    }
+
+    if (bCommit)
+    {
+        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
+        pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
+        Scheduler::ProcessEventsToIdle();
+    }
+}
+} //namespace
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 687b943cbcb1..83538aeaab0d 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -434,7 +434,10 @@ void ScDocShell::SetFormulaOptions( const 
ScFormulaOptions& rOpt, bool bForLoadi
      * once, for the very first document, empty or loaded. */
     static bool bInitOnce = true;
 
-    if (!bForLoading || bInitOnce)
+    // LOKit may need to jugle different symbols lists for differents users so 
a
+    // single load is not enough, otherwise the wrong separators may be 
expected
+    // for the users locale
+    if (!bForLoading || bInitOnce || comphelper::LibreOfficeKit::isActive())
     {
         bool bForceInit = bInitOnce;
         bInitOnce = false;

Reply via email to