Selaa lähdekoodia

Failure when showing error message before configuration is even created

Source commit: 2116eb044dbf6857dcb21e686aaf74804745c330
Martin Prikryl 8 vuotta sitten
vanhempi
sitoutus
4095f2711a
2 muutettua tiedostoa jossa 13 lisäystä ja 8 poistoa
  1. 3 1
      source/forms/MessageDlg.cpp
  2. 10 7
      source/windows/VCLCommon.cpp

+ 3 - 1
source/forms/MessageDlg.cpp

@@ -1080,7 +1080,9 @@ TForm * __fastcall TMessageForm::Create(const UnicodeString & Msg,
       if (LabelFont != 0)
       if (LabelFont != 0)
       {
       {
         Message->Font->Handle = LabelFont;
         Message->Font->Handle = LabelFont;
-        if (DebugAlwaysTrue(LabelFont == MainInstructionFont))
+        if (DebugAlwaysTrue(LabelFont == MainInstructionFont) &&
+             // When showing an early error message
+            (Configuration != NULL))
         {
         {
           Configuration->Usage->Set(L"ThemeMainInstructionFontSize", Message->Font->Size);
           Configuration->Usage->Set(L"ThemeMainInstructionFontSize", Message->Font->Size);
         }
         }

+ 10 - 7
source/windows/VCLCommon.cpp

@@ -769,16 +769,19 @@ static void FlipAnchors(TControl * Control)
 // Settings that must be set only after whole form is constructed
 // Settings that must be set only after whole form is constructed
 void __fastcall UseSystemSettingsPost(TCustomForm * Control)
 void __fastcall UseSystemSettingsPost(TCustomForm * Control)
 {
 {
-  UnicodeString FlipStr = LoadStr(FLIP_CHILDREN);
-  int FlipChildrenFlag =
-    AdjustLocaleFlag(FlipStr, WinConfiguration->FlipChildrenOverride, false, true, false);
-  if (static_cast<bool>(FlipChildrenFlag))
+  // When showing an early error message
+  if (WinConfiguration != NULL)
   {
   {
-    Control->FlipChildren(true);
+    UnicodeString FlipStr = LoadStr(FLIP_CHILDREN);
+    int FlipChildrenFlag =
+      AdjustLocaleFlag(FlipStr, WinConfiguration->FlipChildrenOverride, false, true, false);
+    if (static_cast<bool>(FlipChildrenFlag))
+    {
+      Control->FlipChildren(true);
 
 
-    FlipAnchors(Control);
+      FlipAnchors(Control);
+    }
   }
   }
-
   ResetSystemSettings(Control);
   ResetSystemSettings(Control);
 };
 };
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------