diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-12 13:40:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-13 11:20:23 +0100 |
commit | 6191fa0847ac5b27083efe1a8c6cd84d080a638c (patch) | |
tree | b107ce00125d0d204e5c32f6c472e70c73182bb2 /sc/source/ui/docshell/impex.cxx | |
parent | 2e16eaf31c7a4849110020aebd5fbc97a1ab3e99 (diff) |
reduce use of UniString ctor from null-terminated unicodearray
Change-Id: I98361309ada084d8f78517ce88f210d785f59cc0
Diffstat (limited to 'sc/source/ui/docshell/impex.cxx')
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index c7eaf379a1cc..73015c3ddab8 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1751,16 +1751,16 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) switch( ch ) { case 'X': - nCol = static_cast<SCCOL>(String( p ).ToInt32()) + nStartCol - 1; + nCol = static_cast<SCCOL>(rtl::OUString(p).toInt32()) + nStartCol - 1; break; case 'Y': - nRow = String( p ).ToInt32() + nStartRow - 1; + nRow = rtl::OUString(p).toInt32() + nStartRow - 1; break; case 'C': - nRefCol = static_cast<SCCOL>(String( p ).ToInt32()) + nStartCol - 1; + nRefCol = static_cast<SCCOL>(rtl::OUString(p).toInt32()) + nStartCol - 1; break; case 'R': - nRefRow = String( p ).ToInt32() + nStartRow - 1; + nRefRow = rtl::OUString(p).toInt32() + nStartRow - 1; break; case 'K': { @@ -1871,10 +1871,10 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) switch( ch ) { case 'X': - nCol = static_cast<SCCOL>(String( p ).ToInt32()) + nStartCol - 1; + nCol = static_cast<SCCOL>(rtl::OUString(p).toInt32()) + nStartCol - 1; break; case 'Y': - nRow = String( p ).ToInt32() + nStartRow - 1; + nRow = rtl::OUString(p).toInt32() + nStartRow - 1; break; case 'P' : if ( bData ) @@ -1913,16 +1913,11 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { if ( bData && *p == ';' && *(p+1) == 'P' ) { - String aCode( p+2 ); + rtl::OUString aCode( p+2 ); // unescape doubled semicolons - xub_StrLen nPos = 0; - String aSemicolon( RTL_CONSTASCII_USTRINGPARAM(";;")); - while ( (nPos = aCode.Search( aSemicolon, nPos )) != STRING_NOTFOUND ) - aCode.Erase( nPos++, 1 ); + aCode = aCode.replaceAll(";;", ";"); // get rid of Xcl escape characters - nPos = 0; - while ( (nPos = aCode.Search( sal_Unicode(0x1b), nPos )) != STRING_NOTFOUND ) - aCode.Erase( nPos, 1 ); + aCode = aCode.replaceAll(rtl::OUString(static_cast<sal_Unicode>(0x1b)), rtl::OUString()); xub_StrLen nCheckPos; short nType; sal_uInt32 nKey; |