--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sfx2/source/dialog/cfg.cxx	2006-05-02 17:30:58.000000000 +0100
+++ sfx2/source/dialog/cfg.cxx	2006-06-25 15:27:33.000000000 +0100
@@ -1001,6 +1001,19 @@ void SfxConfigGroupListBox_Impl::Init(co
 						{
 							bIsRootNode = TRUE;
 						}
+						::rtl::OUString currentDocTitle;
+						::rtl::OUString sModelTitle;
+						SfxObjectShell* pCurrentDoc = SfxObjectShell::GetWorkingDocument();
+						if ( pCurrentDoc )
+						{
+							currentDocTitle = pCurrentDoc->GetTitle();
+                            sModelTitle = xModelToDocTitle( pCurrentDoc->GetModel() ); 
+						}
+
+						if ( currentDocTitle.getLength() == 0 && sModelTitle.getLength() != 0 )
+						{
+							currentDocTitle = sModelTitle;
+						}
 
                         for ( sal_Int32 n = 0; n < children.getLength(); n++ )
 						{
@@ -1012,31 +1025,20 @@ void SfxConfigGroupListBox_Impl::Init(co
 							//set the bDisplay flag to FALSE if the current
 							//node is a first level child of the Root and is NOT
 							//either the current document, user or share
-							::rtl::OUString currentDocTitle;
-                       		if ( SfxObjectShell::GetWorkingDocument() )
-							{
-								currentDocTitle = SfxObjectShell::GetWorkingDocument()->GetTitle();
-							}
+
                             ::rtl::OUString uiName = theChild->getName();
 
 							if ( bIsRootNode )
 							{
-								if (  ! ((theChild->getName().equals( user )  ||                                    theChild->getName().equals( share ) ||
-									theChild->getName().equals( currentDocTitle ) ) ) )
-								{
-									bDisplay=FALSE;
-								}
-                                else
-                                {
-                                    if ( uiName.equals( user ) )
-                                    {
-                                        uiName = m_sMyMacros;
-                                    }
-                                    else if ( uiName.equals( share ) )
-                                    {
-                                        uiName = m_sProdMacros;
-                                    }
-                                }
+								if ( uiName.equals( sModelTitle ) )
+									uiName = currentDocTitle;
+
+                                else if ( uiName.equals( user ) )
+                                	uiName = m_sMyMacros;
+                                else if ( uiName.equals( share ) )
+                                 	uiName = m_sProdMacros;
+								else
+									bDisplay = FALSE;
 							}
 							if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT  && bDisplay )
 							{
@@ -1660,6 +1662,15 @@ void SfxConfigGroupListBox_Impl::Request
 							bIsRootNode = TRUE;
 						}
 
+						::rtl::OUString currentDocTitle;
+						::rtl::OUString sModelTitle;
+						SfxObjectShell* pCurrentDoc = SfxObjectShell::GetWorkingDocument();
+						if ( pCurrentDoc )
+						{
+							currentDocTitle = pCurrentDoc->GetTitle();
+                            sModelTitle = xModelToDocTitle( pCurrentDoc->GetModel() ); 
+						}
+						
                         for ( sal_Int32 n = 0; n < children.getLength(); n++ )
 						{
 							Reference< browse::XBrowseNode >& theChild = children[n];
@@ -1670,18 +1681,20 @@ void SfxConfigGroupListBox_Impl::Request
 							set the bDisplay flag to FALSE if the current
 							node is a first level child of the Root and is NOT
 							either the current document, user or share */
-							::rtl::OUString currentDocTitle;
-                       		if ( SfxObjectShell::GetWorkingDocument() )
-							{
-								currentDocTitle = SfxObjectShell::GetWorkingDocument()->GetTitle();
-							}
+
+							::rtl::OUString uiName = theChild->getName();
+
 							if ( bIsRootNode )
 							{
-								if (  ! ((theChild->getName().equals( user )  ||                                    theChild->getName().equals( share ) ||
-									theChild->getName().equals( currentDocTitle ) ) ) )
-								{
-									bDisplay=FALSE;
-								}
+								if ( uiName.equals( sModelTitle ) )
+									uiName = currentDocTitle;
+
+                                else if ( uiName.equals( user ) )
+                                	uiName = m_sMyMacros;
+                                else if ( uiName.equals( share ) )
+                                 	uiName = m_sProdMacros;
+								else
+									bDisplay = FALSE;
 							}
 							if ( children[n].is() && children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay )
 							{
