diff options
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r-- | sc/source/filter/excel/xehelper.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 79da723f7a40..f58d19291866 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -908,6 +908,11 @@ OUString lclEncodeDosUrl( aBuf.append(EXC_URL_DOSDRIVE).append(cDrive); aOldUrl = aOldUrl.copy(3); } + else + { + // URL probably points to a document on a Unix-like file system + aBuf.append(EXC_URL_DRIVEROOT); + } // directories sal_Int32 nPos = -1; @@ -949,6 +954,11 @@ OUString lclEncodeDosUrl( if (pTableName) aBuf.append(*pTableName); + // VirtualPath must be shorter than 255 chars ([MS-XLS].pdf 2.5.277) + // It's better to truncate, than generate invalid file that Excel cannot open. + if (aBuf.getLength() > 255) + aBuf.setLength(255); + return aBuf.makeStringAndClear(); } |