xls: DefColWidth without pColRowBuff

Change-Id: I36f9439e417b380bd3f999c02c55c29337796002
(cherry picked from commit 9b738520316b329251a9f815751fda4e25d25937)
Reviewed-on: https://gerrit.libreoffice.org/19103
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
diff --git a/sc/qa/unit/data/xls/pass/crash-2.xls b/sc/qa/unit/data/xls/pass/crash-2.xls
new file mode 100644
index 0000000..99e485a
--- /dev/null
+++ b/sc/qa/unit/data/xls/pass/crash-2.xls
Binary files differ
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index a08bd14..34dc2c9 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -660,6 +660,12 @@ void ImportExcel::DefColWidth()
    // stored as entire characters -> convert to 1/256 of characters (as in COLINFO)
    double fDefWidth = 256.0 * maStrm.ReaduInt16();

    if (!pColRowBuff)
    {
        SAL_WARN("sc", "*ImportExcel::DefColWidth(): pColRowBuff is NULL!");
        return;
    }

    // #i3006# additional space for default width - Excel adds space depending on font size
    long nFontHt = GetFontBuffer().GetAppFontData().mnHeight;
    fDefWidth += XclTools::GetXclDefColWidthCorrection( nFontHt );