From 104261010aa5ccbb7df4a82a3a3cafcfb0591fa7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 4 Jul 2012 23:58:05 +0100 Subject: some UniString->rtl::OUString Change-Id: Ie69b30094da25df23a36baca2c7723d6a41f48c3 --- dbaccess/source/ui/app/AppController.cxx | 4 ++-- dbaccess/source/ui/browser/unodatbr.cxx | 2 +- dbaccess/source/ui/control/FieldDescControl.cxx | 20 +++++++------------- dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 10 +++++----- dbaccess/source/ui/dlg/dbadmin.cxx | 6 +++--- dbaccess/source/ui/dlg/indexfieldscontrol.cxx | 4 ++-- dbaccess/source/ui/misc/WCPage.cxx | 4 ++-- .../source/ui/querydesign/SelectionBrowseBox.cxx | 2 +- dbaccess/source/ui/tabledesign/TEditControl.cxx | 2 +- .../source/ui/tabledesign/TableDesignControl.cxx | 2 +- 10 files changed, 25 insertions(+), 31 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 0614c4721f51..9fd4d3a31798 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2205,9 +2205,9 @@ void OApplicationController::renameEntry() } catch(const ElementExistException& e) { - static ::rtl::OUString sStatus = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")); + rtl::OUString sStatus("S1000"); String sMsg = String( ModuleRes( STR_NAME_ALREADY_EXISTS ) ); - sMsg.SearchAndReplace('#',e.Message); + sMsg.SearchAndReplace(rtl::OUString('#'), e.Message); showError(SQLExceptionInfo(SQLException(sMsg, e.Context, sStatus, 0, Any()))); } catch(const Exception& ) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index b679e180fd4f..e50a64eb990f 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -1857,7 +1857,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const xProp->getPropertyValue(PROPERTY_COMMAND) >>= aName; String sObject(aName); - sTitle.SearchAndReplace('#',sObject); + sTitle.SearchAndReplace(rtl::OUString('#'), sObject); aReturn.sTitle = sTitle; aReturn.bEnabled = sal_True; } diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 2759864379de..b1423140c2bd 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include "UITools.hxx" #include #include "dbu_control.hrc" @@ -263,33 +264,26 @@ OFieldDescControl::~OFieldDescControl() //------------------------------------------------------------------------------ String OFieldDescControl::BoolStringPersistent(const String& rUIString) const { - static String aZero('0'); - static String aOne('1'); - if (rUIString == aNo) - return aZero; + return rtl::OUString('0'); if (rUIString == aYes) - return aOne; - return String(); + return rtl::OUString('1'); + return rtl::OUString(); } //------------------------------------------------------------------------------ String OFieldDescControl::BoolStringUI(const String& rPersistentString) const { - static String aZero('0'); - static String aOne('1'); - static String aNone(ModuleRes(STR_VALUE_NONE)); - // Older versions may store a language dependend string as a default if (rPersistentString.Equals(aYes) || rPersistentString.Equals(aNo)) return rPersistentString; - if (rPersistentString == aZero) + if (comphelper::string::equals(rPersistentString, '0')) return aNo; - if (rPersistentString == aOne) + if (comphelper::string::equals(rPersistentString, '1')) return aYes; - return aNone; + return ModuleRes(STR_VALUE_NONE).toString(); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index a04d977daf83..ab4b1505aac0 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -470,7 +470,7 @@ DBG_NAME(OTextConnectionHelper) else { sExtension = m_aETOwnExtension.GetText(); - if ( sExtension.GetToken(0,'.').Equals('*') ) + if ( comphelper::string::equals(sExtension.GetToken(0,'.'), '*') ) sExtension.Erase(0,2); } return sExtension; @@ -487,11 +487,11 @@ DBG_NAME(OTextConnectionHelper) return rBox.GetText().Copy(0); if ( !( &m_aTextSeparator == &rBox && nPos == (rBox.GetEntryCount()-1) ) ) - return String( + return rtl::OUString( static_cast< sal_Unicode >( rList.GetToken(((nPos*2)+1), nTok ).ToInt32())); // somewhat strange ... translates for instance an "32" into " " - return String(); + return rtl::OUString(); } //------------------------------------------------------------------------ @@ -503,11 +503,11 @@ DBG_NAME(OTextConnectionHelper) for( i=0 ; i( rList.GetToken( (i+1), nTok ).ToInt32())); - if( sTVal == rVal ) + if( sTVal.equals(rVal) ) { rBox.SetText( rList.GetToken( i, nTok ) ); break; diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 7c36e19528b1..d3ddfb7ac0e5 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -343,9 +343,9 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxBoolItem(DSID_SHOWDELETEDROWS, sal_False); *pCounter++ = new SfxBoolItem(DSID_ALLOWLONGTABLENAMES, sal_False); *pCounter++ = new SfxStringItem(DSID_JDBCDRIVERCLASS, rtl::OUString()); - *pCounter++ = new SfxStringItem(DSID_FIELDDELIMITER, ','); - *pCounter++ = new SfxStringItem(DSID_TEXTDELIMITER, '"'); - *pCounter++ = new SfxStringItem(DSID_DECIMALDELIMITER, '.'); + *pCounter++ = new SfxStringItem(DSID_FIELDDELIMITER, rtl::OUString(',')); + *pCounter++ = new SfxStringItem(DSID_TEXTDELIMITER, rtl::OUString('"')); + *pCounter++ = new SfxStringItem(DSID_DECIMALDELIMITER, rtl::OUString('.')); *pCounter++ = new SfxStringItem(DSID_THOUSANDSDELIMITER, rtl::OUString()); *pCounter++ = new SfxStringItem(DSID_TEXTFILEEXTENSION, rtl::OUString("txt")); *pCounter++ = new SfxBoolItem(DSID_TEXTFILEHEADER, sal_True); diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 9f0b4d997c69..120140063ef7 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -219,7 +219,7 @@ DBG_NAME(IndexFieldsControl) sal_Int32 nWidthAsc = GetTextWidth(m_sAscendingText) + GetSettings().GetStyleSettings().GetScrollBarSize(); sal_Int32 nWidthDesc = GetTextWidth(m_sDescendingText) + GetSettings().GetStyleSettings().GetScrollBarSize(); // maximum plus some additional space - return (nWidthAsc > nWidthDesc ? nWidthAsc : nWidthDesc) + GetTextWidth('0') * 2; + return (nWidthAsc > nWidthDesc ? nWidthAsc : nWidthDesc) + GetTextWidth(rtl::OUString('0')) * 2; } return EditBrowseBox::GetTotalCellWidth(_nRow, _nColId); } @@ -249,7 +249,7 @@ DBG_NAME(IndexFieldsControl) nOther = GetTextWidth(m_sDescendingText) + GetSettings().GetStyleSettings().GetScrollBarSize(); nSortOrderColumnWidth = nSortOrderColumnWidth > nOther ? nSortOrderColumnWidth : nOther; // (plus some additional space) - nSortOrderColumnWidth += GetTextWidth('0') * 2; + nSortOrderColumnWidth += GetTextWidth(rtl::OUString('0')) * 2; InsertDataColumn(COLUMN_ID_ORDER, sColumnName, nSortOrderColumnWidth, HIB_STDSTYLE, 1); m_pSortingCell = new ListBoxControl(&GetDataWindow()); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 7779a2d1451a..6e16280bbd99 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -208,8 +208,8 @@ sal_Bool OCopyTable::LeavePage() && m_pParent->m_aKeyName != m_pParent->createUniqueName(m_pParent->m_aKeyName) ) { String aInfoString( ModuleRes(STR_WIZ_PKEY_ALREADY_DEFINED) ); - aInfoString += String(' '); - aInfoString += String(m_pParent->m_aKeyName); + aInfoString += rtl::OUString(' '); + aInfoString += m_pParent->m_aKeyName; m_pParent->showError(aInfoString); return sal_False; } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index b7a07cf1781a..7c4ad6f91343 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -2329,7 +2329,7 @@ String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nCo sal_uInt16 nIdx = m_pOrderCell->GetSelectEntryPos(); if (nIdx == sal_uInt16(-1)) nIdx = 0; - return String(nIdx); + return rtl::OUString(nIdx); } default: return GetCellText(nCellIndex, nColId); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 231eef5cd72f..2bd52f703d24 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -1267,7 +1267,7 @@ String OTableEditorCtrl::GetCellText( long nRow, sal_uInt16 nColId ) const sal_uInt32 OTableEditorCtrl::GetTotalCellWidth(long nRow, sal_uInt16 nColId) { DBG_CHKTHIS(OTableEditorCtrl,NULL); - return GetTextWidth(GetCellText(nRow, nColId)) + 2 * GetTextWidth('0'); + return GetTextWidth(GetCellText(nRow, nColId)) + 2 * GetTextWidth(rtl::OUString('0')); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index 0794cd67b6cc..f3690eb29de1 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -74,7 +74,7 @@ void OTableRowView::Init() SetFont(aFont); // HandleColumn, fuer maximal fuenf Ziffern einrichten - InsertHandleColumn(static_cast(GetTextWidth('0') * 4)/*, sal_True */); + InsertHandleColumn(static_cast(GetTextWidth(rtl::OUString('0')) * 4)/*, sal_True */); BrowserMode nMode = BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTOSIZE_LASTCOL; -- cgit