summaryrefslogtreecommitdiff
path: root/sc/source/core
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/core
parentf952331f0cf11f624d1df7c1c5a7468c16ffdc82 (diff)
String to rtl::OUString.
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/cell2.cxx14
-rw-r--r--sc/source/core/data/documen2.cxx8
-rw-r--r--sc/source/core/data/documen3.cxx2
-rw-r--r--sc/source/core/data/documen4.cxx10
-rw-r--r--sc/source/core/data/documen9.cxx2
-rw-r--r--sc/source/core/data/document.cxx42
-rw-r--r--sc/source/core/data/drwlayer.cxx6
-rw-r--r--sc/source/core/data/table1.cxx14
-rw-r--r--sc/source/core/tool/address.cxx8
-rw-r--r--sc/source/core/tool/chgtrack.cxx8
-rw-r--r--sc/source/core/tool/compiler.cxx26
-rw-r--r--sc/source/core/tool/interpr1.cxx55
-rw-r--r--sc/source/core/tool/rangelst.cxx2
13 files changed, 118 insertions, 79 deletions
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 63784e9846e4..648cd2365270 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -143,6 +143,13 @@ void ScEditCell::GetString( String& rString ) const
rString.Erase();
}
+void ScEditCell::GetString( rtl::OUString& rString ) const
+{
+ String aTmp;
+ GetString(aTmp);
+ rString = aTmp;
+}
+
void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr )
{
const struct {
@@ -530,6 +537,13 @@ void ScFormulaCell::GetString( String& rString )
rString.Erase();
}
+void ScFormulaCell::GetString( rtl::OUString& rString )
+{
+ String aTmp;
+ GetString(aTmp);
+ rString = aTmp;
+}
+
const ScMatrix* ScFormulaCell::GetMatrix()
{
if ( pDocument->GetAutoCalc() )
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index a08865ec12a3..2c6cee5e1bbd 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -559,7 +559,7 @@ void ScDocument::ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks )
if (pSourceDoc->maTabs[i])
if (!pMarks || pMarks->GetTableSelect(i))
{
- String aString;
+ rtl::OUString aString;
pSourceDoc->maTabs[i]->GetName(aString);
if ( i < static_cast<SCTAB>(maTabs.size()) )
{
@@ -805,7 +805,7 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
{
if (SC_TAB_APPEND == nNewPos || nNewPos >= static_cast<SCTAB>(maTabs.size()))
nNewPos = static_cast<SCTAB>(maTabs.size());
- String aName;
+ rtl::OUString aName;
GetName(nOldPos, aName);
// vorneweg testen, ob der Prefix als gueltig erkannt wird
@@ -932,7 +932,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
sal_Bool bValid = sal_True;
if (bInsertNew) // neu einfuegen
{
- String aName;
+ rtl::OUString aName;
pSrcDoc->GetName(nSrcPos, aName);
CreateValidTabName(aName);
bValid = InsertTab(nDestPos, aName);
@@ -1112,7 +1112,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
if( xLib.is() )
{
- String sSrcCodeName;
+ rtl::OUString sSrcCodeName;
pSrcDoc->GetCodeName( nSrcPos, sSrcCodeName );
rtl::OUString sRTLSource;
xLib->getByName( sSrcCodeName ) >>= sRTLSource;
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 80c801deb3b0..2825e7fa4ce7 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -366,7 +366,7 @@ bool ScDocument::IsDefaultTabBgColor( SCTAB nTab ) const
return true;
}
-void ScDocument::GetScenarioData( SCTAB nTab, String& rComment,
+void ScDocument::GetScenarioData( SCTAB nTab, rtl::OUString& rComment,
Color& rColor, sal_uInt16& rFlags ) const
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] && maTabs[nTab]->IsScenario())
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 4d95790df088..f821ccfb2cbc 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -998,8 +998,8 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
SCTAB nThisTab;
// Tabellen mit gleichen Namen vergleichen
- String aThisName;
- String aOtherName;
+ rtl::OUString aThisName;
+ rtl::OUString aOtherName;
for (nThisTab=0; nThisTab<nThisCount; nThisTab++)
{
SCTAB nOtherTab = SCTAB_MAX;
@@ -1010,7 +1010,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
if (!rOtherDoc.IsScenario(nTemp))
{
rOtherDoc.GetName( nTemp, aOtherName );
- if ( aThisName == aOtherName )
+ if ( aThisName.equals(aOtherName) )
nOtherTab = nTemp;
}
}
@@ -1068,11 +1068,11 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
sal_uLong n1,n2; // fuer AppendDeleteRange
//! ein Progress ueber alle Tabellen ???
- String aTabName;
+ rtl::OUString aTabName;
GetName( nThisTab, aTabName );
String aTemplate = ScGlobal::GetRscString(STR_PROGRESS_COMPARING);
String aProText = aTemplate.GetToken( 0, '#' );
- aProText += aTabName;
+ aProText.Append(String(aTabName));
aProText += aTemplate.GetToken( 1, '#' );
ScProgress aProgress( GetDocumentShell(),
aProText, 3*nThisEndRow ); // 2x FindOrder, 1x hier
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 0736e148c4d5..191ed190406e 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -163,7 +163,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
pDrawLayer->ScAddPage( nTab ); // always add page, with or without the table
if (maTabs[nTab])
{
- String aTabName;
+ rtl::OUString aTabName;
maTabs[nTab]->GetName(aTabName);
pDrawLayer->ScRenamePage( nTab, aTabName );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index e475d8aa8172..dcb95021d48c 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -169,7 +169,7 @@ sal_Bool ScDocument::HasTable( SCTAB nTab ) const
return false;
}
-bool ScDocument::GetName( SCTAB nTab, String& rName ) const
+bool ScDocument::GetName( SCTAB nTab, rtl::OUString& rName ) const
{
if (VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()))
if (maTabs[nTab])
@@ -177,19 +177,11 @@ bool ScDocument::GetName( SCTAB nTab, String& rName ) const
maTabs[nTab]->GetName( rName );
return true;
}
- rName.Erase();
+ rName = rtl::OUString();
return false;
}
-bool ScDocument::GetName( SCTAB nTab, OUString& rName ) const
-{
- String aTmp;
- bool bRet = GetName(nTab, aTmp);
- rName = aTmp;
- return bRet;
-}
-
-sal_Bool ScDocument::SetCodeName( SCTAB nTab, const String& rName )
+bool ScDocument::SetCodeName( SCTAB nTab, const rtl::OUString& rName )
{
if (VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()))
{
@@ -203,7 +195,7 @@ sal_Bool ScDocument::SetCodeName( SCTAB nTab, const String& rName )
return false;
}
-sal_Bool ScDocument::GetCodeName( SCTAB nTab, String& rName ) const
+bool ScDocument::GetCodeName( SCTAB nTab, rtl::OUString& rName ) const
{
if (VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()))
if (maTabs[nTab])
@@ -211,19 +203,19 @@ sal_Bool ScDocument::GetCodeName( SCTAB nTab, String& rName ) const
maTabs[nTab]->GetCodeName( rName );
return true;
}
- rName.Erase();
+ rName = rtl::OUString();
return false;
}
-sal_Bool ScDocument::GetTable( const String& rName, SCTAB& rTab ) const
+bool ScDocument::GetTable( const rtl::OUString& rName, SCTAB& rTab ) const
{
- String aUpperName = rName;
+ rtl::OUString aUpperName = rName;
ScGlobal::pCharClass->toUpper(aUpperName);
for (SCTAB i=0; i< static_cast<SCTAB>(maTabs.size()); i++)
if (maTabs[i])
{
- if ( maTabs[i]->GetUpperName() == aUpperName )
+ if (aUpperName.equals(maTabs[i]->GetUpperName()))
{
rTab = i;
return true;
@@ -294,7 +286,7 @@ sal_Bool ScDocument::ValidNewTabName( const String& rName ) const
for (; it != maTabs.end() && bValid; ++it)
if ( *it )
{
- String aOldName;
+ rtl::OUString aOldName;
(*it)->GetName(aOldName);
bValid = !ScGlobal::GetpTransliteration()->isEqual( rName, aOldName );
}
@@ -316,7 +308,7 @@ bool ScDocument::ValidNewTabName( const std::vector<String>& rNames ) const//TOD
{
for (nameIter = rNames.begin(); nameIter != rNames.end(); ++nameIter)
{
- String aOldName;
+ rtl::OUString aOldName;
(*it)->GetName(aOldName);
bValid = !ScGlobal::GetpTransliteration()->isEqual( *nameIter, aOldName );
}
@@ -371,6 +363,12 @@ void ScDocument::CreateValidTabName(String& rName) const
}
}
+void ScDocument::CreateValidTabName(rtl::OUString& rName) const
+{
+ String aTmp = rName;
+ CreateValidTabName(aTmp);
+ rName = aTmp;
+}
void ScDocument::CreateValidTabNames(std::vector<rtl::OUString>& aNames, SCTAB nCount) const
{
@@ -761,7 +759,7 @@ sal_Bool ScDocument::RenameTab( SCTAB nTab, const String& rName, sal_Bool /* bUp
for (i=0; (i< static_cast<SCTAB>(maTabs.size())) && bValid; i++)
if (maTabs[i] && (i != nTab))
{
- String aOldName;
+ rtl::OUString aOldName;
maTabs[i]->GetName(aOldName);
bValid = !ScGlobal::GetpTransliteration()->isEqual( rName, aOldName );
}
@@ -3053,6 +3051,12 @@ void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rSt
rString.Erase();
}
+void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
+{
+ String aTmp;
+ GetInputString(nCol, nRow, nTab, aTmp);
+ rString = aTmp;
+}
void ScDocument::GetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, double& rValue )
{
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 9e690fad0590..e5cac4b258cc 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1314,17 +1314,17 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
//#i110034# charts need correct sheet names for xml range conversion during load
//so the target sheet name is temporarily renamed (if we have any SdrObjects)
- String aDestTabName;
+ rtl::OUString aDestTabName;
sal_Bool bRestoreDestTabName = false;
if( pOldObject && !bSameDoc && !bDestClip )
{
if( pDoc && pClipDoc )
{
- String aSourceTabName;
+ rtl::OUString aSourceTabName;
if( pClipDoc->GetName( nSourceTab, aSourceTabName )
&& pDoc->GetName( nDestTab, aDestTabName ) )
{
- if( !(aSourceTabName==aDestTabName) &&
+ if( !aSourceTabName.equals(aDestTabName) &&
pDoc->ValidNewTabName(aSourceTabName) )
{
bRestoreDestTabName = pDoc->RenameTab( nDestTab, aSourceTabName ); //sal_Bool bUpdateRef = sal_True, sal_Bool bExternalDocument = sal_False
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 240d1d9025fe..770ff55d7778 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -229,7 +229,7 @@ bool SetOptimalHeightsToRows(OptimalHeightsFuncObjBase& rFuncObj,
// -----------------------------------------------------------------------
-ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName,
+ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const rtl::OUString& rNewName,
bool bColInfo, bool bRowInfo ) :
aName( rNewName ),
aCodeName( rNewName ),
@@ -345,23 +345,23 @@ ScTable::~ScTable()
DestroySortCollator();
}
-void ScTable::GetName( String& rName ) const
+void ScTable::GetName( rtl::OUString& rName ) const
{
rName = aName;
}
-void ScTable::SetName( const String& rNewName )
+void ScTable::SetName( const rtl::OUString& rNewName )
{
aName = rNewName;
- aUpperName.Erase(); // invalidated if the name is changed
+ aUpperName = rtl::OUString(); // invalidated if the name is changed
// SetStreamValid is handled in ScDocument::RenameTab
}
-const String& ScTable::GetUpperName() const
+const rtl::OUString& ScTable::GetUpperName() const
{
- if ( !aUpperName.Len() && aName.Len() )
- aUpperName = ScGlobal::pCharClass->upper( aName );
+ if (aUpperName.isEmpty() && !aName.isEmpty())
+ aUpperName = ScGlobal::pCharClass->upper(aName);
return aUpperName;
}
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 53def4f9c13f..64fe5e386aaf 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1657,7 +1657,9 @@ void ScAddress::Format( String& r, sal_uInt16 nFlags, ScDocument* pDoc,
if( nFlags & SCA_TAB_3D )
{
String aTabName, aDocName;
- pDoc->GetName( nTab, aTabName );
+ rtl::OUString aTmp;
+ pDoc->GetName(nTab, aTmp);
+ aTabName = aTmp; // TODO: remove use of String here.
// External Reference, same as in ScCompiler::MakeTabStr()
if( aTabName.GetChar(0) == '\'' )
{ // "'Doc'#Tab"
@@ -1732,7 +1734,9 @@ lcl_Split_DocTab( const ScDocument* pDoc, SCTAB nTab,
sal_uInt16 nFlags,
String& rTabName, String& rDocName )
{
- pDoc->GetName( nTab, rTabName );
+ rtl::OUString aTmp;
+ pDoc->GetName(nTab, aTmp);
+ rTabName = aTmp;
rDocName.Erase();
// External reference, same as in ScCompiler::MakeTabStr()
if ( rTabName.GetChar(0) == '\'' )
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 5a12539bea3b..8a341a6c4a7d 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -502,7 +502,9 @@ String ScChangeAction::GetRefString( const ScBigRange& rRange,
case SC_CAT_DELETE_COLS :
if ( bFlag3D )
{
- pDoc->GetName( aTmpRange.aStart.Tab(), aStr );
+ rtl::OUString aTmp;
+ pDoc->GetName( aTmpRange.aStart.Tab(), aTmp );
+ aStr = aTmp;
aStr += '.';
}
aStr += ::ScColToAlpha( aTmpRange.aStart.Col() );
@@ -513,7 +515,9 @@ String ScChangeAction::GetRefString( const ScBigRange& rRange,
case SC_CAT_DELETE_ROWS :
if ( bFlag3D )
{
- pDoc->GetName( aTmpRange.aStart.Tab(), aStr );
+ rtl::OUString aTmp;
+ pDoc->GetName( aTmpRange.aStart.Tab(), aTmp );
+ aStr = aTmp;
aStr += '.';
}
aStr += String::CreateFromInt32( aTmpRange.aStart.Row() + 1 );
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 22c6c910c533..2c14b8649169 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -782,10 +782,12 @@ struct ConventionOOO_A1 : public Convention_A1
static String MakeTabStr( const ScCompiler& rComp, SCTAB nTab, String& aDoc )
{
String aString;
- if (!rComp.GetDoc()->GetName( nTab, aString ))
+ rtl::OUString aTmp;
+ if (!rComp.GetDoc()->GetName( nTab, aTmp ))
aString = ScGlobal::GetRscString(STR_NO_REF_TABLE);
else
{
+ aString = aTmp;
if ( aString.GetChar(0) == '\'' )
{ // "'Doc'#Tab"
xub_StrLen nPos = ScGlobal::FindUnquoted( aString, SC_COMPILER_FILE_TAB_SEP);
@@ -868,8 +870,8 @@ struct ConventionOOO_A1 : public Convention_A1
(aRef.Ref1.IsColDeleted() || aRef.Ref1.IsRowDeleted() || aRef.Ref1.IsTabDeleted() ||
aRef.Ref2.IsColDeleted() || aRef.Ref2.IsRowDeleted() || aRef.Ref2.IsTabDeleted()))
rBuffer.append( rComp.GetCurrentOpCodeMap()->getSymbol( ocErrRef));
- // For ODFF write [#REF!], but not for PODF so apps reading ODF
- // 1.0/1.1 may have a better chance if they implemented the old
+ // For ODFF write [#REF!], but not for PODF so apps reading ODF
+ // 1.0/1.1 may have a better chance if they implemented the old
// form.
else
{
@@ -1114,12 +1116,14 @@ struct ConventionXL
bool bHasDoc = false;
rDocName.Erase();
+ rtl::OUString aTmp;
if (rRef.IsTabDeleted() ||
- !rComp.GetDoc()->GetName( rRef.nTab, rTabName ))
+ !rComp.GetDoc()->GetName( rRef.nTab, aTmp ))
{
rTabName = ScGlobal::GetRscString( STR_NO_REF_TABLE );
return false;
}
+ rTabName = aTmp;
// Cheesy hack to unparse the OOO style "'Doc'#Tab"
if ( rTabName.GetChar(0) == '\'' )
@@ -2175,13 +2179,13 @@ Label_MaskStateMachine:
case ssGetErrorConstant:
{
// ODFF Error ::= '#' [A-Z0-9]+ ([!?] | ('/' ([A-Z] | ([0-9] [!?]))))
- // BUT, in UI these may have been translated! So don't
+ // BUT, in UI these may have been translated! So don't
// check for ASCII alnum. Note that this construct can't be
// parsed with i18n.
- /* TODO: be strict when reading ODFF, check for ASCII alnum
- * and proper continuation after '/'. However, even with
- * the lax parsing only the error constants we have defined
- * as opcode symbols will be recognized and others result
+ /* TODO: be strict when reading ODFF, check for ASCII alnum
+ * and proper continuation after '/'. However, even with
+ * the lax parsing only the error constants we have defined
+ * as opcode symbols will be recognized and others result
* in ocBad, so the result is actually conformant. */
bool bAdd = true;
if ('!' == c || '?' == c)
@@ -2680,7 +2684,7 @@ bool ScCompiler::IsPredetectedReference( const String& rName )
* 'haha.#REF!1fooledyou' and will generate an error on such. */
if (nPos == 0)
{
- // Per ODFF the correct string for a reference error is just #REF!,
+ // Per ODFF the correct string for a reference error is just #REF!,
// so pass it on.
if (rName.Len() == 5)
return IsErrorConstant( rName);
@@ -3580,7 +3584,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
* would need an ocBad token with additional error value.
* FormulaErrorToken wouldn't do because we want to preserve the
* original string containing partial valid address
- * information if not ODFF (in that case it was already handled).
+ * information if not ODFF (in that case it was already handled).
* */
ScRawToken aToken;
aToken.SetString( aStr.GetBuffer() );
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index fdbeb58e20a2..f581ac7a84d0 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1912,7 +1912,6 @@ void ScInterpreter::ScCell()
PushIllegalParameter();
else
{
- String aFuncResult;
ScBaseCell* pCell = GetCell( aCellPos );
ScCellKeywordTranslator::transKeyword(aInfoType, ScGlobal::GetLocale(), ocCell);
@@ -1933,12 +1932,14 @@ void ScInterpreter::ScCell()
else if( aInfoType.EqualsAscii( "ADDRESS" ) )
{ // address formatted as [['FILENAME'#]$TABLE.]$COL$ROW
sal_uInt16 nFlags = (aCellPos.Tab() == aPos.Tab()) ? (SCA_ABS) : (SCA_ABS_3D);
- aCellPos.Format( aFuncResult, nFlags, pDok, pDok->GetAddressConvention() );
- PushString( aFuncResult );
+ rtl::OUString aStr;
+ aCellPos.Format( aStr, nFlags, pDok, pDok->GetAddressConvention() );
+ PushString(aStr);
}
else if( aInfoType.EqualsAscii( "FILENAME" ) )
{ // file name and table name: 'FILENAME'#$TABLE
SCTAB nTab = aCellPos.Tab();
+ rtl::OUString aFuncResult;
if( nTab < pDok->GetTableCount() )
{
if( pDok->GetLinkMode( nTab ) == SC_LINK_VALUE )
@@ -1948,13 +1949,15 @@ void ScInterpreter::ScCell()
SfxObjectShell* pShell = pDok->GetDocumentShell();
if( pShell && pShell->GetMedium() )
{
- aFuncResult = (sal_Unicode) '\'';
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(sal_Unicode('\''));
const INetURLObject& rURLObj = pShell->GetMedium()->GetURLObject();
- aFuncResult += String( rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
- aFuncResult.AppendAscii( "'#$" );
- String aTabName;
+ aBuf.append(rURLObj.GetMainURL(INetURLObject::DECODE_UNAMBIGUOUS));
+ aBuf.appendAscii("'#$");
+ rtl::OUString aTabName;
pDok->GetName( nTab, aTabName );
- aFuncResult += aTabName;
+ aBuf.append(aTabName);
+ aFuncResult = aBuf.makeStringAndClear();
}
}
}
@@ -1963,14 +1966,16 @@ void ScInterpreter::ScCell()
else if( aInfoType.EqualsAscii( "COORD" ) )
{ // address, lotus 1-2-3 formatted: $TABLE:$COL$ROW
// Yes, passing tab as col is intentional!
+ rtl::OUStringBuffer aFuncResult;
+ rtl::OUString aCellStr;
ScAddress( static_cast<SCCOL>(aCellPos.Tab()), 0, 0 ).Format(
- aFuncResult, (SCA_COL_ABSOLUTE|SCA_VALID_COL), NULL, pDok->GetAddressConvention() );
- aFuncResult += ':';
- String aCellStr;
+ aCellStr, (SCA_COL_ABSOLUTE|SCA_VALID_COL), NULL, pDok->GetAddressConvention() );
+ aFuncResult.append(aCellStr);
+ aFuncResult.append(sal_Unicode(':'));
aCellPos.Format( aCellStr, (SCA_COL_ABSOLUTE|SCA_VALID_COL|SCA_ROW_ABSOLUTE|SCA_VALID_ROW),
NULL, pDok->GetAddressConvention() );
- aFuncResult += aCellStr;
- PushString( aFuncResult );
+ aFuncResult.append(aCellStr);
+ PushString( aFuncResult.makeStringAndClear() );
}
// *** CELL PROPERTIES ***
@@ -1978,19 +1983,21 @@ void ScInterpreter::ScCell()
{ // contents of the cell, no formatting
if( pCell && pCell->HasStringData() )
{
- GetCellString( aFuncResult, pCell );
- PushString( aFuncResult );
+ String aStr;
+ GetCellString( aStr, pCell );
+ PushString( aStr );
}
else
PushDouble( GetCellValue( aCellPos, pCell ) );
}
else if( aInfoType.EqualsAscii( "TYPE" ) )
{ // b = blank; l = string (label); v = otherwise (value)
+ sal_Unicode c;
if( HasCellStringData( pCell ) )
- aFuncResult = 'l';
+ c = 'l';
else
- aFuncResult = HasCellValueData( pCell ) ? 'v' : 'b';
- PushString( aFuncResult );
+ c = HasCellValueData( pCell ) ? 'v' : 'b';
+ PushString( rtl::OUString(c) );
}
else if( aInfoType.EqualsAscii( "WIDTH" ) )
{ // column width (rounded off as count of zero characters in standard font and size)
@@ -2011,6 +2018,7 @@ void ScInterpreter::ScCell()
}
else if( aInfoType.EqualsAscii( "PREFIX" ) )
{ // ' = left; " = right; ^ = centered
+ sal_Unicode c = 0;
if( HasCellStringData( pCell ) )
{
const SvxHorJustifyItem* pJustAttr = (const SvxHorJustifyItem*)
@@ -2019,13 +2027,13 @@ void ScInterpreter::ScCell()
{
case SVX_HOR_JUSTIFY_STANDARD:
case SVX_HOR_JUSTIFY_LEFT:
- case SVX_HOR_JUSTIFY_BLOCK: aFuncResult = '\''; break;
- case SVX_HOR_JUSTIFY_CENTER: aFuncResult = '^'; break;
- case SVX_HOR_JUSTIFY_RIGHT: aFuncResult = '"'; break;
- case SVX_HOR_JUSTIFY_REPEAT: aFuncResult = '\\'; break;
+ case SVX_HOR_JUSTIFY_BLOCK: c = '\''; break;
+ case SVX_HOR_JUSTIFY_CENTER: c = '^'; break;
+ case SVX_HOR_JUSTIFY_RIGHT: c = '"'; break;
+ case SVX_HOR_JUSTIFY_REPEAT: c = '\\'; break;
}
}
- PushString( aFuncResult );
+ PushString( rtl::OUString(c) );
}
else if( aInfoType.EqualsAscii( "PROTECT" ) )
{ // 1 = cell locked
@@ -2037,6 +2045,7 @@ void ScInterpreter::ScCell()
// *** FORMATTING ***
else if( aInfoType.EqualsAscii( "FORMAT" ) )
{ // specific format code for standard formats
+ String aFuncResult;
sal_uLong nFormat = pDok->GetNumberFormat( aCellPos );
bool bAppendPrec = true;
sal_uInt16 nPrec, nLeading;
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 946d93f61b89..cadd0d1ff19b 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -695,7 +695,7 @@ int SAL_CALL ScRangePairList_QsortNameCompare( const void* p1, const void* p2 )
const ScRangePairNameSort* ps2 = (const ScRangePairNameSort*)p2;
const ScAddress& rStartPos1 = ps1->pPair->GetRange(0).aStart;
const ScAddress& rStartPos2 = ps2->pPair->GetRange(0).aStart;
- String aStr1, aStr2;
+ rtl::OUString aStr1, aStr2;
sal_Int32 nComp;
if ( rStartPos1.Tab() == rStartPos2.Tab() )
nComp = COMPARE_EQUAL;