Kaydet (Commit) 69ff012f authored tarafından Michael Stahl's avatar Michael Stahl

sw: tdf#91131 when renaming a SwNumRule, also ...

... update the DocumentListsManager::maLists because without that all
list styles created in the UI will have GetDefaultListStyleName() ==
"Untitled1" and then deleting one of them deletes all these entries from
maList, which makes the DocumentListsManager unhappy.

Change-Id: Ic40e561fc540881ab29566a3f5ecdc8a180c97ef
üst 38f3b3fd
......@@ -39,6 +39,7 @@ class SwList
const OUString GetListId() const;
const OUString GetDefaultListStyleName() const;
void SetDefaultListStyleName(OUString const&);
void InsertListItem( SwNodeNum& rNodeNum,
const int nLevel );
......
......@@ -182,6 +182,13 @@ void DocumentListsManager::trackChangeOfListStyleName( const OUString& sListStyl
maListStyleLists.erase( sListStyleName );
maListStyleLists[sNewListStyleName] = pList;
}
for (auto & it : maLists) // tdf#91131 update these references too
{
if (it.second->GetDefaultListStyleName() == sListStyleName)
{
it.second->SetDefaultListStyleName(sNewListStyleName);
}
}
}
......
......@@ -51,7 +51,6 @@ class SwListImpl
bool IsListLevelMarked( const int nListLevel ) const;
private:
// unique identifier of the list
const OUString msListId;
// default list style for the list items, identified by the list style name
......@@ -232,6 +231,11 @@ const OUString SwList::GetDefaultListStyleName() const
return mpListImpl->GetDefaultListStyleName();
}
void SwList::SetDefaultListStyleName(OUString const& rNew)
{
mpListImpl->msDefaultListStyleName = rNew;
}
void SwList::InsertListItem( SwNodeNum& rNodeNum,
const int nLevel )
{
......
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