Kaydet (Commit) 367d3c9b authored tarafından Matteo Casalin's avatar Matteo Casalin

Use getToken instead of indexOf and re-assignment

Change-Id: If91343c2334f03cd35f95b79b8e341c6ee355f62
üst c8f4095e
...@@ -3655,13 +3655,10 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, AssignHdl) ...@@ -3655,13 +3655,10 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, AssignHdl)
if(nLevPos != LISTBOX_ENTRY_NOTFOUND && if(nLevPos != LISTBOX_ENTRY_NOTFOUND &&
nTemplPos != LISTBOX_ENTRY_NOTFOUND) nTemplPos != LISTBOX_ENTRY_NOTFOUND)
{ {
OUString aStr(m_pLevelLB->GetEntry(nLevPos)); const OUString aStr(m_pLevelLB->GetEntry(nLevPos).getToken(0, aDeliStart)
sal_Int32 nDelPos = aStr.indexOf(aDeliStart); + " " + OUString(aDeliStart)
if(nDelPos != -1) + m_pParaLayLB->GetSelectEntry()
aStr = aStr.copy(0, nDelPos-1); + OUString(aDeliEnd));
aStr += " " + OUString(aDeliStart)
+ m_pParaLayLB->GetSelectEntry()
+ OUString(aDeliEnd);
m_pCurrentForm->SetTemplate(nLevPos, m_pParaLayLB->GetSelectEntry()); m_pCurrentForm->SetTemplate(nLevPos, m_pParaLayLB->GetSelectEntry());
...@@ -3675,13 +3672,10 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, AssignHdl) ...@@ -3675,13 +3672,10 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, AssignHdl)
IMPL_LINK_NOARG(SwTOXStylesTabPage, StdHdl) IMPL_LINK_NOARG(SwTOXStylesTabPage, StdHdl)
{ {
sal_Int32 nPos = m_pLevelLB->GetSelectEntryPos(); const sal_Int32 nPos = m_pLevelLB->GetSelectEntryPos();
if(nPos != LISTBOX_ENTRY_NOTFOUND) if(nPos != LISTBOX_ENTRY_NOTFOUND)
{ {
OUString aStr(m_pLevelLB->GetEntry(nPos)); const OUString aStr(m_pLevelLB->GetEntry(nPos).getToken(0, aDeliStart));
sal_Int32 nDelPos = aStr.indexOf(aDeliStart);
if(nDelPos != -1)
aStr = aStr.copy(0, nDelPos-1);
m_pLevelLB->RemoveEntry(nPos); m_pLevelLB->RemoveEntry(nPos);
m_pLevelLB->InsertEntry(aStr, nPos); m_pLevelLB->InsertEntry(aStr, nPos);
m_pLevelLB->SelectEntry(aStr); m_pLevelLB->SelectEntry(aStr);
......
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