summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Le Ray <sebastien-libreoffice@orniz.org>2011-03-07 15:55:49 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-07 16:01:28 +0100
commit722586f023c63a4f0f208add61e56a1e5f441ce6 (patch)
tree5c8b39ad0997c4789e579910837d07d3118e7d5f
parent2be280399613be646ae1e0add4dddd51b85acbe2 (diff)
fdo#30917: make the code easier to understand by using constants
-rw-r--r--sfx2/source/dialog/templdlg.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index db41cb6ec5..34e5418aad 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -100,6 +100,13 @@ static USHORT nLastItemId = USHRT_MAX;
// filter box has maximum 12 entries visible
#define MAX_FILTER_ENTRIES 12
+// Special constant to save hierarchical mode
+// We've to use this hack since this is not the
+// index in the filter listbox that is saved but the
+// index in the filters list and hierarchical is not
+// in it
+#define HIERARCHICAL_FILTER_INDEX 0xfffe // 0xffff is reserved
+
//=========================================================================
TYPEINIT0(SfxCommonTemplateDialog_Impl);
@@ -1781,7 +1788,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox )
SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
if (pDocShell)
- SaveFactoryStyleFilter( pDocShell, -2 );
+ SaveFactoryStyleFilter( pDocShell, HIERARCHICAL_FILTER_INDEX );
FillTreeBox();
SelectStyle(aSelectEntry);
pTreeBox->Show();
@@ -2290,9 +2297,9 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(
aFont.SetWeight( WEIGHT_NORMAL );
aFilterLb.SetFont( aFont );
m_aActionTbL.SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT );
- if( nSavedFilter == 0xfffe )
+ if( nSavedFilter == HIERARCHICAL_FILTER_INDEX )
{
- bHierarchical = FALSE;
+ bHierarchical = FALSE; // Force content refresh
aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)));
FilterSelectHdl(&aFilterLb);
}