sc/source/ui/app/inputhdl.cxx |   14 ++++++++++++++
 sc/source/ui/inc/tabvwsh.hxx  |    1 +
 2 files changed, 15 insertions(+)

New commits:
commit d0f1f8b6c42f2f3ba83578a31853d38b7a64bcaf
Author:     Gökay Şatır <gokaysa...@collabora.com>
AuthorDate: Thu Jan 30 19:04:38 2025 +0300
Commit:     Gökay ŞATIR <gokaysa...@collabora.com>
CommitDate: Fri Feb 21 15:07:35 2025 +0100

    cool#11072: Send current cell's decimal separator.
    
    Calc: In a file with a language that uses "," as the decimal separator,
    using a keyboard with a layout that uses "." as decimal separator is 
difficult.
    Numbers are considered as string when it happens.
    Users should be able to use NumPad decimal separator regardless of the 
cell's current decimal separator.
    
    Change-Id: I35623661acb0f505597458b7ce55cfc2c3a4dace
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181993
    Reviewed-by: Gökay ŞATIR <gokaysa...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index e778d27886c0..edeaca798434 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -47,6 +47,7 @@
 #include <sfx2/printer.hxx>
 #include <svl/numformat.hxx>
 #include <svl/zforlist.hxx>
+#include <svtools/langtab.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/charclass.hxx>
 #include <utility>
@@ -1858,6 +1859,18 @@ void ScTabViewShell::LOKSendFormulabarUpdate(EditView* 
pActiveView,
     maSendFormulabarUpdate.m_aText = rText;
     maSendFormulabarUpdate.m_aSelection = aSelection;
     maSendFormulabarUpdate.m_nTimeStamp = now;
+
+    ScViewData& rViewData = this->GetViewData();
+    const ScDocument& rDoc = rViewData.GetDocShell()->GetDocument();
+    const ScPatternAttr* pPattern = rDoc.GetPattern(rViewData.GetCurX(), 
rViewData.GetCurY(), rViewData.GetRefTabNo());
+
+    if (pPattern)
+    {
+        SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
+        sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
+        maSendFormulabarUpdate.m_separator = 
pFormatter->GetFormatDecimalSep(nFormat);
+    }
+
     maSendFormulabarUpdate.Send();
 }
 
@@ -1867,6 +1880,7 @@ void ScTabViewShell::SendFormulabarUpdate::Send()
     (*pData)["action_type"_ostr] = "setText";
     (*pData)["text"_ostr] = m_aText;
     (*pData)["selection"_ostr] = m_aSelection;
+    (*pData)["separator"_ostr] = m_separator;
     OUString sWindowId = OUString::number(m_nShellId) + "formulabar";
     jsdialog::SendAction(sWindowId, u"sc_input_window"_ustr, std::move(pData));
 }
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 842474dd7af7..5a562431f473 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -110,6 +110,7 @@ private:
         OUString m_aText;
         OUString m_aSelection;
         sal_uInt64 m_nShellId;
+        OUString m_separator;
         std::chrono::steady_clock::time_point m_nTimeStamp;
 
         SendFormulabarUpdate()

Reply via email to