sc/qa/unit/data/csv/tdf148423.csv       |    2 ++
 sc/qa/unit/subsequent_filters_test2.cxx |   17 +++++++++++++++++
 2 files changed, 19 insertions(+)

New commits:
commit 58e156bc54177d0ed60f50181640f62189f72ac4
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Apr 12 11:19:55 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Apr 12 14:49:33 2022 +0200

    tdf#148423: subsequent_filters_test2: Add unittest
    
    Change-Id: If630a0e0fe6370212c9d54a58b1b84dbe8b2dc64
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132892
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/unit/data/csv/tdf148423.csv 
b/sc/qa/unit/data/csv/tdf148423.csv
new file mode 100644
index 000000000000..80e0d9cccc8c
--- /dev/null
+++ b/sc/qa/unit/data/csv/tdf148423.csv
@@ -0,0 +1,2 @@
+Column 1       Column 2
+longLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONGlongLONG
       short
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index 1619f7b54128..ebdb2bd84a52 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -165,6 +165,7 @@ public:
     void testVBAMacroFunctionODS();
     void testAutoheight2Rows();
     void testXLSDefColWidth();
+    void testTdf148423();
     void testPreviewMissingObjLink();
     void testShapeRotationImport();
     void testShapeDisplacementOnRotationImport();
@@ -278,6 +279,7 @@ public:
     CPPUNIT_TEST(testVBAMacroFunctionODS);
     CPPUNIT_TEST(testAutoheight2Rows);
     CPPUNIT_TEST(testXLSDefColWidth);
+    CPPUNIT_TEST(testTdf148423);
     CPPUNIT_TEST(testPreviewMissingObjLink);
     CPPUNIT_TEST(testShapeRotationImport);
     CPPUNIT_TEST(testShapeDisplacementOnRotationImport);
@@ -2428,6 +2430,21 @@ void ScFiltersTest2::testXLSDefColWidth()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest2::testTdf148423()
+{
+    ScDocShellRef xDocSh = loadDoc(u"tdf148423.", FORMAT_CSV);
+    ScDocument& rDoc = xDocSh->GetDocument();
+
+    int nWidth = rDoc.GetColWidth(0, 0, false);
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: 32880
+    // - Actual  : 112
+    CPPUNIT_ASSERT_EQUAL(32880, nWidth);
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest2::testPreviewMissingObjLink()
 {
     ScDocShellRef xDocSh = loadDoc(u"keep-preview-missing-obj-link.", 
FORMAT_ODS);

Reply via email to