]> git.saurik.com Git - wxWidgets.git/commitdiff
replaced run-time tests for wxRICHTEXT_USE_TOOLBOOK with compile-time ones to avoid...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 13:19:43 +0000 (13:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 13:19:43 +0000 (13:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextformatdlg.cpp

index 018bbb77605fc37086d99412c1b90337907dc8f9..93ef4bb5979e2dd7d7b19876f4d84c23ec2783dc 100644 (file)
@@ -335,20 +335,18 @@ int wxRichTextFormattingDialogFactory::GetPageIdCount() const
 /// Set the sheet style, called at the start of wxRichTextFormattingDialog::Create
 bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog* dialog)
 {
-    bool useToolBook = wxRICHTEXT_USE_TOOLBOOK;
-    if (useToolBook)
-    {
-        int sheetStyle = wxPROPSHEET_SHRINKTOFIT;
+#if wxRICHTEXT_USE_TOOLBOOK
+    int sheetStyle = wxPROPSHEET_SHRINKTOFIT;
 #ifdef __WXMAC__
-        sheetStyle |= wxPROPSHEET_BUTTONTOOLBOOK;
+    sheetStyle |= wxPROPSHEET_BUTTONTOOLBOOK;
 #else
-        sheetStyle |= wxPROPSHEET_TOOLBOOK;
+    sheetStyle |= wxPROPSHEET_TOOLBOOK;
 #endif
 
-        dialog->SetSheetStyle(sheetStyle);
-        dialog->SetSheetInnerBorder(0);
-        dialog->SetSheetOuterBorder(0);
-    }
+    dialog->SetSheetStyle(sheetStyle);
+    dialog->SetSheetInnerBorder(0);
+    dialog->SetSheetOuterBorder(0);
+#endif // wxRICHTEXT_USE_TOOLBOOK
 
     return true;
 }
@@ -356,17 +354,16 @@ bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog
 /// Create the main dialog buttons
 bool wxRichTextFormattingDialogFactory::CreateButtons(wxRichTextFormattingDialog* dialog)
 {
-    bool useToolBook = wxRICHTEXT_USE_TOOLBOOK;
-
-    // If using a toolbook, also follow Mac style and don't create buttons
     int flags = wxOK|wxCANCEL;
 #ifndef __WXWINCE__
     if (dialog->GetWindowStyleFlag() & wxRICHTEXT_FORMAT_HELP_BUTTON)
         flags |= wxHELP;
 #endif
 
-    if (!useToolBook)
-        dialog->CreateButtons(flags);
+    // If using a toolbook, also follow Mac style and don't create buttons
+#if !wxRICHTEXT_USE_TOOLBOOK
+    dialog->CreateButtons(flags);
+#endif
 
     return true;
 }