diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-11 15:14:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-15 12:25:43 +0200 |
commit | 784634377e42d8c5d207e8a510bb7ee64a66ef9e (patch) | |
tree | 5d9d26c4c6718adee47fbc005da790bc611148cd | |
parent | 511595e3bc2e557ab7a8c57db8f4b4943665edfd (diff) |
convert sw/source/ui/utlui/*.cxx from String to OUString
Change-Id: I081439331c63178f8d56c2b56db50b1b1d1e23ba
-rw-r--r-- | sw/source/ui/utlui/bookctrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/utlui/condedit.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/utlui/content.cxx | 80 | ||||
-rw-r--r-- | sw/source/ui/utlui/glbltree.cxx | 28 | ||||
-rw-r--r-- | sw/source/ui/utlui/gloslst.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/utlui/initui.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/utlui/navipi.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/utlui/numfmtlb.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/utlui/swrenamexnameddlg.cxx | 29 | ||||
-rw-r--r-- | sw/source/ui/utlui/tmplctrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/utlui/uitool.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/utlui/unotools.cxx | 22 | ||||
-rw-r--r-- | sw/source/ui/utlui/viewlayoutctrl.cxx | 2 |
13 files changed, 118 insertions, 119 deletions
diff --git a/sw/source/ui/utlui/bookctrl.cxx b/sw/source/ui/utlui/bookctrl.cxx index 22255069a97f..371f76215362 100644 --- a/sw/source/ui/utlui/bookctrl.cxx +++ b/sw/source/ui/utlui/bookctrl.cxx @@ -73,7 +73,7 @@ void SwBookmarkControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if( eState != SFX_ITEM_AVAILABLE || pState->ISA( SfxVoidItem ) ) - GetStatusBar().SetItemText( GetId(), String() ); + GetStatusBar().SetItemText( GetId(), OUString() ); else if ( pState->ISA( SfxStringItem ) ) { sPageNumber = ((SfxStringItem*)pState)->GetValue(); diff --git a/sw/source/ui/utlui/condedit.cxx b/sw/source/ui/utlui/condedit.cxx index e8f2b875fce8..0f4ae0ba6dc5 100644 --- a/sw/source/ui/utlui/condedit.cxx +++ b/sw/source/ui/utlui/condedit.cxx @@ -64,22 +64,22 @@ sal_Int8 ConditionEdit::ExecuteDrop( const ExecuteDropEvent& rEvt ) { ODataAccessDescriptor aColDesc = OColumnTransferable::extractColumnDescriptor( aData); - String sDBName; + OUString sDBName; if (bBrackets) - sDBName += '['; + sDBName += "["; OUString sTmp; sTmp = aColDesc.getDataSource(); - sDBName += String(sTmp); - sDBName += '.'; + sDBName += sTmp; + sDBName += "."; aColDesc[daCommand] >>= sTmp; - sDBName += String(sTmp); - sDBName += '.'; + sDBName += sTmp; + sDBName += "."; aColDesc[daColumnName] >>= sTmp; - sDBName += String(sTmp); + sDBName += sTmp; if (bBrackets) - sDBName += ']'; + sDBName += "]"; SetText( sDBName ); nRet = DND_ACTION_COPY; diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index 9782db319eaf..fed67deea916 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -289,7 +289,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION && TOX_HEADER_SECTION != eTmpType ) { - const String& rSectionName = + const OUString& rSectionName = pFmt->GetSection()->GetSectionName(); sal_uInt8 nLevel = 0; SwSectionFmt* pParentFmt = pFmt->GetParent(); @@ -592,7 +592,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged) { if(lcl_IsUiVisibleBookmark(*ppBookmark)) { - const String& rBkmName = ppBookmark->get()->GetName(); + const OUString& rBkmName = ppBookmark->get()->GetName(); //nYPos from 0 -> text::Bookmarks will be sorted alphabetically SwContent* pCnt = new SwContent(this, rBkmName, 0); pMember->insert(pCnt); @@ -612,7 +612,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged) (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION && TOX_HEADER_SECTION != eTmpType ) { - String sSectionName = pFmt->GetSection()->GetSectionName(); + OUString sSectionName = pFmt->GetSection()->GetSectionName(); sal_uInt8 nLevel = 0; SwSectionFmt* pParentFmt = pFmt->GetParent(); @@ -681,7 +681,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged) for ( sal_uInt16 nTox = 0; nTox < nCount; nTox++ ) { const SwTOXBase* pBase = pWrtShell->GetTOX( nTox ); - String sTOXNm( pBase->GetTOXName() ); + OUString sTOXNm( pBase->GetTOXName() ); SwContent* pCnt = new SwTOXBaseContent( this, sTOXNm, nTox, *pBase); @@ -973,12 +973,12 @@ PopupMenu* SwContentTree::CreateContextMenu( void ) SwView *pView = SwModule::GetFirstView(); while (pView) { - String sInsert = pView->GetDocShell()->GetTitle(); + OUString sInsert = pView->GetDocShell()->GetTitle(); if(pView == pActiveView) { - sInsert += '('; + sInsert += "("; sInsert += aContextStrings[ ST_ACTIVE - ST_CONTEXT_FIRST]; - sInsert += ')'; + sInsert += ")"; } pSubPop3->InsertItem(nId, sInsert); if(bIsConstant && pActiveShell == &pView->GetWrtShell()) @@ -989,10 +989,10 @@ PopupMenu* SwContentTree::CreateContextMenu( void ) pSubPop3->InsertItem(nId++, aContextStrings[ST_ACTIVE_VIEW - ST_CONTEXT_FIRST]); if(pHiddenShell) { - String sHiddenEntry = pHiddenShell->GetView().GetDocShell()->GetTitle(); - sHiddenEntry += OUString(" ( "); + OUString sHiddenEntry = pHiddenShell->GetView().GetDocShell()->GetTitle(); + sHiddenEntry += " ( "; sHiddenEntry += aContextStrings[ ST_HIDDEN - ST_CONTEXT_FIRST]; - sHiddenEntry += OUString(" )"); + sHiddenEntry += " )"; pSubPop3->InsertItem(nId, sHiddenEntry); } @@ -1154,8 +1154,8 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) if(pCnt) { sal_uInt16 nLevel = ((SwOutlineContent*)pCnt)->GetOutlineLevel(); - String sEntry = pCnt->GetName(); - if(!sEntry.Len()) + OUString sEntry = pCnt->GetName(); + if(sEntry.isEmpty()) sEntry = sSpace; if(!pChild || (nLevel == 0)) pChild = InsertEntry(sEntry, pParent, @@ -1191,8 +1191,8 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) const SwContent* pCnt = pCntType->GetMember(i); if(pCnt) { - String sEntry = pCnt->GetName(); - if(!sEntry.Len()) + OUString sEntry = pCnt->GetName(); + if(sEntry.isEmpty()) sEntry = sSpace; InsertEntry(sEntry, pParent, sal_False, LIST_APPEND, (void*)pCnt); @@ -1337,7 +1337,7 @@ void SwContentTree::Display( bool bActive ) // First read the selected entry to select it later again if necessary // -> the user data here are no longer valid! SvTreeListEntry* pOldSelEntry = FirstSelected(); - String sEntryName; // Name of the entry + OUString sEntryName; // Name of the entry sal_uInt16 nEntryRelPos = 0; // relative position to their parent sal_uInt32 nOldEntryCount = GetEntryCount(); sal_Int32 nOldScrollPos = 0; @@ -1390,7 +1390,7 @@ void SwContentTree::Display( bool bActive ) if(!*ppContentT) (*ppContentT) = new SwContentType(pShell, nCntType, nOutlineLevel ); - String sEntry = (*ppContentT)->GetName(); + OUString sEntry = (*ppContentT)->GetName(); SvTreeListEntry* pEntry; const Image& rImage = aEntryImages.GetImage(SID_SW_START + nCntType); sal_Bool bChOnDemand = 0 != (*ppContentT)->GetMemberCount(); @@ -1455,8 +1455,8 @@ void SwContentTree::Display( bool bActive ) const SwContent* pCnt = (*ppRootContentT)->GetMember(i); if(pCnt) { - String sEntry = pCnt->GetName(); - if(!sEntry.Len()) + OUString sEntry = pCnt->GetName(); + if(sEntry.isEmpty()) sEntry = sSpace; InsertEntry( sEntry, pParent, sal_False, LIST_APPEND, (void*)pCnt); @@ -1539,13 +1539,13 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, SvTreeListEntry* pEntry = GetCurEntry(); if(!pEntry || lcl_IsContentType(pEntry) || !pWrtShell) return false; - String sEntry; + OUString sEntry; SwContent* pCnt = ((SwContent*)pEntry->GetUserData()); sal_uInt16 nActType = pCnt->GetParent()->GetType(); - String sUrl; + OUString sUrl; bool bOutline = false; - String sOutlineText; + OUString sOutlineText; switch( nActType ) { case CONTENT_TYPE_OUTLINE: @@ -1572,7 +1572,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, nVal ++; nVal = nVal - pOutlRule->Get(nLevel).GetStart(); sEntry += OUString::number( nVal ); - sEntry += '.'; + sEntry += "."; } } sEntry += pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineText(nPos, false); @@ -1601,10 +1601,10 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, } bool bRet = false; - if(sEntry.Len()) + if(!sEntry.isEmpty()) { const SwDocShell* pDocShell = pWrtShell->GetView().GetDocShell(); - if(!sUrl.Len()) + if(sUrl.isEmpty()) { if(pDocShell->HasName()) { @@ -1634,12 +1634,12 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, rDragMode = DND_ACTION_MOVE; } - const String& rToken = pCnt->GetParent()->GetTypeToken(); - sUrl += '#'; + const OUString& rToken = pCnt->GetParent()->GetTypeToken(); + sUrl += "#"; sUrl += sEntry; - if(rToken.Len()) + if(!rToken.isEmpty()) { - sUrl += cMarkSeparator; + sUrl += OUString(cMarkSeparator); sUrl += rToken; } } @@ -1774,7 +1774,7 @@ bool SwContentTree::HasContentChanged() pEntry = Next(pEntry); const SwContent* pCnt = pArrType->GetMember(j); pEntry->SetUserData((void*)pCnt); - String sEntryText = GetEntryText(pEntry); + OUString sEntryText = GetEntryText(pEntry); if( sEntryText != pCnt->GetName() && !(sEntryText == sSpace && pCnt->GetName().isEmpty())) bRepaint = true; @@ -1843,7 +1843,7 @@ bool SwContentTree::HasContentChanged() bNext = false; const SwContent* pCnt = pArrType->GetMember(j); pEntry->SetUserData((void*)pCnt); - String sEntryText = GetEntryText(pEntry); + OUString sEntryText = GetEntryText(pEntry); if( sEntryText != pCnt->GetName() && !(sEntryText == sSpace && pCnt->GetName().isEmpty())) bRepaint = true; @@ -1874,7 +1874,7 @@ bool SwContentTree::HasContentChanged() { const SwContent* pCnt = pArrType->GetMember(j); pChild->SetUserData((void*)pCnt); - String sEntryText = GetEntryText(pChild); + OUString sEntryText = GetEntryText(pChild); if( sEntryText != pCnt->GetName() && !(sEntryText == sSpace && pCnt->GetName().isEmpty())) bRemoveChildren = sal_True; @@ -2423,7 +2423,7 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) nType = ((SwContent*)pUserData)->GetParent()->GetType(); bContent = true; } - String sEntry; + OUString sEntry; bool bRet = false; if(bContent) { @@ -2464,8 +2464,8 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) } if(((SwContent*)pUserData)->IsInvisible()) { - if(sEntry.Len()) - sEntry += OUString(", "); + if(!sEntry.isEmpty()) + sEntry += ", "; sEntry += sInvisible; bRet = true; } @@ -2474,7 +2474,7 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) { sal_uInt16 nMemberCount = ((SwContentType*)pUserData)->GetMemberCount(); sEntry = OUString::number(nMemberCount); - sEntry += ' '; + sEntry += " "; sEntry += nMemberCount == 1 ? ((SwContentType*)pUserData)->GetSingleName() : ((SwContentType*)pUserData)->GetName(); @@ -2709,7 +2709,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) else if(nMode == EDIT_MODE_DELETE) { pActiveShell->StartAction(); - String sTable = SW_RES(STR_TABLE_NAME); + OUString sTable = SW_RES(STR_TABLE_NAME); SwRewriter aRewriterTableName; aRewriterTableName.AddRule(UndoArg1, SW_RES(STR_START_QUOTE)); aRewriterTableName.AddRule(UndoArg2, pCnt->GetName()); @@ -2897,14 +2897,14 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) if(xSecond.is()) pDlg->SetAlternativeAccess( xSecond, xThird); - String sForbiddenChars; + OUString sForbiddenChars; if(CONTENT_TYPE_BOOKMARK == nType) { - sForbiddenChars = OUString("/\\@:*?\";,.#"); + sForbiddenChars = "/\\@:*?\";,.#"; } else if(CONTENT_TYPE_TABLE == nType) { - sForbiddenChars = OUString(" .<>"); + sForbiddenChars = " .<>"; } pDlg->SetForbiddenChars(sForbiddenChars); pDlg->Execute(); @@ -3069,7 +3069,7 @@ class SwContentLBoxString : public SvLBoxString { public: SwContentLBoxString( 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& rDev, const SvViewDataEntry* pView, diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index 557e09a58e4f..9434d2a2a69f 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -467,9 +467,9 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) if (pItem && SV_ITEM_ID_LBOXSTRING == pItem->GetType()) { const SwSection* pSect = pCont->GetSection(); - String sEntry = pSect->GetLinkFileName().getToken(0, sfx2::cTokenSeparator); + OUString sEntry = pSect->GetLinkFileName().getToken(0, sfx2::cTokenSeparator); if(!pSect->IsConnectFlag()) - sEntry.Insert(aContextStrings[ST_BROKEN_LINK - ST_GLOBAL_CONTEXT_FIRST], 0 ); + sEntry = aContextStrings[ST_BROKEN_LINK - ST_GLOBAL_CONTEXT_FIRST] + sEntry; Point aEntryPos = GetEntryPosition( pEntry ); aEntryPos.X() = GetTabPos( pEntry, pTab ); @@ -641,7 +641,7 @@ void SwGlobalTree::Display(bool bOnlyUpdateUserData) { SetUpdateMode( sal_False ); SvTreeListEntry* pOldSelEntry = FirstSelected(); - String sEntryName; // Name of the entry + OUString sEntryName; // Name of the entry sal_uInt16 nSelPos = USHRT_MAX; if(pOldSelEntry) { @@ -656,7 +656,7 @@ void SwGlobalTree::Display(bool bOnlyUpdateUserData) for( sal_uInt16 i = 0; i < nCount; i++) { SwGlblDocContent* pCont = (*pSwGlblDocContents)[i]; - String sEntry; + OUString sEntry; Image aImage; switch( pCont->GetType() ) { @@ -1117,7 +1117,7 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard) SwGlblDocContent* pRight = (*pSwGlblDocContents)[i]; GlobalDocContentType eType = pLeft->GetType(); SvTreeListEntry* pEntry = GetEntry(i); - String sTemp = GetEntryText(pEntry); + OUString sTemp = GetEntryText(pEntry); if ( eType != pRight->GetType() || ( @@ -1263,7 +1263,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen _pContent = (SwGlblDocContent*)pLast->GetUserData(); bMove = true; } - String sFilePassword; + OUString sFilePassword; sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); const OUString* pFileNames = _rFiles.getConstArray(); SwWrtShell& rSh = GetParentWindow()->GetCreateView()->GetWrtShell(); @@ -1294,14 +1294,14 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen pAnchorContent = aTempContents[nAnchorContent + nFile]; else pAnchorContent = aTempContents.back(); - String sFileName(pFileNames[nFile]); + OUString sFileName(pFileNames[nFile]); INetURLObject aFileUrl; aFileUrl.SetSmartURL( sFileName ); - String sSectionName(String(aFileUrl.GetLastName( + OUString sSectionName(String(aFileUrl.GetLastName( INetURLObject::DECODE_UNAMBIGUOUS)).GetToken(0, sfx2::cTokenSeparator)); sal_uInt16 nSectCount = rSh.GetSectionFmtCount(); - String sTempSectionName(sSectionName); + OUString sTempSectionName(sSectionName); sal_uInt16 nAddNumber = 0; sal_uInt16 nCount = 0; // if applicable: add index if the range name is already in use. @@ -1313,9 +1313,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen { nCount = 0; nAddNumber++; - sTempSectionName = sSectionName; - sTempSectionName += ':'; - sTempSectionName += OUString::number( nAddNumber ); + sTempSectionName = sSectionName + ":" + OUString::number( nAddNumber ); } else nCount++; @@ -1360,10 +1358,10 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) for ( size_t i = 0, n = pMedList->size(); i < n; ++i ) { SfxMedium* pMed = pMedList->at( i ); - String sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - sFileName += sfx2::cTokenSeparator; + OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + sFileName += OUString(sfx2::cTokenSeparator); sFileName += pMed->GetFilter()->GetFilterName(); - sFileName += sfx2::cTokenSeparator; + sFileName += OUString(sfx2::cTokenSeparator); pFileNames[nPos++] = sFileName; } delete pMedList; diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx index 24d4691903a6..fec8d5404a40 100644 --- a/sw/source/ui/utlui/gloslst.cxx +++ b/sw/source/ui/utlui/gloslst.cxx @@ -45,9 +45,9 @@ struct TripleString { - String sGroup; - String sBlock; - String sShort; + OUString sGroup; + OUString sBlock; + OUString sShort; }; class SwGlossDecideDlg : public ModalDialog @@ -151,7 +151,7 @@ sal_Bool SwGlossaryList::GetShortName(const OUString& rLongName, ListBox& rLB = aDlg.GetListBox(); for(std::vector<TripleString>::const_iterator i = aTripleStrings.begin(); i != aTripleStrings.end(); ++i) - rLB.InsertEntry(i->sGroup.GetToken(0, GLOS_DELIM)); + rLB.InsertEntry(i->sGroup.getToken(0, GLOS_DELIM)); rLB.SelectEntryPos(0); if(RET_OK == aDlg.Execute() && diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index 6cc63692f00e..ea045f2f14c2 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -289,20 +289,20 @@ ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( std::vector<OUString>& rLst { for( sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n ) { - String p(ResId(n + 1, *pSwResMgr)); + OUString p(ResId(n + 1, *pSwResMgr)); if(STR_AUTOFMTREDL_TYPO == n) { #ifdef WNT // For Windows, a special treatment is necessary because MS has // forgotten some characters in the dialog font here. - p.SearchAndReplace(OUString("%1"), OUString(",,")); - p.SearchAndReplace(OUString("%2"), OUString("''")); + p = p.replaceFirst("%1", ",,"); + p = p.replaceFirst("%2", "''"); #else const SvtSysLocale aSysLocale; const LocaleDataWrapper& rLclD = aSysLocale.GetLocaleData(); // With real operating systems it also works without special handling. - p.SearchAndReplace(OUString("%1"), rLclD.getDoubleQuotationMarkStart()); - p.SearchAndReplace(OUString("%2"), rLclD.getDoubleQuotationMarkEnd()); + p = p.replaceFirst("%1", rLclD.getDoubleQuotationMarkStart()); + p = p.replaceFirst("%2", rLclD.getDoubleQuotationMarkEnd()); #endif } rLst.insert(rLst.begin() + n, p); diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 90743058ea3b..cad7a92aeab1 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -1069,8 +1069,8 @@ void SwNavigationPI::UpdateListBox() // #i53333# don't show help pages here if ( !pDoc->IsHelpDocument() ) { - String sEntry = pDoc->GetTitle(); - sEntry += OUString(" ("); + OUString sEntry = pDoc->GetTitle(); + sEntry += " ("; if (pView == pActView) { nAct = nCount; @@ -1078,7 +1078,7 @@ void SwNavigationPI::UpdateListBox() } else sEntry += aStatusArr[ST_INACTIVE - ST_STATUS_FIRST]; - sEntry += ')'; + sEntry += ")"; aDocListBox.InsertEntry(sEntry); @@ -1094,11 +1094,11 @@ void SwNavigationPI::UpdateListBox() if(aContentTree.GetHiddenWrtShell()) { - String sEntry = aContentTree.GetHiddenWrtShell()->GetView(). + OUString sEntry = aContentTree.GetHiddenWrtShell()->GetView(). GetDocShell()->GetTitle(); - sEntry += OUString(" ("); + sEntry += " ("; sEntry += aStatusArr[ST_HIDDEN - ST_STATUS_FIRST]; - sEntry += ')'; + sEntry += ")"; aDocListBox.InsertEntry(sEntry); bDisable = false; } @@ -1192,15 +1192,15 @@ sal_Int8 SwNavigationPI::ExecuteDrop( const ExecuteDropEvent& rEvt ) { TransferableDataHelper aData( rEvt.maDropEvent.Transferable ); sal_Int8 nRet = DND_ACTION_NONE; - String sFileName; + OUString sFileName; if( !aContentTree.IsInDrag() && - 0 != (sFileName = SwNavigationPI::CreateDropFileName( aData )).Len() ) + !(sFileName = SwNavigationPI::CreateDropFileName( aData )).isEmpty() ) { INetURLObject aTemp( sFileName ); GraphicDescriptor aDesc( aTemp ); if( !aDesc.Detect() ) // accept no graphics { - if( STRING_NOTFOUND == sFileName.Search('#') + if( -1 == sFileName.indexOf('#') && (sContentFileName.isEmpty() || sContentFileName != sFileName )) { nRet = rEvt.mnAction; diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index d01580607966..bab9f955e8d2 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -343,7 +343,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) ) ) { - sValue += String(SW_RES(RID_STR_SYSTEM)); + sValue += SW_RES(RID_STR_SYSTEM); } nPos = InsertEntry(sValue, nPos); // Insert as first numeric entry @@ -362,7 +362,7 @@ sal_uLong NumFormatListBox::GetFormat() const IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) { sal_uInt16 nPos = pBox->GetSelectEntryPos(); - String sDefine(SW_RES( STR_DEFINE_NUMBERFORMAT )); + OUString sDefine(SW_RES( STR_DEFINE_NUMBERFORMAT )); SwView *pView = GetView(); if( pView && nPos == pBox->GetEntryCount() - 1 && diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx index 8a99e375b7c8..1fad9cdbf6f9 100644 --- a/sw/source/ui/utlui/swrenamexnameddlg.cxx +++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx @@ -64,10 +64,10 @@ SwRenameXNamedDlg::SwRenameXNamedDlg( Window* pWin, get(m_pNewNameED, "entry"); get(m_pOk, "ok"); - String sTmp(GetText()); + OUString sTmp(GetText()); m_pNewNameED->SetText(xNamed->getName()); m_pNewNameED->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX)); - sTmp += String(xNamed->getName()); + sTmp += xNamed->getName(); SetText(sTmp); m_pOk->SetClickHdl(LINK(this, SwRenameXNamedDlg, OkHdl)); @@ -91,30 +91,31 @@ IMPL_LINK_NOARG(SwRenameXNamedDlg, OkHdl) IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, NoSpaceEdit*, pEdit) { - String sTmp(pEdit->GetText()); + OUString sTmp(pEdit->GetText()); // prevent from pasting illegal characters - sal_uInt16 nLen = sTmp.Len(); - String sMsg; + sal_uInt16 nLen = sTmp.getLength(); + OUString sMsg; for(sal_uInt16 i = 0; i < pEdit->GetForbiddenChars().getLength(); i++) { - sal_uInt16 nTmpLen = sTmp.Len(); + sal_uInt16 nTmpLen = sTmp.getLength(); sTmp = comphelper::string::remove(sTmp, pEdit->GetForbiddenChars()[i]); - if(sTmp.Len() != nTmpLen) - sMsg += pEdit->GetForbiddenChars()[i]; + if(sTmp.getLength() != nTmpLen) + sMsg += OUString(pEdit->GetForbiddenChars()[i]); } - if(sTmp.Len() != nLen) + if(sTmp.getLength() != nLen) { pEdit->SetText(sTmp); - String sWarning(m_sRemoveWarning); + OUString sWarning(m_sRemoveWarning); sWarning += sMsg; InfoBox(this, sWarning).Execute(); } - m_pOk->Enable(sTmp.Len() && !xNameAccess->hasByName(sTmp) - && (!xSecondAccess.is() || !xSecondAccess->hasByName(sTmp)) - && (!xThirdAccess.is() || !xThirdAccess->hasByName(sTmp)) - ); + m_pOk->Enable(!sTmp.isEmpty() + && !xNameAccess->hasByName(sTmp) + && (!xSecondAccess.is() || !xSecondAccess->hasByName(sTmp)) + && (!xThirdAccess.is() || !xThirdAccess->hasByName(sTmp)) + ); return 0; } diff --git a/sw/source/ui/utlui/tmplctrl.cxx b/sw/source/ui/utlui/tmplctrl.cxx index 170b0628c570..6e39e0f688b2 100644 --- a/sw/source/ui/utlui/tmplctrl.cxx +++ b/sw/source/ui/utlui/tmplctrl.cxx @@ -74,7 +74,7 @@ void SwTemplateControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if( eState != SFX_ITEM_AVAILABLE || pState->ISA( SfxVoidItem ) ) - GetStatusBar().SetItemText( GetId(), String() ); + GetStatusBar().SetItemText( GetId(), OUString() ); else if ( pState->ISA( SfxStringItem ) ) { sTemplate = ((SfxStringItem*)pState)->GetValue(); diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index 13e344a59248..110cd439b316 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -376,7 +376,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) else if(SFX_ITEM_SET == rSet.GetItemState( SID_SWREGISTER_COLLECTION, sal_False, &pItem)) { - const String& rColl = ((const SfxStringItem*)pItem)->GetValue(); + const OUString& rColl = ((const SfxStringItem*)pItem)->GetValue(); SwDoc& rDoc = *rMaster.GetDoc(); SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( rColl ); if( !pColl ) @@ -584,8 +584,8 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) } if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_PARA_MODEL, sal_False, &pItem )) { - const String& rDescName = ((SvxPageModelItem*)pItem)->GetValue(); - if( rDescName.Len() ) // No name -> disable PageDesc! + const OUString& rDescName = ((SvxPageModelItem*)pItem)->GetValue(); + if( !rDescName.isEmpty() ) // No name -> disable PageDesc! { // Delete only, if PageDesc will be enabled! rSet.ClearItem( RES_BREAK ); @@ -618,7 +618,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) void SwToSfxPageDescAttr( SfxItemSet& rCoreSet ) { const SfxPoolItem* pItem = 0; - String aName; + OUString aName; sal_uInt16 nPageNum = 0; bool bPut = true; switch( rCoreSet.GetItemState( RES_PAGEDESC, sal_True, &pItem ) ) @@ -704,7 +704,7 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, bool bSorted, bo const SwCharFmt* pFmt = (*pFmts)[i]; if(pFmt->IsDefault()) continue; - const String& rName = pFmt->GetName(); + const OUString& rName = pFmt->GetName(); if(rToFill.GetEntryPos(rName) == LISTBOX_ENTRY_NOTFOUND) { sal_uInt16 nPos; @@ -783,18 +783,18 @@ bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 { bool bRet = false; sal_uInt16 nItemCount = rMenu.GetItemCount(); - String sCommand; + OUString sCommand; for( sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem) { PopupMenu* pPopup = rMenu.GetPopupMenu( rMenu.GetItemId( nItem ) ); if(pPopup) { sCommand = pPopup->GetItemCommand(nId); - if(sCommand.Len()) + if(!sCommand.isEmpty()) break; } } - if(sCommand.Len()) + if(!sCommand.isEmpty()) { uno::Reference< frame::XFrame > xFrame = rViewFrame.GetFrame().GetFrameInterface(); uno::Reference < frame::XDispatchProvider > xProv( xFrame, uno::UNO_QUERY ); diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index 52fb4d8d59c8..ed6a5bda5d20 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -92,7 +92,7 @@ void SwOneExampleFrame::CreateErrorMessage(Window* pParent) { if(SwOneExampleFrame::bShowServiceNotAvailableMessage) { - String sInfo(SW_RES(STR_SERVICE_UNAVAILABLE)); + OUString sInfo(SW_RES(STR_SERVICE_UNAVAILABLE)); sInfo += OUString(cFrameControl); InfoBox(pParent, sInfo).Execute(); SwOneExampleFrame::bShowServiceNotAvailableMessage = false; @@ -292,35 +292,35 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) do { - if (pSh->GetCurWord() == String("HEADING1")) + if (pSh->GetCurWord() == "HEADING1") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING1)); } - else if (pSh->GetCurWord() == String("ENTRY1")) + else if (pSh->GetCurWord() == "ENTRY1") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY1)); } - else if (pSh->GetCurWord() == String("HEADING11")) + else if (pSh->GetCurWord() == "HEADING11") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING11)); } - else if (pSh->GetCurWord() == String("ENTRY11")) + else if (pSh->GetCurWord() == "ENTRY11") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY11)); } - else if (pSh->GetCurWord() == String("HEADING12")) + else if (pSh->GetCurWord() == "HEADING12") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING12)); } - else if (pSh->GetCurWord() == String("ENTRY12")) + else if (pSh->GetCurWord() == "ENTRY12") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY12)); } - else if (pSh->GetCurWord() == String("TABLE1")) + else if (pSh->GetCurWord() == "TABLE1") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_TABLE1)); } - else if (pSh->GetCurWord() == String("IMAGE1")) + else if (pSh->GetCurWord() == "IMAGE1") { pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_IMAGE1)); } @@ -472,9 +472,9 @@ void SwOneExampleFrame::CreatePopup(const Point& rPt) for (sal_uInt16 i = 0; i < (sizeof(nZoomValues)/sizeof(nZoomValues[0])); ++i) { - String sTemp; + OUString sTemp; sTemp = OUString::number(nZoomValues[i]); - sTemp += OUString(" %"); + sTemp += " %"; aSubPop1.InsertItem( ITEM_ZOOM + i + 1, sTemp); if(nZoom == nZoomValues[i]) aSubPop1.CheckItem(ITEM_ZOOM + i + 1); diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx index 6e4fbd3de59f..30549452c6d1 100644 --- a/sw/source/ui/utlui/viewlayoutctrl.cxx +++ b/sw/source/ui/utlui/viewlayoutctrl.cxx @@ -67,7 +67,7 @@ SwViewLayoutControl::~SwViewLayoutControl() void SwViewLayoutControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if ( SFX_ITEM_AVAILABLE != eState || pState->ISA( SfxVoidItem ) ) - GetStatusBar().SetItemText( GetId(), String() ); + GetStatusBar().SetItemText( GetId(), OUString() ); else { OSL_ENSURE( pState->ISA( SvxViewLayoutItem ), "invalid item type" ); |