xlsx export: limit dataValidation list to 255 chars, not 254

related to tdf#99856 commit b139bf96574010f317c543bc45d23dd6a5810621
which had a logic failure, caused by investigating too many
alternative ways of fixing.

Change-Id: I6ffce8c0bc10c992804cb5d8c75441da1a4c3d37
Reviewed-on: https://gerrit.libreoffice.org/38051
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
diff --git a/sc/qa/unit/data/ods/tdf99856_dataValidationTest.ods b/sc/qa/unit/data/ods/tdf99856_dataValidationTest.ods
index 4faf626..b5e036e 100644
--- a/sc/qa/unit/data/ods/tdf99856_dataValidationTest.ods
+++ b/sc/qa/unit/data/ods/tdf99856_dataValidationTest.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 5685108..253134d 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -470,7 +470,7 @@ void ScExportTest::testTdf99856_dataValidationTest()
    std::vector<ScTypedStrData> aList;
    pData->FillSelectionList(aList, ScAddress(0, 1, 1));
    CPPUNIT_ASSERT_EQUAL(size_t(18), aList.size());
    CPPUNIT_ASSERT_EQUAL(OUString("18 Missi"), aList[17].GetString());
    CPPUNIT_ASSERT_EQUAL(OUString("18 Missis"), aList[17].GetString());

    xDocSh->DoClose();
}
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 4c5907c..706dcb6 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1675,7 +1675,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
                    sal_uInt32 nLen = sFormulaBuf.getLength();
                    if( nLen > 256 )  // 255 + beginning quote mark
                    {
                        nLen = 255;
                        nLen = 256;
                        if( sFormulaBuf[nLen - 1] == ',' )
                            --nLen;
                        sFormulaBuf = sFormulaBuf.copy(0, nLen);