sw/inc/shellio.hxx | 4 +- sw/source/core/inc/SwXMLTextBlocks.hxx | 2 - sw/source/core/inc/swblocks.hxx | 2 - sw/source/core/swg/SwXMLTextBlocks.cxx | 4 +- sw/source/core/swg/swblocks.cxx | 4 +- sw/source/ui/dochdl/gloshdl.cxx | 60 +++++++++++++++------------------ sw/source/ui/inc/glosbib.hxx | 2 - sw/source/ui/inc/glosdoc.hxx | 6 +-- sw/source/ui/inc/gloshdl.hxx | 14 +++---- sw/source/ui/misc/glosbib.cxx | 27 +++++++------- sw/source/ui/misc/glosdoc.cxx | 38 +++++++++----------- sw/source/ui/misc/glossary.cxx | 56 +++++++++++++++--------------- sw/source/ui/uno/unoatxt.cxx | 18 ++++----- 13 files changed, 115 insertions(+), 122 deletions(-)
New commits: commit e1c2cb7dc89753c81618a6e4ce95dd9b0d43782f Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Thu Jul 25 19:42:17 2013 +0200 String to OUString Change-Id: Ifc5e74f3a484229e05fe65b47ac5e8b763595fd0 Reviewed-on: https://gerrit.libreoffice.org/5183 Reviewed-by: LuboÅ¡ LuÅák <l.lu...@suse.cz> Tested-by: LuboÅ¡ LuÅák <l.lu...@suse.cz> diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 7e33733..7efeca0 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -331,8 +331,8 @@ public: sal_Bool Delete( sal_uInt16 ); sal_uInt16 Rename( sal_uInt16, const String*, const String* ); - sal_uLong CopyBlock( SwTextBlocks& rSource, String& rSrcShort, - const String& rLong ); + sal_uLong CopyBlock( SwTextBlocks& rSource, OUString& rSrcShort, + const OUString& rLong ); sal_Bool BeginGetDoc( sal_uInt16 ); // Read text modules. void EndGetDoc(); // Release text modules. diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx index 8aa3a94..b3c1b3b 100644 --- a/sw/source/core/inc/SwXMLTextBlocks.hxx +++ b/sw/source/core/inc/SwXMLTextBlocks.hxx @@ -60,7 +60,7 @@ public: //virtual sal_Bool IsOld() const; virtual sal_uLong Delete( sal_uInt16 ); virtual sal_uLong Rename( sal_uInt16, const String&, const String& ); - virtual sal_uLong CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong); + virtual sal_uLong CopyBlock( SwImpBlocks& rImp, OUString& rShort, const OUString& rLong); virtual void ClearDoc(); virtual sal_uLong GetDoc( sal_uInt16 ); virtual sal_uLong BeginPutDoc( const String&, const String& ); diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx index d2f72bf..9561e55 100644 --- a/sw/source/core/inc/swblocks.hxx +++ b/sw/source/core/inc/swblocks.hxx @@ -109,7 +109,7 @@ public: virtual sal_uLong Delete( sal_uInt16 ) = 0; virtual sal_uLong Rename( sal_uInt16, const String&, const String& ) = 0; - virtual sal_uLong CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong) = 0; + virtual sal_uLong CopyBlock( SwImpBlocks& rImp, OUString& rShort, const OUString& rLong) = 0; virtual sal_uLong GetDoc( sal_uInt16 ) = 0; virtual sal_uLong BeginPutDoc( const String&, const String& ) = 0; virtual sal_uLong PutDoc() = 0; diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 30b8500..1a35392 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -244,8 +244,8 @@ sal_uLong SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const String& rNewShort, con return 0; } -sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort, - const String& rLong) +sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, OUString& rShort, + const OUString& rLong) { sal_uLong nError = 0; OpenFile(sal_True); diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index 574d04e..3045aa5 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -387,8 +387,8 @@ sal_uInt16 SwTextBlocks::Rename( sal_uInt16 n, const String* s, const String* l return nIdx; } -sal_uLong SwTextBlocks::CopyBlock( SwTextBlocks& rSource, String& rSrcShort, - const String& rLong ) +sal_uLong SwTextBlocks::CopyBlock( SwTextBlocks& rSource, OUString& rSrcShort, + const OUString& rLong ) { bool bIsOld = false; if (rSource.pImp) diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index d796fe9..95c8b45 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -104,11 +104,10 @@ void SwGlossaryHdl::GlossaryDlg() // the group is created temporarily for faster access void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlwaysCreateNew ) { - String sGroup(rGrp); - if(STRING_NOTFOUND == sGroup.Search(GLOS_DELIM) && !FindGroupName(sGroup)) + OUString sGroup(rGrp); + if (sGroup.indexOf(GLOS_DELIM)<0 && !FindGroupName(sGroup)) { - sGroup += GLOS_DELIM; - sGroup += '0'; + sGroup += OUString(GLOS_DELIM) + "0"; } if(pCurGrp) { @@ -116,7 +115,7 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlw if(!bAlwaysCreateNew) { INetURLObject aTemp( pCurGrp->GetFileName() ); - String sCurBase = aTemp.getBase(); + const OUString sCurBase = aTemp.getBase(); aTemp.removeSegment(); const String sCurEntryPath = aTemp.GetMainURL(INetURLObject::NO_DECODE); const std::vector<String> & rPathArr = @@ -130,10 +129,10 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlw break; } } - String sPath = sGroup.GetToken(1, GLOS_DELIM); - sal_uInt16 nComparePath = (sal_uInt16)sPath.ToInt32(); + const OUString sPath = sGroup.getToken(1, GLOS_DELIM); + sal_uInt16 nComparePath = (sal_uInt16)sPath.toInt32(); if(nCurrentPath == nComparePath && - sGroup.GetToken(0, GLOS_DELIM) == sCurBase) + sGroup.getToken(0, GLOS_DELIM) == sCurBase) bPathEqual = true; } @@ -158,40 +157,40 @@ sal_uInt16 SwGlossaryHdl::GetGroupCnt() const return rStatGlossaries.GetGroupCnt(); } -String SwGlossaryHdl::GetGroupName( sal_uInt16 nId, String* pTitle ) +OUString SwGlossaryHdl::GetGroupName( sal_uInt16 nId, OUString* pTitle ) { - String sRet = rStatGlossaries.GetGroupName(nId); + OUString sRet = rStatGlossaries.GetGroupName(nId); if(pTitle) { SwTextBlocks* pGroup = rStatGlossaries.GetGroupDoc(sRet, sal_False); if(pGroup && !pGroup->GetError()) { *pTitle = pGroup->GetName(); - if(!pTitle->Len()) + if (pTitle->isEmpty()) { - *pTitle = sRet.GetToken(0, GLOS_DELIM); + *pTitle = sRet.getToken(0, GLOS_DELIM); pGroup->SetName(*pTitle); } rStatGlossaries.PutGroupDoc( pGroup ); } else - sRet.Erase(); + sRet = OUString(); } return sRet; } -sal_Bool SwGlossaryHdl::NewGroup(String &rGrpName, const String& rTitle) +sal_Bool SwGlossaryHdl::NewGroup(OUString &rGrpName, const OUString& rTitle) { - if(STRING_NOTFOUND == rGrpName.Search(GLOS_DELIM)) + if (rGrpName.indexOf(GLOS_DELIM)<0) FindGroupName(rGrpName); return rStatGlossaries.NewGroupDoc(rGrpName, rTitle); } -sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const String& rNewTitle) +sal_Bool SwGlossaryHdl::RenameGroup(const OUString& rOld, OUString& rNew, const OUString& rNewTitle) { sal_Bool bRet = sal_False; - String sOldGroup(rOld); - if(STRING_NOTFOUND == rOld.Search(GLOS_DELIM)) + OUString sOldGroup(rOld); + if (rOld.indexOf(GLOS_DELIM)<0) FindGroupName(sOldGroup); if(rOld == rNew) { @@ -205,11 +204,10 @@ sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const Str } else { - String sNewGroup(rNew); - if(STRING_NOTFOUND == sNewGroup.Search(GLOS_DELIM)) + OUString sNewGroup(rNew); + if (sNewGroup.indexOf(GLOS_DELIM)<0) { - sNewGroup += GLOS_DELIM; - sNewGroup += '0'; + sNewGroup += OUString(GLOS_DELIM) + "0"; } bRet = rStatGlossaries.RenameGroupDoc(sOldGroup, sNewGroup, rNewTitle); rNew = sNewGroup; @@ -217,8 +215,8 @@ sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const Str return bRet; } -sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSourceShortName, - const String& rDestGroupName, const String& rLongName, sal_Bool bMove ) +sal_Bool SwGlossaryHdl::CopyOrMove( const OUString& rSourceGroupName, OUString& rSourceShortName, + const OUString& rDestGroupName, const OUString& rLongName, sal_Bool bMove ) { SwTextBlocks* pSourceGroup = rStatGlossaries.GetGroupDoc(rSourceGroupName, sal_False); @@ -243,14 +241,14 @@ sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSo // delete a autotext-file-group sal_Bool SwGlossaryHdl::DelGroup(const String &rGrpName) { - String sGroup(rGrpName); - if(STRING_NOTFOUND == sGroup.Search(GLOS_DELIM)) + OUString sGroup(rGrpName); + if (sGroup.indexOf(GLOS_DELIM)<0) FindGroupName(sGroup); if( rStatGlossaries.DelGroupDoc(sGroup) ) { if(pCurGrp) { - const String aMac_Tmp(pCurGrp->GetName()); + const OUString aMac_Tmp(pCurGrp->GetName()); if(aMac_Tmp == sGroup) DELETEZ(pCurGrp); } @@ -371,8 +369,8 @@ sal_Bool SwGlossaryHdl::ExpandGlossary() OSL_ENSURE(pFact, "Dialogdiet fail!"); ::GlossaryGetCurrGroup fnGetCurrGroup = pFact->GetGlossaryCurrGroupFunc(); OSL_ENSURE(fnGetCurrGroup, "Dialogdiet fail!"); - String sGroupName( (*fnGetCurrGroup)() ); - if(STRING_NOTFOUND == sGroupName.Search(GLOS_DELIM)) + OUString sGroupName( (*fnGetCurrGroup)() ); + if (sGroupName.indexOf(GLOS_DELIM)<0) FindGroupName(sGroupName); pGlossary = rStatGlossaries.GetGroupDoc(sGroupName); @@ -681,7 +679,7 @@ sal_Bool SwGlossaryHdl::Rename(const String& rOldShort, const String& rNewShortN } -sal_Bool SwGlossaryHdl::IsReadOnly( const String* pGrpNm ) const +sal_Bool SwGlossaryHdl::IsReadOnly( const OUString* pGrpNm ) const { SwTextBlocks *pGlossary = 0; @@ -710,7 +708,7 @@ sal_Bool SwGlossaryHdl::IsOld() const } // find group without path index -sal_Bool SwGlossaryHdl::FindGroupName(String & rGroup) +sal_Bool SwGlossaryHdl::FindGroupName(OUString& rGroup) { return rStatGlossaries.FindGroupName(rGroup); } diff --git a/sw/source/ui/inc/glosbib.hxx b/sw/source/ui/inc/glosbib.hxx index 65a1a08..abe7cee 100644 --- a/sw/source/ui/inc/glosbib.hxx +++ b/sw/source/ui/inc/glosbib.hxx @@ -91,7 +91,7 @@ class SwGlossaryGroupDlg : public SvxStandardDialog String sCreatedGroup; - sal_Bool IsDeleteAllowed(const String &rGroup); + sal_Bool IsDeleteAllowed(const OUString &rGroup); protected: virtual void Apply(); diff --git a/sw/source/ui/inc/glosdoc.hxx b/sw/source/ui/inc/glosdoc.hxx index a3a6c79..196194e 100644 --- a/sw/source/ui/inc/glosdoc.hxx +++ b/sw/source/ui/inc/glosdoc.hxx @@ -108,7 +108,7 @@ public: String GetGroupName(sal_uInt16 ); String GetGroupTitle( const String& rGroupName ); - sal_Bool FindGroupName(String & rGroup); + sal_Bool FindGroupName(OUString& rGroup); SwTextBlocks* GetGroupDoc(const String &rName, sal_Bool bCreate = sal_False); @@ -119,8 +119,8 @@ public: String GetCompleteGroupName( const OUString& GroupName ); - sal_Bool NewGroupDoc(String &rGroupName, const String& rTitle); - sal_Bool RenameGroupDoc(const String& sOldGroup, String& sNewGroup, const String& rNewTitle); + sal_Bool NewGroupDoc(OUString &rGroupName, const OUString& rTitle); + sal_Bool RenameGroupDoc(const OUString& sOldGroup, OUString& sNewGroup, const OUString& rNewTitle); sal_Bool DelGroupDoc(const String &); SwDocShellRef EditGroupDoc(const String &rGrpName, const String& rShortName, sal_Bool bShow = sal_True ); void SaveGroupDoc(const String &rGrpName, const String& rLongName ); diff --git a/sw/source/ui/inc/gloshdl.hxx b/sw/source/ui/inc/gloshdl.hxx index 84e876a..b397ec1 100644 --- a/sw/source/ui/inc/gloshdl.hxx +++ b/sw/source/ui/inc/gloshdl.hxx @@ -51,10 +51,10 @@ public: void GlossaryDlg(); sal_uInt16 GetGroupCnt() const; - String GetGroupName( sal_uInt16, String* pTitle = 0 ); - sal_Bool NewGroup(String & rGroupName, const String& rTitle); + OUString GetGroupName( sal_uInt16, OUString* pTitle = 0 ); + sal_Bool NewGroup(OUString & rGroupName, const OUString& rTitle); sal_Bool DelGroup(const String &); - sal_Bool RenameGroup(const String & rOld, String& rNew, const String& rNewTitle); + sal_Bool RenameGroup(const OUString& rOld, OUString& rNew, const OUString& rNewTitle); void SetCurGroup(const String &aGrp, sal_Bool bApi = sal_False, sal_Bool bAlwaysCreateNew = sal_False); const String &GetCurGroup() const { return aCurGrp; } @@ -66,8 +66,8 @@ public: sal_Bool Rename( const String& rOldShortName, const String& rNewShortName, const String& rNewName); - sal_Bool CopyOrMove( const String& rSourceGroupName, String& rSourceShortName, - const String& rDestGroupName, const String& rLongName, sal_Bool bMove ); + sal_Bool CopyOrMove( const OUString& rSourceGroupName, OUString& rSourceShortName, + const OUString& rDestGroupName, const OUString& rLongName, sal_Bool bMove ); sal_Bool HasShortName(const String &rShortName) const; // when NewGlossary is called from Basic then the previously set group should // be newly created if applicable. @@ -88,10 +88,10 @@ public: SvxMacro& rEnd, SwTextBlocks* pGlossary = 0 ); - sal_Bool IsReadOnly( const String* = 0 ) const; + sal_Bool IsReadOnly( const OUString* = 0 ) const; sal_Bool IsOld() const; - sal_Bool FindGroupName(String & rGroup); // find group without path index + sal_Bool FindGroupName(OUString& rGroup); // find group without path index sal_Bool ImportGlossaries( const String& rName ); diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index 8c83593..5b18557 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -96,7 +96,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, const sal_uInt16 nCount = pHdl->GetGroupCnt(); for( sal_uInt16 i = 0; i < nCount; ++i) { - String sTitle; + OUString sTitle; String sGroup = pHdl->GetGroupName(i, &sTitle); if(!sGroup.Len()) continue; @@ -158,7 +158,7 @@ void SwGlossaryGroupDlg::Apply() { OUString const sOld( ::comphelper::string::getToken(*it, 0, RENAME_TOKEN_DELIM)); - String sNew( + OUString sNew( ::comphelper::string::getToken(*it, 1, RENAME_TOKEN_DELIM)); OUString const sTitle( ::comphelper::string::getToken(*it, 2, RENAME_TOKEN_DELIM)); @@ -171,8 +171,8 @@ void SwGlossaryGroupDlg::Apply() for (OUVector_t::const_iterator it(m_InsertedArr.begin()); it != m_InsertedArr.end(); ++it) { - String sNewGroup = *it; - String sNewTitle = sNewGroup.GetToken(0, GLOS_DELIM); + OUString sNewGroup = *it; + OUString sNewTitle = sNewGroup.getToken(0, GLOS_DELIM); if( sNewGroup != aActGroup ) { pGlosHdl->NewGroup(sNewGroup, sNewTitle); @@ -209,9 +209,9 @@ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG ) IMPL_LINK_NOARG(SwGlossaryGroupDlg, NewHdl) { - String sGroup(m_pNameED->GetText()); - sGroup += GLOS_DELIM; - sGroup += OUString::number(m_pPathLB->GetSelectEntryPos()); + OUString sGroup = m_pNameED->GetText() + + OUString(GLOS_DELIM) + + OUString::number(m_pPathLB->GetSelectEntryPos()); OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!"); m_InsertedArr.push_back(sGroup); String sTemp(m_pNameED->GetText()); @@ -290,11 +290,10 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl) GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); String sEntry(pUserData->sGroupName); - String sNewName(m_pNameED->GetText()); - String sNewTitle(sNewName); - - sNewName += GLOS_DELIM; - sNewName += OUString::number(m_pPathLB->GetSelectEntryPos()); + const OUString sNewTitle(m_pNameED->GetText()); + OUString sNewName = sNewTitle + + OUString(GLOS_DELIM) + + OUString::number(m_pPathLB->GetSelectEntryPos()); OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!"); // if the name to be renamed is among the new ones - replace @@ -387,7 +386,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) return 0; } -sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup) +sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const OUString &rGroup) { sal_Bool bDel = (!pGlosHdl->IsReadOnly(&rGroup)); @@ -398,7 +397,7 @@ sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup) for (OUVector_t::const_iterator it(m_InsertedArr.begin()); it != m_InsertedArr.end(); ++it) { - if (String(*it) == rGroup) + if (*it == rGroup) { bDel = sal_True; break; diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx index b6a2dfb..c5d2d2e 100644 --- a/sw/source/ui/misc/glosdoc.cxx +++ b/sw/source/ui/misc/glosdoc.cxx @@ -110,7 +110,7 @@ sal_uInt16 SwGlossaries::GetGroupCnt() /*------------------------------------------------------------------------ Description: supplies the group's name ------------------------------------------------------------------------*/ -sal_Bool SwGlossaries::FindGroupName(String & rGroup) +sal_Bool SwGlossaries::FindGroupName(OUString& rGroup) { // if the group name doesn't contain a path, a suitable group entry // can the searched for here; @@ -118,8 +118,8 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup) sal_uInt16 i; for(i= 0; i < nCount; i++) { - String sTemp(GetGroupName(i)); - if(rGroup.Equals( sTemp.GetToken(0, GLOS_DELIM))) + const OUString sTemp(GetGroupName(i)); + if (rGroup==sTemp.getToken(0, GLOS_DELIM)) { rGroup = sTemp; return sal_True; @@ -130,11 +130,11 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup) const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); for(i = 0; i < nCount; i++) { - String sTemp( GetGroupName( i )); - sal_uInt16 nPath = (sal_uInt16)sTemp.GetToken(1, GLOS_DELIM).ToInt32(); + const OUString sTemp( GetGroupName( i )); + sal_uInt16 nPath = (sal_uInt16)sTemp.getToken(1, GLOS_DELIM).toInt32(); if (!SWUnoHelper::UCB_IsCaseSensitiveFileName( m_PathArr[nPath] ) - && rSCmp.isEqual( rGroup, sTemp.GetToken( 0, GLOS_DELIM) ) ) + && rSCmp.isEqual( rGroup, sTemp.getToken( 0, GLOS_DELIM) ) ) { rGroup = sTemp; return sal_True; @@ -153,8 +153,8 @@ String SwGlossaries::GetGroupName(sal_uInt16 nGroupId) String SwGlossaries::GetGroupTitle( const String& rGroupName ) { String sRet; - String sGroup(rGroupName); - if(STRING_NOTFOUND == sGroup.Search(GLOS_DELIM)) + OUString sGroup(rGroupName); + if (sGroup.indexOf(GLOS_DELIM)<0) FindGroupName(sGroup); SwTextBlocks* pGroup = GetGroupDoc(sGroup, sal_False); if(pGroup) @@ -200,15 +200,15 @@ void SwGlossaries::PutGroupDoc(SwTextBlocks *pBlock) { also created as file so that groups remain there later (without access). ------------------------------------------------------------------------*/ -sal_Bool SwGlossaries::NewGroupDoc(String& rGroupName, const String& rTitle) +sal_Bool SwGlossaries::NewGroupDoc(OUString& rGroupName, const OUString& rTitle) { - sal_uInt16 nNewPath = (sal_uInt16)rGroupName.GetToken(1, GLOS_DELIM).ToInt32(); + sal_uInt16 nNewPath = (sal_uInt16)rGroupName.getToken(1, GLOS_DELIM).toInt32(); if (static_cast<size_t>(nNewPath) >= m_PathArr.size()) return sal_False; const OUString sNewFilePath(m_PathArr[nNewPath]); - String sNewGroup = lcl_CheckFileName(sNewFilePath, rGroupName.GetToken(0, GLOS_DELIM)); + String sNewGroup = lcl_CheckFileName(sNewFilePath, rGroupName.getToken(0, GLOS_DELIM)); sNewGroup += GLOS_DELIM; - sNewGroup += rGroupName.GetToken(1, GLOS_DELIM); + sNewGroup += rGroupName.getToken(1, GLOS_DELIM); SwTextBlocks *pBlock = GetGlosDoc( sNewGroup ); if(pBlock) { @@ -222,14 +222,14 @@ sal_Bool SwGlossaries::NewGroupDoc(String& rGroupName, const String& rTitle) } sal_Bool SwGlossaries::RenameGroupDoc( - const String& rOldGroup, String& rNewGroup, const String& rNewTitle ) + const OUString& rOldGroup, OUString& rNewGroup, const OUString& rNewTitle ) { - sal_uInt16 nOldPath = (sal_uInt16)rOldGroup.GetToken(1, GLOS_DELIM).ToInt32(); + sal_uInt16 nOldPath = (sal_uInt16)rOldGroup.getToken(1, GLOS_DELIM).toInt32(); if (static_cast<size_t>(nOldPath) >= m_PathArr.size()) return sal_False; const OUString sOldFileURL = - lcl_FullPathName(m_PathArr[nOldPath], rOldGroup.GetToken(0, GLOS_DELIM)); + lcl_FullPathName(m_PathArr[nOldPath], rOldGroup.getToken(0, GLOS_DELIM)); if (!FStatHelper::IsDocument( sOldFileURL )) { @@ -237,12 +237,12 @@ sal_Bool SwGlossaries::RenameGroupDoc( return sal_False; } - sal_uInt16 nNewPath = (sal_uInt16)rNewGroup.GetToken(1, GLOS_DELIM).ToInt32(); + sal_uInt16 nNewPath = (sal_uInt16)rNewGroup.getToken(1, GLOS_DELIM).toInt32(); if (static_cast<size_t>(nNewPath) >= m_PathArr.size()) return sal_False; const OUString sNewFileName = lcl_CheckFileName(m_PathArr[nNewPath], - rNewGroup.GetToken(0, GLOS_DELIM)); + rNewGroup.getToken(0, GLOS_DELIM)); const OUString sNewFileURL = lcl_FullPathName(m_PathArr[nNewPath], sNewFileName); if (FStatHelper::IsDocument( sNewFileURL )) @@ -256,9 +256,7 @@ sal_Bool SwGlossaries::RenameGroupDoc( RemoveFileFromList( rOldGroup ); - rNewGroup = sNewFileName; - rNewGroup += GLOS_DELIM; - rNewGroup += OUString::number(nNewPath); + rNewGroup = sNewFileName + OUString(GLOS_DELIM) + OUString::number(nNewPath); if (m_GlosArr.empty()) { GetNameList(); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 3494051..a163807 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -677,23 +677,23 @@ void SwGlossaryDlg::Init() const String sSelStr(::GetCurrGlosGroup()->GetToken(0, GLOS_DELIM)); const sal_uInt16 nSelPath = static_cast< sal_uInt16 >(::GetCurrGlosGroup()->GetToken(1, GLOS_DELIM).ToInt32()); // #i66304# - "My AutoText" comes from mytexts.bau, but should be translated - const String sMyAutoTextEnglish(RTL_CONSTASCII_USTRINGPARAM("My AutoText")); - const String sMyAutoTextTranslated(SW_RESSTR(STR_MY_AUTOTEXT)); + const OUString sMyAutoTextEnglish("My AutoText"); + const OUString sMyAutoTextTranslated(SW_RES(STR_MY_AUTOTEXT)); for(sal_uInt16 nId = 0; nId < nCnt; ++nId ) { - String sTitle; - String sGroupName(pGlossaryHdl->GetGroupName(nId, &sTitle)); - if(!sGroupName.Len()) + OUString sTitle; + OUString sGroupName(pGlossaryHdl->GetGroupName(nId, &sTitle)); + if(sGroupName.isEmpty()) continue; - if(!sTitle.Len()) - sTitle = sGroupName.GetToken( 0, GLOS_DELIM ); + if(sTitle.isEmpty()) + sTitle = sGroupName.getToken( 0, GLOS_DELIM ); if(sTitle == sMyAutoTextEnglish) sTitle = sMyAutoTextTranslated; SvTreeListEntry* pEntry = m_pCategoryBox->InsertEntry( sTitle ); - sal_uInt16 nPath = static_cast< sal_uInt16 >(sGroupName.GetToken( 1, GLOS_DELIM ).ToInt32()); + sal_uInt16 nPath = static_cast< sal_uInt16 >(sGroupName.getToken( 1, GLOS_DELIM ).toInt32()); GroupUserData* pData = new GroupUserData; - pData->sGroupName = sGroupName.GetToken(0, GLOS_DELIM); + pData->sGroupName = sGroupName.getToken(0, GLOS_DELIM); pData->nPathIdx = nPath; pData->bReadonly = pGlossaryHdl->IsReadOnly(&sGroupName); @@ -923,9 +923,9 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag( SvTreeListEntry* pParent = GetParent(pEntry); GroupUserData* pGroupData = (GroupUserData*)pParent->GetUserData(); - String sEntry(pGroupData->sGroupName); - sEntry += GLOS_DELIM; - sEntry += OUString::number(pGroupData->nPathIdx); + OUString sEntry = pGroupData->sGroupName + + OUString(GLOS_DELIM) + + OUString::number(pGroupData->nPathIdx); sal_Int8 nDragOption = DND_ACTION_COPY; eRet = SV_DRAGDROP_CTRL_COPY; if(!pDlg->pGlossaryHdl->IsReadOnly(&sEntry)) @@ -971,17 +971,17 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvTreeListEntry* pTarget, SwWait aWait( *pDlg->pSh->GetView().GetDocShell(), sal_True ); GroupUserData* pGroupData = (GroupUserData*)pSrcParent->GetUserData(); - String sSourceGroup(pGroupData->sGroupName); - sSourceGroup += GLOS_DELIM; - sSourceGroup += OUString::number(pGroupData->nPathIdx); + OUString sSourceGroup = pGroupData->sGroupName + + OUString(GLOS_DELIM) + + OUString::number(pGroupData->nPathIdx); pDlg->pGlossaryHdl->SetCurGroup(sSourceGroup); - String sTitle(GetEntryText(pEntry)); - String sShortName(*(String*)pEntry->GetUserData()); + OUString sTitle(GetEntryText(pEntry)); + OUString sShortName(*(String*)pEntry->GetUserData()); GroupUserData* pDestData = (GroupUserData*)pDestParent->GetUserData(); - String sDestName = pDestData->sGroupName; - sDestName += GLOS_DELIM; - sDestName += OUString::number(pDestData->nPathIdx); + OUString sDestName = pDestData->sGroupName + + OUString(GLOS_DELIM) + + OUString::number(pDestData->nPathIdx); bRet = pDlg->pGlossaryHdl->CopyOrMove( sSourceGroup, sShortName, sDestName, sTitle, sal_True ); if(bRet) @@ -1017,18 +1017,18 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvTreeListEntry* pTarget, SwWait aWait( *pDlg->pSh->GetView().GetDocShell(), sal_True ); GroupUserData* pGroupData = (GroupUserData*)pSrcParent->GetUserData(); - String sSourceGroup(pGroupData->sGroupName); - sSourceGroup += GLOS_DELIM; - sSourceGroup += OUString::number(pGroupData->nPathIdx); + OUString sSourceGroup = pGroupData->sGroupName + + OUString(GLOS_DELIM) + + OUString::number(pGroupData->nPathIdx); pDlg->pGlossaryHdl->SetCurGroup(sSourceGroup); - String sTitle(GetEntryText(pEntry)); - String sShortName(*(String*)pEntry->GetUserData()); + OUString sTitle(GetEntryText(pEntry)); + OUString sShortName(*(String*)pEntry->GetUserData()); GroupUserData* pDestData = (GroupUserData*)pDestParent->GetUserData(); - String sDestName = pDestData->sGroupName; - sDestName += GLOS_DELIM; - sDestName += OUString::number(pDestData->nPathIdx); + OUString sDestName = pDestData->sGroupName + + OUString(GLOS_DELIM) + + OUString::number(pDestData->nPathIdx); bRet = pDlg->pGlossaryHdl->CopyOrMove( sSourceGroup, sShortName, sDestName, sTitle, sal_False ); diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 3a180d6..f3f26a7 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -187,13 +187,12 @@ uno::Reference< text::XAutoTextGroup > SwXAutoTextContainer::insertNewByName( aIllegal.Message = "group name must contain a-z, A-z, '_', ' ' only"; throw aIllegal; } - String sGroup(aGroupName); - if(STRING_NOTFOUND == sGroup.Search(GLOS_DELIM)) + OUString sGroup(aGroupName); + if (sGroup.indexOf(GLOS_DELIM)<0) { - sGroup += GLOS_DELIM; - sGroup += "0"; + sGroup += OUString(GLOS_DELIM) + "0"; } - pGlossaries->NewGroupDoc(sGroup, sGroup.GetToken(0, GLOS_DELIM)); + pGlossaries->NewGroupDoc(sGroup, sGroup.getToken(0, GLOS_DELIM)); uno::Reference< text::XAutoTextGroup > xGroup = pGlossaries->GetAutoTextGroup( sGroup, true ); OSL_ENSURE( xGroup.is(), "SwXAutoTextContainer::insertNewByName: no UNO object created? How this?" ); @@ -487,17 +486,16 @@ void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeExcepti if ( sName == rName || ( nNewNumeric == nOldNumeric && aNewPrefix == aOldPrefix ) ) return; - String sNewGroup(rName); - if(STRING_NOTFOUND == sNewGroup.Search(GLOS_DELIM)) + OUString sNewGroup(rName); + if (sNewGroup.indexOf(GLOS_DELIM)<0) { - sNewGroup += GLOS_DELIM; - sNewGroup += "0"; + sNewGroup += OUString(GLOS_DELIM) + "0"; } //the name must be saved, the group may be invalidated while in RenameGroupDoc() SwGlossaries* pTempGlossaries = pGlossaries; - String sPreserveTitle( pGlossaries->GetGroupTitle( sName ) ); + OUString sPreserveTitle( pGlossaries->GetGroupTitle( sName ) ); if ( !pGlossaries->RenameGroupDoc( sName, sNewGroup, sPreserveTitle ) ) throw uno::RuntimeException(); else
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits