summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-05-10 15:50:44 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-05-10 15:51:53 -0400
commite960fe88dd29980dcd902c5d2464c93fc5f6254e (patch)
treee1a8cdbf3851a7b1eacc3455f395a4e273f0ed0e /sc/source/ui
parent357b6c357b656d177a82b195650d0a18b99f4662 (diff)
More cleanups of ScDBData.
String to rtl::OUString, tabs to whitespaces etc.
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx28
-rw-r--r--sc/source/ui/dbgui/foptmgr.cxx2
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx14
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx2
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx6
-rw-r--r--sc/source/ui/docshell/docsh5.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx2
-rw-r--r--sc/source/ui/undo/undoutil.cxx9
-rw-r--r--sc/source/ui/unoobj/datauno.cxx4
-rw-r--r--sc/source/ui/view/cellsh2.cxx2
10 files changed, 36 insertions, 35 deletions
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 5e084c33b..695b83490 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -257,7 +257,7 @@ void ScDbNameDlg::Init()
pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, sal_True );
if ( pDBData )
{
- String theDbName;
+ ::rtl::OUString theDbName;
ScAddress& rStart = theCurArea.aStart;
ScAddress& rEnd = theCurArea.aEnd;
SCCOL nCol1;
@@ -272,8 +272,8 @@ void ScDbNameDlg::Init()
&& (rStart.Col() == nCol1) && (rStart.Row() == nRow1)
&& (rEnd.Col() == nCol2) && (rEnd.Row() == nRow2 ) )
{
- pDBData->GetName( theDbName );
- if ( theDbName != aStrNoName )
+ theDbName = pDBData->GetName();
+ if ( !theDbName.equals(aStrNoName) )
aEdName.SetText( theDbName );
else
aEdName.SetText( EMPTY_STRING );
@@ -297,21 +297,23 @@ void ScDbNameDlg::Init()
void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
{
- String aSource = aStrSource;
+ ::rtl::OUStringBuffer aBuf;
+ aBuf.append(aStrSource);
if (pDBData)
{
- aSource += ' ';
- aSource += pDBData->GetSourceString();
+ aBuf.append(sal_Unicode(' '));
+ aBuf.append(pDBData->GetSourceString());
}
- aFTSource.SetText( aSource );
+ aFTSource.SetText(aBuf.makeStringAndClear());
+ aBuf.append(aStrOperations);
String aOper = aStrOperations;
if (pDBData)
{
- aOper += ' ';
- aOper += pDBData->GetOperations();
+ aBuf.append(sal_Unicode(' '));
+ aBuf.append(pDBData->GetOperations());
}
- aFTOperations.SetText( aOper );
+ aFTOperations.SetText(aBuf.makeStringAndClear());
}
//----------------------------------------------------------------------------
@@ -377,15 +379,15 @@ void ScDbNameDlg::UpdateNames()
if ( nNameCount > 0 )
{
ScDBData* pDbData = NULL;
- String aString;
+ ::rtl::OUString aString;
for ( sal_uInt16 i=0; i<nNameCount; i++ )
{
pDbData = (ScDBData*)(aLocalDbCol.At( i ));
if ( pDbData )
{
- pDbData->GetName( aString );
- if ( aString != aStrNoName )
+ aString = pDbData->GetName();
+ if (!aString.equals(aStrNoName))
aEdName.InsertEntry( aString );
}
}
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index e55b34ad4..a6bc3f6db 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -190,7 +190,7 @@ void ScFilterOptionsMgr::Init()
if ( pDBData )
{
rBtnHeader.Check( pDBData->HasHeader() );
- pDBData->GetName( theDbName );
+ theDbName = pDBData->GetName();
if ( theDbName != rStrNoName )
{
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index 9f59d426f..b2e0cfe28 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -174,8 +174,7 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
theQueryData.nRow2,
nSrcTab ) );
ScDBCollection* pDBColl = pDoc->GetDBCollection();
- String theDbArea;
- String theDbName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME));
+ ::rtl::OUString theDbName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME));
/*
* Ueberpruefen, ob es sich bei dem uebergebenen
@@ -192,13 +191,14 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
rStart.Col(), rStart.Row(),
rEnd.Col(), rEnd.Row() );
if ( pDBData )
- pDBData->GetName( theDbName );
+ theDbName = pDBData->GetName();
}
- theDbArea.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" ("));
- theDbArea += theDbName;
- theDbArea += ')';
- aFtDbArea.SetText( theDbArea );
+ ::rtl::OUStringBuffer aBuf;
+ aBuf.appendAscii(" (");
+ aBuf.append(theDbName);
+ aBuf.append(sal_Unicode(')'));
+ aFtDbArea.SetText(aBuf.makeStringAndClear());
}
else
{
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 8cc4a3729..0ddd3b187 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -689,7 +689,7 @@ void ScTabPageSortOptions::Init()
rSortData.nCol2, rSortData.nRow2 );
if ( pDBData )
{
- pDBData->GetName( theDbName );
+ theDbName = pDBData->GetName();
aBtnHeader.Check( pDBData->HasHeader() );
}
}
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 02d73f05c..be8b2fc06 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1472,13 +1472,13 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
ScDBCollection& rDBColl = *pDoc->GetDBCollection();
ScDBData* pData = NULL;
ScImportParam aImportParam;
- sal_Bool bFound = false;
+ bool bFound = false;
sal_uInt16 nCount = rDBColl.GetCount();
for (sal_uInt16 i=0; i<nCount && !bFound; i++)
{
pData = rDBColl[i];
- if (pData->GetName() == rTarget)
- bFound = sal_True;
+ if (pData->GetName().equals(rTarget))
+ bFound = true;
}
if (!bFound)
{
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index a4b252746..3e7a4ee90 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -489,7 +489,7 @@ String lcl_GetAreaName( ScDocument* pDoc, ScArea* pArea )
pArea->nColEnd, pArea->nRowEnd );
if (pData)
{
- pData->GetName( aName );
+ aName = pData->GetName();
bOk = sal_True;
}
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 8fc3dca97..dcd0aa92b 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -272,7 +272,7 @@ String lcl_GetDBAreaRange( ScDocument* pDoc, const String& rDBName )
for ( sal_uInt16 i=0; i<nCount; i++ )
{
ScDBData* pData = (*pDbNames)[i];
- if ( pData->GetName() == rDBName )
+ if ( pData->GetName().equals(rDBName) )
{
ScRange aRange;
pData->GetArea(aRange);
diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx
index 93d9c3fe8..1edbdc5c3 100644
--- a/sc/source/ui/undo/undoutil.cxx
+++ b/sc/source/ui/undo/undoutil.cxx
@@ -94,13 +94,12 @@ ScDBData* ScUndoUtil::GetOldDBData( ScDBData* pUndoData, ScDocument* pDoc, SCTAB
if (!pRet)
{
- sal_Bool bWasTemp = false;
+ bool bWasTemp = false;
if ( pUndoData )
{
- String aName;
- pUndoData->GetName( aName );
- if ( rtl::OUString(aName) == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME) ) )
- bWasTemp = sal_True;
+ const ::rtl::OUString& aName = pUndoData->GetName();
+ if (aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)))
+ bWasTemp = true;
}
DBG_ASSERT(bWasTemp, "Undo: didn't find database range");
(void)bWasTemp;
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index a6212a3c6..0e7fcfaf4 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -2092,8 +2092,8 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const rtl::OUString& aPr
else if ( aString.EqualsAscii( SC_UNONAME_ISUSER ) )
{
// all database ranges except "unnamed" are user defined
- ScUnoHelpFunctions::SetBoolInAny( aRet,
- ( pData->GetName() != String(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)) ) );
+ ScUnoHelpFunctions::SetBoolInAny(
+ aRet, !pData->GetName().equalsAscii(STR_DB_LOCAL_NONAME));
}
else if ( aString.EqualsAscii( SC_UNO_LINKDISPBIT ) )
{
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 3b88abb81..64fc2a391 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -735,7 +735,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pDbData )
{
pDBName = new String;
- pDbData->GetName( *pDBName );
+ *pDBName = pDbData->GetName();
if ( *pDBName != aStrNoName )
aList.Insert( pDBName );