Kaydet (Commit) 757a17a3 authored tarafından Michael Stahl's avatar Michael Stahl

SwGlossaryGroupDlg: String to OUString

üst 53526098
...@@ -83,9 +83,10 @@ class SwGlossaryGroupDlg : public SvxStandardDialog ...@@ -83,9 +83,10 @@ class SwGlossaryGroupDlg : public SvxStandardDialog
PushButton aDelPB; PushButton aDelPB;
PushButton aRenamePB; PushButton aRenamePB;
std::vector<String> m_RemovedArr; typedef std::vector< ::rtl::OUString> OUVector_t;
std::vector<String> m_InsertedArr; OUVector_t m_RemovedArr;
std::vector<String> m_RenamedArr; OUVector_t m_InsertedArr;
OUVector_t m_RenamedArr;
SwGlossaryHdl *pGlosHdl; SwGlossaryHdl *pGlosHdl;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#undef SW_DLLIMPLEMENTATION #undef SW_DLLIMPLEMENTATION
#endif #endif
#include <comphelper/string.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <tools/stream.hxx> #include <tools/stream.hxx>
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
...@@ -147,10 +148,11 @@ void SwGlossaryGroupDlg::Apply() ...@@ -147,10 +148,11 @@ void SwGlossaryGroupDlg::Apply()
if (!m_RemovedArr.empty()) if (!m_RemovedArr.empty())
{ {
for (std::vector<String>::const_iterator it(m_RemovedArr.begin()); for (OUVector_t::const_iterator it(m_RemovedArr.begin());
it != m_RemovedArr.end(); ++it) it != m_RemovedArr.end(); ++it)
{ {
const String sDelGroup = it->GetToken(0, '\t'); const String sDelGroup =
::comphelper::string::getToken(*it, 0, '\t');
if( sDelGroup == aActGroup ) if( sDelGroup == aActGroup )
{ {
//when the current group is deleted, the current group has to be relocated //when the current group is deleted, the current group has to be relocated
...@@ -162,7 +164,7 @@ void SwGlossaryGroupDlg::Apply() ...@@ -162,7 +164,7 @@ void SwGlossaryGroupDlg::Apply()
} }
} }
String sMsg(SW_RES(STR_QUERY_DELETE_GROUP1)); String sMsg(SW_RES(STR_QUERY_DELETE_GROUP1));
String sTitle( it->GetToken(1, '\t') ); String sTitle( ::comphelper::string::getToken(*it, 1, '\t') );
if(sTitle.Len()) if(sTitle.Len())
sMsg += sTitle; sMsg += sTitle;
else else
...@@ -177,13 +179,15 @@ void SwGlossaryGroupDlg::Apply() ...@@ -177,13 +179,15 @@ void SwGlossaryGroupDlg::Apply()
//don't rename before there was one //don't rename before there was one
if (!m_RenamedArr.empty()) if (!m_RenamedArr.empty())
{ {
for (std::vector<String>::const_iterator it(m_RenamedArr.begin()); for (OUVector_t::const_iterator it(m_RenamedArr.begin());
it != m_RenamedArr.end(); ++it) it != m_RenamedArr.end(); ++it)
{ {
xub_StrLen nStrSttPos = 0; ::rtl::OUString const sOld(
String sOld( it->GetToken(0, RENAME_TOKEN_DELIM, nStrSttPos ) ); ::comphelper::string::getToken(*it, 0, RENAME_TOKEN_DELIM));
String sNew( it->GetToken(0, RENAME_TOKEN_DELIM, nStrSttPos) ); String sNew(
String sTitle( it->GetToken(0, RENAME_TOKEN_DELIM, nStrSttPos) ); ::comphelper::string::getToken(*it, 1, RENAME_TOKEN_DELIM));
::rtl::OUString const sTitle(
::comphelper::string::getToken(*it, 2, RENAME_TOKEN_DELIM));
pGlosHdl->RenameGroup(sOld, sNew, sTitle); pGlosHdl->RenameGroup(sOld, sNew, sTitle);
if (it == m_RenamedArr.begin()) if (it == m_RenamedArr.begin())
{ {
...@@ -193,7 +197,7 @@ void SwGlossaryGroupDlg::Apply() ...@@ -193,7 +197,7 @@ void SwGlossaryGroupDlg::Apply()
} }
if (!m_InsertedArr.empty()) if (!m_InsertedArr.empty())
{ {
for (std::vector<String>::const_iterator it(m_InsertedArr.begin()); for (OUVector_t::const_iterator it(m_InsertedArr.begin());
it != m_InsertedArr.end(); ++it) it != m_InsertedArr.end(); ++it)
{ {
String sNewGroup = *it; String sNewGroup = *it;
...@@ -265,15 +269,15 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) ...@@ -265,15 +269,15 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
return 0; return 0;
} }
GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
String sEntry(pUserData->sGroupName); ::rtl::OUString const sEntry(pUserData->sGroupName);
// if the name to be deleted is among the new ones - get rid of it // if the name to be deleted is among the new ones - get rid of it
sal_Bool bDelete = sal_True; sal_Bool bDelete = sal_True;
if (!m_InsertedArr.empty()) if (!m_InsertedArr.empty())
{ {
for (std::vector<String>::iterator it(m_InsertedArr.begin()); for (OUVector_t::iterator it(m_InsertedArr.begin());
it != m_InsertedArr.end(); ++it) it != m_InsertedArr.end(); ++it)
{ {
if( *it == sEntry ) if (*it == sEntry)
{ {
m_InsertedArr.erase(it); m_InsertedArr.erase(it);
bDelete = sal_False; bDelete = sal_False;
...@@ -287,10 +291,11 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) ...@@ -287,10 +291,11 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
{ {
if (!m_RenamedArr.empty()) if (!m_RenamedArr.empty())
{ {
for (std::vector<String>::iterator it(m_RenamedArr.begin()); for (OUVector_t::iterator it(m_RenamedArr.begin());
it != m_RenamedArr.end(); ++it) it != m_RenamedArr.end(); ++it)
{ {
if (it->GetToken(0, RENAME_TOKEN_DELIM) == sEntry) if (::comphelper::string::getToken(*it, 0, RENAME_TOKEN_DELIM)
== sEntry)
{ {
m_RenamedArr.erase(it); m_RenamedArr.erase(it);
bDelete = sal_False; bDelete = sal_False;
...@@ -333,10 +338,10 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG ) ...@@ -333,10 +338,10 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
sal_Bool bDone = sal_False; sal_Bool bDone = sal_False;
if (!m_InsertedArr.empty()) if (!m_InsertedArr.empty())
{ {
for (std::vector<String>::iterator it(m_InsertedArr.begin()); for (OUVector_t::iterator it(m_InsertedArr.begin());
it != m_InsertedArr.end(); ++it) it != m_InsertedArr.end(); ++it)
{ {
if (*it == sEntry) if (String(*it) == sEntry)
{ {
m_InsertedArr.erase(it); m_InsertedArr.erase(it);
m_InsertedArr.push_back(sNewName); m_InsertedArr.push_back(sNewName);
...@@ -435,10 +440,10 @@ sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup) ...@@ -435,10 +440,10 @@ sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup)
if (!m_InsertedArr.empty()) if (!m_InsertedArr.empty())
{ {
for (std::vector<String>::const_iterator it(m_InsertedArr.begin()); for (OUVector_t::const_iterator it(m_InsertedArr.begin());
it != m_InsertedArr.end(); ++it) it != m_InsertedArr.end(); ++it)
{ {
if (*it == rGroup) if (String(*it) == rGroup)
{ {
bDel = sal_True; bDel = sal_True;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment