summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-08-26 19:33:59 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-08-26 19:34:42 -0400
commit69841530937c5a110bd37fe7c0c600a19551ed07 (patch)
treec0d8ca5e4ca5c0f8c8e81f0a7918b09c2b4f36bc /sc/source/filter
parentf952331f0cf11f624d1df7c1c5a7468c16ffdc82 (diff)
String to rtl::OUString.
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/dif/difexp.cxx25
-rw-r--r--sc/source/filter/excel/excdoc.cxx2
-rw-r--r--sc/source/filter/excel/read.cxx4
-rw-r--r--sc/source/filter/excel/xehelper.cxx6
-rw-r--r--sc/source/filter/excel/xelink.cxx6
-rw-r--r--sc/source/filter/excel/xipage.cxx14
-rw-r--r--sc/source/filter/html/htmlexp.cxx4
-rw-r--r--sc/source/filter/inc/xehelper.hxx2
-rw-r--r--sc/source/filter/inc/xelink.hxx4
-rw-r--r--sc/source/filter/inc/xepivot.hxx4
-rw-r--r--sc/source/filter/lotus/lotread.cxx10
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx7
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.cxx25
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx6
14 files changed, 62 insertions, 57 deletions
diff --git a/sc/source/filter/dif/difexp.cxx b/sc/source/filter/dif/difexp.cxx
index 6e530505074d..980ca093f1fa 100644
--- a/sc/source/filter/dif/difexp.cxx
+++ b/sc/source/filter/dif/difexp.cxx
@@ -108,7 +108,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
FltError eRet = eERR_OK;
String aOS;
- String aString;
+ rtl::OUString aString;
SCCOL nEndCol = rRange.aEnd.Col();
SCROW nEndRow = rRange.aEnd.Row();
SCCOL nNumCols = nEndCol - rRange.aStart.Col() + 1;
@@ -130,7 +130,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
aOS.AppendAscii( "\n0,1\n\"" );
pDoc->GetName( nTab, aString );
- aOS += aString;
+ aOS.Append(String(aString));
aOS.AppendAscii( "\"\n" );
rOut.WriteUnicodeOrByteText( aOS );
@@ -190,7 +190,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
else
{
pDoc->GetInputString( nColCnt, nRowCnt, nTab, aString );
- aOS += aString;
+ aOS.Append(String(aString));
}
aOS.AppendAscii( "\nV\n" );
break;
@@ -199,7 +199,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
bWriteStringData = true;
break;
case CELLTYPE_STRING:
- ( ( ScStringCell* ) pAkt )->GetString( aString );
+ aString = static_cast<ScStringCell*>(pAkt)->GetString();
bWriteStringData = true;
break;
case CELLTYPE_FORMULA:
@@ -218,13 +218,13 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
else
{
pDoc->GetInputString( nColCnt, nRowCnt, nTab, aString );
- aOS += aString;
+ aOS.Append(String(aString));
}
aOS.AppendAscii( "\nV\n" );
}
else if( pAkt->HasStringData() )
{
- ( ( ScFormulaCell * ) pAkt )->GetString( aString );
+ static_cast<ScFormulaCell*>(pAkt)->GetString(aString);
bWriteStringData = true;
}
else
@@ -245,24 +245,25 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
// sc/source/ui/docsh.cxx:ScDocShell::AsciiSave()
// In fact we should create a common method if this would be
// needed just one more time..
+ String aTmpStr = aString;
aOS.AssignAscii( pStringData );
rOut.WriteUnicodeOrByteText( aOS, eCharSet );
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
- xub_StrLen nPos = aString.Search( cStrDelim );
+ xub_StrLen nPos = aTmpStr.Search( cStrDelim );
while ( nPos != STRING_NOTFOUND )
{
- aString.Insert( cStrDelim, nPos );
- nPos = aString.Search( cStrDelim, nPos+2 );
+ aTmpStr.Insert( cStrDelim, nPos );
+ nPos = aTmpStr.Search( cStrDelim, nPos+2 );
}
rOut.WriteUniOrByteChar( cStrDelim, eCharSet );
- rOut.WriteUnicodeText( aString );
+ rOut.WriteUnicodeText(aTmpStr);
rOut.WriteUniOrByteChar( cStrDelim, eCharSet );
}
else if ( bContextOrNotAsciiEncoding )
{
// to byte encoding
- ByteString aStrEnc( aString, eCharSet );
+ ByteString aStrEnc( aTmpStr, eCharSet );
// back to Unicode
UniString aStrDec( aStrEnc, eCharSet );
// search on re-decoded string
@@ -280,7 +281,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
}
else
{
- ByteString aStrEnc( aString, eCharSet );
+ ByteString aStrEnc( aTmpStr, eCharSet );
// search on encoded string
xub_StrLen nPos = aStrEnc.Search( aStrDelimEncoded );
while ( nPos != STRING_NOTFOUND )
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index c5cc14b75089..7e29312e34de 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -193,7 +193,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
Add( new ExcBofW8 );
SCTAB nC;
- String aTmpString;
+ rtl::OUString aTmpString;
SCTAB nScTabCount = rTabInfo.GetScTabCount();
sal_uInt16 nExcTabCount = rTabInfo.GetXclTabCount();
sal_uInt16 nCodenames = static_cast< sal_uInt16 >( GetExtDocOptions().GetCodeNameCount() );
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index e5284f3211f2..6d7c36c56ecd 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -1092,7 +1092,7 @@ FltError ImportExcel8::Read( void )
case 0x0A: // EOF [ 2345 ]
{
eAkt = EXC_STATE_SHEET;
- String sName;
+ rtl::OUString sName;
GetDoc().GetName( GetCurrScTab(), sName );
if ( !bSheetHasCodeName )
{
@@ -1101,7 +1101,7 @@ FltError ImportExcel8::Read( void )
}
else
{
- String sCodeName;
+ rtl::OUString sCodeName;
GetDoc().GetCodeName( GetCurrScTab(), sCodeName );
OSL_TRACE("Have CodeName %s for SheetName %s",
rtl::OUStringToOString( sCodeName, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() );
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index df2c4bc0992d..f36d318951f0 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -955,7 +955,7 @@ bool lclConvertToDos( String& rUrl, const String& rBasePath, bool bSaveRelUrl )
/** Encodes special parts of the URL, i.e. directory separators and volume names.
@param pTableName Pointer to a table name to be encoded in this URL, or 0. */
-void lclEncodeDosUrl( XclBiff eBiff, String& rUrl, const String* pTableName = 0 )
+void lclEncodeDosUrl( XclBiff eBiff, String& rUrl, const rtl::OUString* pTableName = 0 )
{
if( rUrl.Len() )
{
@@ -1010,14 +1010,14 @@ void lclEncodeDosUrl( XclBiff eBiff, String& rUrl, const String* pTableName = 0
// table name
if( pTableName )
- rUrl.Append( *pTableName );
+ rUrl.Append(String(*pTableName));
}
} // namespace
// ----------------------------------------------------------------------------
-String XclExpUrlHelper::EncodeUrl( const XclExpRoot& rRoot, const String& rAbsUrl, const String* pTableName )
+String XclExpUrlHelper::EncodeUrl( const XclExpRoot& rRoot, const String& rAbsUrl, const rtl::OUString* pTableName )
{
String aDosUrl( rAbsUrl );
if( !aDosUrl.Len() || lclConvertToDos( aDosUrl, rRoot.GetBasePath(), rRoot.IsRelUrl() ) )
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index 14092c71b94f..faaac1cd9b3e 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -782,10 +782,10 @@ bool XclExpTabInfo::IsMirroredTab( SCTAB nScTab ) const
return GetFlag( nScTab, EXC_TABBUF_MIRRORED );
}
-const String& XclExpTabInfo::GetScTabName( SCTAB nScTab ) const
+rtl::OUString XclExpTabInfo::GetScTabName( SCTAB nScTab ) const
{
OSL_ENSURE( nScTab < mnScCnt, "XclExpTabInfo::IsActiveTab - sheet out of range" );
- return (nScTab < mnScCnt) ? maTabInfoVec[ nScTab ].maScName : EMPTY_STRING;
+ return (nScTab < mnScCnt) ? maTabInfoVec[ nScTab ].maScName : rtl::OUString();
}
sal_uInt16 XclExpTabInfo::GetXclTab( SCTAB nScTab ) const
@@ -844,7 +844,7 @@ void XclExpTabInfo::CalcXclIndexes()
// result: first occur all exported sheets, followed by all external sheets
}
-typedef ::std::pair< String, SCTAB > XclExpTabName;
+typedef ::std::pair< rtl::OUString, SCTAB > XclExpTabName;
typedef ::std::vector< XclExpTabName > XclExpTabNameVec;
inline bool operator<( const XclExpTabName& rArg1, const XclExpTabName& rArg2 )
diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx
index 687daa9b3efe..07831f875875 100644
--- a/sc/source/filter/excel/xipage.cxx
+++ b/sc/source/filter/excel/xipage.cxx
@@ -226,14 +226,18 @@ void XclImpPageSettings::Finalize()
// *** create page style sheet ***
- String aStyleName( RTL_CONSTASCII_USTRINGPARAM( "PageStyle_" ) );
- String aTableName;
+ rtl::OUStringBuffer aStyleName;
+ aStyleName.appendAscii("PageStyle_");
+
+ rtl::OUString aTableName;
if( GetDoc().GetName( nScTab, aTableName ) )
- aStyleName.Append( aTableName );
+ aStyleName.append(aTableName);
else
- aStyleName.Append( String::CreateFromInt32( nScTab + 1 ) );
+ aStyleName.append(static_cast<sal_Int32>(nScTab+1));
+
+ ScStyleSheet& rStyleSheet = ScfTools::MakePageStyleSheet(
+ GetStyleSheetPool(), aStyleName.makeStringAndClear(), false);
- ScStyleSheet& rStyleSheet = ScfTools::MakePageStyleSheet( GetStyleSheetPool(), aStyleName, false );
SfxItemSet& rItemSet = rStyleSheet.GetItemSet();
// *** page settings ***
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 70d8ac866ad6..1aa0ce363681 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -443,7 +443,7 @@ void ScHTMLExport::WriteOverview()
OUT_STR( ScGlobal::GetRscString( STR_OVERVIEW ) );
TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_head1 );
- String aStr;
+ rtl::OUString aStr;
const SCTAB nCount = pDoc->GetTableCount();
for ( SCTAB nTab = 0; nTab < nCount; nTab++ )
@@ -665,7 +665,7 @@ void ScHTMLExport::WriteTables()
{
const SCTAB nTabCount = pDoc->GetTableCount();
const String aStrTable( ScResId( SCSTR_TABLE ) );
- String aStr;
+ rtl::OUString aStr;
String aStrOut;
SCCOL nStartCol;
SCROW nStartRow;
diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx
index f02e8ad12bc1..6f43a38d02e6 100644
--- a/sc/source/filter/inc/xehelper.hxx
+++ b/sc/source/filter/inc/xehelper.hxx
@@ -410,7 +410,7 @@ class XclExpUrlHelper : boost::noncopyable
public:
/** Encodes and returns the URL passed in rAbsUrl to an Excel like URL.
@param pTableName Optional pointer to a table name to be encoded in this URL. */
- static String EncodeUrl( const XclExpRoot& rRoot, const String& rAbsUrl, const String* pTableName = 0 );
+ static String EncodeUrl( const XclExpRoot& rRoot, const String& rAbsUrl, const rtl::OUString* pTableName = 0 );
/** Encodes and returns the passed DDE link to an Excel like DDE link. */
static String EncodeDde( const String& rApplic, const String rTopic );
diff --git a/sc/source/filter/inc/xelink.hxx b/sc/source/filter/inc/xelink.hxx
index 866151df28f5..6d056fd6e488 100644
--- a/sc/source/filter/inc/xelink.hxx
+++ b/sc/source/filter/inc/xelink.hxx
@@ -76,7 +76,7 @@ public:
/** Returns true, if the specified Calc sheet is displayed in right-to-left mode. */
bool IsMirroredTab( SCTAB nScTab ) const;
/** Returns the Calc name of the specified sheet. */
- const String& GetScTabName( SCTAB nScTab ) const;
+ rtl::OUString GetScTabName( SCTAB nScTab ) const;
/** Returns the Excel sheet index for a given Calc sheet. */
sal_uInt16 GetXclTab( SCTAB nScTab ) const;
@@ -114,7 +114,7 @@ private:
/** Data structure with infoemation about one Calc sheet. */
struct XclExpTabInfoEntry
{
- String maScName;
+ rtl::OUString maScName;
sal_uInt16 mnXclTab;
sal_uInt8 mnFlags;
inline explicit XclExpTabInfoEntry() : mnXclTab( 0 ), mnFlags( 0 ) {}
diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx
index 3279aa4ff290..b25609a2fbc4 100644
--- a/sc/source/filter/inc/xepivot.hxx
+++ b/sc/source/filter/inc/xepivot.hxx
@@ -242,8 +242,8 @@ private:
XclPCInfo maPCInfo; /// Pivot cache settings (SXDB record).
XclExpPCFieldList maFieldList; /// List of all pivot cache fields.
- String maTabName; /// Name of source data sheet.
- ::rtl::OUString maSrcRangeName; /// Range name for source data.
+ rtl::OUString maTabName; /// Name of source data sheet.
+ rtl::OUString maSrcRangeName; /// Range name for source data.
ScRange maOrigSrcRange; /// The original sheet source range.
ScRange maExpSrcRange; /// The exported sheet source range.
ScRange maDocSrcRange; /// The range used to build the cache fields and items.
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index 0a4fe4fd16d7..188e70d9d4fe 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -212,22 +212,22 @@ FltError ImportLotus::Read()
// duemmliche Namen eliminieren
SCTAB nTabs = pD->GetTableCount();
SCTAB nCnt;
- String aTabName;
- String aBaseName;
- String aRef( RTL_CONSTASCII_USTRINGPARAM( "temp" ) );
+ rtl::OUString aTabName;
+ rtl::OUString aBaseName;
+ rtl::OUString aRef( RTL_CONSTASCII_USTRINGPARAM( "temp" ) );
if( nTabs != 0 )
{
if( nTabs > 1 )
{
pD->GetName( 0, aBaseName );
- aBaseName.Erase( aBaseName.Len() - 1 );
+ aBaseName = aBaseName.copy(0, aBaseName.getLength()-1);
}
for( nCnt = 1 ; nCnt < nTabs ; nCnt++ )
{
OSL_ENSURE( pD->HasTable( nCnt ),
"-ImportLotus::Read(): Wo ist meine Tabelle?!" );
pD->GetName( nCnt, aTabName );
- if( aTabName == aRef )
+ if( aTabName.equals(aRef) )
{
aTabName = aBaseName;
pD->CreateValidTabName( aTabName );
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 00f0b63fe273..615fdc6d71ea 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1202,15 +1202,18 @@ ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab )
{
String sTmpName;
String sTmpComm;
+ rtl::OUString aTmp;
Color aDummyCol;
sal_uInt16 nFlags;
ScDocument& rDoc = rRoot.GetDoc();
- rDoc.GetName( nTab, sTmpName );
+ rDoc.GetName(nTab, aTmp);
+ sTmpName = aTmp;
sName.Assign( sTmpName, EXC_STR_8BITLENGTH );
nRecLen = 8 + sName.GetBufferSize();
- rDoc.GetScenarioData( nTab, sTmpComm, aDummyCol, nFlags );
+ rDoc.GetScenarioData( nTab, aTmp, aDummyCol, nFlags );
+ sTmpComm = aTmp;
sComment.Assign( sTmpComm, EXC_STR_DEFAULT, 255 );
if( sComment.Len() )
nRecLen += sComment.GetSize();
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx
index 0a0a825ceb31..9b7bf38ae9a2 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -81,14 +81,13 @@ XMLCodeNameProvider::~XMLCodeNameProvider()
return mpDoc->GetCodeName().Len() > 0;
SCTAB nCount = mpDoc->GetTableCount();
- String sName( aName );
- String sSheetName, sCodeName;
+ rtl::OUString sSheetName, sCodeName;
for( SCTAB i = 0; i < nCount; i++ )
{
- if( mpDoc->GetName( i, sSheetName ) && sSheetName == sName )
+ if( mpDoc->GetName( i, sSheetName ) && sSheetName.equals(aName) )
{
mpDoc->GetCodeName( i, sCodeName );
- return sCodeName.Len() > 0;
+ return !sCodeName.isEmpty();
}
}
@@ -111,15 +110,13 @@ uno::Any SAL_CALL XMLCodeNameProvider::getByName( const OUString& aName )
}
SCTAB nCount = mpDoc->GetTableCount();
- String sName( aName );
- String sSheetName, sCodeName;
+ rtl::OUString sSheetName, sCodeName;
for( SCTAB i = 0; i < nCount; i++ )
{
- if( mpDoc->GetName( i, sSheetName ) && sSheetName == sName )
+ if( mpDoc->GetName( i, sSheetName ) && sSheetName.equals(aName) )
{
mpDoc->GetCodeName( i, sCodeName );
- OUString sUCodeName( sCodeName );
- aProps[0].Value <<= sUCodeName;
+ aProps[0].Value <<= sCodeName;
aRet <<= aProps;
return aRet;
}
@@ -138,11 +135,11 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( )
if( mpDoc->GetCodeName().Len() )
aNames[nRealCount++] = msDocName;
- String sSheetName, sCodeName;
+ rtl::OUString sSheetName, sCodeName;
for( SCTAB i = 0; i < nCount; i++ )
{
mpDoc->GetCodeName( i, sCodeName );
- if( sCodeName.Len() > 0 )
+ if (!sCodeName.isEmpty())
{
if( mpDoc->GetName( i, sSheetName ) )
aNames[nRealCount++] = sSheetName;
@@ -168,11 +165,11 @@ uno::Type SAL_CALL XMLCodeNameProvider::getElementType( )
return sal_True;
SCTAB nCount = mpDoc->GetTableCount();
- String sSheetName, sCodeName;
+ rtl::OUString sSheetName, sCodeName;
for( SCTAB i = 0; i < nCount; i++ )
{
mpDoc->GetCodeName( i, sCodeName );
- if( sCodeName.Len() > 0 && mpDoc->GetName( i, sSheetName ) )
+ if (!sCodeName.isEmpty() && mpDoc->GetName(i, sSheetName))
return sal_True;
}
@@ -192,7 +189,7 @@ void XMLCodeNameProvider::set( const uno::Reference< container::XNameAccess>& xN
}
SCTAB nCount = pDoc->GetTableCount();
- String sSheetName;
+ rtl::OUString sSheetName;
for( SCTAB i = 0; i < nCount; i++ )
{
if( pDoc->GetName( i, sSheetName ) &&
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 782a7b167383..850173b3b234 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3635,7 +3635,7 @@ void ScXMLExport::WriteScenario()
{
if (pDoc && pDoc->IsScenario(static_cast<SCTAB>(nCurrentTable)))
{
- String sComment;
+ rtl::OUString sComment;
Color aColor;
sal_uInt16 nFlags;
pDoc->GetScenarioData(static_cast<SCTAB>(nCurrentTable), sComment, aColor, nFlags);
@@ -3658,8 +3658,8 @@ void ScXMLExport::WriteScenario()
rtl::OUString sRangeListStr;
ScRangeStringConverter::GetStringFromRangeList( sRangeListStr, pRangeList, pDoc, FormulaGrammar::CONV_OOO );
AddAttribute(XML_NAMESPACE_TABLE, XML_SCENARIO_RANGES, sRangeListStr);
- if (sComment.Len())
- AddAttribute(XML_NAMESPACE_TABLE, XML_COMMENT, rtl::OUString(sComment));
+ if (!sComment.isEmpty())
+ AddAttribute(XML_NAMESPACE_TABLE, XML_COMMENT, sComment);
SvXMLElementExport aElem(*this, XML_NAMESPACE_TABLE, XML_SCENARIO, sal_True, sal_True);
}
}