summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-07 14:02:47 +0200
committerNoel Grandin <noel@peralex.com>2013-10-08 10:03:12 +0200
commitd872c9e8a2f234956ee4af21bc10d639a0d83c10 (patch)
tree52075991fd0d2fa96433b1986cb4546b06517de9 /sc
parenta81219450f4d94213b355c6812032b36c9037aa2 (diff)
convert sc/source/ui/docshell/*.cxx from String to OUString
Change-Id: I0f2cada87bfa7b59cfcfdd8cf9bc876dd1395654
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/arealink.cxx14
-rw-r--r--sc/source/ui/docshell/autostyl.cxx16
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx12
-rw-r--r--sc/source/ui/docshell/docfunc.cxx45
-rw-r--r--sc/source/ui/docshell/docsh.cxx100
-rw-r--r--sc/source/ui/docshell/docsh3.cxx28
-rw-r--r--sc/source/ui/docshell/docsh4.cxx38
-rw-r--r--sc/source/ui/docshell/docsh5.cxx6
-rw-r--r--sc/source/ui/docshell/docsh6.cxx2
-rw-r--r--sc/source/ui/docshell/docsh8.cxx36
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx22
-rw-r--r--sc/source/ui/docshell/impex.cxx83
-rw-r--r--sc/source/ui/docshell/servobj.cxx14
-rw-r--r--sc/source/ui/docshell/tablink.cxx10
-rw-r--r--sc/source/ui/docshell/tpstat.cxx2
15 files changed, 213 insertions, 215 deletions
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index c6745fbb80f7..cebcb1b2d9e6 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -237,7 +237,7 @@ sal_Bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilt
if (rNewFile.isEmpty() || rNewFilter.isEmpty())
return false;
- String aNewUrl( ScGlobal::GetAbsDocName( rNewFile, pImpl->m_pDocSh ) );
+ OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, pImpl->m_pDocSh ) );
sal_Bool bNewUrlName = (aNewUrl != aFileName);
const SfxFilter* pFilter = pImpl->m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
@@ -263,12 +263,12 @@ sal_Bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilt
ScDocument* pSrcDoc = pSrcShell->GetDocument();
// Optionen koennten gesetzt worden sein
- String aNewOpt = ScDocumentLoader::GetOptions(*pMed);
- if (!aNewOpt.Len())
+ OUString aNewOpt = ScDocumentLoader::GetOptions(*pMed);
+ if (aNewOpt.isEmpty())
aNewOpt = aOptions;
// correct source range name list for web query import
- String aTempArea;
+ OUString aTempArea;
if( rNewFilter == ScDocShell::GetWebQueryFilterName() )
aTempArea = ScFormatFilter::Get().GetHTMLRangeNameList( pSrcDoc, rNewArea );
@@ -284,7 +284,7 @@ sal_Bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilt
for( nToken = 0; nToken < nTokenCnt; nToken++ )
{
- String aToken( aTempArea.GetToken( 0, ';', nStringIx ) );
+ OUString aToken( aTempArea.getToken( 0, ';', nStringIx ) );
ScRange aTokenRange;
if( FindExtRange( aTokenRange, pSrcDoc, aToken ) )
{
@@ -366,7 +366,7 @@ sal_Bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilt
nStringIx = 0;
for( nToken = 0; nToken < nTokenCnt; nToken++ )
{
- String aToken( aTempArea.GetToken( 0, ';', nStringIx ) );
+ OUString aToken( aTempArea.getToken( 0, ';', nStringIx ) );
ScRange aTokenRange;
if( FindExtRange( aTokenRange, pSrcDoc, aToken ) )
{
@@ -401,7 +401,7 @@ sal_Bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilt
}
else
{
- String aErr = ScGlobal::GetRscString(STR_LINKERROR);
+ OUString aErr = ScGlobal::GetRscString(STR_LINKERROR);
pDoc->SetString( aDestPos.Col(), aDestPos.Row(), aDestPos.Tab(), aErr );
}
diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 06963ee669fd..78dbf5cd3e02 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -27,22 +27,22 @@
struct ScAutoStyleInitData
{
- ScRange aRange;
- String aStyle1;
+ ScRange aRange;
+ OUString aStyle1;
sal_uLong nTimeout;
- String aStyle2;
+ OUString aStyle2;
- ScAutoStyleInitData( const ScRange& rR, const String& rSt1, sal_uLong nT, const String& rSt2 ) :
+ ScAutoStyleInitData( const ScRange& rR, const OUString& rSt1, sal_uLong nT, const OUString& rSt2 ) :
aRange(rR), aStyle1(rSt1), nTimeout(nT), aStyle2(rSt2) {}
};
struct ScAutoStyleData
{
- sal_uLong nTimeout;
- ScRange aRange;
- String aStyle;
+ sal_uLong nTimeout;
+ ScRange aRange;
+ OUString aStyle;
- ScAutoStyleData( sal_uLong nT, const ScRange& rR, const String& rT ) :
+ ScAutoStyleData( sal_uLong nT, const ScRange& rR, const OUString& rT ) :
nTimeout(nT), aRange(rR), aStyle(rT) {}
};
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 858f45935059..033ab00612ba 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -110,7 +110,7 @@ bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
// create database range
ScDBData* pDBData = rDocShell.GetDBData( ScRange(rPos), SC_DB_IMPORT, SC_DBSEL_KEEP );
DBG_ASSERT(pDBData, "can't create DB data");
- String sTarget = pDBData->GetName();
+ OUString sTarget = pDBData->GetName();
UpdateImport( sTarget, aDesc );
@@ -150,7 +150,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
sal_Bool bApi = false; //! pass as argument
sal_Bool bTruncated = false; // for warning
sal_uInt16 nErrStringId = 0;
- String aErrorMessage;
+ OUString aErrorMessage;
SCCOL nCol = rParam.nCol1;
SCROW nRow = rParam.nRow1;
@@ -364,10 +364,10 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
++nInserted;
if (!(nInserted & 15))
{
- String aPict = ScGlobal::GetRscString( STR_PROGRESS_IMPORT );
- String aText = aPict.GetToken(0,'#');
+ OUString aPict = ScGlobal::GetRscString( STR_PROGRESS_IMPORT );
+ OUString aText = aPict.getToken(0,'#');
aText += OUString::number( nInserted );
- aText += aPict.GetToken(1,'#');
+ aText += aPict.getToken(1,'#');
if (!aProgress.SetStateText( 0, aText )) // stopped by user?
{
@@ -644,7 +644,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (pWaitWin)
pWaitWin->LeaveWait();
- if (!aErrorMessage.Len())
+ if (aErrorMessage.isEmpty())
{
if (!nErrStringId)
nErrStringId = STR_MSSG_IMPORTDATA_0;
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 2a3e1aec31d6..d40677192d13 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1093,11 +1093,11 @@ bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
}
-static ScTokenArray* lcl_ScDocFunc_CreateTokenArrayXML( const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
+static ScTokenArray* lcl_ScDocFunc_CreateTokenArrayXML( const OUString& rText, const OUString& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
{
ScTokenArray* pCode = new ScTokenArray;
pCode->AddStringXML( rText );
- if( (eGrammar == formula::FormulaGrammar::GRAM_EXTERNAL) && (rFormulaNmsp.Len() > 0) )
+ if( (eGrammar == formula::FormulaGrammar::GRAM_EXTERNAL) && (!rFormulaNmsp.isEmpty()) )
pCode->AddStringXML( rFormulaNmsp );
return pCode;
}
@@ -1186,9 +1186,9 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const OUString& rText, sal_B
return false;
}
- String aNewText = convertLineEnd(rText, GetSystemLineEnd()); //! ist das noetig ???
+ OUString aNewText = convertLineEnd(rText, GetSystemLineEnd()); //! ist das noetig ???
- if( ScPostIt* pNote = (aNewText.Len() > 0) ? pDoc->GetNotes(rPos.Tab())->GetOrCreateNote( rPos ) : pDoc->GetNotes( rPos.Tab() )->findByAddress(rPos) )
+ if( ScPostIt* pNote = (!aNewText.isEmpty()) ? pDoc->GetNotes(rPos.Tab())->GetOrCreateNote( rPos ) : pDoc->GetNotes( rPos.Tab() )->findByAddress(rPos) )
pNote->SetText( rPos, aNewText );
//! Undo !!!
@@ -1717,7 +1717,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
// the patch comes from mloiseleur and maoyg
bool bInsertMerge = false;
std::vector<ScRange> qIncreaseRange;
- String aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTCELLS );
+ OUString aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTCELLS );
if (bRecord)
rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
@@ -2134,7 +2134,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
//the patch comes from maoyg
::std::vector<ScRange> qDecreaseRange;
bool bDeletingMerge = false;
- String aUndo = ScGlobal::GetRscString( STR_UNDO_DELETECELLS );
+ OUString aUndo = ScGlobal::GetRscString( STR_UNDO_DELETECELLS );
if (bRecord)
rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
@@ -2854,7 +2854,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
}
//------------------------------------------------------------------------
-uno::Reference< uno::XInterface > GetDocModuleObject( SfxObjectShell& rDocSh, String& sCodeName )
+uno::Reference< uno::XInterface > GetDocModuleObject( SfxObjectShell& rDocSh, OUString& sCodeName )
{
uno::Reference< lang::XMultiServiceFactory> xSF(rDocSh.GetModel(), uno::UNO_QUERY);
uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess;
@@ -2868,7 +2868,7 @@ uno::Reference< uno::XInterface > GetDocModuleObject( SfxObjectShell& rDocSh, St
}
-static script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule )
+static script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, OUString& sModule )
{
script::ModuleInfo sModuleInfo;
sModuleInfo.ModuleType = script::ModuleType::DOCUMENT;
@@ -2885,7 +2885,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, const OUString& sModuleName
uno::Reference< container::XNameContainer > xLib;
if( xLibContainer.is() )
{
- String aLibName( "Standard" );
+ OUString aLibName( "Standard" );
if ( rDocSh.GetBasicManager() && !rDocSh.GetBasicManager()->GetName().isEmpty() )
{
aLibName = rDocSh.GetBasicManager()->GetName();
@@ -2897,7 +2897,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, const OUString& sModuleName
{
// if the Module with codename exists then find a new name
sal_Int32 nNum = 0;
- String genModuleName;
+ OUString genModuleName;
if ( !sModuleName.isEmpty() )
genModuleName = sModuleName;
else
@@ -2933,7 +2933,7 @@ void VBA_DeleteModule( ScDocShell& rDocSh, const OUString& sModuleName )
uno::Reference< container::XNameContainer > xLib;
if( xLibContainer.is() )
{
- String aLibName( "Standard" );
+ OUString aLibName( "Standard" );
if ( rDocSh.GetBasicManager() && !rDocSh.GetBasicManager()->GetName().isEmpty() )
{
aLibName = rDocSh.GetBasicManager()->GetName();
@@ -3754,7 +3754,7 @@ sal_Bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, sal_Bool b
{
if (!bApi)
{
- InfoBox aBox( rDocShell.GetActiveDialogParent(), String( ScResId( SCSTR_WRONGPASSWORD ) ) );
+ InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
aBox.Execute();
}
return false;
@@ -3786,7 +3786,7 @@ sal_Bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, sal_Bool b
{
if (!bApi)
{
- InfoBox aBox( rDocShell.GetActiveDialogParent(), String( ScResId( SCSTR_WRONGPASSWORD ) ) );
+ InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
aBox.Execute();
}
return false;
@@ -4920,7 +4920,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
ScRangeData::MakeValidName(aName);
if (!aName.isEmpty())
{
- String aContent(ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format(SCR_ABS_3D, pDoc));
+ OUString aContent(ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format(SCR_ABS_3D, pDoc));
bool bInsert = false;
ScRangeData* pOld = rList.findByUpperName(ScGlobal::pCharClass->uppercase(aName));
@@ -4934,11 +4934,11 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
bInsert = sal_True; // per API nicht nachfragen
else
{
- String aTemplate = ScGlobal::GetRscString( STR_CREATENAME_REPLACE );
+ OUString aTemplate = ScGlobal::GetRscString( STR_CREATENAME_REPLACE );
- String aMessage = aTemplate.GetToken( 0, '#' );
+ OUString aMessage = aTemplate.getToken( 0, '#' );
aMessage += aName;
- aMessage += aTemplate.GetToken( 1, '#' );
+ aMessage += aTemplate.getToken( 1, '#' );
short nResult = QueryBox( rDocShell.GetActiveDialogParent(),
WinBits(WB_YES_NO_CANCEL | WB_DEF_YES),
@@ -5133,7 +5133,7 @@ sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
#endif
OUString aName;
OUStringBuffer aContent;
- String aFormula;
+ OUString aFormula;
SCROW nOutRow = nStartRow;
for (j=0; j<nValidCount; j++)
{
@@ -5141,8 +5141,7 @@ sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
pData->GetName(aName);
// relative Referenzen Excel-konform auf die linke Spalte anpassen:
pData->UpdateSymbol(aContent, ScAddress( nStartCol, nOutRow, nTab ));
- aFormula = '=';
- aFormula += aContent.toString();
+ aFormula = "=" + aContent.toString();
ScSetStringParam aParam;
aParam.setTextInput();
pDoc->SetString(ScAddress(nStartCol,nOutRow,nTab), aName, &aParam);
@@ -5194,7 +5193,7 @@ sal_Bool ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNe
pDoc->GetFormula( nStartCol, nStartRow, nTab, aFormula );
if ( aFormula[0] == '{' && aFormula[aFormula.getLength()-1] == '}' )
{
- String aUndo = ScGlobal::GetRscString( STR_UNDO_RESIZEMATRIX );
+ OUString aUndo = ScGlobal::GetRscString( STR_UNDO_RESIZEMATRIX );
if (bUndo)
rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
@@ -5253,7 +5252,7 @@ sal_Bool ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilt
if ( !nRemoved )
{
// group all remove and the insert action
- String aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTAREALINK );
+ OUString aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTAREALINK );
rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
}
@@ -5400,7 +5399,7 @@ void ScDocFunc::SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB
void ScDocFunc::EnterListAction( sal_uInt16 nNameResId )
{
- String aUndo( ScGlobal::GetRscString( nNameResId ) );
+ OUString aUndo( ScGlobal::GetRscString( nNameResId ) );
rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index c39499a788dd..b2d482818c54 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -322,7 +322,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
{
xub_StrLen nIndex = nNameLength - nLinkTabNameLength;
INetURLObject aINetURLObject(aDocURLBuffer.makeStringAndClear());
- if( String(aName).Equals(String(aLinkTabName), nIndex, nLinkTabNameLength) &&
+ if(aName == aLinkTabName.copy(nIndex, nLinkTabNameLength) &&
(aName[nIndex - 1] == '#') && // before the table name should be the # char
!aINetURLObject.HasError()) // the docname should be a valid URL
{
@@ -617,8 +617,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScAutoStyleHint& rStlHint = (ScAutoStyleHint&)rHint;
ScRange aRange = rStlHint.GetRange();
- String aName1 = rStlHint.GetStyle1();
- String aName2 = rStlHint.GetStyle2();
+ OUString aName1 = rStlHint.GetStyle1();
+ OUString aName2 = rStlHint.GetStyle2();
sal_uInt32 nTimeout = rStlHint.GetTimeout();
if (!pAutoStyleList)
@@ -762,7 +762,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
xCloseable->close( sal_True );
- String aUserName( ScGlobal::GetRscString( STR_UNKNOWN_USER ) );
+ OUString aUserName( ScGlobal::GetRscString( STR_UNKNOWN_USER ) );
bool bNoLockAccess = false;
try
{
@@ -1036,16 +1036,16 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
const SfxFilter* pFilter = rMedium.GetFilter();
if (pFilter)
{
- String aFltName = pFilter->GetFilterName();
+ OUString aFltName = pFilter->GetFilterName();
- sal_Bool bCalc3 = ( aFltName.EqualsAscii(pFilterSc30) );
- sal_Bool bCalc4 = ( aFltName.EqualsAscii(pFilterSc40) );
+ sal_Bool bCalc3 = ( aFltName.equalsAscii(pFilterSc30) );
+ sal_Bool bCalc4 = ( aFltName.equalsAscii(pFilterSc40) );
if (!bCalc3 && !bCalc4)
aDocument.SetInsertingFromOtherDoc( sal_True );
- if (aFltName.EqualsAscii(pFilterXML))
+ if (aFltName.equalsAscii(pFilterXML))
bRet = LoadXML( &rMedium, NULL );
- else if (aFltName.EqualsAscii(pFilterSc10))
+ else if (aFltName.equalsAscii(pFilterSc10))
{
SvStream* pStream = rMedium.GetInStream();
if (pStream)
@@ -1060,9 +1060,9 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
bRet = sal_True;
}
}
- else if (aFltName.EqualsAscii(pFilterLotus))
+ else if (aFltName.equalsAscii(pFilterLotus))
{
- String sItStr;
+ OUString sItStr;
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
@@ -1071,7 +1071,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
- if (sItStr.Len() == 0)
+ if (sItStr.isEmpty())
{
// default for lotus import (from API without options):
// IBM_437 encoding
@@ -1093,18 +1093,18 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
bSetColWidths = sal_True;
bSetRowHeights = sal_True;
}
- else if ( aFltName.EqualsAscii(pFilterExcel4) || aFltName.EqualsAscii(pFilterExcel5) ||
- aFltName.EqualsAscii(pFilterExcel95) || aFltName.EqualsAscii(pFilterExcel97) ||
- aFltName.EqualsAscii(pFilterEx4Temp) || aFltName.EqualsAscii(pFilterEx5Temp) ||
- aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp) )
+ else if ( aFltName.equalsAscii(pFilterExcel4) || aFltName.equalsAscii(pFilterExcel5) ||
+ aFltName.equalsAscii(pFilterExcel95) || aFltName.equalsAscii(pFilterExcel97) ||
+ aFltName.equalsAscii(pFilterEx4Temp) || aFltName.equalsAscii(pFilterEx5Temp) ||
+ aFltName.equalsAscii(pFilterEx95Temp) || aFltName.equalsAscii(pFilterEx97Temp) )
{
EXCIMPFORMAT eFormat = EIF_AUTO;
- if ( aFltName.EqualsAscii(pFilterExcel4) || aFltName.EqualsAscii(pFilterEx4Temp) )
+ if ( aFltName.equalsAscii(pFilterExcel4) || aFltName.equalsAscii(pFilterEx4Temp) )
eFormat = EIF_BIFF_LE4;
- else if ( aFltName.EqualsAscii(pFilterExcel5) || aFltName.EqualsAscii(pFilterExcel95) ||
- aFltName.EqualsAscii(pFilterEx5Temp) || aFltName.EqualsAscii(pFilterEx95Temp) )
+ else if ( aFltName.equalsAscii(pFilterExcel5) || aFltName.equalsAscii(pFilterExcel95) ||
+ aFltName.equalsAscii(pFilterEx5Temp) || aFltName.equalsAscii(pFilterEx95Temp) )
eFormat = EIF_BIFF5;
- else if ( aFltName.EqualsAscii(pFilterExcel97) || aFltName.EqualsAscii(pFilterEx97Temp) )
+ else if ( aFltName.equalsAscii(pFilterExcel97) || aFltName.equalsAscii(pFilterEx97Temp) )
eFormat = EIF_BIFF8;
MakeDrawLayer(); //! im Filter
@@ -1131,7 +1131,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
else
bRet = true;
}
- else if (aFltName.EqualsAscii(pFilterAscii))
+ else if (aFltName.equalsAscii(pFilterAscii))
{
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
@@ -1199,9 +1199,9 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
bSetColWidths = sal_True;
bSetSimpleTextColWidths = sal_True;
}
- else if (aFltName.EqualsAscii(pFilterDBase))
+ else if (aFltName.equalsAscii(pFilterDBase))
{
- String sItStr;
+ OUString sItStr;
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
@@ -1210,7 +1210,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
- if (sItStr.Len() == 0)
+ if (sItStr.isEmpty())
{
// default for dBase import (from API without options):
// IBM_850 encoding
@@ -1236,13 +1236,13 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
bSetColWidths = true;
bSetSimpleTextColWidths = true;
}
- else if (aFltName.EqualsAscii(pFilterDif))
+ else if (aFltName.equalsAscii(pFilterDif))
{
SvStream* pStream = rMedium.GetInStream();
if (pStream)
{
FltError eError;
- String sItStr;
+ OUString sItStr;
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
@@ -1251,7 +1251,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
- if (sItStr.Len() == 0)
+ if (sItStr.isEmpty())
{
// default for DIF import (from API without options):
// ISO8859-1/MS_1252 encoding
@@ -1276,7 +1276,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
bSetSimpleTextColWidths = sal_True;
bSetRowHeights = sal_True;
}
- else if (aFltName.EqualsAscii(pFilterSylk))
+ else if (aFltName.equalsAscii(pFilterSylk))
{
FltError eError = SCERR_IMPORT_UNKNOWN;
if( !rMedium.IsStorage() )
@@ -1304,7 +1304,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
bSetSimpleTextColWidths = sal_True;
bSetRowHeights = sal_True;
}
- else if (aFltName.EqualsAscii(pFilterQPro6))
+ else if (aFltName.equalsAscii(pFilterQPro6))
{
FltError eError = ScFormatFilter::Get().ScImportQuattroPro( rMedium, &aDocument);
if (eError != eERR_OK)
@@ -1322,7 +1322,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
// wrapping enabled look nicer..
bSetRowHeights = sal_True;
}
- else if (aFltName.EqualsAscii(pFilterRtf))
+ else if (aFltName.equalsAscii(pFilterRtf))
{
FltError eError = SCERR_IMPORT_UNKNOWN;
if( !rMedium.IsStorage() )
@@ -1357,10 +1357,10 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( eError != eERR_OK && !GetError() )
SetError(eError, OUString( OSL_LOG_PREFIX ));
}
- else if (aFltName.EqualsAscii(pFilterHtml) || aFltName.EqualsAscii(pFilterHtmlWebQ))
+ else if (aFltName.equalsAscii(pFilterHtml) || aFltName.equalsAscii(pFilterHtmlWebQ))
{
FltError eError = SCERR_IMPORT_UNKNOWN;
- sal_Bool bWebQuery = aFltName.EqualsAscii(pFilterHtmlWebQ);
+ sal_Bool bWebQuery = aFltName.equalsAscii(pFilterHtmlWebQ);
if( !rMedium.IsStorage() )
{
SvStream* pInStream = rMedium.GetInStream();
@@ -1373,7 +1373,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( pSet && SFX_ITEM_SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
- String aFilterOption = (static_cast<const SfxStringItem*>(pItem))->GetValue();
+ OUString aFilterOption = (static_cast<const SfxStringItem*>(pItem))->GetValue();
lcl_parseHtmlFilterOption(aFilterOption, eLang, bDateConvert);
}
@@ -2162,17 +2162,17 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
OSL_ENSURE( rMed.GetFilter(), "Filter == 0" );
sal_Bool bRet = false;
- String aFltName = rMed.GetFilter()->GetFilterName();
+ OUString aFltName = rMed.GetFilter()->GetFilterName();
- if (aFltName.EqualsAscii(pFilterXML))
+ if (aFltName.equalsAscii(pFilterXML))
{
//TODO/LATER: this shouldn't happen!
OSL_FAIL("XML filter in ConvertFrom?!");
bRet = SaveXML( &rMed, NULL );
}
- else if (aFltName.EqualsAscii(pFilterExcel5) || aFltName.EqualsAscii(pFilterExcel95) ||
- aFltName.EqualsAscii(pFilterExcel97) || aFltName.EqualsAscii(pFilterEx5Temp) ||
- aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp))
+ else if (aFltName.equalsAscii(pFilterExcel5) || aFltName.equalsAscii(pFilterExcel95) ||
+ aFltName.equalsAscii(pFilterExcel97) || aFltName.equalsAscii(pFilterEx5Temp) ||
+ aFltName.equalsAscii(pFilterEx95Temp) || aFltName.equalsAscii(pFilterEx97Temp))
{
WaitObject aWait( GetActiveDialogParent() );
@@ -2210,7 +2210,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
if( bDoSave )
{
ExportFormatExcel eFormat = ExpBiff5;
- if( aFltName.EqualsAscii( pFilterExcel97 ) || aFltName.EqualsAscii( pFilterEx97Temp ) )
+ if( aFltName.equalsAscii( pFilterExcel97 ) || aFltName.equalsAscii( pFilterEx97Temp ) )
eFormat = ExpBiff8;
FltError eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );
@@ -2226,12 +2226,12 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
SetError( ERRCODE_ABORT, OUString( OSL_LOG_PREFIX ) );
}
}
- else if (aFltName.EqualsAscii(pFilterAscii))
+ else if (aFltName.equalsAscii(pFilterAscii))
{
SvStream* pStream = rMed.GetOutStream();
if (pStream)
{
- String sItStr;
+ OUString sItStr;
SfxItemSet* pSet = rMed.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
@@ -2240,7 +2240,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
- if ( sItStr.Len() == 0 )
+ if ( sItStr.isEmpty() )
{
// default for ascii export (from API without options):
// ISO8859-1/MS_1252 encoding, comma, double quotes
@@ -2259,9 +2259,9 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
rMed.SetError(SCWARN_EXPORT_ASCII, OUString( OSL_LOG_PREFIX ));
}
}
- else if (aFltName.EqualsAscii(pFilterDBase))
+ else if (aFltName.equalsAscii(pFilterDBase))
{
- String sCharSet;
+ OUString sCharSet;
SfxItemSet* pSet = rMed.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
@@ -2270,7 +2270,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
sCharSet = ((const SfxStringItem*)pItem)->GetValue();
}
- if (sCharSet.Len() == 0)
+ if (sCharSet.isEmpty())
{
// default for dBase export (from API without options):
// IBM_850 encoding
@@ -2323,12 +2323,12 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
}
}
}
- else if (aFltName.EqualsAscii(pFilterDif))
+ else if (aFltName.equalsAscii(pFilterDif))
{
SvStream* pStream = rMed.GetOutStream();
if (pStream)
{
- String sItStr;
+ OUString sItStr;
SfxItemSet* pSet = rMed.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
@@ -2337,7 +2337,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
- if (sItStr.Len() == 0)
+ if (sItStr.isEmpty())
{
// default for DIF export (from API without options):
// ISO8859-1/MS_1252 encoding
@@ -2355,7 +2355,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
rMed.SetError(SCWARN_EXPORT_ASCII, OUString( OSL_LOG_PREFIX ));
}
}
- else if (aFltName.EqualsAscii(pFilterSylk))
+ else if (aFltName.equalsAscii(pFilterSylk))
{
SvStream* pStream = rMed.GetOutStream();
if ( pStream )
@@ -2372,7 +2372,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), SOT_FORMATSTR_ID_SYLK );
}
}
- else if (aFltName.EqualsAscii(pFilterHtml))
+ else if (aFltName.equalsAscii(pFilterHtml))
{
SvStream* pStream = rMed.GetOutStream();
if ( pStream )
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index f5a282cd3ce7..433e6af649a9 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -529,7 +529,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
if (nDiffFlags & (SFX_PRINTER_CHG_ORIENTATION | SFX_PRINTER_CHG_SIZE))
{
- String aStyle = aDocument.GetPageStyle( GetCurTab() );
+ OUString aStyle = aDocument.GetPageStyle( GetCurTab() );
ScStyleSheetPool* pStPl = aDocument.GetStyleSheetPool();
SfxStyleSheet* pStyleSheet = (SfxStyleSheet*)pStPl->Find(aStyle, SFX_STYLE_FAMILY_PAGE);
if (pStyleSheet)
@@ -642,12 +642,12 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pP
{
if (!pAction) return; // ohne Aktion ist nichts..
- String aComment = pAction->GetComment();
- String aAuthor = pAction->GetUser();
+ OUString aComment = pAction->GetComment();
+ OUString aAuthor = pAction->GetUser();
DateTime aDT = pAction->GetDateTime();
- String aDate = ScGlobal::pLocaleData->getDate( aDT );
- aDate += ' ';
+ OUString aDate = ScGlobal::pLocaleData->getDate( aDT );
+ aDate += " ";
aDate += ScGlobal::pLocaleData->getTime( aDT, false, false );
SfxItemSet aSet( GetPool(),
@@ -680,7 +680,7 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
aDocument.EndChangeTracking();
aDocument.StartChangeTracking();
- String aOldUser;
+ OUString aOldUser;
pTrack = aDocument.GetChangeTrack();
if ( pTrack )
{
@@ -688,11 +688,11 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
// check if comparing to same document
- String aThisFile;
+ OUString aThisFile;
const SfxMedium* pThisMed = GetMedium();
if (pThisMed)
aThisFile = pThisMed->GetName();
- String aOtherFile;
+ OUString aOtherFile;
SfxObjectShell* pOtherSh = rOtherDoc.GetDocumentShell();
if (pOtherSh)
{
@@ -700,7 +700,7 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
if (pOtherMed)
aOtherFile = pOtherMed->GetName();
}
- sal_Bool bSameDoc = ( aThisFile == aOtherFile && aThisFile.Len() );
+ sal_Bool bSameDoc = ( aThisFile == aOtherFile && !aThisFile.isEmpty() );
if ( !bSameDoc )
{
// create change actions from comparing with the name of the user
@@ -713,9 +713,9 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
OSL_ENSURE(xDocProps.is(), "no DocumentProperties");
- String aDocUser = xDocProps->getModifiedBy();
+ OUString aDocUser = xDocProps->getModifiedBy();
- if ( aDocUser.Len() )
+ if ( !aDocUser.isEmpty() )
pTrack->SetUser( aDocUser );
}
}
@@ -902,7 +902,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
// MergeChangeData in das aktuelle Dokument uebernehmen
sal_Bool bHasRejected = false;
- String aOldUser = pThisTrack->GetUser();
+ OUString aOldUser = pThisTrack->GetUser();
pThisTrack->SetUseFixDateTime( sal_True );
ScMarkData& rMarkData = pViewSh->GetViewData()->GetMarkData();
ScMarkData aOldMarkData( rMarkData );
@@ -1099,8 +1099,8 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
}
}
}
- const String& rComment = pSourceAction->GetComment();
- if ( rComment.Len() )
+ const OUString& rComment = pSourceAction->GetComment();
+ if ( !rComment.isEmpty() )
{
ScChangeAction* pAct = pThisTrack->GetLast();
if ( pAct && pAct->GetActionNumber() > nOldActionMax )
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 1d7e1d1b5d5e..53e37a3de1c4 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -149,7 +149,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
if ( aDocument.IsBlockEditable( nTab, nCol,nRow, nCol, nRow ) )
{
- String aVal = ((const SfxStringItem*)pTextItem)->GetValue();
+ OUString aVal = ((const SfxStringItem*)pTextItem)->GetValue();
aDocument.SetString( nCol, nRow, nTab, aVal );
PostPaintCell( nCol, nRow, nTab );
@@ -187,7 +187,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
aDesc.initializeFrom( aProperties );
}
- String sTarget;
+ OUString sTarget;
if ( pReqArgs->GetItemState( FN_PARAM_1, sal_True, &pItem ) == SFX_ITEM_SET )
sTarget = ((const SfxStringItem*)pItem)->GetValue();
@@ -208,7 +208,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
bMakeArea = true;
if (bUndo)
{
- String aStrImport = ScGlobal::GetRscString( STR_UNDO_IMPORTDATA );
+ OUString aStrImport = ScGlobal::GetRscString( STR_UNDO_IMPORTDATA );
GetUndoManager()->EnterListAction( aStrImport, aStrImport );
}
@@ -223,10 +223,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
bool bDo = true;
if (!bIsNewArea)
{
- String aTemplate = ScGlobal::GetRscString( STR_IMPORT_REPLACE );
- String aMessage = aTemplate.GetToken( 0, '#' );
+ OUString aTemplate = ScGlobal::GetRscString( STR_IMPORT_REPLACE );
+ OUString aMessage = aTemplate.getToken( 0, '#' );
aMessage += sTarget;
- aMessage += aTemplate.GetToken( 1, '#' );
+ aMessage += aTemplate.getToken( 1, '#' );
QueryBox aBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage );
bDo = ( aBox.Execute() == RET_YES );
@@ -258,7 +258,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
ScDocument* pDoc = GetDocument();
const SfxPoolItem* pItem;
- String aChartName, aRangeName;
+ OUString aChartName, aRangeName;
ScRange aSingleRange;
ScRangeListRef aRangeListRef;
@@ -304,7 +304,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- if (pViewSh && bValid && aChartName.Len() != 0 )
+ if (pViewSh && bValid && !aChartName.isEmpty() )
{
Window* pParent = pViewSh->GetDialogParent();
@@ -803,7 +803,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
if ( pItem->ISA(SfxStringItem) )
{
- String aName = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aName = ((const SfxStringItem*)pItem)->GetValue();
SCTAB nTab;
if (aDocument.GetTable( aName, nTab ))
{
@@ -990,7 +990,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
xCloseable->close( sal_True );
- String aUserName( ScGlobal::GetRscString( STR_UNKNOWN_USER ) );
+ OUString aUserName( ScGlobal::GetRscString( STR_UNKNOWN_USER ) );
try
{
::svt::DocumentLockFile aLockFile( GetSharedFileURL() );
@@ -1159,7 +1159,7 @@ bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJust
else
{
InfoBox aBox( GetActiveDialogParent(),
- String( ScResId( SCSTR_WRONGPASSWORD ) ) );
+ OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
aBox.Execute();
}
}
@@ -1363,7 +1363,7 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages )
{
sal_Bool bUndo(aDocument.IsUndoEnabled());
- String aStyleName = aDocument.GetPageStyle( nTab );
+ OUString aStyleName = aDocument.GetPageStyle( nTab );
ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyleSheet, "PageStyle not found" );
@@ -1398,7 +1398,7 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
bool bChange = false;
SCTAB nTab = rRange.aStart.Tab();
- String aStyleName = aDocument.GetPageStyle( nTab );
+ OUString aStyleName = aDocument.GetPageStyle( nTab );
ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyleSheet, "PageStyle not found" );
@@ -1529,7 +1529,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
else if ( pReqArgs == NULL )
{
sal_Bool bUndo(aDocument.IsUndoEnabled());
- String aOldName = aDocument.GetPageStyle( nCurTab );
+ OUString aOldName = aDocument.GetPageStyle( nCurTab );
ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet
= pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE );
@@ -1556,7 +1556,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
WaitObject aWait( GetActiveDialogParent() );
- String aNewName = pStyleSheet->GetName();
+ OUString aNewName = pStyleSheet->GetName();
if ( aNewName != aOldName &&
aDocument.RenamePageStyleInUse( aOldName, aNewName ) )
{
@@ -1602,7 +1602,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
}
else if ( pReqArgs == NULL )
{
- String aStr( aDocument.GetPageStyle( nCurTab ) );
+ OUString aStr( aDocument.GetPageStyle( nCurTab ) );
ScStyleSheetPool* pStylePool
= aDocument.GetStyleSheetPool();
@@ -1745,7 +1745,7 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */,
case SID_HFEDIT:
{
- String aStr = aDocument.GetPageStyle( nCurTab );
+ OUString aStr = aDocument.GetPageStyle( nCurTab );
ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStr, SFX_STYLE_FAMILY_PAGE );
@@ -2282,8 +2282,8 @@ IMPL_LINK( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
if ( pMed->GetFilter() )
pImpl->pRequest->AppendItem(
SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName() ) );
- String sOptions = ScDocumentLoader::GetOptions( *pMed );
- if ( sOptions.Len() > 0 )
+ OUString sOptions = ScDocumentLoader::GetOptions( *pMed );
+ if ( !sOptions.isEmpty() )
pImpl->pRequest->AppendItem( SfxStringItem( SID_FILE_FILTEROPTIONS, sOptions ) );
}
const SfxPoolItem* pItem = NULL;
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index c0b12160ad86..9ad746df0823 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -252,13 +252,13 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
{
ScDBCollection* pUndoColl = NULL;
- String aNewName;
+ OUString aNewName;
if (eMode==SC_DB_IMPORT)
{
aDocument.CompileDBFormula( sal_True ); // CreateFormulaString
pUndoColl = new ScDBCollection( *pColl ); // Undo fuer Import1-Bereich
- String aImport = ScGlobal::GetRscString( STR_DBNAME_IMPORT );
+ OUString aImport = ScGlobal::GetRscString( STR_DBNAME_IMPORT );
long nCount = 0;
const ScDBData* pDummy = NULL;
ScDBCollection::NamedDBs& rDBs = pColl->getNamedDBs();
@@ -901,7 +901,7 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
sal_Bool bVbaEnabled = aDocument.IsInVBAMode();
if ( bVbaEnabled )
{
- String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+ OUString aLibName( "Standard" );
Reference< XLibraryContainer > xLibContainer = GetBasicContainer();
Reference< XVBACompatibility > xVBACompat( xLibContainer, UNO_QUERY );
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 3256980caf29..ca6aeb373f51 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -299,7 +299,7 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS
SfxStyleSheetBase* pSourceStyle = aIter.First();
while (pSourceStyle)
{
- String aName = pSourceStyle->GetName();
+ OUString aName = pSourceStyle->GetName();
SfxStyleSheetBase* pDestStyle = pDestPool->Find( pSourceStyle->GetName(), pSourceStyle->GetFamily() );
if ( pDestStyle )
{
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 9004222a561b..5fa6795215ff 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -101,24 +101,24 @@ using ::std::vector;
namespace
{
- sal_uLong lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager2>& _rDrvMgr,uno::Reference<sdbc::XConnection>& _rConnection,String& _rTabName,const String& rFullFileName,rtl_TextEncoding eCharSet)
+ sal_uLong lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager2>& _rDrvMgr, uno::Reference<sdbc::XConnection>& _rConnection, OUString& _rTabName, const OUString& rFullFileName, rtl_TextEncoding eCharSet)
{
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( rFullFileName );
_rTabName = aURL.getBase( INetURLObject::LAST_SEGMENT, true,
INetURLObject::DECODE_UNAMBIGUOUS );
- String aExtension = aURL.getExtension();
+ OUString aExtension = aURL.getExtension();
aURL.removeSegment();
aURL.removeFinalSlash();
- String aPath = aURL.GetMainURL(INetURLObject::NO_DECODE);
+ OUString aPath = aURL.GetMainURL(INetURLObject::NO_DECODE);
uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
_rDrvMgr.set( sdbc::DriverManager::create( xContext ) );
// get connection
- String aConnUrl = OUString("sdbc:dbase:");
+ OUString aConnUrl("sdbc:dbase:");
aConnUrl += aPath;
svxform::ODataAccessCharsetHelper aHelper;
@@ -164,7 +164,7 @@ bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject&
bMoveData = false;
bKillSource = true;
}
- String aName = rDestObj.getName();
+ OUString aName = rDestObj.getName();
INetURLObject aDestPathObj = rDestObj;
aDestPathObj.removeSegment();
aDestPathObj.setFinalSlash();
@@ -313,7 +313,7 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, CharSet eCharS
try
{
- String aTabName;
+ OUString aTabName;
uno::Reference<sdbc::XDriverManager2> xDrvMan;
uno::Reference<sdbc::XConnection> xConnection;
sal_uLong nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
@@ -563,10 +563,10 @@ void lcl_GetColumnTypes(
nFieldLen = aString.getToken( 2, ',' ).toInt32();
if ( !bPrecDefined && nToken > 3 )
{
- String aTmp( aString.getToken( 3, ',' ) );
+ OUString aTmp( aString.getToken( 3, ',' ) );
if ( CharClass::isAsciiNumeric(aTmp) )
{
- nPrecision = aTmp.ToInt32();
+ nPrecision = aTmp.toInt32();
bPrecDefined = sal_True;
}
}
@@ -582,14 +582,14 @@ void lcl_GetColumnTypes(
// keine doppelten Namen.
if ( !IsAsciiAlpha( aFieldName[0] ) )
aFieldName = "N" + aFieldName;
- String aTmpStr;
+ OUString aTmpStr;
sal_Unicode c;
for ( const sal_Unicode* p = aFieldName.getStr(); ( c = *p ) != 0; p++ )
{
if ( IsAsciiAlpha( c ) || IsAsciiDigit( c ) || c == '_' )
- aTmpStr += c;
+ aTmpStr += OUString(c);
else
- aTmpStr += '_';
+ aTmpStr += "_";
}
aFieldName = aTmpStr;
if ( aFieldName.getLength() > 10 )
@@ -598,13 +598,13 @@ void lcl_GetColumnTypes(
if (!aFieldNames.insert(aFieldName).second)
{ // doppelter Feldname, numerisch erweitern
sal_uInt16 nSub = 1;
- String aFixPart( aFieldName );
+ OUString aFixPart( aFieldName );
do
{
++nSub;
- String aVarPart = OUString::number( nSub );
- if ( aFixPart.Len() + aVarPart.Len() > 10 )
- aFixPart.Erase( 10 - aVarPart.Len() );
+ OUString aVarPart = OUString::number( nSub );
+ if ( aFixPart.getLength() + aVarPart.getLength() > 10 )
+ aFixPart = aFixPart.copy( 0, 10 - aVarPart.getLength() );
aFieldName = aFixPart;
aFieldName += aVarPart;
} while (!aFieldNames.insert(aFieldName).second);
@@ -821,7 +821,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, CharSet eCharS
SCROW nDocRow = 0;
ScFieldEditEngine aEditEngine(&aDocument, aDocument.GetEditPool());
OUString aString;
- String aTabName;
+ OUString aTabName;
try
{
@@ -1128,8 +1128,8 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, CharSet eCharS
else
bTest = true;
}
- String sPosition( ScAddress( nDocCol, nDocRow, nTab).GetColRowString());
- String sEncoding( SvxTextEncodingTable().GetTextString( eCharSet));
+ OUString sPosition( ScAddress( nDocCol, nDocRow, nTab).GetColRowString());
+ OUString sEncoding( SvxTextEncodingTable().GetTextString( eCharSet));
nErr = *new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
SCERR_EXPORT_FIELDWIDTH), sPosition, sEncoding,
ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 8548f06b9108..37122f644e24 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -694,7 +694,7 @@ void ScExternalRefCache::setRangeNameTokens(sal_uInt16 nFileId, const OUString&
if (!pDoc)
return;
- String aUpperName = ScGlobal::pCharClass->uppercase(rName);
+ OUString aUpperName = ScGlobal::pCharClass->uppercase(rName);
RangeNameMap& rMap = pDoc->maRangeNames;
rMap.insert(RangeNameMap::value_type(aUpperName, pArray));
pDoc->maRealRangeNameMap.insert(NamePairMap::value_type(aUpperName, rName));
@@ -744,7 +744,7 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa
DocItem& rDoc = *pDocItem;
// Now, find the table position of the first table to cache.
- const String& rFirstTabName = rData.front().maTableName;
+ const OUString& rFirstTabName = rData.front().maTableName;
TableNameIndexMap::iterator itrTabName = rDoc.maTableNameIndex.find(
ScGlobal::pCharClass->uppercase(rFirstTabName));
if (itrTabName == rDoc.maTableNameIndex.end())
@@ -813,7 +813,7 @@ bool ScExternalRefCache::isDocInitialized(sal_uInt16 nFileId)
return pDoc->mbInitFromSource;
}
-static bool lcl_getTableDataIndex(const ScExternalRefCache::TableNameIndexMap& rMap, const String& rName, size_t& rIndex)
+static bool lcl_getTableDataIndex(const ScExternalRefCache::TableNameIndexMap& rMap, const OUString& rName, size_t& rIndex)
{
ScExternalRefCache::TableNameIndexMap::const_iterator itr = rMap.find(rName);
if (itr == rMap.end())
@@ -961,7 +961,7 @@ bool ScExternalRefCache::setCacheTableReferenced( sal_uInt16 nFileId, const OUSt
if (pDoc)
{
size_t nIndex = 0;
- String aTabNameUpper = ScGlobal::pCharClass->uppercase( rTabName);
+ OUString aTabNameUpper = ScGlobal::pCharClass->uppercase( rTabName);
if (lcl_getTableDataIndex( pDoc->maTableNameIndex, aTabNameUpper, nIndex))
{
size_t nStop = ::std::min( nIndex + nSheets, pDoc->maTables.size());
@@ -1146,7 +1146,7 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
DocItem& rDoc = *pDoc;
size_t nIndex;
- String aTabNameUpper = ScGlobal::pCharClass->uppercase(rTabName);
+ OUString aTabNameUpper = ScGlobal::pCharClass->uppercase(rTabName);
if (lcl_getTableDataIndex(rDoc.maTableNameIndex, aTabNameUpper, nIndex))
{
// specified table found.
@@ -1640,7 +1640,7 @@ namespace {
*/
void putCellDataIntoCache(
ScExternalRefCache& rRefCache, const ScExternalRefCache::TokenRef& pToken,
- sal_uInt16 nFileId, const String& rTabName, const ScAddress& rCell,
+ sal_uInt16 nFileId, const OUString& rTabName, const ScAddress& rCell,
const ScExternalRefCache::CellFormat* pFmt)
{
// Now, insert the token into cache table but don't cache empty cells.
@@ -1666,7 +1666,7 @@ void putCellDataIntoCache(
*/
void putRangeDataIntoCache(
ScExternalRefCache& rRefCache, ScExternalRefCache::TokenArrayRef& pArray,
- sal_uInt16 nFileId, const String& rTabName,
+ sal_uInt16 nFileId, const OUString& rTabName,
const vector<ScExternalRefCache::SingleRangeData>& rCacheData,
const ScRange& rCacheRange, const ScRange& rDataRange)
{
@@ -2033,7 +2033,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSr
sal_uInt16 nFileId, ScDocument* pSrcDoc, OUString& rName)
{
ScRangeName* pExtNames = pSrcDoc->GetRangeName();
- String aUpperName = ScGlobal::pCharClass->uppercase(rName);
+ OUString aUpperName = ScGlobal::pCharClass->uppercase(rName);
const ScRangeData* pRangeData = pExtNames->findByUpperName(aUpperName);
if (!pRangeData)
return ScExternalRefCache::TokenArrayRef();
@@ -2581,7 +2581,7 @@ void ScExternalRefManager::resetSrcFileData(const OUString& rBaseFileUrl)
void ScExternalRefManager::updateAbsAfterLoad()
{
- String aOwn( getOwnDocumentName() );
+ OUString aOwn( getOwnDocumentName() );
for (vector<SrcFileData>::iterator itr = maSrcFiles.begin(), itrEnd = maSrcFiles.end();
itr != itrEnd; ++itr)
{
@@ -2589,8 +2589,8 @@ void ScExternalRefManager::updateAbsAfterLoad()
// to be called when the original name is no longer needed (after CompileXML)
itr->maybeCreateRealFileName( aOwn );
- String aReal = itr->maRealFileName;
- if (aReal.Len())
+ OUString aReal = itr->maRealFileName;
+ if (!aReal.isEmpty())
itr->maFileName = aReal;
}
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 93f3960e025c..3392f06d303a 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -275,7 +275,7 @@ bool ScImportExport::ExportData( const OUString& rMimeType,
{
SvMemoryStream aStrm;
// mba: no BaseURL for data exchange
- if( ExportStream( aStrm, String(),
+ if( ExportStream( aStrm, OUString(),
SotExchange::GetFormatIdFromMimeType( rMimeType ) ))
{
aStrm << (sal_uInt8) 0;
@@ -296,7 +296,7 @@ bool ScImportExport::ImportString( const OUString& rText, sal_uLong nFmt )
case FORMAT_STRING :
{
ScImportStringStream aStrm( rText);
- return ImportStream( aStrm, String(), nFmt );
+ return ImportStream( aStrm, OUString(), nFmt );
// ImportStream must handle RTL_TEXTENCODING_UNICODE
}
//break;
@@ -307,7 +307,7 @@ bool ScImportExport::ImportString( const OUString& rText, sal_uLong nFmt )
SvMemoryStream aStrm( (void*)aTmp.getStr(), aTmp.getLength() * sizeof(sal_Char), STREAM_READ );
aStrm.SetStreamCharSet( eEnc );
SetNoEndianSwap( aStrm ); //! no swapping in memory
- return ImportStream( aStrm, String(), nFmt );
+ return ImportStream( aStrm, OUString(), nFmt );
}
}
}
@@ -330,7 +330,7 @@ bool ScImportExport::ExportString( OUString& rText, sal_uLong nFmt )
aStrm.SetStreamCharSet( RTL_TEXTENCODING_UNICODE );
SetNoEndianSwap( aStrm ); //! no swapping in memory
// mba: no BaseURL for data exc
- if( ExportStream( aStrm, String(), nFmt ) )
+ if( ExportStream( aStrm, OUString(), nFmt ) )
{
aStrm << (sal_Unicode) 0;
aStrm.Seek( STREAM_SEEK_TO_END );
@@ -358,7 +358,7 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sa
aStrm.SetStreamCharSet( eEnc );
SetNoEndianSwap( aStrm ); //! no swapping in memory
// mba: no BaseURL for data exchange
- if( ExportStream( aStrm, String(), nFmt ) )
+ if( ExportStream( aStrm, OUString(), nFmt ) )
{
aStrm << (sal_Char) 0;
aStrm.Seek( STREAM_SEEK_TO_END );
@@ -434,7 +434,7 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, sa
}
if( nFmt == SOT_FORMATSTR_ID_LINK && !bAll )
{
- String aDocName;
+ OUString aDocName;
if ( pDoc->IsClipboard() )
aDocName = ScGlobal::GetClipDocName();
else
@@ -444,8 +444,8 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, sa
aDocName = pShell->GetTitle( SFX_TITLE_FULLNAME );
}
- OSL_ENSURE( aDocName.Len(), "ClipBoard document has no name! :-/" );
- if( aDocName.Len() )
+ OSL_ENSURE( !aDocName.isEmpty(), "ClipBoard document has no name! :-/" );
+ if( !aDocName.isEmpty() )
{
// Always use Calc A1 syntax for paste link.
OUString aRefName;
@@ -712,21 +712,21 @@ static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, OUString& rStrin
return p;
}
-static void lcl_UnescapeSylk( String & rString, SylkVersion eVersion )
+static void lcl_UnescapeSylk( OUString & rString, SylkVersion eVersion )
{
// Older versions didn't escape the semicolon.
// Older versions quoted the string and doubled embedded quotes, but not
// the semicolons, which was plain wrong.
if (eVersion >= SYLK_OOO32)
- rString.SearchAndReplaceAll( OUString(DOUBLE_SEMICOLON), OUString(';') );
+ rString = rString.replaceAll( OUString(DOUBLE_SEMICOLON), OUString(';') );
else
- rString.SearchAndReplaceAll( OUString(DOUBLE_DOUBLEQUOTE), OUString('"') );
+ rString = rString.replaceAll( OUString(DOUBLE_DOUBLEQUOTE), OUString('"') );
- rString.SearchAndReplaceAll( OUString(SYLK_LF), OUString('\n') );
+ rString = rString.replaceAll( OUString(SYLK_LF), OUString('\n') );
}
static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p,
- String& rString, SylkVersion eVersion )
+ OUString& rString, SylkVersion eVersion )
{
const sal_Unicode* pStartQuote = p;
const sal_Unicode* pEndQuote = 0;
@@ -762,13 +762,13 @@ static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p,
}
if (!pEndQuote)
pEndQuote = p; // Take all data as string.
- rString.Append( pStartQuote + 1, sal::static_int_cast<xub_StrLen>( pEndQuote - pStartQuote - 1 ) );
+ rString += OUString(pStartQuote + 1, sal::static_int_cast<xub_StrLen>( pEndQuote - pStartQuote - 1 ) );
lcl_UnescapeSylk( rString, eVersion);
return p;
}
static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p,
- String& rString, SylkVersion eVersion )
+ OUString& rString, SylkVersion eVersion )
{
const sal_Unicode* pStart = p;
if (eVersion >= SYLK_OOO32)
@@ -784,7 +784,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p,
}
++p;
}
- rString.Append( pStart, sal::static_int_cast<xub_StrLen>( p - pStart));
+ rString += OUString( pStart, sal::static_int_cast<xub_StrLen>( p - pStart));
lcl_UnescapeSylk( rString, eVersion);
}
else
@@ -825,7 +825,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p,
{
while (*p && *p != ';')
++p;
- rString.Append( pStart, sal::static_int_cast<xub_StrLen>( p - pStart));
+ rString += OUString( pStart, sal::static_int_cast<xub_StrLen>( p - pStart));
}
}
return p;
@@ -954,13 +954,13 @@ bool ScImportExport::Text2Doc( SvStream& rStrm )
static bool lcl_PutString(
- ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, sal_uInt8 nColFormat,
+ ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& rStr, sal_uInt8 nColFormat,
SvNumberFormatter* pFormatter, bool bDetectNumFormat,
::utl::TransliterationWrapper& rTransliteration, CalendarWrapper& rCalendar,
::utl::TransliterationWrapper* pSecondTransliteration, CalendarWrapper* pSecondCalendar )
{
bool bMultiLine = false;
- if ( nColFormat == SC_COL_SKIP || !rStr.Len() || !ValidCol(nCol) || !ValidRow(nRow) )
+ if ( nColFormat == SC_COL_SKIP || rStr.isEmpty() || !ValidCol(nCol) || !ValidRow(nRow) )
return bMultiLine;
if ( nColFormat == SC_COL_TEXT )
@@ -999,7 +999,7 @@ static bool lcl_PutString(
else if ( nColFormat != SC_COL_STANDARD ) // Datumsformate
{
const sal_uInt16 nMaxNumberParts = 7; // Y-M-D h:m:s.t
- xub_StrLen nLen = rStr.Len();
+ xub_StrLen nLen = rStr.getLength();
xub_StrLen nStart[nMaxNumberParts];
xub_StrLen nEnd[nMaxNumberParts];
@@ -1018,7 +1018,7 @@ static bool lcl_PutString(
nFound<nMaxNumberParts); nPos++ )
{
if (bInNum && nFound == 3 && nColFormat == SC_COL_YMD &&
- nPos <= nStart[nFound]+2 && rStr.GetChar(nPos) == 'T')
+ nPos <= nStart[nFound]+2 && rStr[nPos] == 'T')
bInNum = false; // ISO-8601: YYYY-MM-DDThh:mm...
else if ((((!bInNum && nFound==nMP) || (bInNum && nFound==nMP+1))
&& ScGlobal::pCharClass->isLetterNumeric( rStr, nPos))
@@ -1044,7 +1044,7 @@ static bool lcl_PutString(
xub_StrLen nDateLen = nEnd[0] + 1 - nDateStart;
if ( nDateLen >= 5 && nDateLen <= 8 &&
- ScGlobal::pCharClass->isNumeric( rStr.Copy( nDateStart, nDateLen ) ) )
+ ScGlobal::pCharClass->isNumeric( rStr.copy( nDateStart, nDateLen ) ) )
{
// 6 digits: 2 each for day, month, year
// 8 digits: 4 for year, 2 each for day and month
@@ -1074,14 +1074,14 @@ static bool lcl_PutString(
{
using namespace ::com::sun::star;
bool bSecondCal = false;
- sal_uInt16 nDay = (sal_uInt16) rStr.Copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).ToInt32();
- sal_uInt16 nYear = (sal_uInt16) rStr.Copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).ToInt32();
- String aMStr = rStr.Copy( nStart[nMP], nEnd[nMP]+1-nStart[nMP] );
- sal_Int16 nMonth = (sal_Int16) aMStr.ToInt32();
+ sal_uInt16 nDay = (sal_uInt16) rStr.copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).toInt32();
+ sal_uInt16 nYear = (sal_uInt16) rStr.copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).toInt32();
+ OUString aMStr = rStr.copy( nStart[nMP], nEnd[nMP]+1-nStart[nMP] );
+ sal_Int16 nMonth = (sal_Int16) aMStr.toInt32();
if (!nMonth)
{
- static const String aSeptCorrect( RTL_CONSTASCII_USTRINGPARAM( "SEPT" ) );
- static const String aSepShortened( RTL_CONSTASCII_USTRINGPARAM( "SEP" ) );
+ static const OUString aSeptCorrect( "SEPT" );
+ static const OUString aSepShortened( "SEP" );
uno::Sequence< i18n::CalendarItem2 > xMonths;
sal_Int32 i, nMonthCount;
// first test all month names from local international
@@ -1141,16 +1141,16 @@ static bool lcl_PutString(
// time fields to zero (ICU calendar instance defaults to current date/time)
nHour = nMinute = nSecond = nMilli = 0;
if (nFound > 3)
- nHour = (sal_Int16) rStr.Copy( nStart[3], nEnd[3]+1-nStart[3]).ToInt32();
+ nHour = (sal_Int16) rStr.copy( nStart[3], nEnd[3]+1-nStart[3]).toInt32();
if (nFound > 4)
- nMinute = (sal_Int16) rStr.Copy( nStart[4], nEnd[4]+1-nStart[4]).ToInt32();
+ nMinute = (sal_Int16) rStr.copy( nStart[4], nEnd[4]+1-nStart[4]).toInt32();
if (nFound > 5)
- nSecond = (sal_Int16) rStr.Copy( nStart[5], nEnd[5]+1-nStart[5]).ToInt32();
+ nSecond = (sal_Int16) rStr.copy( nStart[5], nEnd[5]+1-nStart[5]).toInt32();
if (nFound > 6)
{
sal_Unicode cDec = '.';
OUString aT( &cDec, 1);
- aT += rStr.Copy( nStart[6], nEnd[6]+1-nStart[6]);
+ aT += rStr.copy( nStart[6], nEnd[6]+1-nStart[6]);
rtl_math_ConversionStatus eStatus;
double fV = rtl::math::stringToDouble( aT, cDec, 0, &eStatus, 0);
if (eStatus == rtl_math_ConversionStatus_Ok)
@@ -1190,7 +1190,7 @@ static bool lcl_PutString(
}
// Standard or date not determined -> SetString / EditCell
- if( rStr.Search( '\n' ) == STRING_NOTFOUND )
+ if( rStr.indexOf( '\n' ) == -1 )
{
ScSetStringParam aParam;
aParam.mpNumFormatter = pFormatter;
@@ -1210,7 +1210,7 @@ static bool lcl_PutString(
}
-static String lcl_GetFixed( const OUString& rLine, sal_Int32 nStart, sal_Int32 nNext,
+static OUString lcl_GetFixed( const OUString& rLine, sal_Int32 nStart, sal_Int32 nNext,
bool& rbIsQuoted, bool& rbOverflowCell )
{
sal_Int32 nLen = rLine.getLength();
@@ -1706,7 +1706,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
while( bOk )
{
OUString aLine;
- String aText;
+ OUString aText;
OString aByteLine;
SCCOL nCol = nStartCol;
SCROW nRow = nStartRow;
@@ -1763,7 +1763,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
if( *p == '"' )
{
bText = true;
- aText.Erase();
+ aText = "";
p = lcl_ScanSylkString( p, aText, eVersion);
}
else
@@ -1808,7 +1808,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
}
if( !bMyDoc || !bData )
break;
- aText = '=';
+ aText = "=";
p = lcl_ScanSylkFormula( p, aText, eVersion);
ScAddress aPos( nCol, nRow, aRange.aStart.Tab() );
/* FIXME: do we want GRAM_ODFF_A1 instead? At the
@@ -1947,9 +1947,8 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
SCCOL nEndCol = aRange.aEnd.Col();
SCROW nEndRow = aRange.aEnd.Row();
OUString aCellStr;
- String aValStr;
- lcl_WriteSimpleString( rStrm,
- String( RTL_CONSTASCII_USTRINGPARAM( "ID;PCALCOOO32")));
+ OUString aValStr;
+ lcl_WriteSimpleString( rStrm, OUString("ID;PCALCOOO32") );
WriteUnicodeOrByteEndl( rStrm );
for (nRow = nStartRow; nRow <= nEndRow; nRow++)
@@ -2031,7 +2030,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
}
if ( aCellStr[0] == '=' )
aCellStr = aCellStr.copy(1);
- String aPrefix;
+ OUString aPrefix;
switch ( pFCell->GetMatrixFlag() )
{
case MM_FORMULA :
@@ -2045,7 +2044,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
aPrefix += OUString::number( nR );
aPrefix += ";C";
aPrefix += OUString::number( nC );
- aPrefix.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ";M" ) );
+ aPrefix += ";M";
}
break;
case MM_REFERENCE :
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index b1ef12fc1619..4dcc85246a56 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -31,7 +31,7 @@ using namespace formula;
// -----------------------------------------------------------------------
-static sal_Bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& rName )
+static sal_Bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const OUString& rName )
{
if (pDocSh)
{
@@ -162,16 +162,16 @@ sal_Bool ScServerObject::GetData(
bRefreshListener = false;
}
- String aDdeTextFmt = pDocSh->GetDdeTextFmt();
+ OUString aDdeTextFmt = pDocSh->GetDdeTextFmt();
ScDocument* pDoc = pDocSh->GetDocument();
if( FORMAT_STRING == SotExchange::GetFormatIdFromMimeType( rMimeType ))
{
ScImportExport aObj( pDoc, aRange );
- if( aDdeTextFmt.GetChar(0) == 'F' )
+ if( aDdeTextFmt[0] == 'F' )
aObj.SetFormulas( sal_True );
- if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
- aDdeTextFmt.EqualsAscii( "FSYLK" ) )
+ if( aDdeTextFmt.equalsAscii( "SYLK" ) ||
+ aDdeTextFmt.equalsAscii( "FSYLK" ) )
{
OString aByteData;
if( aObj.ExportByteString( aByteData, osl_getThreadTextEncoding(), SOT_FORMATSTR_ID_SYLK ) )
@@ -183,8 +183,8 @@ sal_Bool ScServerObject::GetData(
}
return 0;
}
- if( aDdeTextFmt.EqualsAscii( "CSV" ) ||
- aDdeTextFmt.EqualsAscii( "FCSV" ) )
+ if( aDdeTextFmt.equalsAscii( "CSV" ) ||
+ aDdeTextFmt.equalsAscii( "FCSV" ) )
aObj.SetSeparator( ',' );
aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, ' ', false ) );
return aObj.ExportData( rMimeType, rData ) ? 1 : 0;
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 92adbfa86bc4..5a4cfcdf6fc7 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -99,7 +99,7 @@ ScTableLink::~ScTableLink()
// Verbindung aufheben
StopRefreshTimer();
- String aEmpty;
+ OUString aEmpty;
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
SCTAB nCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nCount; nTab++)
@@ -207,8 +207,8 @@ sal_Bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilt
pSrcShell->DoLoad(pMed);
// Optionen koennten gesetzt worden sein
- String aNewOpt = ScDocumentLoader::GetOptions(*pMed);
- if (!aNewOpt.Len())
+ OUString aNewOpt = ScDocumentLoader::GetOptions(*pMed);
+ if (aNewOpt.isEmpty())
aNewOpt = aOptions;
// Undo...
@@ -236,7 +236,7 @@ sal_Bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilt
sal_uInt8 nMode = pDoc->GetLinkMode(nTab);
if (nMode && aFileName.equals(pDoc->GetLinkDoc(nTab)))
{
- String aTabName = pDoc->GetLinkTab(nTab);
+ OUString aTabName = pDoc->GetLinkTab(nTab);
// Undo
@@ -280,7 +280,7 @@ sal_Bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilt
if( pMed->GetError() == 0 )
{
// no sheet name -> use first sheet
- if ( aTabName.Len() && !bAutoTab )
+ if ( !aTabName.isEmpty() && !bAutoTab )
bFound = pSrcDoc->GetTable( aTabName, nSrcTab );
else
bFound = true;
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 186defc26e58..c407e1932b9e 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -53,7 +53,7 @@ ScDocStatPage::ScDocStatPage( Window *pParent, const SfxItemSet& rSet )
pDocSh->GetDocStat( aDocStat );
VclFrame *pFrame = get<VclFrame>("StatisticsInfoPage");
- String aInfo = pFrame->get_label();
+ OUString aInfo = pFrame->get_label();
aInfo += aDocStat.aDocName;
pFrame->set_label(aInfo);
m_pFtTables ->SetText( OUString::number( aDocStat.nTableCount ) );