summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/doc/docdraw.cxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx17
2 files changed, 17 insertions, 2 deletions
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index c070519cfbf9..4468e648a8a2 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -329,6 +329,8 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
// #i36010# - set layout direction of the position
pFormat->SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
+ if (pSubObj->GetName().isEmpty())
+ pSubObj->SetName(pFormat->GetName());
pFormatsAndObjs[i].emplace_back( pFormat, pSubObj );
if( bUndo )
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 641ee44bc6d3..3129d7ee572f 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3193,8 +3193,21 @@ void SwContentTree::UpdateTracking()
{
SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
OUString aName(pSelected->GetName());
- lcl_SelectByContentTypeAndName(this, *m_xTreeView,
- SwResId(STR_CONTENT_TYPE_DRAWOBJECT), aName);
+ if (!aName.isEmpty())
+ lcl_SelectByContentTypeAndName(this, *m_xTreeView,
+ SwResId(STR_CONTENT_TYPE_DRAWOBJECT), aName);
+ else
+ {
+ // clear treeview selections
+ m_xTreeView->unselect_all();
+ Select();
+ }
+ }
+ else
+ {
+ // clear treeview selections
+ m_xTreeView->unselect_all();
+ Select();
}
return;
}