From c99cc9750841e92e4ba5678a3e558dd4668dd264 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 11 Oct 2013 16:34:04 +0200 Subject: convert sw/source/ui/misc/*.cxx from String to OUString Change-Id: I370a92ec5d94ba66df20992f6df26e78b91f31af --- sw/source/ui/misc/bookmark.cxx | 22 ++++++++-------- sw/source/ui/misc/docfnote.cxx | 6 ++--- sw/source/ui/misc/glosbib.cxx | 60 +++++++++++++++++++++--------------------- sw/source/ui/misc/glossary.cxx | 14 +++++----- sw/source/ui/misc/linenum.cxx | 16 +++++------ sw/source/ui/misc/num.cxx | 4 +-- sw/source/ui/misc/outline.cxx | 20 +++++++------- sw/source/ui/misc/pgfnote.cxx | 2 +- sw/source/ui/misc/pggrid.cxx | 2 +- sw/source/ui/misc/redlndlg.cxx | 26 +++++++++--------- sw/source/ui/misc/srtdlg.cxx | 34 ++++++++++++------------ sw/source/ui/misc/swruler.cxx | 4 +-- 12 files changed, 105 insertions(+), 105 deletions(-) (limited to 'sw') diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index c1a7026e511e..68106224af1f 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -40,20 +40,20 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox ) // there may be illegal characters in the box if(!bSelEntries) { - String sTmp = pBox->GetText(); - sal_uInt16 nLen = sTmp.Len(); - String sMsg; + OUString sTmp = pBox->GetText(); + sal_uInt16 nLen = sTmp.getLength(); + OUString sMsg; for(sal_uInt16 i = 0; i < BookmarkCombo::aForbiddenChars.getLength(); i++) { - sal_uInt16 nTmpLen = sTmp.Len(); + sal_uInt16 nTmpLen = sTmp.getLength(); sTmp = comphelper::string::remove(sTmp, BookmarkCombo::aForbiddenChars[i]); - if(sTmp.Len() != nTmpLen) - sMsg += BookmarkCombo::aForbiddenChars[i]; + if(sTmp.getLength() != nTmpLen) + sMsg += OUString(BookmarkCombo::aForbiddenChars[i]); } - if(sTmp.Len() != nLen) + if(sTmp.getLength() != nLen) { pBox->SetText(sTmp); - String sWarning(sRemoveWarning); + OUString sWarning(sRemoveWarning); sWarning += sMsg; InfoBox(this, sWarning).Execute(); } @@ -94,7 +94,7 @@ void SwInsertBookmarkDlg::Apply() //name for (sal_uInt16 nCount = m_pBookmarkBox->GetRemovedCount(); nCount > 0; nCount--) { - String sRemoved = m_pBookmarkBox->GetRemovedEntry( nCount -1 ).GetName(); + OUString sRemoved = m_pBookmarkBox->GetRemovedEntry( nCount -1 ).GetName(); IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); pMarkAccess->deleteMark( pMarkAccess->findMark(sRemoved) ); SfxRequest aReq( rSh.GetView().GetViewFrame(), FN_DELETE_BOOKMARK ); @@ -108,7 +108,7 @@ void SwInsertBookmarkDlg::Apply() if (!m_pBookmarkBox->GetText().isEmpty() && (m_pBookmarkBox->GetSwEntryPos(aTmpEntry) == COMBOBOX_ENTRY_NOTFOUND)) { - String sEntry(comphelper::string::remove(m_pBookmarkBox->GetText(), + OUString sEntry(comphelper::string::remove(m_pBookmarkBox->GetText(), m_pBookmarkBox->GetMultiSelectionSeparator())); rSh.SetBookmark( KeyCode(), sEntry, aEmptyStr ); @@ -150,7 +150,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRe } } - sRemoveWarning = String(SW_RES(STR_REMOVE_WARNING)); + sRemoveWarning = OUString(SW_RES(STR_REMOVE_WARNING)); } SwInsertBookmarkDlg::~SwInsertBookmarkDlg() diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 843729041e9a..5026981f720f 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -234,7 +234,7 @@ SfxTabPage *SwEndNoteOptionPage::Create( Window *pParent, const SfxItemSet &rSet ------------------------------------------------------------------------*/ void SwEndNoteOptionPage::SelectNumbering(int eNum) { - String sSelect; + OUString sSelect; switch(eNum) { case FTNNUM_DOC: @@ -332,7 +332,7 @@ IMPL_LINK_NOARG_INLINE_START(SwEndNoteOptionPage, PosChapterHdl) } IMPL_LINK_NOARG_INLINE_END(SwEndNoteOptionPage, PosChapterHdl) -static SwCharFmt* lcl_GetCharFormat( SwWrtShell* pSh, const String& rCharFmtName ) +static SwCharFmt* lcl_GetCharFormat( SwWrtShell* pSh, const OUString& rCharFmtName ) { SwCharFmt* pFmt = 0; sal_uInt16 nChCount = pSh->GetCharFmtCount(); @@ -375,7 +375,7 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) sal_uInt16 nPos = m_pParaTemplBox->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { - const String aFmtName( m_pParaTemplBox->GetSelectEntry() ); + const OUString aFmtName( m_pParaTemplBox->GetSelectEntry() ); SwTxtFmtColl *pColl = pSh->GetParaStyle(aFmtName, SwWrtShell::GETSTYLE_CREATEANY); OSL_ENSURE(pColl, "paragraph style not found"); pInf->SetFtnTxtColl(*pColl); diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index a08a6211768d..6d5277536072 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -95,15 +95,15 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, for( sal_uInt16 i = 0; i < nCount; ++i) { OUString sTitle; - String sGroup = pHdl->GetGroupName(i, &sTitle); - if(!sGroup.Len()) + OUString sGroup = pHdl->GetGroupName(i, &sTitle); + if(sGroup.isEmpty()) continue; GlosBibUserData* pData = new GlosBibUserData; pData->sGroupName = sGroup; pData->sGroupTitle = sTitle; - String sTemp(sTitle); - sTemp += '\t'; - pData->sPath = m_pPathLB->GetEntry((sal_uInt16)sGroup.GetToken(1, GLOS_DELIM).ToInt32()); + OUString sTemp(sTitle); + sTemp += "\t"; + pData->sPath = m_pPathLB->GetEntry((sal_uInt16)sGroup.getToken(1, GLOS_DELIM).toInt32()); sTemp += pData->sPath; SvTreeListEntry* pEntry = m_pGroupTLB->InsertEntry(sTemp); pEntry->SetUserData(pData); @@ -121,12 +121,12 @@ void SwGlossaryGroupDlg::Apply() if(m_pNewPB->IsEnabled()) NewHdl(m_pNewPB); - String aActGroup = SwGlossaryDlg::GetCurrGroup(); + OUString aActGroup = SwGlossaryDlg::GetCurrGroup(); for (OUVector_t::const_iterator it(m_RemovedArr.begin()); it != m_RemovedArr.end(); ++it) { - const String sDelGroup = it->getToken(0, '\t'); + const OUString sDelGroup = it->getToken(0, '\t'); if( sDelGroup == aActGroup ) { //when the current group is deleted, the current group has to be relocated @@ -137,12 +137,12 @@ void SwGlossaryGroupDlg::Apply() pGlosHdl->SetCurGroup(pUserData->sGroupName); } } - String sMsg(SW_RES(STR_QUERY_DELETE_GROUP1)); - String sTitle( it->getToken(1, '\t') ); - if(sTitle.Len()) + OUString sMsg(SW_RES(STR_QUERY_DELETE_GROUP1)); + OUString sTitle( it->getToken(1, '\t') ); + if(!sTitle.isEmpty()) sMsg += sTitle; else - sDelGroup.GetToken(1, GLOS_DELIM); + sDelGroup.getToken(1, GLOS_DELIM); sMsg += SW_RESSTR(STR_QUERY_DELETE_GROUP2); QueryBox aQuery(this->GetParent(), WB_YES_NO|WB_DEF_NO, sMsg ); if(RET_YES == aQuery.Execute()) @@ -183,19 +183,19 @@ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG ) if(pFirstEntry) { GlosBibUserData* pUserData = (GlosBibUserData*)pFirstEntry->GetUserData(); - String sEntry(pUserData->sGroupName); - String sName(m_pNameED->GetText()); + OUString sEntry(pUserData->sGroupName); + OUString sName(m_pNameED->GetText()); bool bExists = false; sal_uLong nPos = m_pGroupTLB->GetEntryPos(sName, 0); if( 0xffffffff > nPos) { SvTreeListEntry* pEntry = m_pGroupTLB->GetEntry(nPos); GlosBibUserData* pFoundData = (GlosBibUserData*)pEntry->GetUserData(); - String sGroup = pFoundData->sGroupName; + OUString sGroup = pFoundData->sGroupName; bExists = sGroup == sEntry; } - m_pRenamePB->Enable(!bExists && sName.Len()); + m_pRenamePB->Enable(!bExists && !sName.isEmpty()); m_pDelPB->Enable(IsDeleteAllowed(sEntry)); } return 0; @@ -208,8 +208,8 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, NewHdl) + OUString::number(m_pPathLB->GetSelectEntryPos()); OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!"); m_InsertedArr.push_back(sGroup); - String sTemp(m_pNameED->GetText()); - sTemp += '\t'; + OUString sTemp(m_pNameED->GetText()); + sTemp += "\t"; sTemp += m_pPathLB->GetSelectEntry(); SvTreeListEntry* pEntry = m_pGroupTLB->InsertEntry(sTemp); GlosBibUserData* pData = new GlosBibUserData; @@ -263,8 +263,8 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) } if(bDelete) { - String sGroupEntry(pUserData->sGroupName); - sGroupEntry += '\t'; + OUString sGroupEntry(pUserData->sGroupName); + sGroupEntry += "\t"; sGroupEntry += pUserData->sGroupTitle; m_RemovedArr.push_back(sGroupEntry); } @@ -281,7 +281,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl) { SvTreeListEntry* pEntry = m_pGroupTLB->FirstSelected(); GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); - String sEntry(pUserData->sGroupName); + OUString sEntry(pUserData->sGroupName); const OUString sNewTitle(m_pNameED->GetText()); OUString sNewName = sNewTitle @@ -304,16 +304,16 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl) } if(!bDone) { - sEntry += RENAME_TOKEN_DELIM; + sEntry += OUString(RENAME_TOKEN_DELIM); sEntry += sNewName; - sEntry += RENAME_TOKEN_DELIM; + sEntry += OUString(RENAME_TOKEN_DELIM); sEntry += sNewTitle; m_RenamedArr.push_back(sEntry); } delete (GlosBibUserData*)pEntry->GetUserData(); m_pGroupTLB->GetModel()->Remove(pEntry); - String sTemp(m_pNameED->GetText()); - sTemp += '\t'; + OUString sTemp(m_pNameED->GetText()); + sTemp += "\t"; sTemp += m_pPathLB->GetSelectEntry(); pEntry = m_pGroupTLB->InsertEntry(sTemp); GlosBibUserData* pData = new GlosBibUserData; @@ -329,16 +329,16 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl) IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) { - String sEntry(m_pNameED->GetText()); + OUString sEntry(m_pNameED->GetText()); sal_Bool bEnableNew = sal_True; sal_Bool bEnableDel = sal_False; sal_uLong nCaseReadonly = (sal_uLong)m_pPathLB->GetEntryData(m_pPathLB->GetSelectEntryPos()); bool bDirReadonly = 0 != (nCaseReadonly&PATH_READONLY); - if(!sEntry.Len() || bDirReadonly) + if(sEntry.isEmpty() || bDirReadonly) bEnableNew = sal_False; - else if(sEntry.Len()) + else if(!sEntry.isEmpty()) { sal_uLong nPos = m_pGroupTLB->GetEntryPos(sEntry, 0); //if it's not case sensitive you have to search for yourself @@ -347,7 +347,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); for(sal_uInt16 i = 0; i < m_pGroupTLB->GetEntryCount(); i++) { - String sTemp = m_pGroupTLB->GetEntryText( i, 0 ); + OUString sTemp = m_pGroupTLB->GetEntryText( i, 0 ); nCaseReadonly = (sal_uLong)m_pPathLB->GetEntryData( m_pPathLB->GetEntryPos(m_pGroupTLB->GetEntryText(i,1))); bool bCase = 0 != (nCaseReadonly & PATH_CASE_SENSITIVE); @@ -433,10 +433,10 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt ) aSize.Width() = GetSizePixel().Width() - aPos.X(); aPos = OutputToScreenPixel(aPos); Rectangle aItemRect( aPos, aSize ); - String sMsg; + OUString sMsg; GlosBibUserData* pData = (GlosBibUserData*)pEntry->GetUserData(); sMsg = pData->sPath; - sMsg += INET_PATH_TOKEN; + sMsg += OUString(INET_PATH_TOKEN); sMsg += pData->sGroupName.getToken(0, GLOS_DELIM); sMsg += SwGlossaries::GetExtension(); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index d926666b86ad..9a2f7efc2623 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -101,7 +101,7 @@ static OUString lcl_GetValidShortCut( const OUString& rName ) struct GroupUserData { - String sGroupName; + OUString sGroupName; sal_uInt16 nPathIdx; bool bReadonly; @@ -127,16 +127,16 @@ protected: public: SwNewGlosNameDlg( Window* pParent, - const String& rOldName, - const String& rOldShort ); + const OUString& rOldName, + const OUString& rOldShort ); - String GetNewName() const { return m_pNewName->GetText(); } - String GetNewShort() const { return m_pNewShort->GetText(); } + OUString GetNewName() const { return m_pNewName->GetText(); } + OUString GetNewShort() const { return m_pNewShort->GetText(); } }; SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent, - const String& rOldName, - const String& rOldShort ) + const OUString& rOldName, + const OUString& rOldShort ) : ModalDialog(pParent, "RenameAutoTextDialog", "modules/swriter/ui/renameautotextdialog.ui") { diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index 5aa6859f807a..da2d76abbdf6 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -54,18 +54,18 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) get(m_pRestartEachPageCB, "restarteverynewpage"); get(m_pNumberingOnCB, "shownumbering"); - String sIntervalName = m_pDivIntervalFT->GetAccessibleName(); - sIntervalName += OUString("("); + OUString sIntervalName = m_pDivIntervalFT->GetAccessibleName(); + sIntervalName += "("; sIntervalName += m_pDivRowsFT->GetAccessibleName(); - sIntervalName += OUString(")"); + sIntervalName += ")"; m_pDivIntervalNF->SetAccessibleName(sIntervalName); Window *pNumIntervalFT = get("interval"); Window *pNumRowsFT = get("intervallines"); sIntervalName = pNumIntervalFT->GetAccessibleName(); - sIntervalName += OUString("("); + sIntervalName += "("; sIntervalName += pNumRowsFT->GetAccessibleName(); - sIntervalName += OUString(")"); + sIntervalName += ")"; m_pNumIntervalNF->SetAccessibleName(sIntervalName); // char styles @@ -74,14 +74,14 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) const SwLineNumberInfo &rInf = pSh->GetLineNumberInfo(); IDocumentStylePoolAccess* pIDSPA = pSh->getIDocumentStylePoolAccess(); - String sStyleName(rInf.GetCharFmt( *pIDSPA )->GetName()); + OUString sStyleName(rInf.GetCharFmt( *pIDSPA )->GetName()); const sal_uInt16 nPos = m_pCharStyleLB->GetEntryPos(sStyleName); if (nPos != LISTBOX_ENTRY_NOTFOUND) m_pCharStyleLB->SelectEntryPos(nPos); else { - if (sStyleName.Len()) + if (!sStyleName.isEmpty()) { m_pCharStyleLB->InsertEntry(sStyleName); m_pCharStyleLB->SelectEntry(sStyleName); @@ -136,7 +136,7 @@ IMPL_LINK_NOARG(SwLineNumberingDlg, OKHdl) SwLineNumberInfo aInf(pSh->GetLineNumberInfo()); // char styles - String sCharFmtName(m_pCharStyleLB->GetSelectEntry()); + OUString sCharFmtName(m_pCharStyleLB->GetSelectEntry()); SwCharFmt *pCharFmt = pSh->FindCharFmtByName(sCharFmtName); if (!pCharFmt) diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index cbee960678f7..e017c689af51 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -151,7 +151,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, // insert levels for(sal_uInt16 i = 1; i <= MAXLEVEL; i++) m_pLevelLB->InsertEntry(OUString::number(i)); - String sEntry(OUString("1 - ")); + OUString sEntry("1 - "); sEntry += OUString::number(MAXLEVEL); m_pLevelLB->InsertEntry(sEntry); m_pLevelLB->SelectEntry(sEntry); @@ -783,7 +783,7 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, LabelFollowedByHdl_Impl) } else { - m_pListtabMF->SetText( String() ); + m_pListtabMF->SetText( OUString() ); } SetModified(); diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index dc515aa3fd7f..1e997d135b63 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -70,7 +70,7 @@ class SwNumNamesDlg : public ModalDialog public: SwNumNamesDlg(Window *pParent); void SetUserNames(const OUString *pList[]); - String GetName() const { return m_pFormEdit->GetText(); } + OUString GetName() const { return m_pFormEdit->GetText(); } sal_uInt16 GetCurEntryPos() const { return m_pFormBox->GetSelectEntryPos(); } }; @@ -277,7 +277,7 @@ IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu ) pDlg->SetUserNames(aStrArr); if(RET_OK == pDlg->Execute()) { - const String aName(pDlg->GetName()); + const OUString aName(pDlg->GetName()); pChapterNumRules->ApplyNumRules( SwNumRulesWithName( *pNumRule, aName ), pDlg->GetCurEntryPos() ); pMenu->SetItemText(pMenu->GetItemId(pDlg->GetCurEntryPos()), aName); @@ -513,8 +513,8 @@ void SwOutlineSettingsTabPage::Update() else { sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel); - String aColl(pCollNames[nTmpLevel]); - if(aColl.Len()) + OUString aColl(pCollNames[nTmpLevel]); + if(!aColl.isEmpty()) m_pCollBox->SelectEntry(aColl); else m_pCollBox->SelectEntry(aNoFmtName); @@ -591,10 +591,10 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox ) { sal_uInt8 i; - const String aCollName(pBox->GetSelectEntry()); + const OUString aCollName(pBox->GetSelectEntry()); //0xFFFF not allowed here (disable) sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel); - String sOldName( pCollNames[nTmpLevel] ); + OUString sOldName( pCollNames[nTmpLevel] ); for( i = 0; i < MAXLEVEL; ++i) pCollNames[i] = aSaveCollNames[i]; @@ -611,7 +611,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox ) } // search the oldname and put it into the current entries - if( sOldName.Len() ) + if( !sOldName.isEmpty() ) for( i = 0; i < MAXLEVEL; ++i) if( aSaveCollNames[ i ] == sOldName && i != nTmpLevel && pCollNames[ i ].isEmpty() ) @@ -693,7 +693,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pFld ) IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CharFmtHdl) { - String sEntry = m_pCharFmtLB->GetSelectEntry(); + OUString sEntry = m_pCharFmtLB->GetSelectEntry(); sal_uInt16 nMask = 1; bool bFormatNone = sEntry == ViewShell::GetShellRes()->aStrNone; SwCharFmt* pFmt = 0; @@ -999,7 +999,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) if(pActNum->IsContinusNum()) aNumVector[nLevel] = nPreNum; // #128041# - String aText(pActNum->MakeNumString( aNumVector )); + OUString aText(pActNum->MakeNumString( aNumVector )); pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); nBulletWidth = (sal_uInt16)pVDev->GetTextWidth(aText); nPreNum++; @@ -1103,7 +1103,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) if(pActNum->IsContinusNum()) aNumVector[nLevel] = nPreNum; // #128041# - String aText(pActNum->MakeNumString( aNumVector )); + OUString aText(pActNum->MakeNumString( aNumVector )); pVDev->DrawText( Point(nXStart, nYStart), aText ); nTextOffset = (sal_uInt16)pVDev->GetTextWidth(aText); nTextOffset = nTextOffset + nXStep; diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 29decf8fe399..51da82c94dab 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -236,7 +236,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet) sal_uInt16 nSelPos = m_pLineColorBox->GetEntryPos( pFtnInfo->GetLineColor() ); if( nSelPos == LISTBOX_ENTRY_NOTFOUND ) nSelPos = m_pLineColorBox->InsertEntry( pFtnInfo->GetLineColor(), - String( SW_RES( RID_SVXSTR_COLOR_USER ) ) ); + OUString( SW_RES( RID_SVXSTR_COLOR_USER ) ) ); m_pLineColorBox->SetSelectHdl( LINK( this, SwFootNotePage, LineColorSelected_Impl ) ); m_pLineColorBox->SelectEntryPos( nSelPos ); diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index f45804bc726b..05322d46c22c 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -113,7 +113,7 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : { XColorEntry* pEntry = pColorLst->GetColor( i ); Color aColor = pEntry->GetColor(); - String sName = pEntry->GetName(); + OUString sName = pEntry->GetName(); m_pColorLB->InsertEntry( aColor, sName ); } m_pColorLB->SetUpdateMode( sal_True ); diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index 557687f3eabb..21b9272d80d5 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -251,8 +251,8 @@ void SwRedlineAcceptDlg::InitAuthors() SvxTPFilter *pFilterPage = aTabPagesCTRL.GetFilterPage(); - std::vector aStrings; - String sOldAuthor(pFilterPage->GetSelectedAuthor()); + std::vector aStrings; + OUString sOldAuthor(pFilterPage->GetSelectedAuthor()); pFilterPage->ClearAuthors(); sal_uInt16 nCount = pSh->GetRedlineCount(); @@ -529,7 +529,7 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild) void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRedline& rRedln, const sal_uInt16 nAutoFmt) { - String sChild; + OUString sChild; SwRedlineDataChild *pLastRedlineChild = 0; const SwRedlineData *pRedlineData = &rRedln.GetRedlineData(); bool bAutoFmt = (rRedln.GetRealType() & nAutoFmt) != 0; @@ -691,7 +691,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) SwWrtShell* pSh = pView->GetWrtShellPtr(); sal_uInt16 nAutoFmt = HasRedlineAutoFmt() ? nsRedlineType_t::REDLINE_FORM_AUTOFMT : 0; - String sParent; + OUString sParent; sal_uInt16 nCount = pSh->GetRedlineCount(); nEnd = std::min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // also treats nEnd=USHRT_MAX (until the end) @@ -788,7 +788,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) // #111827# if (aRedlines.size() > 1) { - String aTmpStr; + OUString aTmpStr; { SwRewriter aRewriter; aRewriter.AddRule(UndoArg1, @@ -1101,7 +1101,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl) break; default:;//prevent warning } - String sTitle(SW_RES(STR_REDLINE_COMMENT)); + OUString sTitle(SW_RES(STR_REDLINE_COMMENT)); if( nResId ) sTitle += SW_RESSTR( nResId ); pDlg->SetText(sTitle); @@ -1173,18 +1173,18 @@ void SwRedlineAcceptDlg::Initialize(const OUString& rExtraData) if (n2 != -1) { // cut out the alignment string - String aStr = rExtraData.copy(nPos, n2 - nPos + 1); - aStr.Erase(0, n1 - nPos + 1); + OUString aStr = rExtraData.copy(nPos, n2 - nPos + 1); + aStr = aStr.copy(n1 - nPos + 1); - if (aStr.Len()) + if (!aStr.isEmpty()) { - sal_uInt16 nCount = static_cast< sal_uInt16 >(aStr.ToInt32()); + sal_uInt16 nCount = static_cast< sal_uInt16 >(aStr.toInt32()); for (sal_uInt16 i = 0; i < nCount; i++) { - sal_uInt16 n3 = aStr.Search(';'); - aStr.Erase(0, n3 + 1); - pTable->SetTab(i, aStr.ToInt32(), MAP_PIXEL); + sal_Int32 n3 = aStr.indexOf(';'); + aStr = aStr.copy(n3 + 1); + pTable->SetTab(i, aStr.toInt32(), MAP_PIXEL); } } } diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index aba0a8e62d3a..be6580955ffd 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -71,7 +71,7 @@ static void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox ) void* pDel; for( sal_uInt16 n = 0, nEnd = rLstBox.GetEntryCount(); n < nEnd; ++n ) if( 0 != ( pDel = rLstBox.GetEntryData( n )) ) - delete (String*)pDel; + delete (OUString*)pDel; rLstBox.Clear(); } @@ -262,9 +262,9 @@ sal_Unicode SwSortDlg::GetDelimChar() const sal_Unicode cRet = '\t'; if( !m_pDelimTabRB->IsChecked() ) { - String aTmp( m_pDelimEdt->GetText() ); - if( aTmp.Len() ) - cRet = aTmp.GetChar( 0 ); + OUString aTmp( m_pDelimEdt->GetText() ); + if( !aTmp.isEmpty() ) + cRet = aTmp[0]; } return cRet; } @@ -299,12 +299,12 @@ void SwSortDlg::Apply() SwSortOptions aOptions; if( bCheck1 ) { - String sEntry( m_pTypDLB1->GetSelectEntry() ); + OUString sEntry( m_pTypDLB1->GetSelectEntry() ); if( sEntry == aNumericTxt ) - sEntry.Erase(); + sEntry = ""; else if( 0 != (pUserData = m_pTypDLB1->GetEntryData( m_pTypDLB1->GetSelectEntryPos())) ) - sEntry = *(String*)pUserData; + sEntry = *(OUString*)pUserData; SwSortKey *pKey = new SwSortKey( nCol1, sEntry, bAsc1 ? SRT_ASCENDING : SRT_DESCENDING ); @@ -313,12 +313,12 @@ void SwSortDlg::Apply() if( bCheck2 ) { - String sEntry( m_pTypDLB2->GetSelectEntry() ); + OUString sEntry( m_pTypDLB2->GetSelectEntry() ); if( sEntry == aNumericTxt ) - sEntry.Erase(); + sEntry = ""; else if( 0 != (pUserData = m_pTypDLB2->GetEntryData( m_pTypDLB2->GetSelectEntryPos())) ) - sEntry = *(String*)pUserData; + sEntry = *(OUString*)pUserData; SwSortKey *pKey = new SwSortKey( nCol2, sEntry, bAsc2 ? SRT_ASCENDING : SRT_DESCENDING ); @@ -327,12 +327,12 @@ void SwSortDlg::Apply() if( bCheck3 ) { - String sEntry( m_pTypDLB3->GetSelectEntry() ); + OUString sEntry( m_pTypDLB3->GetSelectEntry() ); if( sEntry == aNumericTxt ) - sEntry.Erase(); + sEntry = ""; else if( 0 != (pUserData = m_pTypDLB3->GetEntryData( m_pTypDLB3->GetSelectEntryPos())) ) - sEntry = *(String*)pUserData; + sEntry = *(OUString*)pUserData; SwSortKey *pKey = new SwSortKey( nCol3, sEntry, bAsc3 ? SRT_ASCENDING : SRT_DESCENDING ); @@ -429,7 +429,7 @@ IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox ) const sal_uInt16 nLstBoxCnt = 3; ListBox* aLstArr[ nLstBoxCnt ] = { m_pTypDLB1, m_pTypDLB2, m_pTypDLB3 }; sal_uInt16* aTypeArr[ nLstBoxCnt ] = { &nType1, &nType2, &nType3 }; - String aOldStrArr[ nLstBoxCnt ]; + OUString aOldStrArr[ nLstBoxCnt ]; sal_uInt16 n; void* pUserData; @@ -437,12 +437,12 @@ IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox ) { ListBox* pL = aLstArr[ n ]; if( 0 != (pUserData = pL->GetEntryData( pL->GetSelectEntryPos())) ) - aOldStrArr[ n ] = *(String*)pUserData; + aOldStrArr[ n ] = *(OUString*)pUserData; ::lcl_ClearLstBoxAndDelUserData( *pL ); } sal_uInt16 nInsPos; - String sAlg, sUINm; + OUString sAlg, sUINm; for( long nCnt = 0, nEnd = aSeq.getLength(); nCnt <= nEnd; ++nCnt ) { if( nCnt < nEnd ) @@ -454,7 +454,7 @@ IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox ) { ListBox* pL = aLstArr[ n ]; nInsPos = pL->InsertEntry( sUINm ); - pL->SetEntryData( nInsPos, new String( sAlg )); + pL->SetEntryData( nInsPos, new OUString( sAlg )); if( pLBox && sAlg == aOldStrArr[ n ] ) pL->SelectEntryPos( nInsPos ); } diff --git a/sw/source/ui/misc/swruler.cxx b/sw/source/ui/misc/swruler.cxx index f0838f37ac2e..7806bfebc0d2 100644 --- a/sw/source/ui/misc/swruler.cxx +++ b/sw/source/ui/misc/swruler.cxx @@ -85,7 +85,7 @@ void SwCommentRuler::DrawCommentControl() maVirDev.DrawRect( Rectangle( Point(), aControlRect.GetSize() ) ); - String aLabel( SW_RESSTR ( STR_COMMENTS_LABEL ) ); + OUString aLabel( SW_RESSTR ( STR_COMMENTS_LABEL ) ); // Get label and arrow coordinates Point aLabelPos; Point aArrowPos; @@ -198,7 +198,7 @@ void SwCommentRuler::MouseMove(const MouseEvent& rMEvt) { // Mouse out of comment control // FIXME Should remember previous tooltip text? - SetQuickHelpText( String() ); + SetQuickHelpText( OUString() ); } } } -- cgit