summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-27 12:04:57 +0200
committerNoel Grandin <noel@peralex.com>2013-10-01 10:08:44 +0200
commitb47e4dbc08b782824000f4be477c5d7fa62f51e7 (patch)
tree224fb61bcc16143ba5343445fe789673eef50dee
parent4068562f5d46a7f743d04386647920c0b7094f24 (diff)
convert more of dbaccess from String to OUString
seemed to have missed this the first time around Change-Id: I8b7b78c95c576b178e3e181c7589da81e5189ee3
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx4
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx12
-rw-r--r--dbaccess/source/ui/querydesign/QueryTextView.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx200
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowTitle.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/querydlg.cxx18
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnection.cxx16
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnectionData.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx6
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx8
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx8
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx66
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.hxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx48
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldControl.hxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx8
-rw-r--r--dbaccess/source/ui/tabledesign/TableRow.cxx2
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx24
22 files changed, 224 insertions, 226 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
index 129e5454bd37..61c2f42b88cf 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
@@ -53,7 +53,7 @@ namespace dbaui
class OTabFieldCellModifiedUndoAct : public OQueryDesignFieldUndoAct
{
protected:
- String m_strNextCellContents;
+ OUString m_strNextCellContents;
sal_Int32 m_nCellIndex;
public:
@@ -61,7 +61,7 @@ namespace dbaui
: OQueryDesignFieldUndoAct(pSelBrwBox, STR_QUERY_UNDO_MODIFY_CELL)
,m_nCellIndex(BROWSER_INVALIDID){ }
- inline void SetCellContents(const String& str) { m_strNextCellContents = str; }
+ inline void SetCellContents(const OUString& str) { m_strNextCellContents = str; }
inline void SetCellIndex(sal_Int32 nIndex) { m_nCellIndex = nIndex; }
virtual void Undo();
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
index 85b895c32fa8..bda12abf833b 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
@@ -83,7 +83,7 @@ void OTabFieldCellModifiedUndoAct::Undo()
if ( m_nColumnPostion != BROWSER_INVALIDID )
{
sal_uInt16 nColumnId = pOwner->GetColumnId(m_nColumnPostion);
- String strNext = pOwner->GetCellContents(m_nCellIndex, nColumnId);
+ OUString strNext = pOwner->GetCellContents(m_nCellIndex, nColumnId);
pOwner->SetCellContents(m_nCellIndex, nColumnId, m_strNextCellContents);
m_strNextCellContents = strNext;
}
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 8d378e2aa3cd..5c2ce8656886 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -260,7 +260,7 @@ void OQueryTableView::ReSync()
"before calling OQueryTableView::ReSync() please call ClearAll !");
// I need a collection of all window names that cannot be created so that I do not initialize connections for them.
- ::std::vector<String> arrInvalidTables;
+ ::std::vector<OUString> arrInvalidTables;
TTableWindowData::reverse_iterator aIter = pTabWinDataList->rbegin();
// Create the window and add it
@@ -302,7 +302,7 @@ void OQueryTableView::ReSync()
OQueryTableConnectionData* pTabConnData = static_cast<OQueryTableConnectionData*>(aConIter->get());
// do both tables for the connection exist ?
- String strTabExistenceTest = pTabConnData->getReferencingTable()->GetWinName();
+ OUString strTabExistenceTest = pTabConnData->getReferencingTable()->GetWinName();
sal_Bool bInvalid = ::std::find(arrInvalidTables.begin(),arrInvalidTables.end(),strTabExistenceTest) != arrInvalidTables.end();
strTabExistenceTest = pTabConnData->getReferencedTable()->GetWinName();
bInvalid = bInvalid && ::std::find(arrInvalidTables.begin(),arrInvalidTables.end(),strTabExistenceTest) != arrInvalidTables.end();
@@ -601,7 +601,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ
OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>(jxdSource.pListBox->GetTabWin());
OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>(jxdDest.pListBox->GetTabWin());
- String aSourceFieldName, aDestFieldName;
+ OUString aSourceFieldName, aDestFieldName;
aSourceFieldName = jxdSource.pListBox->GetEntryText(jxdSource.pEntry);
aDestFieldName = jxdDest.pListBox->GetEntryText(jxdDest.pEntry);
@@ -644,7 +644,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ
// the connection could point on the other side
if(pConn->GetSourceWin() == pDestWin)
{
- String aTmp(aSourceFieldName);
+ OUString aTmp(aSourceFieldName);
aSourceFieldName = aDestFieldName;
aDestFieldName = aTmp;
}
@@ -771,7 +771,7 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin)
OQueryDesignView* pParent = static_cast<OQueryDesignView*>(getDesignView());
SfxUndoManager& rUndoMgr = m_pView->getController().GetUndoManager();
- rUndoMgr.EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() );
+ rUndoMgr.EnterListAction( OUString( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString() );
// add the Undo-Action
OQueryTabWinDelUndoAct* pUndoAction = new OQueryTabWinDelUndoAct(this);
@@ -1001,7 +1001,7 @@ sal_Bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) con
void OQueryTableView::onNoColumns_throw()
{
- String sError( ModuleRes( STR_STATEMENT_WITHOUT_RESULT_SET ) );
+ OUString sError( ModuleRes( STR_STATEMENT_WITHOUT_RESULT_SET ) );
::dbtools::throwSQLException( sError, ::dbtools::SQL_GENERAL_ERROR, NULL );
}
diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx
index 4bf48814ec49..a42e3b9767d4 100644
--- a/dbaccess/source/ui/querydesign/QueryTextView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx
@@ -93,7 +93,7 @@ void OQueryTextView::clear()
pUndoAct->SetOriginalText( m_pEdit->GetText() );
getContainerWindow()->getDesignView()->getController().addUndoActionAndInvalidate( pUndoAct );
- m_pEdit->SetText(String());
+ m_pEdit->SetText(OUString());
}
void OQueryTextView::setStatement(const OUString& _rsStatement)
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 6f4d85402ca9..ca189a1d1e88 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -68,10 +68,10 @@ namespace
sal_Bool bAsterix = !(!_sFieldName.isEmpty() && _sFieldName.toChar() != '*');
if ( !bAsterix )
{
- String sName = _sFieldName;
+ OUString sName = _sFieldName;
xub_StrLen nTokenCount = comphelper::string::getTokenCount(sName, '.');
- if ( (nTokenCount == 2 && sName.GetToken(1,'.').GetChar(0) == '*' )
- || (nTokenCount == 3 && sName.GetToken(2,'.').GetChar(0) == '*' ) )
+ if ( (nTokenCount == 2 && sName.getToken(1,'.')[0] == '*' )
+ || (nTokenCount == 3 && sName.getToken(2,'.')[0] == '*' ) )
{
bAsterix = sal_True;
}
@@ -138,11 +138,11 @@ OSelectionBrowseBox::OSelectionBrowseBox( Window* pParent )
aTitleFont.SetSize(Size(0, 6));
SetTitleFont(aTitleFont);
- String aTxt(ModuleRes(STR_QUERY_SORTTEXT));
+ OUString aTxt(ModuleRes(STR_QUERY_SORTTEXT));
xub_StrLen nCount = comphelper::string::getTokenCount(aTxt, ';');
xub_StrLen nIdx = 0;
for (; nIdx < nCount; nIdx++)
- m_pOrderCell->InsertEntry(aTxt.GetToken(nIdx));
+ m_pOrderCell->InsertEntry(aTxt.getToken(nIdx, ';'));
for(long i=0;i < BROW_ROW_CNT;i++)
m_bVisibleRow.push_back(sal_True);
@@ -186,16 +186,16 @@ void OSelectionBrowseBox::initialize()
,IParseContext::KEY_INTERSECTION
};
- String sGroup = m_aFunctionStrings.GetToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';') - 1);
- m_aFunctionStrings = m_aFunctionStrings.GetToken(0);
+ OUString sGroup = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';') - 1, ';');
+ m_aFunctionStrings = m_aFunctionStrings.getToken(0, ';');
for (size_t i = 0; i < sizeof (eFunctions) / sizeof (eFunctions[0]); ++i)
{
- m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";"));
+ m_aFunctionStrings += ";";
m_aFunctionStrings += OStringToOUString(rContext.getIntlKeywordAscii(eFunctions[i]),
RTL_TEXTENCODING_UTF8);
}
- m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";"));
+ m_aFunctionStrings += ";";
m_aFunctionStrings += sGroup;
// Aggregate functions in general available only with Core SQL
@@ -204,12 +204,12 @@ void OSelectionBrowseBox::initialize()
{
xub_StrLen nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';');
for (xub_StrLen nIdx = 0; nIdx < nCount; nIdx++)
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(nIdx));
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(nIdx, ';'));
}
else // else only COUNT(*) and COUNT("table".*)
{
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(0));
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(2)); // 2 -> COUNT
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';'));
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(2, ';')); // 2 -> COUNT
}
try
{
@@ -476,7 +476,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
case BROW_FIELD_ROW:
{
m_pFieldCell->Clear();
- m_pFieldCell->SetText(String());
+ m_pFieldCell->SetText(OUString());
OUString aField(pEntry->GetField());
OUString aTable(pEntry->GetAlias());
@@ -505,11 +505,11 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
for(;aIter != aEnd;++aIter)
m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second)->GetAliasName());
- m_pTableCell->InsertEntry(String(ModuleRes(STR_QUERY_NOTABLE)), 0);
+ m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0);
if (!pEntry->GetAlias().isEmpty())
m_pTableCell->SelectEntry(pEntry->GetAlias());
else
- m_pTableCell->SelectEntry(String(ModuleRes(STR_QUERY_NOTABLE)));
+ m_pTableCell->SelectEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)));
}
}
} break;
@@ -528,7 +528,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
m_pVisibleCell->GetBox().SaveValue();
m_pVisibleCell->GetBox().Disable();
m_pVisibleCell->GetBox().EnableInput(sal_False);
- String aMessage(ModuleRes(STR_QRY_ORDERBY_UNRELATED));
+ OUString aMessage(ModuleRes(STR_QRY_ORDERBY_UNRELATED));
OQueryDesignView* paDView = getDesignView();
InfoBox(paDView, aMessage).Execute();
}
@@ -553,14 +553,14 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
Controller()->ClearModified();
}
-void OSelectionBrowseBox::notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId)
+void OSelectionBrowseBox::notifyTableFieldChanged(const OUString& _sOldAlias,const OUString& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId)
{
appendUndoAction(_sOldAlias,_sAlias,BROW_TABLE_ROW,_bListAction);
if ( m_bVisibleRow[BROW_TABLE_ROW] )
RowModified(GetBrowseRow(BROW_TABLE_ROW), _nColumnId);
}
-void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId)
+void OSelectionBrowseBox::notifyFunctionFieldChanged(const OUString& _sOldFunctionName,const OUString& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId)
{
appendUndoAction(_sOldFunctionName,_sFunctionName,BROW_FUNCTION_ROW,_bListAction);
if ( !m_bVisibleRow[BROW_FUNCTION_ROW] )
@@ -568,14 +568,14 @@ void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunction
RowModified(GetBrowseRow(BROW_FUNCTION_ROW), _nColumnId);
}
-void OSelectionBrowseBox::clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId)
+void OSelectionBrowseBox::clearEntryFunctionField(const OUString& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId)
{
if ( isFieldNameAsterix( _sFieldName ) && (!_pEntry->isNoneFunction() || _pEntry->IsGroupBy()) )
{
OUString sFunctionName;
GetFunctionName(SQL_TOKEN_COUNT,sFunctionName);
- String sOldLocalizedFunctionName = _pEntry->GetFunction();
- if ( !sOldLocalizedFunctionName.Equals(sFunctionName) || _pEntry->IsGroupBy() )
+ OUString sOldLocalizedFunctionName = _pEntry->GetFunction();
+ if ( sOldLocalizedFunctionName != sFunctionName || _pEntry->IsGroupBy() )
{
// append undo action for the function field
_pEntry->SetFunctionType(FKT_NONE);
@@ -621,15 +621,15 @@ sal_Bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName,const O
sal_uInt16 nTabCount = 0;
if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occurred: column not in table window
{
- String sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST));
- sErrorMsg.SearchAndReplaceAscii("$name$",_sColumnName);
+ OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST));
+ sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName);
OSQLErrorBox( this, sErrorMsg ).Execute();
bError = sal_True;
}
else
{
pEntryTab = static_cast<OQueryTableWindow*>(_pEntry->GetTabWindow());
- notifyTableFieldChanged(String(),_pEntry->GetAlias(),_bListAction,GetCurColumnId());
+ notifyTableFieldChanged(OUString(),_pEntry->GetAlias(),_bListAction,GetCurColumnId());
}
}
}
@@ -639,7 +639,7 @@ sal_Bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName,const O
return bError;
}
-sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef& _pEntry, sal_Bool& _bListAction)
+sal_Bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _pEntry, sal_Bool& _bListAction)
{
sal_Bool bError = sal_False;
@@ -647,7 +647,7 @@ sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef&
// first look if the name can be found in our tables
sal_uInt16 nTabCount = 0;
- String sOldAlias = _pEntry->GetAlias();
+ OUString sOldAlias = _pEntry->GetAlias();
if ( static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sFieldName,_pEntry,nTabCount) )
{
// append undo action for the alias name
@@ -727,8 +727,8 @@ sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef&
if ( pParseNode == NULL )
{
// something different which we have to check
- String sErrorMessage( ModuleRes( STR_QRY_COLUMN_NOT_FOUND ) );
- sErrorMessage.SearchAndReplaceAscii("$name$",_sFieldName);
+ OUString sErrorMessage( ModuleRes( STR_QRY_COLUMN_NOT_FOUND ) );
+ sErrorMessage = sErrorMessage.replaceFirst("$name$",_sFieldName);
OSQLErrorBox( this, sErrorMessage ).Execute();
return sal_True;
@@ -771,7 +771,7 @@ sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef&
OUString sColumnAlias = OSQLParseTreeIterator::getColumnAlias(pChild);
if ( !sColumnAlias.isEmpty() ) // we found an as clause
{
- String aSelectionAlias = aSelEntry->GetFieldAlias();
+ OUString aSelectionAlias = aSelEntry->GetFieldAlias();
aSelEntry->SetFieldAlias( sColumnAlias );
// append undo
appendUndoAction(aSelectionAlias,aSelEntry->GetFieldAlias(),BROW_COLUMNALIAS_ROW,_bListAction);
@@ -803,7 +803,7 @@ sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef&
OUString sLocalizedFunctionName;
if ( GetFunctionName(pColumnRef->getChild(0)->getTokenID(),sLocalizedFunctionName) )
{
- String sOldLocalizedFunctionName = aSelEntry->GetFunction();
+ OUString sOldLocalizedFunctionName = aSelEntry->GetFunction();
aSelEntry->SetFunction(sLocalizedFunctionName);
sal_uInt32 nFunCount = pColumnRef->count() - 1;
sal_Int32 nFunctionType = FKT_AGGREGATE;
@@ -830,7 +830,7 @@ sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef&
aSelEntry->SetField(sParameters);
if ( aSelEntry->IsGroupBy() )
{
- sOldLocalizedFunctionName = m_aFunctionStrings.GetToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1);
+ sOldLocalizedFunctionName = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';');
aSelEntry->SetGroupBy(sal_False);
}
@@ -884,8 +884,8 @@ sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef&
if ( i > 0 && !InsertField(aSelEntry,BROWSER_INVALIDID,sal_True,sal_False).is() ) // may we have to append more than one field
{ // the field could not be inserted
- String sErrorMessage( ModuleRes( RID_STR_FIELD_DOESNT_EXIST ) );
- sErrorMessage.SearchAndReplaceAscii("$name$",aSelEntry->GetField());
+ OUString sErrorMessage( ModuleRes( RID_STR_FIELD_DOESNT_EXIST ) );
+ sErrorMessage = sErrorMessage.replaceFirst("$name$",aSelEntry->GetField());
OSQLErrorBox( this, sErrorMessage ).Execute();
bError = sal_True;
}
@@ -912,7 +912,7 @@ sal_Bool OSelectionBrowseBox::SaveModified()
if (pEntry.is() && Controller().Is() && Controller()->IsModified())
{
// for the Undo-action
- String strOldCellContents,sNewValue;
+ OUString strOldCellContents,sNewValue;
long nRow = GetRealRow(GetCurRow());
sal_Bool bAppendRow = sal_False;
switch (nRow)
@@ -937,10 +937,10 @@ sal_Bool OSelectionBrowseBox::SaveModified()
case BROW_FIELD_ROW:
{
- String aFieldName(m_pFieldCell->GetText());
+ OUString aFieldName(m_pFieldCell->GetText());
try
{
- if (!aFieldName.Len())
+ if (aFieldName.isEmpty())
{
OTableFieldDescRef pNewEntry = new OTableFieldDesc();
pNewEntry->SetColumnId( pEntry->GetColumnId() );
@@ -954,15 +954,15 @@ sal_Bool OSelectionBrowseBox::SaveModified()
strOldCellContents = pEntry->GetField();
bListAction = sal_True;
if ( !m_bInUndoMode )
- rController.GetUndoManager().EnterListAction(String(),String());
+ rController.GetUndoManager().EnterListAction(OUString(),OUString());
sal_uInt16 nPos = m_pFieldCell->GetEntryPos(aFieldName);
- String aAliasName = pEntry->GetAlias();
- if ( nPos != COMBOBOX_ENTRY_NOTFOUND && !aAliasName.Len() && comphelper::string::getTokenCount(aFieldName, '.') > 1 )
+ OUString aAliasName = pEntry->GetAlias();
+ if ( nPos != COMBOBOX_ENTRY_NOTFOUND && aAliasName.isEmpty() && comphelper::string::getTokenCount(aFieldName, '.') > 1 )
{ // special case, we have a table field so we must cut the table name
- String sTableAlias = aFieldName.GetToken(0,'.');
+ OUString sTableAlias = aFieldName.getToken(0,'.');
pEntry->SetAlias(sTableAlias);
- String sColumnName = aFieldName.Copy(sTableAlias.Len()+1,aFieldName.Len() - sTableAlias.Len() -1);
+ OUString sColumnName = aFieldName.copy(sTableAlias.getLength()+1,aFieldName.getLength() - sTableAlias.getLength() -1);
Reference<XConnection> xConnection = rController.getConnection();
if ( !xConnection.is() )
return sal_False;
@@ -994,7 +994,7 @@ sal_Bool OSelectionBrowseBox::SaveModified()
case BROW_TABLE_ROW:
{
- String aAliasName = m_pTableCell->GetSelectEntry();
+ OUString aAliasName = m_pTableCell->GetSelectEntry();
strOldCellContents = pEntry->GetAlias();
if ( m_pTableCell->GetSelectEntryPos() != 0 )
{
@@ -1051,8 +1051,8 @@ sal_Bool OSelectionBrowseBox::SaveModified()
strOldCellContents = pEntry->GetFunction();
sal_uInt16 nPos = m_pFunctionCell->GetSelectEntryPos();
// these functions are only available in CORE
- String sFunctionName = m_pFunctionCell->GetEntry(nPos);
- OUString sGroupFunctionName = m_aFunctionStrings.GetToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1);
+ OUString sFunctionName = m_pFunctionCell->GetEntry(nPos);
+ OUString sGroupFunctionName = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';');
sal_Bool bGroupBy = sal_False;
if ( sGroupFunctionName.equals(sFunctionName) ) // check if the function name is GROUP
{
@@ -1067,7 +1067,7 @@ sal_Bool OSelectionBrowseBox::SaveModified()
RowModified(GetBrowseRow(BROW_VIS_ROW), GetCurColumnId());
}
- pEntry->SetFunction(String());
+ pEntry->SetFunction(OUString());
pEntry->SetFunctionType(pEntry->GetFunctionType() & ~FKT_AGGREGATE );
}
else if ( nPos ) // we found an aggregate function
@@ -1077,8 +1077,8 @@ sal_Bool OSelectionBrowseBox::SaveModified()
}
else
{
- sFunctionName = String();
- pEntry->SetFunction(String());
+ sFunctionName = OUString();
+ pEntry->SetFunction(OUString());
pEntry->SetFunctionType(pEntry->GetFunctionType() & ~FKT_AGGREGATE );
}
@@ -1094,10 +1094,10 @@ sal_Bool OSelectionBrowseBox::SaveModified()
break;
sal_uInt16 nIdx = sal_uInt16(nRow - BROW_CRIT1_ROW);
- String aText = comphelper::string::stripStart(m_pTextCell->GetText(), ' ');
+ OUString aText = comphelper::string::stripStart(m_pTextCell->GetText(), ' ');
OUString aCrit;
- if(aText.Len())
+ if(!aText.isEmpty())
{
OUString aErrorMsg;
Reference<XPropertySet> xColumn;
@@ -1127,12 +1127,10 @@ sal_Bool OSelectionBrowseBox::SaveModified()
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
case DataType::CLOB:
- if(aText.GetChar(0) != '\'' || aText.GetChar(aText.Len() -1) != '\'')
+ if(aText[0] != '\'' || aText[aText.getLength() -1] != '\'')
{
- aText.SearchAndReplaceAll(OUString("'"), OUString("''"));
- String aTmp(OUString("'"));
- (aTmp += aText) += OUString("'");
- aText = aTmp;
+ aText = aText.replaceAll("'", "''");
+ aText = "'" + aText + "'";
}
break;
default:
@@ -1259,13 +1257,13 @@ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& r
DBG_CHKTHIS(OSelectionBrowseBox,NULL);
Rectangle aRect(rRect);
aRect.TopLeft().Y() -= 2;
- String aLabel(ModuleRes(STR_QUERY_HANDLETEXT));
+ OUString aLabel(ModuleRes(STR_QUERY_HANDLETEXT));
// from BROW_CRIT2_ROW onwards all rows are shown "or"
xub_StrLen nToken = (xub_StrLen) (m_nSeekRow >= GetBrowseRow(BROW_CRIT2_ROW))
?
xub_StrLen(BROW_CRIT2_ROW) : xub_StrLen(GetRealRow(m_nSeekRow));
- rDev.DrawText(aRect, aLabel.GetToken(nToken),TEXT_DRAW_VCENTER);
+ rDev.DrawText(aRect, aLabel.getToken(nToken, ';'),TEXT_DRAW_VCENTER);
}
void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId)
@@ -1289,7 +1287,7 @@ void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId)
getFields().push_back(pEntry);
EditBrowseBox::RemoveColumn( _nColumnId );
- InsertDataColumn( _nColumnId , String(), DEFAULT_SIZE, HIB_STDSTYLE, HEADERBAR_APPEND);
+ InsertDataColumn( _nColumnId , OUString(), DEFAULT_SIZE, HIB_STDSTYLE, HEADERBAR_APPEND);
// Neuzeichnen
Rectangle aInvalidRect = GetInvalidRect( _nColumnId );
@@ -1443,13 +1441,13 @@ OTableFieldDescRef OSelectionBrowseBox::AppendNewCol( sal_uInt16 nCnt)
sal_uInt16 nColumnId = sal::static_int_cast< sal_uInt16 >(getFields().size());
pEmptyEntry->SetColumnId( nColumnId );
- InsertDataColumn( nColumnId , String(), DEFAULT_SIZE, HIB_STDSTYLE, HEADERBAR_APPEND);
+ InsertDataColumn( nColumnId , OUString(), DEFAULT_SIZE, HIB_STDSTYLE, HEADERBAR_APPEND);
}
return getFields()[nCount];
}
-void OSelectionBrowseBox::DeleteFields(const String& rAliasName)
+void OSelectionBrowseBox::DeleteFields(const OUString& rAliasName)
{
DBG_CHKTHIS(OSelectionBrowseBox,NULL);
if (!getFields().empty())
@@ -1581,7 +1579,7 @@ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxd
return NULL;
// name and position of the selected field
- String aFieldName = jxdSource.pListBox->GetEntryText(jxdSource.pEntry);
+ OUString aFieldName = jxdSource.pListBox->GetEntryText(jxdSource.pEntry);
sal_uInt32 nFieldIndex = jxdSource.pListBox->GetModel()->GetAbsPos(jxdSource.pEntry);
OTableFieldInfo* pInf = static_cast<OTableFieldInfo*>(jxdSource.pEntry->GetUserData());
@@ -1755,7 +1753,7 @@ void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel)
}
}
-void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const String& rValue, const sal_uInt16 nLevel,bool _bAddOrOnOneLine )
+void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const OUString& rValue, const sal_uInt16 nLevel,bool _bAddOrOnOneLine )
{
Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection();
if(!xConnection.is())
@@ -1809,15 +1807,15 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S
}
if ( pLastEntry.is() )
{
- String sCriteria = rValue;
- String sOldCriteria = pLastEntry->GetCriteria( nLevel );
- if ( sOldCriteria.Len() )
+ OUString sCriteria = rValue;
+ OUString sOldCriteria = pLastEntry->GetCriteria( nLevel );
+ if ( !sOldCriteria.isEmpty() )
{
- sCriteria = String(RTL_CONSTASCII_USTRINGPARAM("( "));
+ sCriteria = "( ";
sCriteria += sOldCriteria;
- sCriteria += String(RTL_CONSTASCII_USTRINGPARAM(" OR "));
+ sCriteria += " OR ";
sCriteria += rValue;
- sCriteria += String(RTL_CONSTASCII_USTRINGPARAM(" )"));
+ sCriteria += " )";
}
pLastEntry->SetCriteria( nLevel, sCriteria);
if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1))
@@ -2171,7 +2169,7 @@ OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const
if ( pEntry->IsEmpty() )
return OUString();
- String aText;
+ OUString aText;
switch (nRow)
{
case BROW_TABLE_ROW:
@@ -2179,19 +2177,19 @@ OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const
break;
case BROW_FIELD_ROW:
{
- String aField = pEntry->GetField();
- if (aField.GetChar(0) == '*') // * durch alias.* ersetzen
+ OUString aField = pEntry->GetField();
+ if (aField[0] == '*') // * durch alias.* ersetzen
{
aField = pEntry->GetAlias();
- if(aField.Len())
- aField += '.';
- aField += '*';
+ if(!aField.isEmpty())
+ aField += ".";
+ aField += "*";
}
aText = aField;
} break;
case BROW_ORDER_ROW:
if (pEntry->GetOrderDir() != ORDER_NONE)
- aText = String(ModuleRes(STR_QUERY_SORTTEXT) ).GetToken(sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir()));
+ aText = OUString(ModuleRes(STR_QUERY_SORTTEXT)).getToken(sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir()), ';');
break;
case BROW_VIS_ROW:
break;
@@ -2201,7 +2199,7 @@ OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const
case BROW_FUNCTION_ROW:
// we always show the group function at first
if ( pEntry->IsGroupBy() )
- aText = m_aFunctionStrings.GetToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1);
+ aText = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';');
else if ( pEntry->isNumericOrAggreateFunction() )
aText = pEntry->GetFunction();
break;
@@ -2268,9 +2266,9 @@ sal_Bool OSelectionBrowseBox::GetFunctionName(sal_uInt32 _nFunctionTokenId, OUSt
xub_StrLen i;
for ( i = 0; i < nCount-1; i++) // grouping is not counted
{
- if(rFkt.equalsIgnoreAsciiCase(m_aFunctionStrings.GetToken(i)))
+ if(rFkt.equalsIgnoreAsciiCase(m_aFunctionStrings.getToken(i, ';')))
{
- rFkt = m_aFunctionStrings.GetToken(i);
+ rFkt = m_aFunctionStrings.getToken(i, ';');
break;
}
}
@@ -2282,7 +2280,7 @@ sal_Bool OSelectionBrowseBox::GetFunctionName(sal_uInt32 _nFunctionTokenId, OUSt
return bErg;
}
-String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId)
+OUString OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId)
{
DBG_CHKTHIS(OSelectionBrowseBox,NULL);
if ( GetCurColumnId() == nColId && !m_bInUndoMode )
@@ -2308,7 +2306,7 @@ String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nCo
}
}
-void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, const String& strNewText)
+void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, const OUString& strNewText)
{
DBG_CHKTHIS(OSelectionBrowseBox,NULL);
sal_Bool bWasEditing = IsEditing() && (GetCurColumnId() == nColId) && IsRowVisible(static_cast<sal_uInt16>(nRow)) && (GetCurRow() == static_cast<sal_uInt16>(GetBrowseRow(nRow)));
@@ -2322,7 +2320,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con
switch (nRow)
{
case BROW_VIS_ROW:
- pEntry->SetVisible(strNewText.Equals(g_strOne));
+ pEntry->SetVisible(strNewText == g_strOne);
break;
case BROW_FIELD_ROW:
pEntry->SetField(strNewText);
@@ -2332,7 +2330,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con
break;
case BROW_ORDER_ROW:
{
- sal_uInt16 nIdx = (sal_uInt16)strNewText.ToInt32();
+ sal_uInt16 nIdx = (sal_uInt16)strNewText.toInt32();
pEntry->SetOrderDir(EOrderDir(nIdx));
} break;
case BROW_COLUMNALIAS_ROW:
@@ -2340,7 +2338,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con
break;
case BROW_FUNCTION_ROW:
{
- OUString sGroupFunctionName = m_aFunctionStrings.GetToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1);
+ OUString sGroupFunctionName = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';');
pEntry->SetFunction(strNewText);
// first reset this two member
sal_Int32 nFunctionType = pEntry->GetFunctionType();
@@ -2351,7 +2349,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con
if ( sGroupFunctionName.equalsIgnoreAsciiCase(strNewText) )
pEntry->SetGroupBy(sal_True);
- else if ( strNewText.Len() )
+ else if ( !strNewText.isEmpty() )
{
nFunctionType |= FKT_AGGREGATE;
pEntry->SetFunctionType(nFunctionType);
@@ -2426,11 +2424,11 @@ sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId
OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::GetTotalCellWidth : invalid FieldDescription !");
long nRow = GetRealRow(nRowId);
- String strText(GetCellText(nRow, nColId));
+ OUString strText(GetCellText(nRow, nColId));
return GetDataWindow().LogicToPixel(Size(GetDataWindow().GetTextWidth(strText),0)).Width();
}
-sal_uInt16 OSelectionBrowseBox::GetDefaultColumnWidth(const String& /*rName*/) const
+sal_uInt16 OSelectionBrowseBox::GetDefaultColumnWidth(const OUString& /*rName*/) const
{
DBG_CHKTHIS(OSelectionBrowseBox,NULL);
// the base class makes it dependent on the text. I have no column headers, therefore I
@@ -2529,22 +2527,22 @@ void OSelectionBrowseBox::copy()
}
}
-void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow,sal_Bool& _bListAction)
+void OSelectionBrowseBox::appendUndoAction(const OUString& _rOldValue,const OUString& _rNewValue,sal_Int32 _nRow,sal_Bool& _bListAction)
{
- if ( !m_bInUndoMode && !_rNewValue.Equals(_rOldValue) )
+ if ( !m_bInUndoMode && _rNewValue != _rOldValue )
{
if ( !_bListAction )
{
_bListAction = sal_True;
- static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(String(),String());
+ static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(OUString(),OUString());
}
appendUndoAction(_rOldValue,_rNewValue,_nRow);
}
}
-void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow)
+void OSelectionBrowseBox::appendUndoAction(const OUString& _rOldValue,const OUString& _rNewValue,sal_Int32 _nRow)
{
- if ( !m_bInUndoMode && !_rNewValue.Equals(_rOldValue) )
+ if ( !m_bInUndoMode && _rNewValue != _rOldValue )
{
OTabFieldCellModifiedUndoAct* pUndoAct = new OTabFieldCellModifiedUndoAct(this);
pUndoAct->SetCellIndex(_nRow);
@@ -2592,7 +2590,7 @@ void OSelectionBrowseBox::enableControl(const OTableFieldDescRef& _rEntry,Window
_pControl->EnableInput(bEnable);
}
-void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const OString& _sHelpId)
+void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const OUString& _sText,const OString& _sHelpId)
{
m_pTextCell->SetText(_sText);
m_pTextCell->ClearModifyFlag();
@@ -2603,7 +2601,7 @@ void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,c
if (m_pTextCell->GetHelpId() != _sHelpId)
// as TextCell is used in various contexts I will delete the cached HelpText
- m_pTextCell->SetHelpText(String());
+ m_pTextCell->SetHelpText(OUString());
m_pTextCell->SetHelpId(_sHelpId);
}
@@ -2649,13 +2647,13 @@ void OSelectionBrowseBox::DeactivateCell(sal_Bool _bUpdate)
OUString OSelectionBrowseBox::GetRowDescription( sal_Int32 _nRow ) const
{
- String aLabel(ModuleRes(STR_QUERY_HANDLETEXT));
+ OUString aLabel(ModuleRes(STR_QUERY_HANDLETEXT));
// from BROW_CRIT2_ROW onwards all rows are shown as "or"
xub_StrLen nToken = (xub_StrLen) (_nRow >= GetBrowseRow(BROW_CRIT2_ROW))
?
xub_StrLen(BROW_CRIT2_ROW) : xub_StrLen(GetRealRow(_nRow));
- return OUString(aLabel.GetToken(nToken));
+ return aLabel.getToken(nToken, ';');
}
OUString OSelectionBrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eObjType,sal_Int32 _nPosition) const
@@ -2703,16 +2701,16 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry)
{
// if we have an asterix, no other function than count is allowed
m_pFunctionCell->Clear();
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(0));
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';'));
if ( isFieldNameAsterix(_pEntry->GetField()) )
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(2)); // 2 -> COUNT
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(2, ';')); // 2 -> COUNT
else
{
xub_StrLen nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';');
if ( _pEntry->isNumeric() )
--nCount;
for (xub_StrLen nIdx = 1; nIdx < nCount; nIdx++)
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(nIdx));
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(nIdx, ';'));
}
if ( _pEntry->IsGroupBy() )
@@ -2720,8 +2718,8 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry)
OSL_ENSURE(!_pEntry->isNumeric(),"Not allowed to combine group by and numeric values!");
m_pFunctionCell->SelectEntry(m_pFunctionCell->GetEntry(m_pFunctionCell->GetEntryCount() - 1));
}
- else if ( m_pFunctionCell->GetEntryPos(String(_pEntry->GetFunction())) != COMBOBOX_ENTRY_NOTFOUND )
- m_pFunctionCell->SelectEntry(String(_pEntry->GetFunction()));
+ else if ( m_pFunctionCell->GetEntryPos(OUString(_pEntry->GetFunction())) != COMBOBOX_ENTRY_NOTFOUND )
+ m_pFunctionCell->SelectEntry(OUString(_pEntry->GetFunction()));
else
m_pFunctionCell->SelectEntryPos(0);
@@ -2735,9 +2733,9 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry)
m_pFunctionCell->RemoveEntry(1);
if ( !bCountRemoved && m_pFunctionCell->GetEntryCount() < 2)
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(2)); // 2 -> COUNT
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(2, ';')); // 2 -> COUNT
- if(m_pFunctionCell->GetEntryPos(String(_pEntry->GetFunction())) != COMBOBOX_ENTRY_NOTFOUND)
+ if(m_pFunctionCell->GetEntryPos(OUString(_pEntry->GetFunction())) != COMBOBOX_ENTRY_NOTFOUND)
m_pFunctionCell->SelectEntry(_pEntry->GetFunction());
else
m_pFunctionCell->SelectEntryPos(0);
diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
index da3caaa4604e..2d113d0d9a36 100644
--- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
@@ -75,8 +75,8 @@ void OTableWindowTitle::RequestHelp( const HelpEvent& rHEvt )
{
if(m_pTabWin)
{
- String aHelpText = m_pTabWin->GetComposedName();
- if( aHelpText.Len())
+ OUString aHelpText = m_pTabWin->GetComposedName();
+ if( !aHelpText.isEmpty())
{
// show help
Rectangle aItemRect(Point(0,0),GetSizePixel());
diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx
index 3229a55daa63..8066f995b7a6 100644
--- a/dbaccess/source/ui/querydesign/querydlg.cxx
+++ b/dbaccess/source/ui/querydesign/querydlg.cxx
@@ -174,12 +174,12 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ )
return 1;
m_pJoinControl->aLB_JoinType.SaveValue();
- aML_HelpText.SetText(String());
+ aML_HelpText.SetText(OUString());
m_pTableControl->enableRelation(true);
- String sFirstWinName = m_pConnData->getReferencingTable()->GetWinName();
- String sSecondWinName = m_pConnData->getReferencedTable()->GetWinName();
+ OUString sFirstWinName = m_pConnData->getReferencingTable()->GetWinName();
+ OUString sSecondWinName = m_pConnData->getReferencedTable()->GetWinName();
const EJoinType eOldJoinType = eJoinType;
sal_uInt16 nResId = 0;
const sal_uInt16 nPos = m_pJoinControl->aLB_JoinType.GetSelectEntryPos();
@@ -201,7 +201,7 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ )
{
nResId = STR_QUERY_LEFTRIGHT_JOIN;
eJoinType = RIGHT_JOIN;
- String sTemp = sFirstWinName;
+ OUString sTemp = sFirstWinName;
sFirstWinName = sSecondWinName;
sSecondWinName = sTemp;
}
@@ -240,16 +240,16 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ )
m_pTableControl->Invalidate();
- String sHelpText = String( ModuleRes( nResId ) );
+ OUString sHelpText = ModuleRes( nResId );
if( nPos )
{
- sHelpText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%1" ) ), sFirstWinName );
- sHelpText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%2" ) ), sSecondWinName );
+ sHelpText = sHelpText.replaceFirst( "%1", sFirstWinName );
+ sHelpText = sHelpText.replaceFirst( "%2", sSecondWinName );
}
if ( bAddHint )
{
- sHelpText += String( RTL_CONSTASCII_USTRINGPARAM( "\n" ) );
- sHelpText += String( ModuleRes( STR_JOIN_TYPE_HINT ) );
+ sHelpText += "\n";
+ sHelpText += ModuleRes( STR_JOIN_TYPE_HINT );
}
aML_HelpText.SetText( sHelpText );
diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
index eabdf23c9c79..a9d4bc3f1fbe 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
@@ -94,24 +94,24 @@ void ORelationTableConnection::Draw( const Rectangle& rRect )
Rectangle aSourcePos = pTopLine->GetSourceTextPos();
Rectangle aDestPos = pTopLine->GetDestTextPos();
- String aSourceText;
- String aDestText;
+ OUString aSourceText;
+ OUString aDestText;
switch( pData->GetCardinality() )
{
case CARDINAL_ONE_MANY:
- aSourceText ='1';
- aDestText ='n';
+ aSourceText = "1";
+ aDestText = "n";
break;
case CARDINAL_MANY_ONE:
- aSourceText ='n';
- aDestText ='1';
+ aSourceText = "n";
+ aDestText = "1";
break;
case CARDINAL_ONE_ONE:
- aSourceText ='1';
- aDestText ='1';
+ aSourceText = "1";
+ aDestText = "1";
break;
}
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index 354fd56f5bc6..709500697923 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -97,7 +97,7 @@ sal_Bool ORelationTableConnectionData::DropRelation()
{
OUString sName;
xKey->getPropertyValue(PROPERTY_NAME) >>= sName;
- if(String(sName) == m_aConnName)
+ if(sName == m_aConnName)
{
Reference< XDrop> xDrop(xKeys,UNO_QUERY);
OSL_ENSURE(xDrop.is(),"can't drop key because we haven't a drop interface!");
@@ -392,7 +392,7 @@ xKey.clear();
if ( bDropRelation )
{
DropRelation();
- String sError(ModuleRes(STR_QUERY_REL_COULD_NOT_CREATE));
+ OUString sError(ModuleRes(STR_QUERY_REL_COULD_NOT_CREATE));
::dbtools::throwGenericSQLException(sError,NULL);
}
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 2cd7d52d8e40..c718a60abf15 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -158,7 +158,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue
OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!");
if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), getORB()))
{
- String aMessage(ModuleRes(STR_DATASOURCE_DELETED));
+ OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED));
OSQLWarningBox( getView(), aMessage ).Execute();
}
else
@@ -202,8 +202,8 @@ void ORelationController::impl_initialize()
setEditable(sal_False);
m_bRelationsPossible = sal_False;
{
- String sTitle(ModuleRes(STR_RELATIONDESIGN));
- sTitle.Erase(0,3);
+ OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
+ sTitle = sTitle.copy(3);
OSQLMessageBox aDlg(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE));
aDlg.Execute();
}
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index a3d870a10c38..fecd015de5fb 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -345,9 +345,9 @@ void ORelationTableView::lookForUiActivities()
{
if(m_pExistingConnection)
{
- String sTitle(ModuleRes(STR_RELATIONDESIGN));
- sTitle.Erase(0,3);
- OSQLMessageBox aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),String(),0);
+ OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
+ sTitle = sTitle.copy(3);
+ OSQLMessageBox aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0);
aDlg.SetText(sTitle);
aDlg.RemoveButton(aDlg.GetButtonId(0));
aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
index 1450bd743001..4c7fd621b2d2 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
@@ -65,13 +65,13 @@ void OFieldDescGenWin::SetReadOnly( sal_Bool bReadOnly )
m_pFieldControl->SetReadOnly(bReadOnly);
}
-String OFieldDescGenWin::GetControlText( sal_uInt16 nControlId )
+OUString OFieldDescGenWin::GetControlText( sal_uInt16 nControlId )
{
DBG_CHKTHIS(OFieldDescGenWin,NULL);
return m_pFieldControl->GetControlText(nControlId);
}
-void OFieldDescGenWin::SetControlText( sal_uInt16 nControlId, const String& rText )
+void OFieldDescGenWin::SetControlText( sal_uInt16 nControlId, const OUString& rText )
{
DBG_CHKTHIS(OFieldDescGenWin,NULL);
// Texte der Controls setzen
@@ -117,12 +117,12 @@ void OFieldDescGenWin::LoseFocus()
TabPage::LoseFocus();
}
-String OFieldDescGenWin::BoolStringPersistent(const String& rUIString) const
+OUString OFieldDescGenWin::BoolStringPersistent(const OUString& rUIString) const
{
return m_pFieldControl->BoolStringPersistent(rUIString);
}
-String OFieldDescGenWin::BoolStringUI(const String& rPersistentString) const
+OUString OFieldDescGenWin::BoolStringUI(const OUString& rPersistentString) const
{
return m_pFieldControl->BoolStringUI(rPersistentString);
}
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
index 59dd95785029..12ca4041d8e8 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
@@ -46,8 +46,8 @@ namespace dbaui
void DisplayData( OFieldDescription* pFieldDescr );
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 );
#if OSL_DEBUG_LEVEL > 0
OTableEditorCtrl* GetEditorCtrl();
@@ -55,8 +55,8 @@ namespace dbaui
// short GetFormatCategory(OFieldDescription* pFieldDescr);
// liefert zum am Feld eingestellten Format einen der CAT_xxx-Werte (CAT_NUMBER, CAT_DATE ...)
- String BoolStringPersistent(const String& rUIString) const;
- String BoolStringUI(const String& rPersistentString) const;
+ OUString BoolStringPersistent(const OUString& rUIString) const;
+ OUString BoolStringUI(const OUString& rPersistentString) const;
// IClipboardTest
virtual sal_Bool isCutAllowed();
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index a6b5fbad7e62..218692c963d2 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -63,7 +63,7 @@ using namespace ::com::sun::star::sdb;
namespace dbaui
{
- extern String GetTypeString( sal_uInt16 nType );
+ extern OUString GetTypeString( sal_uInt16 nType );
}
// TYPEINIT1(OTableEditorCtrl, DBView);
@@ -116,20 +116,20 @@ void OTableEditorCtrl::Init()
SetReadOnly( bRead );
// Insert the columns
- String aColumnName( ModuleRes(STR_TAB_FIELD_COLUMN_NAME) );
+ OUString aColumnName( ModuleRes(STR_TAB_FIELD_COLUMN_NAME) );
InsertDataColumn( FIELD_NAME, aColumnName, FIELDNAME_WIDTH );
- aColumnName = String( ModuleRes(STR_TAB_FIELD_COLUMN_DATATYPE) );
+ aColumnName = ModuleRes(STR_TAB_FIELD_COLUMN_DATATYPE);
InsertDataColumn( FIELD_TYPE, aColumnName, FIELDTYPE_WIDTH );
::dbaccess::ODsnTypeCollection aDsnTypes(GetView()->getController().getORB());
sal_Bool bShowColumnDescription = aDsnTypes.supportsColumnDescription(::comphelper::getString(GetView()->getController().getDataSource()->getPropertyValue(PROPERTY_URL)));
- aColumnName = String( ModuleRes(STR_TAB_HELP_TEXT) );
+ aColumnName = ModuleRes(STR_TAB_HELP_TEXT);
InsertDataColumn( HELP_TEXT, aColumnName, bShowColumnDescription ? FIELDTYPE_WIDTH : FIELDDESCR_WIDTH );
if ( bShowColumnDescription )
{
- aColumnName = String( ModuleRes(STR_COLUMN_DESCRIPTION) );
+ aColumnName = ModuleRes(STR_COLUMN_DESCRIPTION);
InsertDataColumn( COLUMN_DESCRIPTION, aColumnName, FIELDTYPE_WIDTH );
}
@@ -333,7 +333,7 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const Rectangle& rRect,
sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(OTableEditorCtrl,NULL);
- const String aText( GetCellText( m_nCurrentPos, nColumnId ));
+ const OUString aText( GetCellText( m_nCurrentPos, nColumnId ));
rDev.Push( PUSH_CLIPREGION );
rDev.SetClipRegion(Region(rRect));
@@ -385,7 +385,7 @@ void OTableEditorCtrl::InitController(CellControllerRef&, long nRow, sal_uInt16
DBG_CHKTHIS(OTableEditorCtrl,NULL);
SeekRow( nRow == -1 ? GetCurRow() : nRow);
OFieldDescription* pActFieldDescr = pActRow->GetActFieldDescr();
- String aInitString;
+ OUString aInitString;
switch (nColumnId)
{
@@ -508,7 +508,7 @@ void OTableEditorCtrl::CursorMoved()
OTableRowView::CursorMoved();
}
-sal_Int32 OTableEditorCtrl::HasFieldName( const String& rFieldName )
+sal_Int32 OTableEditorCtrl::HasFieldName( const OUString& rFieldName )
{
DBG_CHKTHIS(OTableEditorCtrl,NULL);
@@ -543,9 +543,9 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId)
case FIELD_NAME:
{
// If there is no name, do nothing
- String aName(pNameCell->GetText());
+ OUString aName(pNameCell->GetText());
- if( !aName.Len() )
+ if( aName.isEmpty() )
{
// If FieldDescr exists, the field is deleted and the old content restored
if (pActFieldDescr)
@@ -574,7 +574,7 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId)
// Wenn aktuelle Feldbeschreibung NULL, Default setzen
if( !pActFieldDescr )
{
- pHelpTextCell->SetText(String());
+ pHelpTextCell->SetText(OUString());
pHelpTextCell->ClearModifyFlag();
}
else
@@ -586,7 +586,7 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId)
// Set the default if the field description is null
if( !pActFieldDescr )
{
- pDescrCell->SetText(String());
+ pDescrCell->SetText(OUString());
pDescrCell->ClearModifyFlag();
}
else
@@ -681,17 +681,17 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId )
SetDataPtr( nRow );
OFieldDescription* pActFieldDescr = pActRow->GetActFieldDescr();
- String sActionDescription;
+ OUString sActionDescription;
switch ( nColId )
{
- case FIELD_NAME: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_NAME ) ); break;
- case FIELD_TYPE: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_TYPE ) ); break;
+ case FIELD_NAME: sActionDescription = ModuleRes( STR_CHANGE_COLUMN_NAME ); break;
+ case FIELD_TYPE: sActionDescription = ModuleRes( STR_CHANGE_COLUMN_TYPE ); break;
case HELP_TEXT:
- case COLUMN_DESCRIPTION: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_DESCRIPTION ) ); break;
- default: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_ATTRIBUTE ) ); break;
+ case COLUMN_DESCRIPTION: sActionDescription = ModuleRes( STR_CHANGE_COLUMN_DESCRIPTION ); break;
+ default: sActionDescription = ModuleRes( STR_CHANGE_COLUMN_ATTRIBUTE ); break;
}
- GetUndoManager().EnterListAction( sActionDescription, String() );
+ GetUndoManager().EnterListAction( sActionDescription, OUString() );
if (!pActFieldDescr)
{
const OTypeInfoMap* pTypeInfoMap = GetView()->getController().getTypeInfo();
@@ -798,23 +798,23 @@ void OTableEditorCtrl::CopyRows()
}
}
-String OTableEditorCtrl::GenerateName( const String& rName )
+OUString OTableEditorCtrl::GenerateName( const OUString& rName )
{
DBG_CHKTHIS(OTableEditorCtrl,NULL);
// Create a base name for appending numbers to
- String aBaseName;
+ OUString aBaseName;
Reference<XConnection> xCon = GetView()->getController().getConnection();
Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : Reference< XDatabaseMetaData>();
xub_StrLen nMaxTextLen((xub_StrLen)( xMetaData.is() ? xMetaData->getMaxColumnNameLength() : 0));
- if( (rName.Len()+2) >nMaxTextLen )
- aBaseName = rName.Copy( 0, nMaxTextLen-2 );
+ if( (rName.getLength()+2) >nMaxTextLen )
+ aBaseName = rName.copy( 0, nMaxTextLen-2 );
else
aBaseName = rName;
// append a sequential number to the base name (up to 99)
- String aFieldName( rName);
+ OUString aFieldName( rName);
sal_Int32 i=1;
while( HasFieldName(aFieldName) )
{
@@ -841,7 +841,7 @@ void OTableEditorCtrl::InsertRows( long nRow )
aStreamRef->Seek(STREAM_SEEK_TO_BEGIN);
aStreamRef->ResetError();
long nInsertRow = nRow;
- String aFieldName;
+ OUString aFieldName;
::boost::shared_ptr<OTableRow> pRow;
sal_Int32 nSize = 0;
(*aStreamRef) >> nSize;
@@ -1006,7 +1006,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s
if( !pFieldDescr && nColId != FIELD_TYPE)
return;
- String sValue;
+ OUString sValue;
// Set indvidual fields
switch( nColId )
{
@@ -1031,7 +1031,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s
case FIELD_PROPERTY_REQUIRED:
{
sValue = ::comphelper::getString(_rNewData);
- pFieldDescr->SetIsNullable( sValue.ToInt32() );
+ pFieldDescr->SetIsNullable( sValue.toInt32() );
}
break;
@@ -1039,7 +1039,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s
case FIELD_PROPERTY_LENGTH:
{
sValue = ::comphelper::getString(_rNewData);
- pFieldDescr->SetPrecision( sValue.ToInt32() );
+ pFieldDescr->SetPrecision( sValue.toInt32() );
}
break;
@@ -1049,15 +1049,15 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s
case FIELD_PROPERTY_AUTOINC:
{
- String strYes(ModuleRes(STR_VALUE_YES));
+ OUString strYes(ModuleRes(STR_VALUE_YES));
sValue = ::comphelper::getString(_rNewData);
- pFieldDescr->SetAutoIncrement(sValue.Equals(strYes));
+ pFieldDescr->SetAutoIncrement(sValue == strYes);
}
break;
case FIELD_PROPERTY_SCALE:
{
sValue = ::comphelper::getString(_rNewData);
- pFieldDescr->SetScale(sValue.ToInt32());
+ pFieldDescr->SetScale(sValue.toInt32());
}
break;
@@ -1069,7 +1069,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s
case FIELD_PROPERTY_FORMAT:
{
sValue = ::comphelper::getString(_rNewData);
- pFieldDescr->SetFormatKey(sValue.ToInt32());
+ pFieldDescr->SetFormatKey(sValue.toInt32());
}
break;
}
@@ -1089,8 +1089,8 @@ Any OTableEditorCtrl::GetCellData( long nRow, sal_uInt16 nColId )
nRow = GetCurRow();
SetDataPtr( nRow );
- static const String strYes(ModuleRes(STR_VALUE_YES));
- static const String strNo(ModuleRes(STR_VALUE_NO));
+ static const OUString strYes(ModuleRes(STR_VALUE_YES));
+ static const OUString strNo(ModuleRes(STR_VALUE_NO));
OUString sValue;
// Read out the fields
switch( nColId )
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx
index c56363eb6ffe..dc2dc0c0ca26 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx
@@ -186,8 +186,8 @@ namespace dbaui
DECL_LINK( InvalidateFieldType, void* );
void InitCellController();
- sal_Int32 HasFieldName( const String& rFieldName );
- String GenerateName( const String& rName );
+ sal_Int32 HasFieldName( const OUString& rFieldName );
+ OUString GenerateName( const OUString& rName );
sal_Bool SetDataPtr( long nRow );
sal_Bool SaveData(long nRow, sal_uInt16 nColumnId);
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index eb8936c9bf60..c6c4959ef5c1 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -297,7 +297,7 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs)
if (!xTablesSup.is())
{
- String aMessage(ModuleRes(STR_TABLEDESIGN_CONNECTION_MISSING));
+ OUString aMessage(ModuleRes(STR_TABLEDESIGN_CONNECTION_MISSING));
OSQLWarningBox( getView(), aMessage ).Execute();
return sal_False;
}
@@ -320,13 +320,13 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs)
// first we need a name for our query so ask the user
if(bNew)
{
- String aDefaultName;
+ OUString aDefaultName;
if (_bSaveAs && !bNew)
- aDefaultName = String(m_sName);
+ aDefaultName = m_sName;
else
{
- String aName = String(ModuleRes(STR_TBL_TITLE));
- aDefaultName = aName.GetToken(0,' ');
+ OUString aName = ModuleRes(STR_TBL_TITLE);
+ aDefaultName = aName.getToken(0,' ');
aDefaultName = ::dbtools::createUniqueName(xTables,aDefaultName);
}
@@ -426,9 +426,9 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs)
}
catch(const ElementExistException& )
{
- String sText( ModuleRes( STR_NAME_ALREADY_EXISTS ) );
- sText.SearchAndReplaceAscii( "#" , m_sName);
- OSQLMessageBox aDlg( getView(), String( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error );
+ OUString sText( ModuleRes( STR_NAME_ALREADY_EXISTS ) );
+ sText = sText.replaceFirst( "#" , m_sName);
+ OSQLMessageBox aDlg( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error );
aDlg.Execute();
bError = sal_True;
@@ -440,7 +440,7 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs)
}
if ( aInfo.isValid() )
- aInfo.prepend( String( ModuleRes( STR_TABLEDESIGN_SAVE_ERROR ) ) );
+ aInfo.prepend( OUString( ModuleRes( STR_TABLEDESIGN_SAVE_ERROR ) ) );
showError(aInfo);
if (aInfo.isValid() || bError)
@@ -955,8 +955,8 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star::
OFieldDescription* pCompareDesc = (*aIter2)->GetActFieldDescr();
if (pCompareDesc && bCase(pCompareDesc->GetName(),pFieldDesc->GetName()))
{
- String strMessage = String(ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME));
- strMessage.SearchAndReplaceAscii("$column$", pFieldDesc->GetName());
+ OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME);
+ strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName());
OSQLWarningBox( getView(), strMessage ).Execute();
return sal_False;
}
@@ -965,8 +965,8 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star::
}
if ( _bNew && !bFoundPKey && aMetaData.supportsPrimaryKeys() )
{
- String sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD));
- String sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY));
+ OUString sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD));
+ OUString sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY));
OSQLMessageBox aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES);
switch ( aBox.Execute() )
@@ -1092,8 +1092,8 @@ void OTableController::alterColumns()
{
if(xDrop.is() && xAppend.is())
{
- String aMessage( ModuleRes( STR_TABLEDESIGN_ALTER_ERROR ) );
- aMessage.SearchAndReplaceAscii( "$column$", pField->GetName() );
+ OUString aMessage( ModuleRes( STR_TABLEDESIGN_ALTER_ERROR ) );
+ aMessage = aMessage.replaceFirst( "$column$", pField->GetName() );
SQLExceptionInfo aError( ::cppu::getCaughtException() );
OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError );
@@ -1150,8 +1150,8 @@ void OTableController::alterColumns()
bReload = sal_True;
if(xDrop.is() && xAppend.is())
{
- String aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR));
- aMessage.SearchAndReplaceAscii("$column$",pField->GetName());
+ OUString aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR));
+ aMessage = aMessage.replaceFirst("$column$",pField->GetName());
OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES );
if ( aMsg.Execute() != RET_YES )
{
@@ -1216,9 +1216,9 @@ void OTableController::alterColumns()
{
if(xKeyColumns.is() && xKeyColumns->hasByName(*pIter)) // check if this column is a member of the primary key
{
- String aMsgT(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN));
- aMsgT.SearchAndReplaceAscii("$column$",*pIter);
- String aTitle(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE));
+ OUString aMsgT(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN));
+ aMsgT = aMsgT.replaceFirst("$column$",*pIter);
+ OUString aTitle(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE));
OSQLMessageBox aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES);
if(aMsg.Execute() == RET_YES)
{
@@ -1237,8 +1237,8 @@ void OTableController::alterColumns()
}
catch (const SQLException&)
{
- String sError( ModuleRes( STR_TABLEDESIGN_COULD_NOT_DROP_COL ) );
- sError.SearchAndReplaceAscii( "$column$", *pIter );
+ OUString sError( ModuleRes( STR_TABLEDESIGN_COULD_NOT_DROP_COL ) );
+ sError = sError.replaceFirst( "$column$", *pIter );
SQLException aNewException;
aNewException.Message = sError;
@@ -1514,8 +1514,8 @@ OUString OTableController::getPrivateTitle() const
}
if ( sTitle.isEmpty() )
{
- String aName = String(ModuleRes(STR_TBL_TITLE));
- sTitle = aName.GetToken(0,' ');
+ OUString aName = ModuleRes(STR_TBL_TITLE);
+ sTitle = aName.getToken(0,' ');
sTitle += OUString::number(getCurrentStartNumber());
}
}
diff --git a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx
index 84d64ff56739..ebc9f39139e4 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx
@@ -69,7 +69,7 @@ void OTableDesignHelpBar::Resize()
long OTableDesignHelpBar::PreNotify( NotifyEvent& rNEvt )
{
if (rNEvt.GetType() == EVENT_LOSEFOCUS)
- SetHelpText(String());
+ SetHelpText(OUString());
return TabPage::PreNotify(rNEvt);
}
diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx
index 9ff9886eea6a..bfd525b25af0 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx
@@ -48,8 +48,8 @@ namespace dbaui
public:
OTableFieldControl( Window* pParent, OTableDesignHelpBar* pHelpBar);
- String BoolStringPersistent(const String& rUIString) const { return OFieldDescControl::BoolStringPersistent(rUIString); }
- String BoolStringUI(const String& rPersistentString) const { return OFieldDescControl::BoolStringUI(rPersistentString); }
+ OUString BoolStringPersistent(const OUString& rUIString) const { return OFieldDescControl::BoolStringPersistent(rUIString); }
+ OUString BoolStringUI(const OUString& rPersistentString) const { return OFieldDescControl::BoolStringUI(rPersistentString); }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection();
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
index 69ef284025c8..e3b9bfb245ef 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
@@ -51,7 +51,7 @@ OTableFieldDescWin::OTableFieldDescWin( Window* pParent)
DBG_CTOR(OTableFieldDescWin,NULL);
// Header
m_pHeader = new FixedText( this, WB_CENTER | WB_INFO ); // | WB_3DLOOK
- m_pHeader->SetText( String(ModuleRes(STR_TAB_PROPERTIES)) );
+ m_pHeader->SetText( OUString(ModuleRes(STR_TAB_PROPERTIES)) );
m_pHeader->Show();
// HelpBar
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
index ce03198fea23..3e7693b1eff4 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
@@ -67,16 +67,16 @@ namespace dbaui
virtual void GetFocus();
virtual void LoseFocus();
- void SetControlText( sal_uInt16 nControlId, const String& rText )
+ void SetControlText( sal_uInt16 nControlId, const OUString& rText )
{ m_pGenPage->SetControlText(nControlId,rText); }
- String GetControlText( sal_uInt16 nControlId )
+ OUString GetControlText( sal_uInt16 nControlId )
{ return m_pGenPage->GetControlText(nControlId); }
// short GetFormatCategory(OFieldDescription* pFieldDescr) { return m_pGenPage ? m_pGenPage->GetFormatCategory(pFieldDescr) : -1; }
// liefert zum am Feld eingestellten Format einen der CAT_xxx-Werte (CAT_NUMBER, CAT_DATE ...)
- String BoolStringPersistent(const String& rUIString) const { return m_pGenPage->BoolStringPersistent(rUIString); }
- String BoolStringUI(const String& rPersistentString) const { return m_pGenPage->BoolStringUI(rPersistentString); }
+ OUString BoolStringPersistent(const OUString& rUIString) const { return m_pGenPage->BoolStringPersistent(rUIString); }
+ OUString BoolStringUI(const OUString& rPersistentString) const { return m_pGenPage->BoolStringUI(rPersistentString); }
// IClipboardTest
virtual sal_Bool isCutAllowed();
diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx
index 9546e7b0ed3b..aa122aeff0ee 100644
--- a/dbaccess/source/ui/tabledesign/TableRow.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRow.cxx
@@ -154,7 +154,7 @@ namespace dbaui
{
OFieldDescription* pFieldDesc = new OFieldDescription();
_rRow.m_pActFieldDescr = pFieldDesc;
- String sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
+ OUString sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
pFieldDesc->SetName(sValue);
sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 9a2ca5553b7e..be4a361f7eac 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -473,7 +473,7 @@ void SAL_CALL CopyTableWizard::setOperation( ::sal_Int16 _operation ) throw (Ill
&& !OCopyTableWizard::supportsViews( m_xDestConnection )
)
throw IllegalArgumentException(
- String( ModuleRes( STR_CTW_NO_VIEWS_SUPPORT ) ),
+ OUString( ModuleRes( STR_CTW_NO_VIEWS_SUPPORT ) ),
*this,
1
);
@@ -505,7 +505,7 @@ void SAL_CALL CopyTableWizard::setCreatePrimaryKey( const Optional< OUString >&
if ( _newPrimaryKey.IsPresent && !OCopyTableWizard::supportsPrimaryKey( m_xDestConnection ) )
throw IllegalArgumentException(
- String( ModuleRes( STR_CTW_NO_PRIMARY_KEY_SUPPORT ) ),
+ OUString( ModuleRes( STR_CTW_NO_PRIMARY_KEY_SUPPORT ) ),
*this,
1
);
@@ -678,7 +678,7 @@ Reference< XPropertySet > CopyTableWizard::impl_ensureDataAccessDescriptor_throw
if ( !bIsValid )
{
throw IllegalArgumentException(
- String( ModuleRes( STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR ) ),
+ OUString( ModuleRes( STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR ) ),
*const_cast< CopyTableWizard* >( this ),
_nArgPos + 1
);
@@ -722,7 +722,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
if ( !sUnsupportedSetting.isEmpty() )
{
OUString sMessage(
- OUString(String(ModuleRes(STR_CTW_ERROR_UNSUPPORTED_SETTING))).
+ OUString(ModuleRes(STR_CTW_ERROR_UNSUPPORTED_SETTING)).
replaceFirst("$name$", sUnsupportedSetting));
throw IllegalArgumentException(
sMessage,
@@ -771,7 +771,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
break;
default:
throw IllegalArgumentException(
- String( ModuleRes( STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT ) ),
+ OUString( ModuleRes( STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT ) ),
*const_cast< CopyTableWizard* >( this ),
1
);
@@ -790,7 +790,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
if ( _out_rCommandType == CommandType::QUERY )
// we cannot copy a query if the connection cannot provide it ...
throw IllegalArgumentException(
- String(ModuleRes( STR_CTW_ERROR_NO_QUERY )),
+ OUString(ModuleRes( STR_CTW_ERROR_NO_QUERY )),
*const_cast< CopyTableWizard* >( this ),
1
);
@@ -830,7 +830,7 @@ void CopyTableWizard::impl_extractSourceResultSet_throw( const Reference< XPrope
if ( !xRowLocate.is() )
{
::dbtools::throwGenericSQLException(
- String( ModuleRes( STR_CTW_COPY_SOURCE_NEEDS_BOOKMARKS ) ),
+ OUString( ModuleRes( STR_CTW_COPY_SOURCE_NEEDS_BOOKMARKS ) ),
*this
);
}
@@ -1069,7 +1069,7 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r
{
SQLContext aError;
aError.Context = *this;
- aError.Message = String( ModuleRes( STR_ERROR_OCCURRED_WHILE_COPYING ) );
+ aError.Message = OUString( ModuleRes( STR_ERROR_OCCURRED_WHILE_COPYING ) );
::dbtools::SQLExceptionInfo aInfo( _rEvent.Error );
if ( aInfo.isValid() )
@@ -1300,7 +1300,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
default:
{
- OUString aMessage( String( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ) );
+ OUString aMessage( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) );
aMessage = aMessage.replaceFirst( "$type$", OUString::number( aSourceColTypes[ nSourceColumn ] ) );
aMessage = aMessage.replaceFirst( "$pos$", OUString::number( nSourceColumn ) );
@@ -1482,7 +1482,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments )
sal_Int32 nArgCount( _rArguments.getLength() );
if ( ( nArgCount != 2 ) && ( nArgCount != 3 ) )
throw IllegalArgumentException(
- String( ModuleRes( STR_CTW_ILLEGAL_PARAMETER_COUNT ) ),
+ OUString( ModuleRes( STR_CTW_ILLEGAL_PARAMETER_COUNT ) ),
*this,
1
);
@@ -1493,7 +1493,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments )
{ // ->createWithInteractionHandler
if ( !( _rArguments[2] >>= m_xInteractionHandler ) )
throw IllegalArgumentException(
- String(ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER )),
+ OUString(ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER )),
*this,
3
);
@@ -1518,7 +1518,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments )
catch( const Exception& )
{
throw WrappedTargetException(
- String( ModuleRes( STR_CTW_ERROR_DURING_INITIALIZATION ) ),
+ OUString( ModuleRes( STR_CTW_ERROR_DURING_INITIALIZATION ) ),
*this,
::cppu::getCaughtException()
);