sc/qa/uitest/calc_tests2/xmlSource.py |   35 ++++++++
 sc/qa/uitest/data/tdf146260.xml       |  139 ++++++++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+)

New commits:
commit db54b5e778828279394bbe310358e40dac27bf13
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Feb 15 13:29:10 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Feb 15 14:09:20 2023 +0000

    tdf#146260: sc: Add UItest
    
    Change-Id: I1ff644745344cb847fd0b4c7b20551ad189cb383
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147081
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/uitest/calc_tests2/xmlSource.py 
b/sc/qa/uitest/calc_tests2/xmlSource.py
index 59a3abd2b51d..26ca9ce2cd9b 100644
--- a/sc/qa/uitest/calc_tests2/xmlSource.py
+++ b/sc/qa/uitest/calc_tests2/xmlSource.py
@@ -89,4 +89,39 @@ class xmlSource(UITestCase):
             self.assertEqual("v2", get_cell_by_position(calc_doc, 0, 0, 
2).getString())
             self.assertEqual("v3", get_cell_by_position(calc_doc, 0, 0, 
3).getString())
 
+    def test_tdf146260(self):
+
+        with self.ui_test.create_doc_in_start_center("calc") as calc_doc:
+
+            with 
self.ui_test.execute_modeless_dialog_through_command(".uno:ManageXMLSource") as 
xDialog:
+
+                xSource = xDialog.getChild("selectsource")
+
+                with 
self.ui_test.execute_blocking_action(xSource.executeAction, args=('CLICK', ()), 
close_button="open") as xOpenDialog:
+                    xFileName = xOpenDialog.getChild("file_name")
+                    xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": 
get_url_for_data_file("tdf146260.xml")}))
+
+                xTree = xDialog.getChild("tree")
+                self.assertEqual('43', get_state_as_dict(xTree)["Children"])
+
+                xTree.getChild('0').executeAction("SELECT", tuple())
+                for i in range(5):
+                    xTree.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"DOWN"}))
+
+                self.assertEqual("Fp", 
get_state_as_dict(xTree)["SelectEntryText"])
+                self.assertEqual("38", 
get_state_as_dict(xTree)["SelectionCount"])
+
+                xEdit = xDialog.getChild("edit")
+                xEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "$A$1"}))
+
+            # Without the fix in place, this test would have failed with
+            # AssertionError: 'data' != ''
+            self.assertEqual("Djh", get_cell_by_position(calc_doc, 0, 0, 
0).getString())
+            self.assertEqual("Fpzl", get_cell_by_position(calc_doc, 0, 1, 
0).getString())
+
+            for i in range(1, 5):
+                # Without the fix in place, this test would have failed with
+                # AssertionError: '专用发票' != 'ר�÷�Ʊ'
+                self.assertEqual("专用发票", get_cell_by_position(calc_doc, 0, 1, 
i).getString())
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf146260.xml b/sc/qa/uitest/data/tdf146260.xml
new file mode 100644
index 000000000000..fc41f8d46374
--- /dev/null
+++ b/sc/qa/uitest/data/tdf146260.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="GBK"?>
+<Kp>
+    <Version>2.0</Version>
+    <Fpxx>
+        <Zsl>43</Zsl>
+        <Fpsj>
+            <Fp>
+                <Djh></Djh>
+                <Fpzl>ר�÷�Ʊ</Fpzl>
+                <Lbdm>210***3130</Lbdm>
+                <Fphm>01***724</Fphm>
+                <Kprq>202***02</Kprq>
+                <Gfmc>�Ϻ�***ҵ���޹�˾</Gfmc>
+                <Gfsh>913101***95811677F</Gfsh>
+                <Gfyhzh>�����Ϻ�����·֧��31001546***050004961</Gfyhzh>
+                <Gfdzdh>�Ϻ��в���·1***��A��10�� 021-62***662</Gfdzdh>
+                <Xfmc>����******���޹�˾</Xfmc>
+                <Xfsh>9121***826612142928</Xfsh>
+                <Xfyhzh>�й�ũҵ����***֧�� 50590***0003583</Xfyhzh>
+                <Xfdzdh>��***��  8922857</Xfdzdh>
+                <Hjje>94847.03</Hjje>
+                <Hjse>8536.23</Hjse>
+                <Bz></Bz>
+                <Kpr>��*��</Kpr>
+                <Fhr>��*Ӣ</Fhr>
+                <Skr>��*Ө</Skr>
+                <Spbmbbh>39.0</Spbmbbh>
+                <Hsbz>0</Hsbz>
+                <Spxx>
+                    <Sph>
+                        <Xh>1</Xh>
+                        <Spmc>*��****��������</Spmc>
+                        <Ggxh></Ggxh>
+                        <Jldw>kg</Jldw>
+                        <Spbm>1030107010100000000</Spbm>
+                        <Qyspbm>00005</Qyspbm>
+                        <Syyhzcbz>0</Syyhzcbz>
+                        <Lslbz></Lslbz>
+                        <Yhzcsm></Yhzcsm>
+                        <Dj>11.743119266055046</Dj>
+                        <Sl>169.2</Sl>
+                        <Je>1986.94</Je>
+                        <Slv>0.09</Slv>
+                        <Se>178.82</Se>
+                    </Sph>
+                    <Sph>
+                        <Xh>2</Xh>
+                        <Spmc>*��****��������</Spmc>
+                        <Ggxh></Ggxh>
+                        <Jldw>kg</Jldw>
+                        <Spbm>1030107010100000000</Spbm>
+                        <Qyspbm>00005</Qyspbm>
+                        <Syyhzcbz>0</Syyhzcbz>
+                        <Lslbz></Lslbz>
+                        <Yhzcsm></Yhzcsm>
+                        <Dj>11.467889908256881</Dj>
+                        <Sl>385.4</Sl>
+                        <Je>4419.72</Je>
+                        <Slv>0.09</Slv>
+                        <Se>397.78</Se>
+                    </Sph>
+                    <Sph>
+                        <Xh>3</Xh>
+                        <Spmc>*��****��������</Spmc>
+                        <Ggxh></Ggxh>
+                        <Jldw>kg</Jldw>
+                        <Spbm>1030107010100000000</Spbm>
+                        <Qyspbm>00021</Qyspbm>
+                        <Syyhzcbz>0</Syyhzcbz>
+                        <Lslbz></Lslbz>
+                        <Yhzcsm></Yhzcsm>
+                        <Dj>10.550458715596330</Dj>
+                        <Sl>500</Sl>
+                        <Je>5275.23</Je>
+                        <Slv>0.09</Slv>
+                        <Se>474.77</Se>
+                    </Sph>
+                    <Sph>
+                        <Xh>4</Xh>
+                        <Spmc>*��****��������</Spmc>
+                        <Ggxh></Ggxh>
+                        <Jldw>kg</Jldw>
+                        <Spbm>1030107010100000000</Spbm>
+                        <Qyspbm>00015</Qyspbm>
+                        <Syyhzcbz>0</Syyhzcbz>
+                        <Lslbz></Lslbz>
+                        <Yhzcsm></Yhzcsm>
+                        <Dj>33.944954128440367</Dj>
+                        <Sl>2450</Sl>
+                        <Je>83165.14</Je>
+                        <Slv>0.09</Slv>
+                        <Se>7484.86</Se>
+                    </Sph>
+                </Spxx>
+            </Fp>
+            <Fp>
+                <Djh></Djh>
+                <Fpzl>��ͨ��Ʊ</Fpzl>
+                <Lbdm>0210***00404</Lbdm>
+                <Fphm>47***608</Fphm>
+                <Kprq>20***802</Kprq>
+                <Gfmc>�Ϻ�***ʳƷ���޹�˾</Gfmc>
+                <Gfsh>9131011***1334373K</Gfsh>
+                <Gfyhzh>���������Ϻ�����ɽ·֧��  10012469***06906246</Gfyhzh>
+                <Gfdzdh>�Ϻ���������ͨ·4***Ū4��18¥  52***0300</Gfdzdh>
+                <Xfmc>����***���޹�˾</Xfmc>
+                <Xfsh>91210******12142928</Xfsh>
+                <Xfyhzh>�й�ũҵ����***֧�� 50590***0003583</Xfyhzh>
+                <Xfdzdh>��***��  8922857</Xfdzdh>
+                <Hjje>87590.64</Hjje>
+                <Hjse>7883.16</Hjse>
+                <Bz></Bz>
+                <Kpr>��*��</Kpr>
+                <Fhr>��*Ӣ</Fhr>
+                <Skr>��*Ө</Skr>
+                <Spbmbbh>39.0</Spbmbbh>
+                <Hsbz>0</Hsbz>
+                <Spxx>
+                    <Sph>
+                        <Xh>1</Xh>
+                        <Spmc>*��***��������</Spmc>
+                        <Ggxh></Ggxh>
+                        <Jldw>kg</Jldw>
+                        <Spbm>1030107010100000000</Spbm>
+                        <Qyspbm>00002</Qyspbm>
+                        <Syyhzcbz>0</Syyhzcbz>
+                        <Lslbz></Lslbz>
+                        <Yhzcsm></Yhzcsm>
+                        <Dj>10.642201834862385</Dj>
+                        <Sl>8230.5</Sl>
+                        <Je>87590.64</Je>
+                        <Slv>0.09</Slv>
+                        <Se>7883.16</Se>
+                    </Sph>
+                </Spxx>
+            </Fp>
+        </Fpsj>
+    </Fpxx>
+</Kp>

Reply via email to