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 <xiscofauli@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 0000000..80e0d9c
--- /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 1619f7b..ebdb2bd 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);