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/filter/dif/difimp.cxx | |
parent | 2e16eaf31c7a4849110020aebd5fbc97a1ab3e99 (diff) |
reduce use of UniString ctor from null-terminated unicodearray
Change-Id: I98361309ada084d8f78517ce88f210d785f59cc0
Diffstat (limited to 'sc/source/filter/dif/difimp.cxx')
-rw-r--r-- | sc/source/filter/dif/difimp.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 1ffae6a1cb40..7496db78ab8d 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -70,7 +70,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, sal_Bool bSyntErrWarn = false; sal_Bool bOverflowWarn = false; - String& rData = aDifParser.aData; + rtl::OUString aData = aDifParser.aData; sal_Bool bData = false; rIn.Seek( 0 ); @@ -83,7 +83,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, aPrgrsBar.Progress(); - bData = rData.Len() > 0; + bData = !aData.isEmpty(); switch( eTopic ) { @@ -92,7 +92,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, if( aDifParser.nVector != 0 || aDifParser.nVal != 1 ) bSyntErrWarn = sal_True; if( bData ) - pDoc->RenameTab( nBaseTab, rData ); + pDoc->RenameTab( nBaseTab, aData ); } break; case T_VECTORS: @@ -164,14 +164,14 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, if( ValidCol(nColCnt) && ValidRow(nRowCnt) ) { ScBaseCell* pCell; - if( DifParser::IsV( rData.GetBuffer() ) ) + if( DifParser::IsV( aData.getStr() ) ) { pCell = new ScValueCell( aDifParser.fVal ); if( !bPlain ) aAttrCache.SetNumFormat( nColCnt, nRowCnt, aDifParser.nNumFormat ); } - else if( rData == pKeyTRUE || rData == pKeyFALSE ) + else if( aData == pKeyTRUE || aData == pKeyFALSE ) { pCell = new ScValueCell( aDifParser.fVal ); if( bPlain ) @@ -180,12 +180,12 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, aAttrCache.SetNumFormat( nColCnt, nRowCnt, aDifParser.nNumFormat ); } - else if( rData == pKeyNA || rData == pKeyERROR ) - pCell = new ScStringCell( rData ); + else if( aData == pKeyNA || aData == pKeyERROR ) + pCell = new ScStringCell( aData ); else { String aTmp( RTL_CONSTASCII_USTRINGPARAM( "#IND: " )); - aTmp += rData; + aTmp += aData; aTmp += sal_Unicode('?'); pCell = new ScStringCell( aTmp ); } @@ -203,10 +203,10 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, if( ValidCol(nColCnt) && ValidRow(nRowCnt) ) { - if( rData.Len() > 0 ) + if (!aData.isEmpty()) { pDoc->PutCell( nColCnt, nRowCnt, nBaseTab, - ScBaseCell::CreateTextCell( rData, pDoc ), true ); + ScBaseCell::CreateTextCell( aData, pDoc ), true ); } } else @@ -434,7 +434,7 @@ DATASET DifParser::GetNumberDataset( const sal_Unicode* pPossibleNumericData ) else { // ...und zur Strafe mit'm Numberformatter... OSL_ENSURE( pNumFormatter, "-DifParser::GetNextDataset(): No Formatter, more fun!" ); - String aTestVal( pPossibleNumericData ); + rtl::OUString aTestVal( pPossibleNumericData ); sal_uInt32 nFormat = 0; double fTmpVal; if( pNumFormatter->IsNumberFormat( aTestVal, nFormat, fTmpVal ) ) |