summaryrefslogtreecommitdiff
path: root/cui/source/options
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-26 08:30:52 +0200
committerNoel Grandin <noel@peralex.com>2013-10-01 10:08:42 +0200
commitea2c80bdcd862f91dd7429184aea29d9a77f9774 (patch)
treebe34aa41cac74b86ae6bcdd4e9b6b3563121a9b3 /cui/source/options
parent183f260e7ed86c30d99313cdb3267c18abb65bd3 (diff)
convert CUI module from String to OUString
Change-Id: I79bdab414d448a0d619b80857d7b31633c116f81
Diffstat (limited to 'cui/source/options')
-rw-r--r--cui/source/options/cfgchart.cxx2
-rw-r--r--cui/source/options/cfgchart.hxx2
-rw-r--r--cui/source/options/connpooloptions.cxx18
-rw-r--r--cui/source/options/connpoolsettings.cxx2
-rw-r--r--cui/source/options/connpoolsettings.hxx4
-rw-r--r--cui/source/options/dbregister.cxx24
-rw-r--r--cui/source/options/doclinkdialog.cxx26
-rw-r--r--cui/source/options/doclinkdialog.hxx4
-rw-r--r--cui/source/options/fontsubs.cxx16
-rw-r--r--cui/source/options/fontsubs.hxx2
-rw-r--r--cui/source/options/optHeaderTabListbox.cxx2
-rw-r--r--cui/source/options/optcolor.cxx10
-rw-r--r--cui/source/options/optdict.cxx58
-rw-r--r--cui/source/options/optfltr.cxx3
-rw-r--r--cui/source/options/optfltr.hxx4
-rw-r--r--cui/source/options/opthtml.cxx14
-rw-r--r--cui/source/options/optjava.cxx64
-rw-r--r--cui/source/options/optjava.hxx16
-rw-r--r--cui/source/options/optlingu.cxx56
-rw-r--r--cui/source/options/optpath.cxx140
-rw-r--r--cui/source/options/treeopt.cxx52
-rw-r--r--cui/source/options/webconninfo.cxx2
22 files changed, 260 insertions, 261 deletions
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index faac1b594979..182c0f10488e 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -122,7 +122,7 @@ void SvxChartColorTable::useDefault()
}
}
-String SvxChartColorTable::getDefaultName( size_t _nIndex )
+OUString SvxChartColorTable::getDefaultName( size_t _nIndex )
{
OUString aName;
diff --git a/cui/source/options/cfgchart.hxx b/cui/source/options/cfgchart.hxx
index 03f7a78a1c95..71ec42f68e63 100644
--- a/cui/source/options/cfgchart.hxx
+++ b/cui/source/options/cfgchart.hxx
@@ -55,7 +55,7 @@ public:
void remove( size_t _nIndex );
void replace( size_t _nIndex, const XColorEntry & _rEntry );
void useDefault();
- String getDefaultName(size_t _nIndex);
+ OUString getDefaultName(size_t _nIndex);
// comparison
bool operator==( const SvxChartColorTable & _rOther ) const;
diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx
index f2b6509e36a6..b92e271df7c9 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -39,8 +39,8 @@ namespace offapp
DriverPoolingSettings m_aSettings;
DriverPoolingSettings::const_iterator m_aSeekRow;
- String m_sYes;
- String m_sNo;
+ OUString m_sYes;
+ OUString m_sNo;
Link m_aRowChangeHandler;
@@ -85,7 +85,7 @@ namespace offapp
private:
- String implGetCellText(DriverPoolingSettings::const_iterator _rPos, sal_uInt16 _nColId) const;
+ OUString implGetCellText(DriverPoolingSettings::const_iterator _rPos, sal_uInt16 _nColId) const;
};
//--------------------------------------------------------------------
@@ -136,11 +136,11 @@ namespace offapp
EditBrowseBox::Init();
Size aColWidth = LogicToPixel(Size(160, 0), MAP_APPFONT);
- InsertDataColumn(1, String(CUI_RES(RID_SVXSTR_DRIVER_NAME)), aColWidth.Width());
+ InsertDataColumn(1, OUString(CUI_RES(RID_SVXSTR_DRIVER_NAME)), aColWidth.Width());
aColWidth = LogicToPixel(Size(30, 0), MAP_APPFONT);
- InsertDataColumn(2, String(CUI_RES(RID_SVXSTR_POOLED_FLAG)), aColWidth.Width());
+ InsertDataColumn(2, OUString(CUI_RES(RID_SVXSTR_POOLED_FLAG)), aColWidth.Width());
aColWidth = LogicToPixel(Size(60, 0), MAP_APPFONT);
- InsertDataColumn(3, String(CUI_RES(RID_SVXSTR_POOL_TIMEOUT)), aColWidth.Width());
+ InsertDataColumn(3, OUString(CUI_RES(RID_SVXSTR_POOL_TIMEOUT)), aColWidth.Width());
// Attention: the resource of the string is local to the resource of the enclosing dialog!
}
@@ -209,11 +209,11 @@ namespace offapp
}
//--------------------------------------------------------------------
- String DriverListControl::implGetCellText(DriverPoolingSettings::const_iterator _rPos, sal_uInt16 _nColId) const
+ OUString DriverListControl::implGetCellText(DriverPoolingSettings::const_iterator _rPos, sal_uInt16 _nColId) const
{
OSL_ENSURE(_rPos < m_aSettings.end(), "DriverListControl::implGetCellText: invalid position!");
- String sReturn;
+ OUString sReturn;
switch (_nColId)
{
case 1:
@@ -427,7 +427,7 @@ namespace offapp
if (!bValidRow)
{ // positioned on an invalid row
- m_pDriver->SetText(String());
+ m_pDriver->SetText(OUString());
}
else
{
diff --git a/cui/source/options/connpoolsettings.cxx b/cui/source/options/connpoolsettings.cxx
index 89753ae934b7..12e1b16d0a37 100644
--- a/cui/source/options/connpoolsettings.cxx
+++ b/cui/source/options/connpoolsettings.cxx
@@ -28,7 +28,7 @@ namespace offapp
//= DriverPooling
//====================================================================
//--------------------------------------------------------------------
- DriverPooling::DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout )
+ DriverPooling::DriverPooling( const OUString& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout )
:sName(_rName)
,bEnabled(_bEnabled)
,nTimeoutSeconds(_nTimeout)
diff --git a/cui/source/options/connpoolsettings.hxx b/cui/source/options/connpoolsettings.hxx
index a93f6aacf509..01ffccf654de 100644
--- a/cui/source/options/connpoolsettings.hxx
+++ b/cui/source/options/connpoolsettings.hxx
@@ -35,11 +35,11 @@ namespace offapp
//====================================================================
struct DriverPooling
{
- String sName;
+ OUString sName;
sal_Bool bEnabled;
sal_Int32 nTimeoutSeconds;
- DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout );
+ DriverPooling( const OUString& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout );
sal_Bool operator == (const DriverPooling& _rR) const;
sal_Bool operator != (const DriverPooling& _rR) const { return !operator ==(_rR); }
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 4701c7d0eb4b..269e33a74b92 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -229,16 +229,16 @@ void DbRegistrationOptionsPage::Reset( const SfxItemSet& rSet )
insertNewEntry( aIter->first, aTransformer.get( OFileNotation::N_SYSTEM ), aIter->second.bReadOnly );
}
- String aUserData = GetUserData();
- if ( aUserData.Len() )
+ OUString aUserData = GetUserData();
+ if ( !aUserData.isEmpty() )
{
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
// restore column width
- rBar.SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
+ rBar.SetItemSize( ITEMID_TYPE, aUserData.getToken(0, ';').toInt32() );
HeaderEndDrag_Impl( &rBar );
// restore sort direction
- sal_Bool bUp = (sal_Bool)(sal_uInt16)aUserData.GetToken(1).ToInt32();
+ sal_Bool bUp = (sal_Bool)(sal_uInt16)aUserData.getToken(1, ';').toInt32();
HeaderBarItemBits nBits = rBar.GetItemBits(ITEMID_TYPE);
if ( bUp )
@@ -284,7 +284,7 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, DeleteHdl)
// -----------------------------------------------------------------------
IMPL_LINK_NOARG(DbRegistrationOptionsPage, NewHdl)
{
- String sNewName,sNewLocation;
+ OUString sNewName,sNewLocation;
openLinkDialog(sNewName,sNewLocation);
return 0;
}
@@ -301,7 +301,7 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, EditHdl)
if ( !pOldRegistration || pOldRegistration->bReadOnly )
return 0L;
- String sOldName = pPathBox->GetEntryText(pEntry,0);
+ OUString sOldName = pPathBox->GetEntryText(pEntry,0);
m_pCurEntry = pEntry;
openLinkDialog( sOldName, pOldRegistration->sLocation, pEntry );
m_pCurEntry = NULL;
@@ -392,9 +392,9 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, PathSelect_Impl)
// -----------------------------------------------------------------------------
void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUString& _sLocation, const bool _bReadOnly )
{
- String aStr( _sName );
- aStr += '\t';
- aStr += String(_sLocation);
+ OUString aStr( _sName );
+ aStr += "\t";
+ aStr += _sLocation;
SvTreeListEntry* pEntry = NULL;
if ( _bReadOnly )
@@ -411,7 +411,7 @@ void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUS
}
// -----------------------------------------------------------------------------
-void DbRegistrationOptionsPage::openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvTreeListEntry* _pEntry)
+void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const OUString& _sOldLocation,SvTreeListEntry* _pEntry)
{
ODocumentLinkDialog aDlg(this,_pEntry == NULL);
@@ -420,7 +420,7 @@ void DbRegistrationOptionsPage::openLinkDialog(const String& _sOldName,const Str
if ( aDlg.Execute() == RET_OK )
{
- String sNewName,sNewLocation;
+ OUString sNewName,sNewLocation;
aDlg.get(sNewName,sNewLocation);
if ( _pEntry == NULL || sNewName != _sOldName || sNewLocation != _sOldLocation )
{
@@ -435,7 +435,7 @@ void DbRegistrationOptionsPage::openLinkDialog(const String& _sOldName,const Str
}
}
// -----------------------------------------------------------------------------
-IMPL_LINK( DbRegistrationOptionsPage, NameValidator, String*, _pName )
+IMPL_LINK( DbRegistrationOptionsPage, NameValidator, OUString*, _pName )
{
if ( _pName )
{
diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx
index 8302799b480a..e4e5879a7cdd 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -57,7 +57,7 @@ namespace svx
,m_aHelp (this, CUI_RES(BTN_HELP))
,m_bCreatingNew(_bCreateNew)
{
- String sText = String( CUI_RES( m_bCreatingNew ? STR_NEW_LINK : STR_EDIT_LINK ) );
+ OUString sText = CUI_RES( m_bCreatingNew ? STR_NEW_LINK : STR_EDIT_LINK );
SetText(sText);
FreeResource();
@@ -78,7 +78,7 @@ namespace svx
}
//------------------------------------------------------------------
- void ODocumentLinkDialog::set( const String& _rName, const String& _rURL )
+ void ODocumentLinkDialog::set( const OUString& _rName, const OUString& _rURL )
{
m_aName.SetText(_rName);
m_aURL.SetText(_rURL);
@@ -86,7 +86,7 @@ namespace svx
}
//------------------------------------------------------------------
- void ODocumentLinkDialog::get( String& _rName, String& _rURL ) const
+ void ODocumentLinkDialog::get( OUString& _rName, OUString& _rURL ) const
{
_rName = m_aName.GetText();
_rURL = m_aURL.GetText();
@@ -121,8 +121,8 @@ namespace svx
if (!bFileExists)
{
- String sMsg = String(CUI_RES(STR_LINKEDDOC_DOESNOTEXIST));
- sMsg.SearchAndReplaceAscii("$file$", m_aURL.GetText());
+ OUString sMsg = CUI_RES(STR_LINKEDDOC_DOESNOTEXIST);
+ sMsg = sMsg.replaceFirst("$file$", m_aURL.GetText());
ErrorBox aError(this, WB_OK , sMsg);
aError.Execute();
return 0L;
@@ -130,24 +130,24 @@ namespace svx
INetURLObject aURL( sURL );
if ( aURL.GetProtocol() != INET_PROT_FILE )
{
- String sMsg = String(CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE));
- sMsg.SearchAndReplaceAscii("$file$", m_aURL.GetText());
+ OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE);
+ sMsg = sMsg.replaceFirst("$file$", m_aURL.GetText());
ErrorBox aError(this, WB_OK , sMsg);
aError.Execute();
return 0L;
}
- String sCurrentText = m_aName.GetText();
+ OUString sCurrentText = m_aName.GetText();
if ( m_aNameValidator.IsSet() )
{
if ( !m_aNameValidator.Call( &sCurrentText ) )
{
- String sMsg = String(CUI_RES(STR_NAME_CONFLICT));
- sMsg.SearchAndReplaceAscii("$file$", sCurrentText);
+ OUString sMsg = CUI_RES(STR_NAME_CONFLICT);
+ sMsg = sMsg.replaceFirst("$file$", sCurrentText);
InfoBox aError(this, sMsg);
aError.Execute();
- m_aName.SetSelection(Selection(0,sCurrentText.Len()));
+ m_aName.SetSelection(Selection(0,sCurrentText.getLength()));
m_aName.GrabFocus();
return 0L;
}
@@ -169,8 +169,8 @@ namespace svx
aFileDlg.SetCurrentFilter(pFilter->GetUIName());
}
- String sPath = m_aURL.GetText();
- if (sPath.Len())
+ OUString sPath = m_aURL.GetText();
+ if (!sPath.isEmpty())
{
OFileNotation aTransformer( sPath, OFileNotation::N_SYSTEM );
aFileDlg.SetDisplayDirectory( aTransformer.get( OFileNotation::N_URL ) );
diff --git a/cui/source/options/doclinkdialog.hxx b/cui/source/options/doclinkdialog.hxx
index 17b1af513d94..bff0d340c33b 100644
--- a/cui/source/options/doclinkdialog.hxx
+++ b/cui/source/options/doclinkdialog.hxx
@@ -64,8 +64,8 @@ namespace svx
void setNameValidator( const Link& _rValidator ) { m_aNameValidator = _rValidator; }
Link getNameValidator( ) const { return m_aNameValidator; }
- void set( const String& _rName, const String& _rURL );
- void get( String& _rName, String& _rURL ) const;
+ void set( const OUString& _rName, const OUString& _rURL );
+ void get( OUString& _rName, OUString& _rURL ) const;
protected:
DECL_LINK(OnTextModified, void *);
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 230ab855dc9b..06afeb592f8d 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -115,7 +115,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( Window* pParent,
m_pFontHeightLB->InsertEntry(OUString::number(nHeight));
}
-SvTreeListEntry* SvxFontSubstTabPage::CreateEntry(String& rFont1, String& rFont2)
+SvTreeListEntry* SvxFontSubstTabPage::CreateEntry(OUString& rFont1, OUString& rFont2)
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
@@ -208,8 +208,8 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet& )
for (sal_Int32 i = 0; i < nCount; ++i)
{
const SubstitutionStruct* pSubs = pConfig->GetSubstitution(i);
- String aTmpStr1(pSubs->sFont);
- String aTmpStr2(pSubs->sReplaceBy);
+ OUString aTmpStr1(pSubs->sFont);
+ OUString aTmpStr2(pSubs->sReplaceBy);
SvTreeListEntry* pEntry = CreateEntry(aTmpStr1, aTmpStr2);
m_pCheckLB->Insert(pEntry);
m_pCheckLB->CheckEntry(pEntry, 0, pSubs->bReplaceAlways);
@@ -259,8 +259,8 @@ IMPL_LINK(SvxFontSubstTabPage, SelectHdl, Window*, pWin)
else
{
// new entry
- String sFont1 = m_pFont1CB->GetText();
- String sFont2 = m_pFont2CB->GetText();
+ OUString sFont1 = m_pFont1CB->GetText();
+ OUString sFont2 = m_pFont2CB->GetText();
pEntry = CreateEntry(sFont1, sFont2);
m_pCheckLB->Insert(pEntry);
@@ -318,7 +318,7 @@ IMPL_LINK(SvxFontSubstTabPage, SelectHdl, Window*, pWin)
//--------------------------------------------------------------------------
IMPL_LINK(SvxFontSubstTabPage, NonPropFontsHdl, CheckBox*, pBox)
{
- String sFontName = m_pFontNameLB->GetSelectEntry();
+ OUString sFontName = m_pFontNameLB->GetSelectEntry();
sal_Bool bNonPropOnly = pBox->IsChecked();
m_pFontNameLB->Clear();
FontList aFntLst( Application::GetDefaultDevice() );
@@ -344,8 +344,8 @@ void SvxFontSubstTabPage::CheckEnable()
SvTreeListEntry* pEntry = m_pCheckLB->FirstSelected();
- String sEntry = m_pFont1CB->GetText();
- sEntry += '\t';
+ OUString sEntry = m_pFont1CB->GetText();
+ sEntry += "\t";
sEntry += m_pFont2CB->GetText();
// because of OS/2 optimization error (Bug #56267) a bit more intricate:
diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx
index d5fb69ac150b..b5c88a214f7d 100644
--- a/cui/source/options/fontsubs.hxx
+++ b/cui/source/options/fontsubs.hxx
@@ -87,7 +87,7 @@ class SvxFontSubstTabPage : public SfxTabPage
DECL_LINK(SelectHdl, Window *pWin = 0);
DECL_LINK(NonPropFontsHdl, CheckBox* pBox);
- SvTreeListEntry* CreateEntry(String& rFont1, String& rFont2);
+ SvTreeListEntry* CreateEntry(OUString& rFont1, OUString& rFont2);
void CheckEnable();
diff --git a/cui/source/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx
index 5d8db124a66b..74ed49469ecc 100644
--- a/cui/source/options/optHeaderTabListbox.cxx
+++ b/cui/source/options/optHeaderTabListbox.cxx
@@ -30,7 +30,7 @@ namespace svx
class OptLBoxString_Impl : public SvLBoxString
{
public:
- OptLBoxString_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rTxt ) :
+ OptLBoxString_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const OUString& rTxt ) :
SvLBoxString( pEntry, nFlags, rTxt ) {}
virtual void Paint(
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index c6f50c712151..d09fd7798b27 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -1111,9 +1111,9 @@ void SvxColorOptionsTabPage::Reset( const SfxItemSet& )
pExtColorConfig = new EditableExtendedColorConfig;
m_pColorConfigCT->SetExtendedConfig(*pExtColorConfig);
- String sUser = GetUserData();
+ OUString sUser = GetUserData();
//has to be called always to speed up accessibility tools
- m_pColorConfigCT->SetScrollPosition(sUser.ToInt32());
+ m_pColorConfigCT->SetScrollPosition(sUser.toInt32());
m_pColorSchemeLB->Clear();
uno::Sequence< OUString > aSchemes = pColorConfig->GetSchemeNames();
const OUString* pSchemes = aSchemes.getConstArray();
@@ -1155,10 +1155,10 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog( pButton,
- sName, String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2)) );
+ sName, CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2) );
DBG_ASSERT(aNameDlg, "Dialogdiet fail!");
aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
- aNameDlg->SetText(String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE1)));
+ aNameDlg->SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE1));
aNameDlg->SetHelpId(HID_OPTIONS_COLORCONFIG_SAVE_SCHEME);
aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
if(RET_OK == aNameDlg->Execute())
@@ -1176,7 +1176,7 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
{
DBG_ASSERT(m_pColorSchemeLB->GetEntryCount() > 1, "don't delete the last scheme");
QueryBox aQuery(pButton, CUI_RES(RID_SVXQB_DELETE_COLOR_CONFIG));
- aQuery.SetText(String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE)));
+ aQuery.SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE));
if(RET_YES == aQuery.Execute())
{
OUString sDeleteScheme(m_pColorSchemeLB->GetSelectEntry());
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index f30a69d6e44e..722a4834e0f2 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -51,7 +51,7 @@ static long nStaticTabs[]=
// static function -------------------------------------------------------
-static String getNormDicEntry_Impl(const OUString &rText)
+static OUString getNormDicEntry_Impl(const OUString &rText)
{
OUString aTmp(comphelper::string::stripEnd(rText, '.'));
return comphelper::string::remove(aTmp, '=');
@@ -60,7 +60,7 @@ static String getNormDicEntry_Impl(const OUString &rText)
// Compare Dictionary Entry result
enum CDE_RESULT { CDE_EQUAL, CDE_SIMILAR, CDE_DIFFERENT };
-static CDE_RESULT cmpDicEntry_Impl( const String &rText1, const String &rText2 )
+static CDE_RESULT cmpDicEntry_Impl( const OUString &rText1, const OUString &rText2 )
{
CDE_RESULT eRes = CDE_DIFFERENT;
@@ -139,7 +139,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl)
if (xDicList.is())
{
lang::Locale aLocale( LanguageTag::convertToLocale(nLang) );
- String aURL( linguistic::GetWritableDictionaryURL( sDict ) );
+ OUString aURL( linguistic::GetWritableDictionaryURL( sDict ) );
xNewDic = Reference< XDictionary > (
xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY );
xNewDic->setActive( sal_True );
@@ -151,7 +151,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl)
xNewDic = NULL;
// error: couldn't create new dictionary
- SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, String(),
+ SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, OUString(),
this, RID_SVXERRCTX, &CUI_MGR() );
ErrorHandler::HandleError( *new StringErrorInfo(
ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) );
@@ -202,7 +202,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxDictEdit(Window *pParent
SvxEditDictionaryDialog::SvxEditDictionaryDialog(
Window* pParent,
- const String& rName,
+ const OUString& rName,
Reference< XSpellChecker1 > &xSpl ) :
ModalDialog( pParent, "EditDictionaryDialog" ,"cui/ui/editdictionarydialog.ui" ),
@@ -259,15 +259,15 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
const Reference< XDictionary > *pDic = aDics.getConstArray();
sal_Int32 nCount = aDics.getLength();
- String aLookUpEntry;
+ OUString aLookUpEntry;
for ( sal_Int32 i = 0; i < nCount; ++i )
{
Reference< XDictionary > xDic( pDic[i], UNO_QUERY );
if (xDic.is())
{
bool bNegative = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
- String aDicName( xDic->getName() );
- const String aTxt( ::GetDicInfoStr( aDicName,
+ OUString aDicName( xDic->getName() );
+ const OUString aTxt( ::GetDicInfoStr( aDicName,
LanguageTag( xDic->getLocale() ).getLanguageType(), bNegative ) );
pAllDictsLB->InsertEntry( aTxt );
@@ -359,7 +359,7 @@ void SvxEditDictionaryDialog::SetLanguage_Impl( util::Language nLanguage )
pLangLB->SelectLanguage( nLanguage );
}
-sal_uInt16 SvxEditDictionaryDialog::GetLBInsertPos(const String &rDicWord)
+sal_uInt16 SvxEditDictionaryDialog::GetLBInsertPos(const OUString &rDicWord)
{
sal_uInt16 nPos = USHRT_MAX;
@@ -370,7 +370,7 @@ sal_uInt16 SvxEditDictionaryDialog::GetLBInsertPos(const String &rDicWord)
{
SvTreeListEntry* pEntry = pWordsLB->GetEntry(j);
DBG_ASSERT( pEntry, "NULL pointer");
- String aNormEntry( getNormDicEntry_Impl( rDicWord ) );
+ OUString aNormEntry( getNormDicEntry_Impl( rDicWord ) );
StringCompare eCmpRes = (StringCompare)pCollator->
compareString( aNormEntry, getNormDicEntry_Impl( pWordsLB->GetEntryText(pEntry, 0) ) );
if( COMPARE_LESS == eCmpRes )
@@ -388,7 +388,7 @@ void SvxEditDictionaryDialog::RemoveDictEntry(SvTreeListEntry* pEntry)
if ( pEntry != NULL && nLBPos != LISTBOX_ENTRY_NOTFOUND )
{
- String sTmpShort(pWordsLB->GetEntryText(pEntry, 0));
+ OUString sTmpShort(pWordsLB->GetEntryText(pEntry, 0));
Reference< XDictionary > xDic = aDics.getConstArray()[ nLBPos ];
if (xDic->remove( sTmpShort )) // sal_True on success
@@ -435,8 +435,8 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl)
if ( nLang != nOldLang )
{
QueryBox aBox( this, CUI_RES( RID_SFXQB_SET_LANGUAGE ) );
- String sTxt( aBox.GetMessText() );
- sTxt.SearchAndReplaceAscii( "%1", pAllDictsLB->GetSelectEntry() );
+ OUString sTxt( aBox.GetMessText() );
+ sTxt = sTxt.replaceFirst( "%1", pAllDictsLB->GetSelectEntry() );
aBox.SetMessText( sTxt );
if ( aBox.Execute() == RET_YES )
@@ -444,7 +444,7 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl)
xDic->setLocale( LanguageTag::convertToLocale( nLang ) );
bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
- const String sName(
+ const OUString sName(
::GetDicInfoStr( xDic->getName(),
LanguageTag( xDic->getLocale() ).getLanguageType(),
bNegativ ) );
@@ -467,7 +467,7 @@ void SvxEditDictionaryDialog::ShowWords_Impl( sal_uInt16 nId )
nOld = nId;
EnterWait();
- String aStr;
+ OUString aStr;
pWordED->SetText(aStr);
pReplaceED->SetText(aStr);
@@ -511,12 +511,12 @@ void SvxEditDictionaryDialog::ShowWords_Impl( sal_uInt16 nId )
for (sal_Int32 i = 0; i < nCount; i++)
{
- aStr = String(pEntry[i]->getDictionaryWord());
+ aStr = pEntry[i]->getDictionaryWord();
sal_uInt16 nPos = GetLBInsertPos( aStr );
if(pEntry[i]->isNegative())
{
- aStr += '\t';
- aStr += String(pEntry[i]->getReplacementText());
+ aStr += "\t";
+ aStr += pEntry[i]->getReplacementText();
}
pWordsLB->InsertEntry(aStr, 0, sal_False, nPos == USHRT_MAX ? LIST_APPEND : nPos);
}
@@ -566,7 +566,7 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn)
if(pBtn == pDeletePB)
{
DBG_ASSERT(pEntry, "keine Eintrag selektiert");
- String aStr;
+ OUString aStr;
pWordED->SetText(aStr);
pReplaceED->SetText(aStr);
@@ -660,14 +660,14 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn)
IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
{
SvTreeListEntry* pFirstSel = pWordsLB->FirstSelected();
- String rEntry = pEdt->GetText();
+ OUString rEntry = pEdt->GetText();
- xub_StrLen nWordLen=rEntry.Len();
- const String& rRepString = pReplaceED->GetText();
+ sal_Int32 nWordLen = rEntry.getLength();
+ const OUString& rRepString = pReplaceED->GetText();
sal_Bool bEnableNewReplace = sal_False;
sal_Bool bEnableDelete = sal_False;
- String aNewReplaceText = sNew;
+ OUString aNewReplaceText = sNew;
if(pEdt == pWordED)
{
@@ -680,11 +680,11 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
for(sal_uInt16 i = 0; i < pWordsLB->GetEntryCount(); i++)
{
SvTreeListEntry* pEntry = pWordsLB->GetEntry( i );
- String aTestStr( pWordsLB->GetEntryText(pEntry, 0) );
+ OUString aTestStr( pWordsLB->GetEntryText(pEntry, 0) );
eCmpRes = cmpDicEntry_Impl( rEntry, aTestStr );
if(CDE_DIFFERENT != eCmpRes)
{
- if(rRepString.Len())
+ if(!rRepString.isEmpty())
bFirstSelect = sal_True;
bDoNothing=sal_True;
pWordsLB->SetCurEntry(pEntry);
@@ -700,7 +700,7 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
bFound= sal_True;
break;
}
- else if(getNormDicEntry_Impl(aTestStr).Search(
+ else if(getNormDicEntry_Impl(aTestStr).indexOf(
getNormDicEntry_Impl( rEntry ) ) == 0
&& !bTmpSelEntry)
{
@@ -734,12 +734,12 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
}
else if(pEdt == pReplaceED)
{
- String aReplaceText;
- String aWordText;
+ OUString aReplaceText;
+ OUString aWordText;
if (pFirstSel) // a pWordsLB entry is selected
{
aWordText = pWordsLB->GetEntryText( pFirstSel, 0 );
- aReplaceText = pWordsLB->GetEntryText( pFirstSel, 1 );
+ aReplaceText = pWordsLB->GetEntryText( pFirstSel, 1 );
aNewReplaceText = sModify;
bEnableDelete = sal_True;
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 653448c88afd..dc5440e79ac4 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -149,8 +149,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( Window* pParent, const SfxItemSet& rSe
static long aStaticTabs[] = { 3, 0, 20, 40 };
m_pCheckLB->SvSimpleTable::SetTabs( aStaticTabs );
- String sHeader( sHeader1 );
- (( sHeader += '\t' ) += sHeader2 ) += '\t';
+ OUString sHeader = sHeader1 + "\t" + sHeader2 + "\t";
m_pCheckLB->InsertHeaderEntry( sHeader, HEADERBAR_APPEND,
HIB_CENTER | HIB_VCENTER | HIB_FIXEDPOS | HIB_FIXED );
diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx
index a8a70130c660..5d2bc064f841 100644
--- a/cui/source/options/optfltr.hxx
+++ b/cui/source/options/optfltr.hxx
@@ -75,8 +75,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage
SvSimpleTableContainer* m_pCheckLBContainer;
MSFltrSimpleTable* m_pCheckLB;
- String sHeader1, sHeader2;
- String sChgToFromMath,
+ OUString sHeader1, sHeader2;
+ OUString sChgToFromMath,
sChgToFromWriter,
sChgToFromCalc,
sChgToFromImpress;
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx
index 7651a1e8db58..a034c26f1b7a 100644
--- a/cui/source/options/opthtml.cxx
+++ b/cui/source/options/opthtml.cxx
@@ -64,16 +64,16 @@ SfxTabPage( pParent, "OptHtmlPage" , "cui/ui/opthtmlpage.ui", rSet )
aCharSetLB->SetStyle(aCharSetLB->GetStyle() | WB_SORT);
// replace placeholder with UI string from language list
- String aText( aNumbersEnglishUSCB->GetText());
- String aPlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%ENGLISHUSLOCALE"));
- xub_StrLen nPos;
- if ((nPos = aText.Search( aPlaceholder)) != STRING_NOTFOUND)
+ OUString aText( aNumbersEnglishUSCB->GetText());
+ OUString aPlaceholder("%ENGLISHUSLOCALE");
+ sal_Int32 nPos;
+ if ((nPos = aText.indexOf( aPlaceholder)) != -1)
{
SvtLanguageTable aLangTab;
- const String& rStr = aLangTab.GetString( LANGUAGE_ENGLISH_US);
- if (rStr.Len())
+ const OUString& rStr = aLangTab.GetString( LANGUAGE_ENGLISH_US);
+ if (!rStr.isEmpty())
{
- aText.Replace( nPos, aPlaceholder.Len(), rStr);
+ aText = aText.replaceAt( nPos, aPlaceholder.getLength(), rStr);
aNumbersEnglishUSCB->SetText( aText);
}
}
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 0396de23ae7e..e1dca0dd95bf 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -238,9 +238,9 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, SelectHdl_Impl)
// set installation directory info
SvTreeListEntry* pEntry = m_pJavaList->FirstSelected();
DBG_ASSERT( pEntry, "SvxJavaOptionsPage::SelectHdl_Impl(): no entry" );
- String* pLocation = static_cast< String* >( pEntry->GetUserData() );
+ OUString* pLocation = static_cast< OUString* >( pEntry->GetUserData() );
DBG_ASSERT( pLocation, "invalid location string" );
- String sInfo = m_sInstallText;
+ OUString sInfo = m_sInstallText;
if ( pLocation )
sInfo += *pLocation;
m_pJavaPathText->SetText(sInfo);
@@ -256,7 +256,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, AddHdl_Impl)
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
xFolderPicker = FolderPicker::create(xContext);
- String sWorkFolder = SvtPathOptions().GetWorkPath();
+ OUString sWorkFolder = SvtPathOptions().GetWorkPath();
xFolderPicker->setDisplayDirectory( sWorkFolder );
xFolderPicker->setDescription( m_sAddDialogText );
@@ -328,7 +328,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
{
#if HAVE_FEATURE_JAVA
- String sClassPath;
+ OUString sClassPath;
if ( !m_pPathDlg )
{
@@ -336,7 +336,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
javaFrameworkError eErr = jfw_getUserClassPath( &m_pClassPath );
if ( JFW_E_NONE == eErr && m_pClassPath )
{
- sClassPath = String( OUString( m_pClassPath ) );
+ sClassPath = m_pClassPath;
m_pPathDlg->SetClassPath( sClassPath );
}
}
@@ -437,7 +437,7 @@ void SvxJavaOptionsPage::ClearJavaList()
SvTreeListEntry* pEntry = m_pJavaList->First();
while ( pEntry )
{
- String* pLocation = static_cast< String* >( pEntry->GetUserData() );
+ OUString* pLocation = static_cast< OUString* >( pEntry->GetUserData() );
delete pLocation;
pEntry = m_pJavaList->Next( pEntry );
}
@@ -505,7 +505,7 @@ void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo )
sEntry.append(m_sAccessibilityText);
SvTreeListEntry* pEntry = m_pJavaList->InsertEntry(sEntry.makeStringAndClear());
INetURLObject aLocObj( OUString( _pInfo->sLocation ) );
- String* pLocation = new String( aLocObj.getFSysPath( INetURLObject::FSYS_DETECT ) );
+ OUString* pLocation = new OUString( aLocObj.getFSysPath( INetURLObject::FSYS_DETECT ) );
pEntry->SetUserData( pLocation );
#else
(void)_pInfo;
@@ -658,7 +658,7 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
if ( m_pPathDlg )
{
OUString sPath( m_pPathDlg->GetClassPath() );
- if ( m_pPathDlg->GetOldPath() != String( sPath ) )
+ if ( m_pPathDlg->GetOldPath() != sPath )
{
eErr = jfw_setUserClassPath( sPath.pData );
DBG_ASSERT( JFW_E_NONE == eErr,
@@ -756,7 +756,7 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
void SvxJavaOptionsPage::FillUserData()
{
- String aUserData;
+ OUString aUserData;
SetUserData( aUserData );
}
@@ -811,7 +811,7 @@ IMPL_LINK_NOARG(SvxJavaParameterDlg, AssignHdl_Impl)
if ( LISTBOX_ENTRY_NOTFOUND == nPos )
nPos = m_pAssignedList->InsertEntry( sParam );
m_pAssignedList->SelectEntryPos( nPos );
- m_pParameterEdit->SetText( String() );
+ m_pParameterEdit->SetText( OUString() );
ModifyHdl_Impl( m_pParameterEdit );
EnableRemoveButton();
}
@@ -888,7 +888,7 @@ void SvxJavaParameterDlg::SetParameters( Sequence< OUString >& rParams )
const OUString* pArray = rParams.getConstArray();
for ( i = 0; i < nCount; ++i )
{
- String sParam = String( *pArray++ );
+ OUString sParam = OUString( *pArray++ );
m_pAssignedList->InsertEntry( sParam );
}
}
@@ -920,7 +920,7 @@ SvxJavaClassPathDlg::~SvxJavaClassPathDlg()
{
sal_uInt16 i, nCount = m_pPathList->GetEntryCount();
for ( i = 0; i < nCount; ++i )
- delete static_cast< String* >( m_pPathList->GetEntryData(i) );
+ delete static_cast< OUString* >( m_pPathList->GetEntryData(i) );
}
// -----------------------------------------------------------------------
@@ -930,7 +930,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl)
sfx2::FileDialogHelper aDlg( TemplateDescription::FILEOPEN_SIMPLE, 0 );
aDlg.SetTitle( CUI_RES( RID_SVXSTR_ARCHIVE_TITLE ) );
aDlg.AddFilter( CUI_RES( RID_SVXSTR_ARCHIVE_HEADLINE ), OUString("*.jar;*.zip") );
- String sFolder;
+ OUString sFolder;
if ( m_pPathList->GetSelectEntryCount() > 0 )
{
INetURLObject aObj( m_pPathList->GetSelectEntry(), INetURLObject::FSYS_DETECT );
@@ -941,9 +941,9 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl)
aDlg.SetDisplayDirectory( sFolder );
if ( aDlg.Execute() == ERRCODE_NONE )
{
- String sURL = aDlg.GetPath();
+ OUString sURL = aDlg.GetPath();
INetURLObject aURL( sURL );
- String sFile = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
+ OUString sFile = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
if ( !IsPathDuplicate( sURL ) )
{
sal_uInt16 nPos = m_pPathList->InsertEntry( sFile, SvFileInformationManager::GetImage( aURL, false ) );
@@ -951,8 +951,8 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl)
}
else
{
- String sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
- sMsg.SearchAndReplaceAscii( "%1", sFile );
+ OUString sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
+ sMsg = sMsg.replaceFirst( "%1", sFile );
ErrorBox( this, WB_OK, sMsg ).Execute();
}
}
@@ -967,7 +967,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl)
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference < XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);;
- String sOldFolder;
+ OUString sOldFolder;
if ( m_pPathList->GetSelectEntryCount() > 0 )
{
INetURLObject aObj( m_pPathList->GetSelectEntry(), INetURLObject::FSYS_DETECT );
@@ -978,9 +978,9 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl)
xFolderPicker->setDisplayDirectory( sOldFolder );
if ( xFolderPicker->execute() == ExecutableDialogResults::OK )
{
- String sFolderURL( xFolderPicker->getDirectory() );
+ OUString sFolderURL( xFolderPicker->getDirectory() );
INetURLObject aURL( sFolderURL );
- String sNewFolder = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
+ OUString sNewFolder = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
if ( !IsPathDuplicate( sFolderURL ) )
{
sal_uInt16 nPos = m_pPathList->InsertEntry( sNewFolder, SvFileInformationManager::GetImage( aURL, false ) );
@@ -988,8 +988,8 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl)
}
else
{
- String sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
- sMsg.SearchAndReplaceAscii( "%1", sNewFolder );
+ OUString sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
+ sMsg = sMsg.replaceFirst( "%1", sNewFolder );
ErrorBox( this, WB_OK, sMsg ).Execute();
}
}
@@ -1028,7 +1028,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, SelectHdl_Impl)
// -----------------------------------------------------------------------
-bool SvxJavaClassPathDlg::IsPathDuplicate( const String& _rPath )
+bool SvxJavaClassPathDlg::IsPathDuplicate( const OUString& _rPath )
{
bool bRet = false;
INetURLObject aFileObj( _rPath );
@@ -1048,15 +1048,15 @@ bool SvxJavaClassPathDlg::IsPathDuplicate( const String& _rPath )
// -----------------------------------------------------------------------
-String SvxJavaClassPathDlg::GetClassPath() const
+OUString SvxJavaClassPathDlg::GetClassPath() const
{
- String sPath;
+ OUString sPath;
sal_uInt16 nCount = m_pPathList->GetEntryCount();
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
- if ( sPath.Len() > 0 )
- sPath += CLASSPATH_DELIMITER;
- String* pFullPath = static_cast< String* >( m_pPathList->GetEntryData(i) );
+ if ( !sPath.isEmpty() )
+ sPath += OUString(CLASSPATH_DELIMITER);
+ OUString* pFullPath = static_cast< OUString* >( m_pPathList->GetEntryData(i) );
if ( pFullPath )
sPath += *pFullPath;
else
@@ -1067,9 +1067,9 @@ String SvxJavaClassPathDlg::GetClassPath() const
// -----------------------------------------------------------------------
-void SvxJavaClassPathDlg::SetClassPath( const String& _rPath )
+void SvxJavaClassPathDlg::SetClassPath( const OUString& _rPath )
{
- if ( m_sOldPath.Len() == 0 )
+ if ( m_sOldPath.isEmpty() )
m_sOldPath = _rPath;
m_pPathList->Clear();
xub_StrLen i;
@@ -1077,9 +1077,9 @@ void SvxJavaClassPathDlg::SetClassPath( const String& _rPath )
xub_StrLen nCount = comphelper::string::getTokenCount(_rPath, CLASSPATH_DELIMITER);
for ( i = 0; i < nCount; ++i )
{
- String sToken = _rPath.GetToken( 0, CLASSPATH_DELIMITER, nIdx );
+ OUString sToken = _rPath.getToken( 0, CLASSPATH_DELIMITER, nIdx );
INetURLObject aURL( sToken, INetURLObject::FSYS_DETECT );
- String sPath = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
+ OUString sPath = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
m_pPathList->InsertEntry( sPath, SvFileInformationManager::GetImage( aURL, false ) );
}
// select first entry
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index a2724d7a2e9d..bb8debe1ad1f 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -68,9 +68,9 @@ private:
sal_Int32 m_nInfoSize;
sal_Int32 m_nParamSize;
#endif
- String m_sInstallText;
- String m_sAccessibilityText;
- String m_sAddDialogText;
+ OUString m_sInstallText;
+ OUString m_sAccessibilityText;
+ OUString m_sAddDialogText;
Timer m_aResetTimer;
CheckBox* m_pExperimentalCB;
@@ -154,14 +154,14 @@ private:
PushButton* m_pAddPathBtn;
PushButton* m_pRemoveBtn;
- String m_sOldPath;
+ OUString m_sOldPath;
DECL_LINK(AddArchiveHdl_Impl, void *);
DECL_LINK(AddPathHdl_Impl, void *);
DECL_LINK(RemoveHdl_Impl, void *);
DECL_LINK(SelectHdl_Impl, void *);
- bool IsPathDuplicate( const String& _rPath );
+ bool IsPathDuplicate( const OUString& _rPath );
inline void EnableRemoveButton()
{ m_pRemoveBtn->Enable(
m_pPathList->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); }
@@ -170,11 +170,11 @@ public:
SvxJavaClassPathDlg( Window* pParent );
~SvxJavaClassPathDlg();
- inline const String& GetOldPath() const { return m_sOldPath; }
+ inline const OUString& GetOldPath() const { return m_sOldPath; }
inline void SetFocus() { m_pPathList->GrabFocus(); }
- String GetClassPath() const;
- void SetClassPath( const String& _rPath );
+ OUString GetClassPath() const;
+ void SetClassPath( const OUString& _rPath );
};
#endif // #ifndef _SVX_OPTJAVA_HXX
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 84c2e77cecdf..8bbda6a2a8ea 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -158,7 +158,7 @@ static sal_uInt16 pRanges[] =
0
};
-sal_Bool KillFile_Impl( const String& rURL )
+sal_Bool KillFile_Impl( const OUString& rURL )
{
sal_Bool bRet = sal_True;
try
@@ -197,10 +197,10 @@ class ModuleUserData_Impl
sal_Bool bIsChecked;
sal_uInt8 nType;
sal_uInt8 nIndex;
- String sImplName;
+ OUString sImplName;
public:
- ModuleUserData_Impl( String sImpName, sal_Bool bIsParent, sal_Bool bChecked, sal_uInt8 nSetType, sal_uInt8 nSetIndex ) :
+ ModuleUserData_Impl( OUString sImpName, sal_Bool bIsParent, sal_Bool bChecked, sal_uInt8 nSetType, sal_uInt8 nSetIndex ) :
bParent(bIsParent),
bIsChecked(bChecked),
nType(nSetType),
@@ -213,7 +213,7 @@ public:
sal_Bool IsChecked() const {return bIsChecked;}
sal_uInt8 GetIndex() const {return nIndex;}
void SetIndex(sal_uInt8 nSet) {nIndex = nSet;}
- const String& GetImplName() const {return sImplName;}
+ const OUString& GetImplName() const {return sImplName;}
};
@@ -280,7 +280,7 @@ class BrwStringDic_Impl : public SvLBoxString
public:
BrwStringDic_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags,
- const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
+ const OUString& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
virtual void Paint(
const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
@@ -460,7 +460,7 @@ class BrwString_Impl : public SvLBoxString
public:
BrwString_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags,
- const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
+ const OUString& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
virtual void Paint(
const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
@@ -1113,16 +1113,16 @@ SvxLinguTabPage::SvxLinguTabPage( Window* pParent, const SfxItemSet& rSet ) :
if ( SvtExtendedSecurityOptions().GetOpenHyperlinkMode()
!= SvtExtendedSecurityOptions::OPEN_NEVER )
{
- m_pMoreDictsLink->SetURL( String(
+ m_pMoreDictsLink->SetURL( OUString(
"http://extensions.libreoffice.org/dictionaries/" ) );
m_pMoreDictsLink->SetClickHdl( LINK( this, SvxLinguTabPage, OpenURLHdl_Impl ) );
}
else
m_pMoreDictsLink->Hide();
- String sAccessibleNameModuleEdit(CUI_RES(RID_SVXSTR_LINGU_MODULES_EDIT));
- String sAccessibleNameDicsEdit (CUI_RES(RID_SVXSTR_LINGU_DICS_EDIT_DIC));
- String sAccessibleNameOptionEdit(CUI_RES(RID_SVXSTR_LINGU_OPTIONS_EDIT));
+ OUString sAccessibleNameModuleEdit(CUI_RES(RID_SVXSTR_LINGU_MODULES_EDIT));
+ OUString sAccessibleNameDicsEdit (CUI_RES(RID_SVXSTR_LINGU_DICS_EDIT_DIC));
+ OUString sAccessibleNameOptionEdit(CUI_RES(RID_SVXSTR_LINGU_OPTIONS_EDIT));
m_pLinguModulesEditPB->SetAccessibleName(sAccessibleNameModuleEdit);
m_pLinguDicsEditPB->SetAccessibleName(sAccessibleNameDicsEdit);
@@ -1284,7 +1284,7 @@ sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet )
if (bChecked)
{
- String aDicName( xDic->getName() );
+ OUString aDicName( xDic->getName() );
pActiveDic[ nActiveDics++ ] = aDicName;
}
}
@@ -1305,7 +1305,7 @@ sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet )
SvTreeListEntry *pEntry = m_pLinguOptionsCLB->GetEntry( j );
OptionsUserData aData( (sal_uLong)pEntry->GetUserData() );
- String aPropName( lcl_GetPropertyName( (EID_OPTIONS) aData.GetEntryId() ) );
+ OUString aPropName( lcl_GetPropertyName( (EID_OPTIONS) aData.GetEntryId() ) );
Any aAny;
if (aData.IsCheckable())
@@ -1382,7 +1382,7 @@ void SvxLinguTabPage::AddDicBoxEntry(
{
m_pLinguDicsCLB->SetUpdateMode(sal_False);
- String aTxt( ::GetDicInfoStr( rxDic->getName(),
+ OUString aTxt( ::GetDicInfoStr( rxDic->getName(),
LanguageTag( rxDic->getLocale() ).getLanguageType(),
DictionaryType_NEGATIVE == rxDic->getDictionaryType() ) );
m_pLinguDicsCLB->InsertEntry( aTxt, (sal_uInt16)LISTBOX_APPEND ); // append at end
@@ -1734,7 +1734,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
uno::Reference< frame::XStorable > xStor( xDic, UNO_QUERY );
if ( xStor->hasLocation() && !xStor->isReadonly() )
{
- String sURL = xStor->getLocation();
+ OUString sURL = xStor->getLocation();
INetURLObject aObj(sURL);
DBG_ASSERT( aObj.GetProtocol() == INET_PROT_FILE,
"non-file URLs cannot be deleted" );
@@ -1840,14 +1840,14 @@ IMPL_LINK( SvxLinguTabPage, SelectHdl_Impl, SvxCheckListBox *, pBox )
// -----------------------------------------------------------------------
-SvTreeListEntry* SvxLinguTabPage::CreateEntry( String& rTxt, sal_uInt16 nCol )
+SvTreeListEntry* SvxLinguTabPage::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
if( !pCheckButtonData )
pCheckButtonData = new SvLBoxButtonData(m_pLinguOptionsCLB);
- String sEmpty;
+ OUString sEmpty;
if (CBCOL_FIRST == nCol)
pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
if (CBCOL_SECOND == nCol)
@@ -1917,7 +1917,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(Window* pParent, SvxLinguData_Impl& rData)
if ( SvtExtendedSecurityOptions().GetOpenHyperlinkMode()
!= SvtExtendedSecurityOptions::OPEN_NEVER )
{
- aMoreDictsLink.SetURL( String(
+ aMoreDictsLink.SetURL( OUString(
"http://extensions.libreoffice.org/dictionaries/" ) );
aMoreDictsLink.SetClickHdl( LINK( this, SvxEditModulesDlg, OpenURLHdl_Impl ) );
}
@@ -1964,7 +1964,7 @@ SvxEditModulesDlg::~SvxEditModulesDlg()
}
-SvTreeListEntry* SvxEditModulesDlg::CreateEntry( String& rTxt, sal_uInt16 nCol )
+SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
if( !pCheckButtonData )
@@ -1973,7 +1973,7 @@ SvTreeListEntry* SvxEditModulesDlg::CreateEntry( String& rTxt, sal_uInt16 nCol )
pCheckButtonData->SetLink( aModulesCLB.GetCheckButtonHdl() );
}
- String sEmpty;
+ OUString sEmpty;
if (CBCOL_FIRST == nCol)
pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
if (CBCOL_SECOND == nCol)
@@ -2129,7 +2129,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
//
SvTreeListEntry* pEntry = CreateEntry( sSpell, CBCOL_SECOND );
ModuleUserData_Impl* pUserData = new ModuleUserData_Impl(
- String(), sal_True, sal_False, TYPE_SPELL, 0 );
+ OUString(), sal_True, sal_False, TYPE_SPELL, 0 );
pEntry->SetUserData( (void *)pUserData );
pModel->Insert( pEntry );
@@ -2151,7 +2151,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
}
if (!aImplName.isEmpty() && bIsSuppLang)
{
- String aTxt( pInfo->sDisplayName );
+ OUString aTxt( pInfo->sDisplayName );
SvTreeListEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
LangImplNameTable &rTable = rLinguData.GetSpellTable();
@@ -2173,7 +2173,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
// grammar checker entries
//
pEntry = CreateEntry( sGrammar, CBCOL_SECOND );
- pUserData = new ModuleUserData_Impl( String(), sal_True, sal_False, TYPE_GRAMMAR, 0 );
+ pUserData = new ModuleUserData_Impl( OUString(), sal_True, sal_False, TYPE_GRAMMAR, 0 );
pEntry->SetUserData( (void *)pUserData );
pModel->Insert( pEntry );
@@ -2195,7 +2195,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
}
if (!aImplName.isEmpty() && bIsSuppLang)
{
- String aTxt( pInfo->sDisplayName );
+ OUString aTxt( pInfo->sDisplayName );
SvTreeListEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
LangImplNameTable &rTable = rLinguData.GetGrammarTable();
@@ -2217,7 +2217,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
// hyphenator entries
//
pEntry = CreateEntry( sHyph, CBCOL_SECOND );
- pUserData = new ModuleUserData_Impl( String(), sal_True, sal_False, TYPE_HYPH, 0 );
+ pUserData = new ModuleUserData_Impl( OUString(), sal_True, sal_False, TYPE_HYPH, 0 );
pEntry->SetUserData( (void *)pUserData );
pModel->Insert( pEntry );
@@ -2239,7 +2239,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
}
if (!aImplName.isEmpty() && bIsSuppLang)
{
- String aTxt( pInfo->sDisplayName );
+ OUString aTxt( pInfo->sDisplayName );
SvTreeListEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
LangImplNameTable &rTable = rLinguData.GetHyphTable();
@@ -2261,7 +2261,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
// thesaurus entries
//
pEntry = CreateEntry( sThes, CBCOL_SECOND );
- pUserData = new ModuleUserData_Impl( String(), sal_True, sal_False, TYPE_THES, 0 );
+ pUserData = new ModuleUserData_Impl( OUString(), sal_True, sal_False, TYPE_THES, 0 );
pEntry->SetUserData( (void *)pUserData );
pModel->Insert( pEntry );
@@ -2283,7 +2283,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
}
if (!aImplName.isEmpty() && bIsSuppLang)
{
- String aTxt( pInfo->sDisplayName );
+ OUString aTxt( pInfo->sDisplayName );
SvTreeListEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
LangImplNameTable &rTable = rLinguData.GetThesTable();
@@ -2317,7 +2317,7 @@ IMPL_LINK( SvxEditModulesDlg, UpDownHdl_Impl, PushButton *, pBtn )
SvTreeList *pModel = aModulesCLB.GetModel();
ModuleUserData_Impl* pData = (ModuleUserData_Impl*)pEntry->GetUserData();
- String aStr(aModulesCLB.GetEntryText(pEntry));
+ OUString aStr(aModulesCLB.GetEntryText(pEntry));
SvTreeListEntry* pToInsert = CreateEntry( aStr, CBCOL_FIRST );
pToInsert->SetUserData( (void *)pData);
sal_Bool bIsChecked = aModulesCLB.IsChecked(nCurPos);
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index e0b5b08acfee..f33dde62c335 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -90,10 +90,10 @@ struct OptPath_Impl
struct PathUserData_Impl
{
- sal_uInt16 nRealId;
+ sal_uInt16 nRealId;
SfxItemState eState;
- String sUserPath;
- String sWritablePath;
+ OUString sUserPath;
+ OUString sWritablePath;
PathUserData_Impl( sal_uInt16 nId ) :
nRealId( nId ), eState( SFX_ITEM_UNKNOWN ) {}
@@ -122,9 +122,9 @@ static Handle2CfgNameMapping_Impl const Hdl2CfgMap_Impl[] =
{ USHRT_MAX, NULL }
};
-static String getCfgName_Impl( sal_uInt16 _nHandle )
+static OUString getCfgName_Impl( sal_uInt16 _nHandle )
{
- String sCfgName;
+ OUString sCfgName;
sal_uInt16 nIndex = 0;
while ( Hdl2CfgMap_Impl[ nIndex ].m_nHandle != USHRT_MAX )
{
@@ -142,21 +142,21 @@ static String getCfgName_Impl( sal_uInt16 _nHandle )
#define MULTIPATH_DELIMITER ';'
-String Convert_Impl( const String& rValue )
+OUString Convert_Impl( const OUString& rValue )
{
char cDelim = MULTIPATH_DELIMITER;
sal_uInt16 nCount = comphelper::string::getTokenCount(rValue, cDelim);
- String aReturn;
+ OUString aReturn;
for ( sal_uInt16 i=0; i<nCount ; ++i )
{
- String aValue = rValue.GetToken( i, cDelim );
+ OUString aValue = rValue.getToken( i, cDelim );
INetURLObject aObj( aValue );
if ( aObj.GetProtocol() == INET_PROT_FILE )
- aReturn += String(aObj.PathToFileName());
+ aReturn += aObj.PathToFileName();
else if ( ::utl::LocalFileHelper::IsFileContent( aValue ) )
- aReturn += String(aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ));
+ aReturn += aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET );
if ( i+1 < nCount)
- aReturn += MULTIPATH_DELIMITER;
+ aReturn += OUString(MULTIPATH_DELIMITER);
}
return aReturn;
@@ -308,17 +308,17 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
#endif
case SvtPathOptions::PATH_WORK:
{
- String aStr( CUI_RES( RID_SVXSTR_PATH_NAME_START + i ) );
+ OUString aStr( CUI_RES( RID_SVXSTR_PATH_NAME_START + i ) );
nWidth1 = std::max(nWidth1, pPathBox->GetTextWidth(aStr));
- aStr += '\t';
- String sInternal, sUser, sWritable;
+ aStr += "\t";
+ OUString sInternal, sUser, sWritable;
sal_Bool bReadOnly = sal_False;
GetPathList( i, sInternal, sUser, sWritable, bReadOnly );
- String sTmpPath = sUser;
- if ( sTmpPath.Len() > 0 && sWritable.Len() > 0 )
- sTmpPath += MULTIPATH_DELIMITER;
+ OUString sTmpPath = sUser;
+ if ( !sTmpPath.isEmpty() && !sWritable.isEmpty() )
+ sTmpPath += OUString(MULTIPATH_DELIMITER);
sTmpPath += sWritable;
- String aValue( sTmpPath );
+ OUString aValue( sTmpPath );
aValue = Convert_Impl( aValue );
nWidth2 = std::max(nWidth2, pPathBox->GetTextWidth(aValue));
aStr += aValue;
@@ -376,10 +376,10 @@ void SvxPathTabPage::FillUserData()
{
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
- String aUserData = OUString::number( rBar.GetItemSize( ITEMID_TYPE ) ) + ";";
+ OUString aUserData = OUString::number( rBar.GetItemSize( ITEMID_TYPE ) ) + ";";
HeaderBarItemBits nBits = rBar.GetItemBits( ITEMID_TYPE );
sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- aUserData += bUp ? '1' : '0';
+ aUserData += bUp ? OUString("1") : OUString("0");
SetUserData( aUserData );
}
@@ -414,11 +414,11 @@ IMPL_LINK_NOARG(SvxPathTabPage, StandardHdl_Impl)
while ( pEntry )
{
PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
- String aOldPath = pImpl->m_aDefOpt.GetDefaultPath( pPathImpl->nRealId );
+ OUString aOldPath = pImpl->m_aDefOpt.GetDefaultPath( pPathImpl->nRealId );
- if ( aOldPath.Len() )
+ if ( !aOldPath.isEmpty() )
{
- String sInternal, sUser, sWritable, sTemp;
+ OUString sInternal, sUser, sWritable, sTemp;
sal_Bool bReadOnly = sal_False;
GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
@@ -428,29 +428,29 @@ IMPL_LINK_NOARG(SvxPathTabPage, StandardHdl_Impl)
for ( i = 0; i < nOldCount; ++i )
{
bool bFound = false;
- String sOnePath = aOldPath.GetToken( i, MULTIPATH_DELIMITER );
+ OUString sOnePath = aOldPath.getToken( i, MULTIPATH_DELIMITER );
for ( sal_uInt16 j = 0; !bFound && j < nIntCount; ++j )
{
- if ( sInternal.GetToken( i, MULTIPATH_DELIMITER ) == sOnePath )
+ if ( sInternal.getToken( i, MULTIPATH_DELIMITER ) == sOnePath )
bFound = true;
}
if ( !bFound )
{
- if ( sTemp.Len() > 0 )
- sTemp += MULTIPATH_DELIMITER;
+ if ( !sTemp.isEmpty() )
+ sTemp += OUString(MULTIPATH_DELIMITER);
sTemp += sOnePath;
}
}
- String sUserPath, sWritablePath;
+ OUString sUserPath, sWritablePath;
nOldCount = comphelper::string::getTokenCount(sTemp, MULTIPATH_DELIMITER);
for ( i = 0; nOldCount > 0 && i < nOldCount - 1; ++i )
{
- if ( sUserPath.Len() > 0 )
- sUserPath += MULTIPATH_DELIMITER;
- sUserPath += sTemp.GetToken( i, MULTIPATH_DELIMITER );
+ if ( !sUserPath.isEmpty() )
+ sUserPath += OUString(MULTIPATH_DELIMITER);
+ sUserPath += sTemp.getToken( i, MULTIPATH_DELIMITER );
}
- sWritablePath = sTemp.GetToken( nOldCount - 1, MULTIPATH_DELIMITER );
+ sWritablePath = sTemp.getToken( nOldCount - 1, MULTIPATH_DELIMITER );
pPathBox->SetEntryText( Convert_Impl( sTemp ), pEntry, 1 );
pPathImpl->eState = SFX_ITEM_SET;
@@ -464,7 +464,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, StandardHdl_Impl)
// -----------------------------------------------------------------------
-void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder )
+void SvxPathTabPage::ChangeCurrentEntry( const OUString& _rFolder )
{
SvTreeListEntry* pEntry = pPathBox->GetCurEntry();
if ( !pEntry )
@@ -473,7 +473,7 @@ void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder )
return;
}
- String sInternal, sUser, sWritable;
+ OUString sInternal, sUser, sWritable;
PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
sal_Bool bReadOnly = sal_False;
GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
@@ -533,7 +533,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl)
{
SvTreeListEntry* pEntry = pPathBox->GetCurEntry();
sal_uInt16 nPos = ( pEntry != NULL ) ? ( (PathUserData_Impl*)pEntry->GetUserData() )->nRealId : 0;
- String sInternal, sUser, sWritable;
+ OUString sInternal, sUser, sWritable;
if ( pEntry )
{
PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
@@ -556,23 +556,23 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl)
DBG_ASSERT( pMultiDlg, "Dialogdiet fail!" );
pMultiDlg->EnableRadioButtonMode();
- String sPath( sUser );
- if ( sPath.Len() > 0 )
- sPath += MULTIPATH_DELIMITER;
+ OUString sPath( sUser );
+ if ( !sPath.isEmpty() )
+ sPath += OUString(MULTIPATH_DELIMITER);
sPath += sWritable;
pMultiDlg->SetPath( sPath );
- String sPathName = pPathBox->GetEntryText( pEntry, 0 );
- String sNewTitle( pImpl->m_sMultiPathDlg );
- sNewTitle.SearchAndReplace( VAR_ONE, sPathName );
+ OUString sPathName = pPathBox->GetEntryText( pEntry, 0 );
+ OUString sNewTitle( pImpl->m_sMultiPathDlg );
+ sNewTitle = sNewTitle.replaceFirst( VAR_ONE, sPathName );
pMultiDlg->SetTitle( sNewTitle );
if ( pMultiDlg->Execute() == RET_OK && pEntry )
{
- sUser.Erase();
- sWritable.Erase();
- String sFullPath;
- String sNewPath = pMultiDlg->GetPath();
+ sUser = "";
+ sWritable = "";
+ OUString sFullPath;
+ OUString sNewPath = pMultiDlg->GetPath();
char cDelim = MULTIPATH_DELIMITER;
sal_uInt16 nCount = comphelper::string::getTokenCount(sNewPath, cDelim);
if ( nCount > 0 )
@@ -580,16 +580,16 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl)
sal_uInt16 i = 0;
for ( ; i < nCount - 1; ++i )
{
- if ( sUser.Len() > 0 )
- sUser += cDelim;
- sUser += sNewPath.GetToken( i, cDelim );
+ if ( !sUser.isEmpty() )
+ sUser += OUString(cDelim);
+ sUser += sNewPath.getToken( i, cDelim );
}
- if ( sFullPath.Len() > 0 )
- sFullPath += cDelim;
+ if ( !sFullPath.isEmpty() )
+ sFullPath += OUString(cDelim);
sFullPath += sUser;
- sWritable += sNewPath.GetToken( i, cDelim );
- if ( sFullPath.Len() > 0 )
- sFullPath += cDelim;
+ sWritable += sNewPath.getToken( i, cDelim );
+ if ( !sFullPath.isEmpty() )
+ sFullPath += OUString(cDelim);
sFullPath += sWritable;
}
@@ -622,7 +622,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl)
if ( ExecutableDialogResults::OK != nRet )
return 0;
- String sFolder( xFolderPicker->getDirectory() );
+ OUString sFolder( xFolderPicker->getDirectory() );
ChangeCurrentEntry( sFolder );
}
}
@@ -702,7 +702,7 @@ IMPL_LINK( SvxPathTabPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
{
DBG_ASSERT( xFolderPicker.is() == sal_True, "SvxPathTabPage::DialogClosedHdl(): no folder picker" );
- String sURL = String( xFolderPicker->getDirectory() );
+ OUString sURL = xFolderPicker->getDirectory();
ChangeCurrentEntry( sURL );
}
return 0L;
@@ -711,10 +711,10 @@ IMPL_LINK( SvxPathTabPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
// -----------------------------------------------------------------------
void SvxPathTabPage::GetPathList(
- sal_uInt16 _nPathHandle, String& _rInternalPath,
- String& _rUserPath, String& _rWritablePath, sal_Bool& _rReadOnly )
+ sal_uInt16 _nPathHandle, OUString& _rInternalPath,
+ OUString& _rUserPath, OUString& _rWritablePath, sal_Bool& _rReadOnly )
{
- String sCfgName = getCfgName_Impl( _nPathHandle );
+ OUString sCfgName = getCfgName_Impl( _nPathHandle );
try
{
@@ -726,7 +726,7 @@ void SvxPathTabPage::GetPathList(
}
// load internal paths
- String sProp( sCfgName );
+ OUString sProp( sCfgName );
sProp += POSTFIX_INTERNAL;
Any aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
Sequence< OUString > aPathSeq;
@@ -737,9 +737,9 @@ void SvxPathTabPage::GetPathList(
for ( i = 0; i < nCount; ++i )
{
- if ( _rInternalPath.Len() > 0 )
- _rInternalPath += ';';
- _rInternalPath += String( pPaths[i] );
+ if ( !_rInternalPath.isEmpty() )
+ _rInternalPath += ";";
+ _rInternalPath += pPaths[i];
}
}
// load user paths
@@ -753,9 +753,9 @@ void SvxPathTabPage::GetPathList(
for ( i = 0; i < nCount; ++i )
{
- if ( _rUserPath.Len() > 0 )
- _rUserPath += ';';
- _rUserPath += String( pPaths[i] );
+ if ( !_rUserPath.isEmpty() )
+ _rUserPath += ";";
+ _rUserPath += pPaths[i];
}
}
// then the writable path
@@ -764,7 +764,7 @@ void SvxPathTabPage::GetPathList(
aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
OUString sWritablePath;
if ( aAny >>= sWritablePath )
- _rWritablePath = String( sWritablePath );
+ _rWritablePath = sWritablePath;
// and the readonly flag
sProp = sCfgName;
@@ -781,9 +781,9 @@ void SvxPathTabPage::GetPathList(
// -----------------------------------------------------------------------
void SvxPathTabPage::SetPathList(
- sal_uInt16 _nPathHandle, const String& _rUserPath, const String& _rWritablePath )
+ sal_uInt16 _nPathHandle, const OUString& _rUserPath, const OUString& _rWritablePath )
{
- String sCfgName = getCfgName_Impl( _nPathHandle );
+ OUString sCfgName = getCfgName_Impl( _nPathHandle );
try
{
@@ -800,8 +800,8 @@ void SvxPathTabPage::SetPathList(
Sequence< OUString > aPathSeq( nCount );
OUString* pArray = aPathSeq.getArray();
for ( sal_uInt16 i = 0; i < nCount; ++i )
- pArray[i] = OUString( _rUserPath.GetToken( i, cDelim ) );
- String sProp( sCfgName );
+ pArray[i] = _rUserPath.getToken( i, cDelim );
+ OUString sProp( sCfgName );
sProp += POSTFIX_USER;
Any aValue = makeAny( aPathSeq );
pImpl->m_xPathSettings->setPropertyValue( sProp, aValue );
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 01c9f22a2276..8adb5c356b9b 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -122,18 +122,18 @@ static const sal_Char* pViewOptDataName = "page data";
static XOutdevItemPool* mpStaticXOutdevItemPool = 0L;
-static inline void SetViewOptUserItem( SvtViewOptions& rOpt, const String& rData )
+static inline void SetViewOptUserItem( SvtViewOptions& rOpt, const OUString& rData )
{
rOpt.SetUserItem( VIEWOPT_DATANAME, makeAny( OUString( rData ) ) );
}
-static inline String GetViewOptUserItem( const SvtViewOptions& rOpt )
+static inline OUString GetViewOptUserItem( const SvtViewOptions& rOpt )
{
Any aAny( rOpt.GetUserItem( VIEWOPT_DATANAME ) );
OUString aUserData;
aAny >>= aUserData;
- return String( aUserData );
+ return aUserData;
}
struct ModuleToGroupNameMap_Impl
@@ -163,7 +163,7 @@ static ModuleToGroupNameMap_Impl ModuleMap[] =
{ NULL, OUString(), 0xFFFF }
};
-static void setGroupName( const OUString& rModule, const String& rGroupName )
+static void setGroupName( const OUString& rModule, const OUString& rGroupName )
{
sal_uInt16 nIndex = 0;
while ( ModuleMap[ nIndex ].m_pModule )
@@ -179,9 +179,9 @@ static void setGroupName( const OUString& rModule, const String& rGroupName )
}
}
-static String getGroupName( const OUString& rModule, bool bForced )
+static OUString getGroupName( const OUString& rModule, bool bForced )
{
- String sGroupName;
+ OUString sGroupName;
sal_uInt16 nIndex = 0;
while ( ModuleMap[ nIndex ].m_pModule )
{
@@ -195,7 +195,7 @@ static String getGroupName( const OUString& rModule, bool bForced )
++nIndex;
}
- if ( sGroupName.Len() == 0 && bForced )
+ if ( sGroupName.isEmpty() && bForced )
{
if ( !pPageRes )
pPageRes = new OfaPageResource;
@@ -423,7 +423,7 @@ static OptionsMapping_Impl const OptionsMap_Impl[] =
{ NULL, NULL, 0 }
};
-static sal_Bool lcl_getStringFromID( sal_uInt16 _nPageId, String& _rGroupName, String& _rPageName )
+static sal_Bool lcl_getStringFromID( sal_uInt16 _nPageId, OUString& _rGroupName, OUString& _rPageName )
{
sal_Bool bRet = sal_False;
@@ -433,9 +433,9 @@ static sal_Bool lcl_getStringFromID( sal_uInt16 _nPageId, String& _rGroupName, S
if ( _nPageId == OptionsMap_Impl[nIdx].m_nPageId )
{
bRet = sal_True;
- _rGroupName = String( OptionsMap_Impl[nIdx].m_pGroupName, RTL_TEXTENCODING_ASCII_US );
+ _rGroupName = OUString::createFromAscii( OptionsMap_Impl[nIdx].m_pGroupName );
if ( OptionsMap_Impl[nIdx].m_pPageName != NULL )
- _rPageName = String( OptionsMap_Impl[nIdx].m_pPageName, RTL_TEXTENCODING_ASCII_US );
+ _rPageName = OUString::createFromAscii( OptionsMap_Impl[nIdx].m_pPageName );
break;
}
++nIdx;
@@ -447,10 +447,10 @@ static sal_Bool lcl_getStringFromID( sal_uInt16 _nPageId, String& _rGroupName, S
static sal_Bool lcl_isOptionHidden( sal_uInt16 _nPageId, const SvtOptionsDialogOptions& _rOptOptions )
{
sal_Bool bIsHidden = sal_False;
- String sGroupName, sPageName;
+ OUString sGroupName, sPageName;
if ( lcl_getStringFromID( _nPageId, sGroupName, sPageName ) )
{
- if ( sPageName.Len() == 0 )
+ if ( sPageName.isEmpty() )
bIsHidden = _rOptOptions.IsGroupHidden( sGroupName );
else
bIsHidden = _rOptOptions.IsPageHidden( sPageName, sGroupName );
@@ -558,8 +558,8 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
if(pPageInfo->m_pPage)
{
pPageInfo->m_pPage->FillUserData();
- String aPageData(pPageInfo->m_pPage->GetUserData());
- if ( aPageData.Len() )
+ OUString aPageData(pPageInfo->m_pPage->GetUserData());
+ if ( !aPageData.isEmpty() )
{
SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number( pPageInfo->m_nPageId) );
SetViewOptUserItem( aTabPageOpt, aPageData );
@@ -603,7 +603,7 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
}
OptionsPageInfo* OfaTreeOptionsDialog::AddTabPage(
- sal_uInt16 nId, const String& rPageName, sal_uInt16 nGroup )
+ sal_uInt16 nId, const OUString& rPageName, sal_uInt16 nGroup )
{
OptionsPageInfo* pPageInfo = new OptionsPageInfo( nId );
SvTreeListEntry* pParent = aTreeLB.GetEntry( 0, nGroup );
@@ -614,7 +614,7 @@ OptionsPageInfo* OfaTreeOptionsDialog::AddTabPage(
}
// the ItemSet* is passed on to the dialog's ownership
-sal_uInt16 OfaTreeOptionsDialog::AddGroup(const String& rGroupName,
+sal_uInt16 OfaTreeOptionsDialog::AddGroup(const OUString& rGroupName,
SfxShell* pCreateShell,
SfxModule* pCreateModule,
sal_uInt16 nDialogId )
@@ -804,7 +804,7 @@ void OfaTreeOptionsDialog::ActivatePage( sal_uInt16 nResId )
pLastPageSaver->m_nLastPageId = nTemp;
}
-void OfaTreeOptionsDialog::ActivatePage( const String& rPageURL )
+void OfaTreeOptionsDialog::ActivatePage( const OUString& rPageURL )
{
DBG_ASSERT( !bIsFromExtensionManager, "OfaTreeOptionsDialog::ActivatePage(): call from extension manager" );
if ( !pLastPageSaver )
@@ -821,9 +821,9 @@ void OfaTreeOptionsDialog::ActivateLastSelection()
if ( pLastPageSaver )
{
OUString sExpand( EXPAND_PROTOCOL );
- String sLastURL = bIsFromExtensionManager ? pLastPageSaver->m_sLastPageURL_ExtMgr
+ OUString sLastURL = bIsFromExtensionManager ? pLastPageSaver->m_sLastPageURL_ExtMgr
: pLastPageSaver->m_sLastPageURL_Tools;
- if ( sLastURL.Len() == 0 )
+ if ( sLastURL.isEmpty() )
{
sLastURL = !bIsFromExtensionManager ? pLastPageSaver->m_sLastPageURL_ExtMgr
: pLastPageSaver->m_sLastPageURL_Tools;
@@ -1549,7 +1549,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
for ( i = 1; i < nEnd; ++i )
{
- String sNewTitle = rGeneralArray.GetString(i);
+ OUString sNewTitle = rGeneralArray.GetString(i);
nPageId = (sal_uInt16)rGeneralArray.GetValue(i);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
@@ -1906,7 +1906,7 @@ bool isNodeActive( OptionsNode* pNode, Module* pModule )
return true;
// OOo-Nodes (Writer, Calc, Impress...) are active if node is already inserted
- if ( getGroupName( pNode->m_sId, false ).Len() > 0 )
+ if ( !getGroupName( pNode->m_sId, false ).isEmpty() )
return true;
// no module -> not active
@@ -2047,7 +2047,7 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes(
for ( int i = 0; i < seqNames.getLength(); ++i )
{
- String sGroupName( seqNames[i] );
+ OUString sGroupName( seqNames[i] );
Reference< XNameAccess > xNodeAccess;
xSet->getByName( seqNames[i] ) >>= xNodeAccess;
@@ -2066,8 +2066,8 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes(
if ( sLabel.isEmpty() )
sLabel = sGroupName;
- String sTemp = getGroupName( sLabel, !rExtensionId.isEmpty() );
- if ( sTemp.Len() > 0 )
+ OUString sTemp = getGroupName( sLabel, !rExtensionId.isEmpty() );
+ if ( !sTemp.isEmpty() )
sLabel = sTemp;
OptionsNode* pNode =
new OptionsNode( sNodeId, sLabel, sPageURL, bAllModules, sGroupId, nGroupIndex );
@@ -2181,14 +2181,14 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes(
static sal_uInt16 lcl_getGroupId( const OUString& rGroupName, const SvTreeListBox& rTreeLB )
{
- String sGroupName( rGroupName );
+ OUString sGroupName( rGroupName );
sal_uInt16 nRet = 0;
SvTreeListEntry* pEntry = rTreeLB.First();
while( pEntry )
{
if ( !rTreeLB.GetParent( pEntry ) )
{
- String sTemp( rTreeLB.GetEntryText( pEntry ) );
+ OUString sTemp( rTreeLB.GetEntryText( pEntry ) );
if ( sTemp == sGroupName )
return nRet;
nRet++;
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index 189ead276ab0..03a7a79fe6b0 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -278,7 +278,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, ChangePasswordHdl)
if ( pPasswordRequest->isPassword() )
{
- String aNewPass = pPasswordRequest->getPassword();
+ OUString aNewPass = pPasswordRequest->getPassword();
uno::Sequence< OUString > aPasswd( 1 );
aPasswd[0] = aNewPass;