diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-14 00:07:31 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-15 03:08:18 +0100 |
commit | 48545bb3952e000d72e7c3b1719e4c526b289650 (patch) | |
tree | 32530b1f4973360c4ea8a23a9f1659a9ccb9b780 /sc | |
parent | 03e0375864f86312fff89e281fa417bdbc51fd6d (diff) |
fix crash related to hyperlink export, related #i20491#
Export of ooo20491-7.ods as xlsx
Change-Id: I43e1fd6dcb4bfbefea68c0b0a24c7ad0890d9efb
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 21394c56091b..327ef0ef8265 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -415,12 +415,15 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU OUString aTextMark( rUrl.copy( 1 ) ); sal_Int32 nSepPos = aTextMark.indexOf( '.' ); - aTextMark = aTextMark.replaceAt( nSepPos, 1, "!" ); - OUString aSheetName( aTextMark.copy(0, nSepPos)); - - if ( aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'') + if(nSepPos != -1) { - aTextMark = "'" + aTextMark.replaceAt(nSepPos, 0, "'"); + aTextMark = aTextMark.replaceAt( nSepPos, 1, "!" ); + OUString aSheetName( aTextMark.copy(0, nSepPos)); + + if ( aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'') + { + aTextMark = "'" + aTextMark.replaceAt(nSepPos, 0, "'"); + } } mxTextMark.reset( new XclExpString( aTextMark, EXC_STR_FORCEUNICODE, 255 ) ); |