diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-26 12:17:53 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-01 10:08:43 +0200 |
commit | d11ed5a57e23fcc8d59ec40e7f52c7f54f7241a4 (patch) | |
tree | 1cac73d4879d1349a7c849aad892fa14560c03ca /dbaccess/source/ui | |
parent | 5a9e9c8a22586a9309b53cc49f063115d31f5b38 (diff) |
convert dbaccess module from String to OUString
Change-Id: I110c925f8d955dfd841cdd1092c13df4d8205393
Diffstat (limited to 'dbaccess/source/ui')
132 files changed, 825 insertions, 825 deletions
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index f56f039f4781..39e5dcec416a 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -274,7 +274,7 @@ namespace dbaui @return <TRUE/> if the paste opertions was successful, otherwise <FALSE/>. */ - sal_Bool paste( ElementType _eType,const ::svx::ODataAccessDescriptor& _rPasteData ,const OUString& _sParentFolder = String(),sal_Bool _bMove = sal_False); + sal_Bool paste( ElementType _eType,const ::svx::ODataAccessDescriptor& _rPasteData ,const OUString& _sParentFolder = OUString(),sal_Bool _bMove = sal_False); /// returns the system clipboard. const TransferableDataHelper& getViewClipboard() const { return m_aSystemClipboard; } diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index d8813dddecdc..94a8f3ff75f4 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -89,9 +89,9 @@ namespace dbaui struct TaskEntry { - OUString sUNOCommand; - sal_uInt16 nHelpID; - String sTitle; + OUString sUNOCommand; + sal_uInt16 nHelpID; + OUString sTitle; bool bHideWhenDisabled; // TODO: we should be consistent in the task pane and the menus/toolbars: // If an entry is disabled in the latter, it should also be disabled in the former. diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx index b939ac31e8ef..843eb0be4433 100644 --- a/dbaccess/source/ui/browser/dbtreemodel.hxx +++ b/dbaccess/source/ui/browser/dbtreemodel.hxx @@ -49,7 +49,7 @@ namespace dbaui /// if the entry denotes a data source, this is the connection for this data source (if already connection) SharedConnection xConnection; SbaTableQueryBrowser::EntryType eType; - String sAccessor; + OUString sAccessor; DBTreeListUserData(); ~DBTreeListUserData(); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 84e0d7b59794..639d5067311a 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -1137,7 +1137,7 @@ OUString SbaTableQueryBrowser::getDataSourceAcessor( SvTreeListEntry* _pDataSour DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( _pDataSourceEntry->GetUserData() ); OSL_ENSURE( pData, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry data!" ); OSL_ENSURE( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAcessor: entry does not denote a data source!" ); - return pData->sAccessor.Len() ? OUString(pData->sAccessor) : GetEntryText( _pDataSourceEntry ); + return !pData->sAccessor.isEmpty() ? OUString(pData->sAccessor) : GetEntryText( _pDataSourceEntry ); } SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSource, const OUString& _rCommand, sal_Int32 _nCommandType, @@ -3493,7 +3493,7 @@ void SbaTableQueryBrowser::implAdministrate( SvTreeListEntry* _pApplyTo ) sal_Bool SbaTableQueryBrowser::requestQuickHelp( const SvTreeListEntry* _pEntry, OUString& _rText ) const { const DBTreeListUserData* pData = static_cast< const DBTreeListUserData* >( _pEntry->GetUserData() ); - if ( ( pData->eType == etDatasource ) && pData->sAccessor.Len() ) + if ( ( pData->eType == etDatasource ) && !pData->sAccessor.isEmpty() ) { _rText = ::svt::OFileNotation( pData->sAccessor ).get( ::svt::OFileNotation::N_SYSTEM ); return sal_True; diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index 4e3eb60c3dab..2c56383404ed 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -165,7 +165,7 @@ TOTypeInfoSP OColumnControlWindow::getDefaultTyp() const if ( !m_pTypeInfo.get() ) { m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); - m_pTypeInfo->aUIName = m_sTypeNames.GetToken(TYPE_OTHER); + m_pTypeInfo->aUIName = m_sTypeNames.getToken(TYPE_OTHER, ';'); } return m_pTypeInfo; } diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index d0714606867e..63f0ed5a4986 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -246,7 +246,7 @@ OFieldDescControl::~OFieldDescControl() DeactivateAggregate( tpAutoIncrementValue ); } -String OFieldDescControl::BoolStringPersistent(const String& rUIString) const +OUString OFieldDescControl::BoolStringPersistent(const OUString& rUIString) const { if (rUIString == aNo) return OUString('0'); @@ -255,10 +255,10 @@ String OFieldDescControl::BoolStringPersistent(const String& rUIString) const return OUString(); } -String OFieldDescControl::BoolStringUI(const String& rPersistentString) const +OUString OFieldDescControl::BoolStringUI(const OUString& rPersistentString) const { // Older versions may store a language dependend string as a default - if (rPersistentString.Equals(aYes) || rPersistentString.Equals(aNo)) + if (rPersistentString == aYes || rPersistentString == aNo) return rPersistentString; if (comphelper::string::equals(rPersistentString, '0')) @@ -486,7 +486,7 @@ void OFieldDescControl::SetReadOnly( sal_Bool bReadOnly ) } } -String OFieldDescControl::GetControlText( sal_uInt16 nControlId ) +OUString OFieldDescControl::GetControlText( sal_uInt16 nControlId ) { DBG_CHKTHIS(OFieldDescControl,NULL); // Read out the Controls' texts @@ -539,10 +539,10 @@ String OFieldDescControl::GetControlText( sal_uInt16 nControlId ) return m_pAutoIncrementValue->GetText(); } - return String(); + return OUString(); } -void OFieldDescControl::SetControlText( sal_uInt16 nControlId, const String& rText ) +void OFieldDescControl::SetControlText( sal_uInt16 nControlId, const OUString& rText ) { DBG_CHKTHIS(OFieldDescControl,NULL); // Set the Controls' texts @@ -551,9 +551,9 @@ void OFieldDescControl::SetControlText( sal_uInt16 nControlId, const String& rTe case FIELD_PROPERTY_BOOL_DEFAULT: if (pBoolDefault) { - String sOld = pBoolDefault->GetSelectEntry(); + OUString sOld = pBoolDefault->GetSelectEntry(); pBoolDefault->SelectEntry(rText); - if (!sOld.Equals(rText)) + if (sOld != rText) LINK(this, OFieldDescControl, ChangeHdl).Call(pBoolDefault); } break; @@ -583,9 +583,9 @@ void OFieldDescControl::SetControlText( sal_uInt16 nControlId, const String& rTe case FIELD_PROPERTY_AUTOINC: if (pAutoIncrement) { - String sOld = pAutoIncrement->GetSelectEntry(); + OUString sOld = pAutoIncrement->GetSelectEntry(); pAutoIncrement->SelectEntry(rText); - if (!sOld.Equals(rText)) + if (sOld != rText) LINK(this, OFieldDescControl, ChangeHdl).Call(pAutoIncrement); } break; @@ -673,19 +673,19 @@ IMPL_LINK( OFieldDescControl, ChangeHdl, ListBox *, pListBox ) if(pListBox == pRequired && pBoolDefault ) { // If pRequired = sal_True then the sal_Bool field must NOT contain <<none>> - String sDef = BoolStringUI(::comphelper::getString(pActFieldDescr->GetControlDefault())); + OUString sDef = BoolStringUI(::comphelper::getString(pActFieldDescr->GetControlDefault())); if(pRequired->GetSelectEntryPos() == 0) // Yes { - pBoolDefault->RemoveEntry(String(ModuleRes(STR_VALUE_NONE))); - if (!sDef.Equals(aYes) && !sDef.Equals(aNo)) + pBoolDefault->RemoveEntry(OUString(ModuleRes(STR_VALUE_NONE))); + if (sDef != aYes && sDef != aNo) pBoolDefault->SelectEntryPos(1); // No as a default else pBoolDefault->SelectEntry(sDef); } else if(pBoolDefault->GetEntryCount() < 3) { - pBoolDefault->InsertEntry(String(ModuleRes(STR_VALUE_NONE))); + pBoolDefault->InsertEntry(OUString(ModuleRes(STR_VALUE_NONE))); pBoolDefault->SelectEntry(sDef); } } @@ -985,7 +985,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pBoolDefaultText = CreateText(STR_DEFAULT_VALUE); pBoolDefault = new OPropListBoxCtrl( this, STR_HELP_BOOL_DEFAULT, FIELD_PROPERTY_BOOL_DEFAULT, WB_DROPDOWN ); pBoolDefault->SetDropDownLineCount(3); - pBoolDefault->InsertEntry(String(ModuleRes(STR_VALUE_NONE))); + pBoolDefault->InsertEntry(OUString(ModuleRes(STR_VALUE_NONE))); pBoolDefault->InsertEntry(aYes); pBoolDefault->InsertEntry(aNo); @@ -1392,15 +1392,15 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) // If pRequired = sal_True then the sal_Bool field must NOT contain <<none>> OUString sValue; pFieldDescr->GetControlDefault() >>= sValue; - String sDef = BoolStringUI(sValue); + OUString sDef = BoolStringUI(sValue); // Make sure that <<none>> is only present if the field can be NULL if ( ( pFieldType.get() && !pFieldType->bNullable ) || !pFieldDescr->IsNullable() ) { pFieldDescr->SetIsNullable(ColumnValue::NO_NULLS); // The type says so - pBoolDefault->RemoveEntry(String(ModuleRes(STR_VALUE_NONE))); - if ( !sDef.Equals(aYes) && !sDef.Equals(aNo) ) + pBoolDefault->RemoveEntry(OUString(ModuleRes(STR_VALUE_NONE))); + if ( sDef != aYes && sDef != aNo ) pBoolDefault->SelectEntryPos(1); // No as a default else pBoolDefault->SelectEntry(sDef); @@ -1409,7 +1409,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) } else if(pBoolDefault->GetEntryCount() < 3) { - pBoolDefault->InsertEntry(String(ModuleRes(STR_VALUE_NONE))); + pBoolDefault->InsertEntry(OUString(ModuleRes(STR_VALUE_NONE))); pBoolDefault->SelectEntry(sDef); } else @@ -1449,7 +1449,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if(m_pType) { - sal_uInt16 nPos = pFieldType.get() ? m_pType->GetEntryPos(String(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; + sal_uInt16 nPos = pFieldType.get() ? m_pType->GetEntryPos(OUString(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; if(nPos == LISTBOX_ENTRY_NOTFOUND) { const OTypeInfoMap* pMap = getTypeInfo(); @@ -1486,7 +1486,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) IMPL_LINK(OFieldDescControl, OnControlFocusGot, Control*, pControl ) { - String strHelpText; + OUString strHelpText; OPropNumericEditCtrl* pNumeric = dynamic_cast< OPropNumericEditCtrl* >( pControl ); if ( pNumeric ) { @@ -1516,9 +1516,9 @@ IMPL_LINK(OFieldDescControl, OnControlFocusGot, Control*, pControl ) } if (pControl == pFormat) - strHelpText =String(ModuleRes(STR_HELP_FORMAT_BUTTON)); + strHelpText = ModuleRes(STR_HELP_FORMAT_BUTTON); - if (strHelpText.Len() && (pHelp != NULL)) + if (!strHelpText.isEmpty() && (pHelp != NULL)) pHelp->SetHelpText(strHelpText); m_pActFocusWindow = pControl; @@ -1634,7 +1634,7 @@ void OFieldDescControl::implFocusLost(Window* _pWhich) // Reset HelpText if (pHelp && !pHelp->HasChildPathFocus()) - pHelp->SetHelpText( String() ); + pHelp->SetHelpText( OUString() ); } void OFieldDescControl::LoseFocus() @@ -1731,7 +1731,7 @@ sal_Bool OFieldDescControl::isTextFormat(const OFieldDescription* _pFieldDescr,s return bTextFormat; } -String OFieldDescControl::getControlDefault( const OFieldDescription* _pFieldDescr ,sal_Bool _bCheck) const +OUString OFieldDescControl::getControlDefault( const OFieldDescription* _pFieldDescr ,sal_Bool _bCheck) const { OUString sDefault; sal_Bool bCheck = !_bCheck || _pFieldDescr->GetControlDefault().hasValue(); diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index b25922316f76..c10f70f8f807 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -227,7 +227,7 @@ namespace dbaui long nRow = GetCurRow(); if ( nRow != BROWSER_ENDOFSELECTION ) { - String sFieldName(m_pListCell->GetSelectEntry()); + OUString sFieldName(m_pListCell->GetSelectEntry()); OConnectionLineDataVec* pLines = m_pConnData->GetConnLineDataList(); if ( pLines->size() <= static_cast<OConnectionLineDataVec::size_type>(nRow) ) { @@ -315,7 +315,7 @@ namespace dbaui if ( xDef.is() ) { fillListBox(xDef,nRow,nColumnId); - String sName = GetCellText( nRow, nColumnId ); + OUString sName = GetCellText( nRow, nColumnId ); m_pListCell->SelectEntry( sName ); if ( m_pListCell->GetSelectEntry() != sName ) { @@ -343,7 +343,7 @@ namespace dbaui void ORelationControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS(ORelationControl,NULL); - String aText =const_cast< ORelationControl*>(this)->GetCellText( m_nDataPos, nColumnId ); + OUString aText = const_cast< ORelationControl*>(this)->GetCellText( m_nDataPos, nColumnId ); Point aPos( rRect.TopLeft() ); Size aTextSize( GetDataWindow().GetTextHeight(),GetDataWindow().GetTextWidth( aText )); @@ -376,7 +376,7 @@ namespace dbaui { m_pListCell->InsertEntry( *pIter ); } - m_pListCell->InsertEntry(String(), 0); + m_pListCell->InsertEntry(OUString(), 0); } } catch( const Exception& ) @@ -531,7 +531,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent } IMPL_LINK( OTableListBoxControl, OnTableChanged, ListBox*, pListBox ) { - String strSelected(pListBox->GetSelectEntry()); + OUString strSelected(pListBox->GetSelectEntry()); OTableWindow* pLeft = NULL; OTableWindow* pRight = NULL; @@ -550,7 +550,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent ++aIter; OTableWindow* pSecond = aIter->second; - if ( m_lmbLeftTable.GetSelectEntry() == String(pFirst->GetName()) ) + if ( m_lmbLeftTable.GetSelectEntry() == pFirst->GetName() ) { pLeft = pFirst; pRight = pSecond; @@ -649,7 +649,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent m_pRC_Tables->ActivateCell(); m_pRC_Tables->m_ops.clear(); } - void fillEntryAndDisable(ListBox& _rListBox,const String& _sEntry) + void fillEntryAndDisable(ListBox& _rListBox,const OUString& _sEntry) { _rListBox.InsertEntry(_sEntry); _rListBox.SelectEntryPos(0); diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index 28ccfedb5bfd..27f3d7f450e4 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -57,15 +57,15 @@ OTableGrantControl::OTableGrantControl( Window* pParent,const ResId& _RsId) DBG_CTOR(OTableGrantControl,NULL); // Spalten einfuegen sal_uInt16 i=1; - InsertDataColumn( i, String(ModuleRes(STR_TABLE_PRIV_NAME) ), 75); + InsertDataColumn( i, OUString(ModuleRes(STR_TABLE_PRIV_NAME) ), 75); FreezeColumn(i++); - InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_SELECT)), 75); - InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_INSERT)), 75); - InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_DELETE)), 75); - InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_UPDATE)), 75); - InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_ALTER)), 75); - InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_REFERENCE)), 75); - InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_DROP)), 75); + InsertDataColumn( i++, OUString(ModuleRes(STR_TABLE_PRIV_SELECT)), 75); + InsertDataColumn( i++, OUString(ModuleRes(STR_TABLE_PRIV_INSERT)), 75); + InsertDataColumn( i++, OUString(ModuleRes(STR_TABLE_PRIV_DELETE)), 75); + InsertDataColumn( i++, OUString(ModuleRes(STR_TABLE_PRIV_UPDATE)), 75); + InsertDataColumn( i++, OUString(ModuleRes(STR_TABLE_PRIV_ALTER)), 75); + InsertDataColumn( i++, OUString(ModuleRes(STR_TABLE_PRIV_REFERENCE)), 75); + InsertDataColumn( i++, OUString(ModuleRes(STR_TABLE_PRIV_DROP)), 75); while(--i) SetColumnWidth(i,GetAutoColumnWidth(i)); @@ -278,7 +278,7 @@ OUString OTableGrantControl::GetCellText( long nRow, sal_uInt16 nColId ) const void OTableGrantControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS(OTableGrantControl,NULL); - String sTablename = m_aTableNames[nRow]; + OUString sTablename = m_aTableNames[nRow]; // special case for tablename if(nColumnId == COL_TABLE_NAME) m_pEdit->SetText(sTablename); @@ -413,7 +413,7 @@ void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, } else { - String aText(((OTableGrantControl*)this)->GetCellText( m_nDataPos, nColumnId )); + OUString aText(((OTableGrantControl*)this)->GetCellText( m_nDataPos, nColumnId )); Point aPos( rRect.TopLeft() ); sal_Int32 nWidth = GetDataWindow().GetTextWidth( aText ); sal_Int32 nHeight = GetDataWindow().GetTextHeight(); diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index c1c6e0b9a6b1..a068e7f56219 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -43,7 +43,7 @@ namespace dbaui { } - void CharSetListBox::SelectEntryByIanaName( const String& _rIanaName ) + void CharSetListBox::SelectEntryByIanaName( const OUString& _rIanaName ) { OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName ); if (aFind == m_aCharSets.end()) @@ -54,18 +54,18 @@ namespace dbaui if ( aFind == m_aCharSets.end() ) { - SelectEntry( String() ); + SelectEntry( OUString() ); } else { - String sDisplayName = (*aFind).getDisplayName(); + OUString sDisplayName = (*aFind).getDisplayName(); if ( LISTBOX_ENTRY_NOTFOUND == GetEntryPos( sDisplayName ) ) { // in our settings, there was an encoding selected which is not valid for the current // data source type // This is worth at least an assertion. OSL_FAIL( "CharSetListBox::SelectEntryByIanaName: invalid character set!" ); - sDisplayName = String(); + sDisplayName = ""; } SelectEntry( sDisplayName ); diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 7adf78e70403..d49c8acf08fb 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -44,14 +44,14 @@ OConnectionURLEdit::~OConnectionURLEdit() delete m_pForcedPrefix; } -void OConnectionURLEdit::SetTextNoPrefix(const String& _rText) +void OConnectionURLEdit::SetTextNoPrefix(const OUString& _rText) { OSL_ENSURE(GetSubEdit(), "OConnectionURLEdit::SetTextNoPrefix: have no current type, not changing the text!"); if (GetSubEdit()) GetSubEdit()->SetText(_rText); } -String OConnectionURLEdit::GetTextNoPrefix() const +OUString OConnectionURLEdit::GetTextNoPrefix() const { if (GetSubEdit()) return GetSubEdit()->GetText(); @@ -82,7 +82,7 @@ void OConnectionURLEdit::SetText(const OUString& _rStr, const Selection& /*_rNew sal_Bool bIsEmpty = _rStr.isEmpty(); // calc the prefix - String sPrefix; + OUString sPrefix; if (!bIsEmpty) { // determine the type of the new URL described by the new text @@ -109,7 +109,7 @@ void OConnectionURLEdit::SetText(const OUString& _rStr, const Selection& /*_rNew // do the real SetTex // Edit::SetText(bIsEmpty ? _rStr : m_pTypeCollection->cutPrefix(_rStr), _rNewSelection); - String sNewText( _rStr ); + OUString sNewText( _rStr ); if ( !bIsEmpty ) sNewText = m_pTypeCollection->cutPrefix( _rStr ); Edit::SetText( sNewText ); diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index f6a456276498..68b4dcba75c0 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -101,7 +101,7 @@ DBTreeListBox::~DBTreeListBox() implStopSelectionTimer(); } -SvTreeListEntry* DBTreeListBox::GetEntryPosByName( const String& aName, SvTreeListEntry* pStart, const IEntryFilter* _pFilter ) const +SvTreeListEntry* DBTreeListBox::GetEntryPosByName( const OUString& aName, SvTreeListEntry* pStart, const IEntryFilter* _pFilter ) const { SvTreeList* myModel = GetModel(); std::pair<SvTreeListEntries::iterator,SvTreeListEntries::iterator> aIters = @@ -480,7 +480,7 @@ namespace continue; sal_uInt16 nId = _rMenu.GetItemId(pos); - String aCommand = _rMenu.GetItemCommand( nId ); + OUString aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); if ( pPopup ) { @@ -516,7 +516,7 @@ namespace continue; sal_uInt16 nId = _rMenu.GetItemId(pos); - String aCommand = _rMenu.GetItemCommand( nId ); + OUString aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); if ( pPopup ) { diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 061a66e511d7..31033df32e87 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -59,7 +59,7 @@ namespace dbaui using ::com::sun::star::frame::UICommandDescription; using ::com::sun::star::graphic::XGraphic; - String GetCommandText( const sal_Char* _pCommandURL, const OUString& _rModuleName ) + OUString GetCommandText( const sal_Char* _pCommandURL, const OUString& _rModuleName ) { OUString sLabel; if ( !_pCommandURL || !*_pCommandURL ) @@ -215,7 +215,7 @@ namespace dbaui ::comphelper::SequenceAsHashMap aItemProperties( aHistory[ nItem ] ); OUString sURL = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_URL, OUString() ); OUString sFilter = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_FILTER, OUString() ); - String sTitle = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_TITLE, OUString() ); + OUString sTitle = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_TITLE, OUString() ); OUString sPassword = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_PASSWORD, OUString() ); // If the entry is an impress file then insert it into the @@ -235,10 +235,10 @@ namespace dbaui if ( !sPassword.isEmpty() ) aURL.SetPass( sPassword ); - if ( !sTitle.Len() ) + if ( sTitle.isEmpty() ) sTitle = aURL.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_UNAMBIGUOUS ); - String sDecodedURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); + OUString sDecodedURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); sal_uInt16 nPos = InsertEntry( sTitle ); m_aURLs.insert( MapIndexToStringPair::value_type( nPos, StringPair( sDecodedURL, sFilter ) ) ); @@ -251,18 +251,18 @@ namespace dbaui } } - String OpenDocumentListBox::GetSelectedDocumentURL() const + OUString OpenDocumentListBox::GetSelectedDocumentURL() const { - String sURL; + OUString sURL; sal_uInt16 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sURL = impl_getDocumentAtIndex( nSelected ).first; return sURL; } - String OpenDocumentListBox::GetSelectedDocumentFilter() const + OUString OpenDocumentListBox::GetSelectedDocumentFilter() const { - String sFilter; + OUString sFilter; sal_uInt16 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sFilter = impl_getDocumentAtIndex( nSelected ).second; @@ -278,7 +278,7 @@ namespace dbaui if ( pos != m_aURLs.end() ) { aDocumentDescriptor = pos->second; - if ( _bSystemNotation && aDocumentDescriptor.first.Len() ) + if ( _bSystemNotation && !aDocumentDescriptor.first.isEmpty() ) { ::svt::OFileNotation aNotation( aDocumentDescriptor.first ); aDocumentDescriptor.first = aNotation.get( ::svt::OFileNotation::N_SYSTEM ); @@ -302,7 +302,7 @@ namespace dbaui aItemRect = Rectangle( OutputToScreenPixel( aItemRect.TopLeft() ), OutputToScreenPixel( aItemRect.BottomRight() ) ); - String sHelpText = impl_getDocumentAtIndex( nItemIndex, true ).first; + OUString sHelpText = impl_getDocumentAtIndex( nItemIndex, true ).first; Help::ShowQuickHelp( this, aItemRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER ); } } diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 11446c9008c0..1ba8651180b8 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -157,7 +157,7 @@ void OSqlEdit::GetFocus() IMPL_LINK_NOARG(OSqlEdit, OnUndoActionTimer) { - String aText =GetText(); + OUString aText = GetText(); if(aText != m_strOrigText) { OJoinController& rController = m_pView->getContainerWindow()->getDesignView()->getController(); diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index adc36440ce52..e8a4bb0c097f 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -126,7 +126,7 @@ void OTableTreeListBox::notifyHiContrastChanged() } else { - String sCompleteName( getQualifiedTableName( pEntryLoop ) ); + OUString sCompleteName( getQualifiedTableName( pEntryLoop ) ); m_pImageProvider->getImages( sCompleteName, DatabaseObject::TABLE, aImage ); } @@ -149,11 +149,11 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn { Sequence< OUString > sTables, sViews; - String sCurrentActionError; + OUString sCurrentActionError; try { Reference< XTablesSupplier > xTableSupp( _rxConnection, UNO_QUERY_THROW ); - sCurrentActionError = String(ModuleRes(STR_NOTABLEINFO)); + sCurrentActionError = ModuleRes(STR_NOTABLEINFO); Reference< XNameAccess > xTables,xViews; @@ -262,18 +262,18 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn { if (haveVirtualRoot()) { - String sRootEntryText; + OUString sRootEntryText; TNames::const_iterator aViews = ::std::find_if(_rTables.begin(),_rTables.end(), ::o3tl::compose1(::std::bind2nd(::std::equal_to<sal_Bool>(),sal_False),::o3tl::select2nd<TNames::value_type>())); TNames::const_iterator aTables = ::std::find_if(_rTables.begin(),_rTables.end(), ::o3tl::compose1(::std::bind2nd(::std::equal_to<sal_Bool>(),sal_True),::o3tl::select2nd<TNames::value_type>())); if ( aViews == _rTables.end() ) - sRootEntryText = String(ModuleRes(STR_ALL_TABLES)); + sRootEntryText = ModuleRes(STR_ALL_TABLES); else if ( aTables == _rTables.end() ) - sRootEntryText = String(ModuleRes(STR_ALL_VIEWS)); + sRootEntryText = ModuleRes(STR_ALL_VIEWS); else - sRootEntryText = String(ModuleRes(STR_ALL_TABLES_AND_VIEWS)); + sRootEntryText = ModuleRes(STR_ALL_TABLES_AND_VIEWS); InsertEntry( sRootEntryText, NULL, sal_False, LIST_APPEND, reinterpret_cast< void* >( DatabaseObjectContainer::TABLES ) ); } @@ -546,7 +546,7 @@ bool OTableTreeListBox::impl_getAndAssertMetaData( Reference< XDatabaseMetaData return _out_rMetaData.is(); } -String OTableTreeListBox::getQualifiedTableName( SvTreeListEntry* _pEntry ) const +OUString OTableTreeListBox::getQualifiedTableName( SvTreeListEntry* _pEntry ) const { OSL_PRECOND( !isFolderEntry( _pEntry ), "OTableTreeListBox::getQualifiedTableName: folder entries not allowed here!" ); @@ -554,7 +554,7 @@ String OTableTreeListBox::getQualifiedTableName( SvTreeListEntry* _pEntry ) cons { Reference< XDatabaseMetaData > xMeta; if ( !impl_getAndAssertMetaData( xMeta ) ) - return String(); + return OUString(); OUString sCatalog; OUString sSchema; @@ -588,7 +588,7 @@ String OTableTreeListBox::getQualifiedTableName( SvTreeListEntry* _pEntry ) cons { DBG_UNHANDLED_EXCEPTION(); } - return String(); + return OUString(); } SvTreeListEntry* OTableTreeListBox::getEntryByQualifiedName( const OUString& _rName ) diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index eac3039585b6..85cdfc7a4162 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -137,7 +137,7 @@ namespace dbaui for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { sal_uInt16 nItemId = pToolBox->GetItemId(nPos); - if ( pToolBox->GetItemCommand(nItemId) == String(m_aCommandURL) ) + if ( pToolBox->GetItemCommand(nItemId) == m_aCommandURL ) { m_nToolBoxId = nItemId; break; diff --git a/dbaccess/source/ui/control/undosqledit.cxx b/dbaccess/source/ui/control/undosqledit.cxx index ddcf28de4bbc..f842a5700085 100644 --- a/dbaccess/source/ui/control/undosqledit.cxx +++ b/dbaccess/source/ui/control/undosqledit.cxx @@ -24,7 +24,7 @@ namespace dbaui { void OSqlEditUndoAct::ToggleText() { - String strNext = m_pOwner->GetText(); + OUString strNext = m_pOwner->GetText(); m_pOwner->SetText(m_strNextText); m_strNextText =strNext; } diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index e40c32a74a0e..6589dc1aa48a 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -81,7 +81,7 @@ OCollectionView::OCollectionView( Window * pParent FreeResource(); OSL_ENSURE(m_xContent.is(),"No valid content!"); - m_aView.Initialize(m_xContent,String()); + m_aView.Initialize(m_xContent,OUString()); m_aFTCurrentPath.SetStyle( m_aFTCurrentPath.GetStyle() | WB_PATHELLIPSIS ); initCurrentPath(); @@ -133,7 +133,7 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click) xChild.set(m_xContent,UNO_QUERY); } } - m_aView.Initialize(m_xContent,String()); + m_aView.Initialize(m_xContent,OUString()); initCurrentPath(); } sSubFolder = sName.copy(0,nIndex-1); @@ -202,8 +202,8 @@ IMPL_LINK_NOARG(OCollectionView, NewFolder_Click) try { Reference<XHierarchicalNameContainer> xNameContainer(m_xContent,UNO_QUERY); - if ( dbaui::insertHierachyElement(this,m_xContext,xNameContainer,String(),m_bCreateForm) ) - m_aView.Initialize(m_xContent,String()); + if ( dbaui::insertHierachyElement(this,m_xContext,xNameContainer,OUString(),m_bCreateForm) ) + m_aView.Initialize(m_xContent,OUString()); } catch( const SQLException& ) { @@ -227,7 +227,7 @@ IMPL_LINK_NOARG(OCollectionView, Up_Click) if ( xNameAccess.is() ) { m_xContent.set(xNameAccess,UNO_QUERY); - m_aView.Initialize(m_xContent,String()); + m_aView.Initialize(m_xContent,OUString()); initCurrentPath(); } else @@ -259,7 +259,7 @@ IMPL_LINK_NOARG(OCollectionView, Dbl_Click_FileView) if ( xContent.is() ) { m_xContent = xContent; - m_aView.Initialize(m_xContent,String()); + m_aView.Initialize(m_xContent,OUString()); initCurrentPath(); } } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 3eb5c900bfe9..c50f8b42eb7a 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -131,7 +131,7 @@ DBG_NAME(OConnectionHelper) // forward the values to the controls if ( bValid ) { - String sUrl = pUrlItem->GetValue(); + OUString sUrl = pUrlItem->GetValue(); setURL( sUrl ); checkTestConnection(); @@ -148,7 +148,7 @@ DBG_NAME(OConnectionHelper) return; if ( m_pCollection->isFileSystemBased(m_eType) ) - m_pAdminDialog->enableConfirmSettings( getURLNoPrefix().Len() > 0 ); + m_pAdminDialog->enableConfirmSettings( !getURLNoPrefix().isEmpty() ); } IMPL_LINK(OConnectionHelper, OnBrowseConnections, PushButton*, /*_pButton*/) @@ -165,10 +165,10 @@ DBG_NAME(OConnectionHelper) Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(m_xORB); sal_Bool bDoBrowse = sal_False; - String sOldPath = getURLNoPrefix(); + OUString sOldPath = getURLNoPrefix(); do { - if (sOldPath.Len()) + if (!sOldPath.isEmpty()) xFolderPicker->setDisplayDirectory(sOldPath); if (0 == xFolderPicker->execute()) // cancelled by the user @@ -188,7 +188,7 @@ DBG_NAME(OConnectionHelper) } while (bDoBrowse); - String sSelectedDirectory = xFolderPicker->getDirectory(); + OUString sSelectedDirectory = xFolderPicker->getDirectory(); INetURLObject aSelectedDirectory( sSelectedDirectory, INetURLObject::WAS_ENCODED, RTL_TEXTENCODING_UTF8 ); // for UI purpose, we don't want to have the path encoded @@ -218,7 +218,7 @@ DBG_NAME(OConnectionHelper) case ::dbaccess::DST_MSACCESS: { const OUString sExt("*.mdb"); - String sFilterName(ModuleRes (STR_MSACCESS_FILTERNAME)); + OUString sFilterName(ModuleRes (STR_MSACCESS_FILTERNAME)); ::sfx2::FileDialogHelper aFileDlg( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0); @@ -230,7 +230,7 @@ DBG_NAME(OConnectionHelper) case ::dbaccess::DST_MSACCESS_2007: { const OUString sAccdb("*.accdb"); - String sFilterName2(ModuleRes (STR_MSACCESS_2007_FILTERNAME)); + OUString sFilterName2(ModuleRes (STR_MSACCESS_2007_FILTERNAME)); ::sfx2::FileDialogHelper aFileDlg( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0); @@ -322,17 +322,17 @@ DBG_NAME(OConnectionHelper) return true; } - void OConnectionHelper::impl_setURL( const String& _rURL, sal_Bool _bPrefix ) + void OConnectionHelper::impl_setURL( const OUString& _rURL, sal_Bool _bPrefix ) { - String sURL( comphelper::string::stripEnd(_rURL, '*') ); + OUString sURL( comphelper::string::stripEnd(_rURL, '*') ); OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" ); - if ( m_pCollection && sURL.Len() ) + if ( m_pCollection && !sURL.isEmpty() ) { if ( m_pCollection->isFileSystemBased( m_eType ) ) { // get the two parts: prefix and file URL - String sTypePrefix, sFileURLEncoded; + OUString sTypePrefix, sFileURLEncoded; if ( _bPrefix ) { sTypePrefix = m_pCollection->getPrefix( m_eType ); @@ -348,11 +348,11 @@ DBG_NAME(OConnectionHelper) // decode the URL sURL = sTypePrefix; - if ( sFileURLEncoded.Len() ) + if ( !sFileURLEncoded.isEmpty() ) { OFileNotation aFileNotation(sFileURLEncoded); // set this decoded URL as text - sURL += String(aFileNotation.get(OFileNotation::N_SYSTEM)); + sURL += aFileNotation.get(OFileNotation::N_SYSTEM); } } } @@ -365,7 +365,7 @@ DBG_NAME(OConnectionHelper) implUpdateURLDependentStates(); } - String OConnectionHelper::impl_getURL( sal_Bool _bPrefix ) const + OUString OConnectionHelper::impl_getURL( sal_Bool _bPrefix ) const { // get the pure text OUString sURL = _bPrefix ? m_aConnectionURL.GetText() : OUString(m_aConnectionURL.GetTextNoPrefix()); @@ -392,7 +392,7 @@ DBG_NAME(OConnectionHelper) if ( !sFileURLDecoded.isEmpty() ) { OFileNotation aFileNotation( sFileURLDecoded, OFileNotation::N_SYSTEM ); - sURL += String( aFileNotation.get( OFileNotation::N_URL ) ); + sURL += aFileNotation.get( OFileNotation::N_URL ); } // encode the URL @@ -403,29 +403,29 @@ DBG_NAME(OConnectionHelper) return sURL; } - void OConnectionHelper::setURL( const String& _rURL ) + void OConnectionHelper::setURL( const OUString& _rURL ) { impl_setURL( _rURL, sal_True ); } - String OConnectionHelper::getURLNoPrefix( ) const + OUString OConnectionHelper::getURLNoPrefix( ) const { return impl_getURL( sal_False ); } - void OConnectionHelper::setURLNoPrefix( const String& _rURL ) + void OConnectionHelper::setURLNoPrefix( const OUString& _rURL ) { impl_setURL( _rURL, sal_False ); } - sal_Int32 OConnectionHelper::checkPathExistence(const String& _rURL) + sal_Int32 OConnectionHelper::checkPathExistence(const OUString& _rURL) { IS_PATH_EXIST e_exists = pathExists(_rURL, sal_False); if (( e_exists == PATH_NOT_EXIST) || ( e_exists == PATH_NOT_KNOWN)) { - String sQuery(ModuleRes(STR_ASK_FOR_DIRECTORY_CREATION)); + OUString sQuery(ModuleRes(STR_ASK_FOR_DIRECTORY_CREATION)); OFileNotation aTransformer(_rURL); - sQuery.SearchAndReplaceAscii("$path$", aTransformer.get(OFileNotation::N_SYSTEM)); + sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = sal_False; QueryBox aQuery(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery); @@ -441,8 +441,8 @@ DBG_NAME(OConnectionHelper) { if ( !createDirectoryDeep(_rURL) ) { // could not create the directory - sQuery = String(ModuleRes(STR_COULD_NOT_CREATE_DIRECTORY)); - sQuery.SearchAndReplaceAscii("$name$", aTransformer.get(OFileNotation::N_SYSTEM)); + sQuery = ModuleRes(STR_COULD_NOT_CREATE_DIRECTORY); + sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = sal_False; QueryBox aWhatToDo(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery); @@ -533,7 +533,7 @@ DBG_NAME(OConnectionHelper) return OGenericAdministrationPage::PreNotify( _rNEvt ); } - sal_Bool OConnectionHelper::createDirectoryDeep(const String& _rPathURL) + sal_Bool OConnectionHelper::createDirectoryDeep(const OUString& _rPathURL) { // get an URL object analyzing the URL for us ... INetURLObject aParser; @@ -614,14 +614,14 @@ DBG_NAME(OConnectionHelper) sal_Bool OConnectionHelper::commitURL() { - String sURL; - String sOldPath; + OUString sURL; + OUString sOldPath; sOldPath = m_aConnectionURL.GetSavedValueNoPrefix(); sURL = m_aConnectionURL.GetTextNoPrefix(); if ( m_pCollection->isFileSystemBased(m_eType) ) { - if ( ( sURL != sOldPath ) && ( 0 != sURL.Len() ) ) + if ( ( sURL != sOldPath ) && !sURL.isEmpty() ) { // the text changed since entering the control // the path may be in system notation .... @@ -634,8 +634,8 @@ DBG_NAME(OConnectionHelper) { if( pathExists(sURL, sal_True) == PATH_NOT_EXIST ) { - String sFile = String( ModuleRes( STR_FILE_DOES_NOT_EXIST ) ); - sFile.SearchAndReplaceAscii("$file$", aTransformer.get(OFileNotation::N_SYSTEM)); + OUString sFile = ModuleRes( STR_FILE_DOES_NOT_EXIST ); + sFile = sFile.replaceFirst("$file$", aTransformer.get(OFileNotation::N_SYSTEM)); OSQLWarningBox( this, sFile ).Execute(); setURLNoPrefix(sOldPath); SetRoadmapStateValue(sal_False); @@ -667,8 +667,8 @@ DBG_NAME(OConnectionHelper) } void OConnectionHelper::askForFileName(::sfx2::FileDialogHelper& _aFileOpen) { - String sOldPath = getURLNoPrefix(); - if ( sOldPath.Len() ) + OUString sOldPath = getURLNoPrefix(); + if ( !sOldPath.isEmpty() ) _aFileOpen.SetDisplayDirectory(sOldPath); else _aFileOpen.SetDisplayDirectory( SvtPathOptions().GetWorkPath() ); diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 1e8db0c69528..eec5eddec541 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -63,19 +63,19 @@ namespace dbaui // setting/retrieving the current connection URL // necessary because for some types, the URL must be decoded for display purposes //String getURL( OConnectionURLEdit* _m_pConnection ) const; - //void setURL( const String& _rURL, OConnectionURLEdit* _m_pConnection ); + //void setURL( const OUString& _rURL, OConnectionURLEdit* _m_pConnection ); - String getURLNoPrefix( ) const; - void setURLNoPrefix( const String& _rURL ); + OUString getURLNoPrefix( ) const; + void setURLNoPrefix( const OUString& _rURL ); /** checks if the path is existence @param _rURL The URL to check. */ - sal_Int32 checkPathExistence(const String& _rURL); + sal_Int32 checkPathExistence(const OUString& _rURL); IS_PATH_EXIST pathExists(const OUString& _rURL, sal_Bool bIsFile) const; - sal_Bool createDirectoryDeep(const String& _rPathNormalized); + sal_Bool createDirectoryDeep(const OUString& _rPathNormalized); sal_Bool commitURL(); /** opens the FileOpen dialog and asks for a FileName @@ -85,13 +85,13 @@ namespace dbaui void askForFileName(::sfx2::FileDialogHelper& _aFileOpen); protected: - void setURL( const String& _rURL ); + void setURL( const OUString& _rURL ); virtual bool checkTestConnection(); private: DECL_LINK(OnBrowseConnections, PushButton*); - String impl_getURL( sal_Bool _bPrefix ) const; - void impl_setURL( const String& _rURL, sal_Bool _bPrefix ); + OUString impl_getURL( sal_Bool _bPrefix ) const; + void impl_setURL( const OUString& _rURL, sal_Bool _bPrefix ); void implUpdateURLDependentStates() const; }; diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 2026b51c742e..ed8311aac8eb 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -330,7 +330,7 @@ namespace dbaui bool OConnectionTabPage::checkTestConnection() { OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); - sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); + sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || !m_aConnectionURL.GetTextNoPrefix().isEmpty(); if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC ) bEnableTestConnection = bEnableTestConnection && (!m_aJavaDriver.GetText().isEmpty()); m_aTestConnection.Enable(bEnableTestConnection); diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index d514634ac6b5..f3330fadfeb5 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -112,7 +112,7 @@ namespace dbaui if ( USHRT_MAX != _nHelpTextResId ) { - String sHelpText = String(ModuleRes(_nHelpTextResId)); + OUString sHelpText = ModuleRes(_nHelpTextResId); m_aFT_HelpText.SetText(sHelpText); } else @@ -123,7 +123,7 @@ namespace dbaui if ( USHRT_MAX != _nUrlResId ) { - String sLabelText = String(ModuleRes(_nUrlResId)); + OUString sLabelText = ModuleRes(_nUrlResId); m_aFT_Connection.SetText(sLabelText); if ( USHRT_MAX == _nHelpTextResId ) { @@ -167,7 +167,7 @@ namespace dbaui //! TODO //if ( m_eType >= ::dbaccess::DST_USERDEFINE1 ) //{ - // String sDisplayName = m_pCollection->getTypeDisplayName(m_eType); + // OUString sDisplayName = m_pCollection->getTypeDisplayName(m_eType); // FixedText* ppTextControls[] ={&m_aFT_Connection}; // for (size_t i = 0; i < sizeof(ppTextControls)/sizeof(ppTextControls[0]); ++i) // { @@ -190,7 +190,7 @@ namespace dbaui } bool OConnectionTabPageSetup::checkTestConnection() { - return !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); + return !m_aConnectionURL.IsVisible() || !m_aConnectionURL.GetTextNoPrefix().isEmpty(); } IMPL_LINK(OConnectionTabPageSetup, OnEditModified, Edit*, /*_pEdit*/) diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx index daf2598e3185..108fdd6c30ec 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -63,8 +63,8 @@ namespace dbaui <p>The new URL must be of the type which is currently selected, only the parts which do not affect the type may be changed (compared to the previous URL).</p> */ - void changeConnectionURL( const String& _rNewDSN ); - String getConnectionURL( ) const; + void changeConnectionURL( const OUString& _rNewDSN ); + OUString getConnectionURL( ) const; protected: OConnectionTabPageSetup(Window* pParent, sal_uInt16 _rId, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index e822953961cb..b4cac8fdf273 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -88,7 +88,7 @@ DBG_NAME(OTextConnectionPageSetup) IMPL_LINK(OTextConnectionPageSetup, ImplGetExtensionHdl, OTextConnectionHelper*, /*_pTextConnectionHelper*/) { - SetRoadmapStateValue((m_pTextConnectionHelper->GetExtension().Len() > 0) && OConnectionTabPageSetup::checkTestConnection()); + SetRoadmapStateValue(!m_pTextConnectionHelper->GetExtension().isEmpty() && OConnectionTabPageSetup::checkTestConnection()); callModifiedHdl(); return sal_True; } @@ -96,7 +96,7 @@ DBG_NAME(OTextConnectionPageSetup) bool OTextConnectionPageSetup::checkTestConnection() { bool bDoEnable = OConnectionTabPageSetup::checkTestConnection(); - bDoEnable = (m_pTextConnectionHelper->GetExtension().Len() > 0) && bDoEnable; + bDoEnable = !m_pTextConnectionHelper->GetExtension().isEmpty() && bDoEnable; return bDoEnable; } @@ -599,7 +599,7 @@ DBG_NAME(OMySQLIntroPageSetup) bool OJDBCConnectionPageSetup::checkTestConnection() { OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); - sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); + sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || !m_aConnectionURL.GetTextNoPrefix().isEmpty(); bEnableTestConnection = bEnableTestConnection && (!m_aETDriverClass.GetText().isEmpty()); return bEnableTestConnection; } diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 3c3667cbc900..c04882de7604 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -385,8 +385,8 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const OUString // get the global DriverManager Reference< XConnectionPool > xDriverManager; - String sCurrentActionError = String(ModuleRes(STR_COULDNOTCREATE_DRIVERMANAGER)); - sCurrentActionError.SearchAndReplaceAscii("#servicename#", OUString("com.sun.star.sdbc.ConnectionPool")); + OUString sCurrentActionError = ModuleRes(STR_COULDNOTCREATE_DRIVERMANAGER); + sCurrentActionError = sCurrentActionError.replaceFirst("#servicename#", "com.sun.star.sdbc.ConnectionPool"); try { @@ -402,8 +402,8 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const OUString Reference< XDriver > xDriver = xDriverManager->getDriverByURL(_sURL); if (!xDriver.is()) { - sCurrentActionError = String(ModuleRes(STR_NOREGISTEREDDRIVER)); - sCurrentActionError.SearchAndReplaceAscii("#connurl#", _sURL); + sCurrentActionError = ModuleRes(STR_NOREGISTEREDDRIVER); + sCurrentActionError = sCurrentActionError.replaceFirst("#connurl#", _sURL); // will be caught and translated into an SQLContext exception throw SQLException(sCurrentActionError, getORB(), OUString("S1000"), 0, Any()); } @@ -459,7 +459,7 @@ sal_Bool ODbDataSourceAdministrationHelper::hasAuthentication(const SfxItemSet& return DataSourceMetaData::getAuthentication( getDatasourceType( _rSet ) ) != AuthNone; } -String ODbDataSourceAdministrationHelper::getConnectionURL() const +OUString ODbDataSourceAdministrationHelper::getConnectionURL() const { OUString sNewUrl; @@ -1018,7 +1018,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet } } -String ODbDataSourceAdministrationHelper::getDocumentUrl(SfxItemSet& _rDest) +OUString ODbDataSourceAdministrationHelper::getDocumentUrl(SfxItemSet& _rDest) { SFX_ITEMSET_GET(_rDest, pUrlItem, SfxStringItem, DSID_DOCUMENT_URL, sal_True); OSL_ENSURE(pUrlItem,"Document URL is NULL. -> GPF!"); diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx index 391c0cc71e9e..ca8325b009c4 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx @@ -102,7 +102,7 @@ namespace dbaui */ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getCurrentDataSource(); // returns the Url of a database document - String getDocumentUrl(SfxItemSet& _rDest); + OUString getDocumentUrl(SfxItemSet& _rDest); void setDataSourceOrName( const ::com::sun::star::uno::Any& _rDataSourceOrName ); @@ -115,7 +115,7 @@ namespace dbaui @return The connection URL */ - String getConnectionURL() const; + OUString getConnectionURL() const; /// fill the necessary information from the url line void convertUrl(SfxItemSet& _rDest); diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index 3332d9600a0c..f470a5473aa1 100644 --- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx +++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx @@ -96,7 +96,7 @@ void OTableSubscriptionDialog::clearPassword() m_pImpl->clearPassword(); } -String OTableSubscriptionDialog::getConnectionURL() const +OUString OTableSubscriptionDialog::getConnectionURL() const { return m_pImpl->getConnectionURL(); } diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index 8010d06f3852..0ac82b4bbe65 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -90,11 +90,11 @@ DBG_NAME(OTextConnectionHelper) xub_StrLen i; for( i = 0 ; i < nCnt ; i += 2 ) - m_aFieldSeparator.InsertEntry( m_aFieldSeparatorList.GetToken( i, '\t' ) ); + m_aFieldSeparator.InsertEntry( m_aFieldSeparatorList.getToken( i, '\t' ) ); nCnt = comphelper::string::getTokenCount(m_aTextSeparatorList, '\t'); for( i=0 ; i<nCnt ; i+=2 ) - m_aTextSeparator.InsertEntry( m_aTextSeparatorList.GetToken( i, '\t' ) ); + m_aTextSeparator.InsertEntry( m_aTextSeparatorList.getToken( i, '\t' ) ); m_aTextSeparator.InsertEntry(m_aTextNone); // set the modify handlers @@ -143,7 +143,7 @@ DBG_NAME(OTextConnectionHelper) { Window* pRealWindow = pControl->GetWindow( WINDOW_CLIENT ); #if OSL_DEBUG_LEVEL > 0 - String sWindowText( pRealWindow->GetText() ); + OUString sWindowText( pRealWindow->GetText() ); (void)sWindowText; #endif pRealWindow->Hide(); @@ -294,68 +294,68 @@ DBG_NAME(OTextConnectionHelper) { LocalResourceAccess aStringResAccess(PAGE_TEXT, RSC_TABPAGE); // for accessing the strings which are local to our own resource block - String sExtension = GetExtension(); - String aErrorText; + OUString sExtension = GetExtension(); + OUString aErrorText; Control* pErrorWin = NULL; - String aDelText(m_aFieldSeparator.GetText()); - if(!aDelText.Len()) + OUString aDelText(m_aFieldSeparator.GetText()); + if(aDelText.isEmpty()) { // No FieldSeparator - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MISSING)); - aErrorText.SearchAndReplaceAscii("#1",m_aFieldSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MISSING); + aErrorText = aErrorText.replaceFirst("#1",m_aFieldSeparatorLabel.GetText()); pErrorWin = &m_aFieldSeparator; } else if (m_aDecimalSeparator.GetText().isEmpty()) { // No DecimalSeparator - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MISSING)); - aErrorText.SearchAndReplaceAscii("#1",m_aDecimalSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MISSING); + aErrorText = aErrorText.replaceFirst("#1",m_aDecimalSeparatorLabel.GetText()); pErrorWin = &m_aDecimalSeparator; } else if (m_aTextSeparator.GetText() == m_aFieldSeparator.GetText()) { // Field and TextSeparator must not be the same - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MUST_DIFFER)); - aErrorText.SearchAndReplaceAscii("#1",m_aTextSeparatorLabel.GetText()); - aErrorText.SearchAndReplaceAscii("#2",m_aFieldSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MUST_DIFFER); + aErrorText = aErrorText.replaceFirst("#1",m_aTextSeparatorLabel.GetText()); + aErrorText = aErrorText.replaceFirst("#2",m_aFieldSeparatorLabel.GetText()); pErrorWin = &m_aTextSeparator; } else if (m_aDecimalSeparator.GetText() == m_aThousandsSeparator.GetText()) { // Thousands and DecimalSeparator must not be the same - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MUST_DIFFER)); - aErrorText.SearchAndReplaceAscii("#1",m_aDecimalSeparatorLabel.GetText()); - aErrorText.SearchAndReplaceAscii("#2",m_aThousandsSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MUST_DIFFER); + aErrorText = aErrorText.replaceFirst("#1",m_aDecimalSeparatorLabel.GetText()); + aErrorText = aErrorText.replaceFirst("#2",m_aThousandsSeparatorLabel.GetText()); pErrorWin = &m_aDecimalSeparator; } else if (m_aFieldSeparator.GetText() == m_aThousandsSeparator.GetText()) { // Thousands and FieldSeparator must not be the same - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MUST_DIFFER)); - aErrorText.SearchAndReplaceAscii("#1",m_aFieldSeparatorLabel.GetText()); - aErrorText.SearchAndReplaceAscii("#2",m_aThousandsSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MUST_DIFFER); + aErrorText = aErrorText.replaceFirst("#1",m_aFieldSeparatorLabel.GetText()); + aErrorText = aErrorText.replaceFirst("#2",m_aThousandsSeparatorLabel.GetText()); pErrorWin = &m_aFieldSeparator; } else if (m_aFieldSeparator.GetText() == m_aDecimalSeparator.GetText()) { // Tenner and FieldSeparator must not be the same - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MUST_DIFFER)); - aErrorText.SearchAndReplaceAscii("#1",m_aFieldSeparatorLabel.GetText()); - aErrorText.SearchAndReplaceAscii("#2",m_aDecimalSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MUST_DIFFER); + aErrorText = aErrorText.replaceFirst("#1",m_aFieldSeparatorLabel.GetText()); + aErrorText = aErrorText.replaceFirst("#2",m_aDecimalSeparatorLabel.GetText()); pErrorWin = &m_aFieldSeparator; } else if (m_aTextSeparator.GetText() == m_aThousandsSeparator.GetText()) { // Thousands and TextSeparator must not be the same - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MUST_DIFFER)); - aErrorText.SearchAndReplaceAscii("#1",m_aTextSeparatorLabel.GetText()); - aErrorText.SearchAndReplaceAscii("#2",m_aThousandsSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MUST_DIFFER); + aErrorText = aErrorText.replaceFirst("#1",m_aTextSeparatorLabel.GetText()); + aErrorText = aErrorText.replaceFirst("#2",m_aThousandsSeparatorLabel.GetText()); pErrorWin = &m_aTextSeparator; } else if (m_aTextSeparator.GetText() == m_aDecimalSeparator.GetText()) { // Tenner and TextSeparator must not be the same - aErrorText = String(ModuleRes(STR_AUTODELIMITER_MUST_DIFFER)); - aErrorText.SearchAndReplaceAscii("#1",m_aTextSeparatorLabel.GetText()); - aErrorText.SearchAndReplaceAscii("#2",m_aDecimalSeparatorLabel.GetText()); + aErrorText = ModuleRes(STR_AUTODELIMITER_MUST_DIFFER); + aErrorText = aErrorText.replaceFirst("#1",m_aTextSeparatorLabel.GetText()); + aErrorText = aErrorText.replaceFirst("#2",m_aDecimalSeparatorLabel.GetText()); pErrorWin = &m_aTextSeparator; } - else if ((sExtension.Search('*') != STRING_NOTFOUND) || (sExtension.Search('?') != STRING_NOTFOUND)) + else if ((sExtension.indexOf('*') != -1) || (sExtension.indexOf('?') != -1)) { - aErrorText = String(ModuleRes(STR_AUTONO_WILDCARDS)); - aErrorText.SearchAndReplaceAscii("#1",sExtension); + aErrorText = ModuleRes(STR_AUTONO_WILDCARDS); + aErrorText = aErrorText.replaceFirst("#1",sExtension); pErrorWin = &m_aETOwnExtension; } else @@ -371,8 +371,8 @@ DBG_NAME(OTextConnectionHelper) if ( ( m_nAvailableSections & TC_EXTENSION ) != 0 ) { - String sExtension = GetExtension(); - if( !m_aOldExtension.Equals( sExtension ) ) + OUString sExtension = GetExtension(); + if( m_aOldExtension != sExtension ) { rSet.Put( SfxStringItem( DSID_TEXTFILEEXTENSION, sExtension ) ); bChangedSomething = sal_True; @@ -422,11 +422,11 @@ DBG_NAME(OTextConnectionHelper) return bChangedSomething; } - void OTextConnectionHelper::SetExtension(const String& _rVal) + void OTextConnectionHelper::SetExtension(const OUString& _rVal) { - if (_rVal.EqualsAscii("txt")) + if (_rVal == "txt") m_aRBAccessTextFiles.Check(sal_True); - else if (_rVal.EqualsAscii( "csv" )) + else if (_rVal == "csv") m_aRBAccessCSVFiles.Check(sal_True); else { @@ -435,23 +435,23 @@ DBG_NAME(OTextConnectionHelper) } } - String OTextConnectionHelper::GetExtension() + OUString OTextConnectionHelper::GetExtension() { - String sExtension; + OUString sExtension; if (m_aRBAccessTextFiles.IsChecked()) - sExtension = OUString("txt"); + sExtension = "txt"; else if (m_aRBAccessCSVFiles.IsChecked()) - sExtension = OUString("csv"); + sExtension = "csv"; else { sExtension = m_aETOwnExtension.GetText(); - if ( comphelper::string::equals(sExtension.GetToken(0,'.'), '*') ) - sExtension.Erase(0,2); + if ( comphelper::string::equals(sExtension.getToken(0,'.'), '*') ) + sExtension = sExtension.copy(2); } return sExtension; } - String OTextConnectionHelper::GetSeparator( const ComboBox& rBox, const String& rList ) + OUString OTextConnectionHelper::GetSeparator( const ComboBox& rBox, const OUString& rList ) { sal_Unicode nTok = '\t'; xub_StrLen nPos(rBox.GetEntryPos( rBox.GetText() )); @@ -461,13 +461,12 @@ DBG_NAME(OTextConnectionHelper) if ( !( &m_aTextSeparator == &rBox && nPos == (rBox.GetEntryCount()-1) ) ) return OUString( - static_cast< sal_Unicode >( - rList.GetToken(((nPos*2)+1), nTok ).ToInt32())); + static_cast< sal_Unicode >( rList.getToken((nPos*2)+1, nTok ).toInt32() )); // somewhat strange ... translates for instance an "32" into " " return OUString(); } - void OTextConnectionHelper::SetSeparator( ComboBox& rBox, const String& rList, const String& rVal ) + void OTextConnectionHelper::SetSeparator( ComboBox& rBox, const OUString& rList, const OUString& rVal ) { char nTok = '\t'; xub_StrLen nCnt(comphelper::string::getTokenCount(rList, nTok)); @@ -476,22 +475,21 @@ DBG_NAME(OTextConnectionHelper) for( i=0 ; i<nCnt ; i+=2 ) { OUString sTVal( - static_cast< sal_Unicode >( - rList.GetToken( (i+1), nTok ).ToInt32())); + static_cast< sal_Unicode >( rList.getToken( (i+1), nTok ).toInt32() )); if( sTVal.equals(rVal) ) { - rBox.SetText( rList.GetToken( i, nTok ) ); + rBox.SetText( rList.getToken( i, nTok ) ); break; } } if ( i >= nCnt ) { - if ( &m_aTextSeparator == &rBox && !rVal.Len() ) + if ( &m_aTextSeparator == &rBox && rVal.isEmpty() ) rBox.SetText(m_aTextNone); else - rBox.SetText( rVal.Copy(0, 1) ); + rBox.SetText( rVal.copy(0, 1) ); } } } diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index c5342066ac94..ff280023ce4a 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -70,10 +70,10 @@ namespace dbaui FixedLine m_aCharSetHeader; FixedText m_aCharSetLabel; CharSetListBox m_aCharSet; - String m_aFieldSeparatorList; - String m_aTextSeparatorList; - String m_aTextNone; - String m_aOldExtension; + OUString m_aFieldSeparatorList; + OUString m_aTextSeparatorList; + OUString m_aTextNone; + OUString m_aOldExtension; Link m_aGetExtensionHandler; /// to be called if a new type is selected short m_nAvailableSections; @@ -86,16 +86,16 @@ namespace dbaui DECL_LINK(OnEditModified,Edit*); private: - String GetSeparator( const ComboBox& rBox, const String& rList ); - void SetSeparator( ComboBox& rBox, const String& rList, const String& rVal ); - void SetExtension(const String& _rVal); + OUString GetSeparator( const ComboBox& rBox, const OUString& rList ); + void SetSeparator( ComboBox& rBox, const OUString& rList, const OUString& rVal ); + void SetExtension(const OUString& _rVal); public: void implInitControls(const SfxItemSet& _rSet, sal_Bool _bValid); void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); void SetClickHandler(const Link& _rHandler) { m_aGetExtensionHandler = _rHandler; } - String GetExtension(); + OUString GetExtension(); sal_Bool FillItemSet( SfxItemSet& rSet, const sal_Bool bChangedSomething ); sal_Bool prepareLeave(); }; diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index a7c45a665f58..3b8ca1ffc780 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -67,13 +67,13 @@ class OPasswordDialog : public ModalDialog DECL_LINK( ModifiedHdl, Edit * ); public: - OPasswordDialog( Window* pParent,const String& _sUserName); + OPasswordDialog( Window* pParent,const OUString& _sUserName); - String GetOldPassword() const { return aEDOldPassword.GetText(); } - String GetNewPassword() const { return aEDPassword.GetText(); } + OUString GetOldPassword() const { return aEDOldPassword.GetText(); } + OUString GetNewPassword() const { return aEDPassword.GetText(); } }; -OPasswordDialog::OPasswordDialog(Window* _pParent,const String& _sUserName) : +OPasswordDialog::OPasswordDialog(Window* _pParent,const OUString& _sUserName) : ModalDialog( _pParent, ModuleRes( DLG_PASSWORD) ), @@ -92,8 +92,8 @@ OPasswordDialog::OPasswordDialog(Window* _pParent,const String& _sUserName) : aHelpBtn.Hide(); FreeResource(); - String sUser = aFLUser.GetText(); - sUser.SearchAndReplaceAscii("$name$: $",_sUserName); + OUString sUser = aFLUser.GetText(); + sUser = sUser.replaceFirst("$name$: $",_sUserName); aFLUser.SetText(sUser); aOKBtn.Disable(); @@ -107,11 +107,11 @@ IMPL_LINK_NOARG(OPasswordDialog, OKHdl_Impl) EndDialog( RET_OK ); else { - String aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL)); + OUString aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL)); ErrorBox aErrorBox( this, WB_OK, aErrorMsg ); aErrorBox.Execute(); - aEDPassword.SetText( String() ); - aEDPasswordRepeat.SetText( String() ); + aEDPassword.SetText( OUString() ); + aEDPasswordRepeat.SetText( OUString() ); aEDPassword.GrabFocus(); } return 0; @@ -228,7 +228,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) } else if(pButton == &m_PB_CHANGEPWD) { - String sName = GetUser(); + OUString sName = GetUser(); if(m_xUsers->hasByName(sName)) { @@ -286,7 +286,7 @@ IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ ) return 0; } -String OUserAdmin::GetUser() +OUString OUserAdmin::GetUser() { return m_LB_USER.GetSelectEntry(); } diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 1764d77895b5..ad48c761a305 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -54,7 +54,7 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUsers; ::com::sun::star::uno::Sequence< OUString> m_aUserNames; - String m_UserName; + OUString m_UserName; // methods DECL_LINK( ListDblClickHdl, ListBox * ); @@ -68,7 +68,7 @@ public: static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet ); ~OUserAdmin(); - String GetUser(); + OUString GetUser(); // must be overloaded by subclasses, but it isn't pure virtual virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 94adc9a4e17a..95a3b65b12bc 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -69,7 +69,7 @@ DBG_NAME(OUserAdminDlg) delete pExampleSet; pExampleSet = new SfxItemSet(*GetInputSetImpl()); - AddTabPage(TAB_PAGE_USERADMIN, String(ModuleRes(STR_PAGETITLE_USERADMIN)), OUserAdmin::Create,0, sal_False, 1); + AddTabPage(TAB_PAGE_USERADMIN, OUString(ModuleRes(STR_PAGETITLE_USERADMIN)), OUserAdmin::Create,0, sal_False, 1); // remove the reset button - it's meaning is much too ambiguous in this dialog RemoveResetButton(); @@ -101,7 +101,7 @@ DBG_NAME(OUserAdminDlg) ::dbtools::DatabaseMetaData aMetaData( createConnection().first ); if ( !aMetaData.supportsUserAdministration( getORB() ) ) { - String sError(ModuleRes(STR_USERADMIN_NOT_AVAILABLE)); + OUString sError(ModuleRes(STR_USERADMIN_NOT_AVAILABLE)); throw SQLException(sError,NULL,OUString("S1000") ,0,Any()); } } diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index 5b3f51313721..f9a4782b5020 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -51,7 +51,7 @@ namespace dbaui class TextResetOperator :public ::svt::IWindowOperator { public: - TextResetOperator( const String& _rDisabledText ) + TextResetOperator( const OUString& _rDisabledText ) :m_sDisabledText( _rDisabledText ) { } @@ -60,8 +60,8 @@ namespace dbaui virtual void operateOn( const VclWindowEvent& _rTrigger, Window& _rOperateOn ) const; private: - const String m_sDisabledText; - String m_sUserText; + const OUString m_sDisabledText; + OUString m_sUserText; }; void TextResetOperator::operateOn( const VclWindowEvent& _rTrigger, Window& _rOperateOn ) const @@ -99,7 +99,7 @@ namespace dbaui class TextResetOperatorController_Base { protected: - TextResetOperatorController_Base( const String& _rDisabledText ) + TextResetOperatorController_Base( const OUString& _rDisabledText ) :m_pEventFilter( new TextResetOperatorEventFilter ) ,m_pOperator( new TextResetOperator( _rDisabledText ) ) { @@ -117,7 +117,7 @@ namespace dbaui ,public ::svt::DialogController { public: - TextResetOperatorController( Window& _rObservee, const String& _rDisabledText ) + TextResetOperatorController( Window& _rObservee, const OUString& _rDisabledText ) :TextResetOperatorController_Base( _rDisabledText ) ,::svt::DialogController( _rObservee, getEventFilter(), getOperator() ) { @@ -245,8 +245,8 @@ namespace dbaui RadioButton& rSocketPipeRadio = m_aNamedPipeRadio; const SfxStringItem* pSocketPipeItem = pNamedPipe; #endif - String sSocketPipe( pSocketPipeItem->GetValue() ); - if ( sSocketPipe.Len() > 0 ) + OUString sSocketPipe( pSocketPipeItem->GetValue() ); + if ( !sSocketPipe.isEmpty() ) rSocketPipeRadio.Check(); else m_aHostPortRadio.Check(); diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index f3fafe8eba8d..d1f53f9ac873 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -139,8 +139,8 @@ namespace dbaui if (!aEnumeration.isLoaded()) { // show an error message - String sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) ); - sError.SearchAndReplaceAscii("#lib#", aEnumeration.getLibraryName()); + OUString sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) ); + sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName()); ErrorBox aDialog(this, WB_OK, sError); aDialog.Execute(); return sal_False; @@ -262,16 +262,16 @@ namespace dbaui if ( bShowMessage ) { OSQLMessageBox::MessageType eImage = OSQLMessageBox::Info; - String aMessage,sTitle; - sTitle = String (ModuleRes(STR_CONNECTION_TEST)); + OUString aMessage,sTitle; + sTitle = ModuleRes(STR_CONNECTION_TEST); if ( bSuccess ) { - aMessage = String(ModuleRes(STR_CONNECTION_SUCCESS)); + aMessage = ModuleRes(STR_CONNECTION_SUCCESS); } else { eImage = OSQLMessageBox::Error; - aMessage = String(ModuleRes(STR_CONNECTION_NO_SUCCESS)); + aMessage = ModuleRes(STR_CONNECTION_NO_SUCCESS); } OSQLMessageBox aMsg( this, sTitle, aMessage, WB_OK, eImage ); aMsg.Execute(); @@ -286,7 +286,7 @@ namespace dbaui { delete(m_pFT_HeaderText); m_pFT_HeaderText = new FixedText(this, ModuleRes(_nFTResId)); - String sHeaderText = String(ModuleRes(_StringResId)); + OUString sHeaderText = ModuleRes(_StringResId); m_pFT_HeaderText->SetText(sHeaderText); SetControlFontWeight(m_pFT_HeaderText); } diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 0aac084a2ea8..23cecb5a6d05 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -78,7 +78,7 @@ public: private: virtual void updateTableObjectList( bool _bAllowViews ); - virtual String getSelectedName( String& _out_rAliasName ) const; + virtual OUString getSelectedName( OUString& _out_rAliasName ) const; virtual bool isLeafSelected() const; // OContainerListener virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); @@ -92,11 +92,11 @@ TableListFacade::~TableListFacade() m_pContainerListener->dispose(); } -String TableListFacade::getSelectedName( String& _out_rAliasName ) const +OUString TableListFacade::getSelectedName( OUString& _out_rAliasName ) const { SvTreeListEntry* pEntry = m_rTableList.FirstSelected(); if ( !pEntry ) - return String(); + return OUString(); OUString aCatalog, aSchema, aTableName; SvTreeListEntry* pSchema = m_rTableList.GetParent(pEntry); @@ -239,7 +239,7 @@ public: private: virtual void updateTableObjectList( bool _bAllowViews ); - virtual String getSelectedName( String& _out_rAliasName ) const; + virtual OUString getSelectedName( OUString& _out_rAliasName ) const; virtual bool isLeafSelected() const; // OContainerListener virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); @@ -300,9 +300,9 @@ void QueryListFacade::updateTableObjectList( bool /*_bAllowViews*/ ) } } -String QueryListFacade::getSelectedName( String& _out_rAliasName ) const +OUString QueryListFacade::getSelectedName( OUString& _out_rAliasName ) const { - String sSelected; + OUString sSelected; SvTreeListEntry* pEntry = m_rQueryList.FirstSelected(); if ( pEntry ) sSelected = _out_rAliasName = m_rQueryList.GetEntryText( pEntry ); @@ -328,7 +328,7 @@ OAddTableDlg::OAddTableDlg( Window* pParent, IAddTableDialogContext& _rContext ) { // the Close-Button already has a standard help text which should not // occur here. Therefore, resetting the text and giving a new ID - aCloseButton.SetHelpText(String()); + aCloseButton.SetHelpText(OUString()); aCloseButton.SetHelpId(HID_JOINSH_ADDTAB_CLOSE); m_aTableList.SetHelpId( HID_JOINSH_ADDTAB_TABLELIST ); @@ -412,7 +412,7 @@ void OAddTableDlg::impl_addTable() { if ( m_pCurrentList->isLeafSelected() ) { - String sSelectedName, sAliasName; + OUString sSelectedName, sAliasName; sSelectedName = m_pCurrentList->getSelectedName( sAliasName ); m_rContext.addTableWindow( sSelectedName, sAliasName ); @@ -469,15 +469,15 @@ bool OAddTableDlg::impl_isAddAllowed() return m_rContext.allowAddition(); } -String OAddTableDlg::getDialogTitleForContext( IAddTableDialogContext& _rContext ) +OUString OAddTableDlg::getDialogTitleForContext( IAddTableDialogContext& _rContext ) { - String sTitle; + OUString sTitle; ::svt::OLocalResourceAccess aLocalRes( ModuleRes( DLG_JOIN_TABADD ), RSC_MODELESSDIALOG ); if ( _rContext.allowQueries() ) - sTitle = String( ModuleRes( STR_ADD_TABLE_OR_QUERY ) ); + sTitle = ModuleRes( STR_ADD_TABLE_OR_QUERY ); else - sTitle = String( ModuleRes( STR_ADD_TABLES ) ); + sTitle = ModuleRes( STR_ADD_TABLES ); return sTitle; } diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 5ca65870a78f..50a86b4293e0 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -447,11 +447,11 @@ namespace dbaui // auto-generated values? if ( rFeatures.supportsGeneratedValues() ) - AddTabPage( PAGE_GENERATED_VALUES, String( ModuleRes( STR_GENERATED_VALUE ) ), ODriversSettings::CreateGeneratedValuesPage, NULL ); + AddTabPage( PAGE_GENERATED_VALUES, OUString( ModuleRes( STR_GENERATED_VALUE ) ), ODriversSettings::CreateGeneratedValuesPage, NULL ); // any "special settings"? if ( rFeatures.supportsAnySpecialSetting() ) - AddTabPage( PAGE_ADVANCED_SETTINGS_SPECIAL, String( ModuleRes( STR_DS_BEHAVIOUR ) ), ODriversSettings::CreateSpecialSettingsPage, NULL ); + AddTabPage( PAGE_ADVANCED_SETTINGS_SPECIAL, OUString( ModuleRes( STR_DS_BEHAVIOUR ) ), ODriversSettings::CreateSpecialSettingsPage, NULL ); // remove the reset button - it's meaning is much too ambiguous in this dialog RemoveResetButton(); diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index f43a0830b1b4..285feff712e7 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -63,7 +63,7 @@ ODbAdminDialog::ODbAdminDialog(Window* _pParent m_pImpl = ::std::auto_ptr<ODbDataSourceAdministrationHelper>(new ODbDataSourceAdministrationHelper(_rxContext,this,this)); // add the initial tab page - AddTabPage( m_nMainPageID, String( ModuleRes( STR_PAGETITLE_GENERAL ) ), OConnectionTabPage::Create, NULL ); + AddTabPage( m_nMainPageID, OUString( ModuleRes( STR_PAGETITLE_GENERAL ) ), OConnectionTabPage::Create, NULL ); // remove the reset button - it's meaning is much too ambiguous in this dialog RemoveResetButton(); @@ -106,7 +106,7 @@ void ODbAdminDialog::addDetailPage(sal_uInt16 _nPageId, sal_uInt16 _nTextId, Cre // open our own resource block, as the page titles are strings local to this block LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); - AddTabPage(_nPageId, String(ModuleRes(_nTextId)), _pCreateFunc, NULL); + AddTabPage(_nPageId, OUString(ModuleRes(_nTextId)), _pCreateFunc, NULL); m_aCurrentDetailPages.push(_nPageId); } @@ -166,7 +166,7 @@ void ODbAdminDialog::impl_selectDataSource(const ::com::sun::star::uno::Any& _aD case ::dbaccess::DST_USERDEFINE10: { LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); - String aTitle(ModuleRes(STR_PAGETITLE_ADVANCED)); + OUString aTitle(ModuleRes(STR_PAGETITLE_ADVANCED)); AddTabPage(PAGE_USERDRIVER, aTitle, ODriversSettings::CreateUser, 0, sal_False, 1); m_aCurrentDetailPages.push(PAGE_USERDRIVER); } @@ -214,7 +214,7 @@ void ODbAdminDialog::impl_resetPages(const Reference< XPropertySet >& _rxDatasou if ( pCollection->determineType(getDatasourceType( *pExampleSet )) == ::dbaccess::DST_MYSQL_NATIVE ) { LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); - AddTabPage( PAGE_MYSQL_NATIVE, String( ModuleRes( STR_PAGETITLE_CONNECTION ) ), ODriversSettings::CreateMySQLNATIVE, NULL ); + AddTabPage( PAGE_MYSQL_NATIVE, OUString( ModuleRes( STR_PAGETITLE_CONNECTION ) ), ODriversSettings::CreateMySQLNATIVE, NULL ); RemoveTabPage( PAGE_CONNECTION ); m_nMainPageID = PAGE_MYSQL_NATIVE; } diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 3037e5e01af2..c96df2b413fc 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -42,7 +42,7 @@ const OString aGroupIdent(RTL_CONSTASCII_STRINGPARAM("dBase III")); DBG_NAME(ODbaseIndexDialog) -ODbaseIndexDialog::ODbaseIndexDialog( Window * pParent, String aDataSrcName ) +ODbaseIndexDialog::ODbaseIndexDialog( Window * pParent, OUString aDataSrcName ) : ModalDialog( pParent, ModuleRes(DLG_DBASE_INDEXES) ), aPB_OK( this, ModuleRes( PB_OK ) ), aPB_CANCEL( this, ModuleRes( PB_CANCEL ) ), @@ -85,7 +85,7 @@ ODbaseIndexDialog::~ODbaseIndexDialog() DBG_DTOR(ODbaseIndexDialog,NULL); } -sal_Bool ODbaseIndexDialog::GetTable(const String& _rName, TableInfoListIterator& _rPosition) +sal_Bool ODbaseIndexDialog::GetTable(const OUString& _rName, TableInfoListIterator& _rPosition) { for ( _rPosition = m_aTableInfoList.begin(); _rPosition != m_aTableInfoList.end(); @@ -94,7 +94,7 @@ sal_Bool ODbaseIndexDialog::GetTable(const String& _rName, TableInfoListIterator { if (m_bCaseSensitiv) { - if (_rPosition->aTableName.equals(_rName)) + if (_rPosition->aTableName == _rName) return sal_True; } else @@ -115,7 +115,7 @@ void ODbaseIndexDialog::checkButtons() aIB_RemoveAll.Enable(0 != aLB_TableIndexes.GetEntryCount()); } -OTableIndex ODbaseIndexDialog::implRemoveIndex(const String& _rName, TableIndexList& _rList, ListBox& _rDisplay, sal_Bool _bMustExist) +OTableIndex ODbaseIndexDialog::implRemoveIndex(const OUString& _rName, TableIndexList& _rList, ListBox& _rDisplay, sal_Bool _bMustExist) { OTableIndex aReturn; @@ -127,7 +127,7 @@ OTableIndex ODbaseIndexDialog::implRemoveIndex(const String& _rName, TableIndexL ++aSearch, ++nPos ) { - if ( m_bCaseSensitiv ? aSearch->GetIndexFileName().equals(_rName) : aSearch->GetIndexFileName().equalsIgnoreAsciiCase(_rName) ) + if ( m_bCaseSensitiv ? aSearch->GetIndexFileName() == _rName : aSearch->GetIndexFileName().equalsIgnoreAsciiCase(_rName) ) { aReturn = *aSearch; @@ -156,7 +156,7 @@ void ODbaseIndexDialog::implInsertIndex(const OTableIndex& _rIndex, TableIndexLi _rDisplay.SelectEntryPos(0); } -OTableIndex ODbaseIndexDialog::RemoveTableIndex( const String& _rTableName, const String& _rIndexName, sal_Bool _bMustExist ) +OTableIndex ODbaseIndexDialog::RemoveTableIndex( const OUString& _rTableName, const OUString& _rIndexName, sal_Bool _bMustExist ) { OTableIndex aReturn; @@ -168,7 +168,7 @@ OTableIndex ODbaseIndexDialog::RemoveTableIndex( const String& _rTableName, cons return implRemoveIndex(_rIndexName, aTablePos->aIndexList, aLB_TableIndexes, _bMustExist); } -void ODbaseIndexDialog::InsertTableIndex( const String& _rTableName, const OTableIndex& _rIndex) +void ODbaseIndexDialog::InsertTableIndex( const OUString& _rTableName, const OTableIndex& _rIndex) { TableInfoListIterator aTablePos; if (!GetTable(_rTableName, aTablePos)) @@ -193,8 +193,8 @@ IMPL_LINK( ODbaseIndexDialog, OKClickHdl, PushButton*, /*pButton*/ ) IMPL_LINK( ODbaseIndexDialog, AddClickHdl, PushButton*, /*pButton*/ ) { - String aSelection = aLB_FreeIndexes.GetSelectEntry(); - String aTableName = aCB_Tables.GetText(); + OUString aSelection = aLB_FreeIndexes.GetSelectEntry(); + OUString aTableName = aCB_Tables.GetText(); OTableIndex aIndex = RemoveFreeIndex( aSelection, sal_True ); InsertTableIndex( aTableName, aIndex ); @@ -204,8 +204,8 @@ IMPL_LINK( ODbaseIndexDialog, AddClickHdl, PushButton*, /*pButton*/ ) IMPL_LINK( ODbaseIndexDialog, RemoveClickHdl, PushButton*, /*pButton*/ ) { - String aSelection = aLB_TableIndexes.GetSelectEntry(); - String aTableName = aCB_Tables.GetText(); + OUString aSelection = aLB_TableIndexes.GetSelectEntry(); + OUString aTableName = aCB_Tables.GetText(); OTableIndex aIndex = RemoveTableIndex( aTableName, aSelection, sal_True ); InsertFreeIndex( aIndex ); @@ -216,7 +216,7 @@ IMPL_LINK( ODbaseIndexDialog, RemoveClickHdl, PushButton*, /*pButton*/ ) IMPL_LINK( ODbaseIndexDialog, AddAllClickHdl, PushButton*, /*pButton*/ ) { sal_uInt16 nCnt = aLB_FreeIndexes.GetEntryCount(); - String aTableName = aCB_Tables.GetText(); + OUString aTableName = aCB_Tables.GetText(); for( sal_uInt16 nPos = 0; nPos < nCnt; ++nPos ) InsertTableIndex( aTableName, RemoveFreeIndex( aLB_FreeIndexes.GetEntry(0), sal_True ) ); @@ -228,7 +228,7 @@ IMPL_LINK( ODbaseIndexDialog, AddAllClickHdl, PushButton*, /*pButton*/ ) IMPL_LINK( ODbaseIndexDialog, RemoveAllClickHdl, PushButton*, /*pButton*/ ) { sal_uInt16 nCnt = aLB_TableIndexes.GetEntryCount(); - String aTableName = aCB_Tables.GetText(); + OUString aTableName = aCB_Tables.GetText(); for( sal_uInt16 nPos = 0; nPos < nCnt; ++nPos ) InsertFreeIndex( RemoveTableIndex( aTableName, aLB_TableIndexes.GetEntry(0), sal_True ) ); @@ -313,7 +313,7 @@ void ODbaseIndexDialog::Init() OUString aIndexExt("ndx"); OUString aTableExt("dbf"); - ::std::vector< String > aUsedIndexes; + ::std::vector< OUString > aUsedIndexes; const OUString *pBegin = aFolderContent.getConstArray(); const OUString *pEnd = pBegin + aFolderContent.getLength(); @@ -343,7 +343,7 @@ void ODbaseIndexDialog::Init() OString aNDX; sal_uInt16 nKeyCnt = aInfFile.GetKeyCount(); OString aKeyName; - String aEntry; + OUString aEntry; for( sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++ ) { @@ -366,7 +366,7 @@ void ODbaseIndexDialog::Init() } } - for ( ::std::vector< String >::const_iterator aUsedIndex = aUsedIndexes.begin(); + for ( ::std::vector< OUString >::const_iterator aUsedIndex = aUsedIndexes.begin(); aUsedIndex != aUsedIndexes.end(); ++aUsedIndex ) diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index c9cf1f40854c..1dfb2a559c41 100644 --- a/dbaccess/source/ui/dlg/dbfindex.hxx +++ b/dbaccess/source/ui/dlg/dbfindex.hxx @@ -103,27 +103,27 @@ protected: DECL_LINK( OKClickHdl, PushButton* ); DECL_LINK( OnListEntrySelected, ListBox* ); - String m_aDSN; + OUString m_aDSN; TableInfoList m_aTableInfoList; TableIndexList m_aFreeIndexList; sal_Bool m_bCaseSensitiv; void Init(); void SetCtrls(); - sal_Bool GetTable(const String& rName, TableInfoListIterator& _rPosition); + sal_Bool GetTable(const OUString& rName, TableInfoListIterator& _rPosition); - OTableIndex implRemoveIndex(const String& _rName, TableIndexList& _rList, ListBox& _rDisplay, sal_Bool _bMustExist); + OTableIndex implRemoveIndex(const OUString& _rName, TableIndexList& _rList, ListBox& _rDisplay, sal_Bool _bMustExist); void implInsertIndex(const OTableIndex& _rIndex, TableIndexList& _rList, ListBox& _rDisplay); - OTableIndex RemoveFreeIndex( const String& _rName, sal_Bool _bMustExist ) { return implRemoveIndex(_rName, m_aFreeIndexList, aLB_FreeIndexes, _bMustExist); } + OTableIndex RemoveFreeIndex( const OUString& _rName, sal_Bool _bMustExist ) { return implRemoveIndex(_rName, m_aFreeIndexList, aLB_FreeIndexes, _bMustExist); } void InsertFreeIndex( const OTableIndex& _rIndex ) { implInsertIndex(_rIndex, m_aFreeIndexList, aLB_FreeIndexes); } - OTableIndex RemoveTableIndex( const String& _rTableName, const String& _rIndexName, sal_Bool _bMustExist ); - void InsertTableIndex( const String& _rTableName, const OTableIndex& _rIndex ); + OTableIndex RemoveTableIndex( const OUString& _rTableName, const OUString& _rIndexName, sal_Bool _bMustExist ); + void InsertTableIndex( const OUString& _rTableName, const OTableIndex& _rIndex ); void checkButtons(); public: - ODbaseIndexDialog( Window * pParent, String aDataSrcName ); + ODbaseIndexDialog( Window * pParent, OUString aDataSrcName ); virtual ~ODbaseIndexDialog(); }; diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index c24b9b23201b..17a495c1e332 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -294,7 +294,7 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState) // open our own resource block, as the page titles are strings local to this block LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); - pPage->SetText(String(ModuleRes(nStringId))); + pPage->SetText(ModuleRes(nStringId)); defaultButton( _nState == START_PAGE ? WZB_NEXT : WZB_FINISH ); enableButtons( WZB_FINISH, _nState == START_PAGE ? sal_False : sal_True); pPage->Show(); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 5f12461e2025..f5579f6e72f9 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -263,7 +263,7 @@ OUString ODbTypeWizDialogSetup::getStateDisplayName( WizardState _nState ) const case PAGE_DBSETUPWIZARD_USERDEFINED: { LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); - sRoadmapItem = String(ModuleRes(STR_PAGETITLE_CONNECTION)); + sRoadmapItem = ModuleRes(STR_PAGETITLE_CONNECTION); } break; case PAGE_DBSETUPWIZARD_FINAL: @@ -352,7 +352,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() case OGeneralPageWizard::eOpenExisting: { activatePath( static_cast<PathId>(m_pCollection->size() + 1), sal_True ); - enableButtons( WZB_FINISH, m_pGeneralPage->GetSelectedDocument().sURL.Len() != 0 ); + enableButtons( WZB_FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() ); } break; default: @@ -619,7 +619,7 @@ IMPL_LINK(ODbTypeWizDialogSetup, OnChangeCreationMode, OGeneralPageWizard*, /*_p IMPL_LINK(ODbTypeWizDialogSetup, OnRecentDocumentSelected, OGeneralPageWizard*, /*_pGeneralPage*/) { - enableButtons( WZB_FINISH, m_pGeneralPage->GetSelectedDocument().sURL.Len() != 0 ); + enableButtons( WZB_FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() ); return 0L; } @@ -815,7 +815,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() INetURLObject aWorkURL( m_sWorkPath ); aFileDlg.SetDisplayFolder( aWorkURL.GetMainURL( INetURLObject::NO_DECODE )); - OUString sDefaultName = String( ModuleRes( STR_DATABASEDEFAULTNAME ) ); + OUString sDefaultName = ModuleRes( STR_DATABASEDEFAULTNAME ); OUString sExtension = pFilter->GetDefaultExtension(); sDefaultName += sExtension.replaceAt( 0, 1, OUString() ); aWorkURL.Append( sDefaultName ); @@ -858,7 +858,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() } } - String ODbTypeWizDialogSetup::createUniqueFileName(const INetURLObject& _rURL) + OUString ODbTypeWizDialogSetup::createUniqueFileName(const INetURLObject& _rURL) { Reference< XSimpleFileAccess3 > xSimpleFileAccess(ucb::SimpleFileAccess::create(getORB())); OUString BaseName = _rURL.getBase(); diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 379cc306b342..936e451016f4 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -590,7 +590,7 @@ namespace dbaui #endif const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String(), WB_OK | WB_DEF_OK, mt ); + OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ); aMsg.Execute(); return 0L; } @@ -655,7 +655,7 @@ namespace dbaui if ( m_aUserName.GetText() != m_aUserName.GetSavedValue() ) { _rSet.Put( SfxStringItem( DSID_USER, m_aUserName.GetText() ) ); - _rSet.Put( SfxStringItem( DSID_PASSWORD, String())); + _rSet.Put( SfxStringItem( DSID_PASSWORD, OUString())); bChangedSomething = sal_True; } fillBool(_rSet,&m_aPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething); diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index bf04af7a25c3..ffc97be64249 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -99,7 +99,7 @@ namespace dbaui FixedText m_aFT_Message; PushButton m_aIndexes; - String m_sDsn; + OUString m_sDsn; protected: @@ -273,9 +273,9 @@ namespace dbaui private: - String m_aFieldSeparatorList; - String m_aTextSeparatorList; - String m_aTextNone; + OUString m_aFieldSeparatorList; + OUString m_aTextSeparatorList; + OUString m_aTextNone; protected: virtual ~OTextDetailsPage(); virtual sal_Bool prepareLeave(); diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 5568a1fa1a72..6e1d4077e3a5 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -96,7 +96,7 @@ DBG_NAME(DirectSQLDialog) (void)_rSource; { - String sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST)); + OUString sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST)); ErrorBox aError(this, WB_OK, sMessage); aError.Execute(); } @@ -127,7 +127,7 @@ DBG_NAME(DirectSQLDialog) } } - void DirectSQLDialog::implAddToStatementHistory(const String& _rStatement) + void DirectSQLDialog::implAddToStatementHistory(const OUString& _rStatement) { CHECK_INVARIANTS("DirectSQLDialog::implAddToStatementHistory"); @@ -135,8 +135,8 @@ DBG_NAME(DirectSQLDialog) m_aStatementHistory.push_back(_rStatement); // normalize the statement, and remember the normalized form, too - String sNormalized(_rStatement); - sNormalized.SearchAndReplaceAll((sal_Unicode)'\n', ' '); + OUString sNormalized(_rStatement); + sNormalized = sNormalized.replaceAll("\n", " "); m_aNormalizedHistory.push_back(sNormalized); // add the normalized version to the list box @@ -165,13 +165,13 @@ DBG_NAME(DirectSQLDialog) } #endif - void DirectSQLDialog::implExecuteStatement(const String& _rStatement) + void DirectSQLDialog::implExecuteStatement(const OUString& _rStatement) { CHECK_INVARIANTS("DirectSQLDialog::implExecuteStatement"); ::osl::MutexGuard aGuard(m_aMutex); - String sStatus; + OUString sStatus; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > xResultSet; try { @@ -193,7 +193,7 @@ DBG_NAME(DirectSQLDialog) while (xResultSet->next()) { // initialise the output line for each row - String out = OUString(""); + OUString out(""); // work along the columns until that are none left try { @@ -201,7 +201,7 @@ DBG_NAME(DirectSQLDialog) for (;;) { // be dumb, treat everything as a string - out += xRow->getString(i) + OUString(","); + out += xRow->getString(i) + ","; i++; } } @@ -219,7 +219,7 @@ DBG_NAME(DirectSQLDialog) } // successful - sStatus = String(ModuleRes(STR_COMMAND_EXECUTED_SUCCESSFULLY)); + sStatus = ModuleRes(STR_COMMAND_EXECUTED_SUCCESSFULLY); // dispose the statement ::comphelper::disposeComponent(xStatement); @@ -237,7 +237,7 @@ DBG_NAME(DirectSQLDialog) addStatusText(sStatus); } - void DirectSQLDialog::addStatusText(const String& _rMessage) + void DirectSQLDialog::addStatusText(const OUString& _rMessage) { OUString sAppendMessage = OUString::number(m_nStatusCount++) + ": " + _rMessage + "\n\n"; @@ -247,12 +247,12 @@ DBG_NAME(DirectSQLDialog) m_pStatus->SetSelection(Selection(sCompleteMessage.getLength(), sCompleteMessage.getLength())); } - void DirectSQLDialog::addOutputText(const String& _rMessage) + void DirectSQLDialog::addOutputText(const OUString& _rMessage) { - String sAppendMessage = _rMessage; - sAppendMessage += OUString("\n"); + OUString sAppendMessage = _rMessage; + sAppendMessage += "\n"; - String sCompleteMessage = m_pOutput->GetText(); + OUString sCompleteMessage = m_pOutput->GetText(); sCompleteMessage += sAppendMessage; m_pOutput->SetText(sCompleteMessage); } @@ -261,7 +261,7 @@ DBG_NAME(DirectSQLDialog) { CHECK_INVARIANTS("DirectSQLDialog::executeCurrent"); - String sStatement = m_pSQL->GetText(); + OUString sStatement = m_pSQL->GetText(); // execute implExecuteStatement(sStatement); @@ -280,7 +280,7 @@ DBG_NAME(DirectSQLDialog) if ((_nHistoryPos >= 0) && (_nHistoryPos < getHistorySize())) { // set the text in the statement editor - String sStatement = m_aStatementHistory[_nHistoryPos]; + OUString sStatement = m_aStatementHistory[_nHistoryPos]; m_pSQL->SetText(sStatement); OnStatementModified(m_pSQL); @@ -293,7 +293,7 @@ DBG_NAME(DirectSQLDialog) } m_pSQL->GrabFocus(); - m_pSQL->SetSelection(Selection(sStatement.Len(), sStatement.Len())); + m_pSQL->SetSelection(Selection(sStatement.getLength(), sStatement.getLength())); } else OSL_FAIL("DirectSQLDialog::switchToHistory: invalid position!"); diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index 708cf96ea6a5..f19e87760ab8 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -49,9 +49,9 @@ SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumb OSL_FAIL( "found flag TP_ATTR_CHAR" ); } if( nFlags & TP_ATTR_NUMBER ) - AddTabPage( RID_SVXPAGE_NUMBERFORMAT,String(ModuleRes(TP_ATTR_NUMBER)) ); + AddTabPage( RID_SVXPAGE_NUMBERFORMAT,OUString(ModuleRes(TP_ATTR_NUMBER)) ); if( nFlags & TP_ATTR_ALIGN ) - AddTabPage( RID_SVXPAGE_ALIGNMENT,String(ModuleRes(TP_ATTR_ALIGN)) ); + AddTabPage( RID_SVXPAGE_ALIGNMENT,OUString(ModuleRes(TP_ATTR_ALIGN)) ); FreeResource(); } diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index 09cd05a08091..c7d63f7dbca3 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -59,23 +59,23 @@ public: OKButton m_aPB_OK; CancelButton m_aPB_CANCEL; HelpButton m_aPB_HELP; - String m_aQryLabel; - String m_sTblLabel; - String m_aName; + OUString m_aQryLabel; + OUString m_sTblLabel; + OUString m_aName; const IObjectNameCheck& m_rObjectNameCheck; - String m_sParentURL; + OUString m_sParentURL; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xMetaData; sal_Int32 m_nType; sal_Int32 m_nFlags; OSaveAsDlgImpl( Window * pParent,const sal_Int32& _rType, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, - const String& rDefault, + const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags); OSaveAsDlgImpl( Window * pParent, - const String& rDefault, + const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags); }; @@ -85,7 +85,7 @@ public: OSaveAsDlgImpl::OSaveAsDlgImpl( Window * _pParent, const sal_Int32& _rType, const Reference< XConnection>& _xConnection, - const String& rDefault, + const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags) :m_aDescription(_pParent, ModuleRes (FT_DESCRIPTION)) @@ -121,7 +121,7 @@ OSaveAsDlgImpl::OSaveAsDlgImpl( Window * _pParent, } OSaveAsDlgImpl::OSaveAsDlgImpl( Window * _pParent, - const String& rDefault, + const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags) :m_aDescription(_pParent, ModuleRes (FT_DESCRIPTION)) @@ -168,7 +168,7 @@ namespace _rList.InsertEntry( sValue ); } - sal_uInt16 nPos = _rList.GetEntryPos( String( _rCurrent ) ); + sal_uInt16 nPos = _rList.GetEntryPos( OUString( _rCurrent ) ); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) _rList.SelectEntryPos( nPos ); else @@ -185,7 +185,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, const sal_Int32& _rType, const Reference< XComponentContext >& _rxContext, const Reference< XConnection>& _xConnection, - const String& rDefault, + const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags) :ModalDialog( pParent, ModuleRes(DLG_SAVE_AS)) @@ -241,7 +241,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, } OSL_ENSURE(m_pImpl->m_xMetaData.is(),"The metadata can not be null!"); - if(m_pImpl->m_aName.Search('.') != STRING_NOTFOUND) + if(m_pImpl->m_aName.indexOf('.') != -1) { OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(m_pImpl->m_xMetaData, @@ -251,13 +251,13 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, sTable, ::dbtools::eInDataManipulation); - sal_uInt16 nPos = m_pImpl->m_aCatalog.GetEntryPos(String(sCatalog)); + sal_uInt16 nPos = m_pImpl->m_aCatalog.GetEntryPos(OUString(sCatalog)); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) m_pImpl->m_aCatalog.SelectEntryPos(nPos); if ( !sSchema.isEmpty() ) { - nPos = m_pImpl->m_aSchema.GetEntryPos(String(sSchema)); + nPos = m_pImpl->m_aSchema.GetEntryPos(OUString(sSchema)); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) m_pImpl->m_aSchema.SelectEntryPos(nPos); } @@ -299,8 +299,8 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, OSaveAsDlg::OSaveAsDlg( Window * pParent, const Reference< XComponentContext >& _rxContext, - const String& rDefault, - const String& _sLabel, + const OUString& rDefault, + const OUString& _sLabel, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags) :ModalDialog( pParent, ModuleRes(DLG_SAVE_AS)) @@ -353,7 +353,7 @@ IMPL_LINK(OSaveAsDlg, EditModifyHdl, Edit *, pEdit ) return 0; } -void OSaveAsDlg::implInitOnlyTitle(const String& _rLabel) +void OSaveAsDlg::implInitOnlyTitle(const OUString& _rLabel) { m_pImpl->m_aLabel.SetText(_rLabel); m_pImpl->m_aCatalogLbl.Hide(); @@ -409,10 +409,10 @@ void OSaveAsDlg::implInit() } if ( SAD_TITLE_PASTE_AS == ( m_pImpl->m_nFlags & SAD_TITLE_PASTE_AS ) ) - SetText( String( ModuleRes( STR_TITLE_PASTE_AS ) ) ); + SetText( ModuleRes( STR_TITLE_PASTE_AS ) ); else if ( SAD_TITLE_RENAME == ( m_pImpl->m_nFlags & SAD_TITLE_RENAME ) ) { - SetText( String( ModuleRes( STR_TITLE_RENAME ) ) ); + SetText( ModuleRes( STR_TITLE_RENAME ) ); m_pImpl->m_aTitle.SetHelpId(HID_DLG_RENAME); } @@ -422,8 +422,8 @@ void OSaveAsDlg::implInit() FreeResource(); } -String OSaveAsDlg::getName() const { return m_pImpl->m_aName; } -String OSaveAsDlg::getCatalog() const { return m_pImpl->m_aCatalog.IsVisible() ? m_pImpl->m_aCatalog.GetText() : OUString(); } -String OSaveAsDlg::getSchema() const { return m_pImpl->m_aSchema.IsVisible() ? m_pImpl->m_aSchema.GetText() : OUString(); } +OUString OSaveAsDlg::getName() const { return m_pImpl->m_aName; } +OUString OSaveAsDlg::getCatalog() const { return m_pImpl->m_aCatalog.IsVisible() ? m_pImpl->m_aCatalog.GetText() : OUString(); } +OUString OSaveAsDlg::getSchema() const { return m_pImpl->m_aSchema.IsVisible() ? m_pImpl->m_aSchema.GetText() : OUString(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx index 2c332cbc865d..171fa415c84d 100644 --- a/dbaccess/source/ui/dlg/dsselect.hxx +++ b/dbaccess/source/ui/dlg/dsselect.hxx @@ -59,8 +59,8 @@ public: ODatasourceSelectDialog( Window* _pParent, const StringBag& _rDatasources, SfxItemSet* _pOutputSet = NULL ); ~ODatasourceSelectDialog(); - inline String GetSelected() const { return m_aDatasource.GetSelectEntry();} - void Select( const String& _rEntry ) { m_aDatasource.SelectEntry(_rEntry); } + inline OUString GetSelected() const { return m_aDatasource.GetSelectEntry();} + void Select( const OUString& _rEntry ) { m_aDatasource.SelectEntry(_rEntry); } virtual sal_Bool Close(); diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index ff6bd5ddec64..565870fd638d 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -84,9 +84,9 @@ namespace dbaui struct DisplayedType { OUString eType; - String sDisplayName; + OUString sDisplayName; - DisplayedType( const OUString& _eType, const String& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { } + DisplayedType( const OUString& _eType, const OUString& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { } }; typedef ::std::vector< DisplayedType > DisplayedTypes; @@ -194,9 +194,9 @@ namespace dbaui sal_uInt16 nResId = 0; if ( smUnsupportedType == eMessage ) nResId = STR_UNSUPPORTED_DATASOURCE_TYPE; - String sMessage; + OUString sMessage; if ( nResId ) - sMessage = String( ModuleRes( nResId ) ); + sMessage = ModuleRes( nResId ); m_pSpecialMessage->SetText( sMessage ); m_eLastMessage = eMessage; @@ -238,7 +238,7 @@ namespace dbaui getFlags( _rSet, bValid, bReadonly ); // if the selection is invalid, disable everything - String sName,sConnectURL; + OUString sName,sConnectURL; if ( bValid ) { // collect some items and some values @@ -285,7 +285,7 @@ namespace dbaui getFlags( _rSet, bValid, bReadonly ); // if the selection is invalid, disable everything - String sName,sConnectURL; + OUString sName,sConnectURL; m_bDisplayingInvalid = !bValid; if ( bValid ) { @@ -344,17 +344,17 @@ namespace dbaui // do not display the Connector/OOo driver itself, it is always wrapped via the MySQL-Driver, if // this driver is installed if ( m_pCollection->hasDriver( "sdbc:mysql:mysqlc:" ) ) - _inout_rDisplayName = String(); + _inout_rDisplayName = ""; } if ( eType == ::dbaccess::DST_EMBEDDED_HSQLDB || eType == ::dbaccess::DST_EMBEDDED_FIREBIRD ) - _inout_rDisplayName = String(); + _inout_rDisplayName = ""; return _inout_rDisplayName.getLength() > 0; } - void OGeneralPage::insertDatasourceTypeEntryData(const OUString& _sType, String sDisplayName) + void OGeneralPage::insertDatasourceTypeEntryData(const OUString& _sType, OUString sDisplayName) { // insert a (temporary) entry sal_uInt16 nPos = m_pDatasourceType->InsertEntry(sDisplayName); @@ -363,7 +363,7 @@ namespace dbaui m_aURLPrefixes[nPos] = _sType; } - void OGeneralPageWizard::insertEmbeddedDBTypeEntryData(const OUString& _sType, String sDisplayName) + void OGeneralPageWizard::insertEmbeddedDBTypeEntryData(const OUString& _sType, OUString sDisplayName) { // insert a (temporary) entry sal_uInt16 nPos = m_pEmbeddedDBType->InsertEntry(sDisplayName); @@ -571,7 +571,7 @@ namespace dbaui sal_Bool bValid, bReadonly; getFlags( _rSet, bValid, bReadonly ); - SetText( String() ); + SetText( OUString() ); LayoutHelper::positionBelow( *m_pRB_ConnectDatabase, *m_pDatasourceType, RelatedControls, INDENT_BELOW_RADIO ); @@ -617,7 +617,7 @@ namespace dbaui case ::dbaccess::DST_MYSQL_NATIVE: // don't display those, the decision whether the user connects via JDBC/ODBC/C-OOo is made on another // page - _inout_rDisplayName = String(); + _inout_rDisplayName = ""; break; default: break; @@ -668,7 +668,7 @@ namespace dbaui OGeneralPageWizard::DocumentDescriptor OGeneralPageWizard::GetSelectedDocument() const { DocumentDescriptor aDocument; - if ( m_aBrowsedDocument.sURL.Len() ) + if ( !m_aBrowsedDocument.sURL.isEmpty() ) aDocument = m_aBrowsedDocument; else { @@ -713,10 +713,10 @@ namespace dbaui } if ( aFileDlg.Execute() == ERRCODE_NONE ) { - String sPath = aFileDlg.GetPath(); + OUString sPath = aFileDlg.GetPath(); if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() || !pFilter->GetWildcard().Matches(sPath) ) { - String sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO)); + OUString sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO)); InfoBox aError(this, sMessage); aError.Execute(); m_pRB_ConnectDatabase->Check(); @@ -724,7 +724,7 @@ namespace dbaui return 0L; } m_aBrowsedDocument.sURL = sPath; - m_aBrowsedDocument.sFilter = String(); + m_aBrowsedDocument.sFilter = ""; m_aChooseDocumentHandler.Call( this ); return 1L; } diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 71e01520b0b4..0def8c1cf4a2 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -55,7 +55,7 @@ namespace dbaui sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted bool m_bInitTypeList : 1; bool approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ); - void insertDatasourceTypeEntryData( const OUString& _sType, String sDisplayName ); + void insertDatasourceTypeEntryData( const OUString& _sType, OUString sDisplayName ); protected: ListBox* m_pDatasourceType; @@ -128,8 +128,8 @@ namespace dbaui struct DocumentDescriptor { - String sURL; - String sFilter; + OUString sURL; + OUString sFilter; }; private: @@ -160,7 +160,7 @@ namespace dbaui m_aControlDependencies; bool m_bInitEmbeddedDBList : 1; - void insertEmbeddedDBTypeEntryData( const OUString& _sType, String sDisplayName ); + void insertEmbeddedDBTypeEntryData( const OUString& _sType, OUString sDisplayName ); public: void SetCreationModeHandler( const Link& _rHandler ) { m_aCreationModeHandler = _rHandler; } diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 7595e63b3fe6..165cb8b935b2 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -108,7 +108,7 @@ namespace dbaui if (!SvTreeListBox::EditedEntry(_pEntry, _rNewText)) return sal_False; - String sOldText = GetEntryText(_pEntry); + OUString sOldText = GetEntryText(_pEntry); SvTreeListBox::SetEntryText(_pEntry, _rNewText); sal_Bool bValid = sal_True; @@ -350,8 +350,8 @@ DBG_NAME(DbaIndexDialog) return; // get a new unique name for the new index - String sNewIndexName; - const String sNewIndexNameBase(ModuleRes(STR_LOGICAL_INDEX_NAME)); + OUString sNewIndexName; + const OUString sNewIndexNameBase(ModuleRes(STR_LOGICAL_INDEX_NAME)); sal_Int32 i; for ( i = 1; i < 0x7FFFFFFF; ++i ) @@ -397,8 +397,8 @@ DBG_NAME(DbaIndexDialog) // let the user confirm the drop if (_bConfirm) { - String sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX)); - sConfirm.SearchAndReplaceAscii("$name$", m_aIndexes.GetEntryText(pSelected)); + OUString sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX)); + sConfirm = sConfirm.replaceFirst("$name$", m_aIndexes.GetEntryText(pSelected)); QueryBox aConfirm(this, WB_YES_NO, sConfirm); if (RET_YES != aConfirm.Execute()) return; @@ -606,13 +606,13 @@ DBG_NAME(DbaIndexDialog) OSL_ENSURE(aPosition >= m_pIndexes->begin() && aPosition < m_pIndexes->end(), "DbaIndexDialog::OnEntryEdited: invalid entry!"); - String sNewName = m_aIndexes.GetEntryText(_pEntry); + OUString sNewName = m_aIndexes.GetEntryText(_pEntry); Indexes::const_iterator aSameName = m_pIndexes->find(sNewName); if ((aSameName != aPosition) && (m_pIndexes->end() != aSameName)) { - String sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED)); - sError.SearchAndReplaceAscii("$name$", sNewName); + OUString sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED)); + sError = sError.replaceFirst("$name$", sNewName); ErrorBox aError(this, WB_OK, sError); aError.Execute(); @@ -681,7 +681,7 @@ DBG_NAME(DbaIndexDialog) } // no double fields - std::set< String > aExistentFields; + std::set< OUString > aExistentFields; for ( ConstIndexFieldsIterator aFieldCheck = _rPos->aFields.begin(); aFieldCheck != _rPos->aFields.end(); ++aFieldCheck @@ -690,8 +690,8 @@ DBG_NAME(DbaIndexDialog) if (aExistentFields.end() != aExistentFields.find(aFieldCheck->sFieldName)) { // a column is specified twice ... won't work anyway, so prevent this here and now - String sMessage(ModuleRes(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME)); - sMessage.SearchAndReplaceAscii("$name$", aFieldCheck->sFieldName); + OUString sMessage(ModuleRes(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME)); + sMessage = sMessage.replaceFirst("$name$", aFieldCheck->sFieldName); ErrorBox aError(this, WB_OK, sMessage); aError.Execute(); m_pFields->GrabFocus(); @@ -756,7 +756,7 @@ DBG_NAME(DbaIndexDialog) { m_aUnique.Check(sal_False); m_pFields->initializeFrom(IndexFields()); - m_aDescription.SetText(String()); + m_aDescription.SetText(OUString()); } } diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 4b68d3e3b949..94631f69548d 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -134,7 +134,7 @@ DBG_NAME(IndexFieldsControl) Point aPos(_rRect.TopLeft()); aPos.X() += 1; - String aText = GetRowCellText(m_aSeekRow,_nColumnId); + OUString aText = GetRowCellText(m_aSeekRow,_nColumnId); Size TxtSize(GetDataWindow().GetTextWidth(aText), GetDataWindow().GetTextHeight()); // clipping @@ -185,7 +185,7 @@ DBG_NAME(IndexFieldsControl) ConstIndexFieldsIterator aSourceEnd = m_aFields.end(); IndexFieldsIterator aDest = _rFields.begin(); for (; aSource < aSourceEnd; ++aSource) - if (0 != aSource->sFieldName.Len()) + if (!aSource->sFieldName.isEmpty()) { *aDest = *aSource; ++aDest; @@ -215,11 +215,11 @@ DBG_NAME(IndexFieldsControl) if ( m_bAddIndexAppendix ) { - m_sAscendingText = String(ModuleRes(STR_ORDER_ASCENDING)); - m_sDescendingText = String(ModuleRes(STR_ORDER_DESCENDING)); + m_sAscendingText = ModuleRes(STR_ORDER_ASCENDING); + m_sDescendingText = ModuleRes(STR_ORDER_DESCENDING); // the "sort order" column - String sColumnName = String(ModuleRes(STR_TAB_INDEX_SORTORDER)); + OUString sColumnName = ModuleRes(STR_TAB_INDEX_SORTORDER); // the width of the order column is the maximum widths of the texts used // (the title of the column) sal_Int32 nSortOrderColumnWidth = GetTextWidth(sColumnName); @@ -244,13 +244,13 @@ DBG_NAME(IndexFieldsControl) nFieldNameWidth -= aSystemStyle.GetScrollBarSize(); nFieldNameWidth -= 8; // the "field name" column - String sColumnName = String(ModuleRes(STR_TAB_INDEX_FIELD)); + OUString sColumnName = ModuleRes(STR_TAB_INDEX_FIELD); InsertDataColumn(COLUMN_ID_FIELDNAME, sColumnName, nFieldNameWidth, HIB_STDSTYLE, 0); // create the cell controllers // for the field name cell m_pFieldNameCell = new ListBoxControl(&GetDataWindow()); - m_pFieldNameCell->InsertEntry(String()); + m_pFieldNameCell->InsertEntry(OUString()); m_pFieldNameCell->SetHelpId( HID_DLGINDEX_INDEXDETAILS_FIELD ); const OUString* pFields = _rAvailableFields.getConstArray(); const OUString* pFieldsEnd = pFields + _rAvailableFields.getLength(); @@ -270,7 +270,7 @@ DBG_NAME(IndexFieldsControl) switch (_nColumnId) { case COLUMN_ID_ORDER: - if (!bNewField && m_pSortingCell && 0 != aRow->sFieldName.Len()) + if (!bNewField && m_pSortingCell && !aRow->sFieldName.isEmpty()) pReturn = new DbaMouseDownListBoxController(m_pSortingCell); break; @@ -311,8 +311,8 @@ DBG_NAME(IndexFieldsControl) { case COLUMN_ID_FIELDNAME: { - String sFieldSelected = m_pFieldNameCell->GetSelectEntry(); - sal_Bool bEmptySelected = 0 == sFieldSelected.Len(); + OUString sFieldSelected = m_pFieldNameCell->GetSelectEntry(); + sal_Bool bEmptySelected = sFieldSelected.isEmpty(); if (isNewField()) { if (!bEmptySelected) @@ -335,7 +335,7 @@ DBG_NAME(IndexFieldsControl) if (bEmptySelected) { - aPos->sFieldName = String(); + aPos->sFieldName = ""; // invalidate the row to force repaint Invalidate(GetRowRectPixel(nRow)); @@ -379,7 +379,7 @@ DBG_NAME(IndexFieldsControl) switch (_nColumnId) { case COLUMN_ID_FIELDNAME: - m_pFieldNameCell->SelectEntry(bNewField ? String() : aFieldDescription->sFieldName); + m_pFieldNameCell->SelectEntry(bNewField ? OUString() : aFieldDescription->sFieldName); m_pFieldNameCell->SaveValue(); break; @@ -402,20 +402,20 @@ DBG_NAME(IndexFieldsControl) { // a field has been selected if (GetCurRow() >= GetRowCount() - 2) { // and we're in one of the last two rows - String sSelectedEntry = m_pFieldNameCell->GetSelectEntry(); + OUString sSelectedEntry = m_pFieldNameCell->GetSelectEntry(); sal_Int32 nCurrentRow = GetCurRow(); sal_Int32 rowCount = GetRowCount(); OSL_ENSURE(((sal_Int32)(m_aFields.size() + 1)) == rowCount, "IndexFieldsControl::OnListEntrySelected: inconsistence!"); - if (sSelectedEntry.Len() && (nCurrentRow == rowCount - 1) /*&& (!m_nMaxColumnsInIndex || rowCount < m_nMaxColumnsInIndex )*/ ) + if (!sSelectedEntry.isEmpty() && (nCurrentRow == rowCount - 1) /*&& (!m_nMaxColumnsInIndex || rowCount < m_nMaxColumnsInIndex )*/ ) { // in the last row, an non-empty string has been selected // -> insert a new row m_aFields.push_back(OIndexField()); RowInserted(GetRowCount(), 1); Invalidate(GetRowRectPixel(nCurrentRow)); } - else if (!sSelectedEntry.Len() && (nCurrentRow == rowCount - 2)) + else if (sSelectedEntry.isEmpty() && (nCurrentRow == rowCount - 2)) { // in the (last-1)th row, an empty entry has been selected // -> remove the last row m_aFields.erase(m_aFields.end() - 1); @@ -438,7 +438,7 @@ DBG_NAME(IndexFieldsControl) } return GetRowCellText(aRow,nColId); } - String IndexFieldsControl::GetRowCellText(const ConstIndexFieldsIterator& _rRow,sal_uInt16 nColId) const + OUString IndexFieldsControl::GetRowCellText(const ConstIndexFieldsIterator& _rRow,sal_uInt16 nColId) const { if (_rRow < m_aFields.end()) { @@ -447,15 +447,15 @@ DBG_NAME(IndexFieldsControl) case COLUMN_ID_FIELDNAME: return _rRow->sFieldName; case COLUMN_ID_ORDER: - if (0 == _rRow->sFieldName.Len()) - return String(); + if (_rRow->sFieldName.isEmpty()) + return OUString(); else return _rRow->bSortAscending ? m_sAscendingText : m_sDescendingText; default: OSL_FAIL("IndexFieldsControl::GetCurrentRowCellText: invalid column id!"); } } - return String(); + return OUString(); } sal_Bool IndexFieldsControl::IsTabAllowed(sal_Bool /*bForward*/) const { diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index fe1ae459d6aa..598b25f0f5d1 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -200,12 +200,12 @@ DBG_NAME(OParameterDialog) DBG_UNHANDLED_EXCEPTION(); } - String sMessage; + OUString sMessage; { LocalResourceAccess aDummy(DLG_PARAMETERS, RSC_MODALDIALOG); - sMessage = String(ModuleRes(STR_COULD_NOT_CONVERT_PARAM)); + sMessage = ModuleRes(STR_COULD_NOT_CONVERT_PARAM); } - sMessage.SearchAndReplaceAll( OUString("$name$"), sName ); + sMessage = sMessage.replaceAll( "$name$", sName ); ErrorBox(NULL, WB_OK, sMessage).Execute(); m_aParam.GrabFocus(); return 1L; diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 48dd475f6b18..fa7f1b78762c 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -50,16 +50,16 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; -void Replace_OS_PlaceHolder(String& aString) +void Replace_OS_PlaceHolder(OUString& aString) { - while (aString.SearchAndReplace( '*', '%' ) != STRING_NOTFOUND) ; - while (aString.SearchAndReplace( '?', '_' ) != STRING_NOTFOUND) ; + aString = aString.replaceAll( "*", "%" ); + aString = aString.replaceAll( "?", "_" ); } -void Replace_SQL_PlaceHolder(String& aString) +void Replace_SQL_PlaceHolder(OUString& aString) { - while (aString.SearchAndReplace( '%', '*' ) != STRING_NOTFOUND) ; - while (aString.SearchAndReplace( '_', '?' ) != STRING_NOTFOUND) ; + aString = aString.replaceAll( "%", "*" ); + aString = aString.replaceAll( "_", "?" ); } DBG_NAME(DlgFilterCrit); @@ -207,11 +207,11 @@ DlgFilterCrit::~DlgFilterCrit() #define LbText(x) ((x).GetSelectEntry()) #define LbPos(x) ((x).GetSelectEntryPos()) -sal_Int32 DlgFilterCrit::GetOSQLPredicateType( const String& _rSelectedPredicate ) const +sal_Int32 DlgFilterCrit::GetOSQLPredicateType( const OUString& _rSelectedPredicate ) const { sal_Int32 nPredicateIndex = -1; for ( xub_StrLen i=0; i < comphelper::string::getTokenCount(aSTR_COMPARE_OPERATORS, ';'); ++i) - if ( aSTR_COMPARE_OPERATORS.GetToken(i) == _rSelectedPredicate ) + if ( aSTR_COMPARE_OPERATORS.getToken(i, ';') == _rSelectedPredicate ) { nPredicateIndex = i; break; @@ -356,7 +356,7 @@ sal_Bool DlgFilterCrit::getCondition(const ListBox& _rField,const ListBox& _rCom _rFilter.Handle = GetOSQLPredicateType( _rComp.GetSelectEntry() ); if ( SQLFilterOperator::SQLNULL != _rFilter.Handle && _rFilter.Handle != SQLFilterOperator::NOT_SQLNULL ) { - String sPredicateValue = m_aPredicateInput.getPredicateValue( _rValue.GetText(), getMatchingColumn( _rValue ), sal_False ); + OUString sPredicateValue = m_aPredicateInput.getPredicateValue( _rValue.GetText(), getMatchingColumn( _rValue ), sal_False ); if ( _rFilter.Handle == SQLFilterOperator::LIKE || _rFilter.Handle == SQLFilterOperator::NOT_LIKE ) ::Replace_OS_PlaceHolder( sPredicateValue ); @@ -469,7 +469,7 @@ void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const PropertyValue& _rItem,sal_Boo DBG_CHKTHIS(DlgFilterCrit,NULL); OUString aCondition; _rItem.Value >>= aCondition; - String aStr = aCondition; + OUString aStr = aCondition; if ( _rItem.Handle == SQLFilterOperator::LIKE || _rItem.Handle == SQLFilterOperator::NOT_LIKE ) ::Replace_SQL_PlaceHolder(aStr); @@ -484,31 +484,31 @@ void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const PropertyValue& _rItem,sal_Boo // aStr.Erase(0,1); break; case SQLFilterOperator::NOT_EQUAL: - aStr.Erase(0,2); + aStr = aStr.copy(2); break; case SQLFilterOperator::LESS: - aStr.Erase(0,1); + aStr = aStr.copy(1); break; case SQLFilterOperator::LESS_EQUAL: - aStr.Erase(0,2); + aStr = aStr.copy(2); break; case SQLFilterOperator::GREATER: - aStr.Erase(0,1); + aStr = aStr.copy(1); break; case SQLFilterOperator::GREATER_EQUAL: - aStr.Erase(0,2); + aStr = aStr.copy(2); break; case SQLFilterOperator::NOT_LIKE: - aStr.Erase(0,8); + aStr = aStr.copy(8); break; case SQLFilterOperator::LIKE: - aStr.Erase(0,4); + aStr = aStr.copy(4); break; case SQLFilterOperator::SQLNULL: - aStr.Erase(0,7); + aStr = aStr.copy(7); break; case SQLFilterOperator::NOT_SQLNULL: - aStr.Erase(0,11); + aStr = aStr.copy(11); break; } aStr = comphelper::string::stripStart(aStr, ' '); @@ -561,7 +561,7 @@ void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const PropertyValue& _rItem,sal_Boo } } -void DlgFilterCrit::SelectField( ListBox& rBox, const String& rField ) +void DlgFilterCrit::SelectField( ListBox& rBox, const OUString& rField ) { DBG_CHKTHIS(DlgFilterCrit,NULL); sal_uInt16 nCnt = rBox.GetEntryCount(); @@ -683,7 +683,7 @@ void DlgFilterCrit::EnableLines() IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) { - String aName; + OUString aName; ListBox* pComp; if(pListBox == &aLB_WHEREFIELD1) { @@ -713,20 +713,20 @@ IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) if(eColumnSearch == ColumnSearch::FULL) { for(xub_StrLen i=0;i < comphelper::string::getTokenCount(aSTR_COMPARE_OPERATORS, ';');i++) - pComp->InsertEntry(aSTR_COMPARE_OPERATORS.GetToken(i)); + pComp->InsertEntry(aSTR_COMPARE_OPERATORS.getToken(i, ';')); } else if(eColumnSearch == ColumnSearch::CHAR) { for(xub_StrLen i=6;i<10;i++) - pComp->InsertEntry(aSTR_COMPARE_OPERATORS.GetToken(i)); + pComp->InsertEntry(aSTR_COMPARE_OPERATORS.getToken(i, ';')); } else if(eColumnSearch == ColumnSearch::BASIC) { xub_StrLen i; for( i = 0; i < 6; i++ ) - pComp->InsertEntry(aSTR_COMPARE_OPERATORS.GetToken(i)); + pComp->InsertEntry(aSTR_COMPARE_OPERATORS.getToken(i, ';')); for(i=8; i < comphelper::string::getTokenCount(aSTR_COMPARE_OPERATORS, ';'); ++i) - pComp->InsertEntry(aSTR_COMPARE_OPERATORS.GetToken(i)); + pComp->InsertEntry(aSTR_COMPARE_OPERATORS.getToken(i, ';')); } else { diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index d7d4ba33edf4..8c9ce5c4708c 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -234,7 +234,7 @@ OUString DlgOrderCrit::GetOrderList( ) const if(!sOrder.isEmpty()) sOrder += OUString(","); - String sName = m_aColumnList[i]->GetSelectEntry(); + OUString sName = m_aColumnList[i]->GetSelectEntry(); sOrder += ::dbtools::quoteName(sQuote,sName); if(m_aValueList[i]->GetSelectEntryPos()) sOrder += sDESC; diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 214a1d3ed3a3..a55a961a0395 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -67,7 +67,7 @@ namespace class ILabelProvider { public: - virtual String getLabel() const = 0; + virtual OUString getLabel() const = 0; virtual ~ILabelProvider() { }; }; @@ -96,14 +96,14 @@ namespace class LabelProvider : public ILabelProvider { private: - String m_label; + OUString m_label; public: LabelProvider( sal_uInt16 _labelResourceID ) :m_label( ModuleRes( _labelResourceID ) ) { } - virtual String getLabel() const + virtual OUString getLabel() const { return m_label; } @@ -187,9 +187,9 @@ namespace bool bSubEntry; - String sMessage; - String sSQLState; - String sErrorCode; + OUString sMessage; + OUString sSQLState; + OUString sErrorCode; ExceptionDisplayInfo() : eType( SQLExceptionInfo::UNDEFINED ), bSubEntry( false ) { } ExceptionDisplayInfo( SQLExceptionInfo::TYPE _eType ) : eType( _eType ), bSubEntry( false ) { } @@ -197,9 +197,9 @@ namespace static bool lcl_hasDetails( const ExceptionDisplayInfo& _displayInfo ) { - return ( _displayInfo.sErrorCode.Len() ) - || ( _displayInfo.sSQLState.Len() - && !_displayInfo.sSQLState.EqualsAscii( "S1000" ) + return ( !_displayInfo.sErrorCode.isEmpty() ) + || ( !_displayInfo.sSQLState.isEmpty() + && !_displayInfo.sSQLState.equalsAscii( "S1000" ) ); } @@ -251,7 +251,7 @@ namespace if ( pCurrentError->ErrorCode ) aDisplayInfo.sErrorCode = OUString::number( pCurrentError->ErrorCode ); - if ( !aDisplayInfo.sMessage.Len() + if ( aDisplayInfo.sMessage.isEmpty() && !lcl_hasDetails( aDisplayInfo ) ) { @@ -300,8 +300,8 @@ class OExceptionChainDialog : public ModalDialog MultiLineEdit m_aExceptionText; OKButton m_aOK; - String m_sStatusLabel; - String m_sErrorCodeLabel; + OUString m_sStatusLabel; + OUString m_sErrorCodeLabel; ExceptionDisplayChain m_aExceptions; @@ -326,8 +326,8 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi { DBG_CTOR(OExceptionChainDialog,NULL); - m_sStatusLabel = String( ModuleRes( STR_EXCEPTION_STATUS ) ); - m_sErrorCodeLabel = String( ModuleRes( STR_EXCEPTION_ERRORCODE ) ); + m_sStatusLabel = ModuleRes( STR_EXCEPTION_STATUS ); + m_sErrorCodeLabel = ModuleRes( STR_EXCEPTION_ERRORCODE ); FreeResource(); @@ -349,7 +349,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi ) { lcl_insertExceptionEntry( m_aExceptionList, elementPos, *loop ); - bHave22018 = loop->sSQLState.EqualsAscii( "22018" ); + bHave22018 = loop->sSQLState.equalsAscii( "22018" ); } // if the error has the code 22018, then add an additional explanation @@ -359,7 +359,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi ProviderFactory aProviderFactory; ExceptionDisplayInfo aInfo22018; - aInfo22018.sMessage = String( ModuleRes( STR_EXPLAN_STRINGCONVERSION_ERROR ) ); + aInfo22018.sMessage = ModuleRes( STR_EXPLAN_STRINGCONVERSION_ERROR ); aInfo22018.pLabelProvider = aProviderFactory.getLabelProvider( SQLExceptionInfo::SQL_CONTEXT, false ); aInfo22018.pImageProvider = aProviderFactory.getImageProvider( SQLExceptionInfo::SQL_CONTEXT ); m_aExceptions.push_back( aInfo22018 ); @@ -385,7 +385,7 @@ IMPL_LINK_NOARG(OExceptionChainDialog, OnExceptionSelected) size_t pos = reinterpret_cast< size_t >( pSelected->GetUserData() ); const ExceptionDisplayInfo& aExceptionInfo( m_aExceptions[ pos ] ); - if ( aExceptionInfo.sSQLState.Len() ) + if ( !aExceptionInfo.sSQLState.isEmpty() ) { sText += m_sStatusLabel; sText += ": "; @@ -393,7 +393,7 @@ IMPL_LINK_NOARG(OExceptionChainDialog, OnExceptionSelected) sText += "\n"; } - if ( aExceptionInfo.sErrorCode.Len() ) + if ( !aExceptionInfo.sErrorCode.isEmpty() ) { sText += m_sErrorCodeLabel; sText += ": "; @@ -464,7 +464,7 @@ void OSQLMessageBox::impl_positionControls() const ExceptionDisplayInfo& rFirstInfo = *m_pImpl->aDisplayInfo.begin(); if ( m_pImpl->aDisplayInfo.size() > 1 ) pSecondInfo = &m_pImpl->aDisplayInfo[1]; - String sPrimary, sSecondary; + OUString sPrimary, sSecondary; sPrimary = rFirstInfo.sMessage; // one or two texts to display? if ( pSecondInfo ) @@ -503,7 +503,7 @@ void OSQLMessageBox::impl_positionControls() lcl_positionInAppFont( *this, m_aMessage, TEXT_POS_X, OUTER_MARGIN + 16 + 3, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 8 ); Rectangle aSecondaryRect( m_aMessage.GetPosPixel(), m_aMessage.GetSizePixel() ); - bool bHaveSecondaryText = sSecondary.Len() != 0; + bool bHaveSecondaryText = !sSecondary.isEmpty(); // determine which space the secondary text would occupy if ( bHaveSecondaryText ) @@ -720,14 +720,14 @@ IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ ) // OSQLWarningBox OSQLWarningBox::OSQLWarningBox( Window* _pParent, const OUString& _rMessage, WinBits _nStyle, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo ) - :OSQLMessageBox( _pParent, String( ModuleRes( STR_EXCEPTION_WARNING ) ), _rMessage, _nStyle, OSQLMessageBox::Warning, _pAdditionalErrorInfo ) + :OSQLMessageBox( _pParent, ModuleRes( STR_EXCEPTION_WARNING ), _rMessage, _nStyle, OSQLMessageBox::Warning, _pAdditionalErrorInfo ) { } // OSQLErrorBox OSQLErrorBox::OSQLErrorBox( Window* _pParent, const OUString& _rMessage, WinBits _nStyle, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo ) - :OSQLMessageBox( _pParent, String( ModuleRes( STR_EXCEPTION_ERROR ) ), _rMessage, _nStyle, OSQLMessageBox::Error, _pAdditionalErrorInfo ) + :OSQLMessageBox( _pParent, ModuleRes( STR_EXCEPTION_ERROR ), _rMessage, _nStyle, OSQLMessageBox::Error, _pAdditionalErrorInfo ) { } diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 84ac954342ce..245b6b95916b 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -235,9 +235,9 @@ DBG_NAME(OTableSubscriptionPage) // get the name of the data source we're working for SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); OSL_ENSURE(pNameItem, "OTableSubscriptionPage::implInitControls: missing the name attribute!"); - String sDSName = pNameItem->GetValue(); + OUString sDSName = pNameItem->GetValue(); - if (bValid && sDSName.Len() && !m_xCurrentConnection.is() ) + if (bValid && !sDSName.isEmpty() && !m_xCurrentConnection.is() ) { // get the current table list from the connection for the current settings // the PropertyValues for the current dialog settings @@ -270,7 +270,7 @@ DBG_NAME(OTableSubscriptionPage) // fill the table list with this connection information SQLExceptionInfo aErrorInfo; // the current DSN - String sURL; + OUString sURL; if ( m_pTablesDlg ) sURL = m_pTablesDlg->getConnectionURL(); @@ -424,8 +424,8 @@ DBG_NAME(OTableSubscriptionPage) const SvLBoxString* pRightTextItem = static_cast<const SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); - String sLeftText = pLeftTextItem->GetText(); - String sRightText = pRightTextItem->GetText(); + OUString sLeftText = pLeftTextItem->GetText(); + OUString sRightText = pRightTextItem->GetText(); sal_Int32 nCompareResult = 0; // equal by default @@ -441,7 +441,7 @@ DBG_NAME(OTableSubscriptionPage) } else // default behaviour if we do not have a collator -> do the simple string compare - nCompareResult = sLeftText.CompareTo(sRightText); + nCompareResult = sLeftText.compareTo(sRightText); return nCompareResult; } diff --git a/dbaccess/source/ui/inc/CollectionView.hxx b/dbaccess/source/ui/inc/CollectionView.hxx index 3ec0b8f5fc78..35e32a133197 100644 --- a/dbaccess/source/ui/inc/CollectionView.hxx +++ b/dbaccess/source/ui/inc/CollectionView.hxx @@ -43,7 +43,7 @@ namespace dbaui PushButton m_aPB_OK; CancelButton m_aPB_CANCEL; HelpButton m_aPB_HELP; - String m_sPath; + OUString m_sPath; ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent> m_xContent; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; Size m_aDlgSize; diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index 4f5e4e30396d..9fa065133e3c 100644 --- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx +++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx @@ -38,8 +38,8 @@ namespace dbaui ::std::vector<OTypeInfoMap::iterator> m_aDestTypeInfoIndex; mutable TOTypeInfoSP m_pTypeInfo; // default type - String m_sTypeNames; // these type names are the ones out of the resource file - OUString m_sAutoIncrementValue; + OUString m_sTypeNames; // these type names are the ones out of the resource file + OUString m_sAutoIncrementValue; sal_Bool m_bAutoIncrementEnabled; protected: virtual void ActivateAggregate( EControlType eType ); diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx index 83e8310e1203..5505e0e1ee31 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -57,8 +57,8 @@ namespace dbaui sal_Bool RecalcLine(); void Draw( OutputDevice* pOutDev ); bool CheckHit( const Point& rMousePos ) const; - String GetSourceFieldName() const { return m_pData->GetSourceFieldName(); } - String GetDestFieldName() const { return m_pData->GetDestFieldName(); } + OUString GetSourceFieldName() const { return m_pData->GetSourceFieldName(); } + OUString GetDestFieldName() const { return m_pData->GetDestFieldName(); } sal_Bool IsValid() const; diff --git a/dbaccess/source/ui/inc/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx index 27d27a074eaa..64e5279ab398 100644 --- a/dbaccess/source/ui/inc/DExport.hxx +++ b/dbaccess/source/ui/inc/DExport.hxx @@ -84,9 +84,9 @@ namespace dbaui /// for saving the selected tablename OUString m_sDefaultTableName; - String m_sTextToken; ///< cell content - String m_sNumToken; ///< SDNUM value - String m_sValToken; ///< SDVAL value + OUString m_sTextToken; ///< cell content + OUString m_sNumToken; ///< SDNUM value + OUString m_sValToken; ///< SDVAL value TOTypeInfoSP m_pTypeInfo; ///< contains the default type const TColumnVector* m_pColumnList; const OTypeInfoMap* m_pInfoMap; @@ -109,7 +109,7 @@ namespace dbaui getTypeSelectionPageFactory() = 0; void CreateDefaultColumn(const OUString& _rColumnName); - sal_Int16 CheckString(const String& aToken, sal_Int16 _nOldNumberFormat); + sal_Int16 CheckString(const OUString& aToken, sal_Int16 _nOldNumberFormat); void adjustFormat(); void eraseTokens(); void insertValueIntoColumn(); diff --git a/dbaccess/source/ui/inc/FieldControls.hxx b/dbaccess/source/ui/inc/FieldControls.hxx index 46b703c602f7..344274f24a99 100644 --- a/dbaccess/source/ui/inc/FieldControls.hxx +++ b/dbaccess/source/ui/inc/FieldControls.hxx @@ -42,14 +42,14 @@ namespace dbaui { OModuleClient m_aModuleClient; short m_nPos; - String m_strHelpText; + OUString m_strHelpText; public: inline OPropColumnEditCtrl(Window* pParent, OUString& _rAllowedChars, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } - String GetHelp() const { return m_strHelpText; } + OUString GetHelp() const { return m_strHelpText; } virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { @@ -65,13 +65,13 @@ namespace dbaui :OSQLNameEdit(pParent, _rAllowedChars,nWinStyle) ,m_nPos(nPosition) { - m_strHelpText=String(ModuleRes(nHelpId)); + m_strHelpText = ModuleRes(nHelpId); } class OPropEditCtrl : public Edit { OModuleClient m_aModuleClient; short m_nPos; - String m_strHelpText; + OUString m_strHelpText; public: inline OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); @@ -80,7 +80,7 @@ namespace dbaui inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } - String GetHelp() const { return m_strHelpText; } + OUString GetHelp() const { return m_strHelpText; } virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { @@ -93,19 +93,19 @@ namespace dbaui :Edit(pParent, nWinStyle) ,m_nPos(nPosition) { - m_strHelpText =String(ModuleRes(nHelpId)); + m_strHelpText = ModuleRes(nHelpId); } inline OPropEditCtrl::OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :Edit(pParent, _rRes) ,m_nPos(nPosition) { - m_strHelpText =String(ModuleRes(nHelpId)); + m_strHelpText = ModuleRes(nHelpId); } class OPropNumericEditCtrl : public NumericField { - short m_nPos; - String m_strHelpText; + short m_nPos; + OUString m_strHelpText; public: inline OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); @@ -114,7 +114,7 @@ namespace dbaui inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } - String GetHelp() const { return m_strHelpText; } + OUString GetHelp() const { return m_strHelpText; } virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { @@ -127,19 +127,19 @@ namespace dbaui :NumericField(pParent, nWinStyle) ,m_nPos(nPosition) { - m_strHelpText =String(ModuleRes(nHelpId)); + m_strHelpText = ModuleRes(nHelpId); } inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :NumericField(pParent, _rRes) ,m_nPos(nPosition) { - m_strHelpText =String(ModuleRes(nHelpId)); + m_strHelpText = ModuleRes(nHelpId); } class OPropListBoxCtrl : public ListBox { - short m_nPos; - String m_strHelpText; + short m_nPos; + OUString m_strHelpText; public: inline OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); @@ -148,7 +148,7 @@ namespace dbaui inline sal_Bool IsModified() const { return GetSelectEntryPos() != GetSavedValue(); } short GetPos() const { return m_nPos; } - String GetHelp() const { return m_strHelpText; } + OUString GetHelp() const { return m_strHelpText; } virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { @@ -161,13 +161,13 @@ namespace dbaui :ListBox(pParent, nWinStyle) ,m_nPos(nPosition) { - m_strHelpText =String(ModuleRes(nHelpId)); + m_strHelpText = ModuleRes(nHelpId); } inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :ListBox(pParent, _rRes) ,m_nPos(nPosition) { - m_strHelpText =String(ModuleRes(nHelpId)); + m_strHelpText = ModuleRes(nHelpId); } } #endif // DBAUI_FIELDCONTROLS_HXX diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index c05021a52aaf..ce8a04acd36c 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -165,8 +165,8 @@ namespace dbaui virtual sal_Bool isAutoIncrementValueEnabled() const = 0; virtual OUString getAutoIncrementValue() const = 0; - String BoolStringPersistent(const String& rUIString) const; - String BoolStringUI(const String& rPersistentString) const; + OUString BoolStringPersistent(const OUString& rUIString) const; + OUString BoolStringUI(const OUString& rPersistentString) const; const OPropColumnEditCtrl* getColumnCtrl() const { return m_pColumnName; } @@ -181,8 +181,8 @@ namespace dbaui void SaveData( OFieldDescription* pFieldDescr ); - void SetControlText( sal_uInt16 nControlId, const String& rText ); - String GetControlText( sal_uInt16 nControlId ); + void SetControlText( sal_uInt16 nControlId, const OUString& rText ); + OUString GetControlText( sal_uInt16 nControlId ); void SetReadOnly( sal_Bool bReadOnly ); // when resize is called @@ -203,7 +203,7 @@ namespace dbaui virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() = 0; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() = 0; - String getControlDefault( const OFieldDescription* _pFieldDescr ,sal_Bool _bCheck = sal_True) const; + OUString getControlDefault( const OFieldDescription* _pFieldDescr ,sal_Bool _bCheck = sal_True) const; inline void setEditWidth(sal_Int32 _nWidth) { m_nWidth = _nWidth; } }; diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx index 6a833b29f7a0..b3f02dfbd56d 100644 --- a/dbaccess/source/ui/inc/GeneralUndo.hxx +++ b/dbaccess/source/ui/inc/GeneralUndo.hxx @@ -33,11 +33,11 @@ namespace dbaui OModuleClient m_aModuleClient; protected: - String m_strComment; // undo, redo comment + OUString m_strComment; // undo, redo comment public: TYPEINFO(); - OCommentUndoAction(sal_uInt16 nCommentID) { m_strComment = String(ModuleRes(nCommentID)); } + OCommentUndoAction(sal_uInt16 nCommentID) { m_strComment = OUString(ModuleRes(nCommentID)); } virtual OUString GetComment() const { return m_strComment; } }; diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx index 941d15961452..6bb100a3ff39 100644 --- a/dbaccess/source/ui/inc/HtmlReader.hxx +++ b/dbaccess/source/ui/inc/HtmlReader.hxx @@ -29,7 +29,7 @@ namespace dbaui { class OHTMLReader : public HTMLParser, public ODatabaseExport { - String m_sCurrent; + OUString m_sCurrent; sal_Int32 m_nTableCount; sal_Int16 m_nWidth; sal_Int16 m_nColumnWidth; ///< maximum column width diff --git a/dbaccess/source/ui/inc/JoinExchange.hxx b/dbaccess/source/ui/inc/JoinExchange.hxx index e3c6678faf95..31b823e01f7b 100644 --- a/dbaccess/source/ui/inc/JoinExchange.hxx +++ b/dbaccess/source/ui/inc/JoinExchange.hxx @@ -33,7 +33,7 @@ namespace dbaui typedef ::cppu::ImplHelper1< ::com::sun::star::lang::XUnoTunnel > OJoinExchObj_Base; class OJoinExchObj : public TransferableHelper, public OJoinExchObj_Base { - static String m_sJoinFormat; + static OUString m_sJoinFormat; sal_Bool m_bFirstEntry; protected: diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 0f5dc7e24c49..045e43508c7b 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -167,7 +167,7 @@ namespace dbaui Point GetScrollOffset() const { return m_aScrollOffset; } OJoinDesignView* getDesignView() const { return m_pView; } - OTableWindow* GetTabWindow( const String& rName ); + OTableWindow* GetTabWindow( const OUString& rName ); OTableConnection* GetSelectedConn() { return m_pSelectedConn; } /** @note NULL is explicitly allowed (then no-op) */ diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx index 0714cbfabab3..3d6b48eb0634 100644 --- a/dbaccess/source/ui/inc/QueryTableView.hxx +++ b/dbaccess/source/ui/inc/QueryTableView.hxx @@ -29,9 +29,9 @@ namespace dbaui { enum ACTION_TYPE { AT_ADDED_WIN, AT_REMOVED_WIN }; ACTION_TYPE atActionPerformed; - String strAffectedTable; + OUString strAffectedTable; - TabWinsChangeNotification(ACTION_TYPE at, const String& str) : atActionPerformed(at), strAffectedTable(str) { } + TabWinsChangeNotification(ACTION_TYPE at, const OUString& str) : atActionPerformed(at), strAffectedTable(str) { } }; class OQueryTabWinUndoAct; @@ -69,8 +69,8 @@ namespace dbaui /// AddTabWin, setting an alias void AddTabWin(const OUString& strDatabase, const OUString& strTableName, const OUString& strAlias, sal_Bool bNewTable = sal_False); /// search TabWin - OQueryTableWindow* FindTable(const String& rAliasName); - sal_Bool FindTableFromField(const String& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt); + OQueryTableWindow* FindTable(const OUString& rAliasName); + sal_Bool FindTableFromField(const OUString& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt); /// base class overwritten: create and delete Connections virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest); @@ -96,7 +96,7 @@ namespace dbaui virtual void EnsureVisible(const OTableWindow* _pWin); /// how many tables with a certain alias do I already have? - sal_Int32 CountTableAlias(const String& rName, sal_Int32& rMax); + sal_Int32 CountTableAlias(const OUString& rName, sal_Int32& rMax); /// insert field (simply passed to parents) void InsertField(const OTableFieldDescRef& rInfo); diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx index 72d27f5efa01..72db44fdb8d4 100644 --- a/dbaccess/source/ui/inc/RelationControl.hxx +++ b/dbaccess/source/ui/inc/RelationControl.hxx @@ -39,8 +39,8 @@ namespace dbaui ORelationControl* m_pRC_Tables; const OJoinTableView::OTableWindowMap* m_pTableMap; IRelationControlInterface* m_pParentDialog; - String m_strCurrentLeft; - String m_strCurrentRight; + OUString m_strCurrentLeft; + OUString m_strCurrentRight; private: DECL_LINK( OnTableChanged, ListBox* ); public: diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx index dd65a4d5f55b..5e8220b9d75f 100644 --- a/dbaccess/source/ui/inc/TableConnectionData.hxx +++ b/dbaccess/source/ui/inc/TableConnectionData.hxx @@ -41,7 +41,7 @@ namespace dbaui protected: TTableWindowData::value_type m_pReferencingTable; TTableWindowData::value_type m_pReferencedTable; - String m_aConnName; + OUString m_aConnName; OConnectionLineDataVec m_vConnLineData; @@ -55,7 +55,7 @@ namespace dbaui OTableConnectionData(); OTableConnectionData( const TTableWindowData::value_type& _pReferencingTable, const TTableWindowData::value_type& _pReferencedTable, - const String& rConnName = String() ); + const OUString& rConnName = OUString() ); OTableConnectionData( const OTableConnectionData& rConnData ); virtual ~OTableConnectionData(); @@ -70,7 +70,7 @@ namespace dbaui */ virtual OTableConnectionData* NewInstance() const; - sal_Bool SetConnLine( sal_uInt16 nIndex, const String& rSourceFieldName, const String& rDestFieldName ); + sal_Bool SetConnLine( sal_uInt16 nIndex, const OUString& rSourceFieldName, const OUString& rDestFieldName ); sal_Bool AppendConnLine( const OUString& rSourceFieldName, const OUString& rDestFieldName ); /** Deletes list of ConnLines */ @@ -94,9 +94,9 @@ namespace dbaui inline void setReferencingTable(const TTableWindowData::value_type& _pTable) { m_pReferencingTable = _pTable; } inline void setReferencedTable(const TTableWindowData::value_type& _pTable) { m_pReferencedTable = _pTable; } - String GetConnName() const { return m_aConnName; } + OUString GetConnName() const { return m_aConnName; } - virtual void SetConnName( const String& rConnName ){ m_aConnName = rConnName; } + virtual void SetConnName( const OUString& rConnName ){ m_aConnName = rConnName; } /** Update create a new connection @return true if successful diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx index d6097fad863b..4933cfb2ceda 100644 --- a/dbaccess/source/ui/inc/TableController.hxx +++ b/dbaccess/source/ui/inc/TableController.hxx @@ -48,7 +48,7 @@ namespace dbaui OUString m_sSchemaName; // schema for update data OUString m_sName; // table for update data OUString m_sAutoIncrementValue; // the autoincrement value set in the datasource - String m_sTypeNames; // these type names are the ones out of the resource file + OUString m_sTypeNames; // these type names are the ones out of the resource file TOTypeInfoSP m_pTypeInfo; // fall back when type is unknown because database driver has a failure sal_Bool m_bAllowAutoIncrementValue; // no : 1 NO BIT , is true when the datasource has a AutoIncrementValue property in their info property @@ -59,7 +59,7 @@ namespace dbaui void assignTable(); // set the table if a name is given void loadData(); sal_Bool checkColumns(sal_Bool _bNew) throw(::com::sun::star::sdbc::SQLException); // check if we have double column names - String createUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxTables,const String& _rDefault); + OUString createUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxTables,const OUString& _rDefault); void appendColumns(::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier>& _rxColSup,sal_Bool _bNew,sal_Bool _bKeyColumns = sal_False); void appendPrimaryKey(::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XKeysSupplier>& _rxSup,sal_Bool _bNew); void alterColumns(); diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx index 5aae3c55deeb..b444fe53b499 100644 --- a/dbaccess/source/ui/inc/TableDesignControl.hxx +++ b/dbaccess/source/ui/inc/TableDesignControl.hxx @@ -52,8 +52,8 @@ namespace dbaui virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0; virtual ::com::sun::star::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0; - virtual void SetControlText( long nRow, sal_uInt16 nColId, const String& rText ) = 0; - virtual String GetControlText( long nRow, sal_uInt16 nColId ) = 0; + virtual void SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) = 0; + virtual OUString GetControlText( long nRow, sal_uInt16 nColId ) = 0; virtual OTableDesignView* GetView() const = 0; diff --git a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx index 2d1865d98171..696113f0fe49 100644 --- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx +++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx @@ -33,7 +33,7 @@ namespace dbaui class OTableDesignHelpBar : public TabPage, public IClipboardTest { private: - String m_sHelpText; + OUString m_sHelpText; MultiLineEdit* m_pTextWin; protected: @@ -43,8 +43,8 @@ namespace dbaui OTableDesignHelpBar( Window* pParent ); virtual ~OTableDesignHelpBar(); - void SetHelpText( const String& rText ); - String GetHelpText() const { return m_sHelpText; } + void SetHelpText( const OUString& rText ); + OUString GetHelpText() const { return m_sHelpText; } virtual long PreNotify( NotifyEvent& rNEvt ); diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx index 3f9bdf6b9b24..d61d733637ca 100644 --- a/dbaccess/source/ui/inc/TableWindow.hxx +++ b/dbaccess/source/ui/inc/TableWindow.hxx @@ -136,7 +136,7 @@ namespace dbaui void SetSizePixel( const Size& rNewSize ); void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ); - String getTitle() const; + OUString getTitle() const; void SetBoldTitle( sal_Bool bBold ); void setActive(sal_Bool _bActive = sal_True); diff --git a/dbaccess/source/ui/inc/TablesSingleDlg.hxx b/dbaccess/source/ui/inc/TablesSingleDlg.hxx index 6e0638cae43a..4c32b7d38426 100644 --- a/dbaccess/source/ui/inc/TablesSingleDlg.hxx +++ b/dbaccess/source/ui/inc/TablesSingleDlg.hxx @@ -60,7 +60,7 @@ class ODbDataSourceAdministrationHelper; void successfullyConnected(); sal_Bool getCurrentSettings(::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rDriverParams); void clearPassword(); - String getConnectionURL() const; + OUString getConnectionURL() const; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getCurrentDataSource(); inline void endExecution() { m_bStopExecution = sal_True; } diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index b6cf5b8360d2..aeaeb79127c7 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -96,7 +96,7 @@ namespace dbaui ODatabaseImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const String& rExchange = String()); + const OUString& rExchange = OUString()); // import data ODatabaseImportExport( const SharedConnection& _rxConnection, @@ -136,7 +136,7 @@ namespace dbaui ORTFImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const String& rExchange = String()) + const OUString& rExchange = OUString()) : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) {}; // import data @@ -169,7 +169,7 @@ namespace dbaui void WriteHeader(); void WriteBody(); void WriteTables(); - void WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_Int32 nHeightPixel,const char* pChar,const String& rValue,const char* pHtmlTag); + void WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_Int32 nHeightPixel,const char* pChar,const OUString& rValue,const char* pHtmlTag); void IncIndent( sal_Int16 nVal ); const char* GetIndentStr() { return sIndent; } void FontOn(); @@ -180,7 +180,7 @@ namespace dbaui OHTMLImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const String& rExchange = String()); + const OUString& rExchange = OUString()); // import data OHTMLImportExport( const SharedConnection& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, @@ -215,7 +215,7 @@ namespace dbaui const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate >& _xResultSetUpdate, const ::svx::ODataAccessDescriptor& _aDataDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, - const String& rExchange = String()); + const OUString& rExchange = OUString()); // import data ORowSetImportExport(const SharedConnection& _rxConnection, diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 474685fc0502..479accd6bdad 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -117,7 +117,7 @@ namespace dbaui @param _rTypeInfoIters the vector filled with map iterators */ void fillTypeInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection, - const String& _rsTypeNames, + const OUString& _rsTypeNames, OTypeInfoMap& _rTypeInfoMap, ::std::vector<OTypeInfoMap::iterator>& _rTypeInfoIters); @@ -393,7 +393,7 @@ namespace dbaui Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XHierarchicalNameContainer>& _xNames, - const String& _sParentFolder, + const OUString& _sParentFolder, sal_Bool _bForm, sal_Bool _bCollection = sal_True, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent = NULL, diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx index 71bd4dbbc3f7..547e28bab107 100644 --- a/dbaccess/source/ui/inc/WCPage.hxx +++ b/dbaccess/source/ui/inc/WCPage.hxx @@ -63,8 +63,8 @@ namespace dbaui public: virtual void Reset(); virtual void ActivatePage(); - virtual sal_Bool LeavePage(); - virtual String GetTitle() const ; + virtual sal_Bool LeavePage(); + virtual OUString GetTitle() const ; OCopyTable( Window * pParent ); virtual ~OCopyTable(); @@ -74,7 +74,7 @@ namespace dbaui inline sal_Bool IsOptionAppendData() const { return m_aRB_AppendData.IsChecked(); } inline sal_Bool IsOptionView() const { return m_aRB_View.IsChecked(); } inline sal_Bool UseHeaderLine() const { return m_aCB_UseHeaderLine.IsChecked(); } - String GetKeyName() const { return m_edKeyName.GetText(); } + OUString GetKeyName() const { return m_edKeyName.GetText(); } void setCreateStyleAction(); inline void disallowViews() diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx index 71cb8c479d48..d9cec96724b6 100644 --- a/dbaccess/source/ui/inc/WColumnSelect.hxx +++ b/dbaccess/source/ui/inc/WColumnSelect.hxx @@ -78,7 +78,7 @@ namespace dbaui virtual void Reset ( ); virtual void ActivatePage(); virtual sal_Bool LeavePage(); - virtual String GetTitle() const ; + virtual OUString GetTitle() const ; OWizColumnSelect(Window* pParent); virtual ~OWizColumnSelect(); diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index 186aa872668f..0c6024bc1ebc 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -260,7 +260,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_xInteractionHandler; - String m_sTypeNames; // these type names are the ones out of the resource file + OUString m_sTypeNames; // these type names are the ones out of the resource file sal_uInt32 m_nPageCount; sal_Bool m_bDeleteSourceColumns; bool m_bInterConnectionCopy; // are we copying between different connections? diff --git a/dbaccess/source/ui/inc/WNameMatch.hxx b/dbaccess/source/ui/inc/WNameMatch.hxx index 486e6fd01be2..a715b8b3f6fa 100644 --- a/dbaccess/source/ui/inc/WNameMatch.hxx +++ b/dbaccess/source/ui/inc/WNameMatch.hxx @@ -73,7 +73,7 @@ namespace dbaui virtual void Reset ( ); virtual void ActivatePage(); virtual sal_Bool LeavePage(); - virtual String GetTitle() const ; + virtual OUString GetTitle() const ; OWizNameMatching(Window* pParent); virtual ~OWizNameMatching(); diff --git a/dbaccess/source/ui/inc/WTabPage.hxx b/dbaccess/source/ui/inc/WTabPage.hxx index a97715b993d3..c1739dc84a44 100644 --- a/dbaccess/source/ui/inc/WTabPage.hxx +++ b/dbaccess/source/ui/inc/WTabPage.hxx @@ -37,7 +37,7 @@ namespace dbaui public: virtual void Reset ( ) = 0; virtual sal_Bool LeavePage() = 0; - virtual String GetTitle() const = 0; + virtual OUString GetTitle() const = 0; sal_Bool IsFirstTime() const { return m_bFirstTime; } }; diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index 56803b91badd..0af76d72dcd0 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -109,7 +109,7 @@ namespace dbaui virtual void ActivatePage( ); virtual void Resize(); virtual sal_Bool LeavePage(); - virtual String GetTitle() const; + virtual OUString GetTitle() const; OWizTypeSelect(Window* pParent, SvStream* _pStream = NULL ); virtual ~OWizTypeSelect(); diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index c6c5e9137bfe..94dd32ab6079 100644 --- a/dbaccess/source/ui/inc/adtabdlg.hxx +++ b/dbaccess/source/ui/inc/adtabdlg.hxx @@ -42,7 +42,7 @@ namespace dbaui { public: virtual void updateTableObjectList( bool _bAllowViews ) = 0; - virtual String getSelectedName( String& _out_rAliasName ) const = 0; + virtual OUString getSelectedName( OUString& _out_rAliasName ) const = 0; virtual bool isLeafSelected() const = 0; virtual ~TableObjectListFacade(); @@ -56,7 +56,7 @@ namespace dbaui virtual bool allowViews() const = 0; virtual bool allowQueries() const = 0; virtual bool allowAddition() const = 0; - virtual void addTableWindow( const String& _rQualifiedTableName, const String& _rAliasName ) = 0; + virtual void addTableWindow( const OUString& _rQualifiedTableName, const OUString& _rAliasName ) = 0; virtual void onWindowClosing( const Window* _pWindow ) = 0; protected: @@ -95,7 +95,7 @@ namespace dbaui void DetermineAddTable() { aAddButton.Enable( impl_isAddAllowed() ); } void Update(); - static String getDialogTitleForContext( + static OUString getDialogTitleForContext( IAddTableDialogContext& _rContext ); private: diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx index 262f2e70a01f..0f2efdec9479 100644 --- a/dbaccess/source/ui/inc/charsetlistbox.hxx +++ b/dbaccess/source/ui/inc/charsetlistbox.hxx @@ -36,7 +36,7 @@ namespace dbaui CharSetListBox( Window* _pParent, const ResId& _rResId ); ~CharSetListBox(); - void SelectEntryByIanaName( const String& _rIanaName ); + void SelectEntryByIanaName( const OUString& _rIanaName ); bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ); private: diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx index 4006f403f164..14abf5862256 100644 --- a/dbaccess/source/ui/inc/curledit.hxx +++ b/dbaccess/source/ui/inc/curledit.hxx @@ -38,8 +38,8 @@ class OConnectionURLEdit : public Edit ::dbaccess::ODsnTypeCollection* m_pTypeCollection; FixedText* m_pForcedPrefix; - String m_sSaveValueNoPrefix; - sal_Bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not + OUString m_sSaveValueNoPrefix; + sal_Bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not public: OConnectionURLEdit(Window* pParent, const ResId& rResId,sal_Bool _bShowPrefix = sal_False); @@ -57,13 +57,13 @@ public: */ void ShowPrefix(sal_Bool _bShowPrefix); /// get the currently set text, excluding the prefix indicating the type - virtual String GetTextNoPrefix() const; + virtual OUString GetTextNoPrefix() const; /// set a new text, leave the current prefix unchanged - virtual void SetTextNoPrefix(const String& _rText); + virtual void SetTextNoPrefix(const OUString& _rText); - inline void SaveValueNoPrefix() { m_sSaveValueNoPrefix = GetTextNoPrefix(); } - inline String GetSavedValueNoPrefix() const { return m_sSaveValueNoPrefix; } - inline void SetTypeCollection(::dbaccess::ODsnTypeCollection* _pTypeCollection) { m_pTypeCollection = _pTypeCollection; } + inline void SaveValueNoPrefix() { m_sSaveValueNoPrefix = GetTextNoPrefix(); } + inline OUString GetSavedValueNoPrefix() const { return m_sSaveValueNoPrefix; } + inline void SetTypeCollection(::dbaccess::ODsnTypeCollection* _pTypeCollection) { m_pTypeCollection = _pTypeCollection; } }; } // namespace dbaui diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index 0bd0badc5d96..2b03cce4618c 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -104,7 +104,7 @@ namespace dbaui // (normally, the expand handler is called only once) void EnableExpandHandler(SvTreeListEntry* _pEntry); - SvTreeListEntry* GetEntryPosByName( const String& aName, SvTreeListEntry* pStart = NULL, const IEntryFilter* _pFilter = NULL ) const; + SvTreeListEntry* GetEntryPosByName( const OUString& aName, SvTreeListEntry* pStart = NULL, const IEntryFilter* _pFilter = NULL ) const; virtual void RequestingChildren( SvTreeListEntry* pParent ); virtual void SelectHdl(); virtual void DeselectHdl(); diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index 697b9a0cb85e..fd20d553c807 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -69,22 +69,22 @@ private: sal_Bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing sal_Bool m_bUIEnabled : 1; /// <TRUE/> if the UI is enabled, false otherwise. Cannot be switched back to <TRUE/>, once it is <FALSE/> sal_Bool m_bIsConnectable : 1; - String m_sRM_IntroText; - String m_sRM_dBaseText; - String m_sRM_TextText; - String m_sRM_MSAccessText; - String m_sRM_LDAPText; - String m_sRM_ADOText; - String m_sRM_JDBCText; - String m_sRM_MySQLNativePageTitle; - String m_sRM_OracleText; - String m_sRM_MySQLText; - String m_sRM_ODBCText; - String m_sRM_SpreadSheetText; - String m_sRM_AuthentificationText; - String m_sRM_FinalText; + OUString m_sRM_IntroText; + OUString m_sRM_dBaseText; + OUString m_sRM_TextText; + OUString m_sRM_MSAccessText; + OUString m_sRM_LDAPText; + OUString m_sRM_ADOText; + OUString m_sRM_JDBCText; + OUString m_sRM_MySQLNativePageTitle; + OUString m_sRM_OracleText; + OUString m_sRM_MySQLText; + OUString m_sRM_ODBCText; + OUString m_sRM_SpreadSheetText; + OUString m_sRM_AuthentificationText; + OUString m_sRM_FinalText; INetURLObject m_aDocURL; - String m_sWorkPath; + OUString m_sWorkPath; OGeneralPageWizard* m_pGeneralPage; OMySQLIntroPageSetup* m_pMySQLIntroPage; OFinalDBPageSetup* m_pFinalPage; @@ -166,7 +166,7 @@ private: void RegisterDataSourceByLocation(const OUString& sPath); sal_Bool SaveDatabaseDocument(); void activateDatabasePath(); - String createUniqueFileName(const INetURLObject& rURL); + OUString createUniqueFileName(const INetURLObject& rURL); void CreateDatabase(); void createUniqueFolderName(INetURLObject* pURL); ::dbaccess::DATASOURCE_TYPE VerifyDataSourceType(const ::dbaccess::DATASOURCE_TYPE _DatabaseType) const; diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index 999854660e66..abbe61255316 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -56,7 +56,7 @@ namespace dbaui HelpButton* m_pHelp; PushButton* m_pClose; - typedef ::std::deque< String > StringQueue; + typedef ::std::deque< OUString > StringQueue; StringQueue m_aStatementHistory; // previous statements StringQueue m_aNormalizedHistory; // previous statements, normalized to be used in the list box @@ -90,19 +90,19 @@ namespace dbaui private: /// adds a statement to the statement history - void implAddToStatementHistory(const String& _rStatement); + void implAddToStatementHistory(const OUString& _rStatement); /// ensures that our history has at most m_nHistoryLimit entries void implEnsureHistoryLimit(); /// executes the statement given, adds the status to the status list - void implExecuteStatement(const String& _rStatement); + void implExecuteStatement(const OUString& _rStatement); /// adds a status text to the status list - void addStatusText(const String& _rMessage); + void addStatusText(const OUString& _rMessage); /// adds a status text to the output list - void addOutputText(const String& _rMessage); + void addOutputText(const OUString& _rMessage); #ifdef DBG_UTIL const sal_Char* impl_CheckInvariants() const; diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index 57e6550618aa..ad3e6b2ac547 100644 --- a/dbaccess/source/ui/inc/dlgattr.hxx +++ b/dbaccess/source/ui/inc/dlgattr.hxx @@ -32,7 +32,7 @@ namespace dbaui class SbaSbAttrDlg : public SfxTabDialog { - String aTitle; + OUString aTitle; SvxNumberInfoItem* pNumberInfoItem; public: diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx index b705dfdcfb47..f0202a730612 100644 --- a/dbaccess/source/ui/inc/dlgsave.hxx +++ b/dbaccess/source/ui/inc/dlgsave.hxx @@ -54,26 +54,26 @@ namespace dbaui OSaveAsDlg( Window * pParent,const sal_Int32& _rType, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, - const String& rDefault, + const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags = SAD_DEFAULT | SAD_TITLE_STORE_AS); OSaveAsDlg( Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, - const String& _rDefault, - const String& _sLabel, + const OUString& _rDefault, + const OUString& _sLabel, const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags = SAD_DEFAULT | SAD_TITLE_STORE_AS); virtual ~OSaveAsDlg(); - String getName() const; - String getCatalog() const; - String getSchema() const; + OUString getName() const; + OUString getCatalog() const; + OUString getSchema() const; private: DECL_LINK(ButtonClickHdl, Button *); DECL_LINK(EditModifyHdl, Edit * ); - void implInitOnlyTitle(const String& _rLabel); + void implInitOnlyTitle(const OUString& _rLabel); void implInit(); }; } diff --git a/dbaccess/source/ui/inc/imageprovider.hxx b/dbaccess/source/ui/inc/imageprovider.hxx index 0e047041cf43..a6c816dc8b7d 100644 --- a/dbaccess/source/ui/inc/imageprovider.hxx +++ b/dbaccess/source/ui/inc/imageprovider.hxx @@ -77,7 +77,7 @@ namespace dbaui the image to be used for the object. */ void getImages( - const String& _rName, + const OUString& _rName, const sal_Int32 _nDatabaseObjectType, Image& _out_rImage ); diff --git a/dbaccess/source/ui/inc/indexcollection.hxx b/dbaccess/source/ui/inc/indexcollection.hxx index e31039a769f4..3bc8024475b8 100644 --- a/dbaccess/source/ui/inc/indexcollection.hxx +++ b/dbaccess/source/ui/inc/indexcollection.hxx @@ -60,14 +60,14 @@ namespace dbaui Indexes::iterator end() { return m_aIndexes.end(); } // searching - Indexes::const_iterator find(const String& _rName) const; - Indexes::iterator find(const String& _rName); - Indexes::const_iterator findOriginal(const String& _rName) const; - Indexes::iterator findOriginal(const String& _rName); + Indexes::const_iterator find(const OUString& _rName) const; + Indexes::iterator find(const OUString& _rName); + Indexes::const_iterator findOriginal(const OUString& _rName) const; + Indexes::iterator findOriginal(const OUString& _rName); // inserting without committing // the OriginalName of the newly inserted index will be empty, thus indicating that it's new - Indexes::iterator insert(const String& _rName); + Indexes::iterator insert(const OUString& _rName); // commit a new index, which is already part if the collection, but does not have an equivalent in the // data source, yet void commitNewIndex(const Indexes::iterator& _rPos) SAL_THROW((::com::sun::star::sdbc::SQLException)); diff --git a/dbaccess/source/ui/inc/indexes.hxx b/dbaccess/source/ui/inc/indexes.hxx index abc3a0b418f5..72afcd4237d2 100644 --- a/dbaccess/source/ui/inc/indexes.hxx +++ b/dbaccess/source/ui/inc/indexes.hxx @@ -28,7 +28,7 @@ namespace dbaui // OIndexField struct OIndexField { - String sFieldName; + OUString sFieldName; sal_Bool bSortAscending; OIndexField() : bSortAscending(sal_True) { } diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx index 4465b3fc39ee..685b7a73fe25 100644 --- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx +++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx @@ -43,8 +43,8 @@ namespace dbaui ::svt::ListBoxControl* m_pSortingCell; ::svt::ListBoxControl* m_pFieldNameCell; - String m_sAscendingText; - String m_sDescendingText; + OUString m_sAscendingText; + OUString m_sDescendingText; sal_Int32 m_nMaxColumnsInIndex; sal_Bool m_bAddIndexAppendix; @@ -79,7 +79,7 @@ namespace dbaui void InitController(::svt::CellControllerRef&, long _nRow, sal_uInt16 _nColumnId); protected: - String GetRowCellText(const ConstIndexFieldsIterator& _rRow,sal_uInt16 nColId) const; + OUString GetRowCellText(const ConstIndexFieldsIterator& _rRow,sal_uInt16 nColId) const; sal_Bool implGetFieldDesc(long _nRow, ConstIndexFieldsIterator& _rPos); sal_Bool isNewField() const { return GetCurRow() >= (sal_Int32)m_aFields.size(); } diff --git a/dbaccess/source/ui/inc/linkeddocuments.hxx b/dbaccess/source/ui/inc/linkeddocuments.hxx index 1f77ed693bd2..f935ead58af6 100644 --- a/dbaccess/source/ui/inc/linkeddocuments.hxx +++ b/dbaccess/source/ui/inc/linkeddocuments.hxx @@ -51,9 +51,8 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI > m_xDocumentUI; Window* m_pDialogParent; - String m_sCurrentlyEditing; - OUString - m_sDataSourceName; + OUString m_sCurrentlyEditing; + OUString m_sDataSourceName; public: OLinkedDocumentsAccess( diff --git a/dbaccess/source/ui/inc/opendoccontrols.hxx b/dbaccess/source/ui/inc/opendoccontrols.hxx index 63501cb90a8c..9ebba29e4855 100644 --- a/dbaccess/source/ui/inc/opendoccontrols.hxx +++ b/dbaccess/source/ui/inc/opendoccontrols.hxx @@ -50,7 +50,7 @@ namespace dbaui class OpenDocumentListBox : public ListBox { private: - typedef ::std::pair< String, String > StringPair; + typedef ::std::pair< OUString, OUString > StringPair; typedef ::std::map< sal_uInt16, StringPair > MapIndexToStringPair; OUString m_sModule; @@ -59,8 +59,8 @@ namespace dbaui public: OpenDocumentListBox( Window* _pParent, const sal_Char* _pAsciiModuleName ); - String GetSelectedDocumentURL() const; - String GetSelectedDocumentFilter() const; + OUString GetSelectedDocumentURL() const; + OUString GetSelectedDocumentFilter() const; protected: virtual void RequestHelp( const HelpEvent& _rHEvt ); diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx index e87856d01fc8..48d07e98cb69 100644 --- a/dbaccess/source/ui/inc/queryfilter.hxx +++ b/dbaccess/source/ui/inc/queryfilter.hxx @@ -86,8 +86,8 @@ namespace dbaui OKButton aBT_OK; CancelButton aBT_CANCEL; HelpButton aBT_HELP; - String aSTR_NOENTRY; - String aSTR_COMPARE_OPERATORS; + OUString aSTR_NOENTRY; + OUString aSTR_COMPARE_OPERATORS; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xQueryComposer; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns; @@ -96,13 +96,13 @@ namespace dbaui ::dbtools::OPredicateInputController m_aPredicateInput; - void SelectField( ListBox& rBox, const String& rField ); + void SelectField( ListBox& rBox, const OUString& rField ); DECL_LINK( ListSelectHdl, ListBox * ); DECL_LINK( ListSelectCompHdl, ListBox * ); void SetLine( sal_uInt16 nIdx,const ::com::sun::star::beans::PropertyValue& _rItem,sal_Bool _bOr ); void EnableLines(); - sal_Int32 GetOSQLPredicateType( const String& _rSelectedPredicate ) const; + sal_Int32 GetOSQLPredicateType( const OUString& _rSelectedPredicate ) const; sal_uInt16 GetSelectionPos(sal_Int32 eType,const ListBox& rListBox) const; sal_Bool getCondition(const ListBox& _rField,const ListBox& _rComp,const Edit& _rValue,::com::sun::star::beans::PropertyValue& _rFilter) const; void fillLines(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& _aValues); diff --git a/dbaccess/source/ui/inc/queryorder.hxx b/dbaccess/source/ui/inc/queryorder.hxx index 9b32a4413275..98a20f084403 100644 --- a/dbaccess/source/ui/inc/queryorder.hxx +++ b/dbaccess/source/ui/inc/queryorder.hxx @@ -74,8 +74,8 @@ namespace dbaui CancelButton aBT_CANCEL; HelpButton aBT_HELP; FixedLine aFL_ORDER; - String aSTR_NOENTRY; - OUString m_sOrgOrder; + OUString aSTR_NOENTRY; + OUString m_sOrgOrder; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xQueryComposer; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns; diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 50a5dcb60860..3e0e39330c1f 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -42,7 +42,7 @@ namespace dbaui Timer m_timerInvalidate; Timer m_timerUndoActionCreation; Link m_lnkTextModifyHdl; - String m_strOrigText; // is restored on undo + OUString m_strOrigText; // is restored on undo OQueryTextView* m_pView; sal_Bool m_bAccelAction; // is set on cut, copy, paste sal_Bool m_bStopTimer; diff --git a/dbaccess/source/ui/inc/tabletree.hxx b/dbaccess/source/ui/inc/tabletree.hxx index d6edecd755c1..d57344c0ae1f 100644 --- a/dbaccess/source/ui/inc/tabletree.hxx +++ b/dbaccess/source/ui/inc/tabletree.hxx @@ -120,7 +120,7 @@ public: @param _pEntry the entry whose name is to be obtained. Must not denote a folder entry. */ - String getQualifiedTableName( SvTreeListEntry* _pEntry ) const; + OUString getQualifiedTableName( SvTreeListEntry* _pEntry ) const; SvTreeListEntry* getEntryByQualifiedName( const OUString& _rName ); diff --git a/dbaccess/source/ui/inc/undosqledit.hxx b/dbaccess/source/ui/inc/undosqledit.hxx index 2d913de33dfe..0878a7d378b2 100644 --- a/dbaccess/source/ui/inc/undosqledit.hxx +++ b/dbaccess/source/ui/inc/undosqledit.hxx @@ -30,7 +30,7 @@ namespace dbaui { protected: OSqlEdit* m_pOwner; - String m_strNextText; + OUString m_strNextText; virtual void Undo() { ToggleText(); } virtual void Redo() { ToggleText(); } @@ -39,7 +39,7 @@ namespace dbaui public: OSqlEditUndoAct(OSqlEdit* pEdit) : OCommentUndoAction(STR_QUERY_UNDO_MODIFYSQLEDIT), m_pOwner(pEdit) { } - void SetOriginalText(const String& strText) { m_strNextText =strText; } + void SetOriginalText(const OUString& strText) { m_strNextText =strText; } }; } #endif // DBAUI_UNDOSQLEDIT_HXX diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index ba82f993d8c0..1c8c649d6a78 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -313,7 +313,7 @@ void ODatabaseExport::insertValueIntoColumn() sal_Int32 nPos = m_vColumns[nNewPos].first; if ( nPos != COLUMN_POSITION_NOT_FOUND ) { - if ( !m_sTextToken.Len() && pField->IsNullable() ) + if ( m_sTextToken.isEmpty() && pField->IsNullable() ) m_pUpdateHelper->updateNull(nPos,pField->GetType()); else { @@ -325,7 +325,7 @@ void ODatabaseExport::insertValueIntoColumn() sal_Int32 nNumberFormat = 0; double fOutNumber = 0.0; bool bNumberFormatError = false; - if ( m_pFormatter && m_sNumToken.Len() ) + if ( m_pFormatter && !m_sNumToken.isEmpty() ) { LanguageType eNumLang = LANGUAGE_NONE; sal_uInt32 nNumberFormat2( nNumberFormat ); @@ -411,7 +411,7 @@ void ODatabaseExport::insertValueIntoColumn() } } -sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOldNumberFormat) +sal_Int16 ODatabaseExport::CheckString(const OUString& aCheckToken, sal_Int16 _nOldNumberFormat) { SAL_INFO("dbaccess.ui", "ODatabaseExport::CheckString" ); DBG_CHKTHIS(ODatabaseExport,NULL); @@ -424,7 +424,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl Reference< XNumberFormats > xFormats = xSupplier->getNumberFormats(); ensureFormatter(); - if ( m_pFormatter && m_sNumToken.Len() ) + if ( m_pFormatter && !m_sNumToken.isEmpty() ) { LanguageType eNumLang; sal_uInt32 nFormatKey(0); @@ -766,9 +766,9 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException SAL_INFO("dbaccess.ui", "ODatabaseExport::showErrorDialog" ); if(!m_bDontAskAgain) { - String aMsg(e.Message); - aMsg += '\n'; - aMsg += String( ModuleRes( STR_QRY_CONTINUE ) ); + OUString aMsg(e.Message); + aMsg += "\n"; + aMsg += ModuleRes( STR_QRY_CONTINUE ); OSQLWarningBox aBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ); if (aBox.Execute() == RET_YES) @@ -781,7 +781,7 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException void ODatabaseExport::adjustFormat() { SAL_INFO("dbaccess.ui", "ODatabaseExport::adjustFormat" ); - if ( m_sTextToken.Len() ) + if ( !m_sTextToken.isEmpty() ) { sal_Int32 nNewPos = m_bIsAutoIncrement ? m_nColumnPos+1 : m_nColumnPos; OSL_ENSURE((nNewPos) < static_cast<sal_Int32>(m_vColumns.size()),"Illegal index for vector"); @@ -794,7 +794,7 @@ void ODatabaseExport::adjustFormat() OSL_ENSURE((nColPos) < static_cast<sal_Int32>(m_vNumberFormat.size()),"m_vFormatKey: Illegal index for vector"); OSL_ENSURE((nColPos) < static_cast<sal_Int32>(m_vColumnSize.size()),"m_vColumnSize: Illegal index for vector"); m_vNumberFormat[nColPos] = CheckString(m_sTextToken,m_vNumberFormat[nColPos]); - m_vColumnSize[nColPos] = ::std::max<sal_Int32>((sal_Int32)m_vColumnSize[nColPos],(sal_Int32)m_sTextToken.Len()); + m_vColumnSize[nColPos] = ::std::max<sal_Int32>((sal_Int32)m_vColumnSize[nColPos], m_sTextToken.getLength()); } } eraseTokens(); @@ -804,9 +804,9 @@ void ODatabaseExport::adjustFormat() void ODatabaseExport::eraseTokens() { SAL_INFO("dbaccess.ui", "ODatabaseExport::eraseTokens" ); - m_sTextToken.Erase(); - m_sNumToken.Erase(); - m_sValToken.Erase(); + m_sTextToken = ""; + m_sNumToken = ""; + m_sValToken = ""; } void ODatabaseExport::ensureFormatter() diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index d3439342d398..540c5d387d94 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -198,14 +198,14 @@ void OHTMLReader::NextToken( int nToken ) m_sCurrent += m_sTextToken; break; case HTML_PARABREAK_ON: - m_sTextToken.Erase(); + m_sTextToken = ""; break; case HTML_TABLEDATA_ON: fetchOptions(); break; case HTML_TABLEDATA_OFF: { - if ( m_sCurrent.Len() ) + if ( !m_sCurrent.isEmpty() ) m_sTextToken = m_sCurrent; try { @@ -216,7 +216,7 @@ void OHTMLReader::NextToken( int nToken ) { showErrorDialog(e); } - m_sCurrent.Erase(); + m_sCurrent = ""; m_nColumnPos++; eraseTokens(); m_bSDNum = m_bInTbl = sal_False; @@ -272,23 +272,23 @@ void OHTMLReader::NextToken( int nToken ) m_sCurrent += m_sTextToken; break; case HTML_PARABREAK_ON: - m_sTextToken.Erase(); + m_sTextToken = ""; break; case HTML_TABLEDATA_OFF: - if ( m_sCurrent.Len() ) + if ( !m_sCurrent.isEmpty() ) m_sTextToken = m_sCurrent; adjustFormat(); m_nColumnPos++; m_bSDNum = m_bInTbl = sal_False; - m_sCurrent.Erase(); + m_sCurrent = ""; break; case HTML_TABLEROW_OFF: - if ( m_sCurrent.Len() ) + if ( !m_sCurrent.isEmpty() ) m_sTextToken = m_sCurrent; adjustFormat(); m_nColumnPos = 0; m_nRows--; - m_sCurrent.Erase(); + m_sCurrent = ""; break; } } @@ -366,20 +366,20 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor) break; case HTML_O_FACE : { - const String& rFace = rOption.GetString(); - String aFontName; + const OUString& rFace = rOption.GetString(); + OUString aFontName; sal_Int32 nPos = 0; while( nPos != -1 ) { // list fo fonts, VCL: semicolon as separator, HTML: comma - String aFName = rFace.GetToken( 0, ',', nPos ); + OUString aFName = rFace.getToken( 0, ',', nPos ); aFName = comphelper::string::strip(aFName, ' '); - if( aFontName.Len() ) - aFontName += ';'; + if( !aFontName.isEmpty() ) + aFontName += ";"; aFontName += aFName; } - if ( aFontName.Len() ) - _rFont.Name = OUString(aFontName); + if ( !aFontName.isEmpty() ) + _rFont.Name = aFontName; } break; case HTML_O_SIZE : @@ -401,15 +401,15 @@ sal_Int16 OHTMLReader::GetWidthPixel( const HTMLOption& rOption ) { SAL_INFO("dbaccess.ui", "OHTMLReader::GetWidthPixel" ); DBG_CHKTHIS(OHTMLReader,NULL); - const String& rOptVal = rOption.GetString(); - if ( rOptVal.Search('%') != STRING_NOTFOUND ) + const OUString& rOptVal = rOption.GetString(); + if ( rOptVal.indexOf('%') != -1 ) { // percentage OSL_ENSURE( m_nColumnWidth, "WIDTH Option: m_nColumnWidth==0 und Width%" ); return (sal_Int16)((rOption.GetNumber() * m_nColumnWidth) / 100); } else { - if ( rOptVal.Search('*') != STRING_NOTFOUND ) + if ( rOptVal.indexOf('*') != -1 ) { // relativ to what?!? //TODO: collect ColArray of all relevant values and then MakeCol return 0; @@ -423,17 +423,17 @@ sal_Bool OHTMLReader::CreateTable(int nToken) { SAL_INFO("dbaccess.ui", "OHTMLReader::CreateTable" ); DBG_CHKTHIS(OHTMLReader,NULL); - String aTempName(ModuleRes(STR_TBL_TITLE)); - aTempName = aTempName.GetToken(0,' '); - aTempName = String(::dbtools::createUniqueName(m_xTables,OUString(aTempName ))); + OUString aTempName(ModuleRes(STR_TBL_TITLE)); + aTempName = aTempName.getToken(0,' '); + aTempName = ::dbtools::createUniqueName(m_xTables, aTempName); int nTmpToken2 = nToken; sal_Bool bCaption = sal_False; sal_Bool bTableHeader = sal_False; - String aColumnName; + OUString aColumnName; SvxCellHorJustify eVal; - String aTableName; + OUString aTableName; FontDescriptor aFont = VCLUnoHelper::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont()); sal_Int32 nTextColor = 0; do @@ -451,7 +451,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken) m_sCurrent += aColumnName; break; case HTML_PARABREAK_ON: - m_sTextToken.Erase(); + m_sTextToken = ""; break; case HTML_TABLEDATA_ON: case HTML_TABLEHEADER_ON: @@ -462,15 +462,15 @@ sal_Bool OHTMLReader::CreateTable(int nToken) case HTML_TABLEHEADER_OFF: { aColumnName = comphelper::string::strip(aColumnName, ' ' ); - if (!aColumnName.Len() || m_bAppendFirstLine ) - aColumnName = String(ModuleRes(STR_COLUMN_NAME)); - else if ( m_sCurrent.Len() ) + if (aColumnName.isEmpty() || m_bAppendFirstLine ) + aColumnName = ModuleRes(STR_COLUMN_NAME); + else if ( !m_sCurrent.isEmpty() ) aColumnName = m_sCurrent; aColumnName = comphelper::string::strip(aColumnName, ' '); CreateDefaultColumn(aColumnName); - aColumnName.Erase(); - m_sCurrent.Erase(); + aColumnName = ""; + m_sCurrent = ""; eVal = SVX_HOR_JUSTIFY_STANDARD; bTableHeader = sal_False; @@ -484,8 +484,8 @@ sal_Bool OHTMLReader::CreateTable(int nToken) case HTML_TITLE_OFF: case HTML_CAPTION_OFF: aTableName = comphelper::string::strip(aTableName, ' '); - if(!aTableName.Len()) - aTableName = String(::dbtools::createUniqueName(m_xTables,OUString(aTableName))); + if(aTableName.isEmpty()) + aTableName = ::dbtools::createUniqueName(m_xTables, aTableName); else aTableName = aTempName; bCaption = sal_False; @@ -509,16 +509,16 @@ sal_Bool OHTMLReader::CreateTable(int nToken) } while((nTmpToken2 = GetNextToken()) != HTML_TABLEROW_OFF); - if ( m_sCurrent.Len() ) + if ( !m_sCurrent.isEmpty() ) aColumnName = m_sCurrent; aColumnName = comphelper::string::strip(aColumnName, ' '); - if(aColumnName.Len()) + if(!aColumnName.isEmpty()) CreateDefaultColumn(aColumnName); if ( m_vDestVector.empty() ) return sal_False; - if(!aTableName.Len()) + if(aTableName.isEmpty()) aTableName = aTempName; m_bInTbl = sal_False; diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 91293255de57..88146786f226 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -42,7 +42,7 @@ ORowSetImportExport::ORowSetImportExport( Window* _pParent, const Reference< XResultSetUpdate >& _xResultSetUpdate, const ::svx::ODataAccessDescriptor& _aDataDescriptor, const Reference< XComponentContext >& _rM, - const String& rExchange + const OUString& rExchange ) : ODatabaseImportExport(_aDataDescriptor,_rM,NULL,rExchange) ,m_xTargetResultSetUpdate(_xResultSetUpdate) @@ -64,7 +64,7 @@ void ORowSetImportExport::initialize() m_xTargetResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xTargetResultSetUpdate,UNO_QUERY)->getMetaData(); if(!m_xTargetResultSetMetaData.is() || !xColumnLocate.is() || !m_xResultSetMetaData.is() ) - throw SQLException(String(ModuleRes(STR_UNEXPECTED_ERROR)),*this,OUString("S1000") ,0,Any()); + throw SQLException(ModuleRes(STR_UNEXPECTED_ERROR),*this,OUString("S1000") ,0,Any()); sal_Int32 nCount = m_xTargetResultSetMetaData->getColumnCount(); m_aColumnMapping.reserve(nCount); @@ -245,7 +245,7 @@ sal_Bool ORowSetImportExport::insertNewRow() { if(!m_bAlreadyAsked) { - String sAskIfContinue = String(ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING)); + OUString sAskIfContinue = ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING); OSQLWarningBox aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ); if(aDlg.Execute() == RET_YES) m_bAlreadyAsked = sal_True; diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx index 06d94701bfe6..b3a1b48e29ae 100644 --- a/dbaccess/source/ui/misc/RtfReader.cxx +++ b/dbaccess/source/ui/misc/RtfReader.cxx @@ -260,12 +260,12 @@ sal_Bool ORTFReader::CreateTable(int nToken) { SAL_INFO("dbaccess.ui", "ORTFReader::CreateTable" ); DBG_CHKTHIS(ORTFReader,NULL); - String aTableName(ModuleRes(STR_TBL_TITLE)); - aTableName = aTableName.GetToken(0,' '); - aTableName = String(::dbtools::createUniqueName(m_xTables,OUString(aTableName))); + OUString aTableName(ModuleRes(STR_TBL_TITLE)); + aTableName = aTableName.getToken(0,' '); + aTableName = ::dbtools::createUniqueName(m_xTables, aTableName); int nTmpToken2 = nToken; - String aColumnName; + OUString aColumnName; FontDescriptor aFont = VCLUnoHelper::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont()); do @@ -275,11 +275,11 @@ sal_Bool ORTFReader::CreateTable(int nToken) case RTF_UNKNOWNCONTROL: case RTF_UNKNOWNDATA: m_bInTbl = sal_False; - aColumnName.Erase(); + aColumnName = ""; break; case RTF_INTBL: if(m_bInTbl) - aColumnName.Erase(); + aColumnName = ""; m_bInTbl = sal_True; break; @@ -291,11 +291,11 @@ sal_Bool ORTFReader::CreateTable(int nToken) case RTF_CELL: { aColumnName = comphelper::string::strip(aColumnName, ' '); - if (!aColumnName.Len() || m_bAppendFirstLine ) - aColumnName = String(ModuleRes(STR_COLUMN_NAME)); + if (aColumnName.isEmpty() || m_bAppendFirstLine ) + aColumnName = ModuleRes(STR_COLUMN_NAME); CreateDefaultColumn(aColumnName); - aColumnName.Erase(); + aColumnName = ""; } break; case RTF_CF: @@ -319,10 +319,10 @@ sal_Bool ORTFReader::CreateTable(int nToken) sal_Bool bOk = !m_vDestVector.empty(); if(bOk) { - if ( aColumnName.Len() ) + if ( !aColumnName.isEmpty() ) { if ( m_bAppendFirstLine ) - aColumnName = String(ModuleRes(STR_COLUMN_NAME)); + aColumnName = ModuleRes(STR_COLUMN_NAME); CreateDefaultColumn(aColumnName); } diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx index 55bb6bbece47..9fbf253181e9 100644 --- a/dbaccess/source/ui/misc/TableCopyHelper.cxx +++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx @@ -204,7 +204,7 @@ void OTableCopyHelper::pasteTable( SotFormatStringId _nFormatId aTrans.bHtml = SOT_FORMATSTR_ID_HTML == _nFormatId; aTrans.sDefaultTableName = GetTableNameForAppend(); if ( !copyTagTable(aTrans,sal_False,_xConnection) ) - m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,OUString("S1000"),0,Any())); + m_pController->showError(SQLException(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE), *m_pController, OUString("S1000"), 0, Any())); } catch(const SQLException&) { @@ -216,7 +216,7 @@ void OTableCopyHelper::pasteTable( SotFormatStringId _nFormatId } } else - m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,OUString("S1000"),0,Any())); + m_pController->showError(SQLException(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE), *m_pController, OUString("S1000"), 0, Any())); } void OTableCopyHelper::pasteTable( const TransferableDataHelper& _rTransData @@ -313,7 +313,7 @@ void OTableCopyHelper::asyncCopyTagTable( DropDescriptor& _rDesc else if ( !_rDesc.bError ) pasteTable(_rDesc.aDroppedData,i_rDestDataSource,_xConnection); else - m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,OUString("S1000"),0,Any())); + m_pController->showError(SQLException(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE), *m_pController, OUString("S1000"), 0, Any())); } } // namespace dbaui diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 7756a3c66eb2..8e450ef4b01c 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -90,7 +90,7 @@ DBG_NAME(ODatabaseImportExport) ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& _aDataDescriptor, const Reference< XComponentContext >& _rM, const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const String& rExchange) + const OUString& rExchange) :m_bBookmarkSelection( sal_False ) ,m_xFormatter(_rxNumberF) ,m_xContext(_rM) @@ -110,11 +110,11 @@ ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& impl_initFromDescriptor( _aDataDescriptor, false ); xub_StrLen nCount = comphelper::string::getTokenCount(rExchange, char(11)); - if( nCount > SBA_FORMAT_SELECTION_COUNT && rExchange.GetToken(4).Len()) + if( nCount > SBA_FORMAT_SELECTION_COUNT && !rExchange.getToken(4, ';').isEmpty()) { m_pRowMarker = new sal_Int32[nCount-SBA_FORMAT_SELECTION_COUNT]; for(xub_StrLen i=SBA_FORMAT_SELECTION_COUNT;i<nCount;++i) - m_pRowMarker[i-SBA_FORMAT_SELECTION_COUNT] = rExchange.GetToken(i,char(11)).ToInt32(); + m_pRowMarker[i-SBA_FORMAT_SELECTION_COUNT] = rExchange.getToken(i,char(11)).toInt32(); } osl_atomic_decrement( &m_refCount ); } @@ -662,7 +662,7 @@ const char OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataDescriptor, const Reference< XComponentContext >& _rM, const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const String& rExchange) + const OUString& rExchange) : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) ,m_nIndent(0) #if OSL_DEBUG_LEVEL > 0 @@ -727,7 +727,7 @@ void OHTMLImportExport::WriteHeader() IncIndent(1); TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_head ); - SfxFrameHTMLWriter::Out_DocInfo( (*m_pStream), String(), + SfxFrameHTMLWriter::Out_DocInfo( (*m_pStream), OUString(), xDocProps, sIndent ); OUT_LF(); IncIndent(-1); OUT_LF(); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_head ); @@ -901,7 +901,7 @@ void OHTMLImportExport::WriteTables() if(i == aNames.getLength()) IncIndent(-1); - String aValue; + OUString aValue; try { Reference<XPropertySet> xColumn(m_xRowSetColumns->getByIndex(i-1),UNO_QUERY_THROW); @@ -941,8 +941,8 @@ void OHTMLImportExport::WriteTables() IncIndent(-1); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_table ); } -void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_Int32 nHeightPixel,const char* pChar, - const String& rValue,const char* pHtmlTag) +void OHTMLImportExport::WriteCell( sal_Int32 nFormat, sal_Int32 nWidthPixel, sal_Int32 nHeightPixel, const char* pChar, + const OUString& rValue, const char* pHtmlTag) { SAL_INFO("dbaccess.ui", "OHTMLImportExport::WriteCell" ); OString aStrTD = pHtmlTag; @@ -1000,7 +1000,7 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I if ( bUnderline ) TAG_ON( OOO_STRING_SVTOOLS_HTML_underline ); if ( bStrikeout ) TAG_ON( OOO_STRING_SVTOOLS_HTML_strike ); - if ( !rValue.Len() ) + if ( rValue.isEmpty() ) TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // no completely empty cell else HTMLOutFuncs::Out_String( (*m_pStream), rValue ,m_eDestEnc); diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 911d0256ea42..4675cdc7ef00 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -229,9 +229,9 @@ Reference< XDataSource > getDataSourceByName( const OUString& _rDataSourceName, ) ) { - String sErrorMessage = String( ModuleRes( STR_FILE_DOES_NOT_EXIST ) ); + OUString sErrorMessage( ModuleRes( STR_FILE_DOES_NOT_EXIST ) ); OFileNotation aTransformer( e.Message ); - sErrorMessage.SearchAndReplaceAscii( "$file$", aTransformer.get( OFileNotation::N_SYSTEM ) ); + sErrorMessage = sErrorMessage.replaceFirst( "$file$", aTransformer.get( OFileNotation::N_SYSTEM ) ); aSQLError = SQLExceptionInfo( sErrorMessage ).get(); } else @@ -427,7 +427,7 @@ TOTypeInfoSP getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, } void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection, - const String& _rsTypeNames, + const OUString& _rsTypeNames, OTypeInfoMap& _rTypeInfoMap, ::std::vector<OTypeInfoMap::iterator>& _rTypeInfoIters) { @@ -519,108 +519,108 @@ void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo if( pInfo->nMaximumScale < 0) pInfo->nMaximumScale = 0; - String aName; + OUString aName; switch(pInfo->nType) { case DataType::CHAR: - aName = _rsTypeNames.GetToken(TYPE_CHAR); + aName = _rsTypeNames.getToken(TYPE_CHAR, ';'); break; case DataType::VARCHAR: - aName = _rsTypeNames.GetToken(TYPE_TEXT); + aName = _rsTypeNames.getToken(TYPE_TEXT, ';'); break; case DataType::DECIMAL: - aName = _rsTypeNames.GetToken(TYPE_DECIMAL); + aName = _rsTypeNames.getToken(TYPE_DECIMAL, ';'); break; case DataType::NUMERIC: - aName = _rsTypeNames.GetToken(TYPE_NUMERIC); + aName = _rsTypeNames.getToken(TYPE_NUMERIC, ';'); break; case DataType::BIGINT: - aName = _rsTypeNames.GetToken(TYPE_BIGINT); + aName = _rsTypeNames.getToken(TYPE_BIGINT, ';'); break; case DataType::FLOAT: - aName = _rsTypeNames.GetToken(TYPE_FLOAT); + aName = _rsTypeNames.getToken(TYPE_FLOAT, ';'); break; case DataType::DOUBLE: - aName = _rsTypeNames.GetToken(TYPE_DOUBLE); + aName = _rsTypeNames.getToken(TYPE_DOUBLE, ';'); break; case DataType::LONGVARCHAR: - aName = _rsTypeNames.GetToken(TYPE_MEMO); + aName = _rsTypeNames.getToken(TYPE_MEMO, ';'); break; case DataType::LONGVARBINARY: - aName = _rsTypeNames.GetToken(TYPE_IMAGE); + aName = _rsTypeNames.getToken(TYPE_IMAGE, ';'); break; case DataType::DATE: - aName = _rsTypeNames.GetToken(TYPE_DATE); + aName = _rsTypeNames.getToken(TYPE_DATE, ';'); break; case DataType::TIME: - aName = _rsTypeNames.GetToken(TYPE_TIME); + aName = _rsTypeNames.getToken(TYPE_TIME, ';'); break; case DataType::TIMESTAMP: - aName = _rsTypeNames.GetToken(TYPE_DATETIME); + aName = _rsTypeNames.getToken(TYPE_DATETIME, ';'); break; case DataType::BIT: if ( !pInfo->aCreateParams.isEmpty() ) { - aName = _rsTypeNames.GetToken(TYPE_BIT); + aName = _rsTypeNames.getToken(TYPE_BIT, ';'); break; } // run through case DataType::BOOLEAN: - aName = _rsTypeNames.GetToken(TYPE_BOOL); + aName = _rsTypeNames.getToken(TYPE_BOOL, ';'); break; case DataType::TINYINT: - aName = _rsTypeNames.GetToken(TYPE_TINYINT); + aName = _rsTypeNames.getToken(TYPE_TINYINT, ';'); break; case DataType::SMALLINT: - aName = _rsTypeNames.GetToken(TYPE_SMALLINT); + aName = _rsTypeNames.getToken(TYPE_SMALLINT, ';'); break; case DataType::INTEGER: - aName = _rsTypeNames.GetToken(TYPE_INTEGER); + aName = _rsTypeNames.getToken(TYPE_INTEGER, ';'); break; case DataType::REAL: - aName = _rsTypeNames.GetToken(TYPE_REAL); + aName = _rsTypeNames.getToken(TYPE_REAL, ';'); break; case DataType::BINARY: - aName = _rsTypeNames.GetToken(TYPE_BINARY); + aName = _rsTypeNames.getToken(TYPE_BINARY, ';'); break; case DataType::VARBINARY: - aName = _rsTypeNames.GetToken(TYPE_VARBINARY); + aName = _rsTypeNames.getToken(TYPE_VARBINARY, ';'); break; case DataType::SQLNULL: - aName = _rsTypeNames.GetToken(TYPE_SQLNULL); + aName = _rsTypeNames.getToken(TYPE_SQLNULL, ';'); break; case DataType::OBJECT: - aName = _rsTypeNames.GetToken(TYPE_OBJECT); + aName = _rsTypeNames.getToken(TYPE_OBJECT, ';'); break; case DataType::DISTINCT: - aName = _rsTypeNames.GetToken(TYPE_DISTINCT); + aName = _rsTypeNames.getToken(TYPE_DISTINCT, ';'); break; case DataType::STRUCT: - aName = _rsTypeNames.GetToken(TYPE_STRUCT); + aName = _rsTypeNames.getToken(TYPE_STRUCT, ';'); break; case DataType::ARRAY: - aName = _rsTypeNames.GetToken(TYPE_ARRAY); + aName = _rsTypeNames.getToken(TYPE_ARRAY, ';'); break; case DataType::BLOB: - aName = _rsTypeNames.GetToken(TYPE_BLOB); + aName = _rsTypeNames.getToken(TYPE_BLOB, ';'); break; case DataType::CLOB: - aName = _rsTypeNames.GetToken(TYPE_CLOB); + aName = _rsTypeNames.getToken(TYPE_CLOB, ';'); break; case DataType::REF: - aName = _rsTypeNames.GetToken(TYPE_REF); + aName = _rsTypeNames.getToken(TYPE_REF, ';'); break; case DataType::OTHER: - aName = _rsTypeNames.GetToken(TYPE_OTHER); + aName = _rsTypeNames.getToken(TYPE_OTHER, ';'); break; } - if ( aName.Len() ) + if ( !aName.isEmpty() ) { - pInfo->aUIName = aName.GetBuffer(); + pInfo->aUIName = aName.getStr(); pInfo->aUIName += aB1; } pInfo->aUIName += pInfo->aTypeName; - if ( aName.Len() ) + if ( !aName.isEmpty() ) pInfo->aUIName += aB2; // Now that we have the type info, save it in the multimap _rTypeInfoMap.insert(OTypeInfoMap::value_type(pInfo->nType,pInfo)); @@ -943,7 +943,7 @@ sal_Bool appendToFilter(const Reference<XConnection>& _xConnection, { if(! ::dbaui::checkDataSourceAvailable(::comphelper::getString(xProp->getPropertyValue(PROPERTY_NAME)),_rxContext)) { - String aMessage(ModuleRes(STR_TABLEDESIGN_DATASOURCE_DELETED)); + OUString aMessage(ModuleRes(STR_TABLEDESIGN_DATASOURCE_DELETED)); OSQLWarningBox( _pParent, aMessage ).Execute(); bRet = sal_False; } @@ -1289,12 +1289,12 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType sal_Int32 askForUserAction(Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _nText,sal_Bool _bAll,const OUString& _sName) { SolarMutexGuard aGuard; - String aMsg = String(ModuleRes(_nText)); - aMsg.SearchAndReplace(OUString("%1"),String(_sName)); - OSQLMessageBox aAsk(_pParent,String(ModuleRes(_nTitle )),aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query); + OUString aMsg = ModuleRes(_nText); + aMsg = aMsg.replaceFirst("%1", _sName); + OSQLMessageBox aAsk(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query); if ( _bAll ) { - aAsk.AddButton(String(ModuleRes(STR_BUTTON_TEXT_ALL)), RET_ALL, 0); + aAsk.AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0); aAsk.GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL); } return aAsk.Execute(); @@ -1393,7 +1393,7 @@ Reference<XPropertySet> createView( const OUString& _rName, const Reference< XCo sal_Bool insertHierachyElement( Window* _pParent, const Reference< XComponentContext >& _rxContext, const Reference<XHierarchicalNameContainer>& _xNames, - const String& _sParentFolder, + const OUString& _sParentFolder, sal_Bool _bForm, sal_Bool _bCollection, const Reference<XContent>& _xContent, @@ -1424,14 +1424,14 @@ sal_Bool insertHierachyElement( Window* _pParent, const Reference< XComponentCon if ( !_bMove || sNewName.isEmpty() ) { - String sTargetName,sLabel; + OUString sTargetName,sLabel; if ( sNewName.isEmpty() || xNameAccess->hasByName(sNewName) ) { if ( !sNewName.isEmpty() ) sTargetName = sNewName; else - sTargetName = String(ModuleRes( _bCollection ? STR_NEW_FOLDER : ((_bForm) ? RID_STR_FORM : RID_STR_REPORT))); - sLabel = String(ModuleRes( _bCollection ? STR_FOLDER_LABEL : ((_bForm) ? STR_FRM_LABEL : STR_RPT_LABEL))); + sTargetName = ModuleRes( _bCollection ? STR_NEW_FOLDER : ((_bForm) ? RID_STR_FORM : RID_STR_REPORT)); + sLabel = ModuleRes( _bCollection ? STR_FOLDER_LABEL : ((_bForm) ? STR_FRM_LABEL : STR_RPT_LABEL)); sTargetName = ::dbtools::createUniqueName(xNameAccess,sTargetName); // here we have everything needed to create a new query object ... @@ -1452,8 +1452,8 @@ sal_Bool insertHierachyElement( Window* _pParent, const Reference< XComponentCon } else if ( xNameAccess->hasByName(sNewName) ) { - String sError(ModuleRes(STR_NAME_ALREADY_EXISTS)); - sError.SearchAndReplaceAscii("#",sNewName); + OUString sError(ModuleRes(STR_NAME_ALREADY_EXISTS)); + sError = sError.replaceFirst("#",sNewName); throw SQLException(sError,NULL,OUString("S1000") ,0,Any()); } diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index ffb0cf6894e1..67c4eb26b55f 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -103,7 +103,7 @@ OCopyTable::OCopyTable( Window * pParent ) FreeResource(); - SetText(String(ModuleRes(STR_COPYTABLE_TITLE_COPY))); + SetText(ModuleRes(STR_COPYTABLE_TITLE_COPY)); } OCopyTable::~OCopyTable() @@ -172,7 +172,7 @@ sal_Bool OCopyTable::LeavePage() SQLExceptionInfo aErrorInfo; if ( !aNameCheck.isNameValid( m_edTableName.GetText(), aErrorInfo ) ) { - aErrorInfo.append( SQLExceptionInfo::SQL_CONTEXT, String( ModuleRes( STR_SUGGEST_APPEND_TABLE_DATA ) ) ); + aErrorInfo.append( SQLExceptionInfo::SQL_CONTEXT, ModuleRes( STR_SUGGEST_APPEND_TABLE_DATA ) ); m_pParent->showError(aErrorInfo.get()); return sal_False; @@ -192,7 +192,7 @@ sal_Bool OCopyTable::LeavePage() sal_Int32 nMaxLength = xMeta->getMaxTableNameLength(); if ( nMaxLength && sTable.getLength() > nMaxLength ) { - String sError(ModuleRes(STR_INVALID_TABLE_NAME_LENGTH)); + OUString sError(ModuleRes(STR_INVALID_TABLE_NAME_LENGTH)); m_pParent->showError(sError); return sal_False; } @@ -201,8 +201,8 @@ sal_Bool OCopyTable::LeavePage() if ( m_pParent->m_bCreatePrimaryKeyColumn && m_pParent->m_aKeyName != m_pParent->createUniqueName(m_pParent->m_aKeyName) ) { - String aInfoString( ModuleRes(STR_WIZ_PKEY_ALREADY_DEFINED) ); - aInfoString += OUString(' '); + OUString aInfoString( ModuleRes(STR_WIZ_PKEY_ALREADY_DEFINED) ); + aInfoString += " "; aInfoString += m_pParent->m_aKeyName; m_pParent->showError(aInfoString); return sal_False; @@ -235,7 +235,7 @@ sal_Bool OCopyTable::LeavePage() if(m_pParent->m_sName.isEmpty()) { - String sError(ModuleRes(STR_INVALID_TABLE_NAME)); + OUString sError(ModuleRes(STR_INVALID_TABLE_NAME)); m_pParent->showError(sError); return sal_False; } @@ -252,10 +252,10 @@ void OCopyTable::ActivatePage() m_aCB_UseHeaderLine.Check(m_pParent->UseHeaderLine()); } -String OCopyTable::GetTitle() const +OUString OCopyTable::GetTitle() const { DBG_CHKTHIS(OCopyTable,NULL); - return String(ModuleRes(STR_WIZ_TABLE_COPY)); + return ModuleRes(STR_WIZ_TABLE_COPY); } void OCopyTable::Reset() @@ -314,7 +314,7 @@ sal_Bool OCopyTable::checkAppendData() if ( !xTable.is() ) { - String sError(ModuleRes(STR_INVALID_TABLE_NAME)); + OUString sError(ModuleRes(STR_INVALID_TABLE_NAME)); m_pParent->showError(sError); return sal_False; } diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index bedf7c1c0b9f..abd4cc07f578 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -42,7 +42,8 @@ using namespace dbaui; namespace CopyTableOperation = ::com::sun::star::sdb::application::CopyTableOperation; -String OWizColumnSelect::GetTitle() const { return String(ModuleRes(STR_WIZ_COLUMN_SELECT_TITEL)); } +OUString OWizColumnSelect::GetTitle() const { return ModuleRes(STR_WIZ_COLUMN_SELECT_TITEL); } + OWizardPage::OWizardPage( Window* pParent, const ResId& rResId ) : TabPage(pParent,rResId) ,m_pParent(static_cast<OCopyTableWizard*>(pParent)) @@ -310,7 +311,7 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, if(_pRight == &m_lbNewColumnNames) { // we copy the column into the new format for the dest - OFieldDescription* pSrcField = static_cast<OFieldDescription*>(_pLeft->GetEntryData(_pLeft->GetEntryPos(String(_sColumnName)))); + OFieldDescription* pSrcField = static_cast<OFieldDescription*>(_pLeft->GetEntryData(_pLeft->GetEntryPos(OUString(_sColumnName)))); createNewColumn(_pRight,pSrcField,_rRightColumns,_sColumnName,_sExtraChars,_nMaxNameLen,_aCase); } else diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index fc16d90cb619..d5effc13b5f3 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -162,9 +162,9 @@ void ObjectCopySource::copyFilterAndSortingTo( const Reference< XConnection >& _ try { - const String sSourceName = (::dbtools::composeTableNameForSelect(m_xConnection,m_xObject) + OUString(".")); + const OUString sSourceName = (::dbtools::composeTableNameForSelect(m_xConnection,m_xObject) + OUString(".")); const OUString sTargetName = ::dbtools::composeTableNameForSelect(_xConnection,_rxObject); - const String sTargetNameTemp = (sTargetName + OUString(".")); + const OUString sTargetNameTemp = (sTargetName + OUString(".")); OUString sStatement("SELECT * FROM "); sStatement += sTargetName; @@ -179,8 +179,8 @@ void ObjectCopySource::copyFilterAndSortingTo( const Reference< XConnection >& _ if ( !sFilter.isEmpty() ) { sStatement += aProperties[i].second; - String sReplace = sFilter; - sReplace.SearchAndReplace(sSourceName,sTargetNameTemp); + OUString sReplace = sFilter; + sReplace = sReplace.replaceFirst(sSourceName,sTargetNameTemp); sFilter = sReplace; _rxObject->setPropertyValue( aProperties[i].first, makeAny(sFilter) ); sStatement += sFilter; @@ -685,7 +685,7 @@ void OCopyTableWizard::construct() FreeResource(); m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); - m_pTypeInfo->aUIName = m_sTypeNames.GetToken(TYPE_OTHER); + m_pTypeInfo->aUIName = m_sTypeNames.getToken(TYPE_OTHER, ';'); m_bAddPKFirstTime = sal_True; } @@ -876,7 +876,7 @@ IMPL_LINK_NOARG(OCopyTableWizard, ImplOKHdl) if ( aFind == m_vDestColumns.end() && m_xInteractionHandler.is() ) { - String sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); + OUString sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); SQLContext aError; aError.Message = sMsg; ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( makeAny( aError ) ) ); @@ -1589,8 +1589,8 @@ OUString OCopyTableWizard::createUniqueName(const OUString& _sName) void OCopyTableWizard::showColumnTypeNotSupported(const OUString& _rColumnName) { SAL_INFO("dbaccess.ui", "OCopyTableWizard::showColumnTypeNotSupported" ); - String sMessage( ModuleRes( STR_UNKNOWN_TYPE_FOUND ) ); - sMessage.SearchAndReplaceAscii("#1",_rColumnName); + OUString sMessage( ModuleRes( STR_UNKNOWN_TYPE_FOUND ) ); + sMessage = sMessage.replaceFirst("#1",_rColumnName); showError(sMessage); } diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 3464db87c6bc..79221d2aeee9 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -180,7 +180,8 @@ sal_Bool OWizNameMatching::LeavePage() return sal_True; } -String OWizNameMatching::GetTitle() const { return String(ModuleRes(STR_WIZ_NAME_MATCHING_TITEL)); } +OUString OWizNameMatching::GetTitle() const { return ModuleRes(STR_WIZ_NAME_MATCHING_TITEL); } + IMPL_LINK( OWizNameMatching, ButtonClickHdl, Button *, pButton ) { SvTreeListEntry* pEntry = m_CTRL_LEFT.FirstSelected(); @@ -320,7 +321,7 @@ class OColumnString : public SvLBoxString { sal_Bool m_bReadOnly; public: - OColumnString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rStr,sal_Bool _RO) + OColumnString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const OUString& rStr, sal_Bool _RO) :SvLBoxString(pEntry,nFlags,rStr) ,m_bReadOnly(_RO) { diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 7ca531b36a9e..af4fca058e72 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -93,7 +93,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) OFieldDescription* pCurFieldDescr = getCurrentFieldDescData(); - sal_uInt16 nPos = aListBox.GetEntryPos( String( pCurFieldDescr->GetName() ) ); + sal_uInt16 nPos = aListBox.GetEntryPos( OUString( pCurFieldDescr->GetName() ) ); pCurFieldDescr = static_cast< OFieldDescription* >( aListBox.GetEntryData( nPos ) ); OSL_ENSURE( pCurFieldDescr, "OWizTypeSelectControl::CellModified: Columnname/type not found in the listbox!" ); if ( !pCurFieldDescr ) @@ -128,14 +128,14 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) } else - bDoubleName = ((aListBox.GetEntryPos(String(sNewName)) != LISTBOX_ENTRY_NOTFOUND) + bDoubleName = ((aListBox.GetEntryPos(OUString(sNewName)) != LISTBOX_ENTRY_NOTFOUND) || ( pWiz->shouldCreatePrimaryKey() && pWiz->getPrimaryKeyName() == sNewName) ); if ( bDoubleName ) { - String strMessage = String(ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME)); - strMessage.SearchAndReplaceAscii("$column$", sNewName); + OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME); + strMessage = strMessage.replaceFirst("$column$", sNewName); pWiz->showError(strMessage); pCurFieldDescr->SetName(sName); DisplayData(pCurFieldDescr); @@ -260,10 +260,10 @@ OWizTypeSelect::~OWizTypeSelect() DBG_DTOR(OWizTypeSelect,NULL); } -String OWizTypeSelect::GetTitle() const +OUString OWizTypeSelect::GetTitle() const { DBG_CHKTHIS(OWizTypeSelect,NULL); - return String(ModuleRes(STR_WIZ_TYPE_SELECT_TITEL)); + return ModuleRes(STR_WIZ_TYPE_SELECT_TITEL); } void OWizTypeSelect::Resize() @@ -273,7 +273,7 @@ void OWizTypeSelect::Resize() IMPL_LINK( OWizTypeSelect, ColumnSelectHdl, MultiListBox *, /*pListBox*/ ) { - String aColumnName( m_lbColumnNames.GetSelectEntry() ); + OUString aColumnName( m_lbColumnNames.GetSelectEntry() ); OFieldDescription* pField = static_cast<OFieldDescription*>(m_lbColumnNames.GetEntryData(m_lbColumnNames.GetEntryPos(aColumnName))); if(pField) @@ -324,7 +324,7 @@ void OWizTypeSelect::ActivatePage( ) sal_Bool OWizTypeSelect::LeavePage() { DBG_CHKTHIS(OWizTypeSelect,NULL); - String aColumnName( m_lbColumnNames.GetSelectEntry() ); + OUString aColumnName( m_lbColumnNames.GetSelectEntry() ); sal_Bool bDuplicateName = sal_False; OFieldDescription* pField = static_cast<OFieldDescription*>(m_lbColumnNames.GetEntryData(m_lbColumnNames.GetEntryPos(aColumnName))); @@ -374,7 +374,7 @@ sal_Bool OWizTypeSelectList::IsPrimaryKeyAllowed() const void OWizTypeSelectList::setPrimaryKey(OFieldDescription* _pFieldDescr,sal_uInt16 _nPos,sal_Bool _bSet) { - String sColumnName = GetEntry(_nPos); + OUString sColumnName = GetEntry(_nPos); RemoveEntry(_nPos); _pFieldDescr->SetPrimaryKey(_bSet); if( _bSet ) diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index 150fbecafb26..3733fb9e8bf9 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -160,8 +160,8 @@ namespace dbaui Any aWarnings( xConnectionWarnings->getWarnings() ); if ( aWarnings.hasValue() ) { - String sMessage( ModuleRes( STR_WARNINGS_DURING_CONNECT ) ); - sMessage.SearchAndReplaceAscii( "$buttontext$", Button::GetStandardText( BUTTON_MORE ) ); + OUString sMessage( ModuleRes( STR_WARNINGS_DURING_CONNECT ) ); + sMessage = sMessage.replaceFirst( "$buttontext$", Button::GetStandardText( BUTTON_MORE ) ); sMessage = OutputDevice::GetNonMnemonicString( sMessage ); SQLWarning aContext; diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index 0145b937ac1e..595f0949a363 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -449,7 +449,7 @@ namespace dbaui } void DBSubComponentController::connectionLostMessage() const { - String aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); + OUString aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); Reference< XWindow > xWindow = getTopMostContainerWindow(); Window* pWin = NULL; if ( xWindow.is() ) diff --git a/dbaccess/source/ui/misc/imageprovider.cxx b/dbaccess/source/ui/misc/imageprovider.cxx index 88a6e43346de..4529f0ecf3bf 100644 --- a/dbaccess/source/ui/misc/imageprovider.cxx +++ b/dbaccess/source/ui/misc/imageprovider.cxx @@ -120,7 +120,7 @@ namespace dbaui } } - void ImageProvider::getImages( const String& _rName, const sal_Int32 _nDatabaseObjectType, Image& _out_rImage ) + void ImageProvider::getImages( const OUString& _rName, const sal_Int32 _nDatabaseObjectType, Image& _out_rImage ) { if ( _nDatabaseObjectType != DatabaseObject::TABLE ) { diff --git a/dbaccess/source/ui/misc/indexcollection.cxx b/dbaccess/source/ui/misc/indexcollection.cxx index e9b5ffd7570c..0bcb01875de8 100644 --- a/dbaccess/source/ui/misc/indexcollection.cxx +++ b/dbaccess/source/ui/misc/indexcollection.cxx @@ -65,7 +65,7 @@ namespace dbaui m_aIndexes.clear(); } - Indexes::const_iterator OIndexCollection::find(const String& _rName) const + Indexes::const_iterator OIndexCollection::find(const OUString& _rName) const { OUString sNameCompare(_rName); @@ -79,7 +79,7 @@ namespace dbaui return aSearch; } - Indexes::iterator OIndexCollection::find(const String& _rName) + Indexes::iterator OIndexCollection::find(const OUString& _rName) { OUString sNameCompare(_rName); @@ -93,7 +93,7 @@ namespace dbaui return aSearch; } - Indexes::const_iterator OIndexCollection::findOriginal(const String& _rName) const + Indexes::const_iterator OIndexCollection::findOriginal(const OUString& _rName) const { OUString sNameCompare(_rName); @@ -107,7 +107,7 @@ namespace dbaui return aSearch; } - Indexes::iterator OIndexCollection::findOriginal(const String& _rName) + Indexes::iterator OIndexCollection::findOriginal(const OUString& _rName) { OUString sNameCompare(_rName); @@ -322,10 +322,10 @@ namespace dbaui } } - Indexes::iterator OIndexCollection::insert(const String& _rName) + Indexes::iterator OIndexCollection::insert(const OUString& _rName) { OSL_ENSURE(end() == find(_rName), "OIndexCollection::insert: invalid new name!"); - String tmpName; + OUString tmpName; OIndex aNewIndex(tmpName); // the empty string indicates the index is a new one aNewIndex.sName = _rName; m_aIndexes.push_back(aNewIndex); diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index e4e02ce16ab6..efcd1f5bbc15 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -325,8 +325,8 @@ namespace dbaui xRet = impl_open( _rLinkName, _xDefinition, _eOpenMode, _rAdditionalArgs ); if ( !xRet.is() ) { - String sMessage = String(ModuleRes(STR_COULDNOTOPEN_LINKEDDOC)); - sMessage.SearchAndReplaceAscii("$file$",_rLinkName); + OUString sMessage = ModuleRes(STR_COULDNOTOPEN_LINKEDDOC); + sMessage = sMessage.replaceFirst("$file$",_rLinkName); com::sun::star::sdbc::SQLException aSQLException; aSQLException.Message = sMessage; @@ -342,12 +342,12 @@ namespace dbaui aInfo = dbtools::SQLExceptionInfo(aSQLException); // more like a hack, insert an empty message - String sText( ModuleRes( RID_STR_EXTENSION_NOT_PRESENT ) ); - sText.SearchAndReplaceAscii("$file$",_rLinkName); + OUString sText( ModuleRes( RID_STR_EXTENSION_NOT_PRESENT ) ); + sText = sText.replaceFirst("$file$",_rLinkName); aInfo.prepend(sText); - String sMessage = String(ModuleRes(STR_COULDNOTOPEN_LINKEDDOC)); - sMessage.SearchAndReplaceAscii("$file$",_rLinkName); + OUString sMessage = ModuleRes(STR_COULDNOTOPEN_LINKEDDOC); + sMessage = sMessage.replaceFirst("$file$",_rLinkName); aInfo.prepend(sMessage); } catch(const Exception& e) @@ -364,8 +364,8 @@ namespace dbaui // more like a hack, insert an empty message aInfo.prepend(OUString(" \n")); - String sMessage = String(ModuleRes(STR_COULDNOTOPEN_LINKEDDOC)); - sMessage.SearchAndReplaceAscii("$file$",_rLinkName); + OUString sMessage = ModuleRes(STR_COULDNOTOPEN_LINKEDDOC); + sMessage = sMessage.replaceFirst("$file$",_rLinkName); aInfo.prepend(sMessage); } } diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index d3058b90c4f8..ca9a10e7b1c2 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -122,8 +122,8 @@ namespace dbaui aReturn.bEnabled = isEditable() && GetUndoManager().GetUndoActionCount() != 0; if ( aReturn.bEnabled ) { - String sUndo(ModuleRes(STR_UNDO_COLON)); - sUndo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); + OUString sUndo(ModuleRes(STR_UNDO_COLON)); + sUndo += " "; sUndo += GetUndoManager().GetUndoActionComment(); aReturn.sTitle = sUndo; } @@ -133,8 +133,8 @@ namespace dbaui aReturn.bEnabled = isEditable() && GetUndoManager().GetRedoActionCount() != 0; if ( aReturn.bEnabled ) { - String sRedo(ModuleRes(STR_REDO_COLON)); - sRedo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); + OUString sRedo(ModuleRes(STR_REDO_COLON)); + sRedo += " "; sRedo += GetUndoManager().GetRedoActionComment(); aReturn.sTitle = sRedo; } diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 9c376095276b..f49fdefa6fbb 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -95,7 +95,7 @@ public: virtual bool allowViews() const; virtual bool allowQueries() const; virtual bool allowAddition() const; - virtual void addTableWindow( const String& _rQualifiedTableName, const String& _rAliasName ); + virtual void addTableWindow( const OUString& _rQualifiedTableName, const OUString& _rAliasName ); virtual void onWindowClosing( const Window* _pWindow ); private: @@ -122,7 +122,7 @@ bool AddTableDialogContext::allowAddition() const return const_cast< OJoinController& >( m_rController ).getJoinView()->getTableView()->IsAddAllowed(); } -void AddTableDialogContext::addTableWindow( const String& _rQualifiedTableName, const String& _rAliasName ) +void AddTableDialogContext::addTableWindow( const OUString& _rQualifiedTableName, const OUString& _rAliasName ) { getTableView()->AddTabWin( _rQualifiedTableName, _rAliasName, sal_True ); } diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx index 6cc155618771..70007d70601a 100644 --- a/dbaccess/source/ui/querydesign/JoinExchange.cxx +++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx @@ -28,7 +28,8 @@ namespace dbaui using namespace ::com::sun::star::lang; using namespace ::com::sun::star::datatransfer; - String OJoinExchObj::m_sJoinFormat; + OUString OJoinExchObj::m_sJoinFormat; + // class OJoinExchObj DBG_NAME(OJoinExchObj) OJoinExchObj::OJoinExchObj(const OJoinExchangeData& jxdSource,sal_Bool _bFirstEntry) diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index c20d09153f58..79ef08d72490 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -262,7 +262,7 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,sal_Bool _bDelet return true; } -OTableWindow* OJoinTableView::GetTabWindow( const String& rName ) +OTableWindow* OJoinTableView::GetTabWindow( const OUString& rName ) { DBG_CHKTHIS(OJoinTableView,NULL); OTableWindowMapIterator aIter = m_aTableMap.find(rName); @@ -385,7 +385,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) rController.setModified(sal_True); } - String aWinName = pTabWin->GetWinName(); + OUString aWinName = pTabWin->GetWinName(); if(m_aTableMap.find(aWinName) != m_aTableMap.end()) m_aTableMap.erase( aWinName ); else diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index b62564a244e5..30ba7170bc4d 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -264,15 +264,15 @@ namespace if ( !bErg ) { eErrorCode = eColumnNotFound; - String sError(ModuleRes(STR_QRY_COLUMN_NOT_FOUND)); - sError.SearchAndReplaceAscii("$name$",aColumnName); + OUString sError(ModuleRes(STR_QRY_COLUMN_NOT_FOUND)); + sError = sError.replaceFirst("$name$",aColumnName); _pView->getController().appendError( sError ); try { Reference<XDatabaseMetaData> xMeta = _pView->getController().getConnection()->getMetaData(); if ( xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers() ) - _pView->getController().appendError( String( ModuleRes( STR_QRY_CHECK_CASESENSITIVE ) ) ); + _pView->getController().appendError( OUString( ModuleRes( STR_QRY_CHECK_CASESENSITIVE ) ) ); } catch(Exception&) { @@ -572,7 +572,7 @@ namespace SQL_ISRULE(pNode->getChild(2),column_ref) && pNode->getChild(1)->getNodeType() == SQL_NODE_EQUAL)) { - String sError(ModuleRes(STR_QRY_JOIN_COLUMN_COMPARE)); + OUString sError(ModuleRes(STR_QRY_JOIN_COLUMN_COMPARE)); _pView->getController().appendError( sError ); return eIllegalJoin; } @@ -962,14 +962,14 @@ namespace } { - String sTemp(comphelper::string::stripEnd(aWorkStr, ',')); + OUString sTemp(comphelper::string::stripEnd(aWorkStr, ',')); aWorkStr = sTemp; } if ( !aWorkStr.isEmpty() ) { const sal_Int32 nMaxOrder = xMetaData->getMaxColumnsInOrderBy(); - String sToken(aWorkStr); + OUString sToken(aWorkStr); if ( nMaxOrder && nMaxOrder < comphelper::string::getTokenCount(sToken, ',') ) eErrorCode = eStatementTooLong; else @@ -1424,7 +1424,7 @@ namespace else { eErrorCode = eNoColumnInLike; - String sError(ModuleRes(STR_QRY_LIKE_LEFT_NO_COLUMN)); + OUString sError(ModuleRes(STR_QRY_LIKE_LEFT_NO_COLUMN)); _pView->getController().appendError( sError ); } } @@ -1548,8 +1548,8 @@ namespace OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); if (pTabWin->ExistsField( OUString("*"), aDragLeft )) { - aDragLeft->SetAlias(String()); - aDragLeft->SetTable(String()); + aDragLeft->SetAlias(OUString()); + aDragLeft->SetTable(OUString()); break; } } @@ -2209,8 +2209,8 @@ namespace OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); if (pTabWin->ExistsField( OUString("*"), aInfo )) { - aInfo->SetAlias(String()); - aInfo->SetTable(String()); + aInfo->SetAlias(OUString()); + aInfo->SetTable(OUString()); break; } } @@ -2245,8 +2245,8 @@ namespace if ( SQL_ISRULE(pColumnRef,general_set_fct) ) { aInfo->SetFunctionType(nFunctionType|FKT_AGGREGATE); - String aCol(aColumns); - aInfo->SetFunction(comphelper::string::stripEnd(aCol.GetToken(0,'('), ' ')); + OUString aCol(aColumns); + aInfo->SetFunction(comphelper::string::stripEnd(aCol.getToken(0,'('), ' ')); } else aInfo->SetFunctionType(nFunctionType|FKT_OTHER); @@ -2438,7 +2438,7 @@ namespace return eErrorCode; } - String getParseErrorMessage( SqlParseError _eErrorCode ) + OUString getParseErrorMessage( SqlParseError _eErrorCode ) { sal_uInt16 nResId; switch(_eErrorCode) @@ -2484,7 +2484,7 @@ namespace break; } ; - return String( ModuleRes( nResId ) ); + return OUString( ModuleRes( nResId ) ); } } @@ -2734,7 +2734,7 @@ SqlParseError OQueryDesignView::InsertField( const OTableFieldDescRef& rInfo, sa sal_Int32 OQueryDesignView::getColWidth(sal_uInt16 _nColPos) const { - static sal_Int32 s_nDefaultWidth = GetTextWidth(String(RTL_CONSTASCII_USTRINGPARAM("0"))) * 15; + static sal_Int32 s_nDefaultWidth = GetTextWidth(OUString("0")) * 15; sal_Int32 nWidth = static_cast<OQueryController&>(getController()).getColWidth(_nColPos); if ( !nWidth ) nWidth = s_nDefaultWidth; @@ -3031,19 +3031,19 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pE // special handling for functions if ( pEntry->GetFunctionType() & (FKT_OTHER | FKT_AGGREGATE | FKT_NUMERIC) ) { - // we have a function here so we have to distinguish the type of return value - String sFunction; + // we have a function here so we have to distinguish the type of return vOUalue + OUString sFunction; if ( pEntry->isNumericOrAggreateFunction() ) sFunction = pEntry->GetFunction(); - if ( !sFunction.Len() ) + if ( sFunction.isEmpty() ) sFunction = pEntry->GetField(); if (comphelper::string::getTokenCount(sFunction, '(') > 1) - sFunction = sFunction.GetToken(0,'('); // this should be the name of the function + sFunction = sFunction.getToken(0,'('); // this should be the name of the function sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType(sFunction,&rParser.getContext()); - if ( nType == DataType::OTHER || (!sFunction.Len() && pEntry->isNumericOrAggreateFunction()) ) + if ( nType == DataType::OTHER || (sFunction.isEmpty() && pEntry->isNumericOrAggreateFunction()) ) { // first try the international version OUString sSql; diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index ecb8c10236ae..8d378e2aa3cd 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -235,7 +235,7 @@ OQueryTableView::~OQueryTableView() DBG_DTOR(OQueryTableView,NULL); } -sal_Int32 OQueryTableView::CountTableAlias(const String& rName, sal_Int32& rMax) +sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMax) { DBG_CHKTHIS(OQueryTableView,NULL); sal_Int32 nRet = 0; @@ -715,10 +715,10 @@ void OQueryTableView::KeyInput( const KeyEvent& rEvt ) OJoinTableView::KeyInput( rEvt ); } -OQueryTableWindow* OQueryTableView::FindTable(const String& rAliasName) +OQueryTableWindow* OQueryTableView::FindTable(const OUString& rAliasName) { DBG_CHKTHIS(OQueryTableView,NULL); - OSL_ENSURE(rAliasName.Len(), "OQueryTableView::FindTable : the AliasName should not be empty !"); + OSL_ENSURE(!rAliasName.isEmpty(), "OQueryTableView::FindTable : the AliasName should not be empty !"); // (it is harmless but does not make sense and indicates that there is probably an error in the caller) OTableWindowMap::const_iterator aIter = GetTabWinMap()->find(rAliasName); if(aIter != GetTabWinMap()->end()) @@ -726,7 +726,7 @@ OQueryTableWindow* OQueryTableView::FindTable(const String& rAliasName) return NULL; } -sal_Bool OQueryTableView::FindTableFromField(const String& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt) +sal_Bool OQueryTableView::FindTableFromField(const OUString& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt) { DBG_CHKTHIS(OQueryTableView,NULL); rCnt = 0; diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 6cb5ad3cd582..059c6f7532ee 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -68,7 +68,7 @@ namespace dbaui sal_Int32 m_nMaxColumns; // maximum number of columns in a Select-Statement - String m_aFunctionStrings; + OUString m_aFunctionStrings; sal_uInt16 m_nVisibleCount; // maximum number of visible rows sal_uInt32 m_nLastSortColumn; // index of last (highest) sort column sal_Bool m_bOrderByUnRelated; @@ -87,7 +87,7 @@ namespace dbaui OTableFieldDescRef InsertField( const OTableFieldDescRef& rInfo, sal_uInt16 _nColumnPosition = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); void InsertColumn( OTableFieldDescRef pEntry, sal_uInt16& _nColumnPosition ); void RemoveColumn( sal_uInt16 _nColumnId ); - void DeleteFields( const String& rAliasName ); + void DeleteFields( const OUString& rAliasName ); bool HasFieldByAliasName(const OUString& rFieldName, OTableFieldDescRef& rInfo) const; @@ -95,7 +95,7 @@ namespace dbaui // the flag is not set void AddGroupBy( const OTableFieldDescRef& rInfo,sal_uInt32 _nCurrentPos); void AddCondition( const OTableFieldDescRef& rInfo, - const String& rValue, + const OUString& rValue, const sal_uInt16 nLevel, bool _bAddOrOnOneLine ); void DuplicateConditionLevel( const sal_uInt16 nLevel); @@ -110,8 +110,8 @@ namespace dbaui void SetColWidth(sal_uInt16 nColId, long lNewWidth); // unlike SetColumnWidth of the base class it checks an active cell in this column - String GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId); - void SetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId, const String& strNewText); + OUString GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId); + void SetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId, const OUString& strNewText); // cell content (formatted as string) set/return sal_Int32 GetNoneVisibleRows() const; void SetNoneVisbleRow(long nRows); @@ -205,7 +205,7 @@ namespace dbaui virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId); - virtual sal_uInt16 GetDefaultColumnWidth(const String& rName) const; + virtual sal_uInt16 GetDefaultColumnWidth(const OUString& rName) const; // if you want to have an own header ... virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent); @@ -227,11 +227,11 @@ namespace dbaui long GetRealRow(long nRow) const; long GetBrowseRow(long nRowId) const; sal_Bool GetFunctionName(sal_uInt32 _nFunctionTokenId, OUString& rFkt); - void appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow,sal_Bool& _bListAction); - void appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow); + void appendUndoAction(const OUString& _rOldValue,const OUString& _rNewValue,sal_Int32 _nRow,sal_Bool& _bListAction); + void appendUndoAction(const OUString& _rOldValue,const OUString& _rNewValue,sal_Int32 _nRow); OTableFields& getFields() const; void enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl); - void setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const OString& _sHelpId); + void setTextCellContext(const OTableFieldDescRef& _rEntry,const OUString& _sText,const OString& _sHelpId); void invalidateUndoRedo(); OTableFieldDescRef getEntry(OTableFields::size_type _nPos); @@ -247,7 +247,7 @@ namespace dbaui @return <TRUE/> if an error occurred otherwise <FALSE/> */ - sal_Bool saveField(String& _sFieldName, OTableFieldDescRef& _pEntry, sal_Bool& _bListAction); + sal_Bool saveField(OUString& _sFieldName, OTableFieldDescRef& _pEntry, sal_Bool& _bListAction); /** sets the table window at the _pEntry @param _pEntry @@ -289,7 +289,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> */ - void notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId); + void notifyTableFieldChanged(const OUString& _sOldAlias,const OUString& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** append an undo action for the function field @param _sOldFunctionName @@ -299,7 +299,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> */ - void notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId); + void notifyFunctionFieldChanged(const OUString& _sOldFunctionName,const OUString& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** clears the function fields of the submitted entry if it doesn't match the SQL standard and append an undo action. E.q. AGGREGATE functions are only valid when the field name isn't an asterix @@ -310,7 +310,7 @@ namespace dbaui @param _bListAction When <TRUE/> an list action will be created. */ - void clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId); + void clearEntryFunctionField(const OUString& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** remove or insert the necessary function types @param _pEntry diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx index 2d7b3be86c26..8ce999d98581 100644 --- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx @@ -34,7 +34,7 @@ OTableConnectionData::OTableConnectionData() OTableConnectionData::OTableConnectionData(const TTableWindowData::value_type& _pReferencingTable ,const TTableWindowData::value_type& _pReferencedTable - ,const String& rConnName ) + ,const OUString& rConnName ) :m_pReferencingTable(_pReferencingTable) ,m_pReferencedTable(_pReferencedTable) ,m_aConnName( rConnName ) @@ -93,7 +93,7 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat return *this; } -sal_Bool OTableConnectionData::SetConnLine( sal_uInt16 nIndex, const String& rSourceFieldName, const String& rDestFieldName ) +sal_Bool OTableConnectionData::SetConnLine( sal_uInt16 nIndex, const OUString& rSourceFieldName, const OUString& rDestFieldName ) { if (sal_uInt16(m_vConnLineData.size()) < nIndex) return sal_False; diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index c32d8319e385..6b734e8b6ee7 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -740,7 +740,7 @@ long OTableWindow::PreNotify(NotifyEvent& rNEvt) return 1L; } -String OTableWindow::getTitle() const +OUString OTableWindow::getTitle() const { return m_aTitle.GetText(); } diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 189bc53fb4c2..af1d3809c75a 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -222,15 +222,15 @@ namespace dbaui namespace { - String lcl_getObjectResourceString( sal_uInt16 _nResId, sal_Int32 _nCommandType ) + OUString lcl_getObjectResourceString( sal_uInt16 _nResId, sal_Int32 _nCommandType ) { - String sMessageText = String( ModuleRes( _nResId ) ); - String sObjectType; + OUString sMessageText = ModuleRes( _nResId ); + OUString sObjectType; { LocalResourceAccess aLocalRes( RSC_QUERY_OBJECT_TYPE, RSC_RESOURCE ); - sObjectType = String( ModuleRes( (sal_uInt16)( _nCommandType + 1 ) ) ); + sObjectType = ModuleRes( (sal_uInt16)( _nCommandType + 1 ) ); } - sMessageText.SearchAndReplace( OUString("$object$"), sObjectType ); + sMessageText = sMessageText.replaceFirst( "$object$", sObjectType ); return sMessageText; } } @@ -639,7 +639,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& if ( m_pSqlIterator->getStatementType() != SQL_STATEMENT_SELECT || xTabs.begin() == xTabs.end() ) { aError = SQLException( - String( ModuleRes( STR_QRY_NOSELECT ) ), + OUString( ModuleRes( STR_QRY_NOSELECT ) ), NULL, "S1000", 1000, @@ -662,7 +662,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& else { aError = SQLException( - String( ModuleRes( STR_QRY_SYNTAX ) ), + OUString( ModuleRes( STR_QRY_SYNTAX ) ), NULL, "S1000", 1000, @@ -692,7 +692,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& break; case SID_BROWSER_CLEAR_QUERY: { - GetUndoManager().EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); + GetUndoManager().EnterListAction( OUString( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString() ); getContainer()->clear(); GetUndoManager().LeaveListAction(); @@ -988,8 +988,8 @@ void OQueryController::impl_initialize() m_nCommandType = CommandType::QUERY; sal_Bool bClose = sal_False; { - String aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) ); - String aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) ); + OUString aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) ); + OUString aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) ); ODataView* pWindow = getView(); OSQLMessageBox aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query ); bClose = aDlg.Execute() == RET_NO; @@ -1006,7 +1006,7 @@ void OQueryController::impl_initialize() if ( !( aView >>= m_xAlterView ) ) { throw IllegalArgumentException( - OUString( String( ModuleRes( STR_NO_ALTER_VIEW_SUPPORT ) ) ), + OUString( ModuleRes( STR_NO_ALTER_VIEW_SUPPORT ) ), *this, 1 ); @@ -1084,8 +1084,8 @@ OUString OQueryController::getPrivateTitle( ) const { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); - String aDefaultName = String( ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ) ); - sName = aDefaultName.GetToken(0,' '); + OUString aDefaultName = ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ); + sName = aDefaultName.getToken(0,' '); sName += OUString::number(getCurrentStartNumber()); } } @@ -1391,13 +1391,13 @@ sal_Bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElement sal_Bool bNew = _bSaveAs || !_xElements->hasByName( m_sName ); if(bNew) { - String aDefaultName; + OUString aDefaultName; if ( ( _bSaveAs && !bNew ) || ( bNew && !m_sName.isEmpty() ) ) - aDefaultName = String( m_sName ); + aDefaultName = m_sName; else { - String sName = String( ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ) ); - aDefaultName = sName.GetToken(0,' '); + OUString sName = ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ); + aDefaultName = sName.getToken(0,' '); aDefaultName = ::dbtools::createUniqueName(_xElements,aDefaultName); } @@ -1430,7 +1430,7 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!"); if ( !editingCommand() && !haveDataSource() ) { - String aMessage(ModuleRes(STR_DATASOURCE_DELETED)); + OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED)); OSQLWarningBox( getView(), aMessage ).Execute(); return false; } @@ -1781,7 +1781,7 @@ OUString OQueryController::translateStatement( bool _bFireStatementChange ) else if(m_sStatement.isEmpty()) { ModuleRes aModuleRes(STR_QRY_NOSELECT); - String sTmpStr(aModuleRes); + OUString sTmpStr(aModuleRes); OUString sError(sTmpStr); showError(SQLException(sError,NULL,"S1000",1000,Any())); } @@ -1805,7 +1805,7 @@ short OQueryController::saveModified() ) ) { - String sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) ); + OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) ); QueryBox aQry( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ); nRet = aQry.Execute(); @@ -1917,7 +1917,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings { if ( !i_bForceCurrentControllerSettings && !editingView() ) { - String aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR)); + OUString aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR)); OSQLMessageBox aDlg(getView(),aTitle,aErrorMsg); aDlg.Execute(); } diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index ed16d84860a2..354fd56f5bc6 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx @@ -64,7 +64,7 @@ ORelationTableConnectionData::ORelationTableConnectionData( const TTableWindowDa DBG_CTOR(ORelationTableConnectionData,NULL); m_aConnName = rConnName; - if ( m_aConnName.Len() ) + if ( !m_aConnName.isEmpty() ) SetCardinality(); } @@ -86,7 +86,7 @@ sal_Bool ORelationTableConnectionData::DropRelation() ::osl::MutexGuard aGuard( m_aMutex ); // Relation loeschen Reference< XIndexAccess> xKeys = getReferencingTable()->getKeys(); - if( m_aConnName.Len() && xKeys.is() ) + if( !m_aConnName.isEmpty() && xKeys.is() ) { const sal_Int32 nCount = xKeys->getCount(); for(sal_Int32 i = 0;i < nCount;++i) diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index af425a1eb98c..a6b5fbad7e62 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -932,7 +932,7 @@ void OTableEditorCtrl::InsertNewRows( long nRow ) InvalidateFeatures(); } -String OTableEditorCtrl::GetControlText( long nRow, sal_uInt16 nColId ) +OUString OTableEditorCtrl::GetControlText( long nRow, sal_uInt16 nColId ) { DBG_CHKTHIS(OTableEditorCtrl,NULL); // Read the Browser Controls @@ -952,7 +952,7 @@ String OTableEditorCtrl::GetControlText( long nRow, sal_uInt16 nColId ) return pDescrWin->GetControlText( nColId ); } -void OTableEditorCtrl::SetControlText( long nRow, sal_uInt16 nColId, const String& rText ) +void OTableEditorCtrl::SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) { DBG_CHKTHIS(OTableEditorCtrl,NULL); // Set the Browser Controls diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index ce8e8ddce6d3..c56363eb6ffe 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -144,8 +144,8 @@ namespace dbaui virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ); virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rSaveData ); virtual ::com::sun::star::uno::Any GetCellData( long nRow, sal_uInt16 nColId ); - virtual void SetControlText( long nRow, sal_uInt16 nColId, const String& rText ); - virtual String GetControlText( long nRow, sal_uInt16 nColId ); + virtual void SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ); + virtual OUString GetControlText( long nRow, sal_uInt16 nColId ); virtual OTableDesignView* GetView() const; diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index db9a5ca5da3d..eb8936c9bf60 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -159,7 +159,7 @@ OTableController::OTableController(const Reference< XComponentContext >& _rM) : InvalidateAll(); m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); - m_pTypeInfo->aUIName = m_sTypeNames.GetToken(TYPE_OTHER); + m_pTypeInfo->aUIName = m_sTypeNames.getToken(TYPE_OTHER, ';'); } OTableController::~OTableController() diff --git a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx index bf949420c901..84d64ff56739 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx @@ -44,7 +44,7 @@ OTableDesignHelpBar::~OTableDesignHelpBar() m_pTextWin = NULL; } -void OTableDesignHelpBar::SetHelpText( const String& rText ) +void OTableDesignHelpBar::SetHelpText( const OUString& rText ) { DBG_CHKTHIS(OTableDesignHelpBar,NULL); if(m_pTextWin) |