Browse Source

Removing some workarounds that are no longer needed in BCB11

- Not sure if the "push -vi" workaround was obsoleted by BCB11, but it does not seem to be needed anymore
- TCustomPathLabel.CMStyleChanged workaround was obsoleted by change in TCustomLabel.CMStyleChanged
- status bar scaling is not implemented in TCustomStatusBar.ChangeScale

Source commit: 7de59e2226d9d96aecb0fc78cef01a6bd6fce1d6
Martin Prikryl 1 year ago
parent
commit
f93e07ca05
3 changed files with 1 additions and 43 deletions
  1. 0 2
      source/core/SftpFileSystem.cpp
  2. 1 15
      source/packages/my/PathLabel.pas
  3. 0 26
      source/windows/VCLCommon.cpp

+ 0 - 2
source/core/SftpFileSystem.cpp

@@ -1421,7 +1421,6 @@ protected:
     return true;
   }
 
-  #pragma option push -vi- // WORKAROUND for internal compiler errors
   bool __fastcall UnregisterReceiveHandler()
   {
     bool Result = FReceiveHandlerRegistered;
@@ -1438,7 +1437,6 @@ protected:
     FFileSystem->FSecureShell->RegisterReceiveHandler(ReceiveHandler);
     FReceiveHandlerRegistered = true;
   }
-  #pragma option pop
 
 private:
   bool FReceiveHandlerRegistered;

+ 1 - 15
source/packages/my/PathLabel.pas

@@ -66,7 +66,6 @@ type
     procedure DoMaskClick;
     procedure DblClick; override;
     procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); override;
-    procedure CMStyleChanged(var Message: TMessage); message CM_STYLECHANGED;
 
   public
     constructor Create(AnOwner: TComponent); override;
@@ -1006,19 +1005,6 @@ begin
   inherited;
 end;
 
-procedure TCustomPathLabel.CMStyleChanged(var Message: TMessage);
-var
-  WasNotTransparent: Boolean;
-begin
-  // WORKAROUND for what seems like a bug in TCustomLabel.CMStyleChanged that unconditionally sets Transparent := True,
-  // when styling is enabled
-  WasNotTransparent := not Transparent;
-  inherited;
-  if WasNotTransparent then
-  begin
-    Transparent := False;
-    Invalidate;
-  end;
-end;
+WORKAROUND
 
 end.

+ 0 - 26
source/windows/VCLCommon.cpp

@@ -942,32 +942,6 @@ void __fastcall ApplySystemSettingsOnControl(TControl * Control)
   VerifyControl(Control);
   #endif
 
-  // WORKAROUND
-  // VCL does not scale status par panels (while for instance it does
-  // scale list view headers). Remove this if they ever "fix" this.
-  // Neither they scale the status bar size if UseSystemFont is true.
-  // they claim it should scale with font size, but it does not,
-  // probably because they eat WM_SIZE in TCustomStatusBar.WMSize.
-  // (used to be issue 83599 on Embarcadero QC, when it was still online)
-  // Check TCustomStatusBar.ChangeScale() for changes.
-  // For TBX status bars, this is implemented in TTBXCustomStatusBar.ChangeScale
-  TStatusBar * StatusBar = dynamic_cast<TStatusBar *>(Control);
-  if (StatusBar != NULL)
-  {
-    // We should have UseSystemFont and bottom alignment set for all status bars.
-    if (DebugAlwaysTrue(StatusBar->UseSystemFont) &&
-        DebugAlwaysTrue(StatusBar->Align == alBottom))
-    {
-      StatusBar->Height = ScaleByTextHeight(StatusBar, StatusBar->Height);
-    }
-
-    for (int Index = 0; Index < StatusBar->Panels->Count; Index++)
-    {
-      TStatusPanel * Panel = StatusBar->Panels->Items[Index];
-      Panel->Width = ScaleByTextHeight(StatusBar, Panel->Width);
-    }
-  }
-
   TCustomListView * ListView = dynamic_cast<TCustomListView *>(Control);
   TCustomIEListView * IEListView = dynamic_cast<TCustomIEListView *>(Control);
   // For IEListView, this is (somewhat) handled in the TCustomListViewColProperties