Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index




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);   
+    }
 }
 
 // ------------------------------------------------------------------------

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.