Browse Source

Redundant check

(WinConfiguration is already used earlier in the same function)

Source commit: 7c6210d0059d7426770397d0bed0539ef2e2440e
Martin Prikryl 2 năm trước cách đây
mục cha
commit
4098f73b0e
1 tập tin đã thay đổi với 4 bổ sung6 xóa
  1. 4 6
      source/windows/UserInterface.cpp

+ 4 - 6
source/windows/UserInterface.cpp

@@ -375,17 +375,15 @@ void __fastcall ShowNotification(TTerminal * Terminal, const UnicodeString & Str
 //---------------------------------------------------------------------------
 void __fastcall ConfigureInterface()
 {
+  DebugAssert(WinConfiguration != NULL);
   int BidiModeFlag =
     AdjustLocaleFlag(LoadStr(BIDI_MODE), WinConfiguration->BidiModeOverride, false, bdRightToLeft, bdLeftToRight);
   Application->BiDiMode = static_cast<TBiDiMode>(BidiModeFlag);
   SetTBXSysParam(TSP_XPVISUALSTYLE, XPVS_AUTOMATIC);
-  if (WinConfiguration != NULL)
+  UnicodeString Theme = WinConfiguration->UseDarkTheme() ? L"DarkOfficeXP" : L"OfficeXP";
+  if (!SameText(TBXCurrentTheme(), Theme))
   {
-    UnicodeString Theme = WinConfiguration->UseDarkTheme() ? L"DarkOfficeXP" : L"OfficeXP";
-    if (!SameText(TBXCurrentTheme(), Theme))
-    {
-      TBXSetTheme(Theme);
-    }
+    TBXSetTheme(Theme);
   }
   // Has any effect on Wine only
   // (otherwise initial UserDocumentDirectory is equivalent to GetPersonalFolder())