diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-11 15:57:23 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-15 12:25:43 +0200 |
commit | 394926664ba5e415f27c78f0a779885ff2b55bfa (patch) | |
tree | c5ec56640a70a5fa572d16e40f86ff3a2c77f514 /sw | |
parent | dd7acb3d76cd89b3f05dbdafe88eb50e60fd9d10 (diff) |
convert sw/source/ui/uiview/*.cxx from String to OUString
Change-Id: Ia6f61145f7486a2a78da8bd62d8ae9f79d2f95e3
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/uiview/pview.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/uiview/srcview.cxx | 30 | ||||
-rw-r--r-- | sw/source/ui/uiview/view.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 51 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewdlg2.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewling.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewprt.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewsrch.cxx | 12 |
8 files changed, 68 insertions, 73 deletions
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index ca2c767a9e42..9d3b0f3463b7 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -488,10 +488,8 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt ) { // close page preview, set new cursor position and switch to // normal view. - String sNewCrsrPos( OUString::number( aDocPos.X() )); - ((( sNewCrsrPos += ';' ) - += OUString::number( aDocPos.Y() )) ) - += ';'; + OUString sNewCrsrPos = OUString::number( aDocPos.X() ) + ";" + + OUString::number( aDocPos.Y() ) + ";"; mrView.SetNewCrsrPos( sNewCrsrPos ); SfxViewFrame *pTmpFrm = mrView.GetViewFrame(); @@ -1425,7 +1423,7 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar ) GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow()) { // Scroll how many pages?? - String sStateStr(sPageStr); + OUString sStateStr(sPageStr); sal_uInt16 nThmbPos = (sal_uInt16)pScrollbar->GetThumbPos(); if( 1 == aViewWin.GetCol() || !nThmbPos ) ++nThmbPos; diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 18c737378780..52e87e203391 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -125,7 +125,7 @@ SFX_IMPL_INTERFACE( SwSrcView, SfxViewShell, SW_RES(0) ) TYPEINIT1(SwSrcView, SfxViewShell) -static void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt16 nCurPage, const String& rTitle ) +static void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt16 nCurPage, const OUString& rTitle ) { short nLeftMargin = LMARGPRN; Size aSz = rOutDev.GetOutputSize(); @@ -161,11 +161,11 @@ static void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt1 { aFont.SetWeight( WEIGHT_NORMAL ); rOutDev.SetFont( aFont ); - String aPageStr( OUString(" [") ); - aPageStr += String( SW_RES( STR_PAGE ) ); - aPageStr += ' '; + OUString aPageStr( " [" ); + aPageStr += SW_RES( STR_PAGE ); + aPageStr += " "; aPageStr += OUString::number( nCurPage ); - aPageStr += ']'; + aPageStr += "]"; aPos.X() += rOutDev.GetTextWidth( rTitle ); rOutDev.DrawText( aPos, aPageStr ); } @@ -307,7 +307,7 @@ void SwSrcView::Execute(SfxRequest& rReq) if ( pFilter ) { // filter found -> use its uiname and wildcard - const String& rUIName = pFilter->GetUIName(); + const OUString& rUIName = pFilter->GetUIName(); const WildCard& rCard = pFilter->GetWildcard(); xFltMgr->appendFilter( rUIName, rCard.getGlob() ); xFltMgr->setCurrentFilter( rUIName ) ; @@ -428,10 +428,10 @@ void SwSrcView::GetState(SfxItemSet& rSet) switch(nWhich) { case SID_SAVEASDOC: - rSet.Put(SfxStringItem(nWhich, String(SW_RES(STR_SAVEAS_SRC)))); + rSet.Put(SfxStringItem(nWhich, OUString(SW_RES(STR_SAVEAS_SRC)))); break; case SID_SAVEACOPY: - rSet.Put(SfxStringItem(nWhich, String(SW_RES(STR_SAVEACOPY_SRC)))); + rSet.Put(SfxStringItem(nWhich, OUString(SW_RES(STR_SAVEACOPY_SRC)))); break; case SID_SAVEDOC: { @@ -445,11 +445,11 @@ void SwSrcView::GetState(SfxItemSet& rSet) break; case SID_TABLE_CELL: { - String aPos( SW_RES(STR_SRCVIEW_ROW) ); + OUString aPos( SW_RES(STR_SRCVIEW_ROW) ); TextSelection aSel = pTextView->GetSelection(); aPos += OUString::number( aSel.GetEnd().GetPara()+1 ); - aPos += OUString(" : "); - aPos += String(SW_RES(STR_SRCVIEW_COL)); + aPos += " : "; + aPos += SW_RES(STR_SRCVIEW_COL); aPos += OUString::number( aSel.GetEnd().GetIndex()+1 ); SfxStringItem aItem( nWhich, aPos ); rSet.Put( aItem ); @@ -466,7 +466,7 @@ void SwSrcView::GetState(SfxItemSet& rSet) break; case SID_SEARCH_ITEM: { - String sSelected; + OUString sSelected; if ( !pTextView->HasSelection() ) { const TextSelection& rSel = pTextView->GetSelection(); @@ -497,7 +497,7 @@ void SwSrcView::GetState(SfxItemSet& rSet) nCount = rMgr.GetUndoActionCount(); if(nCount) { - String aStr(SvtResId( STR_UNDO)); + OUString aStr(SvtResId( STR_UNDO)); aStr += rMgr.GetUndoActionComment(--nCount); rSet.Put(SfxStringItem(nWhich, aStr)); } @@ -509,7 +509,7 @@ void SwSrcView::GetState(SfxItemSet& rSet) nCount = rMgr.GetRedoActionCount(); if(nCount) { - String aStr(SvtResId( STR_REDO)); + OUString aStr(SvtResId( STR_REDO)); aStr += rMgr.GetRedoActionComment(--nCount); rSet.Put(SfxStringItem(nWhich,aStr)); } @@ -710,7 +710,7 @@ sal_Int32 SwSrcView::PrintSource( aFont.SetColor( COL_BLACK ); pOutDev->SetFont( aFont ); - String aTitle( GetViewFrame()->GetWindow().GetText() ); + OUString aTitle( GetViewFrame()->GetWindow().GetText() ); sal_uInt16 nLineHeight = (sal_uInt16) pOutDev->GetTextHeight(); // slightly more sal_uInt16 nParaSpace = 10; diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 61d2d8d649a6..5737625dba9e 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -1123,12 +1123,12 @@ static bool lcl_IsOwnDocument( SwView& rView ) rView.GetDocShell()->GetModel(), uno::UNO_QUERY_THROW); uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties(); - String Created = xDocProps->getAuthor(); - String Changed = xDocProps->getModifiedBy(); - String FullName = SW_MOD()->GetUserOptions().GetFullName(); - return (FullName.Len() && - (Changed.Len() && Changed == FullName )) || - (!Changed.Len() && Created.Len() && Created == FullName ); + OUString Created = xDocProps->getAuthor(); + OUString Changed = xDocProps->getModifiedBy(); + OUString FullName = SW_MOD()->GetUserOptions().GetFullName(); + return (!FullName.isEmpty() && + (!Changed.isEmpty() && Changed == FullName )) || + (Changed.isEmpty() && !Created.isEmpty() && Created == FullName ); } void SwView::ReadUserData( const OUString &rUserData, bool bBrowse ) diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 37e15a9f35c5..1d2b18df436a 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -247,7 +247,7 @@ int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter, pDocSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) : OUString()); - String sURL = URIHelper::SmartRel2Abs( aTemp, rPath, URIHelper::GetMaybeFileHdl() ); + OUString sURL = URIHelper::SmartRel2Abs( aTemp, rPath, URIHelper::GetMaybeFileHdl() ); rShell.Insert( sURL, rFilter, aGraphic, &aFrameManager, bRule ); } @@ -310,7 +310,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) Sequence<OUString> aListBoxEntries(aFormats.size()); OUString* pEntries = aListBoxEntries.getArray(); sal_Int16 nSelect = 0; - String sGraphicFormat = SW_RESSTR(STR_POOLFRM_GRAPHIC); + OUString sGraphicFormat = SW_RESSTR(STR_POOLFRM_GRAPHIC); for( i = 0; i < aFormats.size(); i++ ) { pEntries[i] = aFormats[i]; @@ -338,7 +338,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) if( pName || ERRCODE_NONE == pFileDlg->Execute() ) { - String aFileName, aFilterName; + OUString aFileName, aFilterName; if ( pName ) { aFileName = pName->GetValue(); @@ -559,7 +559,7 @@ void SwView::Execute(SfxRequest &rReq) aPasswdDlg.SetMinLen( 1 ); //#i69751# the result of Execute() can be ignored aPasswdDlg.Execute(); - String sNewPasswd( aPasswdDlg.GetPassword() ); + OUString sNewPasswd( aPasswdDlg.GetPassword() ); Sequence <sal_Int8> aNewPasswd = pIDRA->GetRedlinePassword(); SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); if(SvPasswordHelper::CompareHashPassword(aPasswd, sNewPasswd)) @@ -599,7 +599,7 @@ void SwView::Execute(SfxRequest &rReq) if (aPasswdDlg.Execute()) { sal_uInt16 nOn = nsRedlineMode_t::REDLINE_ON; - String sNewPasswd( aPasswdDlg.GetPassword() ); + OUString sNewPasswd( aPasswdDlg.GetPassword() ); Sequence <sal_Int8> aNewPasswd = pIDRA->GetRedlinePassword(); SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); @@ -706,7 +706,7 @@ void SwView::Execute(SfxRequest &rReq) case SID_DOCUMENT_COMPARE: case SID_DOCUMENT_MERGE: { - String sFileName, sFilterName; + OUString sFileName, sFilterName; sal_Int16 nVersion = 0; bool bHasFileName = false; m_pViewImpl->SetParam( 0 ); @@ -715,7 +715,7 @@ void SwView::Execute(SfxRequest &rReq) { if( SFX_ITEM_SET == pArgs->GetItemState( SID_FILE_NAME, sal_False, &pItem )) sFileName = ((const SfxStringItem*)pItem)->GetValue(); - bHasFileName = ( sFileName.Len() > 0 ); + bHasFileName = !sFileName.isEmpty(); if( SFX_ITEM_SET == pArgs->GetItemState( SID_FILTER_NAME, sal_False, &pItem )) sFilterName = ((const SfxStringItem*)pItem)->GetValue(); @@ -1208,7 +1208,7 @@ void SwView::Execute(SfxRequest &rReq) /// invalidate page numbering field void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr) { - String sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr )); + OUString sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr )); const SfxStringItem aTmp( FN_STAT_PAGE, sTemp ); SfxBindings &rBnd = GetViewFrame()->GetBindings(); rBnd.SetState( aTmp ); @@ -1468,10 +1468,10 @@ void SwView::StateStatusLine(SfxItemSet &rSet) if(SFX_ITEM_AVAILABLE <= aSet.GetItemState(RES_PARATR_NUMRULE, sal_True)) { - const String& rNumStyle = + const OUString& rNumStyle = ((const SfxStringItem &) aSet.Get(RES_PARATR_NUMRULE)).GetValue(); - if(rNumStyle.Len()) + if(!rNumStyle.isEmpty()) { if(!sStr.isEmpty()) sStr += sStatusDelim; @@ -1856,24 +1856,23 @@ bool SwView::JumpToSwMark( const OUString& rMark ) const SwFmtINetFmt* pINet; OUString sCmp; - String sMark( INetURLObject::decode( rMark, INET_HEX_ESCAPE, + OUString sMark( INetURLObject::decode( rMark, INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8 )); - xub_StrLen nLastPos, nPos = sMark.Search( cMarkSeparator ); - if( STRING_NOTFOUND != nPos ) - while( STRING_NOTFOUND != ( nLastPos = - sMark.Search( cMarkSeparator, nPos + 1 )) ) + sal_Int32 nLastPos, nPos = sMark.indexOf( cMarkSeparator ); + if( -1 != nPos ) + while( -1 != ( nLastPos = sMark.indexOf( cMarkSeparator, nPos + 1 )) ) nPos = nLastPos; IDocumentMarkAccess::const_iterator_t ppMark; IDocumentMarkAccess* const pMarkAccess = m_pWrtShell->getIDocumentMarkAccess(); - if( STRING_NOTFOUND != nPos ) - sCmp = comphelper::string::remove(sMark.Copy(nPos + 1), ' '); + if( -1 != nPos ) + sCmp = comphelper::string::remove(sMark.copy(nPos + 1), ' '); if( !sCmp.isEmpty() ) { - rtl::OUString sName( sMark.Copy( 0, nPos ) ); + rtl::OUString sName( sMark.copy( 0, nPos ) ); sCmp = sCmp.toAsciiLowerCase(); FlyCntType eFlyType = FLYCNTTYPE_ALL; @@ -2001,17 +2000,17 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) if ( !pItem ) { - String sEmpty; + OUString sEmpty; InsertDoc( nSlot, sEmpty, sEmpty ); } else { - String sFile, sFilter; + OUString sFile, sFilter; sFile = ( (const SfxStringItem *)pItem )->GetValue(); if ( SFX_ITEM_SET == rRequest.GetArgs()->GetItemState( FN_PARAM_1, sal_True, &pItem ) ) sFilter = ( (const SfxStringItem *)pItem )->GetValue(); - bool bHasFileName = ( sFile.Len() > 0 ); + bool bHasFileName = !sFile.isEmpty(); long nFound = InsertDoc( nSlot, sFile, sFilter ); if ( bHasFileName ) @@ -2165,7 +2164,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe SfxObjectShellRef xDocSh; SfxObjectShellLock xLockRef; - String sFltNm; + OUString sFltNm; const int nRet = SwFindDocShell( xDocSh, xLockRef, pMedium->GetName(), OUString(), sFltNm, nVersion, pDocSh ); if( nRet ) @@ -2308,10 +2307,10 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) rSh.GetAllUsedDB( aDBNameList, &aAllDBNames ); if(!aDBNameList.empty()) { - String sDBName(aDBNameList[0]); - aData.sDataSource = sDBName.GetToken(0, DB_DELIM); - aData.sCommand = sDBName.GetToken(1, DB_DELIM); - aData.nCommandType = sDBName.GetToken(2, DB_DELIM ).ToInt32(); + OUString sDBName(aDBNameList[0]); + aData.sDataSource = sDBName.getToken(0, DB_DELIM); + aData.sCommand = sDBName.getToken(1, DB_DELIM); + aData.nCommandType = sDBName.getToken(2, DB_DELIM ).toInt32(); } rSh.EnterStdMode(); // force change in text shell; necessary for mixing DB fields AttrChangedNotify( &rSh ); diff --git a/sw/source/ui/uiview/viewdlg2.cxx b/sw/source/ui/uiview/viewdlg2.cxx index bb67dd443a7d..7d4e80933f5c 100644 --- a/sw/source/ui/uiview/viewdlg2.cxx +++ b/sw/source/ui/uiview/viewdlg2.cxx @@ -99,11 +99,11 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt) if (!pOpt) return; - const String &rName = pOpt->GetCategory(); + const OUString &rName = pOpt->GetCategory(); // Is there a pool template with the same name? SwWrtShell &rSh = GetWrtShell(); - if(rName.Len()) + if(!rName.isEmpty()) { sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); if( USHRT_MAX != nPoolId ) @@ -130,7 +130,7 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt) SwFldMgr aMgr(&rSh); SwSetExpFieldType* pFldType = (SwSetExpFieldType*)aMgr.GetFldType(RES_SETEXPFLD, rName); - if (!pFldType && rName.Len() ) + if (!pFldType && !rName.isEmpty() ) { // Create new field types SwSetExpFieldType aSwSetExpFieldType(rSh.GetDoc(), rName, nsSwGetSetExpType::GSE_SEQ); @@ -150,12 +150,12 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt) sal_uInt16 nID = USHRT_MAX; SwFieldType* pType = 0; const sal_uInt16 nCount = aMgr.GetFldTypeCount(); - if( rName.Len() ) + if( !rName.isEmpty() ) { for (sal_uInt16 i = 0; i < nCount; ++i) { pType = aMgr.GetFldType(USHRT_MAX, i); - String aTmpName( pType->GetName() ); + OUString aTmpName( pType->GetName() ); if (aTmpName == rName && pType->Which() == RES_SETEXPFLD) { nID = i; diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index 4d5f95546466..e3108cdf6826 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -342,7 +342,7 @@ void SwView::SpellError(LanguageType eLang) } while( m_pWrtShell->ActionPend() ); } - String aErr(SvtLanguageTable::GetLanguageString( eLang ) ); + OUString aErr(SvtLanguageTable::GetLanguageString( eLang ) ); SwEditWin &rEditWin = GetEditWin(); #if OSL_DEBUG_LEVEL > 1 @@ -418,8 +418,8 @@ void SwView::HyphenateDocument() // do not hyphenate if interactive hyphenation is active elsewhere if (GetWrtShell().HasHyphIter()) { - MessBox( 0, WB_OK, String( SW_RES( STR_HYPH_TITLE ) ), - String( SW_RES( STR_MULT_INTERACT_HYPH_WARN ) ) ).Execute(); + MessBox( 0, WB_OK, OUString( SW_RES( STR_HYPH_TITLE ) ), + OUString( SW_RES( STR_MULT_INTERACT_HYPH_WARN ) ) ).Execute(); return; } @@ -566,7 +566,7 @@ void SwView::StartThesaurus() // get initial LookUp text const sal_Bool bSelection = ((SwCrsrShell*)m_pWrtShell)->HasSelection(); - String aTmp = GetThesaurusLookUpText( bSelection ); + OUString aTmp = GetThesaurusLookUpText( bSelection ); Reference< XThesaurus > xThes( ::GetThesaurus() ); AbstractThesaurusDialog *pDlg = NULL; @@ -671,7 +671,7 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt) (bUseGrammarContext && bCorrectionRes && aGrammarCheckRes.aErrors.getLength() > 0)) { // get paragraph text - String aParaText; + OUString aParaText; SwPosition aPoint( *m_pWrtShell->GetCrsr()->GetPoint() ); const SwTxtNode *pNode = dynamic_cast< const SwTxtNode * >( &aPoint.nNode.GetNode() ); diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index a1712a7bca3d..09d8d04fde2c 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -163,8 +163,8 @@ void SwView::ExecutePrint(SfxRequest& rReq) case FN_FAX: { SwPrintOptions* pPrintOptions = SW_MOD()->GetPrtOptions(bWeb); - String sFaxName(pPrintOptions->GetFaxName()); - if (sFaxName.Len()) + OUString sFaxName(pPrintOptions->GetFaxName()); + if (!sFaxName.isEmpty()) { SfxStringItem aPrinterName(SID_PRINTER_NAME, sFaxName); SfxBoolItem aSilent( SID_SILENT, sal_True ); @@ -175,9 +175,9 @@ void SwView::ExecutePrint(SfxRequest& rReq) else { InfoBox aInfoBox(&GetEditWin(), SW_RES(MSG_ERR_NO_FAX)); - String sMsg = aInfoBox.GetMessText(); + OUString sMsg = aInfoBox.GetMessText(); sal_uInt16 nResNo = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS; - sMsg.SearchAndReplace(OUString("%1"), String(SW_RES(nResNo))); + sMsg = sMsg.replaceFirst("%1", OUString(SW_RES(nResNo))); aInfoBox.SetMessText(sMsg); aInfoBox.Execute(); SfxUInt16Item aDefPage(SID_SW_EDITOPTIONS, TP_OPTPRINT_PAGE); diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index 0c7e4f5f15b5..f2ad595f9218 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -245,7 +245,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) sal_Bool bBack = m_pSrchItem->GetBackward(); if (bBack) m_pWrtShell->Push(); - String aReplace( m_pSrchItem->GetReplaceString() ); + OUString aReplace( m_pSrchItem->GetReplaceString() ); SearchOptions aTmp( m_pSrchItem->GetSearchOptions() ); String *pBackRef = ReplaceBackReferences( aTmp, m_pWrtShell->GetCrsr() ); if( pBackRef ) @@ -326,10 +326,8 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) if( !bApi && ULONG_MAX != nFound) { - String aText( SW_RES( STR_NB_REPLACED ) ); - const xub_StrLen nPos = aText.Search( OUString("XX") ); - aText.Erase( nPos, 2 ); - aText.Insert( OUString::number( nFound ), nPos ); + OUString aText( SW_RES( STR_NB_REPLACED ) ); + aText = aText.replaceFirst("XX", OUString::number( nFound )); Window* pParentWindow = GetParentWindow( m_pSrchDlg ); InfoBox( pParentWindow, aText ).Execute(); } @@ -814,9 +812,9 @@ void SwView::StateSearch(SfxItemSet &rSet) if( m_bJustOpened && m_pWrtShell->IsSelection() ) { - String aTxt; + OUString aTxt; if( 1 == m_pWrtShell->GetCrsrCnt() && - ( aTxt = m_pWrtShell->SwCrsrShell::GetSelTxt() ).Len() ) + !( aTxt = m_pWrtShell->SwCrsrShell::GetSelTxt() ).isEmpty() ) { m_pSrchItem->SetSearchString( aTxt ); m_pSrchItem->SetSelection( sal_False ); |