Hi,

the patch...

Regards
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 9b443e8..5027e7b 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -875,8 +875,6 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
         pStyleFamilies = new SfxStyleFamilies( aFamId );
 
     nActFilter = pCurObjShell ? static_cast< USHORT >( LoadFactoryStyleFilter( 
pCurObjShell ) ) : 0xFFFF;
-    if ( pCurObjShell && 0xFFFF == nActFilter )
-        nActFilter = pCurObjShell->GetAutoStyleFilterIndex();
 
         // Einfuegen in die Toolbox
         // umgekehrte Reihenfolge, da immer vorne eingefuegt wird.
@@ -1496,8 +1494,6 @@ void SfxCommonTemplateDialog_Impl::Update_Impl()
          // andere DocShell -> alles neu
          CheckItem( nActFamily, TRUE );
          nActFilter = static_cast< USHORT >( LoadFactoryStyleFilter( pDocShell 
) );
-         if ( 0xFFFF == nActFilter )
-            nActFilter = pDocShell->GetAutoStyleFilterIndex();
 
          nAppFilter = pItem->GetValue();
          if(!pTreeBox)
@@ -1789,6 +1785,13 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, 
FilterSelectHdl, ListBox *, pBox )
 
             FillTreeBox();
             SelectStyle(aSelectEntry);
+            SfxViewFrame *pViewFrame = 
pBindings->GetDispatcher_Impl()->GetFrame();
+            SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
+            if (pDocShell)
+            {
+                pDocShell->SetAutoStyleFilterIndex(-1);
+                SaveFactoryStyleFilter( pDocShell, -1 );
+            }
             pTreeBox->Show();
         }
     }
@@ -2346,6 +2349,9 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(
 
 {
     pDlgWindow->FreeResource();
+    SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+    pCurObjShell = pViewFrame->GetObjectShell();
+    USHORT nSavedFilter = static_cast< USHORT >( LoadFactoryStyleFilter( 
pCurObjShell ) );
     Initialize();
 
     m_aActionTbL.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, 
ToolBoxLSelect));
@@ -2357,6 +2363,12 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(
     aFont.SetWeight( WEIGHT_NORMAL );
     aFilterLb.SetFont( aFont );
     m_aActionTbL.SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT );
+    if( nSavedFilter == 0xffff  )
+    {
+        bHierarchical = FALSE;
+        aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)));
+        FilterSelectHdl(&aFilterLb);   
+    }
 }
 
 // ------------------------------------------------------------------------
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to