From e960fe88dd29980dcd902c5d2464c93fc5f6254e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 10 May 2011 15:50:44 -0400 Subject: More cleanups of ScDBData. String to rtl::OUString, tabs to whitespaces etc. --- sc/source/ui/dbgui/dbnamdlg.cxx | 28 +++++++++++++++------------- sc/source/ui/dbgui/foptmgr.cxx | 2 +- sc/source/ui/dbgui/pfiltdlg.cxx | 14 +++++++------- sc/source/ui/dbgui/tpsort.cxx | 2 +- sc/source/ui/docshell/dbdocfun.cxx | 6 +++--- sc/source/ui/docshell/docsh5.cxx | 2 +- sc/source/ui/navipi/content.cxx | 2 +- sc/source/ui/undo/undoutil.cxx | 9 ++++----- sc/source/ui/unoobj/datauno.cxx | 4 ++-- sc/source/ui/view/cellsh2.cxx | 2 +- 10 files changed, 36 insertions(+), 35 deletions(-) (limited to 'sc/source/ui') 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; iGetName( 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; iGetName() == 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; iGetName() == 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 ); -- cgit v1.2.3