From d0cf495347a87ca7282a8b38e6bf1e0c606fabe2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 Mar 2007 13:19:43 +0000 Subject: [PATCH] replaced run-time tests for wxRICHTEXT_USE_TOOLBOOK with compile-time ones to avoid warnings about condition being always true/false git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextformatdlg.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index 018bbb7760..93ef4bb597 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -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; } -- 2.45.2